Subversion Repositories Kolibri OS

Rev

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

Rev 5658 Rev 5674
1
//CODED by Veliant, Leency, Nable. GNU GPL licence.
1
//CODED by Veliant, Leency, Nable. GNU GPL licence.
2
#ifndef INCLUDE_KOLIBRI_H
2
#ifndef INCLUDE_KOLIBRI_H
3
#define INCLUDE_KOLIBRI_H
3
#define INCLUDE_KOLIBRI_H
4
 
4
 
5
#startaddress 0
5
#startaddress 0
6
#code32 TRUE
6
#code32 TRUE
7
char   os_name[8]   = {'M','E','N','U','E','T','0','1'};
7
char   os_name[8]   = {'M','E','N','U','E','T','0','1'};
8
dword  os_version   = 0x00000001;
8
dword  os_version   = 0x00000001;
9
dword  start_addr   = #______INIT______;
9
dword  start_addr   = #______INIT______;
10
dword  final_addr   = #______STOP______+32;
10
dword  final_addr   = #______STOP______+32;
11
dword  alloc_mem    = MEMSIZE;
11
dword  alloc_mem    = MEMSIZE;
12
dword  x86esp_reg   = MEMSIZE;
12
dword  x86esp_reg   = MEMSIZE;
13
dword  I_Param      = #param;
13
dword  I_Param      = #param;
14
dword  I_Path       = #program_path;
14
dword  I_Path       = #program_path;
15
char param[4096];
15
char param[4096];
16
char program_path[4096];
16
char program_path[4096];
17
 
17
 
18
#define NULL      0
18
#define NULL      0
19
#define OLD      -1
19
#define OLD      -1
20
#define true      1
20
#define true      1
21
#define false     0
21
#define false     0
22
 
22
 
23
//Events
23
//Events
24
#define evReDraw  1
24
#define evReDraw  1
25
#define evKey     2
25
#define evKey     2
26
#define evButton  3
26
#define evButton  3
27
#define evDesktop 5
27
#define evDesktop 5
28
#define evMouse   6
28
#define evMouse   6
29
#define evIPC     7
29
#define evIPC     7
30
#define evNetwork 8
30
#define evNetwork 8
31
#define evDebug   9
31
#define evDebug   9
32
 
32
 
33
#define EVENT_MOUSE case 6: mouse.get();
33
#define EVENT_MOUSE case 6: mouse.get();
34
 
34
 
35
//Button options
35
//Button options
36
#define BT_DEL      0x80000000
36
#define BT_DEL      0x80000000
37
#define BT_HIDE     0x40000000
37
#define BT_HIDE     0x40000000
38
#define BT_NOFRAME  0x20000000
38
#define BT_NOFRAME  0x20000000
39
 
-
 
40
//Button MOUSE
-
 
41
#define MOUSE_LEFT   001b
-
 
42
#define MOUSE_RIGHT  010b
-
 
43
#define MOUSE_LR     011b
-
 
44
#define MOUSE_CENTER 100b
-
 
45
 
39
 
46
//ASCII KEYS
40
//ASCII KEYS
47
#define ASCII_KEY_BS    008
41
#define ASCII_KEY_BS    008
48
#define ASCII_KEY_TAB   009
42
#define ASCII_KEY_TAB   009
49
#define ASCII_KEY_ENTER 013
43
#define ASCII_KEY_ENTER 013
50
#define ASCII_KEY_ESC   027
44
#define ASCII_KEY_ESC   027
51
#define ASCII_KEY_DEL   182
45
#define ASCII_KEY_DEL   182
52
#define ASCII_KEY_INS   185
46
#define ASCII_KEY_INS   185
53
#define ASCII_KEY_SPACE 032
47
#define ASCII_KEY_SPACE 032
54
 
48
 
55
#define ASCII_KEY_LEFT  176
49
#define ASCII_KEY_LEFT  176
56
#define ASCII_KEY_RIGHT 179
50
#define ASCII_KEY_RIGHT 179
57
#define ASCII_KEY_DOWN  177
51
#define ASCII_KEY_DOWN  177
58
#define ASCII_KEY_UP    178
52
#define ASCII_KEY_UP    178
59
#define ASCII_KEY_HOME  180
53
#define ASCII_KEY_HOME  180
60
#define ASCII_KEY_END   181
54
#define ASCII_KEY_END   181
61
#define ASCII_KEY_PGDN  183
55
#define ASCII_KEY_PGDN  183
62
#define ASCII_KEY_PGUP  184
56
#define ASCII_KEY_PGUP  184
63
 
57
 
64
//allow event mask
58
//allow event mask
65
#define EVENT_MASK_REDRAW   000000001b
59
#define EVENT_MASK_REDRAW   000000001b
66
#define EVENT_MASK_KEYBOARD 000000010b
60
#define EVENT_MASK_KEYBOARD 000000010b
67
#define EVENT_MASK_BUTTONS  000000100b
61
#define EVENT_MASK_BUTTONS  000000100b
68
#define EVENT_MASK_DESKTOP  000010000b
62
#define EVENT_MASK_DESKTOP  000010000b
69
#define EVENT_MASK_MOUSE    000100000b
63
#define EVENT_MASK_MOUSE    000100000b
70
#define EVENT_MASK_IPC      001000000b
64
#define EVENT_MASK_IPC      001000000b
71
#define EVENT_MASK_NETWORK  010000000b
65
#define EVENT_MASK_NETWORK  010000000b
72
#define EVENT_MASK_DEBUG    100000000b
66
#define EVENT_MASK_DEBUG    100000000b
73
 
67
 
74
//ARGS FUNCTION
68
//ARGS FUNCTION
75
#define END_ARGS 0xFF00FF
69
#define END_ARGS 0xFF00FF
76
//-------------------------------------------------------------------------
70
//-------------------------------------------------------------------------
-
 
71
 
-
 
72
#ifndef INCLUDE_SYSTEM_H
-
 
73
#include "../lib/system.h"
-
 
74
#endif
-
 
75
 
-
 
76
#ifndef INCLUDE_MOUSE_H
-
 
77
#include "../lib/mouse.h"
-
 
78
#endif
77
 
79
 
78
:struct raw_image {
80
:struct raw_image {
79
	dword w, h, data;
81
	dword w, h, data;
80
};
82
};
81
 
-
 
