Rev 1918 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1918 | Rev 1919 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | ; Keyboard indicators v0.1 |
- | |
2 | ; by Albom |
1 | ; Keyboard indicators v0.2 |
3 | 2 | ; by Albom and IgorA |
|
Line 4... | Line 3... | ||
4 | use32 |
3 | |
5 | org 0 |
4 | use32 |
6 | db 'MENUET01' |
5 | org 0 |
7 | dd 1 |
6 | db 'MENUET01' |
8 | dd _start |
7 | dd 1 |
9 | dd _end |
8 | dd _start |
10 | dd _memory |
9 | dd _end |
11 | dd _stack |
10 | dd _memory |
12 | dd _param |
- | |
13 | dd 0 |
11 | dd stacktop |
- | 12 | dd 0 |
|
- | 13 | dd sys_path |
|
- | 14 | ||
- | 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' |
|
Line -... | Line 20... | ||
- | 20 | ;include 'dll.inc' |
|
Line -... | Line 21... | ||
- | 21 | ||
14 | 22 | @use_library ;_mem mem.Alloc,mem.Free,mem.ReAlloc, dll.Load |
|
- | 23 | ||
- | 24 | align 4 |
|
- | 25 | _start: |
|
Line -... | Line 26... | ||
- | 26 | load_libraries l_libs_start,l_libs_end |
|
- | 27 | mcall 48,3,sc,sizeof.system_colors |
|
15 | 28 | mcall 40,0x27 |
|
16 | _start: |
- | |
17 | - | ||
18 | call _key_set |
- | |
19 | call _wnd_draw |
- | |
20 | - | ||
21 | _event_wait: |
- | |
22 | - | ||
23 | mov eax, 10 |
- | |
24 | int 0x40 |
- | |
25 | - | ||
26 | cmp eax, 1 |
- | |
27 | jne @f |
- | |
28 | call _wnd_draw |
- | |
29 | - | ||
30 | @@: |
- | |
31 | cmp eax, 2 |
- | |
32 | jne @f |
- | |
33 | call _key_check |
- | |
34 | - | ||
35 | @@: |
- | |
36 | cmp eax, 3 |
- | |
37 | jne @f |
- | |
Line -... | Line 29... | ||
- | 29 | ||
- | 30 | init_checkboxes2 check_boxes,check_boxes_end |
|
- | 31 | check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc |
|
- | 32 | call _key_set |
|
- | 33 | ||
- | 34 | align 4 |
|
- | 35 | red_win: |
|
- | 36 | call draw_window |
|
- | 37 | ||
- | 38 | ||
- | 39 | align 4 |
|
- | 40 | still: |
|
- | 41 | mcall 10 |
|
- | 42 | ||
- | 43 | cmp al,1 ;èçì. ïîëîæåíèå îêíà |
|
- | 44 | jz red_win |
|
- | 45 | cmp al,2 |
|
- | 46 | jz key |
|
- | 47 | cmp al,3 |
|
Line 38... | Line 48... | ||
38 | call _btn_check |
48 | jz button |
Line -... | Line 49... | ||
- | 49 | ||
- | 50 | ;stdcall [check_box_mouse], ch1 |
|
39 | 51 | ;stdcall [check_box_mouse], ch2 |
|
40 | @@: |
52 | ;stdcall [check_box_mouse], ch3 |
41 | - | ||
42 | 53 | ||
- | 54 | jmp still |
|
43 | jmp _event_wait |
55 | |
44 | 56 | ;óñòàíîâèòü îáùåñèñòåìíûå "ãîðÿ÷èå êëàâèøè" |
|
Line 45... | Line 57... | ||
45 | _key_set: |
57 | align 4 |
46 | mov eax, 66 |
- | |
47 | mov edx, 0 |
58 | _key_set: |
- | 59 | mov eax, 66 |
|
48 | mov ebx, 4 |
60 | mov ebx, 4 |
49 | mov cl, 69 |
61 | mov edx, 0 |
Line 50... | Line 62... | ||
50 | int 0x40 |
62 | mov cl, 69 |
51 | - | ||
52 | mov eax, 66 |
63 | int 0x40 |
- | 64 | ||
53 | mov edx, 0 |
65 | mov eax, 66 |
54 | mov ebx, 4 |
66 | mov ebx, 4 |
Line 55... | Line 67... | ||
55 | mov cl, 58 |
67 | mov edx, 0 |
Line 56... | Line 68... | ||
56 | int 0x40 |
68 | mov cl, 58 |
57 | 69 | int 0x40 |
|
58 | mov eax, 66 |
70 | |
59 | mov edx, 0 |
- | |
60 | mov ebx, 4 |
71 | mov eax, 66 |
61 | mov cl, 70 |
- | |
62 | int 0x40 |
- | |
63 | - | ||
64 | ret |
72 | mov ebx, 4 |
65 | 73 | mov edx, 0 |
|
66 | 74 | mov cl, 70 |
|
67 | _wnd_draw: |
75 | int 0x40 |
- | 76 | ||
- | 77 | ret |
|
68 | pusha |
78 | |
69 | 79 | align 4 |
|
70 | mov eax, 12 |
80 | draw_window: |
- | 81 | pushad |
|
71 | mov ebx, 1 |
82 | mcall 12,1 |
- | 83 | xor eax,eax |
|
72 | int 0x40 |
84 | mov ebx,(10 shl 16)+100 |
73 | 85 | mov ecx,(10 shl 16)+75 |
|
74 | xor eax, eax |
86 | mov edx,[sc.work] |
- | 87 | or edx,(2 shl 24)+0x10000000+0x20000000 |
|
75 | mov ebx, 10*65536+100 |
88 | mov edi,[sc.grab] ;[sc.frame] |
76 | mov ecx, 10*65536+30 |
89 | mov esi,[sc.grab] |
- | 90 | int 0x40 |
|
- | 91 | ||
- | 92 | mov eax,8 |
|
- | 93 | mov ebx,(80 shl 16)+10 |
|
77 | mov edx, 0x34ffffff |
94 | mov cx,-15 |
78 | mov edi, _ind |
95 | shl ecx,16 |
Line 79... | Line 96... | ||
79 | int 0x40 |
96 | mov cx,10 |
80 | 97 | mov edx,1 |
|
81 | call _indicators_check |
98 | mov esi,[sc.grab_button] |
82 | - | ||
83 | mov eax, 12 |
- | |
84 | mov ebx, 2 |
99 | int 0x40 |
- | 100 | ||
Line 85... | Line -... | ||
85 | int 0x40 |
- | |
86 | - | ||
87 | popa |
- | |
88 | ret |
- | |
89 | - | ||
90 | _key_check: |
- | |
91 | pusha |
101 | stdcall [check_box_draw], ch1 |
92 | mov eax, 2 |
- | |
93 | int 0x40 |
- | |
94 | - | ||
95 | call _indicators_check |
- | |
96 | - | ||
97 | popa |
- | |
98 | ret |
- | |
99 | - | ||
100 | _btn_check: |
- | |
101 | pusha |
102 | stdcall [check_box_draw], ch2 |
102 | mov eax, 17 |
103 | stdcall [check_box_draw], ch3 |
103 | int 0x40 |
104 | mcall 12,2 |
104 | cmp ah, 1 |
105 | popad |
105 | jne @f |
106 | ret |
Line 106... | Line 107... | ||
106 | mov eax, -1 |
107 | |
107 | int 0x40 |
108 | align 4 |
108 | @@: |
109 | key: |
109 | popa |
110 | mcall 2 |
110 | ret |
111 | call _indicators_check |
111 | 112 | jmp still |
|
112 | 113 | ||
Line 113... | Line 114... | ||
113 | _indicators_check: |
114 | align 4 |
114 | pusha |
115 | _indicators_check: |
115 | mov eax, 66 |
116 | pusha |
116 | mov ebx, 3 |
117 | mov eax, 66 |
117 | int 40h |
118 | mov ebx, 3 |
118 | 119 | int 40h |
|
119 | test_ins: |
120 | |
Line 120... | Line 121... | ||
120 | test eax, 0x80 |
121 | test_ins: |
121 | jz @f |
122 | test eax, 0x80 |
122 | mov [_ind], '*' |
123 | jz @f |
123 | jmp test_caps |
124 | bts dword[ch1.flags],1 |
124 | @@: |
125 | jmp test_caps |
125 | mov [_ind], 'o' |
126 | @@: |
126 | 127 | btr dword[ch1.flags],1 |
|
Line 127... | Line 128... | ||
127 | test_caps: |
128 | |
128 | test eax, 0x40 |
- | |
129 | jz @f |
- | |
130 | mov [_ind+1], '*' |
129 | test_caps: |
131 | jmp test_scroll |
- | |
132 | @@: |
130 | test eax, 0x40 |
133 | mov [_ind+1], 'o' |
131 | jz @f |
Line -... | Line 132... | ||
- | 132 | bts dword[ch2.flags],1 |
|
- | 133 | jmp test_scroll |
|
- | 134 | @@: |
|
- | 135 | btr dword[ch2.flags],1 |
|
- | 136 | ||
- | 137 | test_scroll: |
|
- | 138 | test eax, 0x100 |
|
- | 139 | jz @f |
|
- | 140 | bts dword[ch3.flags],1 |
|
- | 141 | jmp test_ok |
|
- | 142 | @@: |
|
- | 143 | btr dword[ch3.flags],1 |
|
- | 144 | ||
- | 145 | test_ok: |
|
- | 146 | call draw_window |
|
- | 147 | popa |
|
- | 148 | ret |
|
- | 149 | ||
134 | 150 | align 4 |
|
- | 151 | button: |
|
- | 152 | mcall 17 |
|
- | 153 | cmp ah,1 |
|
- | 154 | jne still |
|
- | 155 | .exit: |
|
- | 156 | mcall -1 |
|
- | 157 | ||
- | 158 | ||
- | 159 | check_boxes: |
|
- | 160 | ch1 check_box2 (5 shl 16)+15,(5 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
|
- | 161 | txt_160,0+ch_flag_middle |
|
- | 162 | ch2 check_box2 (5 shl 16)+15,(17 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
|
- | 163 | txt_159,0+ch_flag_middle |
|
- | 164 | ch3 check_box2 (5 shl 16)+15,(29 shl 16)+10,5, 0xffffff,0x8000,0xff,\ |
|
- | 165 | txt_158,0+ch_flag_middle |
|
- | 166 | check_boxes_end: |
|
- | 167 | ||
- | 168 | txt_160 db 'Num',0 |
|
- | 169 | txt_159 db 'Caps',0 |
|
- | 170 | txt_158 db 'Scroll',0 |
|
- | 171 | ||
- | 172 | head_f_i: |
|
- | 173 | head_f_l db 'Ñèñòåìíàÿ îøèáêà',0 |
|
- | 174 | ||
- | 175 | system_dir_0 db '/sys/lib/' |
|
- | 176 | lib_name_0 db 'box_lib.obj',0 |
|
- | 177 | err_msg_found_lib_0 db 'Íå íàéäåíà áèáëèîòåêà box_lib.obj',0 |
|
Line 135... | Line 178... | ||
135 | test_scroll: |
178 | err_msg_import_0 db 'Îøèáêà ïðè èìïîðòå áèáëèîòåêè box_lib',0 |
136 | test eax, 0x100 |
179 | |
Line 137... | Line 180... | ||
137 | jz @f |
180 | l_libs_start: |
138 | mov [_ind+2], '*' |
- | |
139 | jmp test_ok |
181 | lib_0 l_libs lib_name_0, sys_path, library_path, system_dir_0,\ |
140 | @@: |
182 | err_msg_found_lib_0,head_f_l,import_box_lib,err_msg_import_0,head_f_i |
141 | mov [_ind+2], 'o' |
183 | l_libs_end: |
- | 184 | ||
- | 185 | align 4 |
|
142 | 186 | import_box_lib: |