Subversion Repositories Kolibri OS

Rev

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

Rev 3081 Rev 3107
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
	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
	void	GetInfo( ECX);
190
	dword   cwidth,cheight;
191
	byte    reserved[1024-71];
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
-
 
199
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
198
}
200
}
199
 
201
 
200
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
201
{
203
{
202
	$mov eax,34
204
	$mov eax,34
203
	$int 0x40
205
	$int 0x40
204
}
206
}
205
 
207
 
206
inline fastcall int GetProcessSlot( ECX)
208
inline fastcall int GetProcessSlot( ECX)
207
{
209
{
208
	EAX = 18;
210
	EAX = 18;
209
	EBX = 21;
211
	EBX = 21;
210
	$int 0x40
212
	$int 0x40
211
}
213
}
212
 
214
 
213
inline fastcall int GetActiveProcess()
215
inline fastcall int GetActiveProcess()
214
{
216
{
215
	EAX = 18;
217
	EAX = 18;
216
	EBX = 7;
218
	EBX = 7;
217
	$int 0x40
219
	$int 0x40
218
}
220
}
219
 
221
 
220
inline fastcall int CreateThread( ECX,EDX)
222
inline fastcall int CreateThread( ECX,EDX)
221
{
223
{
222
	$mov eax,51
224
	$mov eax,51
223
	$mov ebx,1
225
	$mov ebx,1
224
	$int 0x40
226
	$int 0x40
225
}
227
}
226
 
228
 
227
inline fastcall void SwitchToAnotherThread()
229
inline fastcall void SwitchToAnotherThread()
228
{
230
{
229
	$mov eax,68
231
	$mov eax,68
230
	$mov ebx,1
232
	$mov ebx,1
231
	$int 0x40
233
	$int 0x40
232
}
234
}
233
 
235
 
234
inline fastcall int KillProcess( ECX)
236
inline fastcall int KillProcess( ECX)
235
{
237
{
236
	$mov eax,18;
238
	$mov eax,18;
237
	$mov ebx,18;
239
	$mov ebx,18;
238
	$int 0x40
240
	$int 0x40
239
}
241
}
240
 
242
 
241
#define TURN_OFF 2
243
#define TURN_OFF 2
242
#define REBOOT 3
244
#define REBOOT 3
243
#define KERNEL 4
245
#define KERNEL 4
244
inline fastcall int ExitSystem( ECX)
246
inline fastcall int ExitSystem( ECX)
245
{
247
{
246
	$mov eax, 18
248
	$mov eax, 18
247
	$mov ebx, 9
249
	$mov ebx, 9
248
	$int 0x40
250
	$int 0x40
249
}
251
}
250
 
252
 
251
inline fastcall ExitProcess()
253
inline fastcall ExitProcess()
252
{
254
{
253
	$mov eax,-1;
255
	$mov eax,-1;
254
	$int 0x40
256
	$int 0x40
255
}
257
}
256
 
258
 
257
//------------------------------------------------------------------------------
259
//------------------------------------------------------------------------------
258
 
260
 
259
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
261
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
260
inline fastcall int GetSystemLanguage()
262
inline fastcall int GetSystemLanguage()
261
{
263
{
262
	EAX = 26;
264
	EAX = 26;
263
	EBX = 5;
265
	EBX = 5;
264
	$int 0x40
266
	$int 0x40
265
}
267
}
266
 
268
 
267
inline fastcall GetSkinHeight()
269
inline fastcall GetSkinHeight()
268
{
270
{
269
	$push ebx
271
	$push ebx
270
	$mov  eax,48
272
	$mov  eax,48
271
	$mov  ebx,4
273
	$mov  ebx,4
272
	$int 0x40
274
	$int 0x40
273
	$pop  ebx
275
	$pop  ebx
274
}
276
}
275
 
277
 
