Rev 2528 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1971 | lev | 1 | //CODED by Veliant, Leency, Nable. GNU GPL licence. |
2 | |||
3 | #startaddress 0 |
||
4 | #code32 TRUE |
||
5 | |||
6 | char os_name[8] = {'M','E','N','U','E','T','0','1'}; |
||
7 | dword os_version = 0x00000001; |
||
8 | dword start_addr = #main; |
||
9 | dword final_addr = #stop+32; |
||
10 | dword alloc_mem = #0x00100000; |
||
11 | dword x86esp_reg = #0x00100000; |
||
12 | dword I_Param = #param; |
||
2085 | leency | 13 | dword I_Path = #program_path; |
2566 | leency | 14 | char param[4096]; |
15 | char program_path[4096]; |
||
1971 | lev | 16 | |
17 | //Events |
||
18 | #define evMouse 6 |
||
19 | #define evButton 3 |
||
20 | #define evKey 2 |
||
21 | #define evReDraw 1 |
||
22 | |||
23 | //Button options |
||
24 | #define BT_DEL 0x80000000 |
||
25 | #define BT_HIDE 0x40000000 |
||
26 | #define BT_NOFRAME 0x20000000 |
||
27 | |||
28 | #define OLD -1 |
||
29 | #define true 1 |
||
30 | #define false 0 |
||
31 | //------------------------------------------------------------------------- |
||
32 | |||
33 | struct mouse{ |
||
34 | dword x,y,lkm,pkm,hor,vert; |
||
35 | void get(); |
||
36 | }; |
||
37 | |||
38 | void mouse::get() |
||
39 | { |
||
40 | EAX = 37; |
||
41 | EBX = 1; |
||
42 | $int 0x40 |
||
43 | $mov ebx, eax |
||
44 | $shr eax, 16 |
||
45 | $and ebx,0x0000FFFF |
||
46 | x = EAX; |
||
47 | y = EBX; |
||
48 | EAX = 37; |
||
49 | EBX = 2; |
||
50 | $int 0x40 |
||
51 | $mov ebx, eax |
||
52 | $and eax, 0x00000001 |
||
53 | $shr ebx, 1 |
||
54 | $and ebx, 0x00000001 |
||
55 | lkm = EAX; |
||
56 | pkm = EBX; |
||
57 | EAX = 37; //скролл |
||
58 | EBX = 7; |
||
59 | $int 0x40 |
||
60 | $mov ebx, eax |
||
61 | $shr eax, 16 |
||
62 | $and ebx,0x0000FFFF |
||
63 | //hor = EAX; |
||
64 | vert = EBX; |
||
65 | } |
||
66 | |||
67 | |||
68 | struct system_colors{ |
||
69 | dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph; |
||
70 | void get(); |
||
71 | }; |
||
72 | void system_colors::get() |
||
73 | { |
||
74 | EAX = 48; |
||
75 | EBX = 3; |
||
76 | ECX = #frame; |
||
77 | EDX = 40; |
||
78 | $int 0x40 |
||
79 | } |
||
80 | |||
81 | //------------------------------------------------------------------------------ |
||
82 | |||
83 | inline fastcall dword WaitEvent(){ |
||
84 | EAX = 10; |
||
85 | $int 0x40 |
||
86 | } |
||
87 | |||
88 | inline fastcall dword WaitEventTimeout(dword EBX){ |
||
89 | EAX = 23; |
||
90 | $int 0x40 |
||
91 | } |
||
92 | |||
93 | inline fastcall SetEventMask(dword EBX) |
||
94 | { |
||
95 | EAX = 40; |
||
96 | $int 0x40 |
||
97 | } |
||
98 | |||
99 | inline fastcall ScancodesGeting(){ |
||
100 | $mov eax,66; |
||
101 | $mov ebx,1; |
||
102 | $mov ecx,1; //сканкоды |
||
103 | $int 0x40 |
||
104 | } |
||
105 | |||
2085 | leency | 106 | |
107 | inline fastcall word GetKey(){ //Gluk fix |
||
108 | $push edx |
||
109 | @getkey: |
||
110 | $mov eax,2 |
||
111 | $int 0x40 |
||
112 | $cmp eax,1 |
||
113 | $jne getkeyi |
||
114 | $mov ah,dh |
||
115 | $jmp getkeyii //jz? |
||
116 | @getkeyi: |
||
117 | $mov dh,ah |
||
118 | $jmp getkey |
||
119 | @getkeyii: |
||
120 | $pop edx |
||
121 | EAX = EAX >> 8; |
||
1971 | lev | 122 | } |
123 | |||
2416 | leency | 124 | |
125 | inline fastcall Pause(dword EBX) |
||
126 | { //Пауза, в сотых долях секунды EBX = value |
||
127 | $mov eax, 5 |
||
128 | $int 0x40 |
||
129 | } |
||
130 | |||
131 | //================================================================== |
||
132 | |||
1971 | lev | 133 | inline fastcall word GetButtonID(){ |
134 | EAX = 17; |
||
135 | $int 0x40 |
||
136 | EAX = EAX >> 8; |
||
137 | } |
||
138 | |||
2416 | leency | 139 | struct proc_info{ |
140 | dword use_cpu; |
||
141 | word pos_in_stack,num_slot,rezerv1; |
||
142 | char name[11]; |
||
143 | char rezerv2; |
||
144 | dword adress,use_memory,ID,left,top,width,height; |
||
145 | word status_slot,rezerv3; |
||
146 | dword work_left,work_top,work_width,work_height; |
||
147 | char status_window; |
||
148 | void GetInfo(dword ECX); |
||
149 | byte reserved[1024-71]; |
||
150 | #define SelfInfo -1 |
||
151 | }; |
||
152 | |||
153 | void GetProcessInfo(dword EBX, ECX) |
||
154 | { |
||
155 | EAX = 9; |
||
156 | $int 0x40 |
||
157 | } |
||
158 | |||
159 | int GetProcessSlot(ECX) //ECX = process ID |
||
160 | { |
||
161 | EAX = 18; |
||
162 | EBX = 21; |
||
163 | $int 0x40; |
||
164 | } |
||
165 | |||
1971 | lev | 166 | inline fastcall ExitProcess(){ |
167 | EAX = -1; // close this program |
||
168 | $int 0x40 |
||
169 | } |
||
170 | |||
2416 | leency | 171 | inline fastcall KillProcess(dword ECX){ |
172 | $mov eax,18; |
||
173 | $mov ebx,18; |
||
1971 | lev | 174 | $int 0x40 |
175 | } |
||
176 | |||
2416 | leency | 177 | //================================================================== |
1971 | lev | 178 | |
2252 | leency | 179 | //eax = ч√ъ ёшёЄхь√ (1=eng, 2=fi, 3=ger, 4=rus) |
180 | inline fastcall int GetSystemLanguage(){ |
||
181 | EAX = 26; |
||
182 | EBX = 5; |
||
183 | $int 0x40 |
||
184 | RETURN EAX; |
||
185 | } |
||
186 | |||
1971 | lev | 187 | inline fastcall void DrawTitle(dword ECX) |
188 | { |
||
189 | EAX = 71; |
||
190 | EBX = 1; |
||
191 | $int 0x40; |
||
192 | } |
||
193 | |||
194 | inline fastcall dword GetSkinWidth() |
||
195 | { |
||
196 | EAX = 48; |
||
197 | EBX = 4; |
||
198 | $int 0x40 |
||
199 | } |
||
200 | |||
2495 | leency | 201 | inline fastcall void SetSystemSkin(ECX){ |
1971 | lev | 202 | EAX = 48; |
203 | EBX = 8; |
||
204 | $int 0x40 |
||
205 | } |
||
206 | |||
207 | inline fastcall dword GetScreenWidth() |
||
208 | { |
||
209 | EAX = 14; |
||
210 | EBX = 4; |
||
211 | $int 0x40 |
||
212 | $shr eax, 16 |
||
213 | $and eax,0x0000FFFF |
||
214 | } |
||
215 | |||
216 | inline fastcall MoveSize(dword EBX,ECX,EDX,ESI) |
||
217 | { |
||
218 | EAX = 67; |
||
219 | $int 0x40 |
||
220 | } |
||
221 | |||
222 | inline fastcall dword LoadLibrary(dword ECX) |
||
223 | { |
||
224 | $mov eax, 68 |
||
225 | $mov ebx, 19 |
||
226 | $int 0x40 |
||
227 | } |
||
228 | |||
229 | //------------------------------------------------------------------------------ |
||
230 | inline fastcall dword strlen(dword EDI){ |
||
231 | EAX=0; |
||
232 | ECX=-1; |
||
233 | $REPNE $SCASB |
||
234 | EAX-=2+ECX; |
||
235 | } |
||
236 | |||
237 | inline fastcall copystr(dword ESI,EDI) |
||
238 | { |
||
239 | $cld |
||
240 | l1: |
||
241 | $lodsb |
||
242 | $stosb |
||
243 | $test al,al |
||
244 | $jnz l1 |
||
245 | } |
||
246 | |||
2252 | leency | 247 | |
1971 | lev | 248 | byte fastcall TestBit(EAX, CL) |
249 | { |
||
250 | $shr eax,cl |
||
251 | $and eax,1 |
||
252 | } |
||
253 | |||
254 | char buffer[11]=""; |
||
255 | inline fastcall dword IntToStr(dword ESI) |
||
256 | { |
||
257 | $mov edi, #buffer |
||
258 | $mov ecx, 10 |
||
259 | $test esi, esi |
||
260 | $jns f1 |
||
261 | $mov al, '-' |
||
262 | $stosb |
||
263 | $neg esi |
||
264 | f1: |
||
265 | $mov eax, esi |
||
266 | $push -'0' |
||
267 | f2: |
||
268 | $xor edx, edx |
||
269 | $div ecx |
||
270 | $push edx |
||
271 | $test eax, eax |
||
272 | $jnz f2 |
||
273 | f3: |
||
274 | $pop eax |
||
275 | $add al, '0' |
||
276 | $stosb |
||
277 | $jnz f3 |
||
278 | $mov eax, #buffer |
||
279 | $ret |
||
280 | } |
||
281 | |||
282 | |||
283 | inline fastcall dword StrToInt() |
||
284 | { |
||
285 | ESI=EDI=EAX; |
||
286 | IF(DSBYTE[ESI]=='-')ESI++; |
||
287 | EAX=0; |
||
288 | BH=AL; |
||
289 | do{ |
||
290 | BL=DSBYTE[ESI]-'0'; |
||
291 | EAX=EAX*10+EBX; |
||
292 | ESI++; |
||
293 | }while(DSBYTE[ESI]>0); |
||
294 | IF(DSBYTE[EDI]=='-') -EAX; |
||
295 | } |
||
296 | |||
297 | |||
298 | inline fastcall int strcmp(ESI, EDI) |
||
299 | { |
||
300 | loop() |
||
301 | { |
||
302 | IF (DSBYTE[ESI] |
||
303 | IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1; |
||
304 | IF (DSBYTE[ESI]=='\0') RETURN 0; |
||
305 | ESI++; |
||
306 | EDI++; |
||
307 | } |
||
308 | } |
||
309 | |||
310 | inline fastcall unsigned int find_symbol(ESI,BL) |
||
311 | { |
||
312 | int jj=0, last=-1; |
||
313 | do{ |
||
314 | jj++; |
||
315 | $lodsb |
||
316 | IF(AL==BL) last=jj; |
||
317 | } while(AL!=0); |
||
318 | return last; |
||
319 | } |
||
320 | |||
321 | |||
322 | inline fastcall dword upcase(dword ESI) |
||
323 | { |
||
324 | do{ |
||
325 | AL=DSBYTE[ESI]; |
||
326 | IF(AL>='a')IF(AL<='z')DSBYTE[ESI]=AL&0x5f; |
||
327 | ESI++; |
||
328 | }while(AL!=0); |
||
329 | } |
||
330 | |||
331 | /*inline fastcall void lowcase(ESI) |
||
332 | { |
||
333 | do{ |
||
334 | $LODSB |
||
335 | IF(AL>='A')&&(AL<='Z'){ |
||
336 | AL+=0x20; |
||
337 | DSBYTE[ESI-1]=AL; |
||
338 | CONTINUE; |
||
339 | } |
||
340 | }while(AL!=0); |
||
341 | }*/ |
||
342 | |||
343 | inline fastcall lowcase(ESI) |
||
344 | { |
||
345 | do{ |
||
346 | $LODSB |
||
347 | IF(AL>='A')&&(AL<='Z'){ |
||
348 | AL+=0x20; |
||
349 | DSBYTE[ESI-1]=AL; |
||
350 | CONTINUE; |
||
351 | } |
||
352 | }while(AL!=0); |
||
353 | } |
||
354 | |||
355 | |||
356 | inline fastcall wintodos (dword ESI) |
||
357 | { |
||
358 | while (BL=ESBYTE[ESI]) |
||
359 | { |
||
360 | IF (BL>=192) |
||
361 | { |
||
362 | IF (BL>=240) ESBYTE[ESI] = BL - 16; |
||
363 | ELSE ESBYTE[ESI] = BL - 64; |
||
364 | } |
||
365 | ELSE |
||
366 | { |
||
367 | IF (BL==178) ESBYTE[ESI] = 73; //I |
||
368 | IF (BL==179) ESBYTE[ESI] = 105; //i |
||
369 | IF (BL==175) ESBYTE[ESI] = 244; //J |
||
2085 | leency | 370 | IF (BL==191) ESBYTE[ESI] = 245; //j |
1971 | lev | 371 | IF (BL==170) ESBYTE[ESI] = 242; //E |
372 | IF (BL==186) ESBYTE[ESI] = 243; //e |
||
2085 | leency | 373 | IF (BL==168) ESBYTE[ESI] = 240; //Ё |
374 | IF (BL==184) ESBYTE[ESI] = 'e'; //e |
||
375 | IF (BL==180) ESBYTE[ESI] = 254; //у |
||
376 | IF ((BL==147) || (BL==148) || (BL==171) || (BL==187)) ESBYTE[ESI] = 34; |
||
377 | IF ((BL==150) || (BL==151)) ESBYTE[ESI] = 45; |
||
1971 | lev | 378 | } |
379 | ESI++; |
||
380 | } |
||
381 | } |
||
382 | |||
383 | |||
384 | dword Hex2Symb(char* htmlcolor) |
||
385 | { |
||
386 | dword j=0, symbol=0; |
||
387 | char ch=0x00; |
||
388 | FOR (;j<2;j++) |
||
389 | { |
||
390 | ch=ESBYTE[htmlcolor+j]; |
||
1974 | yogev_ezra | 391 | IF (ch==0x0d) || (ch=='\9') RETURN ''; |
1971 | lev | 392 | IF ((ch>='0') && (ch<='9')) ch -= '0'; |
393 | IF ((ch>='A') && (ch<='F')) ch -= 'A'-10; |
||
394 | IF ((ch>='a') && (ch<='f')) ch -= 'a'-10; |
||
395 | symbol = symbol*0x10 + ch; |
||
396 | } |
||
397 | wintodos(#symbol); |
||
398 | AL=symbol; |
||
399 | } |
||
400 | |||
2252 | leency | 401 | /*int hex2char(char c) |
402 | { |
||
403 | if (c <=9) |
||
404 | return (c+48); |
||
405 | |||
406 | return (c - 10 + 'a'); |
||
407 | } |
||
408 | |||
409 | int hex2char(dword c) |
||
410 | { |
||
411 | if (c <=9) |
||
412 | return (c+48); |
||
413 | |||
414 | return (c - 10 + 'a'); |
||
415 | }*/ |
||
416 | |||
1971 | lev | 417 | byte mas[66] = "юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"; |
418 | inline fastcall void koitodos(dword EDI) |
||
419 | { |
||
420 | WHILE (BL=ESBYTE[EDI]) |
||
421 | { |
||
422 | IF (BL >= 0xC0) |
||
423 | { |
||
424 | BL -= 0xC0; |
||
425 | ESBYTE[EDI] = mas[BL]; |
||
426 | } |
||
427 | //IF (ESBYTE[EDI]=='\244') ESBYTE[EDI]='i'; |
||
428 | EDI++; |
||
429 | } |
||
430 | } |
||
431 | |||
432 | |||
433 | //Asper |
||
434 | //uncomplete |
||
435 | inline fastcall int utf8rutodos(dword ESI) //- |
||
436 | { |
||
437 | EDI=ESI; |
||
438 | while (BL=ESBYTE[ESI]) |
||
439 | { |
||
440 | IF (BL == 0xD0) || (BL == 0xD1) EDI--; |
||
441 | else IF (BL == 0x81) && (ESBYTE[ESI-1]==0xD0) ESBYTE[EDI] = 0xF0; //ш |
||
442 | else IF (BL == 0x91) && (ESBYTE[ESI-1]==0xD1) ESBYTE[EDI] = 0xF1; //м |
||
443 | else IF (BL == 0xE2) && (ESBYTE[ESI+1]==0x80) && (ESBYTE[ESI+2]==0x94) //long defis |
||
444 | { |
||
445 | ESBYTE[EDI] = '-'; |
||
446 | ESI+=2; |
||
447 | } |
||
448 | else IF (BL == 0xE2) && (ESBYTE[ESI+1]==0x80) && (ESBYTE[ESI+2]==0xA2) //central point |
||
449 | { |
||
450 | ESBYTE[EDI] = '*'; |
||
451 | ESI+=2; |
||
452 | } |
||
453 | else IF (BL == 0xC2) && (ESBYTE[ESI+1]==0xA9) // (c) |
||
454 | { |
||
455 | ESBYTE[EDI] = '('; |
||
456 | ESBYTE[EDI+1] = 'c'; |
||
457 | ESBYTE[EDI+2] = ')'; |
||
458 | EDI+=2; |
||
459 | ESI++; |
||
460 | } |
||
1974 | yogev_ezra | 461 | ELSE IF (BL == 0xC2) && ((ESBYTE[ESI+1]==0xAB) || (ESBYTE[ESI+1]==0xBB)) // " |
1971 | lev | 462 | { |
463 | ESBYTE[EDI] = '\"'; |
||
464 | ESI++; |
||
465 | } |
||
1974 | yogev_ezra | 466 | ELSE IF (BL == 0xC2) && (ESBYTE[ESI+1]==0xB7) // _ |
1971 | lev | 467 | { |
468 | ESBYTE[EDI] = '_'; |
||
469 | ESI++; |
||
470 | } |
||
1974 | yogev_ezra | 471 | ELSE IF (BL >= 0x90) && (BL <= 0xAF) |
1971 | lev | 472 | { |
473 | BL -= 0x10; |
||
474 | ESBYTE[EDI] = BL; |
||
475 | } |
||
1974 | yogev_ezra | 476 | ELSE IF (BL >= 0x80) && (BL <= 0x8F) |
1971 | lev | 477 | { |
478 | BL += 0x60; |
||
479 | ESBYTE[EDI] = BL; |
||
480 | } |
||
1974 | yogev_ezra | 481 | ELSE IF (BL >= 0xB0) && (BL <= 0xBF) |
1971 | lev | 482 | { |
483 | BL -= 0x10; |
||
484 | ESBYTE[EDI] = BL; |
||
485 | } |
||
1974 | yogev_ezra | 486 | ELSE ESBYTE[EDI] = BL; |
1971 | lev | 487 | ESI++; |
488 | EDI++; |
||
489 | } |
||
490 | WHILE (EDI |
||
491 | { |
||
492 | ESBYTE[EDI] = ' '; |
||
493 | EDI++; |
||
494 | } |
||
495 | } |
||
496 | |||
497 | //------------------------------------------------------------------------------ |
||
498 | |||
2416 | leency | 499 | |
500 | void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI) |
||
1971 | lev | 501 | { |
502 | EAX = 12; // function 12:tell os about windowdraw |
||
2416 | leency | 503 | EBX = 1; |
1971 | lev | 504 | $int 0x40 |
2416 | leency | 505 | |
1971 | lev | 506 | EBX = x << 16 + sizeX; |
507 | ECX = y << 16 + sizeY; |
||
508 | EDX = mainAreaType << 24 | mainAreaColour; |
||
509 | ESI = headerType << 24 | headerColour; |
||
510 | $xor eax,eax |
||
511 | $int 0x40 |
||
512 | |||
2416 | leency | 513 | EAX = 12; // function 12:tell os about windowdraw |
514 | EBX = 2; |
||
515 | $int 0x40 |
||
516 | } |
||
517 | |||
518 | |||
1971 | lev | 519 | inline fastcall dword CreateThread(dword ECX,EDX) |
520 | { |
||
521 | EAX = 51; |
||
522 | EBX = 1; |
||
523 | $int 0x40 |
||
524 | } |
||
525 | |||
2495 | leency | 526 | inline fastcall int GetSlot(dword ECX) |
527 | { |
||
528 | EAX = 18; |
||
529 | EBX = 21; |
||
530 | $int 0x40 |
||
531 | } |
||
532 | |||
533 | inline fastcall int GetActiveProcess() |
||
534 | { |
||
535 | EAX = 18; |
||
536 | EBX = 7; |
||
537 | $int 0x40 |
||
538 | } |
||
539 | |||
540 | |||
1971 | lev | 541 | void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) |
542 | { |
||
543 | EAX = 4; |
||
544 | EBX = x<<16+y; |
||
545 | ECX = fontType<<24+color; |
||
546 | $int 0x40; |
||
547 | } |
||
548 | |||
2444 | leency | 549 | void CopyScreen(dword EBX, x, y, sizeX, sizeY) |
550 | { |
||
551 | EAX = 36; |
||
552 | ECX = sizeX << 16 + sizeY; |
||
553 | EDX = x << 16 + y; |
||
554 | $int 0x40; |
||
555 | } |
||
556 | |||
1971 | lev | 557 | void PutImage(dword EBX,w,h,x,y) |
558 | { |
||
559 | EAX = 7; |
||
560 | ECX = w<<16+h; |
||
561 | EDX = x<<16+y; |
||
562 | $int 0x40 |
||
563 | } |
||
564 | |||
565 | void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI) |
||
566 | { |
||
567 | EAX = 65; |
||
568 | ECX = w<<16+h; |
||
569 | EDX = x<<16+y; |
||
570 | EBP = 0; |
||
571 | $int 0x40 |
||
572 | } |
||
573 | |||
574 | inline fastcall void PutPixel(dword EBX,ECX,EDX){ |
||
575 | EAX=1; |
||
576 | $int 0x40 |
||
577 | } |
||
578 | |||
579 | void DrawBar(dword x,y,w,h,EDX) |
||
580 | { |
||
581 | EAX = 13; |
||
582 | EBX = x<<16+w; |
||
583 | ECX = y<<16+h; |
||
584 | $int 0x40 |
||
585 | } |
||
586 | |||
587 | void DefineButton(dword x,y,w,h,EDX,ESI) |
||
588 | { |
||
589 | EAX = 8; |
||
2528 | leency | 590 | $push edx |
591 | EDX += BT_DEL; //тэрўрых єфры хь ъэюяє ё ¤Єш шф, яюЄюь ёючфр╕ь |
||
592 | $int 0x40; |
||
1971 | lev | 593 | EBX = x<<16+w; |
594 | ECX = y<<16+h; |
||
2528 | leency | 595 | $pop edx |
596 | $int 0x40 |
||
1971 | lev | 597 | } |
598 | |||
599 | inline fastcall void DeleteButton(dword EDX) |
||
600 | { |
||
601 | EAX = 8; |
||
602 | EDX += BT_DEL; |
||
603 | $int 0x40; |
||
604 | } |
||
605 | |||
2252 | leency | 606 | :void DrawRegion(dword x,y,width,height,color1) |
1971 | lev | 607 | { |
608 | DrawBar(x,y,width,1,color1); //полоса гор сверху |
||
609 | DrawBar(x,y+height,width,1,color1); //полоса гор снизу |
||
610 | DrawBar(x,y,1,height,color1); //полоса верху слева |
||
611 | DrawBar(x+width,y,1,height+1,color1); //полоса верху справа |
||
612 | } |
||
613 | |||
2252 | leency | 614 | :void DrawRegion_3D(dword x,y,width,height,color1,color2) |
1971 | lev | 615 | { |
616 | DrawBar(x,y,width+1,1,color1); //полоса гор сверху |
||
617 | DrawBar(x,y+1,1,height-1,color1); //полоса слева |
||
618 | DrawBar(x+width,y+1,1,height,color2); //полоса справа |
||
619 | DrawBar(x,y+height,width,1,color2); //полоса гор снизу |
||
620 | } |
||
621 | |||
622 | void DrawFlatButton(dword x,y,width,height,id,color,text) |
||
623 | { |
||
624 | DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE); |
||
625 | DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7); |
||
626 | DrawBar(x+2,y+2,width-3,height-3,color); //заливка |
||
627 | IF (id<>0) DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //кнопка |
||
628 | WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0); |
||
629 | } |
||
630 | |||
2252 | leency | 631 | :void DrawCircle(int x, y, r) |
1971 | lev | 632 | { |
633 | int i; float px=0, py=r, ii = r * 3.1415926 * 2; |
||
1974 | yogev_ezra | 634 | FOR (i = 0; i < ii; i++) |
1971 | lev | 635 | { |
636 | PutPixel(px + x, y - py, 0); |
||
637 | px = py / r + px; |
||
638 | py = -px / r + py; |
||
639 | //Pause(1); |
||
640 | } |
||
641 | } |
||
642 | |||
643 | //------------------------------------------------------------------------------ |
||
644 | |||
645 | inline fastcall dword WriteDebug(dword EDX) |
||
646 | { |
||
647 | $push ebx |
||
648 | $push ecx |
||
649 | $mov eax, 63 |
||
650 | $mov ebx, 1 |
||
651 | next_char: |
||
652 | $mov ecx, DSDWORD[edx] |
||
653 | $or cl, cl |
||
654 | $jz done |
||
655 | $int 0x40 |
||
656 | $inc edx |
||
657 | $jmp next_char |
||
658 | done: |
||
659 | $mov cl, 13 |
||
660 | $int 0x40 |
||
661 | $mov cl, 10 |
||
662 | $int 0x40 |
||
663 | $pop ecx |
||
664 | $pop ebx |
||
665 | }>>16+h; |