82
/**
-
 
83
 *  The structure of the MOUSE
-
 
84
 *  x - coordinate X
-
 
85
 *  y - coordinate Y
-
 
86
 *  xx and yy - time coordinates
-
 
87
 *  lkm - left MOUSE button
-
 
88
 *  pkm - right MOUSE button
-
 
89
 *  mkm - MOUSE wheel
-
 
90
 *  key - keycode button
-
 
91
 *  tmp - time keycode 
-
 
92
 *  down - key event press
-
 
93
 *  up - key release events
-
 
94
 *  move - event MOUSE movements
-
 
95
 *  click - when clicked
-
 
96
 *  dblclick - double-click the default 50 (500 ms)
-
 
97
 *  drag - drag the element event
-
 
98
 */
-
 
99
 
-
 
100
:dword __TMP_TIME,MOUSE_TIME;
-
 
101
:struct MOUSE
-
 
102
{
-
 
103
	signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,drag,left,top;
-
 
104
	dword handle,_;
-
 
105
	byte cmd;
-
 
106
	void clearTime();
-
 
107
	void get();
-
 
108
	void set();
-
 
109
	void center();
-
 
110
	dword hide();
-
 
111
	void slider();
-
 
112
	void show();
-
 
113
} mouse;
-
 
114
:void MOUSE::clearTime()
-
 
115
{
-
 
116
	tmp_time = GetStartTime()+MOUSE_TIME;
-
 
117
}
-
 
118
:void MOUSE::show()
-
 
119
{
-
 
120
	if(!handle)return;
-
 
121
	ECX = handle;
-
 
122
	EAX = 37;
-
 
123
	EBX = 5;
-
 
124
	$int 0x40;
-
 
125
}
-
 
126
:dword MOUSE::hide()
-
 
127
{
-
 
128
	if(!_)
-
 
129
	{
-
 
130
		EAX = 68;
-
 
131
		EBX = 12;
-
 
132
		ECX = 32*32*4;
-
 
133
		$int 0x40
-
 
134
		ECX = EAX;
-
 
135
		_ = EAX;
-
 
136
	} else ECX = _;
-
 
137
	EAX = 37;
-
 
138
	EBX = 4;
-
 
139
	DX  = 2;
-
 
140
	$int 0x40;
-
 
141
	handle = EAX;
-
 
142
	ECX = EAX;
-
 
143
	EAX = 37;
-
 
144
	EBX = 5;
-
 
145
	$int 0x40;
-
 
146
	handle = EAX;
-
 
147
}
-
 
148
 
-
 
149
//set new attributes MOUSE
-
 
150
:void MOUSE::set()
-
 
