Subversion Repositories Kolibri OS

Rev

Rev 7310 | Rev 7358 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6021 leency 1
//CODED by Veliant, Leency, Nable, Pavelyakov. GNU GPL licence.
2
 
5598 pavelyakov 3
#ifndef INCLUDE_KOLIBRI_H
5582 pavelyakov 4
#define INCLUDE_KOLIBRI_H
5576 pavelyakov 5
 
5676 pavelyakov 6
#pragma option OST
7
#pragma option ON
8
#pragma option cri-
9
#pragma option -CPA
10
#initallvar 0
11
#jumptomain FALSE
12
 
3067 leency 13
#startaddress 0
5676 pavelyakov 14
 
3067 leency 15
#code32 TRUE
5676 pavelyakov 16
 
3067 leency 17
char   os_name[8]   = {'M','E','N','U','E','T','0','1'};
18
dword  os_version   = 0x00000001;
5648 pavelyakov 19
dword  start_addr   = #______INIT______;
20
dword  final_addr   = #______STOP______+32;
3363 leency 21
dword  alloc_mem    = MEMSIZE;
22
dword  x86esp_reg   = MEMSIZE;
3067 leency 23
dword  I_Param      = #param;
24
dword  I_Path       = #program_path;
25
char param[4096];
26
char program_path[4096];
27
 
6651 leency 28
#define bool      int
5883 pavelyakov 29
 
3363 leency 30
#define NULL      0
31
#define OLD      -1
32
#define true      1
33
#define false     0
34
 
6039 leency 35
//Process Events
4536 leency 36
#define evReDraw  1
37
#define evKey     2
38
#define evButton  3
6978 leency 39
#define evExit    4
5576 pavelyakov 40
#define evDesktop 5
3067 leency 41
#define evMouse   6
5576 pavelyakov 42
#define evIPC     7
4536 leency 43
#define evNetwork 8
5576 pavelyakov 44
#define evDebug   9
3067 leency 45
 
6978 leency 46
//Event mask bits for function 40
7031 leency 47
#define EVM_REDRAW                1b
48
#define EVM_KEY                  10b
49
#define EVM_BUTTON              100b
50
#define EVM_EXIT               1000b
51
#define EVM_BACKGROUND        10000b
52
#define EVM_MOUSE            100000b
53
#define EVM_IPC             1000000b
54
#define EVM_STACK          10000000b
55
#define EVM_DEBUG         100000000b
56
#define EVM_STACK2       1000000000b
6978 leency 57
#define EVM_MOUSE_FILTER  0x80000000
58
#define EVM_CURSOR_FILTER 0x40000000
59
 
3067 leency 60
//Button options
61
#define BT_DEL      0x80000000
62
#define BT_HIDE     0x40000000
63
#define BT_NOFRAME  0x20000000
64
 
7054 leency 65
#define CLOSE_BTN 1
66
 
3067 leency 67
//-------------------------------------------------------------------------
68
 
5674 pavelyakov 69
#include "../lib/system.h"
70
#include "../lib/mouse.h"
6285 leency 71
#include "../lib/keyboard.h"
5674 pavelyakov 72
 
6751 leency 73
inline fastcall dword calc(EAX) { return EAX; }
6742 leency 74
 
5477 leency 75
:struct raw_image {
76
	dword w, h, data;
77
};
78
 
3067 leency 79
//------------------------------------------------------------------------------
5582 pavelyakov 80
:dword wait_event_code;
3067 leency 81
inline fastcall dword WaitEvent()
82
{
83
	$mov eax,10
84
	$int 0x40
5576 pavelyakov 85
	wait_event_code = EAX;
5591 pavelyakov 86
	//if(wait_event_code==evMouse) MOUSE.get();
87
	//return wait_event_code;
3067 leency 88
}
89
 
90
inline fastcall dword CheckEvent()
91
{
92
	$mov eax,11
93
	$int 0x40
7310 pavelyakov 94
	wait_event_code = EAX;
3067 leency 95
}
96
 
7310 pavelyakov 97
:dword WaitEventTimeout(dword time)
3067 leency 98
{
7310 pavelyakov 99
	EAX = 23;
100
	EBX = time;
3067 leency 101
	$int 0x40
7310 pavelyakov 102
	wait_event_code = EAX;
3067 leency 103
}
104
 
6978 leency 105
inline fastcall dword SetEventMask(EBX)
3067 leency 106
{
107
	$mov eax,40
108
	$int 0x40
109
}
110
 
