Subversion Repositories Kolibri OS

Rev

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

Rev 3877 Rev 3958
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 int x,y,lkm,pkm,hor,vert;
37
	signed int 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
	EAX = 37;
51
	EAX = 37;
52
	EBX = 2;
52
	EBX = 2;
53
	$int	0x40
53
	$int	0x40
54
	$mov	ebx, eax
54
	$mov	ebx, eax
55
	$and	eax, 0x00000001
55
	$and	eax, 0x00000001
56
	$shr	ebx, 1
56
	$shr	ebx, 1
57
	$and	ebx, 0x00000001
57
	$and	ebx, 0x00000001
58
	lkm = EAX;
58
	lkm = EAX;
59
	pkm = EBX;
59
	pkm = EBX;
60
	EAX = 37; //áªà®««
60
	EAX = 37; //áªà®««
61
	EBX = 7;
61
	EBX = 7;
62
	$int	0x40
62
	$int	0x40
63
	$mov	ebx, eax
63
	$mov	ebx, eax
64
	$shr	eax, 16
64
	$shr	eax, 16
65
	$and	ebx,0x0000FFFF
65
	$and	ebx,0x0000FFFF
66
	//hor = EAX;
66
	//hor = EAX;
67
	vert = EBX;
67
	vert = EBX;
68
	if (y>6000) y=0;
68
	if (y>6000) y=0;
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
 
-
 
153
//----------------------------------------
-
 
154
 
-
 
155
/* ecx = point to structure
-
 
156
          sysdir_name     rb 64
-
 
157
          sysdir_path     rb 64
-
 
158
Ïðèìåð:  
-
 
159
dir_name1       db 'addappl',0
-
 
160
dir_path1       db 'HD0/1',0
-
 
161
*/
-
 
162
inline fastcall int SetAddApplDir( ECX)
-
 
163
{
-
 
164
	EAX = 30;
-
 
165
	EBX = 3;
-
 
166
	$int 0x40
-
 
167
}
-
 
168
 
152
 
169
inline fastcall dword GetFreeRAM()
153
inline fastcall dword GetFreeRAM()
170
{
154
{
171
	$mov eax, 18
155
	$mov eax, 18
172
	$mov ebx, 16
156
	$mov ebx, 16
173
	$int 0x40
157
	$int 0x40
174
	//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
158
	//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
175
}
159
}
176
 
160
 
177
inline fastcall dword LoadDriver( ECX) //ECX - èìÿ äðàéâåðà
161
inline fastcall dword LoadDriver( ECX) //ECX - èìÿ äðàéâåðà
178
{
162
{
179
	$mov eax, 68
163
	$mov eax, 68
180
	$mov ebx, 16
164
	$mov ebx, 16
181
	$int 0x40
165
	$int 0x40
182
	//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà 
166
	//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà 
183
}
167
}
184
 
168
 
