Subversion Repositories Kolibri OS

Rev

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