151
{
-
 
152
	if((xx!=x)||(yy!=y))
-
 
153
	{
-
 
154
		EAX = 18;
-
 
155
		EBX = 19;
-
 
156
		ECX = 4;
-
 
157
		EDX = (x<<16)+y;
-
 
158
		$int 0x40
-
 
159
		//move = true;
-
 
160
	}
-
 
161
	if((key)||(lkm|mkm|pkm))&&(down|up|click|dblclick|move)
-
 
162
	{
-
 
163
		if(lkm|mkm|pkm)key=(lkm)|(pkm<<1)|(2<
-
 
164
		EAX = 18;
-
 
165
		EBX = 19;
-
 
166
		ECX = key;
-
 
167
		EDX = (x<<16)+y;
-
 
168
		$int 0x40
-
 
169
	}
-
 
170
}
-
 
171
 
-
 
172
:void MOUSE::center()
-
 
173
{
-
 
174
	EAX = 18;
-
 
175
	EBX = 15;
-
 
176
	$int 0x40
-
 
177
}
-
 
178
 
-
 
179
//get new attributes MOUSE
-
 
180
:void MOUSE::get()
-
 
181
{
-
 
182
	EAX = 37;
-
 
183
	EBX = 1;
-
 
184
	$int	0x40
-
 
185
	$mov	ebx, eax
-
 
186
	$shr	eax, 16
-
 
187
	$and	ebx,0x0000FFFF
-
 
188
	x = EAX;
-
 
189
	y = EBX;
-
 
190
	if (x>6000) x-=65535;
-
 
191
	if (y>6000) y-=65535;
-
 
192
	EAX = 37;
-
 
193
	EBX = 2;
-
 
194
	$int	0x40
-
 
195
	$mov	ebx, eax
-
 
196
	$mov	ecx, eax
-
 
197
	key = EAX;
-
 
198
	$and	eax, 0x00000001
-
 
199
	$shr	ebx, 1
-
 
200
	$and	ebx, 0x00000001
-
 
201
	$shr	ecx, 2
-
 
202
	$and	ecx, 0x00000001
-
 
203
	lkm = EAX;
-
 
204
	pkm = EBX;
-
 
205
	mkm = ECX;
-
 
206
	
-
 
207
	//when you release the MOUSE button
-
 
208
	// Mouse Move Event
-
 
209
	if(xx!=x)||(yy!=y)
-
 
210
	{
-
 
211
		move = true;
-
 
212
		xx = x;
-
 
213
		yy = y;
-
 
214
	}
-
 
215
	else move = false;
-
 
216
	// Mouse Up Event
-
 
217
	if(cmd)&&(!key){
-
 
218
		up   = true;
-
 
219
		down = false;
-
 
220
		drag = false;
-
 
221
		if(!move) click = true;
-
 
222
		__TMP_TIME = GetStartTime();
-
 
223
		if(__TMP_TIME-tmp_time<=MOUSE_TIME)
-
 
224
		{ 
-
 
225
			dblclick = true;
-
 
226
			click    = false; 
-
 
227
		}
-
 
228
		tmp_time = __TMP_TIME;
-
 
229
		//returns the key code
-
 
230
		key = tmp;
-
 
231
		lkm = 1&tmp;
-
 
232
		pkm = 2&tmp;
-
 
233
		pkm >>= 1;
-
 
234
		mkm = 4&tmp;
-
 
235
		mkm >>= 2;
-
 
236
		cmd = false;
-
 
237
	}
-
 
238
	
-
 
239
	//when you press the MOUSE button
-
 
240
	// Mouse Down Event/Move Event
-
 
241
	else 
-
 
242
	{
-
 
243
	    up       = false;
-
 
244
		click    = false;
-
 
245
		dblclick = false;
-
 
246
		down     = false;
-
 
247
		// Mouse Move Event
-
 
248
		if(key)if(!cmd) 
-
 
249
		{
-
 
250
			down = true;
-
 
251
			if(move)drag = true;
-
 
252
			cmd = true;
-
 
253
			tmp=key;
-
 
254
		}
-
 
255
	}
-
 
256
	
-
 
257
	//scroll
-
 
258
	EAX = 37;
-
 
259
	EBX = 7;
-
 
260
	$int	0x40
-
 
261
	$mov	ebx, eax
-
 
262
	$shr	eax, 16
-
 
263
	$and	ebx,0x0000FFFF
-
 
264
	//hor = EAX;
-
 
265
	vert = EBX;
-
 
266
}
-
 
267
 
-
 
268
 
-
 
269
 
-
 
270
:void MOUSE::slider()
-
 
271
{
-
 
272
	signed _x,_y;
-
 
273
	if(!handle)hide();
-
 
274
	get();
-
 
275
	_x = x;_y = y;
-
 
276
	pause(5);
-
 
277
	get();
-
 
278
	left = _x - x;
-
 
279
	top  = _y - y;
-
 
280
	center();
-
 
281
	get();
-
 
282
	_x = x;_y = y;
-
 
283
	pause(5);
-
 
284
}
-
 
285
 
-
 
286
:struct keyboard
-
 
287
{
-
 
288
	signed key;
-
 
289
	byte down,up,press;
-
 
290
	void get(void);
-
 
291
};
-
 
292
 
-
 
293
:void keyboard::get(void)
-
 
294
{
-
 
295
	
-
 
296
}
-
 
297
 
-
 
298
:struct system_colors
-
 
299
{
-
 
300
	dword frame,grab,grab_button,grab_button_text,grab_text,
-
 
301
	      work,work_button,work_button_text,work_text,work_graph;
-
 
302
	void get();
-
 
303
};
-
 
304
 
-
 
305
:void system_colors::get()
-
 
306
{
-
 
307
	EAX = 48;
-
 
308
	EBX = 3;
-
 
309
	ECX = #frame;
-
 
310
	EDX = 40;
-
 
311
	$int 0x40
83
 
312
}
84
 
313
 
85
 
314
//------------------------------------------------------------------------------
86
//------------------------------------------------------------------------------
315
:dword wait_event_code;
87
:dword wait_event_code;
316
inline fastcall dword WaitEvent()
88
inline fastcall dword WaitEvent()
317
{
89
{
318
	$mov eax,10
90
	$mov eax,10
319
	$int 0x40
91
	$int 0x40
320
	wait_event_code = EAX;
92
	wait_event_code = EAX;
321
	//if(wait_event_code==evMouse) MOUSE.get();
93
	//if(wait_event_code==evMouse) MOUSE.get();
322
	//return wait_event_code;
94
	//return wait_event_code;
323
}
95
}
324
 
96
 
325
inline fastcall dword CheckEvent()
97
inline fastcall dword CheckEvent()
326
{
98
{
327
	$mov eax,11
99
	$mov eax,11
328
	$int 0x40
100
	$int 0x40
329
}
101
}
330
 
102
 
331
inline fastcall dword WaitEventTimeout(EBX)
103
inline fastcall dword WaitEventTimeout(EBX)
332
{
104
{
333
	$mov eax,23
105
	$mov eax,23
334
	$int 0x40
106
	$int 0x40
335
} 
107
} 
336
 
108
 
337
inline fastcall SetEventMask(EBX)
109
inline fastcall SetEventMask(EBX)
338
{
110
{
339
	$mov eax,40
111
	$mov eax,40
340
	$int 0x40
112
	$int 0x40
341
}
113
}
342
 
114
 
343
inline fastcall ScancodesGeting(){
115
inline fastcall ScancodesGeting(){
344
	$mov eax,66
116
	$mov eax,66
345
	$mov ebx,1
117
	$mov ebx,1
346
	$mov ecx,1 //᪠­ª®¤ë
118
	$mov ecx,1 //᪠­ª®¤ë
347
	$int 0x40
119
	$int 0x40
348
}
120
}
349
 
121
 
350
inline fastcall word GetKey()  //+Gluk fix
122
inline fastcall word GetKey()  //+Gluk fix
351
{
123
{
352
		$push edx
124
		$push edx
353
GETKEY:
125
GETKEY:
354
		$mov  eax,2
126
		$mov  eax,2
355
		$int  0x40
127
		$int  0x40
356
		$cmp eax,1
128
		$cmp eax,1
357
		$jne GETKEYI
129
		$jne GETKEYI
358
		$mov ah,dh
130
		$mov ah,dh
359
		$jmp GETKEYII //jz?
131
		$jmp GETKEYII //jz?
360
GETKEYI:
132
GETKEYI:
361
		$mov dh,ah
133
		$mov dh,ah
362
		$jmp GETKEY
134
		$jmp GETKEY
363
GETKEYII:
135
GETKEYII:
364
		$pop edx
136
		$pop edx
365
		$shr eax,8
137
		$shr eax,8
366
}
138
}
367
 
139
 
368
inline fastcall int GetFullKey()
140
inline fastcall int GetFullKey()
369
{
141
{
370
	$mov  eax,2
142
	$mov  eax,2
371
	$int  0x40
143
	$int  0x40
372
}
144
}
373
 
145
 
374
 
146
 
375
inline fastcall pause(EBX)
147
inline fastcall pause(EBX)
376
{
148
{
377
	$mov eax, 5
149
	$mov eax, 5
378
	$int 0x40
150
	$int 0x40
379
}
151
}
380
 
152
 
381
inline fastcall word GetButtonID()
153
inline fastcall word GetButtonID()
382
{
154
{
383
	$mov eax,17
155
	$mov eax,17
384
	$int  0x40
156
	$int  0x40
385
	$shr eax,8
157
	$shr eax,8
386
}
158
}
387
 
159
 
388
inline fastcall dword GetFreeRAM()
160
inline fastcall dword GetFreeRAM()
389
{
161
{
390
	$mov eax, 18
162
	$mov eax, 18
391
	$mov ebx, 16
163
	$mov ebx, 16
392
	$int 0x40
164
	$int 0x40
393
	//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
165
	//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
394
}
166
}
395
 
167
 
396
inline void draw_line(dword x1,y1,x2,y2,color)
168
inline void draw_line(dword x1,y1,x2,y2,color)
397
{
169
{
398
	x2--;y2--;y1--;
170
	x2--;y2--;y1--;
399
	$mov EAX,38
171
	$mov EAX,38
400
	EBX = x1<<16;
172
	EBX = x1<<16;
401
	EBX |= x2;
173
	EBX |= x2;
402
	ECX = y1<<16;
174
	ECX = y1<<16;
403
	ECX |= y2;
175
	ECX |= y2;
404
	$mov EDX,color
176
	$mov EDX,color
405
	$int 0x40
177
	$int 0x40
406
}
178
}
407
 
179
 
408
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
180
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
409
{
181
{
410
	$mov eax, 68
182
	$mov eax, 68
411
	$mov ebx, 16
183
	$mov ebx, 16
412
	$int 0x40
184
	$int 0x40
413
	//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà 
185
	//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà 
414
}
186
}
415
 
187
 
416
inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
188
inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
417
{
189
{
418
	$mov eax, 68
190
	$mov eax, 68
419
	$mov ebx, 17
191
	$mov ebx, 17
420
	$int 0x40
192
	$int 0x40
421
	//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
193
	//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
422
}
194
}
423
 
195
 
424
struct proc_info
196
struct proc_info
425
{
197
{
426
	#define SelfInfo -1
198
	#define SelfInfo -1
427
	dword	use_cpu;
199
	dword	use_cpu;
428
	word	pos_in_stack,num_slot,rezerv1;
200
	word	pos_in_stack,num_slot,rezerv1;
429
	unsigned char name[11];
201
	unsigned char name[11];
430
	char	rezerv2;
202
	char	rezerv2;
431
	dword	adress,use_memory,ID,left,top,width,height;
203
	dword	adress,use_memory,ID,left,top,width,height;
432
	word	status_slot,rezerv3;
204
	word	status_slot,rezerv3;
433
	dword	work_left,work_top,work_width,work_height;
205
	dword	work_left,work_top,work_width,work_height;
434
	char	status_window;
206
	char	status_window;
435
	dword   cwidth,cheight;
207
	dword   cwidth,cheight;
436
	byte    reserved[1024-71-8];
208
	byte    reserved[1024-71-8];
437
};
209
};
438
 
210
 
439
inline fastcall void GetProcessInfo(EBX, ECX)
211
inline fastcall void GetProcessInfo(EBX, ECX)
440
{
212
{
441
	$mov eax,9;
213
	$mov eax,9;
442
	$int  0x40
214
	$int  0x40
443
	DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
215
	DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
444
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
216
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
445
}
217
}
446
 
218
 
447
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
219
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
448
{
220
{
449
	$mov eax,34
221
	$mov eax,34
450
	$int 0x40
222
	$int 0x40
451
}
223
}
452
 
224
 
453
inline fastcall int GetProcessSlot( ECX)
225
inline fastcall int GetProcessSlot( ECX)
454
{
226
{
455
	EAX = 18;
227
	EAX = 18;
456
	EBX = 21;
228
	EBX = 21;
457
	$int 0x40
229
	$int 0x40
458
}
230
}
459
 
231
 
460
inline fastcall int GetActiveProcess()
232
inline fastcall int GetActiveProcess()
461
{
233
{
462
	EAX = 18;
234
	EAX = 18;
463
	EBX = 7;
235
	EBX = 7;
464
	$int 0x40
236
	$int 0x40
465
}
237
}
466
 
238
 
467
:int CheckActiveProcess(int Form_ID)
239
:int CheckActiveProcess(int Form_ID)
468
{
240
{
469
	int id9=GetProcessSlot(Form_ID);
241
	int id9=GetProcessSlot(Form_ID);
470
	if (id9==GetActiveProcess()) return 1;
242
	if (id9==GetActiveProcess()) return 1;
471
	return 0;
243
	return 0;
472
}
244
}
473
 
245
 
474
inline fastcall void ActivateWindow( ECX)
246
inline fastcall void ActivateWindow( ECX)
475
{
247
{
476
	EAX = 18;
248
	EAX = 18;
477
	EBX = 3;
249
	EBX = 3;
478
	$int 0x40
250
	$int 0x40
479
}
251
}
480
 
252
 
481
inline fastcall int MinimizeWindow()
253
inline fastcall int MinimizeWindow()
482
{
254
{
483
	EAX = 18;
255
	EAX = 18;
484
	EBX = 10;
256
	EBX = 10;
485
	$int 0x40
257
	$int 0x40
486
}
258
}
487
 
259
 
488
inline fastcall int CreateThread(ECX,EDX)
260
inline fastcall int CreateThread(ECX,EDX)
489
{
261
{
490
	$mov eax,51
262
	$mov eax,51
491
	$mov ebx,1
263
	$mov ebx,1
492
	$int 0x40
264
	$int 0x40
493
}
265
}
494
 
266
 
495
inline fastcall void SwitchToAnotherThread()
267
inline fastcall void SwitchToAnotherThread()
496
{
268
{
497
	$mov eax,68
269
	$mov eax,68
498
	$mov ebx,1
270
	$mov ebx,1
499
	$int 0x40
271
	$int 0x40
500
}
272
}
501
 
273
 
502
inline fastcall int SendWindowMessage( ECX, EDX)
274
inline fastcall int SendWindowMessage( ECX, EDX)
503
{
275
{
504
	$mov eax, 72
276
	$mov eax, 72
505
	$mov ebx, 1
277
	$mov ebx, 1
506
	$int 0x40
278
	$int 0x40
507
}
279
}
508
 
280
 
509
inline fastcall int KillProcess( ECX)
281
inline fastcall int KillProcess( ECX)
510
{
282
{
511
	$mov eax,18;
283
	$mov eax,18;
512
	$mov ebx,18;
284
	$mov ebx,18;
513
	$int 0x40
285
	$int 0x40
514
}
286
}
515
 
287
 
516
#define TURN_OFF 2
288
#define TURN_OFF 2
517
#define REBOOT 3
289
#define REBOOT 3
518
#define KERNEL 4
290
#define KERNEL 4
519
inline fastcall int ExitSystem( ECX)
291
inline fastcall int ExitSystem( ECX)
520
{
292
{
521
	$mov eax, 18
293
	$mov eax, 18
522
	$mov ebx, 9
294
	$mov ebx, 9
523
	$int 0x40
295
	$int 0x40
524
}
296
}
525
 
297
 
526
inline fastcall ExitProcess()
298
inline fastcall ExitProcess()
527
{
299
{
528
	$mov eax,-1;
300
	$mov eax,-1;
529
	$int 0x40
301
	$int 0x40
530
}
302
}
531
 
303
 
532
//------------------------------------------------------------------------------
304
//------------------------------------------------------------------------------
533
 
305
 
534
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
306
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
535
inline fastcall int GetSystemLanguage()
307
inline fastcall int GetSystemLanguage()
536
{
308
{
537
	EAX = 26;
309
	EAX = 26;
538
	EBX = 5;
310
	EBX = 5;
539
	$int 0x40
311
	$int 0x40
540
}
312
}
541
 
313
 
542
inline fastcall GetSkinHeight()
314
inline fastcall GetSkinHeight()
543
{
315
{
544
	$push ebx
316
	$push ebx
545
	$mov  eax,48
317
	$mov  eax,48
546
	$mov  ebx,4
318
	$mov  ebx,4
547
	$int 0x40
319
	$int 0x40
548
	$pop  ebx
320
	$pop  ebx
549
}
321
}
550
 
322
 
551
inline fastcall void SetSystemSkin( ECX)
323
inline fastcall void SetSystemSkin( ECX)
552
{
324
{
553
	EAX = 48;
325
	EAX = 48;
554
	EBX = 8;
326
	EBX = 8;
555
	$int 0x40
327
	$int 0x40
556
}
328
}
557
 
329
 
558
inline fastcall int GetScreenWidth()
330
inline fastcall int GetScreenWidth()
559
{
331
{
560
	$mov eax, 14
332
	$mov eax, 14
561
	$int 0x40
333
	$int 0x40
562
	$shr eax, 16
334
	$shr eax, 16
563
}
335
}
564
 
336
 
565
inline fastcall int GetScreenHeight()
337
inline fastcall int GetScreenHeight()
566
{
338
{
567
	$mov eax, 14
339
	$mov eax, 14
568
	$int 0x40
340
	$int 0x40
569
	$and eax,0x0000FFFF
341
	$and eax,0x0000FFFF
570
}
342
}
571
 
343
 
572
inline fastcall int GetClientTop()
344
inline fastcall int GetClientTop()
573
{
345
{
574
	$mov eax, 48
346
	$mov eax, 48
575
	$mov ebx, 5
347
	$mov ebx, 5
576
	$int 0x40
348
	$int 0x40
577
    $mov eax, ebx
349
    $mov eax, ebx
578
    $shr eax, 16
350
    $shr eax, 16
579
}
351
}
580
 
352
 
581
inline fastcall int GetClientHeight()
353
inline fastcall int GetClientHeight()
582
{
354
{
583
	$mov eax, 48
355
	$mov eax, 48
584
	$mov ebx, 5
356
	$mov ebx, 5
585
	$int 0x40
357
	$int 0x40
586
    $mov eax, ebx
358
    $mov eax, ebx
587
}
359
}
588
 
360
 
589
 
361
 
590
inline fastcall dword LoadLibrary( ECX)
362
inline fastcall dword LoadLibrary( ECX)
591
{
363
{
592
	$mov eax, 68 
364
	$mov eax, 68 
593
	$mov ebx, 19
365
	$mov ebx, 19
594
	$int  0x40
366
	$int  0x40
595
}
367
}
596
 
368
 
597
inline fastcall int TestBit( EAX, CL)
369
inline fastcall int TestBit( EAX, CL)
598
{
370
{
599
	$shr eax,cl
371
	$shr eax,cl
600
	$and eax,1
372
	$and eax,1
601
}
373
}
602
 
374
 
603
inline fastcall int PlaySpeaker( ESI)
375
inline fastcall int PlaySpeaker( ESI)
604
{
376
{
605
	$mov eax, 55
377
	$mov eax, 55
606
	$mov ebx, 55
378
	$mov ebx, 55
607
	$int 0x40
379
	$int 0x40
608
}
380
}
609
 
381
 
610
inline fastcall void debugln( EDX)
382
inline fastcall void debugln( EDX)
611
{
383
{
612
	$push eax
384
	$push eax
613
	$push ebx
385
	$push ebx
614
	$push ecx
386
	$push ecx
615
	$mov eax, 63
387
	$mov eax, 63
616
	$mov ebx, 1
388
	$mov ebx, 1
617
NEXT_CHAR:
389
NEXT_CHAR:
618
	$mov ecx, DSDWORD[edx]
390
	$mov ecx, DSDWORD[edx]
619
	$or	 cl, cl
391
	$or	 cl, cl
620
	$jz  DONE
392
	$jz  DONE
621
	$int 0x40
393
	$int 0x40
622
	$inc edx
394
	$inc edx
623
	$jmp NEXT_CHAR
395
	$jmp NEXT_CHAR
624
DONE:
396
DONE:
625
	$mov cl, 13
397
	$mov cl, 13
626
	$int 0x40
398
	$int 0x40
627
	$mov cl, 10
399
	$mov cl, 10
628
	$int 0x40
400
	$int 0x40
629
	$pop ecx
401
	$pop ecx
630
	$pop ebx
402
	$pop ebx
631
	$pop eax
403
	$pop eax
632
}
404
}
633
 
405
 
634
inline fastcall void debug( EDX)
406
inline fastcall void debug( EDX)
635
{
407
{
636
	$push eax
408
	$push eax
637
	$push ebx
409
	$push ebx
638
	$push ecx
410
	$push ecx
639
	$mov eax, 63
411
	$mov eax, 63
640
	$mov ebx, 1
412
	$mov ebx, 1
641
NEXT_CHAR:
413
NEXT_CHAR:
642
	$mov ecx, DSDWORD[edx]
414
	$mov ecx, DSDWORD[edx]
643
	$or	 cl, cl
415
	$or	 cl, cl
644
	$jz  DONE
416
	$jz  DONE
645
	$int 0x40
417
	$int 0x40
646
	$inc edx
418
	$inc edx
647
	$jmp NEXT_CHAR
419
	$jmp NEXT_CHAR
648
DONE:
420
DONE:
649
	$pop ecx
421
	$pop ecx
650
	$pop ebx
422
	$pop ebx
651
	$pop eax
423
	$pop eax
652
}
424
}
653
 
425
 
654
 
426
 
655
inline fastcall void debugch( ECX)
427
inline fastcall void debugch( ECX)
656
{
428
{
657
	$push eax
429
	$push eax
658
	$push ebx
430
	$push ebx
659
	$mov eax,63
431
	$mov eax,63
660
	$mov ebx,1
432
	$mov ebx,1
661
	$int 0x40
433
	$int 0x40
662
	$pop ebx
434
	$pop ebx
663
	$pop eax
435
	$pop eax
664
}
436
}
665
//------------------------------------------------------------------------------
437
//------------------------------------------------------------------------------
666
 
438
 
667
void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, EDI, ESI)
439
void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, EDI, ESI)
668
{
440
{
669
	EAX = 12;              // function 12:tell os about windowdraw
441
	EAX = 12;              // function 12:tell os about windowdraw
670
	EBX = 1;
442
	EBX = 1;
671
	$int 0x40
443
	$int 0x40
672
	
444
	
673
	$xor EAX,EAX
445
	$xor EAX,EAX
674
	EBX = x << 16 + size_w; 
446
	EBX = x << 16 + size_w; 
675
	ECX = y << 16 + size_h;
447
	ECX = y << 16 + size_h;
676
 
448
 
677
	EDX = WindowType << 24 | WindowAreaColor;
449
	EDX = WindowType << 24 | WindowAreaColor;
678
	$int 0x40
450
	$int 0x40
679
 
451
 
680
	EAX = 12;              // function 12:tell os about windowdraw
452
	EAX = 12;              // function 12:tell os about windowdraw
681
	EBX = 2;
453
	EBX = 2;
682
	$int 0x40
454
	$int 0x40
683
}
455
}
684
 
