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 48... | Line 48... | ||
48 | db file_name,0 |
48 | db file_name,0 |
49 | open: |
49 | open: |
50 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
50 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
51 | mov eax,58 |
51 | mov eax,58 |
52 | mov ebx,fileinfo |
52 | mov ebx,fileinfo |
53 | int 0x40 |
53 | mcall |
54 | mov eax,[file_load_area+2] |
54 | mov eax,[file_load_area+2] |
55 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
55 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
56 | inc eax |
56 | inc eax |
57 | mov dword [fileinfo+8],eax |
57 | mov dword [fileinfo+8],eax |
58 | mov eax,58 |
58 | mov eax,58 |
59 | mov ebx,fileinfo |
59 | mov ebx,fileinfo |
60 | int 0x40 |
60 | mcall |
61 | } |
61 | } |
Line 62... | Line 62... | ||
62 | 62 | ||
63 | 63 | ||
Line 141... | Line 141... | ||
141 | words2reg ebx,x,xs |
141 | words2reg ebx,x,xs |
142 | words2reg ecx,y,ys |
142 | words2reg ecx,y,ys |
143 | mov edx,id |
143 | mov edx,id |
144 | mov esi,bcolor |
144 | mov esi,bcolor |
145 | mov eax,8 |
145 | mov eax,8 |
146 | int 0x40 |
146 | mcall |
Line 147... | Line 147... | ||
147 | 147 | ||
148 | mov eax,asd-lab ;calc size |
148 | mov eax,asd-lab ;calc size |
149 | mov ebx,6 |
149 | mov ebx,6 |
150 | mul ebx |
150 | mul ebx |
Line 166... | Line 166... | ||
166 | 166 | ||
167 | mov ecx,tcolor ;arg4 color |
167 | mov ecx,tcolor ;arg4 color |
168 | mov edx,lab |
168 | mov edx,lab |
169 | mov esi,asd-lab ;calc size |
169 | mov esi,asd-lab ;calc size |
170 | mov eax,4 |
170 | mov eax,4 |
171 | int 0x40 |
171 | mcall |
Line 172... | Line 172... | ||
172 | } |
172 | } |
173 | 173 | ||
Line 195... | Line 195... | ||
195 | 195 | ||
196 | ; Get my PID in dec format 4 bytes |
196 | ; Get my PID in dec format 4 bytes |
197 | mov eax,9 |
197 | mov eax,9 |
198 | mov ebx,procinfo |
198 | mov ebx,procinfo |
199 | mov ecx,-1 |
199 | mov ecx,-1 |
Line 200... | Line 200... | ||
200 | int 0x40 |
200 | mcall |
201 | 201 | ||
202 | ; convert eax bin to param dec |
202 | ; convert eax bin to param dec |
203 | mov eax,dword [procinfo+30] ;offset of myPID |
203 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 229... | Line 229... | ||
229 | ; define IPC memory |
229 | ; define IPC memory |
230 | mov eax,60 |
230 | mov eax,60 |
231 | mov ebx,1 ; define IPC |
231 | mov ebx,1 ; define IPC |
232 | mov ecx,path ; offset of area |
232 | mov ecx,path ; offset of area |
233 | mov edx,1024+16 ; size |
233 | mov edx,1024+16 ; size |
234 | int 0x40 |
234 | mcall |
Line 235... | Line 235... | ||
235 | 235 | ||
236 | ; change wanted events list 7-bit IPC event |
236 | ; change wanted events list 7-bit IPC event |
237 | mov eax,40 |
237 | mov eax,40 |
238 | mov ebx,01000111b |
238 | mov ebx,01000111b |
Line 239... | Line 239... | ||
239 | int 0x40 |
239 | mcall |
240 | 240 | ||
241 | ; |
241 | ; |
Line 242... | Line 242... | ||
242 | ; STEP 3 run SYSTEM XTREE with parameters |
242 | ; STEP 3 run SYSTEM XTREE with parameters |
243 | ; |
243 | ; |
244 | 244 | ||
Line 245... | Line 245... | ||
245 | mov eax,70 |
245 | mov eax,70 |
Line 246... | Line 246... | ||
246 | mov ebx,run_fileinfo |
246 | mov ebx,run_fileinfo |
247 | int 0x40 |
247 | mcall |
248 | 248 | ||
249 | call redproc |
249 | call redproc |
250 | 250 | ||
251 | mov [get_loops],0 |
251 | mov [get_loops],0 |
252 | getmesloop: |
252 | getmesloop: |
253 | mov eax,23 |
253 | mov eax,23 |
254 | mov ebx,50 ;0.5 sec |
254 | mov ebx,50 ;0.5 sec |
255 | int 0x40 |
255 | mcall |
Line 264... | Line 264... | ||
264 | 264 | ||
265 | ; Get number of procces |
265 | ; Get number of procces |
266 | mov ebx,procinfo |
266 | mov ebx,procinfo |
267 | mov ecx,-1 |
267 | mov ecx,-1 |
268 | mov eax,9 |
268 | mov eax,9 |
269 | int 0x40 |
269 | mcall |
Line 270... | Line 270... | ||
270 | mov ebp,eax |
270 | mov ebp,eax |
271 | 271 | ||
272 | loox: |
272 | loox: |
273 | mov eax,9 |
273 | mov eax,9 |
274 | mov ebx,procinfo |
274 | mov ebx,procinfo |
275 | mov ecx,ebp |
275 | mov ecx,ebp |
276 | int 0x40 |
276 | mcall |
277 | mov eax,[DLGPID] |
277 | mov eax,[DLGPID] |
278 | cmp [procinfo+30],eax ;IF Dialog find |
278 | cmp [procinfo+30],eax ;IF Dialog find |
279 | je dlg_is_work ;jmp to dlg_is_work |
279 | je dlg_is_work ;jmp to dlg_is_work |
Line 296... | Line 296... | ||
296 | mred: |
296 | mred: |
297 | call redproc |
297 | call redproc |
298 | jmp getmesloop |
298 | jmp getmesloop |
299 | mkey: |
299 | mkey: |
300 | mov eax,2 |
300 | mov eax,2 |
301 | int 0x40 ; read (eax=2) |
301 | mcall ; read (eax=2) |
302 | jmp getmesloop |
302 | jmp getmesloop |
303 | mbutton: |
303 | mbutton: |
304 | mov eax,17 ; get id |
304 | mov eax,17 ; get id |
305 | int 0x40 |
305 | mcall |
306 | cmp ah,1 ; button id=1 ? |
306 | cmp ah,1 ; button id=1 ? |
307 | jne getmesloop |
307 | jne getmesloop |
308 | mov eax,-1 ; close this program |
308 | mov eax,-1 ; close this program |
309 | int 0x40 |
309 | mcall |
310 | mgetmes: |
310 | mgetmes: |
Line 311... | Line 311... | ||
311 | 311 | ||
312 | ; If dlg_pid_get then second message get jmp to still |
312 | ; If dlg_pid_get then second message get jmp to still |
313 | cmp [dlg_pid_get],dword 1 |
313 | cmp [dlg_pid_get],dword 1 |
Line 406... | Line 406... | ||
406 | 406 | ||
407 | ; Get my PID in dec format 4 bytes |
407 | ; Get my PID in dec format 4 bytes |
408 | mov eax,9 |
408 | mov eax,9 |
409 | mov ebx,procinfo |
409 | mov ebx,procinfo |
410 | mov ecx,-1 |
410 | mov ecx,-1 |
Line 411... | Line 411... | ||
411 | int 0x40 |
411 | mcall |
412 | 412 | ||
413 | ; convert eax bin to param dec |
413 | ; convert eax bin to param dec |
414 | mov eax,dword [procinfo+30] ;offset of myPID |
414 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 440... | Line 440... | ||
440 | ; define IPC memory |
440 | ; define IPC memory |
441 | mov eax,60 |
441 | mov eax,60 |
442 | mov ebx,1 ; define IPC |
442 | mov ebx,1 ; define IPC |
443 | mov ecx,path ; offset of area |
443 | mov ecx,path ; offset of area |
444 | mov edx,1024+16 ; size |
444 | mov edx,1024+16 ; size |
445 | int 0x40 |
445 | mcall |
Line 446... | Line 446... | ||
446 | 446 | ||
447 | ; change wanted events list 7-bit IPC event |
447 | ; change wanted events list 7-bit IPC event |
448 | mov eax,40 |
448 | mov eax,40 |
449 | mov ebx,01000111b |
449 | mov ebx,01000111b |
Line 450... | Line 450... | ||
450 | int 0x40 |
450 | mcall |
451 | 451 | ||
452 | ; |
452 | ; |
Line 453... | Line 453... | ||
453 | ; STEP 3 run SYSTEM XTREE with parameters |
453 | ; STEP 3 run SYSTEM XTREE with parameters |
454 | ; |
454 | ; |
455 | 455 | ||
Line 456... | Line 456... | ||
456 | mov eax,70 |
456 | mov eax,70 |
Line 457... | Line 457... | ||
457 | mov ebx,run_fileinfo |
457 | mov ebx,run_fileinfo |
458 | int 0x40 |
458 | mcall |
459 | 459 | ||
460 | call redproc |
460 | call redproc |
461 | 461 | ||
462 | mov [get_loops],0 |
462 | mov [get_loops],0 |
463 | getmesloop: |
463 | getmesloop: |
464 | mov eax,23 |
464 | mov eax,23 |
465 | mov ebx,50 ;0.5 sec |
465 | mov ebx,50 ;0.5 sec |
466 | int 0x40 |
466 | mcall |
Line 475... | Line 475... | ||
475 | 475 | ||
476 | ; Get number of procces |
476 | ; Get number of procces |
477 | mov ebx,procinfo |
477 | mov ebx,procinfo |
478 | mov ecx,-1 |
478 | mov ecx,-1 |
479 | mov eax,9 |
479 | mov eax,9 |
480 | int 0x40 |
480 | mcall |
Line 481... | Line 481... | ||
481 | mov ebp,eax |
481 | mov ebp,eax |
482 | 482 | ||
483 | loox: |
483 | loox: |
484 | mov eax,9 |
484 | mov eax,9 |
485 | mov ebx,procinfo |
485 | mov ebx,procinfo |
486 | mov ecx,ebp |
486 | mov ecx,ebp |
487 | int 0x40 |
487 | mcall |
488 | mov eax,[DLGPID] |
488 | mov eax,[DLGPID] |
489 | cmp [procinfo+30],eax ;IF Dialog find |
489 | cmp [procinfo+30],eax ;IF Dialog find |
490 | je dlg_is_work ;jmp to dlg_is_work |
490 | je dlg_is_work ;jmp to dlg_is_work |
Line 507... | Line 507... | ||
507 | mred: |
507 | mred: |
508 | call redproc |
508 | call redproc |
509 | jmp getmesloop |
509 | jmp getmesloop |
510 | mkey: |
510 | mkey: |
511 | mov eax,2 |
511 | mov eax,2 |
512 | int 0x40 ; read (eax=2) |
512 | mcall ; read (eax=2) |
513 | jmp getmesloop |
513 | jmp getmesloop |
514 | mbutton: |
514 | mbutton: |
515 | mov eax,17 ; get id |
515 | mov eax,17 ; get id |
516 | int 0x40 |
516 | mcall |
517 | cmp ah,1 ; button id=1 ? |
517 | cmp ah,1 ; button id=1 ? |
518 | jne getmesloop |
518 | jne getmesloop |
519 | mov eax,-1 ; close this program |
519 | mov eax,-1 ; close this program |
520 | int 0x40 |
520 | mcall |
521 | mgetmes: |
521 | mgetmes: |
Line 522... | Line 522... | ||
522 | 522 | ||
523 | ; If dlg_pid_get then second message get jmp to still |
523 | ; If dlg_pid_get then second message get jmp to still |
524 | cmp [dlg_pid_get],dword 1 |
524 | cmp [dlg_pid_get],dword 1 |
Line 667... | Line 667... | ||
667 | } |
667 | } |
Line 668... | Line 668... | ||
668 | 668 | ||
669 | macro scank |
669 | macro scank |
670 | { |
670 | { |
671 | mov eax,10 |
671 | mov eax,10 |
672 | int 0x40 |
672 | mcall |
Line 673... | Line 673... | ||
673 | } |
673 | } |
674 | 674 | ||
675 | macro putpix x,y,color |
675 | macro putpix x,y,color |
676 | { |
676 | { |
677 | mov ebx,x |
677 | mov ebx,x |
678 | mov ecx,y |
678 | mov ecx,y |
679 | mov edx,color |
679 | mov edx,color |
680 | mov eax,1 |
680 | mov eax,1 |
Line 681... | Line 681... | ||
681 | int 0x40 |
681 | mcall |
682 | } |
682 | } |
683 | 683 | ||
Line 694... | Line 694... | ||
694 | 694 | ||
695 | ; mov ecx,color |
695 | ; mov ecx,color |
696 | ; mov edx,offs |
696 | ; mov edx,offs |
697 | ; mov esi,size |
697 | ; mov esi,size |
698 | mov eax,4 |
698 | mov eax,4 |
699 | int 0x40 |
699 | mcall |
Line 700... | Line 700... | ||
700 | } |
700 | } |
701 | 701 | ||
702 | macro outcount data, x, y, color, numtype |
702 | macro outcount data, x, y, color, numtype |
Line 706... | Line 706... | ||
706 | mov bl,0 |
706 | mov bl,0 |
707 | ; mov edx,x*65536+y |
707 | ; mov edx,x*65536+y |
708 | words2reg edx,x,y |
708 | words2reg edx,x,y |
709 | mov esi,color |
709 | mov esi,color |
710 | mov eax,47 |
710 | mov eax,47 |
711 | int 0x40 |
711 | mcall |
712 | } |
712 | } |
Line 713... | Line 713... | ||
713 | 713 | ||
Line 714... | Line 714... | ||
714 | ; SCEVENT - Scan event |
714 | ; SCEVENT - Scan event |
715 | 715 | ||
716 | macro scevent red,key,but |
716 | macro scevent red,key,but |
717 | { |
717 | { |
718 | mov eax,11 |
718 | mov eax,11 |
719 | int 0x40 |
719 | mcall |
720 | dec eax |
720 | dec eax |
721 | jz red |
721 | jz red |
722 | dec eax |
722 | dec eax |
Line 728... | Line 728... | ||
728 | ; WTEVENT - Wait event |
728 | ; WTEVENT - Wait event |
Line 729... | Line 729... | ||
729 | 729 | ||
730 | macro wtevent red,key,but |
730 | macro wtevent red,key,but |
731 | { |
731 | { |
732 | mov eax,10 |
732 | mov eax,10 |
733 | int 0x40 |
733 | mcall |
734 | dec eax |
734 | dec eax |
735 | jz red |
735 | jz red |
736 | dec eax |
736 | dec eax |
737 | jz key |
737 | jz key |
Line 743... | Line 743... | ||
743 | 743 | ||
744 | macro timeevent xfps,noevent,red,key,but |
744 | macro timeevent xfps,noevent,red,key,but |
745 | { |
745 | { |
746 | mov eax,23 |
746 | mov eax,23 |
747 | mov ebx,xfps |
747 | mov ebx,xfps |
748 | int 0x40 |
748 | mcall |
749 | cmp eax,0 |
749 | cmp eax,0 |
750 | je noevent |
750 | je noevent |
751 | dec eax |
751 | dec eax |
752 | jz red |
752 | jz red |
Line 760... | Line 760... | ||
760 | ; CLOSE - Close program |
760 | ; CLOSE - Close program |
Line 761... | Line 761... | ||
761 | 761 | ||
762 | macro close |
762 | macro close |
763 | { |
763 | { |
764 | mov eax,-1 |
764 | mov eax,-1 |
765 | int 0x40 |
765 | mcall |
Line 766... | Line 766... | ||
766 | } |
766 | } |
767 | 767 | ||
768 | ; DELAY - Create delay 1/100 sec |
768 | ; DELAY - Create delay 1/100 sec |
Line 769... | Line 769... | ||
769 | ; (SYNTAX) Delay time |
769 | ; (SYNTAX) Delay time |
770 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
770 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
771 | 771 | ||
772 | macro delay arg1 |
772 | macro delay arg1 |
773 | { |
773 | { |
774 | mov eax,5 |
774 | mov eax,5 |
Line 775... | Line 775... | ||
775 | mov ebx,arg1 |
775 | mov ebx,arg1 |
776 | int 0x40 |
776 | mcall |
777 | } |
777 | } |
Line 786... | Line 786... | ||
786 | ; mov ecx,arg2*65536+arg4 |
786 | ; mov ecx,arg2*65536+arg4 |
787 | words2reg ebx,arg1,arg3 |
787 | words2reg ebx,arg1,arg3 |
788 | words2reg ecx,arg2,arg4 |
788 | words2reg ecx,arg2,arg4 |
789 | mov edx,arg5 |
789 | mov edx,arg5 |
790 | mov eax,0 |
790 | mov eax,0 |
791 | int 0x40 |
791 | mcall |
792 | } |
792 | } |
Line 793... | Line 793... | ||
793 | 793 | ||
794 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
794 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
795 | { |
795 | { |
796 | mov ebx,arg1*65536+arg3 |
796 | mov ebx,arg1*65536+arg3 |
797 | mov ecx,arg2*65536+arg4 |
797 | mov ecx,arg2*65536+arg4 |
798 | mov edx,arg5 |
798 | mov edx,arg5 |
799 | mov esi,arg6 |
799 | mov esi,arg6 |
800 | mov edi,arg7 |
800 | mov edi,arg7 |
801 | mov eax,0 |
801 | mov eax,0 |
802 | int 0x40 |
802 | mcall |
Line 803... | Line 803... | ||
803 | } |
803 | } |
Line 804... | Line 804... | ||
804 | 804 | ||
805 | 805 | ||
806 | ; STARTWD - Start of window draw |
806 | ; STARTWD - Start of window draw |
807 | 807 | ||
808 | macro startwd |
808 | macro startwd |
809 | { |
809 | { |
Line 810... | Line 810... | ||
810 | mov eax,12 |
810 | mov eax,12 |
Line 811... | Line 811... | ||
811 | mov ebx,1 |
811 | mov ebx,1 |
812 | int 0x40 |
812 | mcall |
813 | } |
813 | } |
814 | 814 | ||
815 | ; ENDWD - End window draw |
815 | ; ENDWD - End window draw |
816 | 816 | ||
Line 817... | Line 817... | ||
817 | macro endwd |
817 | macro endwd |
818 | { |
818 | { |
819 | mov eax,12 |
819 | mov eax,12 |
Line 840... | Line 840... | ||
840 | dword2reg ecx,arg4 |
840 | dword2reg ecx,arg4 |
Line 841... | Line 841... | ||
841 | 841 | ||
842 | mov edx,lab |
842 | mov edx,lab |
843 | mov esi,asd-lab ;calc size |
843 | mov esi,asd-lab ;calc size |
844 | mov eax,4 |
844 | mov eax,4 |
845 | int 0x40 |
845 | mcall |
Line 846... | Line 846... | ||
846 | } |
846 | } |
847 | 847 | ||
848 | ;Key's |
848 | ;Key's |