111
 
5576 pavelyakov 112
inline fastcall pause(EBX)
3067 leency 113
{
114
	$mov eax, 5
115
	$int 0x40
116
}
117
 
118
inline fastcall word GetButtonID()
119
{
120
	$mov eax,17
121
	$int  0x40
122
	$shr eax,8
123
}
124
 
125
inline fastcall dword GetFreeRAM()
126
{
127
	$mov eax, 18
128
	$mov ebx, 16
129
	$int 0x40
6980 leency 130
	//return eax = free RAM in Kb
3067 leency 131
}
132
 
7356 leency 133
inline fastcall int GetCpuIdleCount()
134
{
135
	EAX = 18;
136
	EBX = 4;
137
	$int 0x40
138
}
139
 
140
inline fastcall int GetCpuFrequency()
141
{
142
	EAX = 18;
143
	EBX = 5;
144
	$int 0x40
145
}
146
 
6791 leency 147
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
3067 leency 148
{
149
	$mov eax, 68
150
	$mov ebx, 16
151
	$int 0x40
6791 leency 152
	//return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà
3067 leency 153
}
154
 
6791 leency 155
inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
3067 leency 156
{
157
	$mov eax, 68
158
	$mov ebx, 17
159
	$int 0x40
6791 leency 160
	//return eax = îïðåäåëÿåòñÿ äðàéâåðîì
3067 leency 161
}
162
 
163
struct proc_info
164
{
165
	#define SelfInfo -1
166
	dword	use_cpu;
7266 leency 167
	word	pos_in_stack,slot,rezerv1;
4137 leency 168
	unsigned char name[11];
3067 leency 169
	char	rezerv2;
170
	dword	adress,use_memory,ID,left,top,width,height;
171
	word	status_slot,rezerv3;
172
	dword	work_left,work_top,work_width,work_height;
173
	char	status_window;
3107 leency 174
	dword   cwidth,cheight;
175
	byte    reserved[1024-71-8];
3067 leency 176
};
177
 
7225 leency 178
:void GetProcessInfo(dword _process_struct_pointer, _process_id)
3067 leency 179
{
7225 leency 180
	skin_height = GetSkinHeight();
181
	EAX = 9;
182
	EBX = _process_struct_pointer;
183
	ECX = _process_id;
3067 leency 184
	$int  0x40
3107 leency 185
	DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
7051 leency 186
	DSDWORD[EBX+75] = DSDWORD[EBX+46] - skin_height - 4; //set cheight
3067 leency 187
}
188
 
189
inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
190
{
191
	$mov eax,34
192
	$int 0x40
193
}
194
 
195
inline fastcall int GetProcessSlot( ECX)
196
{
197
	EAX = 18;
198
	EBX = 21;
199
	$int 0x40
200
}
201
 
202
inline fastcall int GetActiveProcess()
203
{
204
	EAX = 18;
205
	EBX = 7;
206
	$int 0x40
207
}
208
 
4081 leency 209
:int CheckActiveProcess(int Form_ID)
210
{
4166 leency 211
	int id9=GetProcessSlot(Form_ID);
212
	if (id9==GetActiveProcess()) return 1;
4081 leency 213
	return 0;
214
}
215
 
7266 leency 216
inline fastcall void ActivateWindow( ECX) //ECX - slot
3114 leency 217
{
218
	EAX = 18;
219
	EBX = 3;
220
	$int 0x40
221
}
222
 
7254 leency 223
:void RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
224
{
225
	ActivateWindow(ID_REFRESH);
226
	ActivateWindow(ID_ACTIVE);
227
}
228
 
5421 leency 229
inline fastcall int MinimizeWindow()
230
{
231
	EAX = 18;
232
	EBX = 10;
233
	$int 0x40
234
}
235
 
5576 pavelyakov 236
inline fastcall int CreateThread(ECX,EDX)
3067 leency 237
{
238
	$mov eax,51
239
	$mov ebx,1
240
	$int 0x40
241
}
242
 
243
inline fastcall void SwitchToAnotherThread()
244
{
245
	$mov eax,68
246
	$mov ebx,1
247
	$int 0x40
248
}
249
 
3458 leency 250
inline fastcall int SendWindowMessage( ECX, EDX)
3444 leency 251
{
252
	$mov eax, 72
253
	$mov ebx, 1
254
	$int 0x40
255
}
256
 
