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 | lang equ ru ; ru en fr ge fi |
1 | lang equ ru ; ru en fr ge fi |
2 | 2 | ||
3 | ; |
3 | ; |
4 | ; Assembler |
4 | ; Assembler |
5 | ; SMALL |
5 | ; SMALL |
6 | ; CODE |
6 | ; CODE |
7 | ; Libary |
7 | ; Libary |
8 | ; |
8 | ; |
9 | ; Ver 0.09 By Pavlushin Evgeni (RUSSIA) |
9 | ; Ver 0.09 By Pavlushin Evgeni (RUSSIA) |
10 | ; www.waptap@mail.ru |
10 | ; www.waptap@mail.ru |
11 | 11 | ||
12 | ;InfoList |
12 | ;InfoList |
13 | ;0.01 scank,putpix,puttxt |
13 | ;0.01 scank,putpix,puttxt |
14 | ;0.02 label,random,colors |
14 | ;0.02 label,random,colors |
15 | ;0.03 window,startwd,endwd,attributes |
15 | ;0.03 window,startwd,endwd,attributes |
16 | ;0.04 close,delay,scevent ~30.04.2004 |
16 | ;0.04 close,delay,scevent ~30.04.2004 |
17 | ;0.05 small random, ~04.05.2004 |
17 | ;0.05 small random, ~04.05.2004 |
18 | ;0.06 wtevent ~09.05.2004 |
18 | ;0.06 wtevent ~09.05.2004 |
19 | ;0.07 timeevent ~23.05.2004 |
19 | ;0.07 timeevent ~23.05.2004 |
20 | ;0.08 txtput ~14.06.2004 |
20 | ;0.08 txtput ~14.06.2004 |
21 | ;0.09 opendialog,savedialog ~20.06.2004 |
21 | ;0.09 opendialog,savedialog ~20.06.2004 |
22 | 22 | ||
23 | macro opendialog redproc,openoff,erroff,path,testtime |
23 | macro opendialog redproc,openoff,erroff,path,testtime |
24 | { |
24 | { |
25 | local still, dlg_file, clip_file, redwait |
25 | local still, dlg_file, clip_file, redwait |
26 | local button, key, red, zzz, still, zzz2, incf, file_is_open, zzz3 |
26 | local button, key, red, zzz, still, zzz2, incf, file_is_open, zzz3 |
27 | 27 | ||
28 | mov ecx,200 |
28 | mov ecx,200 |
29 | zzz3: |
29 | zzz3: |
30 | mov byte [path+ecx-1],0 |
30 | mov byte [path+ecx-1],0 |
31 | loop zzz3 |
31 | loop zzz3 |
32 | 32 | ||
33 | dec byte [clip_file+7] |
33 | dec byte [clip_file+7] |
34 | incf: |
34 | incf: |
35 | inc byte [clip_file+7] |
35 | inc byte [clip_file+7] |
36 | mov eax,6 |
36 | mov eax,6 |
37 | mov ebx,clip_file |
37 | mov ebx,clip_file |
38 | mov ecx,0 |
38 | mov ecx,0 |
39 | mov edx,-1 |
39 | or edx,-1 |
40 | mov esi,path |
40 | mov esi,path |
41 | int 0x40 |
41 | mcall |
42 | cmp byte [clip_file+7],'Z' |
42 | cmp byte [clip_file+7],'Z' |
43 | je erroff |
43 | je erroff |
44 | cmp eax,0xffffffff |
44 | cmp eax,0xffffffff |
45 | jne incf |
45 | jne incf |
46 | 46 | ||
47 | mov ecx,200 |
47 | mov ecx,200 |
48 | zzz2: |
48 | zzz2: |
49 | mov byte [path+ecx],0 |
49 | mov byte [path+ecx],0 |
50 | loop zzz2 |
50 | loop zzz2 |
51 | 51 | ||
52 | mov ebx,clip_file |
52 | mov ebx,clip_file |
53 | mov ecx,path |
53 | mov ecx,path |
54 | mov edx,100 |
54 | mov edx,100 |
55 | mov esi,0 |
55 | mov esi,0 |
56 | mov eax,33 |
56 | mov eax,33 |
57 | int 0x40 |
57 | mcall |
58 | 58 | ||
59 | mov ebx,dlg_file |
59 | mov ebx,dlg_file |
60 | mov ecx,clip_file |
60 | mov ecx,clip_file |
61 | mov eax,19 |
61 | mov eax,19 |
62 | int 0x40 |
62 | mcall |
63 | 63 | ||
64 | still: |
64 | still: |
65 | scevent red,key,button |
65 | scevent red,key,button |
66 | cmp byte [path],0 |
66 | cmp byte [path],0 |
67 | jne file_is_open |
67 | jne file_is_open |
68 | cmp dword [redwait],testtime ;20 |
68 | cmp dword [redwait],testtime ;20 |
69 | jnae zzz |
69 | jnae zzz |
70 | mov eax,6 |
70 | mov eax,6 |
71 | mov ebx,clip_file |
71 | mov ebx,clip_file |
72 | mov ecx,0 |
72 | mov ecx,0 |
73 | mov edx,-1 |
73 | mov edx,-1 |
74 | mov esi,path |
74 | mov esi,path |
75 | int 0x40 |
75 | mcall |
76 | cmp eax,0xffffffff |
76 | cmp eax,0xffffffff |
77 | je erroff ;errexit |
77 | je erroff ;errexit |
78 | mov dword [redwait],0 |
78 | mov dword [redwait],0 |
79 | zzz: |
79 | zzz: |
80 | delay 5 |
80 | delay 5 |
81 | inc dword [redwait] |
81 | inc dword [redwait] |
82 | jmp still |
82 | jmp still |
83 | 83 | ||
84 | file_is_open: |
84 | file_is_open: |
85 | mov eax,32 |
85 | mov eax,32 |
86 | mov ebx,clip_file |
86 | mov ebx,clip_file |
87 | int 0x40 |
87 | mcall |
88 | jmp openoff |
88 | jmp openoff |
89 | 89 | ||
90 | key: ; key |
90 | key: ; key |
91 | int 0x40 ; read (eax=2) |
91 | mcall ; read (eax=2) |
92 | jmp still |
92 | jmp still |
93 | button: ; button |
93 | button: ; button |
94 | mov eax,17 ; get id |
94 | mov eax,17 ; get id |
95 | int 0x40 |
95 | mcall |
96 | cmp ah,1 ; button id=1 ? |
96 | cmp ah,1 ; button id=1 ? |
97 | jne still |
97 | jne still |
98 | mov eax,-1 ; close this program |
98 | mov eax,-1 ; close this program |
99 | int 0x40 |
99 | mcall |
100 | 100 | ||
101 | red: |
101 | red: |
102 | call redproc |
102 | call redproc |
103 | jmp still |
103 | jmp still |
104 | 104 | ||
105 | dlg_file db 'SYSXTREE ' |
105 | dlg_file db 'SYSXTREE ' |
106 | clip_file db 'OPENCLPACLP' |
106 | clip_file db 'OPENCLPACLP' |
107 | db 'O' ;Dialog type O-open S-save |
107 | db 'O' ;Dialog type O-open S-save |
108 | db 0 ;Marker |
108 | db 0 ;Marker |
109 | redwait dd 0 |
109 | redwait dd 0 |
110 | } |
110 | } |
111 | 111 | ||
112 | macro savedialog redproc,openoff,erroff,path,testtime |
112 | macro savedialog redproc,openoff,erroff,path,testtime |
113 | { |
113 | { |
114 | local still, dlg_file, clip_file, redwait, zzz3 |
114 | local still, dlg_file, clip_file, redwait, zzz3 |
115 | local button, key, red, zzz, still, zzz2, incf, file_is_open |
115 | local button, key, red, zzz, still, zzz2, incf, file_is_open |
116 | 116 | ||
117 | mov ecx,200 |
117 | mov ecx,200 |
118 | zzz3: |
118 | zzz3: |
119 | mov byte [path+ecx-1],0 |
119 | mov byte [path+ecx-1],0 |
120 | loop zzz3 |
120 | loop zzz3 |
121 | 121 | ||
122 | dec byte [clip_file+7] |
122 | dec byte [clip_file+7] |
123 | incf: |
123 | incf: |
124 | inc byte [clip_file+7] |
124 | inc byte [clip_file+7] |
125 | mov eax,6 |
125 | mov eax,6 |
126 | mov ebx,clip_file |
126 | mov ebx,clip_file |
127 | mov ecx,0 |
127 | mov ecx,0 |
128 | mov edx,-1 |
128 | mov edx,-1 |
129 | mov esi,path |
129 | mov esi,path |
130 | int 0x40 |
130 | mcall |
131 | cmp byte [clip_file+7],'Z' |
131 | cmp byte [clip_file+7],'Z' |
132 | je erroff |
132 | je erroff |
133 | cmp eax,0xffffffff |
133 | cmp eax,0xffffffff |
134 | jne incf |
134 | jne incf |
135 | 135 | ||
136 | mov ecx,200 |
136 | mov ecx,200 |
137 | zzz2: |
137 | zzz2: |
138 | mov byte [path+ecx],0 |
138 | mov byte [path+ecx],0 |
139 | loop zzz2 |
139 | loop zzz2 |
140 | 140 | ||
141 | mov ebx,clip_file |
141 | mov ebx,clip_file |
142 | mov ecx,path |
142 | mov ecx,path |
143 | mov edx,100 |
143 | mov edx,100 |
144 | mov esi,0 |
144 | mov esi,0 |
145 | mov eax,33 |
145 | mov eax,33 |
146 | int 0x40 |
146 | mcall |
147 | 147 | ||
148 | mov ebx,dlg_file |
148 | mov ebx,dlg_file |
149 | mov ecx,clip_file |
149 | mov ecx,clip_file |
150 | mov eax,19 |
150 | mov eax,19 |
151 | int 0x40 |
151 | mcall |
152 | 152 | ||
153 | still: |
153 | still: |
154 | scevent red,key,button |
154 | scevent red,key,button |
155 | cmp byte [path],0 |
155 | cmp byte [path],0 |
156 | jne file_is_open |
156 | jne file_is_open |
157 | cmp dword [redwait],testtime ;20 |
157 | cmp dword [redwait],testtime ;20 |
158 | jnae zzz |
158 | jnae zzz |
159 | mov eax,6 |
159 | mov eax,6 |
160 | mov ebx,clip_file |
160 | mov ebx,clip_file |
161 | mov ecx,0 |
161 | mov ecx,0 |
162 | mov edx,-1 |
162 | mov edx,-1 |
163 | mov esi,path |
163 | mov esi,path |
164 | int 0x40 |
164 | mcall |
165 | cmp eax,0xffffffff |
165 | cmp eax,0xffffffff |
166 | je erroff ;errexit |
166 | je erroff ;errexit |
167 | mov dword [redwait],0 |
167 | mov dword [redwait],0 |
168 | zzz: |
168 | zzz: |
169 | delay 5 |
169 | delay 5 |
170 | inc dword [redwait] |
170 | inc dword [redwait] |
171 | jmp still |
171 | jmp still |
172 | 172 | ||
173 | file_is_open: |
173 | file_is_open: |
174 | mov eax,32 |
174 | mov eax,32 |
175 | mov ebx,clip_file |
175 | mov ebx,clip_file |
176 | int 0x40 |
176 | mcall |
177 | jmp openoff |
177 | jmp openoff |
178 | 178 | ||
179 | key: ; key |
179 | key: ; key |
180 | int 0x40 ; read (eax=2) |
180 | mcall ; read (eax=2) |
181 | jmp still |
181 | jmp still |
182 | button: ; button |
182 | button: ; button |
183 | mov eax,17 ; get id |
183 | mov eax,17 ; get id |
184 | int 0x40 |
184 | mcall |
185 | cmp ah,1 ; button id=1 ? |
185 | cmp ah,1 ; button id=1 ? |
186 | jne still |
186 | jne still |
187 | mov eax,-1 ; close this program |
187 | mov eax,-1 ; close this program |
188 | int 0x40 |
188 | mcall |
189 | 189 | ||
190 | red: |
190 | red: |
191 | call redproc |
191 | call redproc |
192 | jmp still |
192 | jmp still |
193 | 193 | ||
194 | dlg_file db 'SYSXTREE ' |
194 | dlg_file db 'SYSXTREE ' |
195 | clip_file db 'SAVECLPACLP' |
195 | clip_file db 'SAVECLPACLP' |
196 | db 'S' ;Dialog type O-open S-save |
196 | db 'S' ;Dialog type O-open S-save |
197 | db 0 ;Marker |
197 | db 0 ;Marker |
198 | redwait dd 0 |
198 | redwait dd 0 |
199 | } |
199 | } |
200 | 200 | ||
201 | 201 | ||
202 | ; RANDOM - generate random count (small) |
202 | ; RANDOM - generate random count (small) |
203 | ; (SYNTAX) RANDOM MaxCount,OutArgument |
203 | ; (SYNTAX) RANDOM MaxCount,OutArgument |
204 | ; (SAMPLE) RANDOM 10000,eax |
204 | ; (SAMPLE) RANDOM 10000,eax |
205 | ; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations |
205 | ; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations |
206 | 206 | ||
207 | randomuse = 0 |
207 | randomuse = 0 |
208 | 208 | ||
209 | macro random arg1,arg2 |
209 | macro random arg1,arg2 |
210 | { |
210 | { |
211 | local rxproc |
211 | local rxproc |
212 | randomuse = randomuse + 1 |
212 | randomuse = randomuse + 1 |
213 | 213 | ||
214 | jmp rxproc |
214 | jmp rxproc |
215 | 215 | ||
216 | if defined randomuse & randomuse = 1 |
216 | if defined randomuse & randomuse = 1 |
217 | randomproc: |
217 | randomproc: |
218 | jmp rnj |
218 | jmp rnj |
219 | rsx1 dw 0x4321 |
219 | rsx1 dw 0x4321 |
220 | rsx2 dw 0x1234 |
220 | rsx2 dw 0x1234 |
221 | rnj: |
221 | rnj: |
222 | ; mov eax,arg1 |
222 | ; mov eax,arg1 |
223 | push bx |
223 | push bx |
224 | push cx |
224 | push cx |
225 | push dx |
225 | push dx |
226 | push si |
226 | push si |
227 | push di |
227 | push di |
228 | mov cx,ax |
228 | mov cx,ax |
229 | mov ax,word ptr rsx1 |
229 | mov ax,word ptr rsx1 |
230 | mov bx,word ptr rsx2 |
230 | mov bx,word ptr rsx2 |
231 | mov si,ax |
231 | mov si,ax |
232 | mov di,bx |
232 | mov di,bx |
233 | mov dl,ah |
233 | mov dl,ah |
234 | mov ah,al |
234 | mov ah,al |
235 | mov al,bh |
235 | mov al,bh |
236 | mov bh,bl |
236 | mov bh,bl |
237 | xor bl,bl |
237 | xor bl,bl |
238 | rcr dl,1 |
238 | rcr dl,1 |
239 | rcr ax,1 |
239 | rcr ax,1 |
240 | rcr bx,1 |
240 | rcr bx,1 |
241 | add bx,di |
241 | add bx,di |
242 | adc ax,si |
242 | adc ax,si |
243 | add bx,0x62e9 |
243 | add bx,0x62e9 |
244 | adc ax,0x3619 |
244 | adc ax,0x3619 |
245 | mov word ptr rsx1,bx |
245 | mov word ptr rsx1,bx |
246 | mov word ptr rsx2,ax |
246 | mov word ptr rsx2,ax |
247 | xor dx,dx |
247 | xor dx,dx |
248 | cmp ax,0 |
248 | cmp ax,0 |
249 | je nodiv |
249 | je nodiv |
250 | cmp cx,0 |
250 | cmp cx,0 |
251 | je nodiv |
251 | je nodiv |
252 | div cx |
252 | div cx |
253 | nodiv: |
253 | nodiv: |
254 | mov ax,dx |
254 | mov ax,dx |
255 | pop di |
255 | pop di |
256 | pop si |
256 | pop si |
257 | pop dx |
257 | pop dx |
258 | pop cx |
258 | pop cx |
259 | pop bx |
259 | pop bx |
260 | ; mov arg2,0 |
260 | ; mov arg2,0 |
261 | ; mov arg2,eax |
261 | ; mov arg2,eax |
262 | ret |
262 | ret |
263 | end if |
263 | end if |
264 | 264 | ||
265 | rxproc: |
265 | rxproc: |
266 | mov eax,arg1 |
266 | mov eax,arg1 |
267 | call randomproc |
267 | call randomproc |
268 | mov arg2,0 |
268 | mov arg2,0 |
269 | mov arg2,eax |
269 | mov arg2,eax |
270 | } |
270 | } |
271 | 271 | ||
272 | macro scank |
272 | macro scank |
273 | { |
273 | { |
274 | mov eax,10 |
274 | mov eax,10 |
275 | int 0x40 |
275 | mcall |
276 | } |
276 | } |
277 | 277 | ||
278 | macro putpix x,y,color |
278 | macro putpix x,y,color |
279 | { |
279 | { |
280 | mov ebx,x |
280 | mov ebx,x |
281 | mov ecx,y |
281 | mov ecx,y |
282 | mov edx,color |
282 | mov edx,color |
283 | mov eax,1 |
283 | mov eax,1 |
284 | int 0x40 |
284 | mcall |
285 | } |
285 | } |
286 | 286 | ||
287 | macro puttxt x,y,offs,size,color |
287 | macro puttxt x,y,offs,size,color |
288 | { |
288 | { |
289 | mov ebx,x |
289 | mov ebx,x |
290 | shl ebx,16 |
290 | shl ebx,16 |
291 | add ebx,y |
291 | add ebx,y |
292 | mov ecx,color |
292 | mov ecx,color |
293 | mov edx,offs |
293 | mov edx,offs |
294 | mov esi,size |
294 | mov esi,size |
295 | mov eax,4 |
295 | mov eax,4 |
296 | int 0x40 |
296 | mcall |
297 | } |
297 | } |
298 | 298 | ||
299 | ;_ equ '____' |
299 | ;_ equ '____' |
300 | 300 | ||
301 | ;macro libtest x,y,color |
301 | ;macro libtest x,y,color |
302 | ;{ |
302 | ;{ |
303 | ;if x = as dword |
303 | ;if x = as dword |
304 | ; mov ebx,x |
304 | ; mov ebx,x |
305 | ;end if |
305 | ;end if |
306 | ; mov ecx,y |
306 | ; mov ecx,y |
307 | ; mov edx,color |
307 | ; mov edx,color |
308 | ; mov eax,1 |
308 | ; mov eax,1 |
309 | ; int 0x40 |
309 | ; mcall |
310 | ;} |
310 | ;} |
311 | 311 | ||
312 | 312 | ||
313 | macro outcount data, x, y, color, numtype |
313 | macro outcount data, x, y, color, numtype |
314 | { |
314 | { |
315 | mov ecx,data |
315 | mov ecx,data |
316 | mov ebx,numtype |
316 | mov ebx,numtype |
317 | mov bl,0 |
317 | mov bl,0 |
318 | mov edx,x*65536+y |
318 | mov edx,x*65536+y |
319 | mov esi,color |
319 | mov esi,color |
320 | mov eax,47 |
320 | mov eax,47 |
321 | int 0x40 |
321 | mcall |
322 | } |
322 | } |
323 | 323 | ||
324 | ; SCEVENT - Scan event |
324 | ; SCEVENT - Scan event |
325 | 325 | ||
326 | macro scevent red,key,but |
326 | macro scevent red,key,but |
327 | { |
327 | { |
328 | mov eax,11 |
328 | mov eax,11 |
329 | int 0x40 |
329 | mcall |
330 | dec eax |
330 | dec eax |
331 | jz red |
331 | jz red |
332 | dec eax |
332 | dec eax |
333 | jz key |
333 | jz key |
334 | dec eax |
334 | dec eax |
335 | jz but |
335 | jz but |
336 | } |
336 | } |
337 | 337 | ||
338 | ; WTEVENT - Wait event |
338 | ; WTEVENT - Wait event |
339 | 339 | ||
340 | macro wtevent red,key,but |
340 | macro wtevent red,key,but |
341 | { |
341 | { |
342 | mov eax,10 |
342 | mov eax,10 |
343 | int 0x40 |
343 | mcall |
344 | dec eax |
344 | dec eax |
345 | jz red |
345 | jz red |
346 | dec eax |
346 | dec eax |
347 | jz key |
347 | jz key |
348 | dec eax |
348 | dec eax |
349 | jz but |
349 | jz but |
350 | } |
350 | } |
351 | 351 | ||
352 | ; TIMEEVENT - Wite for event with timeout |
352 | ; TIMEEVENT - Wite for event with timeout |
353 | 353 | ||
354 | macro timeevent xfps,noevent,red,key,but |
354 | macro timeevent xfps,noevent,red,key,but |
355 | { |
355 | { |
356 | mov eax,23 |
356 | mov eax,23 |
357 | mov ebx,xfps |
357 | mov ebx,xfps |
358 | int 0x40 |
358 | mcall |
359 | cmp eax,0 |
359 | cmp eax,0 |
360 | je noevent |
360 | je noevent |
361 | dec eax |
361 | dec eax |
362 | jz red |
362 | jz red |
363 | dec eax |
363 | dec eax |
364 | jz key |
364 | jz key |
365 | dec eax |
365 | dec eax |
366 | jz but |
366 | jz but |
367 | } |
367 | } |
368 | 368 | ||
369 | 369 | ||
370 | ; CLOSE - Close program |
370 | ; CLOSE - Close program |
371 | 371 | ||
372 | macro close |
372 | macro close |
373 | { |
373 | { |
374 | mov eax,-1 |
374 | mov eax,-1 |
375 | int 0x40 |
375 | mcall |
376 | } |
376 | } |
377 | 377 | ||
378 | ; DELAY - Create delay 1/100 sec |
378 | ; DELAY - Create delay 1/100 sec |
379 | ; (SYNTAX) Delay time |
379 | ; (SYNTAX) Delay time |
380 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
380 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
381 | 381 | ||
382 | macro delay arg1 |
382 | macro delay arg1 |
383 | { |
383 | { |
384 | mov eax,5 |
384 | mov eax,5 |
385 | mov ebx,arg1 |
385 | mov ebx,arg1 |
386 | int 0x40 |
386 | mcall |
387 | } |
387 | } |
388 | 388 | ||
389 | ; WINDOW - Draw window |
389 | ; WINDOW - Draw window |
390 | ; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color |
390 | ; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color |
391 | ; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned |
391 | ; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned |
392 | 392 | ||
393 | macro window arg1,arg2,arg3,arg4,arg5 |
393 | macro window arg1,arg2,arg3,arg4,arg5 |
394 | { |
394 | { |
395 | mov ebx,arg1*65536+arg3 |
395 | mov ebx,arg1*65536+arg3 |
396 | mov ecx,arg2*65536+arg4 |
396 | mov ecx,arg2*65536+arg4 |
397 | mov edx,arg5 |
397 | mov edx,arg5 |
398 | mov eax,0 |
398 | mov eax,0 |
399 | int 0x40 |
399 | mcall |
400 | } |
400 | } |
401 | 401 | ||
402 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
402 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
403 | { |
403 | { |
404 | mov ebx,arg1*65536+arg3 |
404 | mov ebx,arg1*65536+arg3 |
405 | mov ecx,arg2*65536+arg4 |
405 | mov ecx,arg2*65536+arg4 |
406 | mov edx,arg5 |
406 | mov edx,arg5 |
407 | mov esi,arg6 |
407 | mov esi,arg6 |
408 | mov edi,arg7 |
408 | mov edi,arg7 |
409 | mov eax,0 |
409 | mov eax,0 |
410 | int 0x40 |
410 | mcall |
411 | } |
411 | } |
412 | 412 | ||
413 | 413 | ||
414 | ; STARTWD - Start of window draw |
414 | ; STARTWD - Start of window draw |
415 | 415 | ||
416 | macro startwd |
416 | macro startwd |
417 | { |
417 | { |
418 | mov eax,12 |
418 | mov eax,12 |
419 | mov ebx,1 |
419 | mov ebx,1 |
420 | int 0x40 |
420 | mcall |
421 | } |
421 | } |
422 | 422 | ||
423 | ; ENDWD - End window draw |
423 | ; ENDWD - End window draw |
424 | 424 | ||
425 | macro endwd |
425 | macro endwd |
426 | { |
426 | { |
427 | mov eax,12 |
427 | mov eax,12 |
428 | mov ebx,2 |
428 | mov ebx,2 |
429 | int 0x40 |
429 | mcall |
430 | } |
430 | } |
431 | 431 | ||
432 | ; LABEL - Put text to frame |
432 | ; LABEL - Put text to frame |
433 | ; (SYNTAX) LABEL Xstart,Ystart,'Text',Color |
433 | ; (SYNTAX) LABEL Xstart,Ystart,'Text',Color |
434 | ; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big |
434 | ; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big |
435 | 435 | ||
436 | macro label arg1,arg2,arg3,arg4 |
436 | macro label arg1,arg2,arg3,arg4 |
437 | { |
437 | { |
438 | local asd,lab |
438 | local asd,lab |
439 | jmp asd |
439 | jmp asd |
440 | lab db arg3 ;arg label |
440 | lab db arg3 ;arg label |
441 | asd: |
441 | asd: |
442 | mov ebx,arg1 ;arg1=y arg2=x |
442 | mov ebx,arg1 ;arg1=y arg2=x |
443 | shl ebx,16 |
443 | shl ebx,16 |
444 | add ebx,arg2 |
444 | add ebx,arg2 |
445 | mov ecx,arg4 ;arg4 color |
445 | mov ecx,arg4 ;arg4 color |
446 | mov edx,lab |
446 | mov edx,lab |
447 | mov esi,asd-lab ;calc size |
447 | mov esi,asd-lab ;calc size |
448 | mov eax,4 |
448 | mov eax,4 |
449 | int 0x40 |
449 | mcall |
450 | } |
450 | } |
451 | 451 | ||
452 | ;Key's |
452 | ;Key's |
453 | key_Up equ 178 |
453 | key_Up equ 178 |
454 | key_Down equ 177 |
454 | key_Down equ 177 |
455 | key_Right equ 179 |
455 | key_Right equ 179 |
456 | key_Left equ 176 |
456 | key_Left equ 176 |
457 | key_Esc equ 27 |
457 | key_Esc equ 27 |
458 | key_Space equ 32 |
458 | key_Space equ 32 |
459 | key_Enter equ 13 |
459 | key_Enter equ 13 |
460 | key_Bspace equ 8 |
460 | key_Bspace equ 8 |
461 | key_F1 equ 50 |
461 | key_F1 equ 50 |
462 | key_F2 equ 51 |
462 | key_F2 equ 51 |
463 | key_F3 equ 52 |
463 | key_F3 equ 52 |
464 | key_F4 equ 53 |
464 | key_F4 equ 53 |
465 | key_F5 equ 54 |
465 | key_F5 equ 54 |
466 | key_F6 equ 55 |
466 | key_F6 equ 55 |
467 | key_F7 equ 56 |
467 | key_F7 equ 56 |
468 | key_F8 equ 57 |
468 | key_F8 equ 57 |
469 | key_F9 equ 48 |
469 | key_F9 equ 48 |
470 | key_F10 equ 49 |
470 | key_F10 equ 49 |
471 | key_F11 equ 68 |
471 | key_F11 equ 68 |
472 | key_F12 equ 255 |
472 | key_F12 equ 255 |
473 | key_Home equ 180 |
473 | key_Home equ 180 |
474 | key_End equ 181 |
474 | key_End equ 181 |
475 | key_PgUp equ 184 |
475 | key_PgUp equ 184 |
476 | key_PgDown equ 183 |
476 | key_PgDown equ 183 |
477 | 477 | ||
478 | ;Attributes |
478 | ;Attributes |
479 | 479 | ||
480 | ;Window Attributes |
480 | ;Window Attributes |
481 | window_Skinned equ 0x03000000 |
481 | window_Skinned equ 0x03000000 |
482 | window_Type2 equ 0x02000000 |
482 | window_Type2 equ 0x02000000 |
483 | window_Type1 equ 0x00000000 |
483 | window_Type1 equ 0x00000000 |
484 | window_Reserve equ 0x01000000 |
484 | window_Reserve equ 0x01000000 |
485 | 485 | ||
486 | ;Font Attributes |
486 | ;Font Attributes |
487 | font_Big equ 0x10000000 |
487 | font_Big equ 0x10000000 |
488 | 488 | ||
489 | ;Colors |
489 | ;Colors |
490 | cl_White equ 0x00ffffff |
490 | cl_White equ 0x00ffffff |
491 | cl_Black equ 0x00000000 |
491 | cl_Black equ 0x00000000 |
492 | cl_Grey equ 0x00888888 |
492 | cl_Grey equ 0x00888888 |
493 | cl_Red equ 0x00ff0000 |
493 | cl_Red equ 0x00ff0000 |
494 | cl_Lime equ 0x0000ff00 |
494 | cl_Lime equ 0x0000ff00 |
495 | cl_Green equ 0x0000af00 |
495 | cl_Green equ 0x0000af00 |
496 | cl_Blue equ 0x000000ff |
496 | cl_Blue equ 0x000000ff |
497 | cl_Purple equ 0x008080ff |
497 | cl_Purple equ 0x008080ff |
498 | cl_Violet equ 0x008040ff |
498 | cl_Violet equ 0x008040ff |
499 | cl_Cyan equ 0x0040e0ff65536> |
499 | cl_Cyan equ 0x0040e0ff65536> |