Subversion Repositories Kolibri OS

Rev

Rev 903 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 903 Rev 935
Line 10... Line 10...
10
dword  alloc_mem    = 0x00100000;
10
dword  alloc_mem    = 0x00100000;
11
dword  x86esp_reg   = 0x00100000;   // 0x0007fff0; 
11
dword  x86esp_reg   = 0x00100000;   // 0x0007fff0; 
12
dword  I_Param      = #param;
12
dword  I_Param      = #param;
13
dword  I_Icon       = 0x0;
13
dword  I_Icon       = 0x0;
14
dword	skin_width;
14
dword  skin_width;
15
 
-
 
16
char param[256]="";
15
char param[256]="";
Line 17... Line 16...
17
 
16
 
18
//Events
17
//Events
19
#define evMouse	6
18
#define evMouse		6
Line 119... Line 118...
119
inline fastcall dword WaitEvent(){
118
inline fastcall dword WaitEvent(){
120
 EAX = 10;              // wait here for event
119
 EAX = 10;              // wait here for event
121
 $int 0x40
120
 $int 0x40
122
}
121
}
Line 123... Line 122...
123
 
122
 
-
 
123
/*inline fastcall void SetEventMask(dword EBX){
124
inline fastcall void ExitProcess(){
124
	$mov eax,40
125
 EAX = -1;              // close this program
125
	//$mov ebx,100111b
126
 $int 0x40
126
	$int 0x40
Line 127... Line 127...
127
}
127
}*/
128
 
128
 
129
inline fastcall word GetKey(){
129
inline fastcall word GetKey(){
130
 EAX = 2;              // just read this key from buffer
130
 EAX = 2;              // just read this key from buffer
Line 136... Line 136...
136
 EAX = 17;            // Get ID
136
 EAX = 17;            // Get ID
137
 $int  0x40
137
 $int  0x40
138
 EAX = EAX >> 8;
138
 EAX = EAX >> 8;
139
}
139
}
Line -... Line 140...
-
 
140
 
-
 
141
inline fastcall void ExitProcess(){
-
 
142
 EAX = -1;            // close this program
-
 
143
 $int 0x40
Line 140... Line 144...
140
 
144
}
-
 
145
 
-
 
146
/*void Pause(dword EBX)
-
 
147
{					// ã§ , ¢ á®âëå ¤®«ïå ᥪ㭤ë EBX = value
-
 
148
	$mov eax, 5
-
 
149
	$int 0x40
-
 
150
}*/
-
 
151
 
-
 
152
//------------------------------------------------------------------------------
141
 
153
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword
-
 
154
	mainAreaColor,byte headerType,dword headerColor,EDI)
-
 
155
{
-
 
156
	EBX = x << 16 + sizeX;
-
 
157
	ECX = y << 16 + sizeY;
-
 
158
	EDX = mainAreaType << 24 | mainAreaColor;
-
 
159
	ESI = headerType << 24 | headerColor;
-
 
160
	$xor eax,eax
-
 
161
	$int 0x40
-
 
162
}
142
inline fastcall void DrawTitle(dword ECX)
163
 
143
{
164
inline fastcall void DrawTitle(dword ECX){
144
	EAX = 71;
165
	EAX = 71;
145
	EBX = 1;
166
	EBX = 1;
Line -... Line 167...
-
 
167
	$int 0x40;
146
	$int 0x40;
168
}
-
 
169
 
-
 
170
 
147
}
171
inline fastcall void WindowRedrawStatus(dword EBX){
-
 
172
	EAX = 12;              //tell os about windowdraw
-
 
173
	$int 0x40
148
 
174
}
149
inline fastcall dword GetSkinWidth()
175
 
150
{
176
inline fastcall dword GetSkinWidth(){
151
	EAX = 48;
177
	EAX = 48;
Line 152... Line -...
152
	EBX = 4;
-
 
153
	$int 0x40
178
	EBX = 4;
154
}
-
 
155
 
179
	$int 0x40
156
 
-
 
157
inline fastcall void DeleteButton(dword EDX)
180
}
158
{
181
 
Line -... Line 182...
-
 
182
inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI){
Line 159... Line 183...
159
	EAX = 8;
183
	EAX = 67;
160
	EDX = EDX + BT_DEL;
-
 
161
	$int 0x40;
-
 
162
}
184
	$int 0x40
163
 
185
}
164
 
186
 
165
inline fastcall dword strlen(dword EDI)
187
//------------------------------------------------------------------------------
-
 
188
 
-
 