276
inline fastcall void SetSystemSkin( ECX)
278
inline fastcall void SetSystemSkin( ECX)
277
{
279
{
278
	EAX = 48;
280
	EAX = 48;
279
	EBX = 8;
281
	EBX = 8;
280
	$int 0x40
282
	$int 0x40
281
}
283
}
282
 
284
 
283
inline fastcall int GetScreenWidth()
285
inline fastcall int GetScreenWidth()
284
{
286
{
285
	$mov eax, 14
287
	$mov eax, 14
286
	$int 0x40
288
	$int 0x40
287
	$shr eax, 16
289
	$shr eax, 16
288
}
290
}
289
 
291
 
290
inline fastcall int GetScreenHeight()
292
inline fastcall int GetScreenHeight()
291
{
293
{
292
	$mov eax, 14
294
	$mov eax, 14
293
	$int 0x40
295
	$int 0x40
294
	$and eax,0x0000FFFF
296
	$and eax,0x0000FFFF
295
}
297
}
296
 
298
 
297
inline fastcall dword LoadLibrary( ECX)
299
inline fastcall dword LoadLibrary( ECX)
298
{
300
{
299
	$mov eax, 68 
301
	$mov eax, 68 
300
	$mov ebx, 19
302
	$mov ebx, 19
301
	$int  0x40
303
	$int  0x40
302
}
304
}
303
 
305
 
304
inline fastcall int TestBit( EAX, CL)
306
inline fastcall int TestBit( EAX, CL)
305
{
307
{
306
	$shr eax,cl
308
	$shr eax,cl
307
	$and eax,1
309
	$and eax,1
308
}
310
}
309
 
311
 
310
inline fastcall int PlaySpeaker( ESI)
312
inline fastcall int PlaySpeaker( ESI)
311
{
313
{
312
	$mov eax, 55
314
	$mov eax, 55
313
	$mov ebx, 55
315
	$mov ebx, 55
314
	$int 0x40
316
	$int 0x40
315
}
317
}
316
 
318
 
317
inline fastcall void debug( EDX)
319
inline fastcall void debug( EDX)
318
{
320
{
319
	$push ebx
321
	$push ebx
320
	$push ecx
322
	$push ecx
321
	$mov eax, 63
323
	$mov eax, 63
322
	$mov ebx, 1
324
	$mov ebx, 1
323
next_char:
325
NEXT_CHAR:
324
	$mov ecx, DSDWORD[edx]
326
	$mov ecx, DSDWORD[edx]
325
	$or	 cl, cl
327
	$or	 cl, cl
326
	$jz  done
328
	$jz  DONE
327
	$int 0x40
329
	$int 0x40
328
	$inc edx
330
	$inc edx
329
	$jmp next_char
331
	$jmp NEXT_CHAR
330
done:
332
DONE:
331
	$mov cl, 13
333
	$mov cl, 13
332
	$int 0x40
334
	$int 0x40
333
	$mov cl, 10
335
	$mov cl, 10
334
	$int 0x40
336
	$int 0x40
335
	$pop ecx
337
	$pop ecx
336
	$pop ebx
338
	$pop ebx
337
}
339
}
338
 
340
 
339
inline fastcall void debugch( ECX)
341
inline fastcall void debugch( ECX)
340
{
342
{
341
	$mov eax,63
343
	$mov eax,63
342
	$mov ebx,1
344
	$mov ebx,1
343
	$int 0x40
345
	$int 0x40
344
}
346
}
345
//------------------------------------------------------------------------------
347
//------------------------------------------------------------------------------
346
 
348
 
