Subversion Repositories Kolibri OS

Rev

Rev 1006 | 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
 
1768 clevermous 21
struct system_colors{
22
	dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph;
23
	void get();
24
};
25
void system_colors::get()
26
{
27
	EAX = 48;
28
	EBX = 3;
29
	ECX = #frame;
30
	EDX = 40;
31
	$int	0x40
32
}
1003 leency 33
 
34
inline fastcall dword WaitEvent(){
35
 EAX = 10;              // wait here for event
36
 $int 0x40
37
}
38
 
39
 
40
inline fastcall void ExitProcess(){
41
 EAX = -1;              // close this program
42
 $int 0x40
43
}
44
 
1768 clevermous 45
inline fastcall byte GetKey(){
1003 leency 46
 EAX = 2;              // just read it key from buffer
47
 $int  0x40
48
 EAX = EAX >> 8;
49
}
50
 
1768 clevermous 51
inline fastcall byte GetButtonID(){
1003 leency 52
 EAX = 17;            // Get ID
53
 $int  0x40
54
 EAX = EAX >> 8;
55
}
56
 
57
inline fastcall dword GetSkinWidth()
58
{
59
	EAX = 48;
60
	EBX = 4;
61
	$int 0x40
62
}
63
 
64
inline fastcall void DeleteButton(dword EDX)
65
{
66
	EAX = 8;
67
	EDX += BT_DEL;
68
	$int 0x40;
69
}
70
 
71
 
72
inline fastcall void WindowRedrawStatus(dword EBX){
73
	EAX = 12;
74
	$int 0x40
75
}
76
 
77
 
78
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
79
{
1768 clevermous 80
 	EAX = 0;
1003 leency 81
	EBX = x << 16 + sizeX;
82
	ECX = y << 16 + sizeY;
83
	EDX = mainAreaType << 24 | mainAreaColour;
84
	ESI = headerType << 24 | headerColour;
85
	$int 0x40
86
}
87
 
88
void DefineButton(dword x,y,w,h,EDX,ESI)
89
{
90
 	EAX = 8;
91
	EBX = x<<16+w;
1006 leency 92
	ECX = y<<16+h;
1003 leency 93
 	$int 0x40
94
}
95
 
96
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
97
{
98
	EAX = 4;
1006 leency 99
	EBX = x<<16+y;
1003 leency 100
	ECX = fontType<<24+color;
101
	$int 0x40;
102
}
103
 
104
 
105
void DrawBar(dword x,y,w,h,EDX)
106
{
107
	EAX = 13;
108
	EBX = x<<16+w;
1006 leency 109
	ECX = y<<16+h;
1003 leency 110
 	$int 0x40
111
}
112
 
113
 
1006 leency 114
void PutImage(dword EBX,w,h,x,y)
1003 leency 115
{
116
	EAX = 7;
117
	ECX = w<<16+h;
1006 leency 118
	EDX = x<<16+y;
1003 leency 119
	$int 0x40
120
}
121
 
122
 
123
void copystr(dword s,d)
124
{
125
	$mov esi,s
126
	$mov edi,d
127
	$cld
128
l1:
129
	$lodsb
130
	$stosb
131
	$test al,al
132
	$jnz l1
133
}
134
 
1006 leency 135
void WriteNumber(dword x,y,byte fontType, ESI, ECX)
1003 leency 136
{
1006 leency 137
	EAX = 47;
138
	EBX = 2<<16;
139
	EDX = x<<16+y;
140
	ESI = fontType<<24+ESI;
141
	$int 0x40;
142
}