Subversion Repositories Kolibri OS

Rev

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