189
inline fastcall dword strlen(dword EDI){
-
 
190
	ECX=EAX=0;
-
 
191
	ECX--;
-
 
192
	$REPNE $SCASB
-
 
193
	EAX-=2+ECX;
-
 
194
}
166
{
195
 
-
 
196
 
-
 
197
inline fastcall copystr(dword ESI,EDI)
-
 
198
{
-
 
199
	$cld
-
 
200
l1:
-
 
201
	$lodsb
-
 
202
	$stosb
-
 
203
	$test al,al
-
 
204
	$jnz l1
-
 
205
}
-
 
206
 
-
 
207
 
-
 
208
char buffer[11]="";
-
 
209
inline fastcall dword IntToStr(dword ESI)
-
 
210
{
-
 
211
     $mov     edi, #buffer
-
 
212
     $mov     ecx, 10
-
 
213
     $test     esi, esi
-
 
214
     $jns     f1
-
 
215
     $mov     al, '-'
-
 
216
     $stosb
-
 
217
     $neg     esi
-
 
218
f1:
-
 
219
     $mov     eax, esi
-
 
220
     $push     -'0'
-
 
221
f2:
-
 
222
     $xor     edx, edx
-
 
223
     $div     ecx
-
 
224
     $push     edx
-
 
225
     $test     eax, eax
-
 
226
     $jnz     f2
-
 
227
f3:
167
#speed
228
     $pop     eax
Line 168... Line 229...
168
	ECX=EAX=0;
229
     $add     al, '0'
169
	ECX--;
230
     $stosb
Line 204... Line 265...
204
		EDX++;
265
		EDX++;
205
	}while(AL!=0);
266
	}while(AL!=0);
206
#codesize
267
	#codesize
207
}
268
}
Line 208... Line -...
208
 
-
 
-
 
269
 
209
 
270
//------------------------------------------------------------------------------
210
inline fastcall void WindowRedrawStatus(dword EBX)
-
 
211
{
-
 
212
	EAX = 12;              // function 12:tell os about windowdraw
271
inline fastcall void PutPixel(dword EBX,ECX,EDX){
213
	$int 0x40
-
 
214
}
-
 
215
 
-
 
216
 
-
 
217
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
-
 
218
{
-
 
219
	EBX = x << 16 + sizeX;
272
  EAX=1;
220
	ECX = y << 16 + sizeY;
-
 
221
	EDX = mainAreaType << 24 | mainAreaColour;
-
 
222
	ESI = headerType << 24 | headerColour;
-
 
223
	$xor eax,eax
273
  ECX+=skin_width;
224
	$int 0x40
274
  $int 0x40
Line 225... Line -...
225
}
-
 
226
 
275
}
227
 
276
 
228
inline fastcall void SetEventMask(dword EBX,ECX,EDX) //Coded by Leency :D
277
void DefineButton(dword x,y,w,h,EDX,ESI){
229
{
278
	EAX = 8;
230
	$mov eax,40
279
	EBX = x<<16+w;
231
	$mov ebx,100111b
280
	ECX = skin_width+y<<16+h;
Line 232... Line 281...
232
	$int 0x40
281
	$int 0x40
233
}
282
}
234
 
283
 
235
void DefineButton(dword x,y,w,h,EDX,ESI)
284
inline fastcall void DeleteButton(dword EDX)
236
{
-
 
237
	EAX = 8;
285
{
238
	EBX = x<<16+w;
286
	EAX = 8;
Line 239... Line 287...
239
	ECX = skin_width+y<<16+h;
287
	EDX += BT_DEL;
240
	$int 0x40
288
	$int 0x40;
241
}
289
}
242
 
290
 
243
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
291
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
244
{
292
{
245
	EAX = 4;
293
	EAX = 4;
Line 246... Line -...
246
	EBX = x<<16+skin_width+y;
-
 
247
	ECX = fontType<<24+color;
-
 
248
	$int 0x40;
-
 
249
}
-
 
250
 
-
 
251
inline fastcall void PutPixel(dword EBX,ECX,EDX)
-
 
252
{
294
	EBX = x<<16+skin_width+y;
253
  EAX=1;
295
	ECX = fontType<<24+color;
254
  $int 0x40
296
	$int 0x40;
255
}
297
}
256
 
298
 
Line 278... Line 320...
278
	DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //¯®«®á  £®à ¡¥« ï
320
	DrawBar(x+1,y+1,width-1,1,0xFFFFFF); //¯®«®á  £®à ¡¥« ï
279
	DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //¢¥­¬ ¢¥à¢
321
	DrawBar(x+1,y+height-1,width-2,1,0xC7C7C7); //¢¥­¬ ¢¥à¢
280
	DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //¯®«®á  ¢¥à¢ ¡¥« ¯
322
	DrawBar(x+1,y+1,1,height-1,0xFFFFFF); //¯®«®á  ¢¥à¢ ¡¥« ¯