347
void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI, ESI)
349
void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI, ESI)
348
{
350
{
349
	EAX = 12;              // function 12:tell os about windowdraw
351
	EAX = 12;              // function 12:tell os about windowdraw
350
	EBX = 1;
352
	EBX = 1;
351
	$int 0x40
353
	$int 0x40
352
	
354
	
353
	EAX = 0;
355
	EAX = 0;
354
	EBX = x << 16 + sizeX;
356
	EBX = x << 16 + sizeX;
355
	ECX = y << 16 + sizeY;
357
	ECX = y << 16 + sizeY;
356
	EDX = WindowType << 24 | WindowAreaColor;
358
	EDX = WindowType << 24 | WindowAreaColor;
357
	$int 0x40
359
	$int 0x40
358
 
360
 
359
	EAX = 12;              // function 12:tell os about windowdraw
361
	EAX = 12;              // function 12:tell os about windowdraw
360
	EBX = 2;
362
	EBX = 2;
361
	$int 0x40
363
	$int 0x40
362
}
364
}
363
 
-
 
364
inline fastcall DeleteAllButtons()
-
 
365
{
-
 
366
	EAX = 12;              // function 12:tell os about windowdraw
-
 
367
	EBX = 1;
-
 
368
	$int 0x40
-
 
369
	EBX = 2;
-
 
370
	$int 0x40
-
 
371
}
-
 
372
 
365
 
373
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
366
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
374
{
367
{
375
	$mov eax, 67
368
	$mov eax, 67
376
	$int 0x40
369
	$int 0x40
377
}
370
}
378
 
371
 
379
inline fastcall void DrawTitle( ECX)
372
inline fastcall void DrawTitle( ECX)
380
{
373
{
381
	EAX = 71;
374
	EAX = 71;
382
	EBX = 1;
375
	EBX = 1;
383
	$int 0x40;
376
	$int 0x40;
384
}
377
}
-
 
378
 
-
 
379
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
-
 
380
{
-
 
381
	EAX = 4;
-
 
382
	EBX = x<<16+y;
-
 
383
	ECX = fontType<<24+color;
-
 
384
	$int 0x40;
-
 
385
	$add ebx, 1<<16
-
 
386
	$int 0x40
-
 
387
}
385
 
388
 
386
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
389
void WriteText(dword x,y,byte fontType, dword color, EDX)
387
{
390
{
388
	EAX = 4;
391
	EAX = 4;
389
	EBX = x<<16+y;
392
	EBX = x<<16+y;
390
	ECX = fontType<<24+color;
393
	ECX = fontType<<24+color;
-
 
394
	$xor esi, esi
391
	$int 0x40;
395
	$int 0x40;
392
}
396
}
393
 
397
 
394
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
398
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
395
{
399
{
396
	EAX = 47;
400
	EAX = 47;
397
	EBX = count<<16;
401
	EBX = count<<16;
398
	EDX = x<<16+y;
402
	EDX = x<<16+y;
399
	ESI = fontType<<24+color;
403
	ESI = fontType<<24+color;
400
	$int 0x40;
404
	$int 0x40;
401
}
405
}
402
 
406
 
403
void CopyScreen(dword EBX, x, y, sizeX, sizeY)
407
void CopyScreen(dword EBX, x, y, sizeX, sizeY)
404
{
408
{
405
  EAX = 36;
409
  EAX = 36;
406
  ECX = sizeX << 16 + sizeY;
410
  ECX = sizeX << 16 + sizeY;
407
  EDX = x << 16 + y;
411
  EDX = x << 16 + y;
408
  $int  0x40;
412
  $int  0x40;
409
}
413
}
410
 
414
 
411
dword GetPixelColor(dword x, x_size, y)
415
dword GetPixelColor(dword x, x_size, y)
412
{
416
{
413
	$mov eax, 35
417
	$mov eax, 35
414
	EBX= y*x_size+x;
418
	EBX= y*x_size+x;
415
	$int 0x40
419
	$int 0x40
416
}
420
}
417
 
421
 
418
void PutImage(dword EBX,w,h,x,y)
422
void PutImage(dword EBX,w,h,x,y)
419
{
423
{
420
	EAX = 7;
424
	EAX = 7;
421
	ECX = w<<16+h;
425
	ECX = w<<16+h;
422
	EDX = x<<16+y;
426
	EDX = x<<16+y;
423
	$int 0x40
427
	$int 0x40
424
}
428
}
425
 