185
inline fastcall dword RuleDriver( ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
169
inline fastcall dword RuleDriver( ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
186
{
170
{
187
	$mov eax, 68
171
	$mov eax, 68
188
	$mov ebx, 17
172
	$mov ebx, 17
189
	$int 0x40
173
	$int 0x40
190
	//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
174
	//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
191
}
175
}
192
 
176
 
193
struct proc_info
177
struct proc_info
194
{
178
{
195
	#define SelfInfo -1
179
	#define SelfInfo -1
196
	dword	use_cpu;
180
	dword	use_cpu;
197
	word	pos_in_stack,num_slot,rezerv1;
181
	word	pos_in_stack,num_slot,rezerv1;
198
	char	name[11];
182
	char	name[11];
199
	char	rezerv2;
183
	char	rezerv2;
200
	dword	adress,use_memory,ID,left,top,width,height;
184
	dword	adress,use_memory,ID,left,top,width,height;
201
	word	status_slot,rezerv3;
185
	word	status_slot,rezerv3;
202
	dword	work_left,work_top,work_width,work_height;
186
	dword	work_left,work_top,work_width,work_height;
203
	char	status_window;
187
	char	status_window;
204
	dword   cwidth,cheight;
188
	dword   cwidth,cheight;
205
	byte    reserved[1024-71-8];
189
	byte    reserved[1024-71-8];
206
};
190
};
207
 
191
 
208
inline fastcall void GetProcessInfo( EBX, ECX)
192
inline fastcall void GetProcessInfo( EBX, ECX)
209
{
193
{
210
	$mov eax,9;
194
	$mov eax,9;
211
	$int  0x40
195
	$int  0x40
212
	DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
196
	DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
213
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
197
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
214
}
198
}
215
 
199
 
216
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
200
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
217
{
201
{
218
	$mov eax,34
202
	$mov eax,34
219
	$int 0x40
203
	$int 0x40
220
}
204
}
221
 
205
 
222
inline fastcall int GetProcessSlot( ECX)
206
inline fastcall int GetProcessSlot( ECX)
223
{
207
{
224
	EAX = 18;
208
	EAX = 18;
225
	EBX = 21;
209
	EBX = 21;
226
	$int 0x40
210
	$int 0x40
227
}
211
}
228
 
212
 
229
inline fastcall int GetActiveProcess()
213
inline fastcall int GetActiveProcess()
230
{
214
{
231
	EAX = 18;
215
	EAX = 18;
232
	EBX = 7;
216
	EBX = 7;
233
	$int 0x40
217
	$int 0x40
234
}
218
}
235
 
219
 
236
inline fastcall void ActivateWindow( ECX)
220
inline fastcall void ActivateWindow( ECX)
237
{
221
{
238
	EAX = 18;
222
	EAX = 18;
239
	EBX = 3;
223
	EBX = 3;
240
	$int 0x40
224
	$int 0x40
241
}
225
}
242
 
226
 
243
inline fastcall int CreateThread( ECX,EDX)
227
inline fastcall int CreateThread( ECX,EDX)
244
{
228
{
245
	$mov eax,51
229
	$mov eax,51
246
	$mov ebx,1
230
	$mov ebx,1
247
	$int 0x40
231
	$int 0x40
248
}
232
}
249
 
233
 
250
inline fastcall void SwitchToAnotherThread()
234
inline fastcall void SwitchToAnotherThread()
251
{
235
{
252
	$mov eax,68
236
	$mov eax,68
253
	$mov ebx,1
237
	$mov ebx,1
254
	$int 0x40
238
	$int 0x40
255
}
239
}
256
 
240
 
257
inline fastcall int SendWindowMessage( ECX, EDX)
241
inline fastcall int SendWindowMessage( ECX, EDX)
258
{
242
{
259
	$mov eax, 72
243
	$mov eax, 72
260
	$mov ebx, 1
244
	$mov ebx, 1
261
	$int 0x40
245
	$int 0x40
262
}
246
}
263
 
247
 
264
inline fastcall int KillProcess( ECX)
248
inline fastcall int KillProcess( ECX)
265
{
249
{
266
	$mov eax,18;
250
	$mov eax,18;
267
	$mov ebx,18;
251
	$mov ebx,18;
268
	$int 0x40
252
	$int 0x40
269
}
253
}
270
 
254
 
271
#define TURN_OFF 2
255
#define TURN_OFF 2
272
#define REBOOT 3
256
#define REBOOT 3
273
#define KERNEL 4
257
#define KERNEL 4
274
inline fastcall int ExitSystem( ECX)
258
inline fastcall int ExitSystem( ECX)
275
{
259
{
276
	$mov eax, 18
260
	$mov eax, 18
277
	$mov ebx, 9
261
	$mov ebx, 9
278
	$int 0x40
262
	$int 0x40
279
}
263
}
280
 
264
 
281
inline fastcall ExitProcess()
265
inline fastcall ExitProcess()
282
{
266
{
283
	$mov eax,-1;
267
	$mov eax,-1;
284
	$int 0x40
268
	$int 0x40
285
}
269
}
286
 
270
 
287
//------------------------------------------------------------------------------
271
//------------------------------------------------------------------------------
288
 
272
 
289
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
273
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
290
inline fastcall int GetSystemLanguage()
274
inline fastcall int GetSystemLanguage()
291
{
275
{
292
	EAX = 26;
276
	EAX = 26;
293
	EBX = 5;
277
	EBX = 5;
294
	$int 0x40
278
	$int 0x40
295
}
279
}
296
 
280
 
297
inline fastcall GetSkinHeight()
281
inline fastcall GetSkinHeight()
298
{
282
{
299
	$push ebx
283
	$push ebx
300
	$mov  eax,48
284
	$mov  eax,48
301
	$mov  ebx,4
285
	$mov  ebx,4
302
	$int 0x40
286
	$int 0x40
303
	$pop  ebx
287
	$pop  ebx
304
}
288
}
305
 
289
 
306
inline fastcall void SetSystemSkin( ECX)
290
inline fastcall void SetSystemSkin( ECX)
307
{
291
{
308
	EAX = 48;
292
	EAX = 48;
309
	EBX = 8;
293
	EBX = 8;
310
	$int 0x40
294
	$int 0x40
311
}
295
}
312
 
296
 
313
inline fastcall int GetScreenWidth()
297
inline fastcall int GetScreenWidth()
314
{
298
{
315
	$mov eax, 14
299
	$mov eax, 14
316
	$int 0x40
300
	$int 0x40
317
	$shr eax, 16
301
	$shr eax, 16
318
}
302
}
319
 
303
 
320
inline fastcall int GetScreenHeight()
304
inline fastcall int GetScreenHeight()
321
{
305
{
322
	$mov eax, 14
306
	$mov eax, 14
323
	$int 0x40
307
	$int 0x40
324
	$and eax,0x0000FFFF
308
	$and eax,0x0000FFFF
325
}
309
}
326
 
310
 
327
inline fastcall dword LoadLibrary( ECX)
311
inline fastcall dword LoadLibrary( ECX)
328
{
312
{
329
	$mov eax, 68 
313
	$mov eax, 68 
330
	$mov ebx, 19
314
	$mov ebx, 19
331
	$int  0x40
315
	$int  0x40
332
}
316
}
333
 
317
 
334
inline fastcall int TestBit( EAX, CL)
318
inline fastcall int TestBit( EAX, CL)
335
{
319
{
336
	$shr eax,cl
320
	$shr eax,cl
337
	$and eax,1
321
	$and eax,1
338
}
322
}
339
 
323
 
340
inline fastcall int PlaySpeaker( ESI)
324
inline fastcall int PlaySpeaker( ESI)
341
{
325
{
342
	$mov eax, 55
326
	$mov eax, 55
343
	$mov ebx, 55
327
	$mov ebx, 55
344
	$int 0x40
328
	$int 0x40
345
}
329
}
346
 
330
 
347
inline fastcall void debug( EDX)
331
inline fastcall void debug( EDX)
348
{
332
{
349
	$push eax
333
	$push eax
350
	$push ebx
334
	$push ebx
351
	$push ecx
335
	$push ecx
352
	$mov eax, 63
336
	$mov eax, 63
353
	$mov ebx, 1
337
	$mov ebx, 1
354
NEXT_CHAR:
338
NEXT_CHAR:
355
	$mov ecx, DSDWORD[edx]
339
	$mov ecx, DSDWORD[edx]
356
	$or	 cl, cl
340
	$or	 cl, cl
357
	$jz  DONE
341
	$jz  DONE
358
	$int 0x40
342
	$int 0x40
359
	$inc edx
343
	$inc edx
360
	$jmp NEXT_CHAR
344
	$jmp NEXT_CHAR
361
DONE:
345
DONE:
362
	$mov cl, 13
346
	$mov cl, 13
363
	$int 0x40
347
	$int 0x40
364
	$mov cl, 10
348
	$mov cl, 10
365
	$int 0x40
349
	$int 0x40
366
	$pop ecx
350
	$pop ecx
367
	$pop ebx
351
	$pop ebx
368
	$pop eax
352
	$pop eax
369
}
353
}
370
 
354
 
371
 
355
 
372
inline fastcall void debugch( ECX)
356
inline fastcall void debugch( ECX)
373
{
357
{
374
	$push eax
358
	$push eax
375
	$push ebx
359
	$push ebx
376
	$mov eax,63
360
	$mov eax,63
377
	$mov ebx,1
361
	$mov ebx,1
378
	$int 0x40
362
	$int 0x40
379
	$pop ebx
363
	$pop ebx
380
	$pop eax
364
	$pop eax
381
}
365
}
382
//------------------------------------------------------------------------------
366
//------------------------------------------------------------------------------
383
 
367
 
384
void DefineAndDrawWindow(dword x,y, sizeX,sizeY, byte WindowType,dword WindowAreaColor, EDI, ESI)
368
void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, EDI, ESI)
385
{
369
{
386
	EAX = 12;              // function 12:tell os about windowdraw
370
	EAX = 12;              // function 12:tell os about windowdraw
387
	EBX = 1;
371
	EBX = 1;
388
	$int 0x40
372
	$int 0x40
389
	
373
	
390
	EAX = 0;
374
	EAX = 0;
391
	EBX = x << 16 + sizeX;
375
	EBX = x << 16 + size_w; 
392
	ECX = y << 16 + sizeY;
376
	ECX = y << 16 + size_h;
393
	EDX = WindowType << 24 | WindowAreaColor;
377
	EDX = WindowType << 24 | WindowAreaColor;
394
	$int 0x40
378
	$int 0x40
395
 
379
 
396
	EAX = 12;              // function 12:tell os about windowdraw
380
	EAX = 12;              // function 12:tell os about windowdraw
397
	EBX = 2;
381
	EBX = 2;
398
	$int 0x40
382
	$int 0x40
399
}
383
}
400
 
384
 
401
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
385
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
402
{
386
{
403
	$mov eax, 67
387
	$mov eax, 67
404
	$int 0x40
388
	$int 0x40
405
}
389
}
406
 
390
 
407
inline fastcall void DrawTitle( ECX)
391
inline fastcall void DrawTitle( ECX)
408
{
392
{
409
	EAX = 71;
393
	EAX = 71;
410
	EBX = 1;
394
	EBX = 1;
411
	$int 0x40;
395
	$int 0x40;
412
}
396
}
413
 
397
 
414
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
398
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
415
{
399
{
416
	EAX = 4;
400
	EAX = 4;
417
	EBX = x<<16+y;
401
	EBX = x<<16+y;
418
	ECX = fontType<<24+color;
402
	ECX = fontType<<24+color;
419
	ESI = 0;
403
	ESI = 0;
420
	$int 0x40;
404
	$int 0x40;
421
	$add ebx, 1<<16
405
	$add ebx, 1<<16
422
	$int 0x40
406
	$int 0x40
423
}
407
}
424
 
408
 
425
void WriteText(dword x,y,byte fontType, dword color, EDX)
409
void WriteText(dword x,y,byte fontType, dword color, EDX)
426
{
410
{
427
	EAX = 4;
411
	EAX = 4;
428
	EBX = x<<16+y;
412
	EBX = x<<16+y;
429
	ECX = fontType<<24+color;
413
	ECX = fontType<<24+color;
430
	$int 0x40;
414
	$int 0x40;
431
}
415
}
432
 
416
 
433
dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI)
417
dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI)
434
{
418
{
435
	EAX = 4;
419
	EAX = 4;
436
	EBX = x<<16+y;
420
	EBX = x<<16+y;
437
	ECX = fontType<<24+color;
421
	ECX = fontType<<24+color;
438
	$int 0x40;
422
	$int 0x40;
439
}
423
}
440
 
