Rev 539 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 539 | Rev 551 | ||
---|---|---|---|
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.14 By Pavlushin Evgeni (RUSSIA) |
9 | ; Ver 0.14 By Pavlushin Evgeni (RUSSIA) |
10 | ; www.waptap@mail.ru |
10 | ; www.waptap@mail.ru |
11 | 11 | ||
12 | ;Please compile aplications on FASM ver1.54 or higer!!! |
12 | ;Please compile aplications on FASM ver1.54 or higer!!! |
13 | 13 | ||
14 | ;InfoList |
14 | ;InfoList |
15 | ;0.01 scank,putpix,puttxt |
15 | ;0.01 scank,putpix,puttxt |
16 | ;0.02 label,random,colors |
16 | ;0.02 label,random,colors |
17 | ;0.03 window,startwd,endwd,attributes |
17 | ;0.03 window,startwd,endwd,attributes |
18 | ;0.04 close,delay,scevent ~30.04.2004 |
18 | ;0.04 close,delay,scevent ~30.04.2004 |
19 | ;0.05 small random, ~04.05.2004 |
19 | ;0.05 small random, ~04.05.2004 |
20 | ;0.06 wtevent ~09.05.2004 |
20 | ;0.06 wtevent ~09.05.2004 |
21 | ;0.07 timeevent ~23.05.2004 |
21 | ;0.07 timeevent ~23.05.2004 |
22 | ;0.08 txtput ~14.06.2004 |
22 | ;0.08 txtput ~14.06.2004 |
23 | ;0.09 opendialog,savedialog ~20.06.2004 |
23 | ;0.09 opendialog,savedialog ~20.06.2004 |
24 | ;0.10 wordstoreg by halyavin, add at ~30.08.2004 |
24 | ;0.10 wordstoreg by halyavin, add at ~30.08.2004 |
25 | ; random bug deleted eax is use. |
25 | ; random bug deleted eax is use. |
26 | ;0.11 loadfile from me +puttxt bug del ~07.09.2004 |
26 | ;0.11 loadfile from me +puttxt bug del ~07.09.2004 |
27 | ;0.12 open/save dialog ~13.09.2004 |
27 | ;0.12 open/save dialog ~13.09.2004 |
28 | ;0.13 dialogs bugs deleted |
28 | ;0.13 dialogs bugs deleted |
29 | ;0.14 drawlbut ~03.10.2004 |
29 | ;0.14 drawlbut ~03.10.2004 |
30 | ;0.15 extendet label! |
30 | ;0.15 extendet label! |
31 | 31 | ||
32 | ; LOADFILE |
32 | ; LOADFILE |
33 | ; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area |
33 | ; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area |
34 | ; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area |
34 | ; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area |
35 | 35 | ||
36 | 36 | ||
37 | macro loadfile file_name,file_load_area,file_temp_area |
37 | macro loadfile file_name,file_load_area,file_temp_area |
38 | { |
38 | { |
39 | local open,fileinfo,string |
39 | local open,fileinfo,string |
40 | jmp open |
40 | jmp open |
41 | fileinfo: |
41 | fileinfo: |
42 | dd 0 |
42 | dd 0 |
43 | dd 0 |
43 | dd 0 |
44 | dd 1 |
44 | dd 1 |
45 | dd file_load_area |
45 | dd file_load_area |
46 | dd file_temp_area |
46 | dd file_temp_area |
47 | string: |
47 | string: |
48 | db file_name,0 |
48 | db file_name,0 |
49 | open: |
49 | open: |
50 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
50 | mov dword [fileinfo+8],1 ; how many blocks to read (1) |
51 | mov eax,58 |
51 | mov eax,58 |
52 | mov ebx,fileinfo |
52 | mov ebx,fileinfo |
53 | mcall |
53 | mcall |
54 | mov eax,[file_load_area+2] |
54 | mov eax,[file_load_area+2] |
55 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
55 | shr eax,9 ; ¯®¤¥«¨¬ 512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢ |
56 | inc eax |
56 | inc eax |
57 | mov dword [fileinfo+8],eax |
57 | mov dword [fileinfo+8],eax |
58 | mov eax,58 |
58 | mov eax,58 |
59 | mov ebx,fileinfo |
59 | mov ebx,fileinfo |
60 | mcall |
60 | mcall |
61 | } |
61 | } |
62 | 62 | ||
63 | 63 | ||
64 | macro wordstoreg reg,hiword,loword |
64 | macro wordstoreg reg,hiword,loword |
65 | { |
65 | { |
66 | if hiword eqtype 0 & loword eqtype 0 |
66 | if hiword eqtype 0 & loword eqtype 0 |
67 | mov reg,dword (hiword)*65536+(loword) |
67 | mov reg,dword (hiword)*65536+(loword) |
68 | else if hiword eqtype 12 & loword eqtype eax |
68 | else if hiword eqtype 12 & loword eqtype eax |
69 | mov reg,dword (hiword)*65536 |
69 | mov reg,dword (hiword)*65536 |
70 | add reg,dword loword |
70 | add reg,dword loword |
71 | else if hiword eqtype 12 & loword eqtype [123] |
71 | else if hiword eqtype 12 & loword eqtype [123] |
72 | mov reg,dword (hiword)*65536 |
72 | mov reg,dword (hiword)*65536 |
73 | add reg,dword loword |
73 | add reg,dword loword |
74 | else |
74 | else |
75 | mov reg,dword hiword |
75 | mov reg,dword hiword |
76 | shl reg,16 |
76 | shl reg,16 |
77 | add reg,dword loword |
77 | add reg,dword loword |
78 | end if |
78 | end if |
79 | } |
79 | } |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | macro dword2reg reg,doubleword |
83 | macro dword2reg reg,doubleword |
84 | { |
84 | { |
85 | if doubleword eq |
85 | if doubleword eq |
86 | ; not changes |
86 | ; not changes |
87 | else |
87 | else |
88 | mov reg,dword doubleword |
88 | mov reg,dword doubleword |
89 | end if |
89 | end if |
90 | } |
90 | } |
91 | 91 | ||
92 | macro words2reg reg,hiword,lowword |
92 | macro words2reg reg,hiword,lowword |
93 | { |
93 | { |
94 | if hiword eq |
94 | if hiword eq |
95 | if lowword eq |
95 | if lowword eq |
96 | ; not changes |
96 | ; not changes |
97 | else |
97 | else |
98 | if lowword eqtype 12 |
98 | if lowword eqtype 12 |
99 | and reg,dword 0xffff0000 |
99 | and reg,dword 0xffff0000 |
100 | add reg,dword lowword |
100 | add reg,dword lowword |
101 | else |
101 | else |
102 | and reg,dword 0xffff0000 |
102 | and reg,dword 0xffff0000 |
103 | add reg,dword lowword |
103 | add reg,dword lowword |
104 | end if |
104 | end if |
105 | end if |
105 | end if |
106 | else |
106 | else |
107 | if lowword eq |
107 | if lowword eq |
108 | if hiword eqtype 12 |
108 | if hiword eqtype 12 |
109 | and reg,dword 0x0000ffff |
109 | and reg,dword 0x0000ffff |
110 | add reg,dword hiword*65536 |
110 | add reg,dword hiword*65536 |
111 | else |
111 | else |
112 | shl reg,16 |
112 | shl reg,16 |
113 | add reg,dword hiword |
113 | add reg,dword hiword |
114 | ror reg,16 |
114 | ror reg,16 |
115 | end if |
115 | end if |
116 | else |
116 | else |
117 | if lowword eqtype 12 & hiword eqtype 12 |
117 | if lowword eqtype 12 & hiword eqtype 12 |
118 | if lowword eq 0 & hiword eq 0 |
118 | if lowword eq 0 & hiword eq 0 |
119 | xor reg,reg |
119 | xor reg,reg |
120 | else |
120 | else |
121 | mov reg,dword hiword*65536+lowword |
121 | mov reg,dword hiword*65536+lowword |
122 | end if |
122 | end if |
123 | else |
123 | else |
124 | mov reg,dword hiword |
124 | mov reg,dword hiword |
125 | shl reg,16 |
125 | shl reg,16 |
126 | add reg,dword lowword |
126 | add reg,dword lowword |
127 | end if |
127 | end if |
128 | end if |
128 | end if |
129 | end if |
129 | end if |
130 | } |
130 | } |
131 | 131 | ||
132 | 132 | ||
133 | 133 | ||
134 | 134 | ||
135 | ; DRAW BUTTON with label |
135 | ; DRAW BUTTON with label |
136 | 136 | ||
137 | macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor |
137 | macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor |
138 | { |
138 | { |
139 | local asd,lab |
139 | local asd,lab |
140 | jmp asd |
140 | jmp asd |
141 | lab db text ;arg label |
141 | lab db text ;arg label |
142 | asd: |
142 | asd: |
143 | words2reg ebx,x,xs |
143 | words2reg ebx,x,xs |
144 | words2reg ecx,y,ys |
144 | words2reg ecx,y,ys |
145 | mov edx,id |
145 | mov edx,id |
146 | mov esi,bcolor |
146 | mov esi,bcolor |
147 | mov eax,8 |
147 | mov eax,8 |
148 | mcall |
148 | mcall |
149 | 149 | ||
150 | mov eax,asd-lab ;calc size |
150 | mov eax,asd-lab ;calc size |
151 | mov ebx,6 |
151 | mov ebx,6 |
152 | mul ebx |
152 | mul ebx |
153 | mov esi,eax |
153 | mov esi,eax |
154 | 154 | ||
155 | mov eax,xs |
155 | mov eax,xs |
156 | sub eax,esi |
156 | sub eax,esi |
157 | shr eax,1 |
157 | shr eax,1 |
158 | add eax,x |
158 | add eax,x |
159 | 159 | ||
160 | mov edx,ys |
160 | mov edx,ys |
161 | sub edx,7 |
161 | sub edx,7 |
162 | shr edx,1 |
162 | shr edx,1 |
163 | add edx,y |
163 | add edx,y |
164 | 164 | ||
165 | mov ebx,eax |
165 | mov ebx,eax |
166 | shl ebx,16 |
166 | shl ebx,16 |
167 | add ebx,edx |
167 | add ebx,edx |
168 | 168 | ||
169 | mov ecx,tcolor ;arg4 color |
169 | mov ecx,tcolor ;arg4 color |
170 | mov edx,lab |
170 | mov edx,lab |
171 | mov esi,asd-lab ;calc size |
171 | mov esi,asd-lab ;calc size |
172 | mov eax,4 |
172 | mov eax,4 |
173 | mcall |
173 | mcall |
174 | } |
174 | } |
175 | 175 | ||
176 | 176 | ||
177 | macro opendialog redproc,openoff,erroff,path |
177 | macro opendialog redproc,openoff,erroff,path |
178 | { |
178 | { |
179 | local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc |
179 | local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc |
180 | local run_fileinfo, param |
180 | local run_fileinfo, param |
181 | local getmesloop, loox, mred, mkey, mbutton, mgetmes |
181 | local getmesloop, loox, mred, mkey, mbutton, mgetmes |
182 | local dlg_is_work, ready, procinfo |
182 | local dlg_is_work, ready, procinfo |
183 | ; |
183 | ; |
184 | ; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, |
184 | ; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, |
185 | ; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) |
185 | ; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) |
186 | ; |
186 | ; |
187 | 187 | ||
188 | cld |
188 | cld |
189 | ;; mov esi,path |
189 | ;; mov esi,path |
190 | mov edi,path |
190 | mov edi,path |
191 | mov eax,0 |
191 | mov eax,0 |
192 | mov ecx,200 |
192 | mov ecx,200 |
193 | rep stosb |
193 | rep stosb |
194 | 194 | ||
195 | ;mov [get_loops],0 |
195 | ;mov [get_loops],0 |
196 | mov [dlg_pid_get],0 |
196 | mov [dlg_pid_get],0 |
197 | 197 | ||
198 | ; Get my PID in dec format 4 bytes |
198 | ; Get my PID in dec format 4 bytes |
199 | mov eax,9 |
199 | mov eax,9 |
200 | mov ebx,procinfo |
200 | mov ebx,procinfo |
201 | mov ecx,-1 |
201 | mov ecx,-1 |
202 | mcall |
202 | mcall |
203 | 203 | ||
204 | ; convert eax bin to param dec |
204 | ; convert eax bin to param dec |
205 | mov eax,dword [procinfo+30] ;offset of myPID |
205 | mov eax,dword [procinfo+30] ;offset of myPID |
206 | mov edi,param+4-1 ;offset to 4 bytes |
206 | mov edi,param+4-1 ;offset to 4 bytes |
207 | mov ecx,4 |
207 | mov ecx,4 |
208 | mov ebx,10 |
208 | mov ebx,10 |
209 | cld |
209 | cld |
210 | new_d: |
210 | new_d: |
211 | xor edx,edx |
211 | xor edx,edx |
212 | div ebx |
212 | div ebx |
213 | add dl,'0' |
213 | add dl,'0' |
214 | mov [edi],dl |
214 | mov [edi],dl |
215 | dec edi |
215 | dec edi |
216 | loop new_d |
216 | loop new_d |
217 | 217 | ||
218 | ; wirite 1 byte space to param |
218 | ; wirite 1 byte space to param |
219 | mov [param+4],byte 32 ;Space for next parametr |
219 | mov [param+4],byte 32 ;Space for next parametr |
220 | ; and 1 byte type of dialog to param |
220 | ; and 1 byte type of dialog to param |
221 | mov [param+5],byte 'O' ;Get Open dialog (Use 'S' for Save dialog) |
221 | mov [param+5],byte 'O' ;Get Open dialog (Use 'S' for Save dialog) |
222 | 222 | ||
223 | ; |
223 | ; |
224 | ; STEP2 prepare IPC area for get messages |
224 | ; STEP2 prepare IPC area for get messages |
225 | ; |
225 | ; |
226 | 226 | ||
227 | ; prepare IPC area |
227 | ; prepare IPC area |
228 | mov [path],dword 0 |
228 | mov [path],dword 0 |
229 | mov [path+4],dword 8 |
229 | mov [path+4],dword 8 |
230 | 230 | ||
231 | ; define IPC memory |
231 | ; define IPC memory |
232 | mov eax,60 |
232 | mov eax,60 |
233 | mov ebx,1 ; define IPC |
233 | mov ebx,1 ; define IPC |
234 | mov ecx,path ; offset of area |
234 | mov ecx,path ; offset of area |
235 | mov edx,150 ; size 150 bytes |
235 | mov edx,150 ; size 150 bytes |
236 | mcall |
236 | mcall |
237 | 237 | ||
238 | ; change wanted events list 7-bit IPC event |
238 | ; change wanted events list 7-bit IPC event |
239 | mov eax,40 |
239 | mov eax,40 |
240 | mov ebx,01000111b |
240 | mov ebx,01000111b |
241 | mcall |
241 | mcall |
242 | 242 | ||
243 | ; |
243 | ; |
244 | ; STEP 3 run SYSTEM XTREE with parameters |
244 | ; STEP 3 run SYSTEM XTREE with parameters |
245 | ; |
245 | ; |
246 | 246 | ||
247 | mov eax,58 |
247 | mov eax,58 |
248 | mov ebx,run_fileinfo |
248 | mov ebx,run_fileinfo |
249 | mcall |
249 | mcall |
250 | 250 | ||
251 | call redproc |
251 | call redproc |
252 | 252 | ||
253 | mov [get_loops],0 |
253 | mov [get_loops],0 |
254 | getmesloop: |
254 | getmesloop: |
255 | mov eax,23 |
255 | mov eax,23 |
256 | mov ebx,50 ;0.5 sec |
256 | mov ebx,50 ;0.5 sec |
257 | mcall |
257 | mcall |
258 | 258 | ||
259 | cmp eax,1 |
259 | cmp eax,1 |
260 | je mred |
260 | je mred |
261 | cmp eax,2 |
261 | cmp eax,2 |
262 | je mkey |
262 | je mkey |
263 | cmp eax,3 |
263 | cmp eax,3 |
264 | je mbutton |
264 | je mbutton |
265 | cmp eax,7 |
265 | cmp eax,7 |
266 | je mgetmes |
266 | je mgetmes |
267 | 267 | ||
268 | ; Get number of procces |
268 | ; Get number of procces |
269 | mov ebx,procinfo |
269 | mov ebx,procinfo |
270 | mov ecx,-1 |
270 | mov ecx,-1 |
271 | mov eax,9 |
271 | mov eax,9 |
272 | mcall |
272 | mcall |
273 | mov ebp,eax |
273 | mov ebp,eax |
274 | 274 | ||
275 | loox: |
275 | loox: |
276 | mov eax,9 |
276 | mov eax,9 |
277 | mov ebx,procinfo |
277 | mov ebx,procinfo |
278 | mov ecx,ebp |
278 | mov ecx,ebp |
279 | mcall |
279 | mcall |
280 | mov eax,[DLGPID] |
280 | mov eax,[DLGPID] |
281 | cmp [procinfo+30],eax ;IF Dialog find |
281 | cmp [procinfo+30],eax ;IF Dialog find |
282 | je dlg_is_work ;jmp to dlg_is_work |
282 | je dlg_is_work ;jmp to dlg_is_work |
283 | dec ebp |
283 | dec ebp |
284 | jnz loox |
284 | jnz loox |
285 | 285 | ||
286 | jmp erroff |
286 | jmp erroff |
287 | 287 | ||
288 | dlg_is_work: |
288 | dlg_is_work: |
289 | cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated |
289 | cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated |
290 | je erroff ;TESTODP2 terminated too |
290 | je erroff ;TESTODP2 terminated too |
291 | 291 | ||
292 | cmp [dlg_pid_get],dword 1 |
292 | cmp [dlg_pid_get],dword 1 |
293 | je getmesloop |
293 | je getmesloop |
294 | inc [get_loops] |
294 | inc [get_loops] |
295 | cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated |
295 | cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated |
296 | jae erroff |
296 | jae erroff |
297 | jmp getmesloop |
297 | jmp getmesloop |
298 | 298 | ||
299 | mred: |
299 | mred: |
300 | call redproc |
300 | call redproc |
301 | jmp getmesloop |
301 | jmp getmesloop |
302 | mkey: |
302 | mkey: |
303 | mov eax,2 |
303 | mov eax,2 |
304 | mcall ; read (eax=2) |
304 | mcall ; read (eax=2) |
305 | jmp getmesloop |
305 | jmp getmesloop |
306 | mbutton: |
306 | mbutton: |
307 | mov eax,17 ; get id |
307 | mov eax,17 ; get id |
308 | mcall |
308 | mcall |
309 | cmp ah,1 ; button id=1 ? |
309 | cmp ah,1 ; button id=1 ? |
310 | jne getmesloop |
310 | jne getmesloop |
311 | mov eax,-1 ; close this program |
311 | mov eax,-1 ; close this program |
312 | mcall |
312 | mcall |
313 | mgetmes: |
313 | mgetmes: |
314 | 314 | ||
315 | ; If dlg_pid_get then second message get jmp to still |
315 | ; If dlg_pid_get then second message get jmp to still |
316 | cmp [dlg_pid_get],dword 1 |
316 | cmp [dlg_pid_get],dword 1 |
317 | je ready |
317 | je ready |
318 | 318 | ||
319 | ; First message is number of PID SYSXTREE dialog |
319 | ; First message is number of PID SYSXTREE dialog |
320 | 320 | ||
321 | ; convert PID dec to PID bin |
321 | ; convert PID dec to PID bin |
322 | movzx eax,byte [path+16] |
322 | movzx eax,byte [path+16] |
323 | sub eax,48 |
323 | sub eax,48 |
324 | imul eax,10 |
324 | imul eax,10 |
325 | movzx ebx,byte [path+16+1] |
325 | movzx ebx,byte [path+16+1] |
326 | add eax,ebx |
326 | add eax,ebx |
327 | sub eax,48 |
327 | sub eax,48 |
328 | imul eax,10 |
328 | imul eax,10 |
329 | movzx ebx,byte [path+16+2] |
329 | movzx ebx,byte [path+16+2] |
330 | add eax,ebx |
330 | add eax,ebx |
331 | sub eax,48 |
331 | sub eax,48 |
332 | imul eax,10 |
332 | imul eax,10 |
333 | movzx ebx,byte [path+16+3] |
333 | movzx ebx,byte [path+16+3] |
334 | add eax,ebx |
334 | add eax,ebx |
335 | sub eax,48 |
335 | sub eax,48 |
336 | mov [DLGPID],eax |
336 | mov [DLGPID],eax |
337 | 337 | ||
338 | ; Claear and prepare IPC area for next message |
338 | ; Claear and prepare IPC area for next message |
339 | mov [path],dword 0 |
339 | mov [path],dword 0 |
340 | mov [path+4],dword 8 |
340 | mov [path+4],dword 8 |
341 | mov [path+8],dword 0 |
341 | mov [path+8],dword 0 |
342 | mov [path+12],dword 0 |
342 | mov [path+12],dword 0 |
343 | mov [path+16],dword 0 |
343 | mov [path+16],dword 0 |
344 | 344 | ||
345 | ; Set dlg_pid_get for get next message |
345 | ; Set dlg_pid_get for get next message |
346 | mov [dlg_pid_get],dword 1 |
346 | mov [dlg_pid_get],dword 1 |
347 | call redproc ;show DLG_PID |
347 | call redproc ;show DLG_PID |
348 | jmp getmesloop |
348 | jmp getmesloop |
349 | 349 | ||
350 | ready: |
350 | ready: |
351 | ; |
351 | ; |
352 | ; The second message get |
352 | ; The second message get |
353 | ; Second message is 100 bytes path to SAVE/OPEN file |
353 | ; Second message is 100 bytes path to SAVE/OPEN file |
354 | ; shl path string on 16 bytes |
354 | ; shl path string on 16 bytes |
355 | ; |
355 | ; |
356 | cld |
356 | cld |
357 | mov esi,path+16 |
357 | mov esi,path+16 |
358 | mov edi,path |
358 | mov edi,path |
359 | mov ecx,200 |
359 | mov ecx,200 |
360 | rep movsb |
360 | rep movsb |
361 | mov [edi],byte 0 |
361 | mov [edi],byte 0 |
362 | 362 | ||
363 | jmp openoff |
363 | jmp openoff |
364 | 364 | ||
365 | 365 | ||
366 | ; DATA AREA |
366 | ; DATA AREA |
367 | get_loops dd 0 |
367 | get_loops dd 0 |
368 | dlg_pid_get dd 0 |
368 | dlg_pid_get dd 0 |
369 | DLGPID dd 0 |
369 | DLGPID dd 0 |
370 | 370 | ||
371 | param: |
371 | param: |
372 | dd 0 ; My dec PID |
372 | dd 0 ; My dec PID |
373 | dd 0,0 ; Type of dialog |
373 | dd 0,0 ; Type of dialog |
374 | 374 | ||
375 | run_fileinfo: |
375 | run_fileinfo: |
376 | dd 16 |
376 | dd 16 |
377 | dd 0 |
377 | dd 0 |
378 | dd param |
378 | dd param |
379 | dd 0 |
379 | dd 0 |
380 | dd procinfo ; 0x10000 |
380 | dd procinfo ; 0x10000 |
381 | ;run_filepath |
381 | ;run_filepath |
382 | db '/sys/SYSXTREE',0 |
382 | db '/sys/SYSXTREE',0 |
383 | 383 | ||
384 | procinfo: |
384 | procinfo: |
385 | times 256 db 0 |
385 | times 256 db 0 |
386 | } |
386 | } |
387 | 387 | ||
388 | 388 | ||
389 | macro savedialog redproc,openoff,erroff,path |
389 | macro savedialog redproc,openoff,erroff,path |
390 | { |
390 | { |
391 | local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc |
391 | local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc |
392 | local run_fileinfo, run_filepath, param |
392 | local run_fileinfo, run_filepath, param |
393 | local getmesloop, loox, mred, mkey, mbutton, mgetmes |
393 | local getmesloop, loox, mred, mkey, mbutton, mgetmes |
394 | local dlg_is_work, ready, procinfo |
394 | local dlg_is_work, ready, procinfo |
395 | ; |
395 | ; |
396 | ; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, |
396 | ; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec, |
397 | ; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) |
397 | ; 1 byte space, 1 byte type of dialog (O - Open ,S - Save) |
398 | ; |
398 | ; |
399 | 399 | ||
400 | cld |
400 | cld |
401 | ;; mov esi,path |
401 | ;; mov esi,path |
402 | mov edi,path |
402 | mov edi,path |
403 | mov eax,0 |
403 | mov eax,0 |
404 | mov ecx,200 |
404 | mov ecx,200 |
405 | rep stosb |
405 | rep stosb |
406 | 406 | ||
407 | ;mov [get_loops],0 |
407 | ;mov [get_loops],0 |
408 | mov [dlg_pid_get],0 |
408 | mov [dlg_pid_get],0 |
409 | 409 | ||
410 | ; Get my PID in dec format 4 bytes |
410 | ; Get my PID in dec format 4 bytes |
411 | mov eax,9 |
411 | mov eax,9 |
412 | mov ebx,procinfo |
412 | mov ebx,procinfo |
413 | mov ecx,-1 |
413 | mov ecx,-1 |
414 | mcall |
414 | mcall |
415 | 415 | ||
416 | ; convert eax bin to param dec |
416 | ; convert eax bin to param dec |
417 | mov eax,dword [procinfo+30] ;offset of myPID |
417 | mov eax,dword [procinfo+30] ;offset of myPID |
418 | mov edi,param+4-1 ;offset to 4 bytes |
418 | mov edi,param+4-1 ;offset to 4 bytes |
419 | mov ecx,4 |
419 | mov ecx,4 |
420 | mov ebx,10 |
420 | mov ebx,10 |
421 | cld |
421 | cld |
422 | new_d: |
422 | new_d: |
423 | xor edx,edx |
423 | xor edx,edx |
424 | div ebx |
424 | div ebx |
425 | add dl,'0' |
425 | add dl,'0' |
426 | mov [edi],dl |
426 | mov [edi],dl |
427 | dec edi |
427 | dec edi |
428 | loop new_d |
428 | loop new_d |
429 | 429 | ||
430 | ; wirite 1 byte space to param |
430 | ; wirite 1 byte space to param |
431 | mov [param+4],byte 32 ;Space for next parametr |
431 | mov [param+4],byte 32 ;Space for next parametr |
432 | ; and 1 byte type of dialog to param |
432 | ; and 1 byte type of dialog to param |
433 | mov [param+5],byte 'S' ;Get Open dialog (Use 'S' for Save dialog) |
433 | mov [param+5],byte 'S' ;Get Open dialog (Use 'S' for Save dialog) |
434 | 434 | ||
435 | ; |
435 | ; |
436 | ; STEP2 prepare IPC area for get messages |
436 | ; STEP2 prepare IPC area for get messages |
437 | ; |
437 | ; |
438 | 438 | ||
439 | ; prepare IPC area |
439 | ; prepare IPC area |
440 | mov [path],dword 0 |
440 | mov [path],dword 0 |
441 | mov [path+4],dword 8 |
441 | mov [path+4],dword 8 |
442 | 442 | ||
443 | ; define IPC memory |
443 | ; define IPC memory |
444 | mov eax,60 |
444 | mov eax,60 |
445 | mov ebx,1 ; define IPC |
445 | mov ebx,1 ; define IPC |
446 | mov ecx,path ; offset of area |
446 | mov ecx,path ; offset of area |
447 | mov edx,120 ; size 150 bytes |
447 | mov edx,120 ; size 150 bytes |
448 | mcall |
448 | mcall |
449 | 449 | ||
450 | ; change wanted events list 7-bit IPC event |
450 | ; change wanted events list 7-bit IPC event |
451 | mov eax,40 |
451 | mov eax,40 |
452 | mov ebx,01000111b |
452 | mov ebx,01000111b |
453 | mcall |
453 | mcall |
454 | 454 | ||
455 | ; |
455 | ; |
456 | ; STEP 3 run SYSTEM XTREE with parameters |
456 | ; STEP 3 run SYSTEM XTREE with parameters |
457 | ; |
457 | ; |
458 | 458 | ||
459 | mov eax,58 |
459 | mov eax,58 |
460 | mov ebx,run_fileinfo |
460 | mov ebx,run_fileinfo |
461 | mcall |
461 | mcall |
462 | 462 | ||
463 | call redproc |
463 | call redproc |
464 | 464 | ||
465 | mov [get_loops],0 |
465 | mov [get_loops],0 |
466 | getmesloop: |
466 | getmesloop: |
467 | mov eax,23 |
467 | mov eax,23 |
468 | mov ebx,50 ;0.5 sec |
468 | mov ebx,50 ;0.5 sec |
469 | mcall |
469 | mcall |
470 | 470 | ||
471 | cmp eax,1 |
471 | cmp eax,1 |
472 | je mred |
472 | je mred |
473 | cmp eax,2 |
473 | cmp eax,2 |
474 | je mkey |
474 | je mkey |
475 | cmp eax,3 |
475 | cmp eax,3 |
476 | je mbutton |
476 | je mbutton |
477 | cmp eax,7 |
477 | cmp eax,7 |
478 | je mgetmes |
478 | je mgetmes |
479 | 479 | ||
480 | ; Get number of procces |
480 | ; Get number of procces |
481 | mov ebx,procinfo |
481 | mov ebx,procinfo |
482 | mov ecx,-1 |
482 | mov ecx,-1 |
483 | mov eax,9 |
483 | mov eax,9 |
484 | mcall |
484 | mcall |
485 | mov ebp,eax |
485 | mov ebp,eax |
486 | 486 | ||
487 | loox: |
487 | loox: |
488 | mov eax,9 |
488 | mov eax,9 |
489 | mov ebx,procinfo |
489 | mov ebx,procinfo |
490 | mov ecx,ebp |
490 | mov ecx,ebp |
491 | mcall |
491 | mcall |
492 | mov eax,[DLGPID] |
492 | mov eax,[DLGPID] |
493 | cmp [procinfo+30],eax ;IF Dialog find |
493 | cmp [procinfo+30],eax ;IF Dialog find |
494 | je dlg_is_work ;jmp to dlg_is_work |
494 | je dlg_is_work ;jmp to dlg_is_work |
495 | dec ebp |
495 | dec ebp |
496 | jnz loox |
496 | jnz loox |
497 | 497 | ||
498 | jmp erroff |
498 | jmp erroff |
499 | 499 | ||
500 | dlg_is_work: |
500 | dlg_is_work: |
501 | cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated |
501 | cmp [procinfo+50],word 9 ;If slot state 9 - dialog is terminated |
502 | je erroff ;TESTODP2 terminated too |
502 | je erroff ;TESTODP2 terminated too |
503 | 503 | ||
504 | cmp [dlg_pid_get],dword 1 |
504 | cmp [dlg_pid_get],dword 1 |
505 | je getmesloop |
505 | je getmesloop |
506 | inc [get_loops] |
506 | inc [get_loops] |
507 | cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated |
507 | cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated |
508 | jae erroff |
508 | jae erroff |
509 | jmp getmesloop |
509 | jmp getmesloop |
510 | 510 | ||
511 | mred: |
511 | mred: |
512 | call redproc |
512 | call redproc |
513 | jmp getmesloop |
513 | jmp getmesloop |
514 | mkey: |
514 | mkey: |
515 | mcall ; read (eax=2) |
515 | mcall ; read (eax=2) |
516 | jmp getmesloop |
516 | jmp getmesloop |
517 | mbutton: |
517 | mbutton: |
518 | mov eax,17 ; get id |
518 | mov eax,17 ; get id |
519 | mcall |
519 | mcall |
520 | cmp ah,1 ; button id=1 ? |
520 | cmp ah,1 ; button id=1 ? |
521 | jne getmesloop |
521 | jne getmesloop |
522 | mov eax,-1 ; close this program |
522 | mov eax,-1 ; close this program |
523 | mcall |
523 | mcall |
524 | mgetmes: |
524 | mgetmes: |
525 | 525 | ||
526 | ; If dlg_pid_get then second message get jmp to still |
526 | ; If dlg_pid_get then second message get jmp to still |
527 | cmp [dlg_pid_get],dword 1 |
527 | cmp [dlg_pid_get],dword 1 |
528 | je ready |
528 | je ready |
529 | 529 | ||
530 | ; First message is number of PID SYSXTREE dialog |
530 | ; First message is number of PID SYSXTREE dialog |
531 | 531 | ||
532 | ; convert PID dec to PID bin |
532 | ; convert PID dec to PID bin |
533 | movzx eax,byte [path+16] |
533 | movzx eax,byte [path+16] |
534 | sub eax,48 |
534 | sub eax,48 |
535 | imul eax,10 |
535 | imul eax,10 |
536 | movzx ebx,byte [path+16+1] |
536 | movzx ebx,byte [path+16+1] |
537 | add eax,ebx |
537 | add eax,ebx |
538 | sub eax,48 |
538 | sub eax,48 |
539 | imul eax,10 |
539 | imul eax,10 |
540 | movzx ebx,byte [path+16+2] |
540 | movzx ebx,byte [path+16+2] |
541 | add eax,ebx |
541 | add eax,ebx |
542 | sub eax,48 |
542 | sub eax,48 |
543 | imul eax,10 |
543 | imul eax,10 |
544 | movzx ebx,byte [path+16+3] |
544 | movzx ebx,byte [path+16+3] |
545 | add eax,ebx |
545 | add eax,ebx |
546 | sub eax,48 |
546 | sub eax,48 |
547 | mov [DLGPID],eax |
547 | mov [DLGPID],eax |
548 | 548 | ||
549 | ; Claear and prepare IPC area for next message |
549 | ; Claear and prepare IPC area for next message |
550 | mov [path],dword 0 |
550 | mov [path],dword 0 |
551 | mov [path+4],dword 8 |
551 | mov [path+4],dword 8 |
552 | mov [path+8],dword 0 |
552 | mov [path+8],dword 0 |
553 | mov [path+12],dword 0 |
553 | mov [path+12],dword 0 |
554 | mov [path+16],dword 0 |
554 | mov [path+16],dword 0 |
555 | 555 | ||
556 | ; Set dlg_pid_get for get next message |
556 | ; Set dlg_pid_get for get next message |
557 | mov [dlg_pid_get],dword 1 |
557 | mov [dlg_pid_get],dword 1 |
558 | call redproc ;show DLG_PID |
558 | call redproc ;show DLG_PID |
559 | jmp getmesloop |
559 | jmp getmesloop |
560 | 560 | ||
561 | ready: |
561 | ready: |
562 | ; |
562 | ; |
563 | ; The second message get |
563 | ; The second message get |
564 | ; Second message is 100 bytes path to SAVE/OPEN file |
564 | ; Second message is 100 bytes path to SAVE/OPEN file |
565 | ; shl path string on 16 bytes |
565 | ; shl path string on 16 bytes |
566 | ; |
566 | ; |
567 | cld |
567 | cld |
568 | mov esi,path+16 |
568 | mov esi,path+16 |
569 | mov edi,path |
569 | mov edi,path |
570 | mov ecx,200 |
570 | mov ecx,200 |
571 | rep movsb |
571 | rep movsb |
572 | mov [edi],byte 0 |
572 | mov [edi],byte 0 |
573 | 573 | ||
574 | jmp openoff |
574 | jmp openoff |
575 | 575 | ||
576 | 576 | ||
577 | ; DATA AREA |
577 | ; DATA AREA |
578 | get_loops dd 0 |
578 | get_loops dd 0 |
579 | dlg_pid_get dd 0 |
579 | dlg_pid_get dd 0 |
580 | DLGPID dd 0 |
580 | DLGPID dd 0 |
581 | 581 | ||
582 | param: |
582 | param: |
583 | rb 4 ; My dec PID |
583 | rb 4 ; My dec PID |
584 | rb 6 ; Type of dialog |
584 | rb 6 ; Type of dialog |
585 | 585 | ||
586 | run_fileinfo: |
586 | run_fileinfo: |
587 | dd 16 |
587 | dd 16 |
588 | dd 0 |
588 | dd 0 |
589 | dd param |
589 | dd param |
590 | dd 0 |
590 | dd 0 |
591 | dd procinfo |
591 | dd procinfo |
592 | run_filepath: |
592 | run_filepath: |
593 | db '/sys/SYSXTREE',0 |
593 | db '/sys/SYSXTREE',0 |
594 | 594 | ||
595 | procinfo: |
595 | procinfo: |
596 | times 256 db 0 |
596 | times 256 db 0 |
597 | } |
597 | } |
598 | 598 | ||
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | ; RANDOM - generate random count (small) |
602 | ; RANDOM - generate random count (small) |
603 | ; (SYNTAX) RANDOM MaxCount,OutArgument |
603 | ; (SYNTAX) RANDOM MaxCount,OutArgument |
604 | ; (SAMPLE) RANDOM 10000,eax |
604 | ; (SAMPLE) RANDOM 10000,eax |
605 | ; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations |
605 | ; ( NOTE ) Maxint<65536 ; use random 65536,eax for more combinations |
606 | 606 | ||
607 | randomuse = 0 |
607 | randomuse = 0 |
608 | 608 | ||
609 | macro random arg1,arg2 |
609 | macro random arg1,arg2 |
610 | { |
610 | { |
611 | local rxproc |
611 | local rxproc |
612 | randomuse = randomuse + 1 |
612 | randomuse = randomuse + 1 |
613 | 613 | ||
614 | jmp rxproc |
614 | jmp rxproc |
615 | 615 | ||
616 | if defined randomuse & randomuse = 1 |
616 | if defined randomuse & randomuse = 1 |
617 | randomproc: |
617 | randomproc: |
618 | jmp rnj |
618 | jmp rnj |
619 | rsx1 dw 0x4321 |
619 | rsx1 dw 0x4321 |
620 | rsx2 dw 0x1234 |
620 | rsx2 dw 0x1234 |
621 | rnj: |
621 | rnj: |
622 | ; mov eax,arg1 |
622 | ; mov eax,arg1 |
623 | push bx |
623 | push bx |
624 | push cx |
624 | push cx |
625 | push dx |
625 | push dx |
626 | push si |
626 | push si |
627 | push di |
627 | push di |
628 | mov cx,ax |
628 | mov cx,ax |
629 | mov ax,word ptr rsx1 |
629 | mov ax,word ptr rsx1 |
630 | mov bx,word ptr rsx2 |
630 | mov bx,word ptr rsx2 |
631 | mov si,ax |
631 | mov si,ax |
632 | mov di,bx |
632 | mov di,bx |
633 | mov dl,ah |
633 | mov dl,ah |
634 | mov ah,al |
634 | mov ah,al |
635 | mov al,bh |
635 | mov al,bh |
636 | mov bh,bl |
636 | mov bh,bl |
637 | xor bl,bl |
637 | xor bl,bl |
638 | rcr dl,1 |
638 | rcr dl,1 |
639 | rcr ax,1 |
639 | rcr ax,1 |
640 | rcr bx,1 |
640 | rcr bx,1 |
641 | add bx,di |
641 | add bx,di |
642 | adc ax,si |
642 | adc ax,si |
643 | add bx,0x62e9 |
643 | add bx,0x62e9 |
644 | adc ax,0x3619 |
644 | adc ax,0x3619 |
645 | mov word ptr rsx1,bx |
645 | mov word ptr rsx1,bx |
646 | mov word ptr rsx2,ax |
646 | mov word ptr rsx2,ax |
647 | xor dx,dx |
647 | xor dx,dx |
648 | cmp ax,0 |
648 | cmp ax,0 |
649 | je nodiv |
649 | je nodiv |
650 | cmp cx,0 |
650 | cmp cx,0 |
651 | je nodiv |
651 | je nodiv |
652 | div cx |
652 | div cx |
653 | nodiv: |
653 | nodiv: |
654 | mov ax,dx |
654 | mov ax,dx |
655 | pop di |
655 | pop di |
656 | pop si |
656 | pop si |
657 | pop dx |
657 | pop dx |
658 | pop cx |
658 | pop cx |
659 | pop bx |
659 | pop bx |
660 | and eax,0000ffffh |
660 | and eax,0000ffffh |
661 | ; mov arg2,0 |
661 | ; mov arg2,0 |
662 | ; mov arg2,eax |
662 | ; mov arg2,eax |
663 | ret |
663 | ret |
664 | end if |
664 | end if |
665 | 665 | ||
666 | rxproc: |
666 | rxproc: |
667 | mov eax,arg1 |
667 | mov eax,arg1 |
668 | call randomproc |
668 | call randomproc |
669 | mov arg2,eax |
669 | mov arg2,eax |
670 | } |
670 | } |
671 | 671 | ||
672 | macro scank |
672 | macro scank |
673 | { |
673 | { |
674 | mov eax,10 |
674 | mov eax,10 |
675 | mcall |
675 | mcall |
676 | } |
676 | } |
677 | 677 | ||
678 | macro putpix x,y,color |
678 | macro putpix x,y,color |
679 | { |
679 | { |
680 | mov ebx,x |
680 | mov ebx,x |
681 | mov ecx,y |
681 | mov ecx,y |
682 | mov edx,color |
682 | mov edx,color |
683 | mov eax,1 |
683 | mov eax,1 |
684 | mcall |
684 | mcall |
685 | } |
685 | } |
686 | 686 | ||
687 | macro puttxt x,y,offs,size,color |
687 | macro puttxt x,y,offs,size,color |
688 | { |
688 | { |
689 | ; mov ebx,x |
689 | ; mov ebx,x |
690 | ; shl ebx,16 |
690 | ; shl ebx,16 |
691 | ; add ebx,y |
691 | ; add ebx,y |
692 | words2reg ebx,x,y |
692 | words2reg ebx,x,y |
693 | mov ecx,color |
693 | mov ecx,color |
694 | mov edx,offs |
694 | mov edx,offs |
695 | mov esi,size |
695 | mov esi,size |
696 | mov eax,4 |
696 | mov eax,4 |
697 | mcall |
697 | mcall |
698 | } |
698 | } |
699 | 699 | ||
700 | macro outcount data, x, y, color, numtype |
700 | macro outcount data, x, y, color, numtype |
701 | { |
701 | { |
702 | mov ecx,data |
702 | mov ecx,data |
703 | mov ebx,numtype |
703 | mov ebx,numtype |
704 | mov bl,0 |
704 | mov bl,0 |
705 | ; mov edx,x*65536+y |
705 | ; mov edx,x*65536+y |
706 | words2reg edx,x,y |
706 | words2reg edx,x,y |
707 | mov esi,color |
707 | mov esi,color |
708 | mov eax,47 |
708 | mov eax,47 |
709 | mcall |
709 | mcall |
710 | } |
710 | } |
711 | 711 | ||
712 | ; SCEVENT - Scan event |
712 | ; SCEVENT - Scan event |
713 | 713 | ||
714 | macro scevent red,key,but |
714 | macro scevent red,key,but |
715 | { |
715 | { |
716 | mov eax,11 |
716 | mov eax,11 |
717 | mcall |
717 | mcall |
718 | dec eax |
718 | dec eax |
719 | jz red |
719 | jz red |
720 | dec eax |
720 | dec eax |
721 | jz key |
721 | jz key |
722 | dec eax |
722 | dec eax |
723 | jz but |
723 | jz but |
724 | } |
724 | } |
725 | 725 | ||
726 | ; WTEVENT - Wait event |
726 | ; WTEVENT - Wait event |
727 | 727 | ||
728 | macro wtevent red,key,but |
728 | macro wtevent red,key,but |
729 | { |
729 | { |
730 | mov eax,10 |
730 | mov eax,10 |
731 | mcall |
731 | mcall |
732 | dec eax |
732 | dec eax |
733 | jz red |
733 | jz red |
734 | dec eax |
734 | dec eax |
735 | jz key |
735 | jz key |
736 | dec eax |
736 | dec eax |
737 | jz but |
737 | jz but |
738 | } |
738 | } |
739 | 739 | ||
740 | ; TIMEEVENT - Wite for event with timeout |
740 | ; TIMEEVENT - Wite for event with timeout |
741 | 741 | ||
742 | macro timeevent xfps,noevent,red,key,but |
742 | macro timeevent xfps,noevent,red,key,but |
743 | { |
743 | { |
744 | mov eax,23 |
744 | mov eax,23 |
745 | mov ebx,xfps |
745 | mov ebx,xfps |
746 | mcall |
746 | mcall |
747 | cmp eax,0 |
747 | cmp eax,0 |
748 | je noevent |
748 | je noevent |
749 | dec eax |
749 | dec eax |
750 | jz red |
750 | jz red |
751 | dec eax |
751 | dec eax |
752 | jz key |
752 | jz key |
753 | dec eax |
753 | dec eax |
754 | jz but |
754 | jz but |
755 | } |
755 | } |
756 | 756 | ||
757 | 757 | ||
758 | ; CLOSE - Close program |
758 | ; CLOSE - Close program |
759 | 759 | ||
760 | macro close |
760 | macro close |
761 | { |
761 | { |
762 | mov eax,-1 |
762 | mov eax,-1 |
763 | mcall |
763 | mcall |
764 | } |
764 | } |
765 | 765 | ||
766 | ; DELAY - Create delay 1/100 sec |
766 | ; DELAY - Create delay 1/100 sec |
767 | ; (SYNTAX) Delay time |
767 | ; (SYNTAX) Delay time |
768 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
768 | ; (SAMPLE) Delay 100 ;delay 2 sec 1/100*200=2 sec |
769 | 769 | ||
770 | macro delay arg1 |
770 | macro delay arg1 |
771 | { |
771 | { |
772 | mov eax,5 |
772 | mov eax,5 |
773 | mov ebx,arg1 |
773 | mov ebx,arg1 |
774 | mcall |
774 | mcall |
775 | } |
775 | } |
776 | 776 | ||
777 | ; WINDOW - Draw window |
777 | ; WINDOW - Draw window |
778 | ; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color |
778 | ; (SYNTAX) WINDOW Xstart,Ystart,'Text',Color |
779 | ; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned |
779 | ; (SAMPLE) WINDOW 10,10,640+8,480+24,window_Skinned |
780 | 780 | ||
781 | macro window arg1,arg2,arg3,arg4,arg5 |
781 | macro window arg1,arg2,arg3,arg4,arg5 |
782 | { |
782 | { |
783 | ; mov ebx,arg1*65536+arg3 |
783 | ; mov ebx,arg1*65536+arg3 |
784 | ; mov ecx,arg2*65536+arg4 |
784 | ; mov ecx,arg2*65536+arg4 |
785 | words2reg ebx,arg1,arg3 |
785 | words2reg ebx,arg1,arg3 |
786 | words2reg ecx,arg2,arg4 |
786 | words2reg ecx,arg2,arg4 |
787 | mov edx,arg5 |
787 | mov edx,arg5 |
788 | mov eax,0 |
788 | mov eax,0 |
789 | mcall |
789 | mcall |
790 | } |
790 | } |
791 | 791 | ||
792 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
792 | macro colorwindow arg1,arg2,arg3,arg4,arg5,arg6,arg7 |
793 | { |
793 | { |
794 | mov ebx,arg1*65536+arg3 |
794 | mov ebx,arg1*65536+arg3 |
795 | mov ecx,arg2*65536+arg4 |
795 | mov ecx,arg2*65536+arg4 |
796 | mov edx,arg5 |
796 | mov edx,arg5 |
797 | mov esi,arg6 |
797 | mov esi,arg6 |
798 | mov edi,arg7 |
798 | mov edi,arg7 |
799 | mov eax,0 |
799 | mov eax,0 |
800 | mcall |
800 | mcall |
801 | } |
801 | } |
802 | 802 | ||
803 | 803 | ||
804 | ; STARTWD - Start of window draw |
804 | ; STARTWD - Start of window draw |
805 | 805 | ||
806 | macro startwd |
806 | macro startwd |
807 | { |
807 | { |
808 | mov eax,12 |
808 | mov eax,12 |
809 | mov ebx,1 |
809 | mov ebx,1 |
810 | mcall |
810 | mcall |
811 | } |
811 | } |
812 | 812 | ||
813 | ; ENDWD - End window draw |
813 | ; ENDWD - End window draw |
814 | 814 | ||
815 | macro endwd |
815 | macro endwd |
816 | { |
816 | { |
817 | mov eax,12 |
817 | mov eax,12 |
818 | mov ebx,2 |
818 | mov ebx,2 |
819 | mcall |
819 | mcall |
820 | } |
820 | } |
821 | 821 | ||
822 | ; LABEL - Put text to frame |
822 | ; LABEL - Put text to frame |
823 | ; (SYNTAX) LABEL Xstart,Ystart,'Text',Color |
823 | ; (SYNTAX) LABEL Xstart,Ystart,'Text',Color |
824 | ; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big |
824 | ; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big |
825 | 825 | ||
826 | macro label arg1,arg2,arg3,arg4 |
826 | macro label arg1,arg2,arg3,arg4 |
827 | { |
827 | { |
828 | local asd,lab |
828 | local asd,lab |
829 | jmp asd |
829 | jmp asd |
830 | lab db arg3 ;arg label |
830 | lab db arg3 ;arg label |
831 | asd: |
831 | asd: |
832 | ; mov ebx,arg1 ;arg1=y arg2=x |
832 | ; mov ebx,arg1 ;arg1=y arg2=x |
833 | ; shl ebx,16 |
833 | ; shl ebx,16 |
834 | ; add ebx,arg2 |
834 | ; add ebx,arg2 |
835 | 835 | ||
836 | 836 | ||
837 | words2reg ebx,arg1,arg2 |
837 | words2reg ebx,arg1,arg2 |
838 | 838 | ||
839 | dword2reg ecx,arg4 |
839 | dword2reg ecx,arg4 |
840 | 840 | ||
841 | 841 | ||
842 | mov edx,lab |
842 | mov edx,lab |
843 | mov esi,asd-lab ;calc size |
843 | mov esi,asd-lab ;calc size |
844 | mov eax,4 |
844 | mov eax,4 |
845 | mcall |
845 | mcall |
846 | } |
846 | } |
847 | 847 | ||
848 | ;Key's |
848 | ;Key's |
849 | key_Up equ 178 |
849 | key_Up equ 178 |
850 | key_Down equ 177 |
850 | key_Down equ 177 |
851 | key_Right equ 179 |
851 | key_Right equ 179 |
852 | key_Left equ 176 |
852 | key_Left equ 176 |
853 | key_Esc equ 27 |
853 | key_Esc equ 27 |
854 | key_Space equ 32 |
854 | key_Space equ 32 |
855 | key_Enter equ 13 |
855 | key_Enter equ 13 |
856 | key_Bspace equ 8 |
856 | key_Bspace equ 8 |
857 | key_F1 equ 50 |
857 | key_F1 equ 50 |
858 | key_F2 equ 51 |
858 | key_F2 equ 51 |
859 | key_F3 equ 52 |
859 | key_F3 equ 52 |
860 | key_F4 equ 53 |
860 | key_F4 equ 53 |
861 | key_F5 equ 54 |
861 | key_F5 equ 54 |
862 | key_F6 equ 55 |
862 | key_F6 equ 55 |
863 | key_F7 equ 56 |
863 | key_F7 equ 56 |
864 | key_F8 equ 57 |
864 | key_F8 equ 57 |
865 | key_F9 equ 48 |
865 | key_F9 equ 48 |
866 | key_F10 equ 49 |
866 | key_F10 equ 49 |
867 | key_F11 equ 68 |
867 | key_F11 equ 68 |
868 | key_F12 equ 255 |
868 | key_F12 equ 255 |
869 | key_Home equ 180 |
869 | key_Home equ 180 |
870 | key_End equ 181 |
870 | key_End equ 181 |
871 | key_PgUp equ 184 |
871 | key_PgUp equ 184 |
872 | key_PgDown equ 183 |
872 | key_PgDown equ 183 |
873 | 873 | ||
874 | ;Attributes |
874 | ;Attributes |
875 | 875 | ||
876 | ;Window Attributes |
876 | ;Window Attributes |
877 | window_Skinned equ 0x03000000 |
877 | window_Skinned equ 0x04000000 |
878 | window_Type2 equ 0x02000000 |
878 | window_Type2 equ 0x02000000 |
879 | window_Type1 equ 0x00000000 |
879 | window_Type1 equ 0x00000000 |
880 | window_Reserve equ 0x01000000 |
880 | window_Reserve equ 0x01000000 |
881 | 881 | ||
882 | ;Font Attributes |
882 | ;Font Attributes |
883 | font_Big equ 0x10000000 |
883 | font_Big equ 0x10000000 |
884 | 884 | ||
885 | ;Colors |
885 | ;Colors |
886 | cl_White equ 0x00ffffff |
886 | cl_White equ 0x00ffffff |
887 | cl_Black equ 0x00000000 |
887 | cl_Black equ 0x00000000 |
888 | cl_Grey equ 0x00888888 |
888 | cl_Grey equ 0x00888888 |
889 | cl_Red equ 0x00ff0000 |
889 | cl_Red equ 0x00ff0000 |
890 | cl_Lime equ 0x0000ff00 |
890 | cl_Lime equ 0x0000ff00 |
891 | cl_Green equ 0x0000af00 |
891 | cl_Green equ 0x0000af00 |
892 | cl_Blue equ 0x000000ff |
892 | cl_Blue equ 0x000000ff |
893 | cl_Purple equ 0x008080ff |
893 | cl_Purple equ 0x008080ff |
894 | cl_Violet equ 0x008040ff |
894 | cl_Violet equ 0x008040ff |
895 | cl_Cyan equ 0x0040e0ff65536> |
895 | cl_Cyan equ 0x0040e0ff65536> |