429
 
426
void _PutImage(dword x,y, w,h, EBX)
430
void _PutImage(dword x,y, w,h, EBX)
427
{
431
{
428
	EAX = 7;
432
	EAX = 7;
429
	ECX = w<<16+h;
433
	ECX = w<<16+h;
430
	EDX = x<<16+y;
434
	EDX = x<<16+y;
431
	$int 0x40
435
	$int 0x40
432
}
436
}
433
 
437
 
434
void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
438
void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
435
{
439
{
436
	EAX = 65;
440
	EAX = 65;
437
	ECX = w<<16+h;
441
	ECX = w<<16+h;
438
	EDX = x<<16+y;
442
	EDX = x<<16+y;
439
	EBP = 0;
443
	EBP = 0;
440
	$int 0x40
444
	$int 0x40
441
} 
445
} 
442
 
446
 
443
inline fastcall void PutPixel( EBX,ECX,EDX)
447
inline fastcall void PutPixel( EBX,ECX,EDX)
444
{
448
{
445
  EAX=1;
449
  EAX=1;
446
  $int 0x40
450
  $int 0x40
447
}
451
}
448
 
452
 
449
void DrawBar(dword x,y,w,h,EDX)
453
void DrawBar(dword x,y,w,h,EDX)
450
{
454
{
-
 
455
	if (h<=0) || (h>65000) return; //bad boy :)
451
	EAX = 13;
456
	EAX = 13;
452
	EBX = x<<16+w;
457
	EBX = x<<16+w;
453
	ECX = y<<16+h;
458
	ECX = y<<16+h;
454
 	$int 0x40
459
 	$int 0x40
455
}
460
}
456
 
461
 
457
void DefineButton(dword x,y,w,h,EDX,ESI)
462
void DefineButton(dword x,y,w,h,EDX,ESI)
458
{
463
{
459
 	EAX = 8;
464
	EAX = 8;
-
 
465
	$push edx
-
 
466
	EDX += BT_DEL;
-
 
467
	$int 0x40;
-
 
468
	$pop edx
-
 
469
	EBX = x<<16+w;
-
 
470
	ECX = y<<16+h;
-
 
471
	$int 0x40
-
 
472
}
-
 
473
 
-
 
474
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
-
 
475
{
-
 
476
	EAX = 8;
460
	EBX = x<<16+w;
477
	EBX = x<<16+w;
461
	ECX = y<<16+h;
478
	ECX = y<<16+h;
462
	$int 0x40
479
	$int 0x40
463
}
480
}
464
 
481
 
465
inline fastcall void DeleteButton( EDX)
482
inline fastcall void DeleteButton( EDX)
466
{
483
{
467
	EAX = 8;
484
	EAX = 8;
468
	EDX += BT_DEL;
485
	EDX += BT_DEL;
469
	$int 0x40;
486
	$int 0x40;
470
}
487
}
471
>
488
>
472
>
489
>
473
>
490
>
474
>
491
>
475
>
492
>
476
>
493
>
477
>
494
>
478
>
495
>
479
>
496
>
480
>
497
>
481
>
498
>
482
>
499
>
483
>
500
>
484
>
501
>
485
>
502
>
486
>
503
>
487
>
504
>
488
>
505
>
489
>
506
>
490
>
507
>
491
>
508
>
492
>
509
>
493
>
510
>
494
>
511
>
495
>
512
>
496
>
513
>
497
>
514
>
498
>
515
>
499
>
516
>
500
>
517
>
-
 
518
>
-
 
519
>
-
 
520
>
-
 
521
>
-
 
522
>
-
 
523
>
-
 
524
>
-
 
525
>
-
 
526
>
-
 
527
>