Rev 7935 | Rev 8489 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7935 | Rev 8484 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | ; MAIN MENU by lisovin@26.ru |
18 | ; MAIN MENU by lisovin@26.ru |
19 | ; Some parts of code rewritten by Ivan Poddubny |
19 | ; Some parts of code rewritten by Ivan Poddubny |
20 | ; |
20 | ; |
21 | ; Compile with FASM for Menuet |
21 | ; Compile with FASM for Menuet |
22 | ;****************************************************************************** |
22 | ;****************************************************************************** |
23 | BTN_HEIGHT = 22 |
23 | BTN_HEIGHT = 22 ;26 |
24 | BTN_WIDTH = 140 |
24 | BTN_WIDTH = 140 ;178 |
25 | TXT_Y = (BTN_HEIGHT)/2-4 |
25 | TXT_Y = (BTN_HEIGHT)/2-4 |
- | 26 | FONT_TYPE = 0x80000000 ;0x90000000 |
|
Line 26... | Line 27... | ||
26 | 27 | ||
27 | PANEL_HEIGHT = 20 |
28 | PANEL_HEIGHT = 20 |
28 | MENU_BOTTON_X_POS = 10 |
29 | MENU_BOTTON_X_POS = 10 |
29 | MENU_BOTTON_X_SIZE = 50 |
30 | MENU_BOTTON_X_SIZE = 50 |
Line 75... | Line 76... | ||
75 | ;------------------------------------------------------------------------------ |
76 | ;------------------------------------------------------------------------------ |
76 | align 4 |
77 | align 4 |
77 | START: ; start of execution |
78 | START: ; start of execution |
78 | mcall 68,11 |
79 | mcall 68,11 |
Line -... | Line 80... | ||
- | 80 | ||
- | 81 | mcall 30, 1, default_dir |
|
79 | 82 | ||
80 | mov esi,bootparam |
83 | mov esi,bootparam |
81 | cmp [esi],byte 0 |
84 | cmp [esi],byte 0 |
82 | je .no_boot_parameters |
85 | je .no_boot_parameters |
83 | ; boot params - hex |
86 | ; boot params - hex |
Line 376... | Line 379... | ||
376 | dec ah |
379 | dec ah |
377 | jnz .next_string |
380 | jnz .next_string |
378 | pop eax |
381 | pop eax |
Line 379... | Line 382... | ||
379 | 382 | ||
380 | mov ecx,40 |
383 | mov ecx,40 |
381 | mov al,'/' |
384 | mov al,'|' |
382 | cld |
385 | cld |
383 | repne scasb |
386 | repne scasb |
384 | test ecx,ecx ; if '/' not found |
387 | test ecx,ecx ; if '|' not found |
Line 385... | Line 388... | ||
385 | je searchexit |
388 | je searchexit |
386 | 389 | ||
Line 387... | Line 390... | ||
387 | cmp [edi],byte '@' ; check for submenu |
390 | cmp [edi],byte '@' ; check for submenu |
388 | je runthread |
391 | je runthread |
Line 389... | Line 392... | ||
389 | 392 | ||
390 | cmp [last_key],179 |
393 | cmp [last_key],179 |
391 | je searchexit |
394 | je searchexit |
392 | 395 | ||
Line 393... | Line 396... | ||
393 | dec edi |
396 | ;dec edi |
Line 433... | Line 436... | ||
433 | cmp al,[esi + child] |
436 | cmp al,[esi + child] |
434 | je searchexit ; such process already exists |
437 | je searchexit ; such process already exists |
Line 435... | Line 438... | ||
435 | 438 | ||
436 | mov [esi + child],al ; this is my child |
439 | mov [esi + child],al ; this is my child |
437 | mov cx,[esi + x_start] |
440 | mov cx,[esi + x_start] |
438 | add cx,141 ; new x_start in cx |
441 | add cx,BTN_WIDTH+1 ; new x_start in cx |
439 | movzx edx,al |
442 | movzx edx,al |
440 | shl edx,4 |
443 | shl edx,4 |
441 | add edx,[menu_data] ; edx points to child's base address |
444 | add edx,[menu_data] ; edx points to child's base address |
442 | mov [edx + x_start],cx ; xstart for new thread |
445 | mov [edx + x_start],cx ; xstart for new thread |
Line 682... | Line 685... | ||
682 | push ecx |
685 | push ecx |
683 | mcall 9,procinfo |
686 | mcall 9,procinfo |
684 | mov eax,[menu_mame] |
687 | mov eax,[menu_mame] |
685 | cmp [ebx+10],eax |
688 | cmp [ebx+10],eax |
686 | jne @f |
689 | jne @f |
- | 690 | ; temporary to fit into 3 IMG sectors |
|
687 | mov ax,[menu_mame+4] |
691 | ;mov ax,[menu_mame+4] |
688 | cmp [ebx+14],ax |
692 | ;cmp [ebx+14],ax |
689 | jne @f |
693 | ;jne @f |
690 | cmp ecx,[active_process] |
694 | cmp ecx,[active_process] |
691 | je @f |
695 | je @f |
692 | ; dph ecx |
696 | ; dph ecx |
693 | mcall 18,2 |
697 | mcall 18,2 |
694 | mov edx,1 |
698 | mov edx,1 |
Line 853... | Line 857... | ||
853 | ; dunkaist[ |
857 | ; dunkaist[ |
854 | add edx,0xd1ff00 ; This makes first menu buttons differ |
858 | add edx,0xd1ff00 ; This makes first menu buttons differ |
855 | ; from system close button with 0x000001 id |
859 | ; from system close button with 0x000001 id |
856 | ; dunkaist] |
860 | ; dunkaist] |
857 | mcall |
861 | mcall |
858 | pusha |
862 | push edx |
Line 859... | Line 863... | ||
859 | 863 | ||
860 | mov edx, esi |
864 | mov edx, esi |
Line 861... | Line 865... | ||
861 | mcall 13 |
865 | mcall 13 |
862 | 866 | ||
- | 867 | mcall , BTN_WIDTH,<[draw_y],1>,[sc.work_light] |
|
- | 868 | add ecx, BTN_HEIGHT-1 |
|
863 | mcall , BTN_WIDTH, <[draw_y],1>, [sc.work_light] |
869 | mcall , 1 |
864 | mcall , 1, <[draw_y],BTN_HEIGHT> |
870 | inc ecx |
865 | mcall , |
871 | mcall , |
Line 866... | Line 872... | ||
866 | add [draw_y], BTN_HEIGHT-1 |
872 | add [draw_y], BTN_HEIGHT-1 |
867 | mcall , BTN_WIDTH, <[draw_y],1> |
873 | mcall , BTN_WIDTH,<[draw_y],1> |
868 | 874 | ||
869 | popa |
875 | pop edx |
870 | movzx edx,dl |
876 | movzx edx,dl |
871 | dec dl |
877 | dec dl |
Line 903... | Line 909... | ||
903 | cmp byte [edi],10 |
909 | cmp byte [edi],10 |
904 | jne searchstartstring |
910 | jne searchstartstring |
905 | ret |
911 | ret |
906 | ;------------------------------------------------------------------------------ |
912 | ;------------------------------------------------------------------------------ |
907 | ;*** DATA AREA **************************************************************** |
913 | ;*** DATA AREA **************************************************************** |
908 | menu_mame: |
914 | menu_mame: db '@MENU',0 |
909 | db '@MENU',0 |
915 | default_dir: db '/sys',0 |
Line 910... | Line 916... | ||
910 | 916 | ||
911 | align 4 |
917 | align 4 |
912 | free_my_area_lock dd 0 |
918 | free_my_area_lock dd 0 |
Line 931... | Line 937... | ||
931 | .start dd 0 ; start byte |
937 | .start dd 0 ; start byte |
932 | .size_high dd 0 ; rezerved |
938 | .size_high dd 0 ; rezerved |
933 | .size dd 0 ; bytes to read |
939 | .size dd 0 ; bytes to read |
934 | .return dd procinfo ; return data pointer |
940 | .return dd procinfo ; return data pointer |
935 | .name: |
941 | .name: |
936 | db '/SYS/SETTINGS/MENU.DAT',0 ; ASCIIZ dir & filename |
942 | db 'SETTINGS/MENU.DAT',0 ; ASCIIZ dir & filename |
937 | ;-------------------------------------- |
943 | ;-------------------------------------- |
938 | align 4 |
944 | align 4 |
939 | fileinfo_start: |
945 | fileinfo_start: |
940 | .subfunction dd 7 ; 7=START APPLICATION |
946 | .subfunction dd 7 ; 7=START APPLICATION |
941 | .flags dd 0 ; flags |
947 | .flags dd 0 ; flags |