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