3067 leency 257
inline fastcall int KillProcess( ECX)
258
{
259
	$mov eax,18;
260
	$mov ebx,18;
261
	$int 0x40
262
}
263
 
264
#define TURN_OFF 2
265
#define REBOOT 3
266
#define KERNEL 4
267
inline fastcall int ExitSystem( ECX)
268
{
269
	$mov eax, 18
270
	$mov ebx, 9
271
	$int 0x40
272
}
273
 
274
inline fastcall ExitProcess()
275
{
276
	$mov eax,-1;
277
	$int 0x40
278
}
279
 
280
//------------------------------------------------------------------------------
281
 
6563 leency 282
inline fastcall void SetCurDir( ECX)
283
{
284
  EAX=30;
285
  EBX=1;
286
  $int 0x40
287
}
6504 punk_joker 288
 
289
 
6791 leency 290
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
6662 leency 291
#define SYS_LANG_ENG 1
292
#define SYS_LANG_FIN 2
293
#define SYS_LANG_GER 3
294
#define SYS_LANG_RUS 4
3067 leency 295
inline fastcall int GetSystemLanguage()
296
{
297
	EAX = 26;
298
	EBX = 5;
299
	$int 0x40
300
}
301
 
7235 leency 302
#define BUTTON_STYLE_FLAT 0
303
#define BUTTON_STYLE_GRADIENT 1
304
inline fastcall SetButtonStyle(ECX) //ECX - button style
305
{
306
	$mov eax,48
307
	$mov ebx,1
308
	int 64
309
}
310
 
3067 leency 311
inline fastcall GetSkinHeight()
312
{
313
	$push ebx
314
	$mov  eax,48
315
	$mov  ebx,4
316
	$int 0x40
317
	$pop  ebx
318
}
319
 
320
inline fastcall void SetSystemSkin( ECX)
321
{
322
	EAX = 48;
323
	EBX = 8;
324
	$int 0x40
325
}
326
 
327
inline fastcall int GetScreenWidth()
328
{
329
	$mov eax, 14
330
	$int 0x40
331
	$shr eax, 16
332
}
333
 
334
inline fastcall int GetScreenHeight()
335
{
336
	$mov eax, 14
337
	$int 0x40
338
	$and eax,0x0000FFFF
339
}
340
 
5421 leency 341
inline fastcall int GetClientTop()
342
{
343
	$mov eax, 48
344
	$mov ebx, 5
345
	$int 0x40
6058 leency 346
	$mov eax, ebx
347
	$shr eax, 16
5421 leency 348
}
349
 
350
inline fastcall int GetClientHeight()
351
{
352
	$mov eax, 48
353
	$mov ebx, 5
354
	$int 0x40
6058 leency 355
	$mov eax, ebx
5421 leency 356
}
357
 
3067 leency 358
inline fastcall dword LoadLibrary( ECX)
359
{
360
	$mov eax, 68
361
	$mov ebx, 19
362
	$int  0x40
363
}
364
 
365
inline fastcall int TestBit( EAX, CL)
366
{
367
	$shr eax,cl
368
	$and eax,1
369
}
370
 
7166 leency 371
:void SetClientScreenArea(dword _left, _right, _top, _bottom)
372
{
373
	EAX = 48;
374
	EBX = 6;
375
	ECX = _left * 65536 + _right;
376
	EDX = _top * 65536 + _bottom;
377
	$int 64;
378
}
379
 
3067 leency 380
//------------------------------------------------------------------------------
381
 
6746 leency 382
:void DefineAndDrawWindow(dword _x, _y, _w, _h, _window_type, _bgcolor, _title, _flags)
3067 leency 383
{
384
	EAX = 12;              // function 12:tell os about windowdraw
385
	EBX = 1;
386
	$int 0x40
387
 
5576 pavelyakov 388
	$xor EAX,EAX
6746 leency 389
	EBX = _x << 16 + _w;
390
	ECX = _y << 16 + _h;
391
	EDX = _window_type << 24 | _bgcolor;
392
	EDI = _title;
393
	ESI = _flags;
3067 leency 394
	$int 0x40
395
 
6742 leency 396
 
3067 leency 397
	EAX = 12;              // function 12:tell os about windowdraw
398
	EBX = 2;
399
	$int 0x40
400
}
401
 
402
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
403
{
404
	$mov eax, 67
405
	$int 0x40
406
}
407
 