456
 
685
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
457
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
686
{
458
{
687
	$mov eax, 67
459
	$mov eax, 67
688
	$int 0x40
460
	$int 0x40
689
}
461
}
690
 
462
 
691
inline fastcall void DrawTitle( ECX)
463
inline fastcall void DrawTitle( ECX)
692
{
464
{
693
	EAX = 71;
465
	EAX = 71;
694
	EBX = 1;
466
	EBX = 1;
695
	$int 0x40;
467
	$int 0x40;
696
}
468
}
697
 
469
 
698
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
470
void WriteTextB(dword x,y,byte fontType, dword color, EDX)
699
{
471
{
700
	EAX = 4;
472
	EAX = 4;
701
	EBX = x<<16+y;
473
	EBX = x<<16+y;
702
	ECX = fontType<<24+color;
474
	ECX = fontType<<24+color;
703
	ESI = 0;
475
	ESI = 0;
704
	$int 0x40;
476
	$int 0x40;
705
	$add ebx, 1<<16
477
	$add ebx, 1<<16
706
	$int 0x40
478
	$int 0x40
707
}
479
}
708
 
480
 
709
void WriteText(dword x,y,byte fontType, dword color, EDX)
481
void WriteText(dword x,y,byte fontType, dword color, EDX)
710
{
482
{
711
	EAX = 4;
483
	EAX = 4;
712
	EBX = x<<16+y;
484
	EBX = x<<16+y;
713
	ECX = fontType<<24+color;
485
	ECX = fontType<<24+color;
714
	$int 0x40;
486
	$int 0x40;
715
}
487
}
716
 
