Rev 134 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 134 | Rev 485 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | db file_name,0 |
46 | db file_name,0 |
47 | open: |
47 | open: |
48 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
48 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
49 | mov eax,58 |
49 | mov eax,58 |
50 | mov ebx,fileinfo |
50 | mov ebx,fileinfo |
51 | int 0x40 |
51 | mcall |
52 | mov eax,[file_load_area+2] |
52 | mov eax,[file_load_area+2] |
53 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
53 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
54 | inc eax |
54 | inc eax |
55 | mov dword [fileinfo+8],eax |
55 | mov dword [fileinfo+8],eax |
56 | mov eax,58 |
56 | mov eax,58 |
57 | mov ebx,fileinfo |
57 | mov ebx,fileinfo |
58 | int 0x40 |
58 | mcall |
59 | } |
59 | } |
Line 60... | Line 60... | ||
60 | 60 | ||
61 | 61 | ||
Line 88... | Line 88... | ||
88 | wordstoreg ebx,x,xs |
88 | wordstoreg ebx,x,xs |
89 | wordstoreg ecx,y,ys |
89 | wordstoreg ecx,y,ys |
90 | mov edx,id |
90 | mov edx,id |
91 | mov esi,bcolor |
91 | mov esi,bcolor |
92 | mov eax,8 |
92 | mov eax,8 |
93 | int 0x40 |
93 | mcall |
Line 94... | Line 94... | ||
94 | 94 | ||
95 | mov eax,asd-lab ;calc size |
95 | mov eax,asd-lab ;calc size |
96 | mov ebx,6 |
96 | mov ebx,6 |
97 | mul ebx |
97 | mul ebx |
Line 113... | Line 113... | ||
113 | 113 | ||
114 | mov ecx,tcolor ;arg4 color |
114 | mov ecx,tcolor ;arg4 color |
115 | mov edx,lab |
115 | mov edx,lab |
116 | mov esi,asd-lab ;calc size |
116 | mov esi,asd-lab ;calc size |
117 | mov eax,4 |
117 | mov eax,4 |
118 | int 0x40 |
118 | mcall |
Line 119... | Line 119... | ||
119 | } |
119 | } |
120 | 120 | ||
Line 142... | Line 142... | ||
142 | 142 | ||
143 | ; Get my PID in dec format 4 bytes |
143 | ; Get my PID in dec format 4 bytes |
144 | mov eax,9 |
144 | mov eax,9 |
145 | mov ebx,procinfo |
145 | mov ebx,procinfo |
146 | mov ecx,-1 |
146 | mov ecx,-1 |
Line 147... | Line 147... | ||
147 | int 0x40 |
147 | mcall |
148 | 148 | ||
149 | ; convert eax bin to param dec |
149 | ; convert eax bin to param dec |
150 | mov eax,dword [procinfo+30] ;offset of myPID |
150 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 176... | Line 176... | ||
176 | ; define IPC memory |
176 | ; define IPC memory |
177 | mov eax,60 |
177 | mov eax,60 |
178 | mov ebx,1 ; define IPC |
178 | mov ebx,1 ; define IPC |
179 | mov ecx,path ; offset of area |
179 | mov ecx,path ; offset of area |
180 | mov edx,1024+16 ; size |
180 | mov edx,1024+16 ; size |
181 | int 0x40 |
181 | mcall |
Line 182... | Line 182... | ||
182 | 182 | ||
183 | ; change wanted events list 7-bit IPC event |
183 | ; change wanted events list 7-bit IPC event |
184 | mov eax,40 |
184 | mov eax,40 |
185 | mov ebx,01000111b |
185 | mov ebx,01000111b |
Line 186... | Line 186... | ||
186 | int 0x40 |
186 | mcall |
187 | 187 | ||
188 | ; |
188 | ; |
Line 189... | Line 189... | ||
189 | ; STEP 3 run SYSTEM XTREE with parameters |
189 | ; STEP 3 run SYSTEM XTREE with parameters |
190 | ; |
190 | ; |
191 | 191 | ||
Line 192... | Line 192... | ||
192 | mov eax,70 |
192 | mov eax,70 |
Line 193... | Line 193... | ||
193 | mov ebx,run_fileinfo |
193 | mov ebx,run_fileinfo |
194 | int 0x40 |
194 | mcall |
195 | 195 | ||
196 | call redproc |
196 | call redproc |
197 | 197 | ||
198 | mov [get_loops],0 |
198 | mov [get_loops],0 |
199 | getmesloop: |
199 | getmesloop: |
200 | mov eax,23 |
200 | mov eax,23 |
201 | mov ebx,50 ;0.5 sec |
201 | mov ebx,50 ;0.5 sec |
202 | int 0x40 |
202 | mcall |
Line 211... | Line 211... | ||
211 | 211 | ||
212 | ; Get number of procces |
212 | ; Get number of procces |
213 | mov ebx,procinfo |
213 | mov ebx,procinfo |
214 | mov ecx,-1 |
214 | mov ecx,-1 |
215 | mov eax,9 |
215 | mov eax,9 |
216 | int 0x40 |
216 | mcall |
Line 217... | Line 217... | ||
217 | mov ebp,eax |
217 | mov ebp,eax |
218 | 218 | ||
219 | loox: |
219 | loox: |
220 | mov eax,9 |
220 | mov eax,9 |
221 | mov ebx,procinfo |
221 | mov ebx,procinfo |
222 | mov ecx,ebp |
222 | mov ecx,ebp |
223 | int 0x40 |
223 | mcall |
224 | mov eax,[DLGPID] |
224 | mov eax,[DLGPID] |
225 | cmp [procinfo+30],eax ;IF Dialog find |
225 | cmp [procinfo+30],eax ;IF Dialog find |
226 | je dlg_is_work ;jmp to dlg_is_work |
226 | je dlg_is_work ;jmp to dlg_is_work |
Line 243... | Line 243... | ||
243 | mred: |
243 | mred: |
244 | call redproc |
244 | call redproc |
245 | jmp getmesloop |
245 | jmp getmesloop |
246 | mkey: |
246 | mkey: |
247 | mov eax,2 |
247 | mov eax,2 |
248 | int 0x40 ; read (eax=2) |
248 | mcall ; read (eax=2) |
249 | jmp getmesloop |
249 | jmp getmesloop |
250 | mbutton: |
250 | mbutton: |
251 | mov eax,17 ; get id |
251 | mov eax,17 ; get id |
252 | int 0x40 |
252 | mcall |
253 | cmp ah,1 ; button id=1 ? |
253 | cmp ah,1 ; button id=1 ? |
254 | jne getmesloop |
254 | jne getmesloop |
255 | mov eax,-1 ; close this program |
255 | mov eax,-1 ; close this program |
256 | int 0x40 |
256 | mcall |
257 | mgetmes: |
257 | mgetmes: |
Line 258... | Line 258... | ||
258 | 258 | ||
259 | ; If dlg_pid_get then second message get jmp to still |
259 | ; If dlg_pid_get then second message get jmp to still |
260 | cmp [dlg_pid_get],dword 1 |
260 | cmp [dlg_pid_get],dword 1 |
Line 353... | Line 353... | ||
353 | 353 | ||
354 | ; Get my PID in dec format 4 bytes |
354 | ; Get my PID in dec format 4 bytes |
355 | mov eax,9 |
355 | mov eax,9 |
356 | mov ebx,procinfo |
356 | mov ebx,procinfo |
357 | mov ecx,-1 |
357 | mov ecx,-1 |
Line 358... | Line 358... | ||
358 | int 0x40 |
358 | mcall |
359 | 359 | ||
360 | ; convert eax bin to param dec |
360 | ; convert eax bin to param dec |
361 | mov eax,dword [procinfo+30] ;offset of myPID |
361 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 387... | Line 387... | ||
387 | ; define IPC memory |
387 | ; define IPC memory |
388 | mov eax,60 |
388 | mov eax,60 |
389 | mov ebx,1 ; define IPC |
389 | mov ebx,1 ; define IPC |
390 | mov ecx,path ; offset of area |
390 | mov ecx,path ; offset of area |
391 | mov edx,1024+16 ; size |
391 | mov edx,1024+16 ; size |
392 | int 0x40 |
392 | mcall |
Line 393... | Line 393... | ||
393 | 393 | ||
394 | ; change wanted events list 7-bit IPC event |
394 | ; change wanted events list 7-bit IPC event |
395 | mov eax,40 |
395 | mov eax,40 |
396 | mov ebx,01000111b |
396 | mov ebx,01000111b |
Line 397... | Line 397... | ||
397 | int 0x40 |
397 | mcall |
398 | 398 | ||
399 | ; |
399 | ; |
Line 400... | Line 400... | ||
400 | ; STEP 3 run SYSTEM XTREE with parameters |
400 | ; STEP 3 run SYSTEM XTREE with parameters |
401 | ; |
401 | ; |
402 | 402 | ||
Line 403... | Line 403... | ||
403 | mov eax,70 |
403 | mov eax,70 |
Line 404... | Line 404... | ||
404 | mov ebx,run_fileinfo |
404 | mov ebx,run_fileinfo |
405 | int 0x40 |
405 | mcall |
406 | 406 | ||
407 | call redproc |
407 | call redproc |
408 | 408 | ||
409 | mov [get_loops],0 |
409 | mov [get_loops],0 |
410 | getmesloop: |
410 | getmesloop: |
411 | mov eax,23 |
411 | mov eax,23 |
412 | mov ebx,50 ;0.5 sec |
412 | mov ebx,50 ;0.5 sec |
413 | int 0x40 |
413 | mcall |
Line 422... | Line 422... | ||
422 | 422 | ||
423 | ; Get number of procces |
423 | ; Get number of procces |
424 | mov ebx,procinfo |
424 | mov ebx,procinfo |
425 | mov ecx,-1 |
425 | mov ecx,-1 |
426 | mov eax,9 |
426 | mov eax,9 |
427 | int 0x40 |
427 | mcall |
Line 428... | Line 428... | ||
428 | mov ebp,eax |
428 | mov ebp,eax |
429 | 429 | ||
430 | loox: |
430 | loox: |
431 | mov eax,9 |
431 | mov eax,9 |
432 | mov ebx,procinfo |
432 | mov ebx,procinfo |
433 | mov ecx,ebp |
433 | mov ecx,ebp |
434 | int 0x40 |
434 | mcall |
435 | mov eax,[DLGPID] |
435 | mov eax,[DLGPID] |
436 | cmp [procinfo+30],eax ;IF Dialog find |
436 | cmp [procinfo+30],eax ;IF Dialog find |
437 | je dlg_is_work ;jmp to dlg_is_work |
437 | je dlg_is_work ;jmp to dlg_is_work |
Line 454... | Line 454... | ||
454 | mred: |
454 | mred: |
455 | call redproc |
455 | call redproc |
456 | jmp getmesloop |
456 | jmp getmesloop |
457 | mkey: |
457 | mkey: |
458 | mov eax,2 |
458 | mov eax,2 |
459 | int 0x40 ; read (eax=2) |
459 | mcall ; read (eax=2) |
460 | jmp getmesloop |
460 | jmp getmesloop |
461 | mbutton: |
461 | mbutton: |
462 | mov eax,17 ; get id |
462 | mov eax,17 ; get id |
463 | int 0x40 |
463 | mcall |
464 | cmp ah,1 ; button id=1 ? |
464 | cmp ah,1 ; button id=1 ? |
465 | jne getmesloop |
465 | jne getmesloop |
466 | mov eax,-1 ; close this program |
466 | mov eax,-1 ; close this program |
467 | int 0x40 |
467 | mcall |
468 | mgetmes: |
468 | mgetmes: |
Line 469... | Line 469... | ||
469 | 469 | ||
470 | ; If dlg_pid_get then second message get jmp to still |
470 | ; If dlg_pid_get then second message get jmp to still |
471 | cmp [dlg_pid_get],dword 1 |
471 | cmp [dlg_pid_get],dword 1 |
Line 615... | Line 615... | ||
615 | } |
615 | } |
Line 616... | Line 616... | ||
616 | 616 | ||
617 | macro scank |
617 | macro scank |
618 | { |
618 | { |
619 | mov eax,10 |
619 | mov eax,10 |
620 | int 0x40 |
620 | mcall |
Line 621... | Line 621... | ||
621 | } |
621 | } |
622 | 622 | ||
623 | macro putpix x,y,color |
623 | macro putpix x,y,color |
624 | { |
624 | { |
625 | mov ebx,x |
625 | mov ebx,x |
626 | mov ecx,y |
626 | mov ecx,y |
627 | mov edx,color |
627 | mov edx,color |
628 | mov eax,1 |
628 | mov eax,1 |
Line 629... | Line 629... | ||
629 | int 0x40 |
629 | mcall |
630 | } |
630 | } |
631 | 631 | ||
Line 637... | Line 637... | ||
637 | wordstoreg ebx,x,y |
637 | wordstoreg ebx,x,y |
638 | mov ecx,color |
638 | mov ecx,color |
639 | mov edx,offs |
639 | mov edx,offs |
640 | mov esi,size |
640 | mov esi,size |
641 | mov eax,4 |
641 | mov eax,4 |
642 | int 0x40 |
642 | mcall |
643 | } |
643 | } |
Line 644... | Line 644... | ||
644 | 644 | ||
645 | macro outcount data, x, y, color, numtype |
645 | macro outcount data, x, y, color, numtype |
646 | { |
646 | { |
Line 649... | Line 649... | ||
649 | mov bl,0 |
649 | mov bl,0 |
650 | ; mov edx,x*65536+y |
650 | ; mov edx,x*65536+y |
651 | wordstoreg edx,x,y |
651 | wordstoreg edx,x,y |
652 | mov esi,color |
652 | mov esi,color |
653 | mov eax,47 |
653 | mov eax,47 |
654 | int 0x40 |
654 | mcall |
655 | } |
655 | } |
Line 656... | Line 656... | ||
656 | 656 | ||
Line 657... | Line 657... | ||
657 | ; SCEVENT - Scan event |
657 | ; SCEVENT - Scan event |
658 | 658 | ||
659 | macro scevent red,key,but |
659 | macro scevent red,key,but |
660 | { |
660 | { |
661 | mov eax,11 |
661 | mov eax,11 |
662 | int 0x40 |
662 | mcall |
663 | dec eax |
663 | dec eax |
664 | jz red |
664 | jz red |
665 | dec eax |
665 | dec eax |
Line 671... | Line 671... | ||
671 | ; WTEVENT - Wait event |
671 | ; WTEVENT - Wait event |
Line 672... | Line 672... | ||
672 | 672 | ||
673 | macro wtevent red,key,but |
673 | macro wtevent red,key,but |
674 | { |
674 | { |
675 | mov eax,10 |
675 | mov eax,10 |
676 | int 0x40 |
676 | mcall |
677 | dec eax |
677 | dec eax |
678 | jz red |
678 | jz red |
679 | dec eax |
679 | dec eax |
680 | jz key |
680 | jz key |
Line 686... | Line 686... | ||
686 | 686 | ||
687 | macro timeevent xfps,noevent,red,key,but |
687 | macro timeevent xfps,noevent,red,key,but |
688 | { |
688 | { |
689 | mov eax,23 |
689 | mov eax,23 |
690 | mov ebx,xfps |
690 | mov ebx,xfps |
691 | int 0x40 |
691 | mcall |
692 | cmp eax,0 |
692 | cmp eax,0 |
693 | je noevent |
693 | je noevent |
694 | dec eax |
694 | dec eax |
695 | jz red |
695 | jz red |
Line 703... | Line 703... | ||
703 | ; CLOSE - Close program |
703 | ; CLOSE - Close program |
Line 704... | Line 704... | ||
704 | 704 | ||
705 | macro close |
705 | macro close |
706 | { |
706 | { |
707 | mov eax,-1 |
707 | mov eax,-1 |
708 | int 0x40 |
708 | mcall |
Line 709... | Line 709... | ||
709 | } |
709 | } |
710 | 710 | ||
711 | ; DELAY - Create delay 1/100 sec |
711 | ; DELAY - Create delay 1/100 sec |
Line 712... | Line 712... | ||
712 | ; (SYNTAX) Delay time |
712 | ; (SYNTAX) Delay time |
713 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
713 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
714 | 714 | ||
715 | macro delay arg1 |
715 | macro delay arg1 |
716 | { |
716 | { |
717 | mov eax,5 |
717 | mov eax,5 |
Line 718... | Line 718... | ||
718 | mov ebx,arg1 |
718 | mov ebx,arg1 |
719 | int 0x40 |
719 | mcall |
720 | } |
720 | } |
Line 729... | Line 729... | ||
729 | ; mov ecx,arg2*65536+arg4 |
729 | ; mov ecx,arg2*65536+arg4 |
730 | wordstoreg ebx,arg1,arg3 |
730 | wordstoreg ebx,arg1,arg3 |
731 | wordstoreg ecx,arg2,arg4 |
731 | wordstoreg ecx,arg2,arg4 |
732 | mov edx,arg5 |
732 | mov edx,arg5 |
733 | mov eax,0 |
733 | mov eax,0 |
734 | int 0x40 |
734 | mcall |
735 | } |
735 | } |
Line 736... | Line 736... | ||
736 | 736 | ||
737 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
737 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
738 | { |
738 | { |
739 | mov ebx,arg1*65536+arg3 |
739 | mov ebx,arg1*65536+arg3 |
740 | mov ecx,arg2*65536+arg4 |
740 | mov ecx,arg2*65536+arg4 |
741 | mov edx,arg5 |
741 | mov edx,arg5 |
742 | mov esi,arg6 |
742 | mov esi,arg6 |
743 | mov edi,arg7 |
743 | mov edi,arg7 |
744 | mov eax,0 |
744 | mov eax,0 |
745 | int 0x40 |
745 | mcall |
Line 746... | Line 746... | ||
746 | } |
746 | } |
Line 747... | Line 747... | ||
747 | 747 | ||
748 | 748 | ||
749 | ; STARTWD - Start of window draw |
749 | ; STARTWD - Start of window draw |
750 | 750 | ||
751 | macro startwd |
751 | macro startwd |
752 | { |
752 | { |
Line 753... | Line 753... | ||
753 | mov eax,12 |
753 | mov eax,12 |
Line 754... | Line 754... | ||
754 | mov ebx,1 |
754 | mov ebx,1 |
755 | int 0x40 |
755 | mcall |
756 | } |
756 | } |
757 | 757 | ||
758 | ; ENDWD - End window draw |
758 | ; ENDWD - End window draw |
759 | 759 | ||
Line 760... | Line 760... | ||
760 | macro endwd |
760 | macro endwd |
761 | { |
761 | { |
762 | mov eax,12 |
762 | mov eax,12 |
Line 763... | Line -... | ||
763 | mov ebx,2 |
- | |
764 | int 0x40 |
- | |
765 | } |
- | |
766 | - | ||
767 | ; LABEL - Put text to frame |
- | |
768 | ; (SYNTAX) LABEL Xstart,Ystart,'Text',Color |
- | |
769 | ; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big |
- | |
770 | - | ||
771 | macro label arg1,arg2,arg3,arg4 |
- | |
772 | { |
- | |
773 | local asd,lab |
- | |
774 | jmp asd |
- | |
775 | lab db arg3 ;arg label |
- | |
776 | asd: |
- | |
777 | ; mov ebx,arg1 ;arg1=y arg2=x |
- | |
778 | ; shl ebx,16 |
- | |
Line 779... | Line 763... | ||
779 | ; add ebx,arg2 |
763 | mov ebx,2 |
780 | wordstoreg ebx,arg1,arg2 |
764 | mcall |
781 | mov ecx,arg4 ;arg4 color |
765 | } |
782 | mov edx,lab |
766 |