Subversion Repositories Kolibri OS

Rev

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

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