408
inline fastcall void DrawTitle( ECX)
409
{
410
	EAX = 71;
411
	EBX = 1;
412
	$int 0x40;
413
}
414
 
6794 leency 415
// @EDX is a process id, -1 for self
6791 leency 416
// @ESI is a new LayerBehaviour
417
// @RETURN: EAX, 0 is fail, 1 is success
6794 leency 418
#define ZPOS_DESKTOP     -2
419
#define ZPOS_ALWAYS_BACK -1
420
#define ZPOS_NORMAL      0
421
#define ZPOS_ALWAYS_TOP  1
6791 leency 422
inline fastcall dword SetWindowLayerBehaviour(EDX, ESI)
423
{
424
	EAX = 18;
425
	EBX = 25;
426
	ECX = 2;
427
	$int 64
428
}
429
 
6735 leency 430
:void WriteTextB(dword x,y,byte fontType, dword color, str_offset)
3067 leency 431
{
432
	EAX = 4;
433
	EBX = x<<16+y;
434
	ECX = fontType<<24+color;
6735 leency 435
	EDX = str_offset;
3363 leency 436
	ESI = 0;
3067 leency 437
	$int 0x40;
3107 leency 438
	$add ebx, 1<<16
439
	$int 0x40
3067 leency 440
}
441
 
6735 leency 442
:void WriteText(dword x,y,byte fontType, dword color, str_offset)
3107 leency 443
{
444
	EAX = 4;
445
	EBX = x<<16+y;
446
	ECX = fontType<<24+color;
6735 leency 447
	EDX = str_offset;
3107 leency 448
	$int 0x40;
449
}
450
 
6742 leency 451
:dword WriteBufText(dword x,y,byte fontType, dword color, str_offset, buf_offset)
3467 leency 452
{
453
	EAX = 4;
454
	EBX = x<<16+y;
455
	ECX = fontType<<24+color;
6742 leency 456
	EDX = str_offset;
457
	EDI = buf_offset;
3467 leency 458
	$int 0x40;
459
}
460
 
6742 leency 461
:void WriteNumber(dword x,y,byte fontType, dword color, count, number_or_offset)
3067 leency 462
{
463
	EAX = 47;
464
	EBX = count<<16;
6735 leency 465
	ECX = number_or_offset;
3067 leency 466
	EDX = x<<16+y;
467
	ESI = fontType<<24+color;
468
	$int 0x40;
469
}
470
 
6735 leency 471
:void CopyScreen(dword dst_offset, x, y, w, h)
3067 leency 472
{
473
  EAX = 36;
6735 leency 474
  EBX = dst_offset;
3363 leency 475
  ECX = w << 16 + h;
3067 leency 476
  EDX = x << 16 + y;
477
  $int  0x40;
478
}
479
 
6791 leency 480
:dword GetPixelColorFromScreen(dword _x, _y)
3067 leency 481
{
6791 leency 482
	EAX = 35;
483
	EBX = _y * screen.width + _x;
484
	$int 64
3067 leency 485
}
486
 
7089 leency 487
#define DRAW_DESKTOP_BG_TILE 1
488
#define DRAW_DESKTOP_BG_STRETCH 2
7160 leency 489
:void SetBackgroundImage(dword w,h, image, mode)
7089 leency 490
{
491
	$mov     eax,15      // SF_BACKGROUND_SET 15 - work with desktop background graphics
492
	$mov     ebx,4       // SSF_MODE_BG 4 - set drawing mode for the background
493
	$mov     ecx,mode    // drawing mode - tile (1), stretch (2)
494
	$int     64
495
 
496
	$mov     eax,15      // SF_BACKGROUND_SET 15 - work with desktop background graphics
497
	$mov     ebx,1       // SSF_SIZE_BG=1 - set a size of the background image
498
	$mov     ecx,w       // width
499
	$mov     edx,h       // height
500
	$int     64
501
 
502
	$mov     eax,15      // SF_BACKGROUND_SET 15 - work with desktop background graphics
503
	$mov     ebx,5       // SSF_IMAGE_BG=5 - put block of pixels on the background image
504
	$mov     ecx,image   // pointer to the data in the format BBGGRRBBGGRR...
505
	$mov     edx,0       // offset in data of the background image
506
	ESI      = 3*w*h;    // size of data in bytes = 3 * number of pixels
507
	$int     64
508
 
509
	$mov     eax,15      // SF_BACKGROUND_SET 15 - work with desktop background graphics
510
	$mov     ebx,3       // SSF_REDRAW_BG=3 - redraw background
511
	$int     64
512
}
513
 
