Rev 134 | Rev 539 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 134 | Rev 485 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | db file_name,0 |
44 | db file_name,0 |
45 | open: |
45 | open: |
46 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
46 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
47 | mov eax,58 |
47 | mov eax,58 |
48 | mov ebx,fileinfo |
48 | mov ebx,fileinfo |
49 | int 0x40 |
49 | mcall |
50 | mov eax,[file_load_area+2] |
50 | mov eax,[file_load_area+2] |
51 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
51 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
52 | inc eax |
52 | inc eax |
53 | mov dword [fileinfo+8],eax |
53 | mov dword [fileinfo+8],eax |
54 | mov eax,58 |
54 | mov eax,58 |
55 | mov ebx,fileinfo |
55 | mov ebx,fileinfo |
56 | int 0x40 |
56 | mcall |
57 | } |
57 | } |
Line 58... | Line 58... | ||
58 | 58 | ||
59 | 59 | ||
Line 86... | Line 86... | ||
86 | wordstoreg ebx,x,xs |
86 | wordstoreg ebx,x,xs |
87 | wordstoreg ecx,y,ys |
87 | wordstoreg ecx,y,ys |
88 | mov edx,id |
88 | mov edx,id |
89 | mov esi,bcolor |
89 | mov esi,bcolor |
90 | mov eax,8 |
90 | mov eax,8 |
91 | int 0x40 |
91 | mcall |
Line 92... | Line 92... | ||
92 | 92 | ||
93 | mov eax,asd-lab ;calc size |
93 | mov eax,asd-lab ;calc size |
94 | mov ebx,6 |
94 | mov ebx,6 |
95 | mul ebx |
95 | mul ebx |
Line 111... | Line 111... | ||
111 | 111 | ||
112 | mov ecx,tcolor ;arg4 color |
112 | mov ecx,tcolor ;arg4 color |
113 | mov edx,lab |
113 | mov edx,lab |
114 | mov esi,asd-lab ;calc size |
114 | mov esi,asd-lab ;calc size |
115 | mov eax,4 |
115 | mov eax,4 |
116 | int 0x40 |
116 | mcall |
Line 117... | Line 117... | ||
117 | } |
117 | } |
118 | 118 | ||
Line 140... | Line 140... | ||
140 | 140 | ||
141 | ; Get my PID in dec format 4 bytes |
141 | ; Get my PID in dec format 4 bytes |
142 | mov eax,9 |
142 | mov eax,9 |
143 | mov ebx,procinfo |
143 | mov ebx,procinfo |
144 | mov ecx,-1 |
144 | mov ecx,-1 |
Line 145... | Line 145... | ||
145 | int 0x40 |
145 | mcall |
146 | 146 | ||
147 | ; convert eax bin to param dec |
147 | ; convert eax bin to param dec |
148 | mov eax,dword [procinfo+30] ;offset of myPID |
148 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 174... | Line 174... | ||
174 | ; define IPC memory |
174 | ; define IPC memory |
175 | mov eax,60 |
175 | mov eax,60 |
176 | mov ebx,1 ; define IPC |
176 | mov ebx,1 ; define IPC |
177 | mov ecx,path ; offset of area |
177 | mov ecx,path ; offset of area |
178 | mov edx,150 ; size 150 bytes |
178 | mov edx,150 ; size 150 bytes |
179 | int 0x40 |
179 | mcall |
Line 180... | Line 180... | ||
180 | 180 | ||
181 | ; change wanted events list 7-bit IPC event |
181 | ; change wanted events list 7-bit IPC event |
182 | mov eax,40 |
182 | mov eax,40 |
183 | mov ebx,01000111b |
183 | mov ebx,01000111b |
Line 184... | Line 184... | ||
184 | int 0x40 |
184 | mcall |
185 | 185 | ||
186 | ; |
186 | ; |
Line 187... | Line 187... | ||
187 | ; STEP 3 run SYSTEM XTREE with parameters |
187 | ; STEP 3 run SYSTEM XTREE with parameters |
188 | ; |
188 | ; |
189 | 189 | ||
Line 190... | Line 190... | ||
190 | mov eax,58 |
190 | mov eax,58 |
Line 191... | Line 191... | ||
191 | mov ebx,run_fileinfo |
191 | mov ebx,run_fileinfo |
192 | int 0x40 |
192 | mcall |
193 | 193 | ||
194 | call redproc |
194 | call redproc |
195 | 195 | ||
Line 196... | Line 196... | ||
196 | mov [get_loops],0 |
196 | mov [get_loops],0 |
197 | getmesloop: |
197 | getmesloop: |
198 | mov eax,23 |
198 | mov eax,23 |
199 | mov ebx,50 ;0.5 sec |
199 | mov ebx,50 ;0.5 sec |
Line 210... | Line 210... | ||
210 | 210 | ||
211 | ; Get number of procces |
211 | ; Get number of procces |
212 | mov ebx,procinfo |
212 | mov ebx,procinfo |
213 | mov ecx,-1 |
213 | mov ecx,-1 |
214 | mov eax,9 |
214 | mov eax,9 |
215 | int 0x40 |
215 | mcall |
Line 216... | Line 216... | ||
216 | mov ebp,eax |
216 | mov ebp,eax |
217 | 217 | ||
218 | loox: |
218 | loox: |
219 | mov eax,9 |
219 | mov eax,9 |
220 | mov ebx,procinfo |
220 | mov ebx,procinfo |
221 | mov ecx,ebp |
221 | mov ecx,ebp |
222 | int 0x40 |
222 | mcall |
223 | mov eax,[DLGPID] |
223 | mov eax,[DLGPID] |
224 | cmp [procinfo+30],eax ;IF Dialog find |
224 | cmp [procinfo+30],eax ;IF Dialog find |
225 | je dlg_is_work ;jmp to dlg_is_work |
225 | je dlg_is_work ;jmp to dlg_is_work |
Line 242... | Line 242... | ||
242 | mred: |
242 | mred: |
243 | call redproc |
243 | call redproc |
244 | jmp getmesloop |
244 | jmp getmesloop |
245 | mkey: |
245 | mkey: |
246 | mov eax,2 |
246 | mov eax,2 |
247 | int 0x40 ; read (eax=2) |
247 | mcall ; read (eax=2) |
248 | jmp getmesloop |
248 | jmp getmesloop |
249 | mbutton: |
249 | mbutton: |
250 | mov eax,17 ; get id |
250 | mov eax,17 ; get id |
251 | int 0x40 |
251 | mcall |
252 | cmp ah,1 ; button id=1 ? |
252 | cmp ah,1 ; button id=1 ? |
253 | jne getmesloop |
253 | jne getmesloop |
254 | mov eax,-1 ; close this program |
254 | mov eax,-1 ; close this program |
255 | int 0x40 |
255 | mcall |
256 | mgetmes: |
256 | mgetmes: |
Line 257... | Line 257... | ||
257 | 257 | ||
258 | ; If dlg_pid_get then second message get jmp to still |
258 | ; If dlg_pid_get then second message get jmp to still |
259 | cmp [dlg_pid_get],dword 1 |
259 | cmp [dlg_pid_get],dword 1 |
Line 352... | Line 352... | ||
352 | 352 | ||
353 | ; Get my PID in dec format 4 bytes |
353 | ; Get my PID in dec format 4 bytes |
354 | mov eax,9 |
354 | mov eax,9 |
355 | mov ebx,procinfo |
355 | mov ebx,procinfo |
356 | mov ecx,-1 |
356 | mov ecx,-1 |
Line 357... | Line 357... | ||
357 | int 0x40 |
357 | mcall |
358 | 358 | ||
359 | ; convert eax bin to param dec |
359 | ; convert eax bin to param dec |
360 | mov eax,dword [procinfo+30] ;offset of myPID |
360 | mov eax,dword [procinfo+30] ;offset of myPID |
Line 386... | Line 386... | ||
386 | ; define IPC memory |
386 | ; define IPC memory |
387 | mov eax,60 |
387 | mov eax,60 |
388 | mov ebx,1 ; define IPC |
388 | mov ebx,1 ; define IPC |
389 | mov ecx,path ; offset of area |
389 | mov ecx,path ; offset of area |
390 | mov edx,120 ; size 150 bytes |
390 | mov edx,120 ; size 150 bytes |
391 | int 0x40 |
391 | mcall |
Line 392... | Line 392... | ||
392 | 392 | ||
393 | ; change wanted events list 7-bit IPC event |
393 | ; change wanted events list 7-bit IPC event |
394 | mov eax,40 |
394 | mov eax,40 |
395 | mov ebx,01000111b |
395 | mov ebx,01000111b |
Line 396... | Line 396... | ||
396 | int 0x40 |
396 | mcall |
397 | 397 | ||
398 | ; |
398 | ; |
Line 399... | Line 399... | ||
399 | ; STEP 3 run SYSTEM XTREE with parameters |
399 | ; STEP 3 run SYSTEM XTREE with parameters |
400 | ; |
400 | ; |
401 | 401 | ||
Line 402... | Line 402... | ||
402 | mov eax,58 |
402 | mov eax,58 |
Line 403... | Line 403... | ||
403 | mov ebx,run_fileinfo |
403 | mov ebx,run_fileinfo |
404 | int 0x40 |
404 | mcall |
405 | 405 | ||
406 | call redproc |
406 | call redproc |
407 | 407 | ||
Line 408... | Line 408... | ||
408 | mov [get_loops],0 |
408 | mov [get_loops],0 |
409 | getmesloop: |
409 | getmesloop: |
410 | mov eax,23 |
410 | mov eax,23 |
411 | mov ebx,50 ;0.5 sec |
411 | mov ebx,50 ;0.5 sec |
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 453... | Line 453... | ||
453 | 453 | ||
454 | mred: |
454 | mred: |
455 | call redproc |
455 | call redproc |
456 | jmp getmesloop |
456 | jmp getmesloop |
457 | mkey: |
457 | mkey: |
458 | int 0x40 ; read (eax=2) |
458 | mcall ; read (eax=2) |
459 | jmp getmesloop |
459 | jmp getmesloop |
460 | mbutton: |
460 | mbutton: |
461 | mov eax,17 ; get id |
461 | mov eax,17 ; get id |
462 | int 0x40 |
462 | mcall |
463 | cmp ah,1 ; button id=1 ? |
463 | cmp ah,1 ; button id=1 ? |
464 | jne getmesloop |
464 | jne getmesloop |
465 | mov eax,-1 ; close this program |
465 | mov eax,-1 ; close this program |
466 | int 0x40 |
466 | mcall |
Line 467... | Line 467... | ||
467 | mgetmes: |
467 | mgetmes: |
468 | 468 | ||
469 | ; If dlg_pid_get then second message get jmp to still |
469 | ; If dlg_pid_get then second message get jmp to still |
Line 613... | Line 613... | ||
613 | } |
613 | } |
Line 614... | Line 614... | ||
614 | 614 | ||
615 | macro scank |
615 | macro scank |
616 | { |
616 | { |
617 | mov eax,10 |
617 | mov eax,10 |
618 | int 0x40 |
618 | mcall |
Line 619... | Line 619... | ||
619 | } |
619 | } |
620 | 620 | ||
621 | macro putpix x,y,color |
621 | macro putpix x,y,color |
622 | { |
622 | { |
623 | mov ebx,x |
623 | mov ebx,x |
624 | mov ecx,y |
624 | mov ecx,y |
625 | mov edx,color |
625 | mov edx,color |
626 | mov eax,1 |
626 | mov eax,1 |
Line 627... | Line 627... | ||
627 | int 0x40 |
627 | mcall |
628 | } |
628 | } |
629 | 629 | ||
Line 635... | Line 635... | ||
635 | wordstoreg ebx,x,y |
635 | wordstoreg ebx,x,y |
636 | mov ecx,color |
636 | mov ecx,color |
637 | mov edx,offs |
637 | mov edx,offs |
638 | mov esi,size |
638 | mov esi,size |
639 | mov eax,4 |
639 | mov eax,4 |
640 | int 0x40 |
640 | mcall |
641 | } |
641 | } |
Line 642... | Line 642... | ||
642 | 642 | ||
643 | macro outcount data, x, y, color, numtype |
643 | macro outcount data, x, y, color, numtype |
644 | { |
644 | { |
Line 647... | Line 647... | ||
647 | mov bl,0 |
647 | mov bl,0 |
648 | ; mov edx,x*65536+y |
648 | ; mov edx,x*65536+y |
649 | wordstoreg edx,x,y |
649 | wordstoreg edx,x,y |
650 | mov esi,color |
650 | mov esi,color |
651 | mov eax,47 |
651 | mov eax,47 |
652 | int 0x40 |
652 | mcall |
653 | } |
653 | } |
Line 654... | Line 654... | ||
654 | 654 | ||
Line 655... | Line 655... | ||
655 | ; SCEVENT - Scan event |
655 | ; SCEVENT - Scan event |
656 | 656 | ||
657 | macro scevent red,key,but |
657 | macro scevent red,key,but |
658 | { |
658 | { |
659 | mov eax,11 |
659 | mov eax,11 |
660 | int 0x40 |
660 | mcall |
661 | dec eax |
661 | dec eax |
662 | jz red |
662 | jz red |
663 | dec eax |
663 | dec eax |
Line 669... | Line 669... | ||
669 | ; WTEVENT - Wait event |
669 | ; WTEVENT - Wait event |
Line 670... | Line 670... | ||
670 | 670 | ||
671 | macro wtevent red,key,but |
671 | macro wtevent red,key,but |
672 | { |
672 | { |
673 | mov eax,10 |
673 | mov eax,10 |
674 | int 0x40 |
674 | mcall |
675 | dec eax |
675 | dec eax |
676 | jz red |
676 | jz red |
677 | dec eax |
677 | dec eax |
678 | jz key |
678 | jz key |
Line 684... | Line 684... | ||
684 | 684 | ||
685 | macro timeevent xfps,noevent,red,key,but |
685 | macro timeevent xfps,noevent,red,key,but |
686 | { |
686 | { |
687 | mov eax,23 |
687 | mov eax,23 |
688 | mov ebx,xfps |
688 | mov ebx,xfps |
689 | int 0x40 |
689 | mcall |
690 | cmp eax,0 |
690 | cmp eax,0 |
691 | je noevent |
691 | je noevent |
692 | dec eax |
692 | dec eax |
693 | jz red |
693 | jz red |
Line 701... | Line 701... | ||
701 | ; CLOSE - Close program |
701 | ; CLOSE - Close program |
Line 702... | Line 702... | ||
702 | 702 | ||
703 | macro close |
703 | macro close |
704 | { |
704 | { |
705 | mov eax,-1 |
705 | mov eax,-1 |
706 | int 0x40 |
706 | mcall |
Line 707... | Line 707... | ||
707 | } |
707 | } |
708 | 708 | ||
709 | ; DELAY - Create delay 1/100 sec |
709 | ; DELAY - Create delay 1/100 sec |
Line 710... | Line 710... | ||
710 | ; (SYNTAX) Delay time |
710 | ; (SYNTAX) Delay time |
711 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
711 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
712 | 712 | ||
713 | macro delay arg1 |
713 | macro delay arg1 |
714 | { |
714 | { |
715 | mov eax,5 |
715 | mov eax,5 |
Line 716... | Line 716... | ||
716 | mov ebx,arg1 |
716 | mov ebx,arg1 |
717 | int 0x40 |
717 | mcall |
718 | } |
718 | } |
Line 727... | Line 727... | ||
727 | ; mov ecx,arg2*65536+arg4 |
727 | ; mov ecx,arg2*65536+arg4 |
728 | wordstoreg ebx,arg1,arg3 |
728 | wordstoreg ebx,arg1,arg3 |
729 | wordstoreg ecx,arg2,arg4 |
729 | wordstoreg ecx,arg2,arg4 |
730 | mov edx,arg5 |
730 | mov edx,arg5 |
731 | mov eax,0 |
731 | mov eax,0 |
732 | int 0x40 |
732 | mcall |
733 | } |
733 | } |
Line 734... | Line 734... | ||
734 | 734 | ||
735 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
735 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
736 | { |
736 | { |
737 | mov ebx,arg1*65536+arg3 |
737 | mov ebx,arg1*65536+arg3 |
738 | mov ecx,arg2*65536+arg4 |
738 | mov ecx,arg2*65536+arg4 |
739 | mov edx,arg5 |
739 | mov edx,arg5 |
740 | mov esi,arg6 |
740 | mov esi,arg6 |
741 | mov edi,arg7 |
741 | mov edi,arg7 |
742 | mov eax,0 |
742 | mov eax,0 |
743 | int 0x40 |
743 | mcall |
Line 744... | Line 744... | ||
744 | } |
744 | } |
Line 745... | Line 745... | ||
745 | 745 | ||
746 | 746 | ||
747 | ; STARTWD - Start of window draw |
747 | ; STARTWD - Start of window draw |
748 | 748 | ||
749 | macro startwd |
749 | macro startwd |
750 | { |
750 | { |
Line 751... | Line 751... | ||
751 | mov eax,12 |
751 | mov eax,12 |
Line 752... | Line 752... | ||
752 | mov ebx,1 |
752 | mov ebx,1 |
753 | int 0x40 |
753 | mcall |
754 | } |
754 | } |
755 | 755 | ||
756 | ; ENDWD - End window draw |
756 | ; ENDWD - End window draw |
757 | 757 | ||
Line 758... | Line 758... | ||
758 | macro endwd |
758 | macro endwd |
759 | { |
759 | { |
760 | mov eax,12 |
760 | mov eax,12 |
Line 778... | Line 778... | ||
778 | wordstoreg ebx,arg1,arg2 |
778 | wordstoreg ebx,arg1,arg2 |
779 | mov ecx,arg4 ;arg4 color |
779 | mov ecx,arg4 ;arg4 color |
780 | mov edx,lab |
780 | mov edx,lab |
781 | mov esi,asd-lab ;calc size |
781 | mov esi,asd-lab ;calc size |
782 | mov eax,4 |
782 | mov eax,4 |
783 | int 0x40 |
783 | mcall |
784 | } |
784 | } |
Line 785... | Line 785... | ||
785 | 785 | ||
786 | ;Key's |
786 | ;Key's |
787 | key_Up equ 178 |
787 | key_Up equ 178 |