Subversion Repositories Kolibri OS

Rev

Rev 5779 | Rev 5933 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. //CODED by Veliant, Leency, Nable. GNU GPL licence.
  2. #ifndef INCLUDE_KOLIBRI_H
  3. #define INCLUDE_KOLIBRI_H
  4. #print "[include <kolibri.h>]\n"
  5.  
  6. #pragma option OST
  7. #pragma option ON
  8. #pragma option cri-
  9. #pragma option -CPA
  10. #initallvar 0
  11. #jumptomain FALSE
  12.  
  13. #startaddress 0
  14.  
  15. #code32 TRUE
  16.  
  17. char   os_name[8]   = {'M','E','N','U','E','T','0','1'};
  18. dword  os_version   = 0x00000001;
  19. dword  start_addr   = #______INIT______;
  20. dword  final_addr   = #______STOP______+32;
  21. dword  alloc_mem    = MEMSIZE;
  22. dword  x86esp_reg   = MEMSIZE;
  23. dword  I_Param      = #param;
  24. dword  I_Path       = #program_path;
  25. char param[4096];
  26. char program_path[4096];
  27.  
  28. #define NULL      0
  29. #define OLD      -1
  30. #define true      1
  31. #define false     0
  32.  
  33. //Events
  34.  
  35. #define evReDraw  1
  36. #define evKey     2
  37. #define evButton  3
  38. #define evDesktop 5
  39. #define evMouse   6
  40. #define evIPC     7
  41. #define evNetwork 8
  42. #define evDebug   9
  43.  
  44. #define EVENT_MOUSE case 6: mouse.get();
  45.  
  46. //Button options
  47. #define BT_DEL      0x80000000
  48. #define BT_HIDE     0x40000000
  49. #define BT_NOFRAME  0x20000000
  50.  
  51. //ASCII KEYS
  52. #define ASCII_KEY_BS    008
  53. #define ASCII_KEY_TAB   009
  54. #define ASCII_KEY_ENTER 013
  55. #define ASCII_KEY_ESC   027
  56. #define ASCII_KEY_DEL   182
  57. #define ASCII_KEY_INS   185
  58. #define ASCII_KEY_SPACE 032
  59.  
  60. #define ASCII_KEY_LEFT  176
  61. #define ASCII_KEY_RIGHT 179
  62. #define ASCII_KEY_DOWN  177
  63. #define ASCII_KEY_UP    178
  64. #define ASCII_KEY_HOME  180
  65. #define ASCII_KEY_END   181
  66. #define ASCII_KEY_PGDN  183
  67. #define ASCII_KEY_PGUP  184
  68.  
  69. //SCAN CODE KEYS
  70. #define SCAN_CODE_BS    014
  71. #define SCAN_CODE_TAB   015
  72. #define SCAN_CODE_ENTER 028
  73. #define SCAN_CODE_ESC   001
  74. #define SCAN_CODE_DEL   083
  75. #define SCAN_CODE_INS   082
  76. #define SCAN_CODE_SPACE 057
  77.            
  78. #define SCAN_CODE_LEFT  075
  79. #define SCAN_CODE_RIGHT 077
  80. #define SCAN_CODE_DOWN  080
  81. #define SCAN_CODE_UP    072
  82. #define SCAN_CODE_HOME  071
  83. #define SCAN_CODE_END   079
  84. #define SCAN_CODE_PGDN  081
  85. #define SCAN_CODE_PGUP  073
  86.  
  87. #define KEY_LSHIFT     00000000001b
  88. #define KEY_RSHIFT     00000000010b
  89. #define KEY_LCTRL      00000000100b
  90. #define KEY_RCTRL      00000001000b
  91. #define KEY_LALT       00000010000b
  92. #define KEY_RALT       00000100000b
  93. #define KEY_CAPSLOCK   00001000000b
  94. #define KEY_NUMLOCK    00010000000b
  95. #define KEY_SCROLLLOCK 00100000000b
  96. #define KEY_LWIN       01000000000b
  97. #define KEY_RWIN       10000000000b
  98.  
  99.  
  100. inline fastcall word GetKey()  //+Gluk fix
  101. {
  102.                 $push edx
  103. GETKEY:
  104.                 $mov  eax,2
  105.                 $int  0x40
  106.                 $cmp eax,1
  107.                 $jne GETKEYI
  108.                 $mov ah,dh
  109.                 $jmp GETKEYII //jz?
  110. GETKEYI:
  111.                 $mov dh,ah
  112.                 $jmp GETKEY
  113. GETKEYII:
  114.                 $pop edx
  115.                 $shr eax,8
  116. }
  117.  
  118.  
  119. unsigned char key_ascii;
  120. dword key_scancode, key_modifier;
  121. int GetKeys()
  122. {
  123.                 $push edx
  124. GETKEY:
  125.                 $mov  eax,2
  126.                 $int  0x40
  127.                 $cmp eax,1
  128.                 $jne GETKEYI
  129.                 $mov eax,edx
  130.                 $jmp GETKEYII
  131. GETKEYI:
  132.                 $mov edx,eax
  133.                 $jmp GETKEY
  134. GETKEYII:
  135.                 $pop edx
  136.         key_ascii = AH;
  137.         $shr  eax,16
  138.         key_scancode = AL;
  139.         //get alt/shift/ctrl key status
  140.         $mov eax,66
  141.         $mov ebx,3
  142.         $int 0x40
  143.         key_modifier = EAX;
  144. }
  145.  
  146. //allow event mask
  147. #define EVENT_MASK_REDRAW   000000001b
  148. #define EVENT_MASK_KEYBOARD 000000010b
  149. #define EVENT_MASK_BUTTONS  000000100b
  150. #define EVENT_MASK_DESKTOP  000010000b
  151. #define EVENT_MASK_MOUSE    000100000b
  152. #define EVENT_MASK_IPC      001000000b
  153. #define EVENT_MASK_NETWORK  010000000b
  154. #define EVENT_MASK_DEBUG    100000000b
  155.  
  156. //ARGS FUNCTION
  157. #define END_ARGS 0xFF00FF
  158. //-------------------------------------------------------------------------
  159.  
  160. #ifndef INCLUDE_SYSTEM_H
  161. #include "../lib/system.h"
  162. #endif
  163.  
  164. #ifndef INCLUDE_MOUSE_H
  165. #include "../lib/mouse.h"
  166. #endif
  167.  
  168. :struct raw_image {
  169.         dword w, h, data;
  170. };
  171.  
  172.  
  173.  
  174. //------------------------------------------------------------------------------
  175. :dword wait_event_code;
  176. inline fastcall dword WaitEvent()
  177. {
  178.         $mov eax,10
  179.         $int 0x40
  180.         wait_event_code = EAX;
  181.         //if(wait_event_code==evMouse) MOUSE.get();
  182.         //return wait_event_code;
  183. }
  184.  
  185. inline fastcall dword CheckEvent()
  186. {
  187.         $mov eax,11
  188.         $int 0x40
  189. }
  190.  
  191. inline fastcall dword WaitEventTimeout(EBX)
  192. {
  193.         $mov eax,23
  194.         $int 0x40
  195. }
  196.  
  197. inline fastcall SetEventMask(EBX)
  198. {
  199.         $mov eax,40
  200.         $int 0x40
  201. }
  202.  
  203.  
  204. inline fastcall pause(EBX)
  205. {
  206.         $mov eax, 5
  207.         $int 0x40
  208. }
  209.  
  210. inline fastcall word GetButtonID()
  211. {
  212.         $mov eax,17
  213.         $int  0x40
  214.         $shr eax,8
  215. }
  216.  
  217. inline fastcall dword GetFreeRAM()
  218. {
  219.         $mov eax, 18
  220.         $mov ebx, 16
  221.         $int 0x40
  222.         //return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
  223. }
  224.  
  225. inline void draw_line(dword x1,y1,x2,y2,color)
  226. {
  227.         x2--;y2--;y1--;
  228.         $mov EAX,38
  229.         EBX = x1<<16;
  230.         EBX |= x2;
  231.         ECX = y1<<16;
  232.         ECX |= y2;
  233.         $mov EDX,color
  234.         $int 0x40
  235. }
  236.  
  237. inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
  238. {
  239.         $mov eax, 68
  240.         $mov ebx, 16
  241.         $int 0x40
  242.         //return 0 - íåóäà÷à, èíà÷å eax = õýíäë äðàéâåðà
  243. }
  244.  
  245. inline fastcall dword RuleDriver(ECX) //óêàçàòåëü íà óïðàâëÿþùóþ ñòðóêòóðó
  246. {
  247.         $mov eax, 68
  248.         $mov ebx, 17
  249.         $int 0x40
  250.         //return eax = îïðåäåëÿåòñÿ äðàéâåðîì
  251. }
  252.  
  253. struct proc_info
  254. {
  255.         #define SelfInfo -1
  256.         dword   use_cpu;
  257.         word    pos_in_stack,num_slot,rezerv1;
  258.         unsigned char name[11];
  259.         char    rezerv2;
  260.         dword   adress,use_memory,ID,left,top,width,height;
  261.         word    status_slot,rezerv3;
  262.         dword   work_left,work_top,work_width,work_height;
  263.         char    status_window;
  264.         dword   cwidth,cheight;
  265.         byte    reserved[1024-71-8];
  266. };
  267.  
  268. inline fastcall void GetProcessInfo(EBX, ECX)
  269. {
  270.         $mov eax,9;
  271.         $int  0x40
  272.         DSDWORD[EBX+71] = DSDWORD[EBX+42] - 9; //set cwidth
  273.         DSDWORD[EBX+75] = DSDWORD[EBX+46] - GetSkinHeight() - 4; //set cheight
  274. }
  275.  
  276. inline fastcall int GetPointOwner( EBX, ECX) //ebx=m.x, ecx=m.y
  277. {
  278.         $mov eax,34
  279.         $int 0x40
  280. }
  281.  
  282. inline fastcall int GetProcessSlot( ECX)
  283. {
  284.         EAX = 18;
  285.         EBX = 21;
  286.         $int 0x40
  287. }
  288.  
  289. inline fastcall int GetActiveProcess()
  290. {
  291.         EAX = 18;
  292.         EBX = 7;
  293.         $int 0x40
  294. }
  295.  
  296. :int CheckActiveProcess(int Form_ID)
  297. {
  298.         int id9=GetProcessSlot(Form_ID);
  299.         if (id9==GetActiveProcess()) return 1;
  300.         return 0;
  301. }
  302.  
  303. inline fastcall void ActivateWindow( ECX)
  304. {
  305.         EAX = 18;
  306.         EBX = 3;
  307.         $int 0x40
  308. }
  309.  
  310. inline fastcall int MinimizeWindow()
  311. {
  312.         EAX = 18;
  313.         EBX = 10;
  314.         $int 0x40
  315. }
  316.  
  317. inline fastcall int CreateThread(ECX,EDX)
  318. {
  319.         $mov eax,51
  320.         $mov ebx,1
  321.         $int 0x40
  322. }
  323.  
  324. inline fastcall void SwitchToAnotherThread()
  325. {
  326.         $mov eax,68
  327.         $mov ebx,1
  328.         $int 0x40
  329. }
  330.  
  331. inline fastcall int SendWindowMessage( ECX, EDX)
  332. {
  333.         $mov eax, 72
  334.         $mov ebx, 1
  335.         $int 0x40
  336. }
  337.  
  338. inline fastcall int KillProcess( ECX)
  339. {
  340.         $mov eax,18;
  341.         $mov ebx,18;
  342.         $int 0x40
  343. }
  344.  
  345. #define TURN_OFF 2
  346. #define REBOOT 3
  347. #define KERNEL 4
  348. inline fastcall int ExitSystem( ECX)
  349. {
  350.         $mov eax, 18
  351.         $mov ebx, 9
  352.         $int 0x40
  353. }
  354.  
  355. inline fastcall ExitProcess()
  356. {
  357.         $mov eax,-1;
  358.         $int 0x40
  359. }
  360.  
  361. //------------------------------------------------------------------------------
  362.  
  363. //eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
  364. inline fastcall int GetSystemLanguage()
  365. {
  366.         EAX = 26;
  367.         EBX = 5;
  368.         $int 0x40
  369. }
  370.  
  371. inline fastcall GetSkinHeight()
  372. {
  373.         $push ebx
  374.         $mov  eax,48
  375.         $mov  ebx,4
  376.         $int 0x40
  377.         $pop  ebx
  378. }
  379.  
  380. inline fastcall void SetSystemSkin( ECX)
  381. {
  382.         EAX = 48;
  383.         EBX = 8;
  384.         $int 0x40
  385. }
  386.  
  387. inline fastcall int GetScreenWidth()
  388. {
  389.         $mov eax, 14
  390.         $int 0x40
  391.         $shr eax, 16
  392. }
  393.  
  394. inline fastcall int GetScreenHeight()
  395. {
  396.         $mov eax, 14
  397.         $int 0x40
  398.         $and eax,0x0000FFFF
  399. }
  400.  
  401. inline fastcall int GetClientTop()
  402. {
  403.         $mov eax, 48
  404.         $mov ebx, 5
  405.         $int 0x40
  406.     $mov eax, ebx
  407.     $shr eax, 16
  408. }
  409.  
  410. inline fastcall int GetClientHeight()
  411. {
  412.         $mov eax, 48
  413.         $mov ebx, 5
  414.         $int 0x40
  415.     $mov eax, ebx
  416. }
  417.  
  418.  
  419. inline fastcall dword LoadLibrary( ECX)
  420. {
  421.         $mov eax, 68
  422.         $mov ebx, 19
  423.         $int  0x40
  424. }
  425.  
  426. inline fastcall int TestBit( EAX, CL)
  427. {
  428.         $shr eax,cl
  429.         $and eax,1
  430. }
  431.  
  432. inline fastcall int PlaySpeaker( ESI)
  433. {
  434.         $mov eax, 55
  435.         $mov ebx, 55
  436.         $int 0x40
  437. }
  438.  
  439. inline fastcall void debugln( EDX)
  440. {
  441.         $push eax
  442.         $push ebx
  443.         $push ecx
  444.         $mov eax, 63
  445.         $mov ebx, 1
  446. NEXT_CHAR:
  447.         $mov ecx, DSDWORD[edx]
  448.         $or      cl, cl
  449.         $jz  DONE
  450.         $int 0x40
  451.         $inc edx
  452.         $jmp NEXT_CHAR
  453. DONE:
  454.         $mov cl, 13
  455.         $int 0x40
  456.         $mov cl, 10
  457.         $int 0x40
  458.         $pop ecx
  459.         $pop ebx
  460.         $pop eax
  461. }
  462.  
  463. inline fastcall void debug( EDX)
  464. {
  465.         $push eax
  466.         $push ebx
  467.         $push ecx
  468.         $mov eax, 63
  469.         $mov ebx, 1
  470. NEXT_CHAR:
  471.         $mov ecx, DSDWORD[edx]
  472.         $or      cl, cl
  473.         $jz  DONE
  474.         $int 0x40
  475.         $inc edx
  476.         $jmp NEXT_CHAR
  477. DONE:
  478.         $pop ecx
  479.         $pop ebx
  480.         $pop eax
  481. }
  482.  
  483.  
  484. inline fastcall void debugch( ECX)
  485. {
  486.         $push eax
  487.         $push ebx
  488.         $mov eax,63
  489.         $mov ebx,1
  490.         $int 0x40
  491.         $pop ebx
  492.         $pop eax
  493. }
  494. //------------------------------------------------------------------------------
  495.  
  496. void DefineAndDrawWindow(dword x, y, size_w, size_h, byte WindowType,dword WindowAreaColor, EDI, ESI)
  497. {
  498.         EAX = 12;              // function 12:tell os about windowdraw
  499.         EBX = 1;
  500.         $int 0x40
  501.        
  502.         $xor EAX,EAX
  503.         EBX = x << 16 + size_w;
  504.         ECX = y << 16 + size_h;
  505.  
  506.         EDX = WindowType << 24 | WindowAreaColor;
  507.         $int 0x40
  508.  
  509.         EAX = 12;              // function 12:tell os about windowdraw
  510.         EBX = 2;
  511.         $int 0x40
  512. }
  513.  
  514. inline fastcall MoveSize( EBX,ECX,EDX,ESI)
  515. {
  516.         $mov eax, 67
  517.         $int 0x40
  518. }
  519.  
  520. inline fastcall void DrawTitle( ECX)
  521. {
  522.         EAX = 71;
  523.         EBX = 1;
  524.         $int 0x40;
  525. }
  526.  
  527. void WriteTextB(dword x,y,byte fontType, dword color, EDX)
  528. {
  529.         EAX = 4;
  530.         EBX = x<<16+y;
  531.         ECX = fontType<<24+color;
  532.         ESI = 0;
  533.         $int 0x40;
  534.         $add ebx, 1<<16
  535.         $int 0x40
  536. }
  537.  
  538. void WriteText(dword x,y,byte fontType, dword color, EDX)
  539. {
  540.         EAX = 4;
  541.         EBX = x<<16+y;
  542.         ECX = fontType<<24+color;
  543.         $int 0x40;
  544. }
  545.  
  546. dword WriteBufText(dword x,y,byte fontType, dword color, EDX, EDI)
  547. {
  548.         EAX = 4;
  549.         EBX = x<<16+y;
  550.         ECX = fontType<<24+color;
  551.         $int 0x40;
  552. }
  553.  
  554. void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
  555. {
  556.         EAX = 47;
  557.         EBX = count<<16;
  558.         EDX = x<<16+y;
  559.         ESI = fontType<<24+color;
  560.         $int 0x40;
  561. }
  562.  
  563. void CopyScreen(dword EBX, x, y, w, h)
  564. {
  565.   EAX = 36;
  566.   ECX = w << 16 + h;
  567.   EDX = x << 16 + y;
  568.   $int  0x40;
  569. }
  570.  
  571. :dword GetPixelColor(dword x, x_size, y)
  572. {
  573.         $mov eax, 35
  574.         EBX= y*x_size+x;
  575.         $int 0x40
  576. }
  577.  
  578.  
  579. void _PutImage(dword x,y, w,h, EBX)
  580. {
  581.         EAX = 7;
  582.         ECX = w<<16+h;
  583.         EDX = x<<16+y;
  584.         $int 0x40
  585. }
  586.  
  587. void PutPaletteImage(dword EBX,w,h,x,y,ESI,EDI)
  588. {
  589.         EAX = 65;
  590.         ECX = w<<16+h;
  591.         EDX = x<<16+y;
  592.         EBP = 0;
  593.         $int 0x40
  594. }
  595.  
  596. inline fastcall void PutPixel( EBX,ECX,EDX)
  597. {
  598.   EAX=1;
  599.   $int 0x40
  600. }
  601.  
  602. void DrawBar(dword x,y,w,h,EDX)
  603. {
  604.         if (h<=0) || (h>60000) || (w<=0) || (w>60000) return; //bad boy :)
  605.         EAX = 13;
  606.         EBX = x<<16+w;
  607.         ECX = y<<16+h;
  608.         $int 0x40
  609. }
  610.  
  611. void DefineButton(dword x,y,w,h,EDX,ESI)
  612. {
  613.         EAX = 8;
  614.         $push edx
  615.         EDX += BT_DEL;
  616.         $int 0x40;
  617.         $pop edx
  618.         EBX = x<<16+w;
  619.         ECX = y<<16+h;
  620.         $int 0x40
  621. }
  622.  
  623. inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
  624. {
  625.         EAX = 18;
  626.         EBX = 22;
  627.         ECX = 3;
  628.         EDX = ID_REFRESH;
  629.         $int 0x40
  630.         EAX = 18;
  631.         EBX = 3;
  632.         EDX = ID_ACTIVE;
  633.         $int 0x40
  634. }
  635.  
  636. inline getIPC(ECX,EDX)
  637. {
  638.         $mov EAX,60
  639.         $mov EBX,2
  640.         $int 0x40
  641. }
  642.  
  643. inline sendIPC(ECX,EDX,ESI)
  644. {
  645.         $mov EAX,60
  646.         $mov EBX,1
  647.         $int 0x40
  648. }
  649.  
  650. void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
  651. {
  652.         EAX = 8;
  653.         EBX = x<<16+w;
  654.         ECX = y<<16+h;
  655.         $int 0x40
  656. }
  657.  
  658. inline fastcall void DeleteButton( EDX)
  659. {
  660.         EAX = 8;
  661.         EDX += BT_DEL;
  662.         $int 0x40
  663. }
  664.  
  665. inline fastcall dword GetStartTime()
  666. {
  667.         $mov eax,26
  668.         $mov ebx,9
  669.         $int 0x40
  670. }
  671.  
  672. :dword X_EventRedrawWindow,Y_EventRedrawWindow;
  673. :void _EventRedrawWindow()
  674. {
  675.         loop()switch(WaitEvent())
  676.         {
  677.                 case evReDraw:
  678.                         DefineAndDrawWindow(X_EventRedrawWindow,Y_EventRedrawWindow,100,1,1,0x34,0xFFFFFF,"");
  679.                         pause(10);
  680.                         ExitProcess();
  681.                         break;
  682.         }
  683. }
  684. :char REDRAW_BUFF_EVENT_[4096];
  685. :void EventRedrawWindow(dword x,y)
  686. {
  687.         X_EventRedrawWindow = x;
  688.         Y_EventRedrawWindow = y;
  689.         CreateThread(#_EventRedrawWindow,#REDRAW_BUFF_EVENT_+4092);
  690. }
  691.  
  692. :dword ALERT_TEXT;
  693. :void dialog_alert()
  694. {
  695.         byte id;
  696.         loop()switch(WaitEvent())
  697.         {
  698.                 case evReDraw:
  699.                         DefineAndDrawWindow(215,100,250,200,0x34,0xFFFFFF,"Alert");
  700.                         WriteTextB(5,5,0x90,0x0,ALERT_TEXT);
  701.                 break;
  702.                 case evKey:
  703.                 case evButton:
  704.                         id=GetButtonID();
  705.                         if (id==1) ExitProcess();
  706.                 break;
  707.         }
  708. }
  709. :dword alert(dword text)
  710. {
  711.         dword mem = malloc(4096);
  712.         ALERT_TEXT = text;
  713.         CreateThread(#dialog_alert,mem+4092);
  714.         return mem;
  715. }
  716.  
  717. :struct _screen
  718. {
  719.         dword width,height;
  720. } screen;
  721.  
  722. :struct _skin
  723. {
  724.         dword width,height;
  725. } SKIN;
  726.  
  727. :void DrawDate(dword x, y, color, in_date)
  728. {
  729.         //char text[15];
  730.         EDI = in_date;
  731.         EAX = 47;
  732.         EBX = 2<<16;
  733.         EDX = x<<16+y;
  734.         ESI = 0x80<<24+color;
  735.         ECX = EDI.date.day;
  736.         $int 0x40;
  737.         EDX += 18<<16;
  738.         ECX = EDI.date.month;
  739.         $int 0x40;
  740.         EDX += 18<<16;
  741.         EBX = 4<<16;
  742.         ECX = EDI.date.year;
  743.         $int 0x40;
  744.         PutPixel(x+14,y+6,color);
  745.         PutPixel(x+32,y+6,color);
  746.         //sprintf(#text,"%d",EDI.date.year);
  747.         //WriteText(x, y, 0x80, 0x000000, #text);
  748. }
  749.  
  750. :void __path_name__(dword BUF,PATH)
  751. {
  752.         dword beg = PATH;
  753.         dword pos = PATH;
  754.         dword sav = PATH;
  755.         dword i;
  756.         while(DSBYTE[pos])
  757.         {
  758.                 if(DSBYTE[pos]=='/')sav = pos;
  759.                 pos++;
  760.         }
  761.         i = sav-beg;
  762.         while(i)
  763.         {
  764.                 DSBYTE[BUF] = DSBYTE[beg];
  765.                 beg++;
  766.                 BUF++;
  767.                 i--;
  768.         }
  769.         /*while(DSBYTE[beg])
  770.         {
  771.                 DSBYTE[BUF1] = DSBYTE[beg];
  772.                 beg++;
  773.                 BUF1++;
  774.         }*/
  775.         //DSBYTE[BUF1] = 0;
  776.         DSBYTE[BUF] = 0;
  777. }
  778. char __BUF_DIR__[4096];
  779. :struct SELF
  780. {
  781.         dword dir;
  782.         dword file;
  783.         dword path;
  784. } self;
  785.  
  786. dword __generator;  // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
  787.  
  788. :dword program_path_length;
  789.  
  790. //The initialization of the initial data before running
  791. void ______INIT______()
  792. {
  793.         self.dir = #__BUF_DIR__;
  794.         self.file = 0;
  795.         self.path = I_Path;
  796.         __path_name__(#__BUF_DIR__,I_Path);
  797.        
  798.         SKIN.height   = GetSkinHeight();
  799.         screen.width  = GetScreenWidth();
  800.         screen.height = GetScreenHeight();
  801.        
  802.         //program_path_length = strlen(I_Path);
  803.         MOUSE_TIME = 50; //Default 500 ms.
  804.         __generator = GetStartTime();
  805.        
  806.         $push    ebx
  807.         $mov     eax, 68
  808.         $mov     ebx, 11
  809.         $int     0x40
  810.        
  811.         $pop     ebx
  812.  
  813.         main();
  814. }
  815. ______STOP______:
  816. #endif