Rev 3114 | Rev 3225 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3114 | Rev 3128 | ||
---|---|---|---|
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 = #0x00100000; |
10 | dword alloc_mem = #0x00100000; |
11 | dword x86esp_reg = #0x00100000; |
11 | dword x86esp_reg = #0x00100000; |
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 | //Events |
17 | //Events |
18 | #define evMouse 6 |
18 | #define evMouse 6 |
19 | #define evButton 3 |
19 | #define evButton 3 |
20 | #define evKey 2 |
20 | #define evKey 2 |
21 | #define evReDraw 1 |
21 | #define evReDraw 1 |
22 | 22 | ||
23 | #define OLD -1 |
23 | #define OLD -1 |
24 | #define true 1 |
24 | #define true 1 |
25 | #define false 0 |
25 | #define false 0 |
26 | 26 | ||
27 | #define NULL 0 |
27 | #define NULL 0 |
28 | 28 | ||
29 | //Button options |
29 | //Button options |
30 | #define BT_DEL 0x80000000 |
30 | #define BT_DEL 0x80000000 |
31 | #define BT_HIDE 0x40000000 |
31 | #define BT_HIDE 0x40000000 |
32 | #define BT_NOFRAME 0x20000000 |
32 | #define BT_NOFRAME 0x20000000 |
33 | 33 | ||
34 | //------------------------------------------------------------------------- |
34 | //------------------------------------------------------------------------- |
35 | 35 | ||
36 | struct mouse |
36 | struct mouse |
37 | { |
37 | { |
38 | signed int x,y,lkm,pkm,hor,vert; |
38 | signed int x,y,lkm,pkm,hor,vert; |
39 | void get(); |
39 | void get(); |
40 | }; |
40 | }; |
41 | 41 | ||
42 | void mouse::get() |
42 | void mouse::get() |
43 | { |
43 | { |
44 | EAX = 37; |
44 | EAX = 37; |
45 | EBX = 1; |
45 | EBX = 1; |
46 | $int 0x40 |
46 | $int 0x40 |
47 | $mov ebx, eax |
47 | $mov ebx, eax |
48 | $shr eax, 16 |
48 | $shr eax, 16 |
49 | $and ebx,0x0000FFFF |
49 | $and ebx,0x0000FFFF |
50 | x = EAX; |
50 | x = EAX; |
51 | y = EBX; |
51 | y = EBX; |
52 | EAX = 37; |
52 | EAX = 37; |
53 | EBX = 2; |
53 | EBX = 2; |
54 | $int 0x40 |
54 | $int 0x40 |
55 | $mov ebx, eax |
55 | $mov ebx, eax |
56 | $and eax, 0x00000001 |
56 | $and eax, 0x00000001 |
57 | $shr ebx, 1 |
57 | $shr ebx, 1 |
58 | $and ebx, 0x00000001 |
58 | $and ebx, 0x00000001 |
59 | lkm = EAX; |
59 | lkm = EAX; |
60 | pkm = EBX; |
60 | pkm = EBX; |
61 | EAX = 37; //áªà®«« |
61 | EAX = 37; //áªà®«« |
62 | EBX = 7; |
62 | EBX = 7; |
63 | $int 0x40 |
63 | $int 0x40 |
64 | $mov ebx, eax |
64 | $mov ebx, eax |
65 | $shr eax, 16 |
65 | $shr eax, 16 |
66 | $and ebx,0x0000FFFF |
66 | $and ebx,0x0000FFFF |
67 | //hor = EAX; |
67 | //hor = EAX; |
68 | vert = EBX; |
68 | vert = EBX; |
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 | 242 | ||
243 | inline fastcall int KillProcess( ECX) |
243 | inline fastcall int KillProcess( ECX) |
244 | { |
244 | { |
245 | $mov eax,18; |
245 | $mov eax,18; |
246 | $mov ebx,18; |
246 | $mov ebx,18; |
247 | $int 0x40 |
247 | $int 0x40 |
248 | } |
248 | } |
249 | 249 | ||
250 | #define TURN_OFF 2 |
250 | #define TURN_OFF 2 |
251 | #define REBOOT 3 |
251 | #define REBOOT 3 |
252 | #define KERNEL 4 |
252 | #define KERNEL 4 |
253 | inline fastcall int ExitSystem( ECX) |
253 | inline fastcall int ExitSystem( ECX) |
254 | { |
254 | { |
255 | $mov eax, 18 |
255 | $mov eax, 18 |
256 | $mov ebx, 9 |
256 | $mov ebx, 9 |
257 | $int 0x40 |
257 | $int 0x40 |
258 | } |
258 | } |
259 | 259 | ||
260 | inline fastcall ExitProcess() |
260 | inline fastcall ExitProcess() |
261 | { |
261 | { |
262 | $mov eax,-1; |
262 | $mov eax,-1; |
263 | $int 0x40 |
263 | $int 0x40 |
264 | } |
264 | } |
265 | 265 | ||
266 | //------------------------------------------------------------------------------ |
266 | //------------------------------------------------------------------------------ |
267 | 267 | ||
268 | //eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus) |
268 | //eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus) |
269 | inline fastcall int GetSystemLanguage() |
269 | inline fastcall int GetSystemLanguage() |
270 | { |
270 | { |
271 | EAX = 26; |
271 | EAX = 26; |
272 | EBX = 5; |
272 | EBX = 5; |
273 | $int 0x40 |
273 | $int 0x40 |
274 | } |
274 | } |
275 | 275 | ||
276 | inline fastcall GetSkinHeight() |
276 | inline fastcall GetSkinHeight() |
277 | { |
277 | { |
278 | $push ebx |
278 | $push ebx |
279 | $mov eax,48 |
279 | $mov eax,48 |
280 | $mov ebx,4 |
280 | $mov ebx,4 |
281 | $int 0x40 |
281 | $int 0x40 |
282 | $pop ebx |
282 | $pop ebx |
283 | } |
283 | } |
284 | 284 | ||
285 | inline fastcall void SetSystemSkin( ECX) |
285 | inline fastcall void SetSystemSkin( ECX) |
286 | { |
286 | { |
287 | EAX = 48; |
287 | EAX = 48; |
288 | EBX = 8; |
288 | EBX = 8; |
289 | $int 0x40 |
289 | $int 0x40 |
290 | } |
290 | } |
291 | 291 | ||
292 | inline fastcall int GetScreenWidth() |
292 | inline fastcall int GetScreenWidth() |
293 | { |
293 | { |
294 | $mov eax, 14 |
294 | $mov eax, 14 |
295 | $int 0x40 |
295 | $int 0x40 |
296 | $shr eax, 16 |
296 | $shr eax, 16 |
297 | } |
297 | } |
298 | 298 | ||
299 | inline fastcall int GetScreenHeight() |
299 | inline fastcall int GetScreenHeight() |
300 | { |
300 | { |
301 | $mov eax, 14 |
301 | $mov eax, 14 |
302 | $int 0x40 |
302 | $int 0x40 |
303 | $and eax,0x0000FFFF |
303 | $and eax,0x0000FFFF |
304 | } |
304 | } |
305 | 305 | ||
306 | inline fastcall dword LoadLibrary( ECX) |
306 | inline fastcall dword LoadLibrary( ECX) |
307 | { |
307 | { |
308 | $mov eax, 68 |
308 | $mov eax, 68 |
309 | $mov ebx, 19 |
309 | $mov ebx, 19 |
310 | $int 0x40 |
310 | $int 0x40 |
311 | } |
311 | } |
312 | 312 | ||
313 | inline fastcall int TestBit( EAX, CL) |
313 | inline fastcall int TestBit( EAX, CL) |
314 | { |
314 | { |
315 | $shr eax,cl |
315 | $shr eax,cl |
316 | $and eax,1 |
316 | $and eax,1 |
317 | } |
317 | } |
318 | 318 | ||
319 | inline fastcall int PlaySpeaker( ESI) |
319 | inline fastcall int PlaySpeaker( ESI) |
320 | { |
320 | { |
321 | $mov eax, 55 |
321 | $mov eax, 55 |
322 | $mov ebx, 55 |
322 | $mov ebx, 55 |
323 | $int 0x40 |
323 | $int 0x40 |
324 | } |
324 | } |
325 | 325 | ||
326 | inline fastcall void debug( EDX) |
326 | inline fastcall void debug( EDX) |
327 | { |
327 | { |
- | 328 | $push eax |
|
328 | $push ebx |
329 | $push ebx |
329 | $push ecx |
330 | $push ecx |
330 | $mov eax, 63 |
331 | $mov eax, 63 |
331 | $mov ebx, 1 |
332 | $mov ebx, 1 |
332 | NEXT_CHAR: |
333 | NEXT_CHAR: |
333 | $mov ecx, DSDWORD[edx] |
334 | $mov ecx, DSDWORD[edx] |
334 | $or cl, cl |
335 | $or cl, cl |
335 | $jz DONE |
336 | $jz DONE |
336 | $int 0x40 |
337 | $int 0x40 |
337 | $inc edx |
338 | $inc edx |
338 | $jmp NEXT_CHAR |
339 | $jmp NEXT_CHAR |
339 | DONE: |
340 | DONE: |
340 | $mov cl, 13 |
341 | $mov cl, 13 |
341 | $int 0x40 |
342 | $int 0x40 |
342 | $mov cl, 10 |
343 | $mov cl, 10 |
343 | $int 0x40 |
344 | $int 0x40 |
344 | $pop ecx |
345 | $pop ecx |
345 | $pop ebx |
346 | $pop ebx |
- | 347 | $pop eax |
|
346 | } |
348 | } |
347 | 349 | ||
348 | inline fastcall void debugch( ECX) |
350 | inline fastcall void debugch( ECX) |
349 | { |
351 | { |
- | 352 | $push eax |
|
- | 353 | $push ebx |
|
350 | $mov eax,63 |
354 | $mov eax,63 |
351 | $mov ebx,1 |
355 | $mov ebx,1 |
352 | $int 0x40 |
356 | $int 0x40 |
- | 357 | $pop ebx |
|
- | 358 | $pop eax |
|
353 | } |
359 | } |
354 | //------------------------------------------------------------------------------ |
360 | //------------------------------------------------------------------------------ |
355 | 361 | ||
356 | void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI, ESI) |
362 | void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI, ESI) |
357 | { |
363 | { |
358 | EAX = 12; // function 12:tell os about windowdraw |
364 | EAX = 12; // function 12:tell os about windowdraw |
359 | EBX = 1; |
365 | EBX = 1; |
360 | $int 0x40 |
366 | $int 0x40 |
361 | 367 | ||
362 | EAX = 0; |
368 | EAX = 0; |
363 | EBX = x << 16 + sizeX; |
369 | EBX = x << 16 + sizeX; |
364 | ECX = y << 16 + sizeY; |
370 | ECX = y << 16 + sizeY; |
365 | EDX = WindowType << 24 | WindowAreaColor; |
371 | EDX = WindowType << 24 | WindowAreaColor; |
366 | $int 0x40 |
372 | $int 0x40 |
367 | 373 | ||
368 | EAX = 12; // function 12:tell os about windowdraw |
374 | EAX = 12; // function 12:tell os about windowdraw |
369 | EBX = 2; |
375 | EBX = 2; |
370 | $int 0x40 |
376 | $int 0x40 |
371 | } |
377 | } |
372 | 378 | ||
373 | inline fastcall MoveSize( EBX,ECX,EDX,ESI) |
379 | inline fastcall MoveSize( EBX,ECX,EDX,ESI) |
374 | { |
380 | { |
375 | $mov eax, 67 |
381 | $mov eax, 67 |
376 | $int 0x40 |
382 | $int 0x40 |
377 | } |
383 | } |
378 | 384 | ||
379 | inline fastcall void DrawTitle( ECX) |
385 | inline fastcall void DrawTitle( ECX) |
380 | { |
386 | { |
381 | EAX = 71; |
387 | EAX = 71; |
382 | EBX = 1; |
388 | EBX = 1; |
383 | $int 0x40; |
389 | $int 0x40; |
384 | } |
390 | } |
385 | 391 | ||
386 | void WriteTextB(dword x,y,byte fontType, dword color, EDX) |
392 | void WriteTextB(dword x,y,byte fontType, dword color, EDX) |
387 | { |
393 | { |
388 | EAX = 4; |
394 | EAX = 4; |
389 | EBX = x<<16+y; |
395 | EBX = x<<16+y; |
390 | ECX = fontType<<24+color; |
396 | ECX = fontType<<24+color; |
391 | $int 0x40; |
397 | $int 0x40; |
392 | $add ebx, 1<<16 |
398 | $add ebx, 1<<16 |
393 | $int 0x40 |
399 | $int 0x40 |
394 | } |
400 | } |
395 | 401 | ||
396 | void WriteText(dword x,y,byte fontType, dword color, EDX) |
402 | void WriteText(dword x,y,byte fontType, dword color, EDX) |
397 | { |
403 | { |
398 | EAX = 4; |
404 | EAX = 4; |
399 | EBX = x<<16+y; |
405 | EBX = x<<16+y; |
400 | ECX = fontType<<24+color; |
406 | ECX = fontType<<24+color; |
401 | $xor esi, esi |
407 | $xor esi, esi |
402 | $int 0x40; |
408 | $int 0x40; |
403 | } |
409 | } |
404 | 410 | ||
405 | void WriteNumber(dword x,y,byte fontType, dword color, count, ECX) |
411 | void WriteNumber(dword x,y,byte fontType, dword color, count, ECX) |
406 | { |
412 | { |
407 | EAX = 47; |
413 | EAX = 47; |
408 | EBX = count<<16; |
414 | EBX = count<<16; |
409 | EDX = x<<16+y; |
415 | EDX = x<<16+y; |
410 | ESI = fontType<<24+color; |
416 | ESI = fontType<<24+color; |
411 | $int 0x40; |
417 | $int 0x40; |
412 | } |
418 | } |
413 | 419 | ||
414 | void CopyScreen(dword EBX, x, y, sizeX, sizeY) |
420 | void CopyScreen(dword EBX, x, y, sizeX, sizeY) |
415 | { |
421 | { |
416 | EAX = 36; |
422 | EAX = 36; |
417 | ECX = sizeX << 16 + sizeY; |
423 | ECX = sizeX << 16 + sizeY; |
418 | EDX = x << 16 + y; |
424 | EDX = x << 16 + y; |
419 | $int 0x40; |
425 | $int 0x40; |
420 | } |
426 | } |
421 | 427 | ||
422 | dword GetPixelColor(dword x, x_size, y) |
428 | dword GetPixelColor(dword x, x_size, y) |
423 | { |
429 | { |
424 | $mov eax, 35 |
430 | $mov eax, 35 |
425 | EBX= y*x_size+x; |
431 | EBX= y*x_size+x; |
426 | $int 0x40 |
432 | $int 0x40 |
427 | } |
433 | } |
428 | 434 | ||
429 | void PutImage(dword EBX,w,h,x,y) |
435 | void PutImage(dword EBX,w,h,x,y) |
430 | { |
436 | { |
431 | EAX = 7; |
437 | EAX = 7; |
432 | ECX = w<<16+h; |
438 | ECX = w<<16+h; |
433 | EDX = x<<16+y; |
439 | EDX = x<<16+y; |
434 | $int 0x40 |
440 | $int 0x40 |
435 | } |
441 | } |
436 | 442 | ||
437 | void _PutImage(dword x,y, w,h, EBX) |
443 | void _PutImage(dword x,y, w,h, EBX) |
438 | { |
444 | { |
439 | EAX = 7; |
445 | EAX = 7; |
440 | ECX = w<<16+h; |
446 | ECX = w<<16+h; |
441 | EDX = x<<16+y; |
447 | EDX = x<<16+y; |
442 | $int 0x40 |
448 | $int 0x40 |
443 | } |
449 | } |
444 | 450 | ||
445 | void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI) |
451 | void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI) |
446 | { |
452 | { |
447 | EAX = 65; |
453 | EAX = 65; |
448 | ECX = w<<16+h; |
454 | ECX = w<<16+h; |
449 | EDX = x<<16+y; |
455 | EDX = x<<16+y; |
450 | EBP = 0; |
456 | EBP = 0; |
451 | $int 0x40 |
457 | $int 0x40 |
452 | } |
458 | } |
453 | 459 | ||
454 | inline fastcall void PutPixel( EBX,ECX,EDX) |
460 | inline fastcall void PutPixel( EBX,ECX,EDX) |
455 | { |
461 | { |
456 | EAX=1; |
462 | EAX=1; |
457 | $int 0x40 |
463 | $int 0x40 |
458 | } |
464 | } |
459 | 465 | ||
460 | void DrawBar(dword x,y,w,h,EDX) |
466 | void DrawBar(dword x,y,w,h,EDX) |
461 | { |
467 | { |
462 | if (h<=0) || (h>65000) return; //bad boy :) |
468 | if (h<=0) || (h>65000) return; //bad boy :) |
463 | EAX = 13; |
469 | EAX = 13; |
464 | EBX = x<<16+w; |
470 | EBX = x<<16+w; |
465 | ECX = y<<16+h; |
471 | ECX = y<<16+h; |
466 | $int 0x40 |
472 | $int 0x40 |
467 | } |
473 | } |
468 | 474 | ||
469 | void DefineButton(dword x,y,w,h,EDX,ESI) |
475 | void DefineButton(dword x,y,w,h,EDX,ESI) |
470 | { |
476 | { |
471 | EAX = 8; |
477 | EAX = 8; |
472 | $push edx |
478 | $push edx |
473 | EDX += BT_DEL; |
479 | EDX += BT_DEL; |
474 | $int 0x40; |
480 | $int 0x40; |
475 | $pop edx |
481 | $pop edx |
476 | EBX = x<<16+w; |
482 | EBX = x<<16+w; |
477 | ECX = y<<16+h; |
483 | ECX = y<<16+h; |
478 | $int 0x40 |
484 | $int 0x40 |
479 | } |
485 | } |
480 | 486 | ||
481 | void UnsafeDefineButton(dword x,y,w,h,EDX,ESI) |
487 | void UnsafeDefineButton(dword x,y,w,h,EDX,ESI) |
482 | { |
488 | { |
483 | EAX = 8; |
489 | EAX = 8; |
484 | EBX = x<<16+w; |
490 | EBX = x<<16+w; |
485 | ECX = y<<16+h; |
491 | ECX = y<<16+h; |
486 | $int 0x40 |
492 | $int 0x40 |
487 | } |
493 | } |
488 | 494 | ||
489 | inline fastcall void DeleteButton( EDX) |
495 | inline fastcall void DeleteButton( EDX) |
490 | { |
496 | { |
491 | EAX = 8; |
497 | EAX = 8; |
492 | EDX += BT_DEL; |
498 | EDX += BT_DEL; |
493 | $int 0x40; |
499 | $int 0x40; |
494 | }16+h; |
500 | }16+h; |
495 | ><16+h; |
501 | ><16+h; |
496 | >16+w; |
502 | >16+w; |
497 | ><16+w; |
503 | ><16+w; |
498 | >16+h; |
504 | >16+h; |
499 | ><16+h; |
505 | ><16+h; |
500 | >16+w; |
506 | >16+w; |
501 | ><16+w; |
507 | ><16+w; |
502 | >16+h; |
508 | >16+h; |
503 | ><16+h; |
509 | ><16+h; |
504 | >16+w; |
510 | >16+w; |
505 | ><16+w; |
511 | ><16+w; |
506 | >=0)>16+y; |
512 | >=0)>16+y; |
507 | ><16+y; |
513 | ><16+y; |
508 | >16+h; |
514 | >16+h; |
509 | ><16+h; |
515 | ><16+h; |
510 | >16+y; |
516 | >16+y; |
511 | ><16+y; |
517 | ><16+y; |
512 | >16+h; |
518 | >16+h; |
513 | ><16+h; |
519 | ><16+h; |
514 | >16+y; |
520 | >16+y; |
515 | ><16+y; |
521 | ><16+y; |
516 | >16+h; |
522 | >16+h; |
517 | ><16+h; |
523 | ><16+h; |
518 | >><>><>24+color; |
524 | >><>><>24+color; |
519 | ><24+color; |
525 | ><24+color; |
520 | >16+y; |
526 | >16+y; |
521 | ><16+y; |
527 | ><16+y; |
522 | >16; |
528 | >16; |
523 | ><16; |
529 | ><16; |
524 | >24+color; |
530 | >24+color; |
525 | ><24+color; |
531 | ><24+color; |
526 | >16+y; |
532 | >16+y; |
527 | ><16+y; |
533 | ><16+y; |
528 | >16 |
534 | >16 |
529 | ><16 |
535 | ><16 |
530 | >24+color; |
536 | >24+color; |
531 | ><24+color; |
537 | ><24+color; |
532 | >16+y; |
538 | >16+y; |
533 | ><16+y; |
539 | ><16+y; |
534 | >><>><>><> |
540 | >><>><>><> |