6735 leency 514
:void _PutImage(dword x,y, w,h, data_offset)
3067 leency 515
{
516
	EAX = 7;
6735 leency 517
	EBX = data_offset;
3067 leency 518
	ECX = w<<16+h;
519
	EDX = x<<16+y;
520
	$int 0x40
521
}
522
 
7163 leency 523
:void PutPaletteImage(dword inbuf,w,h,x,y,bits,pal)
3067 leency 524
{
525
	EAX = 65;
7163 leency 526
	EBX = inbuf;
3067 leency 527
	ECX = w<<16+h;
528
	EDX = x<<16+y;
7163 leency 529
	ESI = bits;
530
	EDI = pal;
3067 leency 531
	EBP = 0;
532
	$int 0x40
6742 leency 533
}
3067 leency 534
 
535
inline fastcall void PutPixel( EBX,ECX,EDX)
536
{
537
  EAX=1;
538
  $int 0x40
539
}
540
 
6742 leency 541
:void DrawBar(dword x,y,w,h,color)
3067 leency 542
{
3225 leency 543
	if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
3067 leency 544
	EAX = 13;
545
	EBX = x<<16+w;
546
	ECX = y<<16+h;
6742 leency 547
	EDX = color;
6058 leency 548
	$int 0x40
3067 leency 549
}
550
 
7203 leency 551
:void DefineButton(dword x,y,w,h,id,color)
3067 leency 552
{
3107 leency 553
	EAX = 8;
7203 leency 554
	EDX = id + BT_DEL;
3107 leency 555
	$int 0x40;
7203 leency 556
	EDX = id;
557
	ESI = color;
3067 leency 558
	EBX = x<<16+w;
559
	ECX = y<<16+h;
560
	$int 0x40
561
}
562
 
6742 leency 563
:void UnsafeDefineButton(dword x,y,w,h,id,color)
3107 leency 564
{
565
	EAX = 8;
566
	EBX = x<<16+w;
567
	ECX = y<<16+h;
6742 leency 568
	EDX = id;
569
	ESI = color;
3107 leency 570
	$int 0x40
571
}
572
 
7160 leency 573
:void DefineDragableWindow(dword _x, _y, _w, _h)
6791 leency 574
{
575
	DefineAndDrawWindow(_x, _y, _w, _h, 0x41,0x000000,NULL,0b);
576
}
577
 
7166 leency 578
:void DefineUnDragableWindow(dword _x, _y, _w, _h)
579
{
580
	DefineAndDrawWindow(_x, _y, _w, _h, 0x01, 0, 0, 0x01fffFFF);
581
}
582
 
6791 leency 583
:void EventDragWindow()
584
{
585
	dword tmp_x,tmp_y;
586
	dword z1,z2;
587
	tmp_x = mouse.x;
588
	tmp_y = mouse.y;
589
	do {
590
		mouse.get();
591
		if (tmp_x!=mouse.x) || (tmp_y!=mouse.y)
592
		{
593
			z1 = Form.left + mouse.x - tmp_x;
594
			z2 = Form.top + mouse.y - tmp_y;
595
			if(z1<=10) || (z1>20000) z1=0; else if(z1>screen.width-Form.width-10)z1=screen.width-Form.width;
596
			if(z2<=10) || (z2>20000) z2=0; else if(z2>screen.height-Form.height-10)z2=screen.height-Form.height;
597
			MoveSize(z1 , z2, OLD, OLD);
598
			draw_window();
599
		}
600
		pause(1);
601
	} while (mouse.lkm);
602
}
603
 
604
:void DefineHiddenButton(dword _x, _y, _w, _h, _id)
605
{
606
	DefineButton(_x, _y, _w, _h, _id + BT_HIDE, 0);
607
}
608
 
3067 leency 609
inline fastcall void DeleteButton( EDX)
610
{
611
	EAX = 8;
612
	EDX += BT_DEL;
5630 leency 613
	$int 0x40
5548 leency 614
}
615
 
616
inline fastcall dword GetStartTime()
617
{
618
	$mov eax,26
619
	$mov ebx,9
620
	$int 0x40
5575 pavelyakov 621
}
622
 
