Rev 5548 | Rev 5572 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5548 | Rev 5549 | ||
---|---|---|---|
1 | //CODED by Veliant, Leency, Nable. GNU GPL licence. |
1 | //CODED by Veliant, Leency, Nable. GNU GPL licence. |
2 | 2 | ||
3 | #startaddress 0 |
3 | #startaddress 0 |
4 | #code32 TRUE |
4 | #code32 TRUE |
5 | 5 | ||
6 | char os_name[8] = {'M','E','N','U','E','T','0','1'}; |
6 | char os_name[8] = {'M','E','N','U','E','T','0','1'}; |
7 | dword os_version = 0x00000001; |
7 | dword os_version = 0x00000001; |
8 | dword start_addr = #main; |
8 | dword start_addr = #main; |
9 | dword final_addr = #stop+32; |
9 | dword final_addr = #stop+32; |
10 | dword alloc_mem = MEMSIZE; |
10 | dword alloc_mem = MEMSIZE; |
11 | dword x86esp_reg = MEMSIZE; |
11 | dword x86esp_reg = MEMSIZE; |
12 | dword I_Param = #param; |
12 | dword I_Param = #param; |
13 | dword I_Path = #program_path; |
13 | dword I_Path = #program_path; |
14 | char param[4096]; |
14 | char param[4096]; |
15 | char program_path[4096]; |
15 | char program_path[4096]; |
16 | 16 | ||
17 | #define NULL 0 |
17 | #define NULL 0 |
18 | #define OLD -1 |
18 | #define OLD -1 |
19 | #define true 1 |
19 | #define true 1 |
20 | #define false 0 |
20 | #define false 0 |
21 | 21 | ||
22 | //Events |
22 | //Events |
23 | #define evReDraw 1 |
23 | #define evReDraw 1 |
24 | #define evKey 2 |
24 | #define evKey 2 |
25 | #define evButton 3 |
25 | #define evButton 3 |
26 | #define evMouse 6 |
26 | #define evMouse 6 |
27 | #define evNetwork 8 |
27 | #define evNetwork 8 |
28 | 28 | ||
29 | 29 | ||
30 | //Button options |
30 | //Button options |
31 | #define BT_DEL 0x80000000 |
31 | #define BT_DEL 0x80000000 |
32 | #define BT_HIDE 0x40000000 |
32 | #define BT_HIDE 0x40000000 |
33 | #define BT_NOFRAME 0x20000000 |
33 | #define BT_NOFRAME 0x20000000 |
34 | 34 | ||
35 | //ASCII KEYS |
35 | //ASCII KEYS |
36 | #define ASCII_KEY_BS 008 |
36 | #define ASCII_KEY_BS 008 |
37 | #define ASCII_KEY_TAB 009 |
37 | #define ASCII_KEY_TAB 009 |
38 | #define ASCII_KEY_ENTER 013 |
38 | #define ASCII_KEY_ENTER 013 |
39 | #define ASCII_KEY_ESC 027 |
39 | #define ASCII_KEY_ESC 027 |
40 | #define ASCII_KEY_DEL 182 |
40 | #define ASCII_KEY_DEL 182 |
41 | #define ASCII_KEY_INS 185 |
41 | #define ASCII_KEY_INS 185 |
42 | #define ASCII_KEY_SPACE 032 |
42 | #define ASCII_KEY_SPACE 032 |
43 | 43 | ||
44 | #define ASCII_KEY_LEFT 176 |
44 | #define ASCII_KEY_LEFT 176 |
45 | #define ASCII_KEY_RIGHT 179 |
45 | #define ASCII_KEY_RIGHT 179 |
46 | #define ASCII_KEY_DOWN 177 |
46 | #define ASCII_KEY_DOWN 177 |
47 | #define ASCII_KEY_UP 178 |
47 | #define ASCII_KEY_UP 178 |
48 | #define ASCII_KEY_HOME 180 |
48 | #define ASCII_KEY_HOME 180 |
49 | #define ASCII_KEY_END 181 |
49 | #define ASCII_KEY_END 181 |
50 | #define ASCII_KEY_PGDN 183 |
50 | #define ASCII_KEY_PGDN 183 |
51 | #define ASCII_KEY_PGUP 184 |
51 | #define ASCII_KEY_PGUP 184 |
52 | 52 | ||
53 | 53 | ||
54 | //------------------------------------------------------------------------- |
54 | //------------------------------------------------------------------------- |
55 | 55 | ||
56 | :struct raw_image { |
56 | :struct raw_image { |
57 | dword w, h, data; |
57 | dword w, h, data; |
58 | }; |
58 | }; |
59 | 59 | ||
60 | :struct mouse |
60 | :struct mouse |
61 | { |
61 | { |
62 | signed x,y,lkm,pkm,hor,vert; |
62 | signed x,y,lkm,mkm,pkm,hor,vert; |
63 | void get(); |
63 | void get(); |
64 | }; |
64 | }; |
65 | 65 | ||
66 | :void mouse::get() |
66 | :void mouse::get() |
67 | { |
67 | { |
68 | EAX = 37; |
68 | EAX = 37; |
69 | EBX = 1; |
69 | EBX = 1; |
70 | $int 0x40 |
70 | $int 0x40 |
71 | $mov ebx, eax |
71 | $mov ebx, eax |
72 | $shr eax, 16 |
72 | $shr eax, 16 |
73 | $and ebx,0x0000FFFF |
73 | $and ebx,0x0000FFFF |
74 | x = EAX; |
74 | x = EAX; |
75 | y = EBX; |
75 | y = EBX; |
76 | if (x>6000) x-=65535; |
76 | if (x>6000) x-=65535; |
77 | if (y>6000) y-=65535; |
77 | if (y>6000) y-=65535; |
78 | EAX = 37; |
78 | EAX = 37; |
79 | EBX = 2; |
79 | EBX = 2; |
80 | $int 0x40 |
80 | $int 0x40 |
81 | $mov ebx, eax |
81 | $mov ebx, eax |
- | 82 | $mov ecx, eax |
|
82 | $and eax, 0x00000001 |
83 | $and eax, 0x00000001 |
83 | $shr ebx, 1 |
84 | $shr ebx, 1 |
84 | $and ebx, 0x00000001 |
85 | $and ebx, 0x00000001 |
- | 86 | $shr ecx, 2 |
|
- | 87 | $and ecx, 0x00000001 |
|
85 | lkm = EAX; |
88 | lkm = EAX; |
86 | pkm = EBX; |
89 | pkm = EBX; |
- | 90 | mkm = ECX; |
|
87 | EAX = 37; //áªà®«« |
91 | EAX = 37; //áªà®«« |
88 | EBX = 7; |
92 | EBX = 7; |
89 | $int 0x40 |
93 | $int 0x40 |
90 | $mov ebx, eax |
94 | $mov ebx, eax |
91 | $shr eax, 16 |
95 | $shr eax, 16 |
92 | $and ebx,0x0000FFFF |
96 | $and ebx,0x0000FFFF |
93 | //hor = EAX; |
97 | //hor = EAX; |
94 | vert = EBX; |
98 | vert = EBX; |
95 | } |
99 | } |
96 | 100 | ||
97 | 101 | ||
98 | :struct system_colors |
102 | :struct system_colors |
99 | { |
103 | { |
100 | dword frame,grab,grab_button,grab_button_text,grab_text, |
104 | dword frame,grab,grab_button,grab_button_text,grab_text, |
101 | work,work_button,work_button_text,work_text,work_graph; |
105 | work,work_button,work_button_text,work_text,work_graph; |
102 | void get(); |
106 | void get(); |
103 | }; |
107 | }; |
104 | 108 | ||
105 | :void system_colors::get() |
109 | :void system_colors::get() |
106 | { |
110 | { |
107 | EAX = 48; |
111 | EAX = 48; |
108 | EBX = 3; |
112 | EBX = 3; |
109 | ECX = #frame; |
113 | ECX = #frame; |
110 | EDX = 40; |
114 | EDX = 40; |
111 | $int 0x40 |
115 | $int 0x40 |
112 | } |
116 | } |
113 | 117 | ||
114 | //------------------------------------------------------------------------------ |
118 | //------------------------------------------------------------------------------ |
115 | 119 | ||
116 | inline fastcall dword WaitEvent() |
120 | inline fastcall dword WaitEvent() |
117 | { |
121 | { |
118 | $mov eax,10 |
122 | $mov eax,10 |
119 | $int 0x40 |
123 | $int 0x40 |
120 | } |
124 | } |
121 | 125 | ||
122 | inline fastcall dword CheckEvent() |
126 | inline fastcall dword CheckEvent() |
123 | { |
127 | { |
124 | $mov eax,11 |
128 | $mov eax,11 |
125 | $int 0x40 |
129 | $int 0x40 |
126 | } |
130 | } |
127 | 131 | ||
128 | inline fastcall dword WaitEventTimeout( EBX) |
132 | inline fastcall dword WaitEventTimeout( EBX) |
129 | { |
133 | { |
130 | $mov eax,23 |
134 | $mov eax,23 |
131 | $int 0x40 |
135 | $int 0x40 |
132 | } |
136 | } |
133 | 137 | ||
134 | inline fastcall SetEventMask( EBX) |
138 | inline fastcall SetEventMask( EBX) |
135 | { |
139 | { |
136 | $mov eax,40 |
140 | $mov eax,40 |
137 | $int 0x40 |
141 | $int 0x40 |
138 | } |
142 | } |
139 | 143 | ||
140 | inline fastcall ScancodesGeting(){ |
144 | inline fastcall ScancodesGeting(){ |
141 | $mov eax,66 |
145 | $mov eax,66 |
142 | $mov ebx,1 |
146 | $mov ebx,1 |
143 | $mov ecx,1 //᪠ª®¤ë |
147 | $mov ecx,1 //᪠ª®¤ë |
144 | $int 0x40 |
148 | $int 0x40 |
145 | } |
149 | } |
146 | 150 | ||
147 | inline fastcall word GetKey() //+Gluk fix |
151 | inline fastcall word GetKey() //+Gluk fix |
148 | { |
152 | { |
149 | $push edx |
153 | $push edx |
150 | GETKEY: |
154 | GETKEY: |
151 | $mov eax,2 |
155 | $mov eax,2 |
152 | $int 0x40 |
156 | $int 0x40 |
153 | $cmp eax,1 |
157 | $cmp eax,1 |
154 | $jne GETKEYI |
158 | $jne GETKEYI |
155 | $mov ah,dh |
159 | $mov ah,dh |
156 | $jmp GETKEYII //jz? |
160 | $jmp GETKEYII //jz? |
157 | GETKEYI: |
161 | GETKEYI: |
158 | $mov dh,ah |
162 | $mov dh,ah |
159 | $jmp GETKEY |
163 | $jmp GETKEY |
160 | GETKEYII: |
164 | GETKEYII: |
161 | $pop edx |
165 | $pop edx |
162 | $shr eax,8 |
166 | $shr eax,8 |
163 | } |
167 | } |
164 | 168 | ||
165 | inline fastcall int GetFullKey() |
169 | inline fastcall int GetFullKey() |
166 | { |
170 | { |
167 | $mov eax,2 |
171 | $mov eax,2 |
168 | $int 0x40 |
172 | $int 0x40 |
169 | } |
173 | } |
170 | 174 | ||
171 | 175 | ||
172 | inline fastcall pause( EBX) |
176 | inline fastcall pause( EBX) |
173 | { |
177 | { |
174 | $mov eax, 5 |
178 | $mov eax, 5 |
175 | $int 0x40 |
179 | $int 0x40 |
176 | } |
180 | } |
177 | 181 | ||
178 | inline fastcall word GetButtonID() |
182 | inline fastcall word GetButtonID() |
179 | { |
183 | { |
180 | $mov eax,17 |
184 | $mov eax,17 |
181 | $int 0x40 |
185 | $int 0x40 |
182 | $shr eax,8 |
186 | $shr eax,8 |
183 | } |
187 | } |
184 | 188 | ||
185 | inline fastcall dword GetFreeRAM() |
189 | inline fastcall dword GetFreeRAM() |
186 | { |
190 | { |
187 | $mov eax, 18 |
191 | $mov eax, 18 |
188 | $mov ebx, 16 |
192 | $mov ebx, 16 |
189 | $int 0x40 |
193 | $int 0x40 |
190 | //return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ |
194 | //return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ |
191 | } |
195 | } |
192 | 196 | ||
193 | inline fastcall dword LoadDriver( ECX) //ECX - èìÿ äðàéâåðà |
197 | inline fastcall dword LoadDriver( ECX) //ECX - èìÿ äðàéâåðà |
194 | { |
198 | { |
195 | $mov eax, 68 |
199 | $mov eax, 68 |
196 | $mov ebx, 16 |
200 | $mov ebx, 16 |
197 | $int 0x40 |
201 | $int 0x40 |
198 | //return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà |
202 | //return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà |
199 | } |
203 | } |
200 | 204 | ||
201 | inline fastcall dword RuleDriver( ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó |
205 | inline fastcall dword RuleDriver( ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó |
202 | { |
206 | { |
203 | $mov eax, 68 |
207 | $mov eax, 68 |
204 | $mov ebx, 17 |
208 | $mov ebx, 17 |
205 | $int 0x40 |
209 | $int 0x40 |
206 | //return eax = îïðåäåëÿåòñÿ äðàéâåðîì |
210 | //return eax = îïðåäåëÿåòñÿ äðàéâåðîì |
207 | } |
211 | } |
208 | 212 | ||
209 | struct proc_info |
213 | struct proc_info |
210 | { |
214 | { |
211 | #define SelfInfo -1 |
215 | #define SelfInfo -1 |
212 | dword use_cpu; |
216 | dword use_cpu; |
213 | word pos_in_stack,num_slot,rezerv1; |
217 | word pos_in_stack,num_slot,rezerv1; |
214 | unsigned char name[11]; |
218 | unsigned char name[11]; |
215 | char rezerv2; |
219 | char rezerv2; |
216 | dword adress,use_memory,ID,left,top,width,height; |
220 | dword adress,use_memory,ID,left,top,width,height; |
217 | word status_slot,rezerv3; |
221 | word status_slot,rezerv3; |
218 | dword work_left,work_top,work_width,work_height; |
222 | dword work_left,work_top,work_width,work_height; |
219 | char status_window; |
223 | char status_window; |
220 | dword cwidth,cheight; |
224 | dword cwidth,cheight; |
221 | byte reserved[1024-71-8]; |
225 | byte reserved[1024-71-8]; |
222 | }; |
226 | }; |
223 | 227 | ||
224 | inline fastcall void GetProcessInfo( EBX, ECX) |
228 | inline fastcall void GetProcessInfo( EBX, ECX) |
225 | { |
229 | { |
226 | $mov eax,9; |
230 | $mov eax,9; |
227 | $int 0x40 |
231 | $int 0x40 |
228 | DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth |
232 | DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth |
229 | DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight |
233 | DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight |
230 | } |
234 | } |
231 | 235 | ||
232 | inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y |
236 | inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y |
233 | { |
237 | { |
234 | $mov eax,34 |
238 | $mov eax,34 |
235 | $int 0x40 |
239 | $int 0x40 |
236 | } |
240 | } |
237 | 241 | ||
238 | inline fastcall int GetProcessSlot( ECX) |
242 | inline fastcall int GetProcessSlot( ECX) |
239 | { |
243 | { |
240 | EAX = 18; |
244 | EAX = 18; |
241 | EBX = 21; |
245 | EBX = 21; |
242 | $int 0x40 |
246 | $int 0x40 |
243 | } |
247 | } |
244 | 248 | ||
245 | inline fastcall int GetActiveProcess() |
249 | inline fastcall int GetActiveProcess() |
246 | { |
250 | { |
247 | EAX = 18; |
251 | EAX = 18; |
248 | EBX = 7; |
252 | EBX = 7; |
249 | $int 0x40 |
253 | $int 0x40 |
250 | } |
254 | } |
251 | 255 | ||
252 | :int CheckActiveProcess(int Form_ID) |
256 | :int CheckActiveProcess(int Form_ID) |
253 | { |
257 | { |
254 | int id9=GetProcessSlot(Form_ID); |
258 | int id9=GetProcessSlot(Form_ID); |
255 | if (id9==GetActiveProcess()) return 1; |
259 | if (id9==GetActiveProcess()) return 1; |
256 | return 0; |
260 | return 0; |
257 | } |
261 | } |
258 | 262 | ||
259 | inline fastcall void ActivateWindow( ECX) |
263 | inline fastcall void ActivateWindow( ECX) |
260 | { |
264 | { |
261 | EAX = 18; |
265 | EAX = 18; |
262 | EBX = 3; |
266 | EBX = 3; |
263 | $int 0x40 |
267 | $int 0x40 |
264 | } |
268 | } |
265 | 269 | ||
266 | inline fastcall int MinimizeWindow() |
270 | inline fastcall int MinimizeWindow() |
267 | { |
271 | { |
268 | EAX = 18; |
272 | EAX = 18; |
269 | EBX = 10; |
273 | EBX = 10; |
270 | $int 0x40 |
274 | $int 0x40 |
271 | } |
275 | } |
272 | 276 | ||
273 | inline fastcall int CreateThread( ECX,EDX) |
277 | inline fastcall int CreateThread( ECX,EDX) |
274 | { |
278 | { |
275 | $mov eax,51 |
279 | $mov eax,51 |
276 | $mov ebx,1 |
280 | $mov ebx,1 |
277 | $int 0x40 |
281 | $int 0x40 |
278 | } |
282 | } |
279 | 283 | ||
280 | inline fastcall void SwitchToAnotherThread() |
284 | inline fastcall void SwitchToAnotherThread() |
281 | { |
285 | { |
282 | $mov eax,68 |
286 | $mov eax,68 |
283 | $mov ebx,1 |
287 | $mov ebx,1 |
284 | $int 0x40 |
288 | $int 0x40 |
285 | } |
289 | } |
286 | 290 | ||
287 | inline fastcall int SendWindowMessage( ECX, EDX) |
291 | inline fastcall int SendWindowMessage( ECX, EDX) |
288 | { |
292 | { |
289 | $mov eax, 72 |
293 | $mov eax, 72 |
290 | $mov ebx, 1 |
294 | $mov ebx, 1 |
291 | $int 0x40 |
295 | $int 0x40 |
292 | } |
296 | } |
293 | 297 | ||
294 | inline fastcall int KillProcess( ECX) |
298 | inline fastcall int KillProcess( ECX) |
295 | { |
299 | { |
296 | $mov eax,18; |
300 | $mov eax,18; |
297 | $mov ebx,18; |
301 | $mov ebx,18; |
298 | $int 0x40 |
302 | $int 0x40 |
299 | } |
303 | } |
300 | 304 | ||
301 | #define TURN_OFF 2 |
305 | #define TURN_OFF 2 |
302 | #define REBOOT 3 |
306 | #define REBOOT 3 |
303 | #define KERNEL 4 |
307 | #define KERNEL 4 |
304 | inline fastcall int ExitSystem( ECX) |
308 | inline fastcall int ExitSystem( ECX) |
305 | { |
309 | { |
306 | $mov eax, 18 |
310 | $mov eax, 18 |
307 | $mov ebx, 9 |
311 | $mov ebx, 9 |
308 | $int 0x40 |
312 | $int 0x40 |
309 | } |
313 | } |
310 | 314 | ||
311 | inline fastcall ExitProcess() |
315 | inline fastcall ExitProcess() |
312 | { |
316 | { |
313 | $mov eax,-1; |
317 | $mov eax,-1; |
314 | $int 0x40 |
318 | $int 0x40 |
315 | } |
319 | } |
316 | 320 | ||
317 | //------------------------------------------------------------------------------ |
321 | //------------------------------------------------------------------------------ |
318 | 322 | ||
319 | //eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus) |
323 | //eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus) |
320 | inline fastcall int GetSystemLanguage() |
324 | inline fastcall int GetSystemLanguage() |
321 | { |
325 | { |
322 | EAX = 26; |
326 | EAX = 26; |
323 | EBX = 5; |
327 | EBX = 5; |
324 | $int 0x40 |
328 | $int 0x40 |
325 | } |
329 | } |
326 | 330 | ||
327 | inline fastcall GetSkinHeight() |
331 | inline fastcall GetSkinHeight() |
328 | { |
332 | { |
329 | $push ebx |
333 | $push ebx |
330 | $mov eax,48 |
334 | $mov eax,48 |
331 | $mov ebx,4 |
335 | $mov ebx,4 |
332 | $int 0x40 |
336 | $int 0x40 |
333 | $pop ebx |
337 | $pop ebx |
334 | } |
338 | } |
335 | 339 | ||
336 | inline fastcall void SetSystemSkin( ECX) |
340 | inline fastcall void SetSystemSkin( ECX) |
337 | { |
341 | { |
338 | EAX = 48; |
342 | EAX = 48; |
339 | EBX = 8; |
343 | EBX = 8; |
340 | $int 0x40 |
344 | $int 0x40 |
341 | } |
345 | } |
342 | 346 | ||
343 | inline fastcall int GetScreenWidth() |
347 | inline fastcall int GetScreenWidth() |
344 | { |
348 | { |
345 | $mov eax, 14 |
349 | $mov eax, 14 |
346 | $int 0x40 |
350 | $int 0x40 |
347 | $shr eax, 16 |
351 | $shr eax, 16 |
348 | } |
352 | } |
349 | 353 | ||
350 | inline fastcall int GetScreenHeight() |
354 | inline fastcall int GetScreenHeight() |
351 | { |
355 | { |
352 | $mov eax, 14 |
356 | $mov eax, 14 |
353 | $int 0x40 |
357 | $int 0x40 |
354 | $and eax,0x0000FFFF |
358 | $and eax,0x0000FFFF |
355 | } |
359 | } |
356 | 360 | ||
357 | inline fastcall int GetClientTop() |
361 | inline fastcall int GetClientTop() |
358 | { |
362 | { |
359 | $mov eax, 48 |
363 | $mov eax, 48 |
360 | $mov ebx, 5 |
364 | $mov ebx, 5 |
361 | $int 0x40 |
365 | $int 0x40 |
362 | $mov eax, ebx |
366 | $mov eax, ebx |
363 | $shr eax, 16 |
367 | $shr eax, 16 |
364 | } |
368 | } |
365 | 369 | ||
366 | inline fastcall int GetClientHeight() |
370 | inline fastcall int GetClientHeight() |
367 | { |
371 | { |
368 | $mov eax, 48 |
372 | $mov eax, 48 |
369 | $mov ebx, 5 |
373 | $mov ebx, 5 |
370 | $int 0x40 |
374 | $int 0x40 |
371 | $mov eax, ebx |
375 | $mov eax, ebx |
372 | } |
376 | } |
373 | 377 | ||
374 | 378 | ||
375 | inline fastcall dword LoadLibrary( ECX) |
379 | inline fastcall dword LoadLibrary( ECX) |
376 | { |
380 | { |
377 | $mov eax, 68 |
381 | $mov eax, 68 |
378 | $mov ebx, 19 |
382 | $mov ebx, 19 |
379 | $int 0x40 |
383 | $int 0x40 |
380 | } |
384 | } |
381 | 385 | ||
382 | inline fastcall int TestBit( EAX, CL) |
386 | inline fastcall int TestBit( EAX, CL) |
383 | { |
387 | { |
384 | $shr eax,cl |
388 | $shr eax,cl |
385 | $and eax,1 |
389 | $and eax,1 |
386 | } |
390 | } |
387 | 391 | ||
388 | inline fastcall int PlaySpeaker( ESI) |
392 | inline fastcall int PlaySpeaker( ESI) |
389 | { |
393 | { |
390 | $mov eax, 55 |
394 | $mov eax, 55 |
391 | $mov ebx, 55 |
395 | $mov ebx, 55 |
392 | $int 0x40 |
396 | $int 0x40 |
393 | } |
397 | } |
394 | 398 | ||
395 | inline fastcall void debugln( EDX) |
399 | inline fastcall void debugln( EDX) |
396 | { |
400 | { |
397 | $push eax |
401 | $push eax |
398 | $push ebx |
402 | $push ebx |
399 | $push ecx |
403 | $push ecx |
400 | $mov eax, 63 |
404 | $mov eax, 63 |
401 | $mov ebx, 1 |
405 | $mov ebx, 1 |
402 | NEXT_CHAR: |
406 | NEXT_CHAR: |
403 | $mov ecx, DSDWORD[edx] |
407 | $mov ecx, DSDWORD[edx] |
404 | $or cl, cl |
408 | $or cl, cl |
405 | $jz DONE |
409 | $jz DONE |
406 | $int 0x40 |
410 | $int 0x40 |
407 | $inc edx |
411 | $inc edx |
408 | $jmp NEXT_CHAR |
412 | $jmp NEXT_CHAR |
409 | DONE: |
413 | DONE: |
410 | $mov cl, 13 |
414 | $mov cl, 13 |
411 | $int 0x40 |
415 | $int 0x40 |
412 | $mov cl, 10 |
416 | $mov cl, 10 |
413 | $int 0x40 |
417 | $int 0x40 |
414 | $pop ecx |
418 | $pop ecx |
415 | $pop ebx |
419 | $pop ebx |
416 | $pop eax |
420 | $pop eax |
417 | } |
421 | } |
418 | 422 | ||
419 | inline fastcall void debug( EDX) |
423 | inline fastcall void debug( EDX) |
420 | { |
424 | { |
421 | $push eax |
425 | $push eax |
422 | $push ebx |
426 | $push ebx |
423 | $push ecx |
427 | $push ecx |
424 | $mov eax, 63 |
428 | $mov eax, 63 |
425 | $mov ebx, 1 |
429 | $mov ebx, 1 |
426 | NEXT_CHAR: |
430 | NEXT_CHAR: |
427 | $mov ecx, DSDWORD[edx] |
431 | $mov ecx, DSDWORD[edx] |
428 | $or cl, cl |
432 | $or cl, cl |
429 | $jz DONE |
433 | $jz DONE |
430 | $int 0x40 |
434 | $int 0x40 |
431 | $inc edx |
435 | $inc edx |
432 | $jmp NEXT_CHAR |
436 | $jmp NEXT_CHAR |
433 | DONE: |
437 | DONE: |
434 | $pop ecx |
438 | $pop ecx |
435 | $pop ebx |
439 | $pop ebx |
436 | $pop eax |
440 | $pop eax |
437 | } |
441 | } |
438 | 442 | ||
439 | 443 | ||
440 | inline fastcall void debugch( ECX) |
444 | inline fastcall void debugch( ECX) |
441 | { |
445 | { |
442 | $push eax |
446 | $push eax |
443 | $push ebx |
447 | $push ebx |
444 | $mov eax,63 |
448 | $mov eax,63 |
445 | $mov ebx,1 |
449 | $mov ebx,1 |
446 | $int 0x40 |
450 | $int 0x40 |
447 | $pop ebx |
451 | $pop ebx |
448 | $pop eax |
452 | $pop eax |
449 | } |
453 | } |
450 | //------------------------------------------------------------------------------ |
454 | //------------------------------------------------------------------------------ |
451 | 455 | ||
452 | void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, EDI, ESI) |
456 | void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, EDI, ESI) |
453 | { |
457 | { |
454 | EAX = 12; // function 12:tell os about windowdraw |
458 | EAX = 12; // function 12:tell os about windowdraw |
455 | EBX = 1; |
459 | EBX = 1; |
456 | $int 0x40 |
460 | $int 0x40 |
457 | 461 | ||
458 | EAX = 0; |
462 | EAX = 0; |
459 | EBX = x << 16 + size_w; |
463 | EBX = x << 16 + size_w; |
460 | ECX = y << 16 + size_h; |
464 | ECX = y << 16 + size_h; |
461 | EDX = WindowType << 24 | WindowAreaColor; |
465 | EDX = WindowType << 24 | WindowAreaColor; |
462 | $int 0x40 |
466 | $int 0x40 |
463 | 467 | ||
464 | EAX = 12; // function 12:tell os about windowdraw |
468 | EAX = 12; // function 12:tell os about windowdraw |
465 | EBX = 2; |
469 | EBX = 2; |
466 | $int 0x40 |
470 | $int 0x40 |
467 | } |
471 | } |
468 | 472 | ||
469 | inline fastcall MoveSize( EBX,ECX,EDX,ESI) |
473 | inline fastcall MoveSize( EBX,ECX,EDX,ESI) |
470 | { |
474 | { |
471 | $mov eax, 67 |
475 | $mov eax, 67 |
472 | $int 0x40 |
476 | $int 0x40 |
473 | } |
477 | } |
474 | 478 | ||
475 | inline fastcall void DrawTitle( ECX) |
479 | inline fastcall void DrawTitle( ECX) |
476 | { |
480 | { |
477 | EAX = 71; |
481 | EAX = 71; |
478 | EBX = 1; |
482 | EBX = 1; |
479 | $int 0x40; |
483 | $int 0x40; |
480 | } |
484 | } |
481 | 485 | ||
482 | void WriteTextB(dword x,y,byte fontType, dword color, EDX) |
486 | void WriteTextB(dword x,y,byte fontType, dword color, EDX) |
483 | { |
487 | { |
484 | EAX = 4; |
488 | EAX = 4; |
485 | EBX = x<<16+y; |
489 | EBX = x<<16+y; |
486 | ECX = fontType<<24+color; |
490 | ECX = fontType<<24+color; |
487 | ESI = 0; |
491 | ESI = 0; |
488 | $int 0x40; |
492 | $int 0x40; |
489 | $add ebx, 1<<16 |
493 | $add ebx, 1<<16 |
490 | $int 0x40 |
494 | $int 0x40 |
491 | } |
495 | } |
492 | 496 | ||
493 | void WriteText(dword x,y,byte fontType, dword color, EDX) |
497 | void WriteText(dword x,y,byte fontType, dword color, EDX) |
494 | { |
498 | { |
495 | EAX = 4; |
499 | EAX = 4; |
496 | EBX = x<<16+y; |
500 | EBX = x<<16+y; |
497 | ECX = fontType<<24+color; |
501 | ECX = fontType<<24+color; |
498 | $int 0x40; |
502 | $int 0x40; |
499 | } |
503 | } |
500 | 504 | ||
501 | dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI) |
505 | dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI) |
502 | { |
506 | { |
503 | EAX = 4; |
507 | EAX = 4; |
504 | EBX = x<<16+y; |
508 | EBX = x<<16+y; |
505 | ECX = fontType<<24+color; |
509 | ECX = fontType<<24+color; |
506 | $int 0x40; |
510 | $int 0x40; |
507 | } |
511 | } |
508 | 512 | ||
509 | void WriteNumber(dword x,y,byte fontType, dword color, count, ECX) |
513 | void WriteNumber(dword x,y,byte fontType, dword color, count, ECX) |
510 | { |
514 | { |
511 | EAX = 47; |
515 | EAX = 47; |
512 | EBX = count<<16; |
516 | EBX = count<<16; |
513 | EDX = x<<16+y; |
517 | EDX = x<<16+y; |
514 | ESI = fontType<<24+color; |
518 | ESI = fontType<<24+color; |
515 | $int 0x40; |
519 | $int 0x40; |
516 | } |
520 | } |
517 | 521 | ||
518 | void CopyScreen(dword EBX, x, y, w, h) |
522 | void CopyScreen(dword EBX, x, y, w, h) |
519 | { |
523 | { |
520 | EAX = 36; |
524 | EAX = 36; |
521 | ECX = w << 16 + h; |
525 | ECX = w << 16 + h; |
522 | EDX = x << 16 + y; |
526 | EDX = x << 16 + y; |
523 | $int 0x40; |
527 | $int 0x40; |
524 | } |
528 | } |
525 | 529 | ||
526 | :dword GetPixelColor(dword x, x_size, y) |
530 | :dword GetPixelColor(dword x, x_size, y) |
527 | { |
531 | { |
528 | $mov eax, 35 |
532 | $mov eax, 35 |
529 | EBX= y*x_size+x; |
533 | EBX= y*x_size+x; |
530 | $int 0x40 |
534 | $int 0x40 |
531 | } |
535 | } |
532 | 536 | ||
533 | 537 | ||
534 | void _PutImage(dword x,y, w,h, EBX) |
538 | void _PutImage(dword x,y, w,h, EBX) |
535 | { |
539 | { |
536 | EAX = 7; |
540 | EAX = 7; |
537 | ECX = w<<16+h; |
541 | ECX = w<<16+h; |
538 | EDX = x<<16+y; |
542 | EDX = x<<16+y; |
539 | $int 0x40 |
543 | $int 0x40 |
540 | } |
544 | } |
541 | 545 | ||
542 | void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI) |
546 | void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI) |
543 | { |
547 | { |
544 | EAX = 65; |
548 | EAX = 65; |
545 | ECX = w<<16+h; |
549 | ECX = w<<16+h; |
546 | EDX = x<<16+y; |
550 | EDX = x<<16+y; |
547 | EBP = 0; |
551 | EBP = 0; |
548 | $int 0x40 |
552 | $int 0x40 |
549 | } |
553 | } |
550 | 554 | ||
551 | inline fastcall void PutPixel( EBX,ECX,EDX) |
555 | inline fastcall void PutPixel( EBX,ECX,EDX) |
552 | { |
556 | { |
553 | EAX=1; |
557 | EAX=1; |
554 | $int 0x40 |
558 | $int 0x40 |
555 | } |
559 | } |
556 | 560 | ||
557 | void DrawBar(dword x,y,w,h,EDX) |
561 | void DrawBar(dword x,y,w,h,EDX) |
558 | { |
562 | { |
559 | if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :) |
563 | if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :) |
560 | EAX = 13; |
564 | EAX = 13; |
561 | EBX = x<<16+w; |
565 | EBX = x<<16+w; |
562 | ECX = y<<16+h; |
566 | ECX = y<<16+h; |
563 | $int 0x40 |
567 | $int 0x40 |
564 | } |
568 | } |
565 | 569 | ||
566 | void DefineButton(dword x,y,w,h,EDX,ESI) |
570 | void DefineButton(dword x,y,w,h,EDX,ESI) |
567 | { |
571 | { |
568 | EAX = 8; |
572 | EAX = 8; |
569 | $push edx |
573 | $push edx |
570 | EDX += BT_DEL; |
574 | EDX += BT_DEL; |
571 | $int 0x40; |
575 | $int 0x40; |
572 | $pop edx |
576 | $pop edx |
573 | EBX = x<<16+w; |
577 | EBX = x<<16+w; |
574 | ECX = y<<16+h; |
578 | ECX = y<<16+h; |
575 | $int 0x40 |
579 | $int 0x40 |
576 | } |
580 | } |
577 | 581 | ||
578 | void UnsafeDefineButton(dword x,y,w,h,EDX,ESI) |
582 | void UnsafeDefineButton(dword x,y,w,h,EDX,ESI) |
579 | { |
583 | { |
580 | EAX = 8; |
584 | EAX = 8; |
581 | EBX = x<<16+w; |
585 | EBX = x<<16+w; |
582 | ECX = y<<16+h; |
586 | ECX = y<<16+h; |
583 | $int 0x40 |
587 | $int 0x40 |
584 | } |
588 | } |
585 | 589 | ||
586 | inline fastcall void DeleteButton( EDX) |
590 | inline fastcall void DeleteButton( EDX) |
587 | { |
591 | { |
588 | EAX = 8; |
592 | EAX = 8; |
589 | EDX += BT_DEL; |
593 | EDX += BT_DEL; |
590 | $int 0x40; |
594 | $int 0x40; |
591 | } |
595 | } |
592 | 596 | ||
593 | inline fastcall dword GetStartTime() |
597 | inline fastcall dword GetStartTime() |
594 | { |
598 | { |
595 | $mov eax,26 |
599 | $mov eax,26 |
596 | $mov ebx,9 |
600 | $mov ebx,9 |
597 | $int 0x40 |
601 | $int 0x40 |
598 | }16+h; |
602 | }16+h; |
599 | ><16+h; |
603 | ><16+h; |
600 | >16+w; |
604 | >16+w; |
601 | ><16+w; |
605 | ><16+w; |
602 | >16+h; |
606 | >16+h; |
603 | ><16+h; |
607 | ><16+h; |
604 | >16+w; |
608 | >16+w; |
605 | ><16+w; |
609 | ><16+w; |
606 | >16+h; |
610 | >16+h; |
607 | ><16+h; |
611 | ><16+h; |
608 | >16+w; |
612 | >16+w; |
609 | ><16+w; |
613 | ><16+w; |
610 | >=0)>=0)>16+y; |
614 | >=0)>=0)>16+y; |
611 | ><16+y; |
615 | ><16+y; |
612 | >16+h; |
616 | >16+h; |
613 | ><16+h; |
617 | ><16+h; |
614 | >16+y; |
618 | >16+y; |
615 | ><16+y; |
619 | ><16+y; |
616 | >16+h; |
620 | >16+h; |
617 | ><16+h; |
621 | ><16+h; |
618 | >><>><>24+color; |
622 | >><>><>24+color; |
619 | ><24+color; |
623 | ><24+color; |
620 | >16+y; |
624 | >16+y; |
621 | ><16+y; |
625 | ><16+y; |
622 | >16; |
626 | >16; |
623 | ><16; |
627 | ><16; |
624 | >24+color; |
628 | >24+color; |
625 | ><24+color; |
629 | ><24+color; |
626 | >16+y; |
630 | >16+y; |
627 | ><16+y; |
631 | ><16+y; |
628 | >24+color; |
632 | >24+color; |
629 | ><24+color; |
633 | ><24+color; |
630 | >16+y; |
634 | >16+y; |
631 | ><16+y; |
635 | ><16+y; |
632 | >16 |
636 | >16 |
633 | ><16 |
637 | ><16 |
634 | >24+color; |
638 | >24+color; |
635 | ><24+color; |
639 | ><24+color; |
636 | >16+y; |
640 | >16+y; |
637 | ><16+y; |
641 | ><16+y; |
638 | >><>><>><> |
642 | >><>><>><> |