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