5606 pavelyakov 623
:dword X_EventRedrawWindow,Y_EventRedrawWindow;
624
:void _EventRedrawWindow()
625
{
7244 leency 626
	DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,1,1,0x34,0xFFFFFF,NULL,0);
627
	//pause(10);
628
	ExitProcess();
5606 pavelyakov 629
}
5760 pavelyakov 630
:char REDRAW_BUFF_EVENT_[4096];
5606 pavelyakov 631
:void EventRedrawWindow(dword x,y)
632
{
633
	X_EventRedrawWindow = x;
634
	Y_EventRedrawWindow = y;
5760 pavelyakov 635
	CreateThread(#_EventRedrawWindow,#REDRAW_BUFF_EVENT_+4092);
5606 pavelyakov 636
}
637
 
5582 pavelyakov 638
:struct _screen
639
{
640
	dword width,height;
641
} screen;
642
 
6041 leency 643
:byte skin_height;
5582 pavelyakov 644
 
5640 pavelyakov 645
:void DrawDate(dword x, y, color, in_date)
646
{
647
	EDI = in_date;
648
	EAX = 47;
649
	EBX = 2<<16;
650
	EDX = x<<16+y;
6280 punk_joker 651
	ESI = 0x90<<24+color;
5640 pavelyakov 652
	ECX = EDI.date.day;
653
	$int 0x40;
6285 leency 654
	EDX += 20<<16;
5640 pavelyakov 655
	ECX = EDI.date.month;
656
	$int 0x40;
6285 leency 657
	EDX += 20<<16;
5640 pavelyakov 658
	EBX = 4<<16;
659
	ECX = EDI.date.year;
660
	$int 0x40;
6285 leency 661
	DrawBar(x+17,y+10,2,2,color);
662
	DrawBar(x+37,y+10,2,2,color);
5640 pavelyakov 663
}
664
 
5646 pavelyakov 665
:void __path_name__(dword BUF,PATH)
666
{
667
	dword beg = PATH;
668
	dword pos = PATH;
669
	dword sav = PATH;
670
	dword i;
671
	while(DSBYTE[pos])
672
	{
673
		if(DSBYTE[pos]=='/')sav = pos;
674
		pos++;
675
	}
676
	i = sav-beg;
677
	while(i)
678
	{
679
		DSBYTE[BUF] = DSBYTE[beg];
680
		beg++;
681
		BUF++;
682
		i--;
683
	}
684
	/*while(DSBYTE[beg])
685
	{
686
		DSBYTE[BUF1] = DSBYTE[beg];
687
		beg++;
688
		BUF1++;
689
	}*/
690
	//DSBYTE[BUF1] = 0;
691
	DSBYTE[BUF] = 0;
692
}
5648 pavelyakov 693
char __BUF_DIR__[4096];
694
:struct SELF
695
{
696
	dword dir;
697
	dword file;
698
	dword path;
699
} self;
5646 pavelyakov 700
 
6791 leency 701
dword __generator;  // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
5575 pavelyakov 702
 
5582 pavelyakov 703
:dword program_path_length;
5576 pavelyakov 704
 
5575 pavelyakov 705
//The initialization of the initial data before running
5648 pavelyakov 706
void ______INIT______()
5575 pavelyakov 707
{
6761 leency 708
	//if (program_path[0]!='/') I_Path++;
6759 leency 709
 
5648 pavelyakov 710
	self.dir = #__BUF_DIR__;
711
	self.file = 0;
712
	self.path = I_Path;
713
	__path_name__(#__BUF_DIR__,I_Path);
5646 pavelyakov 714
 
6041 leency 715
	skin_height   = GetSkinHeight();
6771 leency 716
	screen.width  = GetScreenWidth()+1;
717
	screen.height = GetScreenHeight()+1;
5582 pavelyakov 718
 
5575 pavelyakov 719
	__generator = GetStartTime();
5651 pavelyakov 720
 
6021 leency 721
	mem_init();
5651 pavelyakov 722
 
6735 leency 723
 
5575 pavelyakov 724
	main();
5933 pavelyakov 725
	ExitProcess();
5598 pavelyakov 726
}
5648 pavelyakov 727
______STOP______:
6021 leency 728
#endif
729
 
730
#ifndef INCLUDE_MEM_H
731
#include "../lib/mem.h"
732
#endif
6058 leency 733
 
734
#ifndef INCLUDE_DEBUG_H
735
#include "../lib/debug.h"
736
#endif