488
 
717
dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI)
489
dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI)
718
{
490
{
719
	EAX = 4;
491
	EAX = 4;
720
	EBX = x<<16+y;
492
	EBX = x<<16+y;
721
	ECX = fontType<<24+color;
493
	ECX = fontType<<24+color;
722
	$int 0x40;
494
	$int 0x40;
723
}
495
}
724
 
496
 
725
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
497
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
726
{
498
{
727
	EAX = 47;
499
	EAX = 47;
728
	EBX = count<<16;
500
	EBX = count<<16;
729
	EDX = x<<16+y;
501
	EDX = x<<16+y;
730
	ESI = fontType<<24+color;
502
	ESI = fontType<<24+color;
731
	$int 0x40;
503
	$int 0x40;
732
}
504
}
733
 
505
 
734
void CopyScreen(dword EBX, x, y, w, h)
506
void CopyScreen(dword EBX, x, y, w, h)
735
{
507
{
736
  EAX = 36;
508
  EAX = 36;
737
  ECX = w << 16 + h;
509
  ECX = w << 16 + h;
738
  EDX = x << 16 + y;
510
  EDX = x << 16 + y;
739
  $int  0x40;
511
  $int  0x40;
740
}
512
}
741
 
513
 
742
:dword GetPixelColor(dword x, x_size, y)
514
:dword GetPixelColor(dword x, x_size, y)
743
{
515
{
744
	$mov eax, 35
516
	$mov eax, 35
745
	EBX= y*x_size+x;
517
	EBX= y*x_size+x;
746
	$int 0x40
518
	$int 0x40
747
}
519
}
748
 
