Subversion Repositories Kolibri OS

Rev

Rev 2818 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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