Rev 1768 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1003 | leency | 1 | #code32 TRUE |
2 | |||
3 | char os_name[8] = {'M','E','N','U','E','T','0','1'}; |
||
4 | dword os_version = 0x00000001; |
||
5 | dword start_addr = #main; |
||
6 | dword final_addr = #stop+32; |
||
1768 | clevermous | 7 | dword alloc_mem = 0x00004096; |
8 | dword x86esp_reg = 0x00004096; |
||
1003 | leency | 9 | dword I_Param = 0x0; |
10 | dword I_Icon = 0x0; |
||
11 | |||
12 | #define evButton 3 |
||
13 | #define evKey 2 |
||
14 | #define evReDraw 1 |
||
15 | |||
16 | #define BT_DEL 0x80000000 |
||
1768 | clevermous | 17 | #define BT_HIDE 0x40000000 |
1003 | leency | 18 | #define BT_NOFRAME 0x20000000 |
19 | |||
20 | |||
2056 | leency | 21 | struct proc_info{ |
22 | dword use_cpu; |
||
23 | word pos_in_stack,num_slot,rezerv1; |
||
24 | char name[11]; |
||
25 | char rezerv2; |
||
26 | dword adress,use_memory,ID,left,top,width,height; |
||
27 | word status_slot,rezerv3; |
||
28 | dword work_left,work_top,work_width,work_height; |
||
29 | char status_window; |
||
30 | void GetInfo(dword ECX); |
||
31 | byte reserved[1024-71]; |
||
32 | #define SelfInfo -1 |
||
33 | }; |
||
34 | |||
35 | void proc_info::GetInfo(dword ECX) |
||
36 | { |
||
37 | EAX = 9; |
||
38 | EBX = #use_cpu; |
||
39 | $int 0x40 |
||
40 | } |
||
41 | |||
1768 | clevermous | 42 | struct system_colors{ |
43 | dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph; |
||
44 | void get(); |
||
45 | }; |
||
46 | void system_colors::get() |
||
47 | { |
||
48 | EAX = 48; |
||
49 | EBX = 3; |
||
50 | ECX = #frame; |
||
51 | EDX = 40; |
||
52 | $int 0x40 |
||
53 | } |
||
1003 | leency | 54 | |
55 | inline fastcall dword WaitEvent(){ |
||
56 | EAX = 10; // wait here for event |
||
57 | $int 0x40 |
||
58 | } |
||
59 | |||
60 | |||
61 | inline fastcall void ExitProcess(){ |
||
62 | EAX = -1; // close this program |
||
63 | $int 0x40 |
||
64 | } |
||
65 | |||
1768 | clevermous | 66 | inline fastcall byte GetKey(){ |
1003 | leency | 67 | EAX = 2; // just read it key from buffer |
68 | $int 0x40 |
||
69 | EAX = EAX >> 8; |
||
70 | } |
||
71 | |||
1768 | clevermous | 72 | inline fastcall byte GetButtonID(){ |
1003 | leency | 73 | EAX = 17; // Get ID |
74 | $int 0x40 |
||
75 | EAX = EAX >> 8; |
||
76 | } |
||
77 | |||
78 | inline fastcall dword GetSkinWidth() |
||
79 | { |
||
80 | EAX = 48; |
||
81 | EBX = 4; |
||
82 | $int 0x40 |
||
83 | } |
||
84 | |||
2056 | leency | 85 | |
86 | void DefineButton(dword x,y,w,h,EDX,ESI) |
||
87 | { |
||
88 | EAX = 8; |
||
89 | EBX = x<<16+w; |
||
90 | ECX = y<<16+h; |
||
91 | $int 0x40 |
||
92 | } |
||
93 | |||
1003 | leency | 94 | inline fastcall void DeleteButton(dword EDX) |
95 | { |
||
96 | EAX = 8; |
||
97 | EDX += BT_DEL; |
||
98 | $int 0x40; |
||
99 | } |
||
100 | |||
101 | |||
2056 | leency | 102 | |
1003 | leency | 103 | inline fastcall void WindowRedrawStatus(dword EBX){ |
104 | EAX = 12; |
||
105 | $int 0x40 |
||
106 | } |
||
107 | |||
108 | |||
109 | void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI) |
||
110 | { |
||
2056 | leency | 111 | WindowRedrawStatus(1); |
1768 | clevermous | 112 | EAX = 0; |
1003 | leency | 113 | EBX = x << 16 + sizeX; |
114 | ECX = y << 16 + sizeY; |
||
115 | EDX = mainAreaType << 24 | mainAreaColour; |
||
116 | ESI = headerType << 24 | headerColour; |
||
117 | $int 0x40 |
||
2056 | leency | 118 | WindowRedrawStatus(2); |
1003 | leency | 119 | } |
120 | |||
121 | |||
122 | void WriteText(dword x,y,byte fontType, dword color, EDX, ESI) |
||
123 | { |
||
124 | EAX = 4; |
||
1006 | leency | 125 | EBX = x<<16+y; |
1003 | leency | 126 | ECX = fontType<<24+color; |
127 | $int 0x40; |
||
128 | } |
||
129 | |||
130 | |||
131 | void DrawBar(dword x,y,w,h,EDX) |
||
132 | { |
||
133 | EAX = 13; |
||
134 | EBX = x<<16+w; |
||
1006 | leency | 135 | ECX = y<<16+h; |
1003 | leency | 136 | $int 0x40 |
137 | } |
||
138 | |||
139 | |||
1006 | leency | 140 | void PutImage(dword EBX,w,h,x,y) |
1003 | leency | 141 | { |
142 | EAX = 7; |
||
143 | ECX = w<<16+h; |
||
1006 | leency | 144 | EDX = x<<16+y; |
1003 | leency | 145 | $int 0x40 |
146 | } |
||
147 | |||
148 | |||
149 | void copystr(dword s,d) |
||
150 | { |
||
151 | $mov esi,s |
||
152 | $mov edi,d |
||
153 | $cld |
||
154 | l1: |
||
155 | $lodsb |
||
156 | $stosb |
||
157 | $test al,al |
||
158 | $jnz l1 |
||
159 | } |
||
160 | |||
1006 | leency | 161 | void WriteNumber(dword x,y,byte fontType, ESI, ECX) |
1003 | leency | 162 | { |
1006 | leency | 163 | EAX = 47; |
164 | EBX = 2<<16; |
||
165 | EDX = x<<16+y; |
||
166 | ESI = fontType<<24+ESI; |
||
167 | $int 0x40; |
||
168 | }24+ESI; |