520
 
749
 
521
 
750
void _PutImage(dword x,y, w,h, EBX)
522
void _PutImage(dword x,y, w,h, EBX)
751
{
523
{
752
	EAX = 7;
524
	EAX = 7;
753
	ECX = w<<16+h;
525
	ECX = w<<16+h;
754
	EDX = x<<16+y;
526
	EDX = x<<16+y;
755
	$int 0x40
527
	$int 0x40
756
}
528
}
757
 
529
 
758
void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
530
void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
759
{
531
{
760
	EAX = 65;
532
	EAX = 65;
761
	ECX = w<<16+h;
533
	ECX = w<<16+h;
762
	EDX = x<<16+y;
534
	EDX = x<<16+y;
763
	EBP = 0;
535
	EBP = 0;
764
	$int 0x40
536
	$int 0x40
765
} 
537
} 
766
 
538
 
767
inline fastcall void PutPixel( EBX,ECX,EDX)
539
inline fastcall void PutPixel( EBX,ECX,EDX)
768
{
540
{
769
  EAX=1;
541
  EAX=1;
770
  $int 0x40
542
  $int 0x40
771
}
543
}
772
 
544
 
773
void DrawBar(dword x,y,w,h,EDX)
545
void DrawBar(dword x,y,w,h,EDX)
774
{
546
{
775
	if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
547
	if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
776
	EAX = 13;
548
	EAX = 13;
777
	EBX = x<<16+w;
549
	EBX = x<<16+w;
778
	ECX = y<<16+h;
550
	ECX = y<<16+h;
779
 	$int 0x40
551
 	$int 0x40
780
}
552
}
781
 
