Rev 3628 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1919 | Albom | 1 | ; Keyboard indicators v0.2 |
2 | ; by Albom and IgorA |
||
1918 | Albom | 3 | |
4 | use32 |
||
1919 | Albom | 5 | org 0 |
6 | db 'MENUET01' |
||
7 | dd 1 |
||
8 | dd _start |
||
9 | dd _end |
||
10 | dd _memory |
||
11 | dd stacktop |
||
12 | dd 0 |
||
13 | dd sys_path |
||
1918 | Albom | 14 | |
1919 | Albom | 15 | include '../../macros.inc' |
16 | include '../../proc32.inc' |
||
17 | include '../../develop/libraries/box_lib/load_lib.mac' |
||
18 | include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
||
19 | ;include 'mem.inc' |
||
20 | ;include 'dll.inc' |
||
3628 | fedesco | 21 | include 'lang.inc' |
1918 | Albom | 22 | |
1919 | Albom | 23 | @use_library ;_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load |
24 | |||
25 | align 4 |
||
1918 | Albom | 26 | _start: |
1919 | Albom | 27 | load_libraries l_libs_start,l_libs_end |
28 | mcall 48,3,sc,sizeof.system_colors |
||
29 | mcall 40,0x27 |
||
1918 | Albom | 30 | |
1919 | Albom | 31 | init_checkboxes2 check_boxes,check_boxes_end |
32 | check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc |
||
33 | call _key_set |
||
1918 | Albom | 34 | |
1919 | Albom | 35 | align 4 |
36 | red_win: |
||
37 | call draw_window |
||
1918 | Albom | 38 | |
39 | |||
1919 | Albom | 40 | align 4 |
41 | still: |
||
42 | mcall 10 |
||
1918 | Albom | 43 | |
1919 | Albom | 44 | cmp al,1 ;изм. положение окна |
45 | jz red_win |
||
46 | cmp al,2 |
||
47 | jz key |
||
48 | cmp al,3 |
||
49 | jz button |
||
1918 | Albom | 50 | |
1919 | Albom | 51 | ;stdcall [check_box_mouse], ch1 |
52 | ;stdcall [check_box_mouse], ch2 |
||
53 | ;stdcall [check_box_mouse], ch3 |
||
1918 | Albom | 54 | |
1919 | Albom | 55 | jmp still |
1918 | Albom | 56 | |
1919 | Albom | 57 | ;установить общесистемные "горячие клавиши" |
58 | align 4 |
||
1918 | Albom | 59 | _key_set: |
60 | mov eax, 66 |
||
1919 | Albom | 61 | mov ebx, 4 |
1918 | Albom | 62 | mov edx, 0 |
63 | mov cl, 69 |
||
64 | int 0x40 |
||
65 | |||
66 | mov eax, 66 |
||
1919 | Albom | 67 | mov ebx, 4 |
1918 | Albom | 68 | mov edx, 0 |
69 | mov cl, 58 |
||
70 | int 0x40 |
||
71 | |||
72 | mov eax, 66 |
||
1919 | Albom | 73 | mov ebx, 4 |
1918 | Albom | 74 | mov edx, 0 |
75 | mov cl, 70 |
||
76 | int 0x40 |
||
77 | |||
78 | ret |
||
79 | |||
1919 | Albom | 80 | align 4 |
81 | draw_window: |
||
82 | pushad |
||
83 | mcall 12,1 |
||
6165 | leency | 84 | mov edx, [sc.work] |
85 | or edx, 0x34000000 |
||
86 | mcall 0, (10 shl 16)+100, (10 shl 16)+75 |
||
1918 | Albom | 87 | |
1919 | Albom | 88 | stdcall [check_box_draw], ch1 |
89 | stdcall [check_box_draw], ch2 |
||
90 | stdcall [check_box_draw], ch3 |
||
91 | mcall 12,2 |
||
92 | popad |
||
93 | ret |
||
1918 | Albom | 94 | |
1919 | Albom | 95 | align 4 |
96 | key: |
||
97 | mcall 2 |
||
98 | call _indicators_check |
||
99 | jmp still |
||
1918 | Albom | 100 | |
1919 | Albom | 101 | align 4 |
1918 | Albom | 102 | _indicators_check: |
103 | pusha |
||
1919 | Albom | 104 | mov eax, 66 |
105 | mov ebx, 3 |
||
106 | int 40h |
||
1918 | Albom | 107 | |
108 | test_ins: |
||
1919 | Albom | 109 | test eax, 0x80 |
110 | jz @f |
||
111 | bts dword[ch1.flags],1 |
||
112 | jmp test_caps |
||
1918 | Albom | 113 | @@: |
1919 | Albom | 114 | btr dword[ch1.flags],1 |
1918 | Albom | 115 | |
116 | test_caps: |
||
1919 | Albom | 117 | test eax, 0x40 |
118 | jz @f |
||
119 | bts dword[ch2.flags],1 |
||
120 | jmp test_scroll |
||
121 | @@: |
||
122 | btr dword[ch2.flags],1 |
||
1918 | Albom | 123 | |
124 | test_scroll: |
||
1919 | Albom | 125 | test eax, 0x100 |
126 | jz @f |
||
127 | bts dword[ch3.flags],1 |
||
128 | jmp test_ok |
||
1918 | Albom | 129 | @@: |
1919 | Albom | 130 | btr dword[ch3.flags],1 |
1918 | Albom | 131 | |
132 | test_ok: |
||
1919 | Albom | 133 | call draw_window |
1918 | Albom | 134 | popa |
135 | ret |
||
136 | |||
1919 | Albom | 137 | align 4 |
138 | button: |
||
139 | mcall 17 |
||
140 | cmp ah,1 |
||
141 | jne still |
||
142 | .exit: |
||
143 | mcall -1 |
||
1918 | Albom | 144 | |
145 | |||
1919 | Albom | 146 | check_boxes: |
147 | ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
||
148 | txt_160,0+ch_flag_middle |
||
149 | ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
||
150 | txt_159,0+ch_flag_middle |
||
151 | ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
||
152 | txt_158,0+ch_flag_middle |
||
153 | check_boxes_end: |
||
154 | |||
3628 | fedesco | 155 | if lang eq it |
156 | txt_160 db 'Bloc Num',0 |
||
157 | txt_159 db 'Bloc Maiusc',0 |
||
158 | txt_158 db 'Bloc Scorr',0 |
||
159 | else |
||
160 | txt_160 db 'Num',0 |
||
161 | txt_159 db 'Caps',0 |
||
162 | txt_158 db 'Scroll',0 |
||
163 | end if |
||
1919 | Albom | 164 | head_f_i: |
165 | head_f_l db 'Системная ошибка',0 |
||
166 | |||
167 | system_dir_0 db '/sys/lib/' |
||
168 | lib_name_0 db 'box_lib.obj',0 |
||
169 | err_msg_found_lib_0 db 'Не найдена библиотека box_lib.obj',0 |
||
170 | err_msg_import_0 db 'Ошибка при импорте библиотеки box_lib',0 |
||
171 | |||
172 | l_libs_start: |
||
173 | lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\ |
||
174 | err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i |
||
175 | l_libs_end: |
||
176 | |||
177 | align 4 |
||
178 | import_box_lib: |
||
179 | ;init dd sz_init |
||
180 | init_checkbox dd sz_init_checkbox |
||
181 | check_box_draw dd sz_check_box_draw |
||
182 | check_box_mouse dd sz_check_box_mouse |
||
183 | dd 0,0 |
||
184 | ;sz_init db 'lib_init',0 |
||
185 | sz_init_checkbox db 'init_checkbox2',0 |
||
186 | sz_check_box_draw db 'check_box_draw2',0 |
||
187 | sz_check_box_mouse db 'check_box_mouse2',0 |
||
188 | |||
189 | ;mouse_dd dd 0x0 |
||
3628 | fedesco | 190 | sc system_colors |
1919 | Albom | 191 | |
1918 | Albom | 192 | _end: |
193 | align 32 |
||
1919 | Albom | 194 | rb 2048 |
195 | stacktop: |
||
196 | sys_path rb 1024 |
||
197 | library_path rb 1024 |
||
1918 | Albom | 198 | _memory: |