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 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 89... | Line 89... | ||
89 | wordstoreg ebx,x,xs |
89 | wordstoreg ebx,x,xs |
90 | wordstoreg ecx,y,ys |
90 | wordstoreg ecx,y,ys |
91 | mov edx,id |
91 | mov edx,id |
92 | mov esi,bcolor |
92 | mov esi,bcolor |
93 | mov eax,8 |
93 | mov eax,8 |
94 | int 0x40 |
94 | mcall |
Line 95... | Line 95... | ||
95 | 95 | ||
96 | mov eax,asd-lab ;calc size |
96 | mov eax,asd-lab ;calc size |
97 | mov ebx,6 |
97 | mov ebx,6 |
98 | mul ebx |
98 | mul ebx |
Line 114... | Line 114... | ||
114 | 114 | ||
115 | mov ecx,tcolor ;arg4 color |
115 | mov ecx,tcolor ;arg4 color |
116 | mov edx,lab |
116 | mov edx,lab |
117 | mov esi,asd-lab ;calc size |
117 | mov esi,asd-lab ;calc size |
118 | mov eax,4 |
118 | mov eax,4 |
119 | int 0x40 |
119 | mcall |
Line 120... | Line 120... | ||
120 | } |
120 | } |
121 | 121 | ||
Line 143... | Line 143... | ||
143 | 143 | ||
144 | ; Get my PID in dec format 4 bytes |
144 | ; Get my PID in dec format 4 bytes |
145 | mov eax,9 |
145 | mov eax,9 |
146 | mov ebx,procinfo |
146 | mov ebx,procinfo |
147 | mov ecx,-1 |
147 | mov ecx,-1 |
Line 148... | Line 148... | ||
148 | int 0x40 |
148 | mcall |
149 | 149 | ||
150 | ; convert eax bin to param dec |
150 | ; convert eax bin to param dec |
151 | mov eax,dword [procinfo+30] ;offset of myPID |
151 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 177... | Line 177... | ||
177 | ; define IPC memory |
177 | ; define IPC memory |
178 | mov eax,60 |
178 | mov eax,60 |
179 | mov ebx,1 ; define IPC |
179 | mov ebx,1 ; define IPC |
180 | mov ecx,path ; offset of area |
180 | mov ecx,path ; offset of area |
181 | mov edx,150 ; size 150 bytes |
181 | mov edx,150 ; size 150 bytes |
182 | int 0x40 |
182 | mcall |
Line 183... | Line 183... | ||
183 | 183 | ||
184 | ; change wanted events list 7-bit IPC event |
184 | ; change wanted events list 7-bit IPC event |
185 | mov eax,40 |
185 | mov eax,40 |
186 | mov ebx,01000111b |
186 | mov ebx,01000111b |
Line 187... | Line 187... | ||
187 | int 0x40 |
187 | mcall |
188 | 188 | ||
189 | ; |
189 | ; |
Line 190... | Line 190... | ||
190 | ; STEP 3 run SYSTEM XTREE with parameters |
190 | ; STEP 3 run SYSTEM XTREE with parameters |
191 | ; |
191 | ; |
192 | 192 | ||
Line 193... | Line 193... | ||
193 | mov eax,58 |
193 | mov eax,58 |
Line 194... | Line 194... | ||
194 | mov ebx,run_fileinfo |
194 | mov ebx,run_fileinfo |
195 | int 0x40 |
195 | mcall |
196 | 196 | ||
197 | call redproc |
197 | call redproc |
198 | 198 | ||
Line 199... | Line 199... | ||
199 | mov [get_loops],0 |
199 | mov [get_loops],0 |
200 | getmesloop: |
200 | getmesloop: |
201 | mov eax,23 |
201 | mov eax,23 |
202 | mov ebx,50 ;0.5 sec |
202 | mov ebx,50 ;0.5 sec |
Line 213... | Line 213... | ||
213 | 213 | ||
214 | ; Get number of procces |
214 | ; Get number of procces |
215 | mov ebx,procinfo |
215 | mov ebx,procinfo |
216 | mov ecx,-1 |
216 | mov ecx,-1 |
217 | mov eax,9 |
217 | mov eax,9 |
218 | int 0x40 |
218 | mcall |
Line 219... | Line 219... | ||
219 | mov ebp,eax |
219 | mov ebp,eax |
220 | 220 | ||
221 | loox: |
221 | loox: |
222 | mov eax,9 |
222 | mov eax,9 |
223 | mov ebx,procinfo |
223 | mov ebx,procinfo |
224 | mov ecx,ebp |
224 | mov ecx,ebp |
225 | int 0x40 |
225 | mcall |
226 | mov eax,[DLGPID] |
226 | mov eax,[DLGPID] |
227 | cmp [procinfo+30],eax ;IF Dialog find |
227 | cmp [procinfo+30],eax ;IF Dialog find |
228 | je dlg_is_work ;jmp to dlg_is_work |
228 | je dlg_is_work ;jmp to dlg_is_work |
Line 245... | Line 245... | ||
245 | mred: |
245 | mred: |
246 | call redproc |
246 | call redproc |
247 | jmp getmesloop |
247 | jmp getmesloop |
248 | mkey: |
248 | mkey: |
249 | mov eax,2 |
249 | mov eax,2 |
250 | int 0x40 ; read (eax=2) |
250 | mcall ; read (eax=2) |
251 | jmp getmesloop |
251 | jmp getmesloop |
252 | mbutton: |
252 | mbutton: |
253 | mov eax,17 ; get id |
253 | mov eax,17 ; get id |
254 | int 0x40 |
254 | mcall |
255 | cmp ah,1 ; button id=1 ? |
255 | cmp ah,1 ; button id=1 ? |
256 | jne getmesloop |
256 | jne getmesloop |
257 | mov eax,-1 ; close this program |
257 | mov eax,-1 ; close this program |
258 | int 0x40 |
258 | mcall |
259 | mgetmes: |
259 | mgetmes: |
Line 260... | Line 260... | ||
260 | 260 | ||
261 | ; If dlg_pid_get then second message get jmp to still |
261 | ; If dlg_pid_get then second message get jmp to still |
262 | cmp [dlg_pid_get],dword 1 |
262 | cmp [dlg_pid_get],dword 1 |
Line 355... | Line 355... | ||
355 | 355 | ||
356 | ; Get my PID in dec format 4 bytes |
356 | ; Get my PID in dec format 4 bytes |
357 | mov eax,9 |
357 | mov eax,9 |
358 | mov ebx,procinfo |
358 | mov ebx,procinfo |
359 | mov ecx,-1 |
359 | mov ecx,-1 |
Line 360... | Line 360... | ||
360 | int 0x40 |
360 | mcall |
361 | 361 | ||
362 | ; convert eax bin to param dec |
362 | ; convert eax bin to param dec |
363 | mov eax,dword [procinfo+30] ;offset of myPID |
363 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 389... | Line 389... | ||
389 | ; define IPC memory |
389 | ; define IPC memory |
390 | mov eax,60 |
390 | mov eax,60 |
391 | mov ebx,1 ; define IPC |
391 | mov ebx,1 ; define IPC |
392 | mov ecx,path ; offset of area |
392 | mov ecx,path ; offset of area |
393 | mov edx,120 ; size 150 bytes |
393 | mov edx,120 ; size 150 bytes |
394 | int 0x40 |
394 | mcall |
Line 395... | Line 395... | ||
395 | 395 | ||
396 | ; change wanted events list 7-bit IPC event |
396 | ; change wanted events list 7-bit IPC event |
397 | mov eax,40 |
397 | mov eax,40 |
398 | mov ebx,01000111b |
398 | mov ebx,01000111b |
Line 399... | Line 399... | ||
399 | int 0x40 |
399 | mcall |
400 | 400 | ||
401 | ; |
401 | ; |
Line 402... | Line 402... | ||
402 | ; STEP 3 run SYSTEM XTREE with parameters |
402 | ; STEP 3 run SYSTEM XTREE with parameters |
403 | ; |
403 | ; |
404 | 404 | ||
Line 405... | Line 405... | ||
405 | mov eax,58 |
405 | mov eax,58 |
Line 406... | Line 406... | ||
406 | mov ebx,run_fileinfo |
406 | mov ebx,run_fileinfo |
407 | int 0x40 |
407 | mcall |
408 | 408 | ||
409 | call redproc |
409 | call redproc |
410 | 410 | ||
Line 411... | Line 411... | ||
411 | mov [get_loops],0 |
411 | mov [get_loops],0 |
412 | getmesloop: |
412 | getmesloop: |
413 | mov eax,23 |
413 | mov eax,23 |
414 | mov ebx,50 ;0.5 sec |
414 | mov ebx,50 ;0.5 sec |
Line 425... | Line 425... | ||
425 | 425 | ||
426 | ; Get number of procces |
426 | ; Get number of procces |
427 | mov ebx,procinfo |
427 | mov ebx,procinfo |
428 | mov ecx,-1 |
428 | mov ecx,-1 |
429 | mov eax,9 |
429 | mov eax,9 |
430 | int 0x40 |
430 | mcall |
Line 431... | Line 431... | ||
431 | mov ebp,eax |
431 | mov ebp,eax |
432 | 432 | ||
433 | loox: |
433 | loox: |
434 | mov eax,9 |
434 | mov eax,9 |
435 | mov ebx,procinfo |
435 | mov ebx,procinfo |
436 | mov ecx,ebp |
436 | mov ecx,ebp |
437 | int 0x40 |
437 | mcall |
438 | mov eax,[DLGPID] |
438 | mov eax,[DLGPID] |
439 | cmp [procinfo+30],eax ;IF Dialog find |
439 | cmp [procinfo+30],eax ;IF Dialog find |
440 | je dlg_is_work ;jmp to dlg_is_work |
440 | je dlg_is_work ;jmp to dlg_is_work |
Line 456... | Line 456... | ||
456 | 456 | ||
457 | mred: |
457 | mred: |
458 | call redproc |
458 | call redproc |
459 | jmp getmesloop |
459 | jmp getmesloop |
460 | mkey: |
460 | mkey: |
461 | int 0x40 ; read (eax=2) |
461 | mcall ; read (eax=2) |
462 | jmp getmesloop |
462 | jmp getmesloop |
463 | mbutton: |
463 | mbutton: |
464 | mov eax,17 ; get id |
464 | mov eax,17 ; get id |
465 | int 0x40 |
465 | mcall |
466 | cmp ah,1 ; button id=1 ? |
466 | cmp ah,1 ; button id=1 ? |
467 | jne getmesloop |
467 | jne getmesloop |
468 | mov eax,-1 ; close this program |
468 | mov eax,-1 ; close this program |
469 | int 0x40 |
469 | mcall |
Line 470... | Line 470... | ||
470 | mgetmes: |
470 | mgetmes: |
471 | 471 | ||
472 | ; If dlg_pid_get then second message get jmp to still |
472 | ; If dlg_pid_get then second message get jmp to still |
Line 616... | Line 616... | ||
616 | } |
616 | } |
Line 617... | Line 617... | ||
617 | 617 | ||
618 | macro scank |
618 | macro scank |
619 | { |
619 | { |
620 | mov eax,10 |
620 | mov eax,10 |
621 | int 0x40 |
621 | mcall |
Line 622... | Line 622... | ||
622 | } |
622 | } |
623 | 623 | ||
624 | macro putpix x,y,color |
624 | macro putpix x,y,color |
625 | { |
625 | { |
626 | mov ebx,x |
626 | mov ebx,x |
627 | mov ecx,y |
627 | mov ecx,y |
628 | mov edx,color |
628 | mov edx,color |
629 | mov eax,1 |
629 | mov eax,1 |
Line 630... | Line 630... | ||
630 | int 0x40 |
630 | mcall |
631 | } |
631 | } |
632 | 632 | ||
Line 638... | Line 638... | ||
638 | wordstoreg ebx,x,y |
638 | wordstoreg ebx,x,y |
639 | mov ecx,color |
639 | mov ecx,color |
640 | mov edx,offs |
640 | mov edx,offs |
641 | mov esi,size |
641 | mov esi,size |
642 | mov eax,4 |
642 | mov eax,4 |
643 | int 0x40 |
643 | mcall |
644 | } |
644 | } |
Line 645... | Line 645... | ||
645 | 645 | ||
646 | macro outcount data, x, y, color, numtype |
646 | macro outcount data, x, y, color, numtype |
647 | { |
647 | { |
Line 650... | Line 650... | ||
650 | mov bl,0 |
650 | mov bl,0 |
651 | ; mov edx,x*65536+y |
651 | ; mov edx,x*65536+y |
652 | wordstoreg edx,x,y |
652 | wordstoreg edx,x,y |
653 | mov esi,color |
653 | mov esi,color |
654 | mov eax,47 |
654 | mov eax,47 |
655 | int 0x40 |
655 | mcall |
656 | } |
656 | } |
Line 657... | Line 657... | ||
657 | 657 | ||
Line 658... | Line 658... | ||
658 | ; SCEVENT - Scan event |
658 | ; SCEVENT - Scan event |
659 | 659 | ||
660 | macro scevent red,key,but |
660 | macro scevent red,key,but |
661 | { |
661 | { |
662 | mov eax,11 |
662 | mov eax,11 |
663 | int 0x40 |
663 | mcall |
664 | dec eax |
664 | dec eax |
665 | jz red |
665 | jz red |
666 | dec eax |
666 | dec eax |
Line 672... | Line 672... | ||
672 | ; WTEVENT - Wait event |
672 | ; WTEVENT - Wait event |
Line 673... | Line 673... | ||
673 | 673 | ||
674 | macro wtevent red,key,but |
674 | macro wtevent red,key,but |
675 | { |
675 | { |
676 | mov eax,10 |
676 | mov eax,10 |
677 | int 0x40 |
677 | mcall |
678 | dec eax |
678 | dec eax |
679 | jz red |
679 | jz red |
680 | dec eax |
680 | dec eax |
681 | jz key |
681 | jz key |
Line 687... | Line 687... | ||
687 | 687 | ||
688 | macro timeevent xfps,noevent,red,key,but |
688 | macro timeevent xfps,noevent,red,key,but |
689 | { |
689 | { |
690 | mov eax,23 |
690 | mov eax,23 |
691 | mov ebx,xfps |
691 | mov ebx,xfps |
692 | int 0x40 |
692 | mcall |
693 | cmp eax,0 |
693 | cmp eax,0 |
694 | je noevent |
694 | je noevent |
695 | dec eax |
695 | dec eax |
696 | jz red |
696 | jz red |
Line 704... | Line 704... | ||
704 | ; CLOSE - Close program |
704 | ; CLOSE - Close program |
Line 705... | Line 705... | ||
705 | 705 | ||
706 | macro close |
706 | macro close |
707 | { |
707 | { |
708 | mov eax,-1 |
708 | mov eax,-1 |
709 | int 0x40 |
709 | mcall |
Line 710... | Line 710... | ||
710 | } |
710 | } |
711 | 711 | ||
712 | ; DELAY - Create delay 1/100 sec |
712 | ; DELAY - Create delay 1/100 sec |
Line 713... | Line 713... | ||
713 | ; (SYNTAX) Delay time |
713 | ; (SYNTAX) Delay time |
714 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
714 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
715 | 715 | ||
716 | macro delay arg1 |
716 | macro delay arg1 |
717 | { |
717 | { |
718 | mov eax,5 |
718 | mov eax,5 |
Line 719... | Line 719... | ||
719 | mov ebx,arg1 |
719 | mov ebx,arg1 |
720 | int 0x40 |
720 | mcall |
721 | } |
721 | } |
Line 730... | Line 730... | ||
730 | ; mov ecx,arg2*65536+arg4 |
730 | ; mov ecx,arg2*65536+arg4 |
731 | wordstoreg ebx,arg1,arg3 |
731 | wordstoreg ebx,arg1,arg3 |
732 | wordstoreg ecx,arg2,arg4 |
732 | wordstoreg ecx,arg2,arg4 |
733 | mov edx,arg5 |
733 | mov edx,arg5 |
734 | mov eax,0 |
734 | mov eax,0 |
735 | int 0x40 |
735 | mcall |
736 | } |
736 | } |
Line 737... | Line 737... | ||
737 | 737 | ||
738 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
738 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
739 | { |
739 | { |
740 | mov ebx,arg1*65536+arg3 |
740 | mov ebx,arg1*65536+arg3 |
741 | mov ecx,arg2*65536+arg4 |
741 | mov ecx,arg2*65536+arg4 |
742 | mov edx,arg5 |
742 | mov edx,arg5 |
743 | mov esi,arg6 |
743 | mov esi,arg6 |
744 | mov edi,arg7 |
744 | mov edi,arg7 |
745 | mov eax,0 |
745 | mov eax,0 |
746 | int 0x40 |
746 | mcall |
Line 747... | Line 747... | ||
747 | } |
747 | } |
Line 748... | Line 748... | ||
748 | 748 | ||
749 | 749 | ||
750 | ; STARTWD - Start of window draw |
750 | ; STARTWD - Start of window draw |
751 | 751 | ||
752 | macro startwd |
752 | macro startwd |
753 | { |
753 | { |
Line 754... | Line 754... | ||
754 | mov eax,12 |
754 | mov eax,12 |
Line 755... | Line 755... | ||
755 | mov ebx,1 |
755 | mov ebx,1 |
756 | int 0x40 |
756 | mcall |
757 | } |
757 | } |
758 | 758 | ||
759 | ; ENDWD - End window draw |
759 | ; ENDWD - End window draw |
760 | 760 | ||
Line 761... | Line 761... | ||
761 | macro endwd |
761 | macro endwd |
762 | { |
762 | { |
763 | mov eax,12 |
763 | mov eax,12 |
Line 783... | Line 783... | ||
783 | mov ecx,arg4 ;arg4 color |
783 | mov ecx,arg4 ;arg4 color |
784 | end if |
784 | end if |
785 | mov edx,lab |
785 | mov edx,lab |
786 | mov esi,asd-lab ;calc size |
786 | mov esi,asd-lab ;calc size |
787 | mov eax,4 |
787 | mov eax,4 |
788 | int 0x40 |
788 | mcall |
789 | } |
789 | } |
Line 790... | Line 790... | ||
790 | 790 | ||
791 | ;Key's |
791 | ;Key's |
792 | key_Up equ 178 |
792 | key_Up equ 178 |