424
 
441
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
425
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
442
{
426
{
443
	EAX = 47;
427
	EAX = 47;
444
	EBX = count<<16;
428
	EBX = count<<16;
445
	EDX = x<<16+y;
429
	EDX = x<<16+y;
446
	ESI = fontType<<24+color;
430
	ESI = fontType<<24+color;
447
	$int 0x40;
431
	$int 0x40;
448
}
432
}
449
 
433
 
450
void CopyScreen(dword EBX, x, y, w, h)
434
void CopyScreen(dword EBX, x, y, w, h)
451
{
435
{
452
  EAX = 36;
436
  EAX = 36;
453
  ECX = w << 16 + h;
437
  ECX = w << 16 + h;
454
  EDX = x << 16 + y;
438
  EDX = x << 16 + y;
455
  $int  0x40;
439
  $int  0x40;
456
}
440
}
457
 
441
 
458
:dword GetPixelColor(dword x, x_size, y)
442
:dword GetPixelColor(dword x, x_size, y)
459
{
443
{
460
	$mov eax, 35
444
	$mov eax, 35
461
	EBX= y*x_size+x;
445
	EBX= y*x_size+x;
462
	$int 0x40
446
	$int 0x40
463
}
447
}
464
 
448
 
465
 
449
 
466
void _PutImage(dword x,y, w,h, EBX)
450
void _PutImage(dword x,y, w,h, EBX)
467
{
451
{
468
	EAX = 7;
452
	EAX = 7;
469
	ECX = w<<16+h;
453
	ECX = w<<16+h;
470
	EDX = x<<16+y;
454
	EDX = x<<16+y;
471
	$int 0x40
455
	$int 0x40
472
}
456
}
473
 