553
 
782
void DefineButton(dword x,y,w,h,EDX,ESI)
554
void DefineButton(dword x,y,w,h,EDX,ESI)
783
{
555
{
784
	EAX = 8;
556
	EAX = 8;
785
	$push edx
557
	$push edx
786
	EDX += BT_DEL;
558
	EDX += BT_DEL;
787
	$int 0x40;
559
	$int 0x40;
788
	$pop edx
560
	$pop edx
789
	EBX = x<<16+w;
561
	EBX = x<<16+w;
790
	ECX = y<<16+h;
562
	ECX = y<<16+h;
791
	$int 0x40
563
	$int 0x40
792
}
564
}
793
 
565
 
794
inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
566
inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
795
{
567
{
796
	EAX = 18;
568
	EAX = 18;
797
	EBX = 22;
569
	EBX = 22;
798
	ECX = 3;
570
	ECX = 3;
799
	EDX = ID_REFRESH;
571
	EDX = ID_REFRESH;
800
	$int 0x40
572
	$int 0x40
801
	EAX = 18;
573
	EAX = 18;
802
	EBX = 3;
574
	EBX = 3;
803
	EDX = ID_ACTIVE;
575
	EDX = ID_ACTIVE;
804
	$int 0x40
576
	$int 0x40
805
}
577
}
806
 
578
 
807
inline getIPC(ECX,EDX)
579
inline getIPC(ECX,EDX)
808
{
580
{
809
	$mov EAX,60
581
	$mov EAX,60
810
	$mov EBX,2
582
	$mov EBX,2
811
	$int 0x40
583
	$int 0x40
812
}
584
}
813
 
585
 
814
inline sendIPC(ECX,EDX,ESI)
586
inline sendIPC(ECX,EDX,ESI)
815
{
587
{
816
	$mov EAX,60
588
	$mov EAX,60
817
	$mov EBX,1
589
	$mov EBX,1
818
	$int 0x40
590
	$int 0x40
819
}
591
}
820
 
592
 
821
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
593
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
822
{
594
{
823
	EAX = 8;
595
	EAX = 8;
824
	EBX = x<<16+w;
596
	EBX = x<<16+w;
825
	ECX = y<<16+h;
597
	ECX = y<<16+h;
826
	$int 0x40
598
	$int 0x40
827
}
599
}
828
 
600
 
829
inline fastcall void DeleteButton( EDX)
601
inline fastcall void DeleteButton( EDX)
830
{
602
{
831
	EAX = 8;
603
	EAX = 8;
832
	EDX += BT_DEL;
604
	EDX += BT_DEL;
833
	$int 0x40
605
	$int 0x40
834
}
606
}
835
 
607
 
836
inline fastcall dword GetStartTime()
608
inline fastcall dword GetStartTime()
837
{
609
{
838
	$mov eax,26
610
	$mov eax,26
839
	$mov ebx,9
611
	$mov ebx,9
840
	$int 0x40
612
	$int 0x40
841
}
613
}
842
 
614
 
843
:dword X_EventRedrawWindow,Y_EventRedrawWindow;
615
:dword X_EventRedrawWindow,Y_EventRedrawWindow;
844
:void _EventRedrawWindow()
616
:void _EventRedrawWindow()
845
{
617
{
846
	loop()switch(WaitEvent())
618
	loop()switch(WaitEvent())
847
	{
619
	{
848
		case evReDraw:
620
		case evReDraw:
849
			DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,"");
621
			DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,"");
850
			pause(10);
622
			pause(10);
851
			ExitProcess();
623
			ExitProcess();
852
			break;
624
			break;
853
	}
625
	}