281
	DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //¢¥­¬ ¢¥à¢
323
	DrawBar(x+width-1,y+2,1,height-2,0xC7C7C7); //¢¥­¬ ¢¥à¢
282
	DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
324
	DrawBar(x+2,y+2,width-3,height-3,color); //§ «¨¢ª 
283
	IF (id<>0)	DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //®¯à¥¤¥«¯¥¬ ª­®¯ª£
325
	IF (id<>0)	DefineButton(x,y,width,height,id+BT_HIDE,0xEFEBEF); //ª­®¯ª 
284
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
326
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
285
}
327
}
Line 286... Line -...
286
 
-
 
287
 
328
 
288
void PutImage(dword EBX,w,h,x,y)
329
void PutImage(dword EBX,w,h,x,y)
289
{
330
{
290
	EAX = 7;
331
	EAX = 7;
291
	ECX = w<<16+h;
332
	ECX = w<<16+h;
292
	EDX = x<<16+y+skin_width;
333
	EDX = x<<16+y+skin_width;
293
	$int 0x40
334
	$int 0x40
Line 294... Line -...
294
}
-
 
295
 
-
 
296
 
-
 
297
void copystr(dword s,d)
-
 
298
{
-
 
299
	$mov esi,s
-
 
300
	$mov edi,d
-
 
301
	$cld
-
 
302
l1:
-
 
303
	$lodsb
-
 
304
	$stosb
-
 
305
	$test al,al
-
 
306
	$jnz l1
-
 
307
}
-
 
308
 
-
 
309
 
-
 
310
int	 j=0;
335
}
311
char buffer[11]="";
336
 
312
inline fastcall dword IntToStr(dword ESI)
-
 
313
{
-
 
314
     $mov     edi, #buffer
-
 
315
     $mov     ecx, 10
-
 
316
     $test     esi, esi
-
 
317
     $jns     f1
337
void PutPaletteImage(dword EBX,w,h,x,y, EDI)
318
     $mov     al, '-'
-
 
319
     $stosb
-
 
320
     $neg     esi
-
 
321
f1:
-
 
322
     $mov     eax, esi
-
 
323
     $push     -'0'
-
 
324
f2:
-
 
325
     $xor     edx, edx
-
 
326
     $div     ecx
-
 
327
     $push     edx
-
 
328
     $test     eax, eax
-
 
329
     $jnz     f2
-
 
330
f3:
-
 
331
     $pop     eax
-
 
332
     $add     al, '0'
338
{
333
     $stosb
339
	EAX = 65;
334
     $jnz     f3
340
	ECX = w<<16+h;
335
     $mov     eax, #buffer
-
 
336
     $ret
-
 
337
}
-
 
338
 
-
 
339
 
-
 
340
inline fastcall dword MoveSize(dword EBX,ECX,EDX,ESI)
341
	EDX = x<<16+y+skin_width;
341
{
342
	ESI = 8;
342
	EAX = 67;
343
	EBP = 0;
Line -... Line 344...
-
 
344
	$int 0x40
Line 343... Line 345...
343
	$int 0x40
345
}  
344
}
346
 
345
 
347
//------------------------------------------------------------------------------
346
 
348
 
Line 358... Line 360...
358
	CopyFile_f.name = s;
360
	CopyFile_f.name = s;
359
	$mov	eax, 70
361
	$mov	eax, 70
360
	$mov	ebx, #CopyFile_f
362
	$mov	ebx, #CopyFile_f
361
	$int	0x40
363
	$int	0x40
Line 362... Line 364...
362
	
364
	
363
	if (EAX == 0)
365
	if (!EAX)
364
	{	
366
	{	
365
		cBufer = malloc(CopyFile_atr.sizelo);	
367
		cBufer = malloc(CopyFile_atr.sizelo);	
366
		CopyFile_f.func = 0;
368
		CopyFile_f.func = 0;
367
		CopyFile_f.param1 = 0;
369
		CopyFile_f.param1 = 0;
Line 372... Line 374...
372
		CopyFile_f.name = s;
374
		CopyFile_f.name = s;
373
		$mov	eax, 70
375
		$mov	eax, 70
374
		$mov	ebx, #CopyFile_f
376
		$mov	ebx, #CopyFile_f
375
		$int	0x40
377
		$int	0x40
Line 376... Line 378...
376
	
378
	
377
		IF (EAX == 0)
379
		IF (!EAX)
378
		{
380
		{
379
			CopyFile_f.func = 2;
381
			CopyFile_f.func = 2;
380
			CopyFile_f.param1 = 0;
382
			CopyFile_f.param1 = 0;
381
			CopyFile_f.param2 = 0;
383
			CopyFile_f.param2 = 0;