Rev 1919 | Go to most recent revision | 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 |
||
84 | xor eax,eax |
||
85 | mov ebx,(10 shl 16)+100 |
||
86 | mov ecx,(10 shl 16)+75 |
||
87 | mov edx,[sc.work] |
||
88 | or edx,(2 shl 24)+0x10000000+0x20000000 |
||
89 | mov edi,[sc.grab] ;[sc.frame] |
||
90 | mov esi,[sc.grab] |
||
91 | int 0x40 |
||
1918 | Albom | 92 | |
1919 | Albom | 93 | mov eax,8 |
94 | mov ebx,(80 shl 16)+10 |
||
95 | mov cx,-15 |
||
96 | shl ecx,16 |
||
97 | mov cx,10 |
||
98 | mov edx,1 |
||
99 | mov esi,[sc.grab_button] |
||
100 | int 0x40 |
||
1918 | Albom | 101 | |
1919 | Albom | 102 | stdcall [check_box_draw], ch1 |
103 | stdcall [check_box_draw], ch2 |
||
104 | stdcall [check_box_draw], ch3 |
||
105 | mcall 12,2 |
||
106 | popad |
||
107 | ret |
||
1918 | Albom | 108 | |
1919 | Albom | 109 | align 4 |
110 | key: |
||
111 | mcall 2 |
||
112 | call _indicators_check |
||
113 | jmp still |
||
1918 | Albom | 114 | |
1919 | Albom | 115 | align 4 |
1918 | Albom | 116 | _indicators_check: |
117 | pusha |
||
1919 | Albom | 118 | mov eax, 66 |
119 | mov ebx, 3 |
||
120 | int 40h |
||
1918 | Albom | 121 | |
122 | test_ins: |
||
1919 | Albom | 123 | test eax, 0x80 |
124 | jz @f |
||
125 | bts dword[ch1.flags],1 |
||
126 | jmp test_caps |
||
1918 | Albom | 127 | @@: |
1919 | Albom | 128 | btr dword[ch1.flags],1 |
1918 | Albom | 129 | |
130 | test_caps: |
||
1919 | Albom | 131 | test eax, 0x40 |
132 | jz @f |
||
133 | bts dword[ch2.flags],1 |
||
134 | jmp test_scroll |
||
135 | @@: |
||
136 | btr dword[ch2.flags],1 |
||
1918 | Albom | 137 | |
138 | test_scroll: |
||
1919 | Albom | 139 | test eax, 0x100 |
140 | jz @f |
||
141 | bts dword[ch3.flags],1 |
||
142 | jmp test_ok |
||
1918 | Albom | 143 | @@: |
1919 | Albom | 144 | btr dword[ch3.flags],1 |
1918 | Albom | 145 | |
146 | test_ok: |
||
1919 | Albom | 147 | call draw_window |
1918 | Albom | 148 | popa |
149 | ret |
||
150 | |||
1919 | Albom | 151 | align 4 |
152 | button: |
||
153 | mcall 17 |
||
154 | cmp ah,1 |
||
155 | jne still |
||
156 | .exit: |
||
157 | mcall -1 |
||
1918 | Albom | 158 | |
159 | |||
1919 | Albom | 160 | check_boxes: |
161 | ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
||
162 | txt_160,0+ch_flag_middle |
||
163 | ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
||
164 | txt_159,0+ch_flag_middle |
||
165 | ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
||
166 | txt_158,0+ch_flag_middle |
||
167 | check_boxes_end: |
||
168 | |||
3628 | fedesco | 169 | if lang eq it |
170 | txt_160 db 'Bloc Num',0 |
||
171 | txt_159 db 'Bloc Maiusc',0 |
||
172 | txt_158 db 'Bloc Scorr',0 |
||
173 | else |
||
174 | txt_160 db 'Num',0 |
||
175 | txt_159 db 'Caps',0 |
||
176 | txt_158 db 'Scroll',0 |
||
177 | end if |
||
1919 | Albom | 178 | head_f_i: |
179 | head_f_l db 'Системная ошибка',0 |
||
180 | |||
181 | system_dir_0 db '/sys/lib/' |
||
182 | lib_name_0 db 'box_lib.obj',0 |
||
183 | err_msg_found_lib_0 db 'Не найдена библиотека box_lib.obj',0 |
||
184 | err_msg_import_0 db 'Ошибка при импорте библиотеки box_lib',0 |
||
185 | |||
186 | l_libs_start: |
||
187 | lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\ |
||
188 | err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i |
||
189 | l_libs_end: |
||
190 | |||
191 | align 4 |
||
192 | import_box_lib: |
||
193 | ;init dd sz_init |
||
194 | init_checkbox dd sz_init_checkbox |
||
195 | check_box_draw dd sz_check_box_draw |
||
196 | check_box_mouse dd sz_check_box_mouse |
||
197 | dd 0,0 |
||
198 | ;sz_init db 'lib_init',0 |
||
199 | sz_init_checkbox db 'init_checkbox2',0 |
||
200 | sz_check_box_draw db 'check_box_draw2',0 |
||
201 | sz_check_box_mouse db 'check_box_mouse2',0 |
||
202 | |||
203 | ;mouse_dd dd 0x0 |
||
3628 | fedesco | 204 | sc system_colors |
1919 | Albom | 205 | |
1918 | Albom | 206 | _end: |
207 | align 32 |
||
1919 | Albom | 208 | rb 2048 |
209 | stacktop: |
||
210 | sys_path rb 1024 |
||
211 | library_path rb 1024 |
||
1918 | Albom | 212 | _memory: |