854
}
626
}
855
:void EventRedrawWindow(dword x,y)
627
:void EventRedrawWindow(dword x,y)
856
{
628
{
857
	dword mem = malloc(4096);
629
	dword mem = malloc(4096);
858
	X_EventRedrawWindow = x;
630
	X_EventRedrawWindow = x;
859
	Y_EventRedrawWindow = y;
631
	Y_EventRedrawWindow = y;
860
	CreateThread(#_EventRedrawWindow,mem+4092);
632
	CreateThread(#_EventRedrawWindow,mem+4092);
861
}
633
}
862
 
634
 
863
:dword ALERT_TEXT;
635
:dword ALERT_TEXT;
864
:void dialog_alert()
636
:void dialog_alert()
865
{
637
{
866
	byte id;
638
	byte id;
867
	loop()switch(WaitEvent())
639
	loop()switch(WaitEvent())
868
	{
640
	{
869
		case evReDraw:
641
		case evReDraw:
870
			DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Alert");
642
			DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Alert");
871
			WriteTextB(5,5,0x90,0x0,ALERT_TEXT);
643
			WriteTextB(5,5,0x90,0x0,ALERT_TEXT);
872
		break;
644
		break;
873
		case evKey:
645
		case evKey:
874
		case evButton:
646
		case evButton:
875
			id=GetButtonID();
647
			id=GetButtonID();
876
			if (id==1) ExitProcess();
648
			if (id==1) ExitProcess();
877
		break;
649
		break;
878
	}
650
	}
879
}
651
}
880
:dword alert(dword text)
652
:dword alert(dword text)
881
{
653
{
882
	dword mem = malloc(4096);
654
	dword mem = malloc(4096);
883
	ALERT_TEXT = text;
655
	ALERT_TEXT = text;
884
	CreateThread(#dialog_alert,mem+4092);
656
	CreateThread(#dialog_alert,mem+4092);
885
	return mem;
657
	return mem;
886
}
658
}
887
 
659
 
888
:struct _screen
660
:struct _screen
889
{
661
{
890
	dword width,height;
662
	dword width,height;
891
} screen;
663
} screen;
892
 
664
 
893
:struct _skin
665
:struct _skin
894
{
666
{
895
	dword width,height;
667
	dword width,height;
896
} SKIN;
668
} SKIN;
897
 
669
 
898
:void DrawDate(dword x, y, color, in_date)
670
:void DrawDate(dword x, y, color, in_date)
899
{
671
{
900
	//char text[15];
672
	//char text[15];
901
	EDI = in_date;
673
	EDI = in_date;
902
	EAX = 47;
674
	EAX = 47;
903
	EBX = 2<<16;
675
	EBX = 2<<16;
904
	EDX = x<<16+y;
676
	EDX = x<<16+y;
905
	ESI = 0x80<<24+color;
677
	ESI = 0x80<<24+color;
906
	ECX = EDI.date.day;
678
	ECX = EDI.date.day;
907
	$int 0x40;
679
	$int 0x40;
908
	EDX += 18<<16;
680
	EDX += 18<<16;
909
	ECX = EDI.date.month;
681
	ECX = EDI.date.month;
910
	$int 0x40;
682
	$int 0x40;
911
	EDX += 18<<16;
683
	EDX += 18<<16;
912
	EBX = 4<<16;
684
	EBX = 4<<16;
913
	ECX = EDI.date.year;
685
	ECX = EDI.date.year;
914
	$int 0x40;
686
	$int 0x40;
915
	PutPixel(x+14,y+6,color);
687
	PutPixel(x+14,y+6,color);
916
	PutPixel(x+32,y+6,color);
688
	PutPixel(x+32,y+6,color);
917
	//sprintf(#text,"%d",EDI.date.year);
689
	//sprintf(#text,"%d",EDI.date.year);
918
	//WriteText(x, y, 0x80, 0x000000, #text);
690
	//WriteText(x, y, 0x80, 0x000000, #text);
919
}
691
}
920
 
692
 
921
:void __path_name__(dword BUF,PATH)
693
:void __path_name__(dword BUF,PATH)
922
{
694
{
923
	dword beg = PATH;
695
	dword beg = PATH;
924
	dword pos = PATH;
696
	dword pos = PATH;
925
	dword sav = PATH;
697
	dword sav = PATH;
926
	dword i;
698
	dword i;
927
	while(DSBYTE[pos])
699
	while(DSBYTE[pos])
928
	{
700
	{
929
		if(DSBYTE[pos]=='/')sav = pos;
701
		if(DSBYTE[pos]=='/')sav = pos;
930
		pos++;
702
		pos++;
931
	}
703
	}
932
	i = sav-beg;
704
	i = sav-beg;
933
	while(i)
705
	while(i)
934
	{
706
	{
935
		DSBYTE[BUF] = DSBYTE[beg];
707
		DSBYTE[BUF] = DSBYTE[beg];
936
		beg++;
708
		beg++;
937
		BUF++;
709
		BUF++;
938
		i--;
710
		i--;
939
	}
711
	}
940
	/*while(DSBYTE[beg])
712
	/*while(DSBYTE[beg])
941
	{
713
	{
942
		DSBYTE[BUF1] = DSBYTE[beg];
714
		DSBYTE[BUF1] = DSBYTE[beg];
943
		beg++;
715
		beg++;
944
		BUF1++;
716
		BUF1++;
945
	}*/
717
	}*/
946
	//DSBYTE[BUF1] = 0;
718
	//DSBYTE[BUF1] = 0;
947
	DSBYTE[BUF] = 0;
719
	DSBYTE[BUF] = 0;
948
}
720
}
949
char __BUF_DIR__[4096];
721
char __BUF_DIR__[4096];
950
:struct SELF
722
:struct SELF
951
{
723
{
952
	dword dir;
724
	dword dir;
953
	dword file;
725
	dword file;
954
	dword path;
726
	dword path;
955
} self;
727
} self;
956
 
728
 
957
dword __generator;  // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
729
dword __generator;  // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
958
 
730
 
959
:dword program_path_length;
731
:dword program_path_length;
960
 
732
 
961
//The initialization of the initial data before running
733
//The initialization of the initial data before running
962
void ______INIT______()
734
void ______INIT______()
963
{
735
{
964
	self.dir = #__BUF_DIR__;
736
	self.dir = #__BUF_DIR__;
965
	self.file = 0;
737
	self.file = 0;
966
	self.path = I_Path;
738
	self.path = I_Path;
967
	__path_name__(#__BUF_DIR__,I_Path);
739
	__path_name__(#__BUF_DIR__,I_Path);
968
	
740
	
969
	SKIN.height   = GetSkinHeight();
741
	SKIN.height   = GetSkinHeight();
970
	screen.width  = GetScreenWidth();
742
	screen.width  = GetScreenWidth();
971
	screen.height = GetScreenHeight();
743
	screen.height = GetScreenHeight();
972
	
744
	
973
	//program_path_length = strlen(I_Path);
745
	//program_path_length = strlen(I_Path);
974
	MOUSE_TIME = 50; //Default 500 ms.
746
	MOUSE_TIME = 50; //Default 500 ms.
975
	__generator = GetStartTime();
747
	__generator = GetStartTime();
976
	
748
	
977
	$push    ebx
749
	$push    ebx
978
	$mov     eax, 68
750
	$mov     eax, 68
979
	$mov     ebx, 11
751
	$mov     ebx, 11
980
	$int     0x40
752
	$int     0x40
981
	
753
	
982
	$pop     ebx
754
	$pop     ebx
983
 
755
 
984
	main();
756
	main();
985
}
757
}
986
______STOP______:
758
______STOP______:
987
#endif
759
#endif
988
>
760
>
989
>
761
>
990
>
762
>
991
>
763
>
992
>
764
>
993
>
765
>
994
>
766
>
995
>
767
>
996
>
768
>
997
>
769
>
998
>
770
>
999
>
771
>
1000
>
772
>
1001
>
773
>
1002
>
774
>
1003
>
775
>
1004
>
776
>
1005
>
777
>
1006
>
778
>
1007
>
779
>
1008
>
780
>
1009
>
781
>
1010
>
782
>
1011
>
783
>
1012
>
784
>
1013
>
785
>
1014
>
786
>
1015
>
787
>
1016
>
788
>
1017
>
789
>
1018
>
790
>
1019
>
791
>
1020
>
792
>
1021
>
793
>
1022
>
794
>
1023
>
795
>
1024
>
796
>
1025
>
797
>
1026
>
798
>
1027
>
799
>
1028
>
800
>
1029
>
801
>
1030
>
802
>
1031
>
803
>
1032
>
804
>
1033
>
805
>
1034
>
806
>
1035
>
807
>
1036
>
808
>
1037
>
809
>
1038
>
810
>
1039
>
811
>
1040
>
812
>
1041
>
813
>
1042
>
814
>
1043
>
815
>
1044
>
-
 
1045
>
-
 
1046
>
-
 
1047
>
-
 
1048
>
-
 
1049
>
-
 
1050
>
-
 
1051
>
-
 
1052
>
-