Rev 109 | Rev 539 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 109 | 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 143... | Line 143... | ||
143 | words2reg ebx,x,xs |
143 | words2reg ebx,x,xs |
144 | words2reg ecx,y,ys |
144 | words2reg ecx,y,ys |
145 | mov edx,id |
145 | mov edx,id |
146 | mov esi,bcolor |
146 | mov esi,bcolor |
147 | mov eax,8 |
147 | mov eax,8 |
148 | int 0x40 |
148 | mcall |
Line 149... | Line 149... | ||
149 | 149 | ||
150 | mov eax,asd-lab ;calc size |
150 | mov eax,asd-lab ;calc size |
151 | mov ebx,6 |
151 | mov ebx,6 |
152 | mul ebx |
152 | mul ebx |
Line 168... | Line 168... | ||
168 | 168 | ||
169 | mov ecx,tcolor ;arg4 color |
169 | mov ecx,tcolor ;arg4 color |
170 | mov edx,lab |
170 | mov edx,lab |
171 | mov esi,asd-lab ;calc size |
171 | mov esi,asd-lab ;calc size |
172 | mov eax,4 |
172 | mov eax,4 |
173 | int 0x40 |
173 | mcall |
Line 174... | Line 174... | ||
174 | } |
174 | } |
175 | 175 | ||
Line 197... | Line 197... | ||
197 | 197 | ||
198 | ; Get my PID in dec format 4 bytes |
198 | ; Get my PID in dec format 4 bytes |
199 | mov eax,9 |
199 | mov eax,9 |
200 | mov ebx,procinfo |
200 | mov ebx,procinfo |
201 | mov ecx,-1 |
201 | mov ecx,-1 |
Line 202... | Line 202... | ||
202 | int 0x40 |
202 | mcall |
203 | 203 | ||
204 | ; convert eax bin to param dec |
204 | ; convert eax bin to param dec |
205 | mov eax,dword [procinfo+30] ;offset of myPID |
205 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 231... | Line 231... | ||
231 | ; define IPC memory |
231 | ; define IPC memory |
232 | mov eax,60 |
232 | mov eax,60 |
233 | mov ebx,1 ; define IPC |
233 | mov ebx,1 ; define IPC |
234 | mov ecx,path ; offset of area |
234 | mov ecx,path ; offset of area |
235 | mov edx,150 ; size 150 bytes |
235 | mov edx,150 ; size 150 bytes |
236 | int 0x40 |
236 | mcall |
Line 237... | Line 237... | ||
237 | 237 | ||
238 | ; change wanted events list 7-bit IPC event |
238 | ; change wanted events list 7-bit IPC event |
239 | mov eax,40 |
239 | mov eax,40 |
240 | mov ebx,01000111b |
240 | mov ebx,01000111b |
Line 241... | Line 241... | ||
241 | int 0x40 |
241 | mcall |
242 | 242 | ||
243 | ; |
243 | ; |
Line 244... | Line 244... | ||
244 | ; STEP 3 run SYSTEM XTREE with parameters |
244 | ; STEP 3 run SYSTEM XTREE with parameters |
245 | ; |
245 | ; |
246 | 246 | ||
Line 247... | Line 247... | ||
247 | mov eax,58 |
247 | mov eax,58 |
Line 248... | Line 248... | ||
248 | mov ebx,run_fileinfo |
248 | mov ebx,run_fileinfo |
249 | int 0x40 |
249 | mcall |
250 | 250 | ||
251 | call redproc |
251 | call redproc |
252 | 252 | ||
Line 253... | Line 253... | ||
253 | mov [get_loops],0 |
253 | mov [get_loops],0 |
254 | getmesloop: |
254 | getmesloop: |
255 | mov eax,23 |
255 | mov eax,23 |
256 | mov ebx,50 ;0.5 sec |
256 | mov ebx,50 ;0.5 sec |
Line 267... | Line 267... | ||
267 | 267 | ||
268 | ; Get number of procces |
268 | ; Get number of procces |
269 | mov ebx,procinfo |
269 | mov ebx,procinfo |
270 | mov ecx,-1 |
270 | mov ecx,-1 |
271 | mov eax,9 |
271 | mov eax,9 |
272 | int 0x40 |
272 | mcall |
Line 273... | Line 273... | ||
273 | mov ebp,eax |
273 | mov ebp,eax |
274 | 274 | ||
275 | loox: |
275 | loox: |
276 | mov eax,9 |
276 | mov eax,9 |
277 | mov ebx,procinfo |
277 | mov ebx,procinfo |
278 | mov ecx,ebp |
278 | mov ecx,ebp |
279 | int 0x40 |
279 | mcall |
280 | mov eax,[DLGPID] |
280 | mov eax,[DLGPID] |
281 | cmp [procinfo+30],eax ;IF Dialog find |
281 | cmp [procinfo+30],eax ;IF Dialog find |
282 | je dlg_is_work ;jmp to dlg_is_work |
282 | je dlg_is_work ;jmp to dlg_is_work |
Line 299... | Line 299... | ||
299 | mred: |
299 | mred: |
300 | call redproc |
300 | call redproc |
301 | jmp getmesloop |
301 | jmp getmesloop |
302 | mkey: |
302 | mkey: |
303 | mov eax,2 |
303 | mov eax,2 |
304 | int 0x40 ; read (eax=2) |
304 | mcall ; read (eax=2) |
305 | jmp getmesloop |
305 | jmp getmesloop |
306 | mbutton: |
306 | mbutton: |
307 | mov eax,17 ; get id |
307 | mov eax,17 ; get id |
308 | int 0x40 |
308 | mcall |
309 | cmp ah,1 ; button id=1 ? |
309 | cmp ah,1 ; button id=1 ? |
310 | jne getmesloop |
310 | jne getmesloop |
311 | mov eax,-1 ; close this program |
311 | mov eax,-1 ; close this program |
312 | int 0x40 |
312 | mcall |
313 | mgetmes: |
313 | mgetmes: |
Line 314... | Line 314... | ||
314 | 314 | ||
315 | ; If dlg_pid_get then second message get jmp to still |
315 | ; If dlg_pid_get then second message get jmp to still |
316 | cmp [dlg_pid_get],dword 1 |
316 | cmp [dlg_pid_get],dword 1 |
Line 409... | Line 409... | ||
409 | 409 | ||
410 | ; Get my PID in dec format 4 bytes |
410 | ; Get my PID in dec format 4 bytes |
411 | mov eax,9 |
411 | mov eax,9 |
412 | mov ebx,procinfo |
412 | mov ebx,procinfo |
413 | mov ecx,-1 |
413 | mov ecx,-1 |
Line 414... | Line 414... | ||
414 | int 0x40 |
414 | mcall |
415 | 415 | ||
416 | ; convert eax bin to param dec |
416 | ; convert eax bin to param dec |
417 | mov eax,dword [procinfo+30] ;offset of myPID |
417 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 443... | Line 443... | ||
443 | ; define IPC memory |
443 | ; define IPC memory |
444 | mov eax,60 |
444 | mov eax,60 |
445 | mov ebx,1 ; define IPC |
445 | mov ebx,1 ; define IPC |
446 | mov ecx,path ; offset of area |
446 | mov ecx,path ; offset of area |
447 | mov edx,120 ; size 150 bytes |
447 | mov edx,120 ; size 150 bytes |
448 | int 0x40 |
448 | mcall |
Line 449... | Line 449... | ||
449 | 449 | ||
450 | ; change wanted events list 7-bit IPC event |
450 | ; change wanted events list 7-bit IPC event |
451 | mov eax,40 |
451 | mov eax,40 |
452 | mov ebx,01000111b |
452 | mov ebx,01000111b |
Line 453... | Line 453... | ||
453 | int 0x40 |
453 | mcall |
454 | 454 | ||
455 | ; |
455 | ; |
Line 456... | Line 456... | ||
456 | ; STEP 3 run SYSTEM XTREE with parameters |
456 | ; STEP 3 run SYSTEM XTREE with parameters |
457 | ; |
457 | ; |
458 | 458 | ||
Line 459... | Line 459... | ||
459 | mov eax,58 |
459 | mov eax,58 |
Line 460... | Line 460... | ||
460 | mov ebx,run_fileinfo |
460 | mov ebx,run_fileinfo |
461 | int 0x40 |
461 | mcall |
462 | 462 | ||
463 | call redproc |
463 | call redproc |
464 | 464 | ||
Line 465... | Line 465... | ||
465 | mov [get_loops],0 |
465 | mov [get_loops],0 |
466 | getmesloop: |
466 | getmesloop: |
467 | mov eax,23 |
467 | mov eax,23 |
468 | mov ebx,50 ;0.5 sec |
468 | mov ebx,50 ;0.5 sec |
Line 479... | Line 479... | ||
479 | 479 | ||
480 | ; Get number of procces |
480 | ; Get number of procces |
481 | mov ebx,procinfo |
481 | mov ebx,procinfo |
482 | mov ecx,-1 |
482 | mov ecx,-1 |
483 | mov eax,9 |
483 | mov eax,9 |
484 | int 0x40 |
484 | mcall |
Line 485... | Line 485... | ||
485 | mov ebp,eax |
485 | mov ebp,eax |
486 | 486 | ||
487 | loox: |
487 | loox: |
488 | mov eax,9 |
488 | mov eax,9 |
489 | mov ebx,procinfo |
489 | mov ebx,procinfo |
490 | mov ecx,ebp |
490 | mov ecx,ebp |
491 | int 0x40 |
491 | mcall |
492 | mov eax,[DLGPID] |
492 | mov eax,[DLGPID] |
493 | cmp [procinfo+30],eax ;IF Dialog find |
493 | cmp [procinfo+30],eax ;IF Dialog find |
494 | je dlg_is_work ;jmp to dlg_is_work |
494 | je dlg_is_work ;jmp to dlg_is_work |
Line 510... | Line 510... | ||
510 | 510 | ||
511 | mred: |
511 | mred: |
512 | call redproc |
512 | call redproc |
513 | jmp getmesloop |
513 | jmp getmesloop |
514 | mkey: |
514 | mkey: |
515 | int 0x40 ; read (eax=2) |
515 | mcall ; read (eax=2) |
516 | jmp getmesloop |
516 | jmp getmesloop |
517 | mbutton: |
517 | mbutton: |
518 | mov eax,17 ; get id |
518 | mov eax,17 ; get id |
519 | int 0x40 |
519 | mcall |
520 | cmp ah,1 ; button id=1 ? |
520 | cmp ah,1 ; button id=1 ? |
521 | jne getmesloop |
521 | jne getmesloop |
522 | mov eax,-1 ; close this program |
522 | mov eax,-1 ; close this program |
523 | int 0x40 |
523 | mcall |
Line 524... | Line 524... | ||
524 | mgetmes: |
524 | mgetmes: |
525 | 525 | ||
526 | ; If dlg_pid_get then second message get jmp to still |
526 | ; If dlg_pid_get then second message get jmp to still |
Line 670... | Line 670... | ||
670 | } |
670 | } |
Line 671... | Line 671... | ||
671 | 671 | ||
672 | macro scank |
672 | macro scank |
673 | { |
673 | { |
674 | mov eax,10 |
674 | mov eax,10 |
675 | int 0x40 |
675 | mcall |
Line 676... | Line 676... | ||
676 | } |
676 | } |
677 | 677 | ||
678 | macro putpix x,y,color |
678 | macro putpix x,y,color |
679 | { |
679 | { |
680 | mov ebx,x |
680 | mov ebx,x |
681 | mov ecx,y |
681 | mov ecx,y |
682 | mov edx,color |
682 | mov edx,color |
683 | mov eax,1 |
683 | mov eax,1 |
Line 684... | Line 684... | ||
684 | int 0x40 |
684 | mcall |
685 | } |
685 | } |
686 | 686 | ||
Line 692... | Line 692... | ||
692 | words2reg ebx,x,y |
692 | words2reg ebx,x,y |
693 | mov ecx,color |
693 | mov ecx,color |
694 | mov edx,offs |
694 | mov edx,offs |
695 | mov esi,size |
695 | mov esi,size |
696 | mov eax,4 |
696 | mov eax,4 |
697 | int 0x40 |
697 | mcall |
698 | } |
698 | } |
Line 699... | Line 699... | ||
699 | 699 | ||
700 | macro outcount data, x, y, color, numtype |
700 | macro outcount data, x, y, color, numtype |
701 | { |
701 | { |
Line 704... | Line 704... | ||
704 | mov bl,0 |
704 | mov bl,0 |
705 | ; mov edx,x*65536+y |
705 | ; mov edx,x*65536+y |
706 | words2reg edx,x,y |
706 | words2reg edx,x,y |
707 | mov esi,color |
707 | mov esi,color |
708 | mov eax,47 |
708 | mov eax,47 |
709 | int 0x40 |
709 | mcall |
710 | } |
710 | } |
Line 711... | Line 711... | ||
711 | 711 | ||
Line 712... | Line 712... | ||
712 | ; SCEVENT - Scan event |
712 | ; SCEVENT - Scan event |
713 | 713 | ||
714 | macro scevent red,key,but |
714 | macro scevent red,key,but |
715 | { |
715 | { |
716 | mov eax,11 |
716 | mov eax,11 |
717 | int 0x40 |
717 | mcall |
718 | dec eax |
718 | dec eax |
719 | jz red |
719 | jz red |
720 | dec eax |
720 | dec eax |
Line 726... | Line 726... | ||
726 | ; WTEVENT - Wait event |
726 | ; WTEVENT - Wait event |
Line 727... | Line 727... | ||
727 | 727 | ||
728 | macro wtevent red,key,but |
728 | macro wtevent red,key,but |
729 | { |
729 | { |
730 | mov eax,10 |
730 | mov eax,10 |
731 | int 0x40 |
731 | mcall |
732 | dec eax |
732 | dec eax |
733 | jz red |
733 | jz red |
734 | dec eax |
734 | dec eax |
735 | jz key |
735 | jz key |
Line 741... | Line 741... | ||
741 | 741 | ||
742 | macro timeevent xfps,noevent,red,key,but |
742 | macro timeevent xfps,noevent,red,key,but |
743 | { |
743 | { |
744 | mov eax,23 |
744 | mov eax,23 |
745 | mov ebx,xfps |
745 | mov ebx,xfps |
746 | int 0x40 |
746 | mcall |
747 | cmp eax,0 |
747 | cmp eax,0 |
748 | je noevent |
748 | je noevent |
749 | dec eax |
749 | dec eax |
750 | jz red |
750 | jz red |
Line 758... | Line 758... | ||
758 | ; CLOSE - Close program |
758 | ; CLOSE - Close program |
Line 759... | Line 759... | ||
759 | 759 | ||
760 | macro close |
760 | macro close |
761 | { |
761 | { |
762 | mov eax,-1 |
762 | mov eax,-1 |
763 | int 0x40 |
763 | mcall |
Line 764... | Line 764... | ||
764 | } |
764 | } |
765 | 765 | ||
766 | ; DELAY - Create delay 1/100 sec |
766 | ; DELAY - Create delay 1/100 sec |
Line 767... | Line 767... | ||
767 | ; (SYNTAX) Delay time |
767 | ; (SYNTAX) Delay time |
768 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
768 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
769 | 769 | ||
770 | macro delay arg1 |
770 | macro delay arg1 |
771 | { |
771 | { |
772 | mov eax,5 |
772 | mov eax,5 |
Line 773... | Line 773... | ||
773 | mov ebx,arg1 |
773 | mov ebx,arg1 |
774 | int 0x40 |
774 | mcall |
775 | } |
775 | } |
Line 784... | Line 784... | ||
784 | ; mov ecx,arg2*65536+arg4 |
784 | ; mov ecx,arg2*65536+arg4 |
785 | words2reg ebx,arg1,arg3 |
785 | words2reg ebx,arg1,arg3 |
786 | words2reg ecx,arg2,arg4 |
786 | words2reg ecx,arg2,arg4 |
787 | mov edx,arg5 |
787 | mov edx,arg5 |
788 | mov eax,0 |
788 | mov eax,0 |
789 | int 0x40 |
789 | mcall |
790 | } |
790 | } |
Line 791... | Line 791... | ||
791 | 791 | ||
792 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
792 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
793 | { |
793 | { |
794 | mov ebx,arg1*65536+arg3 |
794 | mov ebx,arg1*65536+arg3 |
795 | mov ecx,arg2*65536+arg4 |
795 | mov ecx,arg2*65536+arg4 |
796 | mov edx,arg5 |
796 | mov edx,arg5 |
797 | mov esi,arg6 |
797 | mov esi,arg6 |
798 | mov edi,arg7 |
798 | mov edi,arg7 |
799 | mov eax,0 |
799 | mov eax,0 |
800 | int 0x40 |
800 | mcall |
Line 801... | Line 801... | ||
801 | } |
801 | } |
Line 802... | Line 802... | ||
802 | 802 | ||
803 | 803 | ||
804 | ; STARTWD - Start of window draw |
804 | ; STARTWD - Start of window draw |
805 | 805 | ||
806 | macro startwd |
806 | macro startwd |
807 | { |
807 | { |
Line 808... | Line 808... | ||
808 | mov eax,12 |
808 | mov eax,12 |
Line 809... | Line 809... | ||
809 | mov ebx,1 |
809 | mov ebx,1 |
810 | int 0x40 |
810 | mcall |
811 | } |
811 | } |
812 | 812 | ||
813 | ; ENDWD - End window draw |
813 | ; ENDWD - End window draw |
814 | 814 | ||
Line 815... | Line 815... | ||
815 | macro endwd |
815 | macro endwd |
816 | { |
816 | { |
817 | mov eax,12 |
817 | mov eax,12 |
Line 840... | Line 840... | ||
840 | 840 | ||
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 |
Line 845... | Line 845... | ||
845 | int 0x40 |
845 | mcall |
846 | } |
846 | } |
847 | 847 |