Subversion Repositories Kolibri OS

Rev

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

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