Subversion Repositories Kolibri OS

Rev

Rev 1768 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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