457
 
474
void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
458
void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
475
{
459
{
476
	EAX = 65;
460
	EAX = 65;
477
	ECX = w<<16+h;
461
	ECX = w<<16+h;
478
	EDX = x<<16+y;
462
	EDX = x<<16+y;
479
	EBP = 0;
463
	EBP = 0;
480
	$int 0x40
464
	$int 0x40
481
} 
465
} 
482
 
466
 
483
inline fastcall void PutPixel( EBX,ECX,EDX)
467
inline fastcall void PutPixel( EBX,ECX,EDX)
484
{
468
{
485
  EAX=1;
469
  EAX=1;
486
  $int 0x40
470
  $int 0x40
487
}
471
}
488
 
472
 
489
void DrawBar(dword x,y,w,h,EDX)
473
void DrawBar(dword x,y,w,h,EDX)
490
{
474
{
491
	if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
475
	if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
492
	EAX = 13;
476
	EAX = 13;
493
	EBX = x<<16+w;
477
	EBX = x<<16+w;
494
	ECX = y<<16+h;
478
	ECX = y<<16+h;
495
 	$int 0x40
479
 	$int 0x40
496
}
480
}
497
 
481
 
498
void DefineButton(dword x,y,w,h,EDX,ESI)
482
void DefineButton(dword x,y,w,h,EDX,ESI)
499
{
483
{
500
	EAX = 8;
484
	EAX = 8;
501
	$push edx
485
	$push edx
502
	EDX += BT_DEL;
486
	EDX += BT_DEL;
503
	$int 0x40;
487
	$int 0x40;
504
	$pop edx
488
	$pop edx
505
	EBX = x<<16+w;
489
	EBX = x<<16+w;
506
	ECX = y<<16+h;
490
	ECX = y<<16+h;
507
	$int 0x40
491
	$int 0x40
508
}
492
}
509
 
