Rev 109 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 109 | Rev 485 | ||
---|---|---|---|
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ; ; |
2 | ; ; |
3 | ; DIALOGS1.INC ; |
3 | ; DIALOGS1.INC ; |
4 | ; ; |
4 | ; ; |
5 | ; COMPILE WITH FASM for MENUET ; |
5 | ; COMPILE WITH FASM for MENUET ; |
6 | ; ; |
6 | ; ; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8 | 8 | ||
9 | 9 | ||
10 | menus dd 3 ; number of menus |
10 | menus dd 3 ; number of menus |
11 | m_x dd 0x5 ; x start |
11 | m_x dd 0x5 ; x start |
12 | m_y dd 20 ; y start |
12 | m_y dd 20 ; y start |
13 | m_xs dd 290 ; x size |
13 | m_xs dd 290 ; x size |
14 | m_ys dd 14 ; y size |
14 | m_ys dd 14 ; y size |
15 | g_stack dd 0xf000 ; thread stack - required |
15 | g_stack dd 0xf000 ; thread stack - required |
16 | 16 | ||
17 | 17 | ||
18 | menu:; AB C D E F G |
18 | menu:; AB C D E F G |
19 | 19 | ||
20 | db '*D FILE +Save File +Load File +- +Quit ' |
20 | db '*D FILE +Save File +Load File +- +Quit ' |
21 | db '*B EDIT +Copy +Paste ' |
21 | db '*B EDIT +Copy +Paste ' |
22 | db '*B HELP +Setup +About.. ' |
22 | db '*B HELP +Setup +About.. ' |
23 | db '@' ; end mark |
23 | db '@' ; end mark |
24 | 24 | ||
25 | ; A : Data type '*' -> New menu , '+' -> menu selection |
25 | ; A : Data type '*' -> New menu , '+' -> menu selection |
26 | ; B : Number of selections in menu (A+) |
26 | ; B : Number of selections in menu (A+) |
27 | ; C : Menu header text |
27 | ; C : Menu header text |
28 | ; D-G : Menu selection text |
28 | ; D-G : Menu selection text |
29 | 29 | ||
30 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
30 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
31 | ; |
31 | ; |
32 | ; DATA BELOW IS FOR DIALOGS1.INC INTERNALS |
32 | ; DATA BELOW IS FOR DIALOGS1.INC INTERNALS |
33 | 33 | ||
34 | menu_action dd '----' |
34 | menu_action dd '----' |
35 | 35 | ||
36 | window_on db 0 |
36 | window_on db 0 |
37 | 37 | ||
38 | g_n dd -1 |
38 | g_n dd -1 |
39 | g_x dd 0x0 |
39 | g_x dd 0x0 |
40 | g_t dd 0x0 |
40 | g_t dd 0x0 |
41 | g_1 dd 0x0 |
41 | g_1 dd 0x0 |
42 | g_l dd 0x0 |
42 | g_l dd 0x0 |
43 | closet db 0 |
43 | closet db 0 |
44 | 44 | ||
45 | table: times 1024 db 0 |
45 | table: times 1024 db 0 |
46 | 46 | ||
47 | last_mouse dd 0x0 |
47 | last_mouse dd 0x0 |
48 | 48 | ||
49 | mo_x dd 0x0 |
49 | mo_x dd 0x0 |
50 | mo_y dd 0x0 |
50 | mo_y dd 0x0 |
51 | 51 | ||
52 | 52 | ||
53 | check_mouse: |
53 | check_mouse: |
54 | 54 | ||
55 | pusha |
55 | pusha |
56 | 56 | ||
57 | cmp [window_on],1 |
57 | cmp [window_on],1 |
58 | je no_open |
58 | je no_open |
59 | 59 | ||
60 | mov eax,37 |
60 | mov eax,37 |
61 | mov ebx,2 |
61 | mov ebx,2 |
62 | int 0x40 |
62 | mcall |
63 | 63 | ||
64 | cmp [window_on],0 |
64 | cmp [window_on],0 |
65 | jne openw2 |
65 | jne openw2 |
66 | 66 | ||
67 | cmp eax,0 |
67 | cmp eax,0 |
68 | je no_open |
68 | je no_open |
69 | 69 | ||
70 | openw2: |
70 | openw2: |
71 | 71 | ||
72 | waitformouse: |
72 | waitformouse: |
73 | 73 | ||
74 | mov eax,23 |
74 | mov eax,23 |
75 | mov ebx,2 |
75 | mov ebx,2 |
76 | int 0x40 |
76 | mcall |
77 | 77 | ||
78 | cmp eax,0 |
78 | cmp eax,0 |
79 | jne no_open |
79 | jne no_open |
80 | 80 | ||
81 | mov eax,37 |
81 | mov eax,37 |
82 | mov ebx,2 |
82 | mov ebx,2 |
83 | int 0x40 |
83 | mcall |
84 | 84 | ||
85 | cmp eax,0 |
85 | cmp eax,0 |
86 | jne waitformouse |
86 | jne waitformouse |
87 | 87 | ||
88 | 88 | ||
89 | mov eax,37 |
89 | mov eax,37 |
90 | mov ebx,1 |
90 | mov ebx,1 |
91 | int 0x40 |
91 | mcall |
92 | 92 | ||
93 | mov esi,eax |
93 | mov esi,eax |
94 | 94 | ||
95 | shr eax,16 |
95 | shr eax,16 |
96 | xor edx,edx |
96 | xor edx,edx |
97 | mov ebx,50 |
97 | mov ebx,50 |
98 | div ebx |
98 | div ebx |
99 | mov edx,eax |
99 | mov edx,eax |
100 | cmp edx,[g_n] |
100 | cmp edx,[g_n] |
101 | je no_open |
101 | je no_open |
102 | cmp edx,[menus] |
102 | cmp edx,[menus] |
103 | jge no_open |
103 | jge no_open |
104 | mov eax,esi |
104 | mov eax,esi |
105 | 105 | ||
106 | and eax,0xffff |
106 | and eax,0xffff |
107 | 107 | ||
108 | mov ebx,[m_y] |
108 | mov ebx,[m_y] |
109 | cmp eax,ebx |
109 | cmp eax,ebx |
110 | jbe no_open |
110 | jbe no_open |
111 | add ebx,[m_ys] |
111 | add ebx,[m_ys] |
112 | cmp eax,ebx |
112 | cmp eax,ebx |
113 | jge no_open |
113 | jge no_open |
114 | 114 | ||
115 | cmp [window_on],0 |
115 | cmp [window_on],0 |
116 | je noww |
116 | je noww |
117 | 117 | ||
118 | mov [closet],1 |
118 | mov [closet],1 |
119 | mov ecx,100 |
119 | mov ecx,100 |
120 | waitm: |
120 | waitm: |
121 | mov eax,5 |
121 | mov eax,5 |
122 | mov ebx,1 |
122 | mov ebx,1 |
123 | int 0x40 |
123 | mcall |
124 | dec ecx |
124 | dec ecx |
125 | jz no_open |
125 | jz no_open |
126 | cmp [window_on],0 |
126 | cmp [window_on],0 |
127 | jne waitm |
127 | jne waitm |
128 | noww: |
128 | noww: |
129 | 129 | ||
130 | mov eax,edx |
130 | mov eax,edx |
131 | jmp cll |
131 | jmp cll |
132 | 132 | ||
133 | no_open: |
133 | no_open: |
134 | 134 | ||
135 | mov [last_mouse],esi |
135 | mov [last_mouse],esi |
136 | 136 | ||
137 | popa |
137 | popa |
138 | 138 | ||
139 | ret |
139 | ret |
140 | 140 | ||
141 | cll: |
141 | cll: |
142 | 142 | ||
143 | mov [window_on],2 |
143 | mov [window_on],2 |
144 | 144 | ||
145 | mov [g_n],eax |
145 | mov [g_n],eax |
146 | mov [g_x],96 |
146 | mov [g_x],96 |
147 | mov [g_t],0 |
147 | mov [g_t],0 |
148 | mov [g_1],1 |
148 | mov [g_1],1 |
149 | 149 | ||
150 | mov eax,9 |
150 | mov eax,9 |
151 | mov ebx,table |
151 | mov ebx,table |
152 | mov ecx,-1 |
152 | mov ecx,-1 |
153 | int 0x40 |
153 | mcall |
154 | 154 | ||
155 | mov eax,[table+34] |
155 | mov eax,[table+34] |
156 | mov [mo_x],eax |
156 | mov [mo_x],eax |
157 | mov eax,[table+38] |
157 | mov eax,[table+38] |
158 | mov [mo_y],eax |
158 | mov [mo_y],eax |
159 | 159 | ||
160 | mov eax,51 |
160 | mov eax,51 |
161 | mov ebx,1 |
161 | mov ebx,1 |
162 | mov ecx,alert_entry |
162 | mov ecx,alert_entry |
163 | mov edx,[g_stack] |
163 | mov edx,[g_stack] |
164 | int 0x40 |
164 | mcall |
165 | 165 | ||
166 | mov [esp+28],dword 0 ; clear button entry |
166 | mov [esp+28],dword 0 ; clear button entry |
167 | 167 | ||
168 | mov [menu_action],'MD ' |
168 | mov [menu_action],'MD ' |
169 | 169 | ||
170 | check_gr: |
170 | check_gr: |
171 | 171 | ||
172 | popa |
172 | popa |
173 | 173 | ||
174 | ret |
174 | ret |
175 | 175 | ||
176 | 176 | ||
177 | draw_menu: |
177 | draw_menu: |
178 | 178 | ||
179 | mov eax,9 |
179 | mov eax,9 |
180 | mov ebx,table |
180 | mov ebx,table |
181 | mov ecx,-1 |
181 | mov ecx,-1 |
182 | int 0x40 |
182 | mcall |
183 | 183 | ||
184 | cmp [table+46],dword 30 |
184 | cmp [table+46],dword 30 |
185 | jb drmr |
185 | jb drmr |
186 | 186 | ||
187 | mov eax,13 ; white background |
187 | mov eax,13 ; white background |
188 | mov ebx,[m_x] |
188 | mov ebx,[m_x] |
189 | shl ebx,16 |
189 | shl ebx,16 |
190 | add ebx,[m_xs] |
190 | add ebx,[m_xs] |
191 | inc ebx |
191 | inc ebx |
192 | mov ecx,[m_y] |
192 | mov ecx,[m_y] |
193 | shl ecx,16 |
193 | shl ecx,16 |
194 | add ecx,[m_ys] |
194 | add ecx,[m_ys] |
195 | mov edx,0xf0f8ff |
195 | mov edx,0xf0f8ff |
196 | int 0x40 |
196 | mcall |
197 | 197 | ||
198 | mov eax,38 ; egde lines |
198 | mov eax,38 ; egde lines |
199 | mov ebx,[m_x] |
199 | mov ebx,[m_x] |
200 | shl ebx,16 |
200 | shl ebx,16 |
201 | add ebx,[m_x] |
201 | add ebx,[m_x] |
202 | add ebx,[m_xs] |
202 | add ebx,[m_xs] |
203 | mov ecx,[m_y] |
203 | mov ecx,[m_y] |
204 | shl ecx,16 |
204 | shl ecx,16 |
205 | add ecx,[m_y] |
205 | add ecx,[m_y] |
206 | mov edx,0x000000 |
206 | mov edx,0x000000 |
207 | int 0x40 |
207 | mcall |
208 | mov eax,38 |
208 | mov eax,38 |
209 | mov ecx,[m_y] |
209 | mov ecx,[m_y] |
210 | add ecx,[m_ys] |
210 | add ecx,[m_ys] |
211 | shl ecx,16 |
211 | shl ecx,16 |
212 | add ecx,[m_y] |
212 | add ecx,[m_y] |
213 | add ecx,[m_ys] |
213 | add ecx,[m_ys] |
214 | int 0x40 |
214 | mcall |
215 | 215 | ||
216 | mov esi,menu-1 |
216 | mov esi,menu-1 |
217 | mov edi,[m_x] |
217 | mov edi,[m_x] |
218 | mov ebp,1 |
218 | mov ebp,1 |
219 | new_menu: |
219 | new_menu: |
220 | inc esi |
220 | inc esi |
221 | 221 | ||
222 | cmp [esi],byte '*' |
222 | cmp [esi],byte '*' |
223 | jne drmnl1 |
223 | jne drmnl1 |
224 | push esi |
224 | push esi |
225 | mov eax,4 |
225 | mov eax,4 |
226 | mov ebx,edi |
226 | mov ebx,edi |
227 | shl ebx,16 |
227 | shl ebx,16 |
228 | add ebx,[m_y] |
228 | add ebx,[m_y] |
229 | add ebx,0x00050004 |
229 | add ebx,0x00050004 |
230 | mov ecx,0x000000 |
230 | mov ecx,0x000000 |
231 | mov edx,esi |
231 | mov edx,esi |
232 | add edx,3 |
232 | add edx,3 |
233 | mov esi,12 |
233 | mov esi,12 |
234 | int 0x40 ; draw text |
234 | mcall ; draw text |
235 | pop esi |
235 | pop esi |
236 | add esi,2 |
236 | add esi,2 |
237 | add edi,50 |
237 | add edi,50 |
238 | inc ebp |
238 | inc ebp |
239 | 239 | ||
240 | drmnl1: |
240 | drmnl1: |
241 | cmp [esi],byte '@' |
241 | cmp [esi],byte '@' |
242 | jne new_menu |
242 | jne new_menu |
243 | 243 | ||
244 | drmr: |
244 | drmr: |
245 | 245 | ||
246 | ret |
246 | ret |
247 | 247 | ||
248 | alert_box: |
248 | alert_box: |
249 | 249 | ||
250 | ; eax : x size - min 200 |
250 | ; eax : x size - min 200 |
251 | ; ebx : pointer to ASCIIZ - max 128 character text |
251 | ; ebx : pointer to ASCIIZ - max 128 character text |
252 | ; ecx : button 1 id ( OK or YES ) |
252 | ; ecx : button 1 id ( OK or YES ) |
253 | ; edx : button 2 id or zero ( NO ) |
253 | ; edx : button 2 id or zero ( NO ) |
254 | 254 | ||
255 | 255 | ||
256 | cmp [window_on],0 |
256 | cmp [window_on],0 |
257 | jne alert_box_return |
257 | jne alert_box_return |
258 | 258 | ||
259 | mov [window_on],1 |
259 | mov [window_on],1 |
260 | 260 | ||
261 | cmp eax,100 |
261 | cmp eax,100 |
262 | jg size_ok |
262 | jg size_ok |
263 | mov eax,100 |
263 | mov eax,100 |
264 | size_ok: |
264 | size_ok: |
265 | 265 | ||
266 | mov [g_x],eax |
266 | mov [g_x],eax |
267 | mov [g_t],ebx |
267 | mov [g_t],ebx |
268 | mov [g_1],ecx |
268 | mov [g_1],ecx |
269 | 269 | ||
270 | mov ecx,0 |
270 | mov ecx,0 |
271 | new_search: |
271 | new_search: |
272 | cmp [ebx],byte 0 |
272 | cmp [ebx],byte 0 |
273 | je found_len |
273 | je found_len |
274 | inc ebx |
274 | inc ebx |
275 | inc ecx |
275 | inc ecx |
276 | cmp ecx,128 |
276 | cmp ecx,128 |
277 | jbe new_search |
277 | jbe new_search |
278 | found_len: |
278 | found_len: |
279 | mov [g_l],ecx |
279 | mov [g_l],ecx |
280 | 280 | ||
281 | mov eax,51 |
281 | mov eax,51 |
282 | mov ebx,1 |
282 | mov ebx,1 |
283 | mov ecx,alert_entry |
283 | mov ecx,alert_entry |
284 | mov edx,[g_stack] |
284 | mov edx,[g_stack] |
285 | int 0x40 |
285 | mcall |
286 | 286 | ||
287 | mov [menu_action],'MA ' |
287 | mov [menu_action],'MA ' |
288 | 288 | ||
289 | alert_box_return: |
289 | alert_box_return: |
290 | 290 | ||
291 | ret |
291 | ret |
292 | 292 | ||
293 | alert_entry: |
293 | alert_entry: |
294 | 294 | ||
295 | call alert_draw_window |
295 | call alert_draw_window |
296 | 296 | ||
297 | alert_still: |
297 | alert_still: |
298 | 298 | ||
299 | mov eax,23 ; wait here for event |
299 | mov eax,23 ; wait here for event |
300 | mov ebx,1 |
300 | mov ebx,1 |
301 | int 0x40 |
301 | mcall |
302 | 302 | ||
303 | cmp eax,1 ; redraw request ? |
303 | cmp eax,1 ; redraw request ? |
304 | je alert_red |
304 | je alert_red |
305 | cmp eax,2 ; key in buffer ? |
305 | cmp eax,2 ; key in buffer ? |
306 | je alert_key |
306 | je alert_key |
307 | cmp eax,3 ; button in buffer ? |
307 | cmp eax,3 ; button in buffer ? |
308 | je alert_button |
308 | je alert_button |
309 | 309 | ||
310 | cmp [closet],0 |
310 | cmp [closet],0 |
311 | jne ccc |
311 | jne ccc |
312 | 312 | ||
313 | mov eax,9 |
313 | mov eax,9 |
314 | mov ebx,table |
314 | mov ebx,table |
315 | mov ecx,-1 |
315 | mov ecx,-1 |
316 | int 0x40 |
316 | mcall |
317 | 317 | ||
318 | cmp ax,[table+4] |
318 | cmp ax,[table+4] |
319 | je no_close |
319 | je no_close |
320 | ccc: |
320 | ccc: |
321 | mov [closet],0 |
321 | mov [closet],0 |
322 | mov [g_n],-1 |
322 | mov [g_n],-1 |
323 | mov [menu_action],'----' |
323 | mov [menu_action],'----' |
324 | mov [window_on],0 |
324 | mov [window_on],0 |
325 | mov eax,-1 |
325 | mov eax,-1 |
326 | int 0x40 |
326 | mcall |
327 | no_close: |
327 | no_close: |
328 | 328 | ||
329 | jmp alert_still |
329 | jmp alert_still |
330 | 330 | ||
331 | alert_red: ; redraw |
331 | alert_red: ; redraw |
332 | call alert_draw_window |
332 | call alert_draw_window |
333 | jmp alert_still |
333 | jmp alert_still |
334 | 334 | ||
335 | alert_key: ; key |
335 | alert_key: ; key |
336 | mov eax,2 ; just read it and ignore |
336 | mov eax,2 ; just read it and ignore |
337 | int 0x40 |
337 | mcall |
338 | jmp alert_still |
338 | jmp alert_still |
339 | 339 | ||
340 | alert_button: ; button |
340 | alert_button: ; button |
341 | mov eax,17 ; get id |
341 | mov eax,17 ; get id |
342 | int 0x40 |
342 | mcall |
343 | 343 | ||
344 | shr eax,8 |
344 | shr eax,8 |
345 | cmp eax,3 |
345 | cmp eax,3 |
346 | jg no_action1 |
346 | jg no_action1 |
347 | dec eax |
347 | dec eax |
348 | shl eax,2 |
348 | shl eax,2 |
349 | mov eax,dword [eax+rtext] |
349 | mov eax,dword [eax+rtext] |
350 | mov [menu_action],eax |
350 | mov [menu_action],eax |
351 | jmp action_done |
351 | jmp action_done |
352 | no_action1: |
352 | no_action1: |
353 | sub eax,16 |
353 | sub eax,16 |
354 | add eax,65 |
354 | add eax,65 |
355 | shl eax,8 |
355 | shl eax,8 |
356 | mov ebx,[g_n] |
356 | mov ebx,[g_n] |
357 | add ebx,65 |
357 | add ebx,65 |
358 | add eax,ebx |
358 | add eax,ebx |
359 | mov [menu_action],eax |
359 | mov [menu_action],eax |
360 | 360 | ||
361 | action_done: |
361 | action_done: |
362 | 362 | ||
363 | mov [closet],0 |
363 | mov [closet],0 |
364 | mov [g_n],-1 |
364 | mov [g_n],-1 |
365 | mov [window_on],0 |
365 | mov [window_on],0 |
366 | mov eax,-1 ; close this program |
366 | mov eax,-1 ; close this program |
367 | int 0x40 |
367 | mcall |
368 | 368 | ||
369 | rtext db 'NO YES OK ' |
369 | rtext db 'NO YES OK ' |
370 | 370 | ||
371 | jmp alert_still |
371 | jmp alert_still |
372 | 372 | ||
373 | 373 | ||
374 | ; ********************************************* |
374 | ; ********************************************* |
375 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
375 | ; ******* WINDOW DEFINITIONS AND DRAW ******** |
376 | ; ********************************************* |
376 | ; ********************************************* |
377 | 377 | ||
378 | 378 | ||
379 | alert_draw_window: |
379 | alert_draw_window: |
380 | 380 | ||
381 | 381 | ||
382 | mov eax,12 ; function 12:tell os about windowdraw |
382 | mov eax,12 ; function 12:tell os about windowdraw |
383 | mov ebx,1 ; 1, start of draw |
383 | mov ebx,1 ; 1, start of draw |
384 | int 0x40 |
384 | mcall |
385 | 385 | ||
386 | cmp [window_on],2 |
386 | cmp [window_on],2 |
387 | jne no_win_type_2 |
387 | jne no_win_type_2 |
388 | 388 | ||
389 | mov edx,menu-1 |
389 | mov edx,menu-1 |
390 | mov ecx,[g_n] |
390 | mov ecx,[g_n] |
391 | add ecx,1 |
391 | add ecx,1 |
392 | find_menu: |
392 | find_menu: |
393 | inc edx |
393 | inc edx |
394 | cmp [edx],byte '*' |
394 | cmp [edx],byte '*' |
395 | je menu_loop |
395 | je menu_loop |
396 | jmp find_menu |
396 | jmp find_menu |
397 | menu_loop: |
397 | menu_loop: |
398 | loop find_menu |
398 | loop find_menu |
399 | movzx ebp,byte [edx+1] |
399 | movzx ebp,byte [edx+1] |
400 | sub ebp,64 |
400 | sub ebp,64 |
401 | push edx |
401 | push edx |
402 | ; DRAW WINDOW |
402 | ; DRAW WINDOW |
403 | mov eax,0 ; function 0 : define and draw window |
403 | mov eax,0 ; function 0 : define and draw window |
404 | mov ebx,[g_n] |
404 | mov ebx,[g_n] |
405 | imul ebx,50 |
405 | imul ebx,50 |
406 | add ebx,[mo_x] |
406 | add ebx,[mo_x] |
407 | add ebx,[m_x] |
407 | add ebx,[m_x] |
408 | shl ebx,16 |
408 | shl ebx,16 |
409 | add ebx,[g_x] |
409 | add ebx,[g_x] |
410 | mov ecx,[mo_y] |
410 | mov ecx,[mo_y] |
411 | add ecx,[m_y] |
411 | add ecx,[m_y] |
412 | add ecx,[m_ys] |
412 | add ecx,[m_ys] |
413 | shl ecx,16 |
413 | shl ecx,16 |
414 | mov edx,14 |
414 | mov edx,14 |
415 | imul edx,ebp |
415 | imul edx,ebp |
416 | add edx,7 |
416 | add edx,7 |
417 | add ecx,edx |
417 | add ecx,edx |
418 | mov edx,0x00ffffff ; color of work area RRGGBB,8->color gl |
418 | mov edx,0x00ffffff ; color of work area RRGGBB,8->color gl |
419 | mov esi,0x00ffffff ; color of grab bar RRGGBB,8->color gl |
419 | mov esi,0x00ffffff ; color of grab bar RRGGBB,8->color gl |
420 | mov edi,0x000000cc ; color of frames RRGGBB |
420 | mov edi,0x000000cc ; color of frames RRGGBB |
421 | int 0x40 |
421 | mcall |
422 | 422 | ||
423 | pop edx |
423 | pop edx |
424 | 424 | ||
425 | mov ebx,5*65536+7 ; draw info text with function 4 |
425 | mov ebx,5*65536+7 ; draw info text with function 4 |
426 | mov ecx,0x10000000 |
426 | mov ecx,0x10000000 |
427 | mov esi,12 |
427 | mov esi,12 |
428 | mov ebp,16 |
428 | mov ebp,16 |
429 | no_d_found: |
429 | no_d_found: |
430 | inc edx |
430 | inc edx |
431 | cmp [edx],byte '*' |
431 | cmp [edx],byte '*' |
432 | je d_drawed |
432 | je d_drawed |
433 | cmp [edx],byte '@' |
433 | cmp [edx],byte '@' |
434 | je d_drawed |
434 | je d_drawed |
435 | cmp [edx],byte '+' |
435 | cmp [edx],byte '+' |
436 | jne no_d_found |
436 | jne no_d_found |
437 | inc edx |
437 | inc edx |
438 | pusha ; draw button |
438 | pusha ; draw button |
439 | mov eax,8 |
439 | mov eax,8 |
440 | mov ecx,ebx |
440 | mov ecx,ebx |
441 | mov ebx,[g_x] |
441 | mov ebx,[g_x] |
442 | add ebx,0x0000fffe |
442 | add ebx,0x0000fffe |
443 | shl ecx,16 |
443 | shl ecx,16 |
444 | add ecx,0xfffc0000+14 |
444 | add ecx,0xfffc0000+14 |
445 | mov edx,0x40000000 |
445 | mov edx,0x40000000 |
446 | add edx,ebp |
446 | add edx,ebp |
447 | mov esi,0 |
447 | mov esi,0 |
448 | int 0x40 |
448 | mcall |
449 | popa |
449 | popa |
450 | mov eax,4 ; draw text |
450 | mov eax,4 ; draw text |
451 | int 0x40 |
451 | mcall |
452 | inc ebp |
452 | inc ebp |
453 | add ebx,14 |
453 | add ebx,14 |
454 | jmp no_d_found |
454 | jmp no_d_found |
455 | d_drawed: |
455 | d_drawed: |
456 | 456 | ||
457 | no_win_type_2: |
457 | no_win_type_2: |
458 | 458 | ||
459 | 459 | ||
460 | cmp [window_on],1 |
460 | cmp [window_on],1 |
461 | jne no_win_1 |
461 | jne no_win_1 |
462 | 462 | ||
463 | mov eax,14 ; to middle of screen |
463 | mov eax,14 ; to middle of screen |
464 | int 0x40 |
464 | mcall |
465 | mov ecx,eax |
465 | mov ecx,eax |
466 | and ecx,0xffff |
466 | and ecx,0xffff |
467 | shr ecx,1 |
467 | shr ecx,1 |
468 | shr eax,1 |
468 | shr eax,1 |
469 | mov ebx,[g_x] |
469 | mov ebx,[g_x] |
470 | shr ebx,1 |
470 | shr ebx,1 |
471 | shl ebx,16 |
471 | shl ebx,16 |
472 | sub eax,ebx |
472 | sub eax,ebx |
473 | mov ebx,eax |
473 | mov ebx,eax |
474 | 474 | ||
475 | mov eax,0 ; function 0 : define and draw window |
475 | mov eax,0 ; function 0 : define and draw window |
476 | mov bx,word [g_x] |
476 | mov bx,word [g_x] |
477 | sub ecx,80 |
477 | sub ecx,80 |
478 | shl ecx,16 |
478 | shl ecx,16 |
479 | mov cx,110 ; [y start] *65536 + [y size] |
479 | mov cx,110 ; [y start] *65536 + [y size] |
480 | mov edx,0x02ffffff ; color of work area RRGGBB,8->color gl |
480 | mov edx,0x02ffffff ; color of work area RRGGBB,8->color gl |
481 | mov esi,0x80d05050 ; color of grab bar RRGGBB,8->color gl |
481 | mov esi,0x80d05050 ; color of grab bar RRGGBB,8->color gl |
482 | mov edi,0x00d05050 ; color of frames RRGGBB |
482 | mov edi,0x00d05050 ; color of frames RRGGBB |
483 | int 0x40 |
483 | mcall |
484 | 484 | ||
485 | 485 | ||
486 | mov eax,4 ; label |
486 | mov eax,4 ; label |
487 | mov ebx,8*65536+8 |
487 | mov ebx,8*65536+8 |
488 | mov ecx,0x10ddeeff |
488 | mov ecx,0x10ddeeff |
489 | mov edx,alert_labelt1 |
489 | mov edx,alert_labelt1 |
490 | mov esi,alert_label1len-alert_labelt1 |
490 | mov esi,alert_label1len-alert_labelt1 |
491 | int 0x40 |
491 | mcall |
492 | 492 | ||
493 | mov eax,4 |
493 | mov eax,4 |
494 | mov ebx,10*65536+43 |
494 | mov ebx,10*65536+43 |
495 | mov ecx,0x10000000 |
495 | mov ecx,0x10000000 |
496 | mov edx,[g_t] |
496 | mov edx,[g_t] |
497 | mov esi,[g_l] |
497 | mov esi,[g_l] |
498 | int 0x40 |
498 | mcall |
499 | 499 | ||
500 | cmp [g_1],1 |
500 | cmp [g_1],1 |
501 | jne gadgets_no_1 |
501 | jne gadgets_no_1 |
502 | 502 | ||
503 | mov eax,8 |
503 | mov eax,8 |
504 | mov ebx,[g_x] |
504 | mov ebx,[g_x] |
505 | sub ebx,100 |
505 | sub ebx,100 |
506 | shr ebx,1 |
506 | shr ebx,1 |
507 | shl ebx,16 |
507 | shl ebx,16 |
508 | add ebx,30*65536+40 |
508 | add ebx,30*65536+40 |
509 | mov ecx,75*65536+16 |
509 | mov ecx,75*65536+16 |
510 | mov edx,3 |
510 | mov edx,3 |
511 | mov esi,0x446688 |
511 | mov esi,0x446688 |
512 | int 0x40 |
512 | mcall |
513 | 513 | ||
514 | mov eax,4 |
514 | mov eax,4 |
515 | mov ebx,[g_x] |
515 | mov ebx,[g_x] |
516 | sub ebx,100 |
516 | sub ebx,100 |
517 | shr ebx,1 |
517 | shr ebx,1 |
518 | shl ebx,16 |
518 | shl ebx,16 |
519 | add ebx,31*65536+80 |
519 | add ebx,31*65536+80 |
520 | mov ecx,0x10ffffff |
520 | mov ecx,0x10ffffff |
521 | mov edx,alert_t2 |
521 | mov edx,alert_t2 |
522 | mov esi,alert_t2len-alert_t2 |
522 | mov esi,alert_t2len-alert_t2 |
523 | int 0x40 |
523 | mcall |
524 | 524 | ||
525 | gadgets_no_1: |
525 | gadgets_no_1: |
526 | 526 | ||
527 | cmp [g_1],2 |
527 | cmp [g_1],2 |
528 | jne gadgets_no_2 |
528 | jne gadgets_no_2 |
529 | 529 | ||
530 | mov eax,8 |
530 | mov eax,8 |
531 | mov ebx,[g_x] |
531 | mov ebx,[g_x] |
532 | sub ebx,100 |
532 | sub ebx,100 |
533 | shr ebx,1 |
533 | shr ebx,1 |
534 | shl ebx,16 |
534 | shl ebx,16 |
535 | add ebx,0*65536+40 |
535 | add ebx,0*65536+40 |
536 | mov ecx,75*65536+16 |
536 | mov ecx,75*65536+16 |
537 | mov edx,1 |
537 | mov edx,1 |
538 | mov esi,0x446688 |
538 | mov esi,0x446688 |
539 | int 0x40 |
539 | mcall |
540 | 540 | ||
541 | mov eax,8 |
541 | mov eax,8 |
542 | mov ebx,[g_x] |
542 | mov ebx,[g_x] |
543 | sub ebx,100 |
543 | sub ebx,100 |
544 | shr ebx,1 |
544 | shr ebx,1 |
545 | shl ebx,16 |
545 | shl ebx,16 |
546 | add ebx,57*65536+40 |
546 | add ebx,57*65536+40 |
547 | mov ecx,75*65536+16 |
547 | mov ecx,75*65536+16 |
548 | mov edx,2 |
548 | mov edx,2 |
549 | mov esi,0x446688 |
549 | mov esi,0x446688 |
550 | int 0x40 |
550 | mcall |
551 | 551 | ||
552 | mov eax,4 |
552 | mov eax,4 |
553 | mov ebx,[g_x] |
553 | mov ebx,[g_x] |
554 | sub ebx,100 |
554 | sub ebx,100 |
555 | shr ebx,1 |
555 | shr ebx,1 |
556 | shl ebx,16 |
556 | shl ebx,16 |
557 | add ebx,1*65536+80 |
557 | add ebx,1*65536+80 |
558 | mov ecx,0x10ffffff |
558 | mov ecx,0x10ffffff |
559 | mov edx,alert_t1 |
559 | mov edx,alert_t1 |
560 | mov esi,alert_t1len-alert_t1 |
560 | mov esi,alert_t1len-alert_t1 |
561 | int 0x40 |
561 | mcall |
562 | 562 | ||
563 | gadgets_no_2: |
563 | gadgets_no_2: |
564 | 564 | ||
565 | no_win_1: |
565 | no_win_1: |
566 | 566 | ||
567 | mov eax,12 ; function 12:tell os about windowdraw |
567 | mov eax,12 ; function 12:tell os about windowdraw |
568 | mov ebx,2 ; 2, end of draw |
568 | mov ebx,2 ; 2, end of draw |
569 | int 0x40 |
569 | mcall |
570 | 570 | ||
571 | ret |
571 | ret |
572 | 572 | ||
573 | 573 | ||
574 | ; DATA AREA |
574 | ; DATA AREA |
575 | 575 | ||
576 | 576 | ||
577 | alert_t1: |
577 | alert_t1: |
578 | db ' No Yes' |
578 | db ' No Yes' |
579 | alert_t1len: |
579 | alert_t1len: |
580 | 580 | ||
581 | 581 | ||
582 | alert_t2: |
582 | alert_t2: |
583 | db ' OK' |
583 | db ' OK' |
584 | alert_t2len: |
584 | alert_t2len: |
585 | 585 | ||
586 | 586 | ||
587 | alert_labelt1: |
587 | alert_labelt1: |
588 | db 'ALERT' |
588 | db 'ALERT' |
589 | alert_label1len: |
589 | alert_label1len: |