493
 
510
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
494
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
511
{
495
{
512
	EAX = 8;
496
	EAX = 8;
513
	EBX = x<<16+w;
497
	EBX = x<<16+w;
514
	ECX = y<<16+h;
498
	ECX = y<<16+h;
515
	$int 0x40
499
	$int 0x40
516
}
500
}
517
 
501
 
518
inline fastcall void DeleteButton( EDX)
502
inline fastcall void DeleteButton( EDX)
519
{
503
{
520
	EAX = 8;
504
	EAX = 8;
521
	EDX += BT_DEL;
505
	EDX += BT_DEL;
522
	$int 0x40;
506
	$int 0x40;
523
}
507
}
524
>
508
>
525
>
509
>
526
>
510
>
527
>
511
>
528
>
512
>
529
>
513
>
530
>
514
>
531
>
515
>
532
>
516
>
533
>
517
>
534
>
518
>
535
>
519
>
536
>
520
>
537
>
521
>
538
>
522
>
539
>
523
>
540
>
524
>
541
>
525
>
542
>
526
>
543
>
527
>
544
>
528
>
545
>
529
>
546
>
530
>
547
>
531
>
548
>
532
>
549
>
533
>
550
>
534
>
551
>
535
>
552
>
536
>
553
>
537
>
554
>
538
>
555
>
539
>
556
>
540
>
557
>
541
>
558
>
542
>
559
>
543
>
560
>
544
>
561
>
545
>
562
>
546
>
563
>
547
>