Subversion Repositories Kolibri OS

Rev

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

Rev 2814 Rev 2875
1
//CODED by Veliant, Leency 2008-2012. GNU GPL licence.
1
//CODED by Veliant, Leency 2008-2012. GNU GPL licence.
2
 
2
 
3
#startaddress 0
3
#startaddress 0
4
#code32 TRUE
4
#code32 TRUE
5
 
5
 
6
byte   os_name[8]   = {'M','E','N','U','E','T','0','1'};
6
byte   os_name[8]   = {'M','E','N','U','E','T','0','1'};
7
dword  os_version   = 0x00000001;
7
dword  os_version   = 0x00000001;
8
dword  start_addr   = #main;
8
dword  start_addr   = #main;
9
dword  final_addr   = #stop+32;
9
dword  final_addr   = #stop+32;
10
dword  alloc_mem    = 0x00070000;
10
dword  alloc_mem    = 0x00070000;
11
dword  x86esp_reg   = 0x00070000;
11
dword  x86esp_reg   = 0x00070000;
12
dword  I_Param      = #param;
12
dword  I_Param      = #param;
13
dword  I_Path       = #program_path;
13
dword  I_Path       = #program_path;
14
 
14
 
15
char param[4096];
15
char param[4096];
16
char program_path[4096];
16
char program_path[4096];
17
 
17
 
18
 
18
 
19
//Events
19
//Events
20
#define evMouse		6
20
#define evMouse		6
21
#define evButton	3
21
#define evButton	3
22
#define evKey		2
22
#define evKey		2
23
#define evReDraw	1
23
#define evReDraw	1
24
 
24
 
25
//Button options
25
//Button options
26
#define BT_DEL		0x80000000
26
#define BT_DEL		0x80000000
27
#define BT_HIDE		0x40000000
27
#define BT_HIDE		0x40000000
28
#define BT_NOFRAME	0x20000000
28
#define BT_NOFRAME	0x20000000
29
 
29
 
30
#define OLD			-1
30
#define OLD			-1
31
#define true		1
31
#define true		1
32
#define false		0
32
#define false		0
33
 
33
 
34
 
34
 
35
 
35
 
36
struct mouse
36
struct mouse
37
{
37
{
38
	unsigned int x,y,lkm,pkm,hor,vert;
38
	unsigned int x,y,lkm,pkm,hor,vert;
39
	void get();
39
	void get();
40
};
40
};
41
 
41
 
42
inline fastcall int TestBit(EAX, CL)
42
inline fastcall int TestBit(EAX, CL)
43
{
43
{
44
	$shr eax,cl
44
	$shr eax,cl
45
	$and eax,1
45
	$and eax,1
46
}
46
}
47
 
47
 
48
void mouse::get()
48
void mouse::get()
49
{
49
{
50
	EAX = 37;
50
	EAX = 37;
51
	EBX = 1;
51
	EBX = 1;
52
	$int	0x40
52
	$int	0x40
53
	$mov	ebx, eax
53
	$mov	ebx, eax
54
	$shr	eax, 16
54
	$shr	eax, 16
55
	$and	ebx,0x0000FFFF
55
	$and	ebx,0x0000FFFF
56
	x = EAX;
56
	x = EAX;
57
	y = EBX;
57
	y = EBX;
58
	
58
	
59
	EAX = 37;
59
	EAX = 37;
60
	EBX = 2;
60
	EBX = 2;
61
	$int	0x40
61
	$int	0x40
62
	$mov	ebx, eax
62
	$mov	ebx, eax
63
	$and	eax, 0x00000001
63
	$and	eax, 0x00000001
64
	$shr	ebx, 1
64
	$shr	ebx, 1
65
	$and	ebx, 0x00000001
65
	$and	ebx, 0x00000001
66
	lkm = EAX;
66
	lkm = EAX;
67
	pkm = EBX;
67
	pkm = EBX;
68
	
68
	
69
	EAX = 37; //scroll
69
	EAX = 37; //scroll
70
	EBX = 7;
70
	EBX = 7;
71
	$int	0x40
71
	$int	0x40
72
	$mov	ebx, eax
72
	$mov	ebx, eax
73
	$shr	eax, 16
73
	$shr	eax, 16
74
	$and	ebx,0x0000FFFF
74
	$and	ebx,0x0000FFFF
75
	//hor = EAX;
75
	//hor = EAX;
76
	vert = EBX;
76
	vert = EBX;
77
}
77
}
78
 
78
 
79
//---------------------------------------------------------------------------
79
//---------------------------------------------------------------------------
80
struct proc_info
80
struct proc_info
81
{
81
{
82
	#define SelfInfo -1
82
	#define SelfInfo -1
83
	dword	use_cpu;
83
	dword	use_cpu;
84
	word	pos_in_stack,num_slot,rezerv1;
84
	word	pos_in_stack,num_slot,rezerv1;
85
	char	name[11];
85
	char	name[11];
86
	char	rezerv2;
86
	char	rezerv2;
87
	dword	adress,use_memory,ID,left,top,width,height;
87
	dword	adress,use_memory,ID,left,top,width,height;
88
	word	status_slot,rezerv3;
88
	word	status_slot,rezerv3;
89
	dword	work_left,work_top,work_width,work_height;
89
	dword	work_left,work_top,work_width,work_height;
90
	char	status_window;
90
	char	status_window;
91
	void	GetInfo( ECX);
91
	void	GetInfo( ECX);
92
	byte    reserved[1024-71];
92
	byte    reserved[1024-71];
93
};
93
};
94
 
94
 
95
void proc_info::GetInfo( EBX, ECX)
95
void proc_info::GetInfo( EBX, ECX)
96
{
96
{
97
	$mov eax,9;
97
	$mov eax,9;
98
	$int 0x40
98
	$int 0x40
99
}
99
}
100
 
100
 
101
inline fastcall int GetSlot( ECX)
101
inline fastcall int GetSlot( ECX)
102
{
102
{
103
	$mov eax,18;
103
	$mov eax,18;
104
	$mov ebx,21;
104
	$mov ebx,21;
105
	$int 0x40
105
	$int 0x40
106
}
106
}
107
 
107
 
108
inline fastcall int ActiveProcess()
108
inline fastcall int ActiveProcess()
109
{
109
{
110
	$mov eax,18;
110
	$mov eax,18;
111
	$mov ebx,7;
111
	$mov ebx,7;
112
	$int 0x40
112
	$int 0x40
113
}
113
}
114
 
114
 
115
//-------------------------------------------------------------------------------
115
//-------------------------------------------------------------------------------
116
 
116
 
117
inline fastcall dword WaitEvent(){
117
inline fastcall dword WaitEvent(){
118
	$mov eax,10;
118
	$mov eax,10;
119
	$int 0x40
119
	$int 0x40
120
}
120
}
121
 
121
 
122
inline fastcall void SetEventMask( EBX)
122
inline fastcall void SetEventMask( EBX)
123
{
123
{
124
	EAX = 40;
124
	EAX = 40;
125
	$int 0x40
125
	$int 0x40
126
}
126
}
127
 
127
 
128
inline fastcall word GetKey(){ //+Gluk fix
128
inline fastcall word GetKey(){ //+Gluk fix
129
		$push edx
129
		$push edx
130
@getkey:
130
@getkey:
131
		$mov  eax,2
131
		$mov  eax,2
132
		$int  0x40
132
		$int  0x40
133
		$cmp eax,1
133
		$cmp eax,1
134
		$jne getkeyi
134
		$jne getkeyi
135
		$mov ah,dh
135
		$mov ah,dh
136
		$jmp getkeyii //jz?
136
		$jmp getkeyii //jz?
137
@getkeyi:
137
@getkeyi:
138
		$mov dh,ah
138
		$mov dh,ah
139
		$jmp getkey
139
		$jmp getkey
140
@getkeyii:
140
@getkeyii:
141
		$pop edx
141
		$pop edx
142
		EAX = EAX >> 8;		 
142
		EAX = EAX >> 8;		 
143
}
143
}
144
 
144
 
145
inline fastcall word GetButtonID(){
145
inline fastcall word GetButtonID(){
146
	EAX = 17;            // Get ID
146
	EAX = 17;            // Get ID
147
	$int  0x40
147
	$int  0x40
148
	EAX = EAX >> 8;
148
	EAX = EAX >> 8;
149
}
149
}
150
 
150
 
151
inline fastcall void ExitProcess(){
151
inline fastcall void ExitProcess(){
152
	EAX = -1;            // close this program
152
	EAX = -1;            // close this program
153
	$int 0x40
153
	$int 0x40
154
}
154
}
155
 
155
 
156
inline fastcall void Pause(dword EBX){				
156
inline fastcall void Pause( EBX){				
157
	$mov eax, 5
157
	$mov eax, 5
158
	$int 0x40
158
	$int 0x40
159
}
159
}
160
 
160
 
161
//------------------------------------------------------------------------------
161
//------------------------------------------------------------------------------
162
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,
162
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType, dword mainAreaColour, EDI)
163
dword mainAreaColour,byte headerType,dword headerColour,EDI)
-
 
164
{
163
{
165
	EAX = 12;              // function 12:tell os about windowdraw
164
	EAX = 12;              // function 12:tell os about windowdraw
166
	EBX = 1;
165
	EBX = 1;
167
	$int 0x40
166
	$int 0x40
168
	
167
	
169
	EBX = x << 16 + sizeX;
168
	EBX = x << 16 + sizeX;
170
	ECX = y << 16 + sizeY;
169
	ECX = y << 16 + sizeY;
171
	EDX = mainAreaType << 24 | mainAreaColour;
170
	EDX = mainAreaType << 24 | mainAreaColour;
172
	ESI = headerType << 24 | headerColour;
-
 
173
	$xor eax,eax
171
	$xor eax,eax
174
	$int 0x40
172
	$int 0x40
175
 
173
 
176
	EAX = 12;              // function 12:tell os about windowdraw
174
	EAX = 12;              // function 12:tell os about windowdraw
177
	EBX = 2;
175
	EBX = 2;
178
	$int 0x40
176
	$int 0x40
179
}
177
}
180
 
178
 
181
inline fastcall void CreateThread( ECX,EDX)
179
inline fastcall void CreateThread( ECX,EDX)
182
{
180
{
183
	EAX = 51;
181
	EAX = 51;
184
	EBX = 1;
182
	EBX = 1;
185
	$int 0x40
183
	$int 0x40
186
}
184
}
187
 
185
 
188
inline fastcall void DrawTitle( ECX){
186
inline fastcall void DrawTitle( ECX){
189
	EAX = 71;
187
	EAX = 71;
190
	EBX = 1;
188
	EBX = 1;
191
	$int 0x40;
189
	$int 0x40;
192
}
190
}
193
 
191
 
-
 
192
inline fastcall dword GetSkinHeight()
194
inline fastcall dword GetSkinWidth(){
193
{
195
	EAX = 48;
194
	$push ebx
-
 
195
	$mov  eax,48
196
	EBX = 4;
196
	$mov  ebx,4
-
 
197
	$int 0x40
197
	$int 0x40
198
	$pop  ebx
198
}
199
}
199
 
200
 
200
inline fastcall dword GetScreenHeight()
201
inline fastcall dword GetScreenHeight()
201
{
202
{
202
	EAX = 14;
203
	EAX = 14;
203
	EBX = 4;
-
 
204
	$int 0x40
204
	$int 0x40
205
	//$shr eax, 16
-
 
206
	$and eax,0x0000FFFF
205
	$and eax,0x0000FFFF
207
}
206
}
208
 
207
 
209
inline fastcall void MoveSize( EBX,ECX,EDX,ESI){
208
inline fastcall void MoveSize( EBX,ECX,EDX,ESI){
210
	$mov eax,67;
209
	$mov eax,67;
211
	$int 0x40
210
	$int 0x40
212
}
211
}
213
 
212
 
214
//------------------------------------------------------------------------------
213
//------------------------------------------------------------------------------
215
 
214
 
216
inline fastcall dword strlen( EDI)
215
inline fastcall dword strlen( EDI)
217
{
216
{
218
	asm {
217
	asm {
219
	  xor ecx, ecx
218
	  xor ecx, ecx
220
	  xor eax, eax
219
	  xor eax, eax
221
	  dec ecx
220
	  dec ecx
222
	  repne scasb
221
	  repne scasb
223
	  sub eax, 2
222
	  sub eax, 2
224
	  sub eax, ecx
223
	  sub eax, ecx
225
	}
224
	}
226
}
225
}
227
 
226
 
228
 
227
 
229
inline fastcall copystr( ESI,EDI)
228
inline fastcall copystr( ESI,EDI)
230
{
229
{
231
	$cld
230
	$cld
232
l1:
231
l1:
233
	$lodsb
232
	$lodsb
234
	$stosb
233
	$stosb
235
	$test al,al
234
	$test al,al
236
	$jnz l1
235
	$jnz l1
237
}
236
}
238
 
237
 
239
char buffer[11];
238
char buffer[11];
240
inline fastcall dword IntToStr( ESI)
239
inline fastcall dword IntToStr( ESI)
241
{
240
{
242
     $mov     edi, #buffer
241
     $mov     edi, #buffer
243
     $mov     ecx, 10
242
     $mov     ecx, 10
244
     $test     esi, esi
243
     $test     esi, esi
245
     $jns     f1
244
     $jns     f1
246
     $mov     al, '-'
245
     $mov     al, '-'
247
     $stosb
246
     $stosb
248
     $neg     esi
247
     $neg     esi
249
f1:
248
f1:
250
     $mov     eax, esi
249
     $mov     eax, esi
251
     $push     -'0'
250
     $push     -'0'
252
f2:
251
f2:
253
     $xor     edx, edx
252
     $xor     edx, edx
254
     $div     ecx
253
     $div     ecx
255
     $push     edx
254
     $push     edx
256
     $test     eax, eax
255
     $test     eax, eax
257
     $jnz     f2
256
     $jnz     f2
258
f3:
257
f3:
259
     $pop     eax
258
     $pop     eax
260
     $add     al, '0'
259
     $add     al, '0'
261
     $stosb
260
     $stosb
262
     $jnz     f3
261
     $jnz     f3
263
     $mov     eax, #buffer
262
     $mov     eax, #buffer
264
     $ret
263
     $ret
265
}
264
}
266
 
265
 
267
inline fastcall dword StrToInt()
266
inline fastcall dword StrToInt()
268
{
267
{
269
	ESI=EDI=EAX;
268
	ESI=EDI=EAX;
270
	IF(DSBYTE[ESI]=='-')ESI++;
269
	IF(DSBYTE[ESI]=='-')ESI++;
271
	EAX=0;
270
	EAX=0;
272
	BH=AL;
271
	BH=AL;
273
	do{
272
	do{
274
		BL=DSBYTE[ESI]-'0';
273
		BL=DSBYTE[ESI]-'0';
275
		EAX=EAX*10+EBX;
274
		EAX=EAX*10+EBX;
276
		ESI++;
275
		ESI++;
277
	}while(DSBYTE[ESI]>0);
276
	}while(DSBYTE[ESI]>0);
278
	IF(DSBYTE[EDI]=='-') -EAX;
277
	IF(DSBYTE[EDI]=='-') -EAX;
279
}
278
}
280
 
279
 
281
dword StrToCol(char* htmlcolor)
280
dword StrToCol(char* htmlcolor)
282
{
281
{
283
  dword j, color=0;
282
  dword j, color=0;
284
  char ch=0x00;
283
  char ch=0x00;
285
  
284
  
286
  FOR (j=0; j<6; j++)
285
  FOR (j=0; j<6; j++)
287
  {
286
  {
288
    ch=ESBYTE[htmlcolor+j];
287
    ch=ESBYTE[htmlcolor+j];
289
    IF ((ch>='0') && (ch<='9')) ch -= '0';
288
    IF ((ch>='0') && (ch<='9')) ch -= '0';
290
    IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
289
    IF ((ch>='A') && (ch<='F')) ch -= 'A'-10;
291
    IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
290
    IF ((ch>='a') && (ch<='f')) ch -= 'a'-10;
292
    color = color*0x10 + ch;
291
    color = color*0x10 + ch;
293
  }
292
  }
294
  
293
  
295
  return color;
294
  return color;
296
}
295
}
297
 
296
 
298
inline fastcall int strcmp(ESI, EDI)
297
inline fastcall int strcmp(ESI, EDI)
299
{
298
{
300
	loop()
299
	loop()
301
	{
300
	{
302
		IF (DSBYTE[ESI]
301
		IF (DSBYTE[ESI]
303
		IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1;
302
		IF (DSBYTE[ESI]>DSBYTE[EDI]) RETURN 1;
304
		IF (DSBYTE[ESI]=='\0') RETURN 0;
303
		IF (DSBYTE[ESI]=='\0') RETURN 0;
305
		ESI++;
304
		ESI++;
306
		EDI++;
305
		EDI++;
307
	}
306
	}
308
}
307
}
309
 
308
 
-
 
309
 
-
 
310
inline fastcall signed int strncmp( ESI, EDI, ECX)
-
 
311
{
-
 
312
  asm {
-
 
313
    MOV EBX, EDI
-
 
314
    XOR EAX, EAX
-
 
315
    MOV EDX, ECX
-
 
316
    OR ECX, ECX
-
 
317
    JE L1
-
 
318
    REPNE SCASB
-
 
319
    SUB EDX, ECX
-
 
320
    MOV ECX, EDX
-
 
321
    MOV EDI, EBX
-
 
322
    XOR EBX, EBX
-
 
323
    REPE CMPSB
-
 
324
    MOV AL, DSBYTE[ ESI-1]
-
 
325
    MOV BL, DSBYTE[ EDI-1]
-
 
326
    SUB EAX, EBX
-
 
327
L1:
-
 
328
  }
-
 
329
}
-
 
330
 
310
 
331
 
311
inline fastcall unsigned int find_symbol(ESI,BL)
332
inline fastcall unsigned int strchr(ESI,BL)
312
{
333
{
313
	int jj=0, last=-1;
334
	int jj=0, last=-1;
314
	do{
335
	do{
315
		jj++;
336
		jj++;
316
		$lodsb
337
		$lodsb
317
		IF(AL==BL) last=jj;
338
		IF(AL==BL) last=jj;
318
	} while(AL!=0);
339
	} while(AL!=0);
319
	return last;
340
	return last;
320
}
341
}
321
 
342
 
322
 
343
 
323
inline fastcall ChangeCase( EDX)
344
inline fastcall TitleCase( EDX)
324
{
345
{
325
	AL=DSBYTE[EDX];
346
	AL=DSBYTE[EDX];
326
	IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
347
	IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
327
	IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32;	//à-ï
348
	IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32;	//à-ï
328
	IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80;	//à-ï
349
	IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80;	//à-ï
329
	do{
350
	do{
330
		EDX++;
351
		EDX++;
331
		AL=DSBYTE[EDX];
352
		AL=DSBYTE[EDX];
332
		IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; CONTINUE;}
353
		IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; CONTINUE;}
333
		IF(AL>='€')&&(AL<='')DSBYTE[EDX]=AL|0x20; // -¯
354
		IF(AL>='€')&&(AL<='')DSBYTE[EDX]=AL|0x20; // -¯
334
		IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80;	//à-ï
355
		IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80;	//à-ï
335
	}while(AL!=0);
356
	}while(AL!=0);
336
}
357
}
337
 
358
 
338
 
359
 
339
//------------------------------------------------------------------------------
360
//------------------------------------------------------------------------------
340
inline fastcall void PutPixel( EBX,ECX,EDX)
361
inline fastcall void PutPixel( EBX,ECX,EDX)
341
{
362
{
342
  EAX=1;
363
  EAX=1;
343
  $int 0x40
364
  $int 0x40
344
}
365
}
345
 
366
 
346
void DefineButton(dword x,y,w,h,EDX,ESI)
367
void DefineButton(dword x,y,w,h,EDX,ESI)
347
{
368
{
348
 	EAX = 8;
369
 	EAX = 8;
349
	$push edx
370
	$push edx
350
	EDX += BT_DEL; //âíà÷àëå óäàëÿåì êíîïó ñ ýòè èä, ïîòîì ñîçäà¸ì
371
	EDX += BT_DEL; //âíà÷àëå óäàëÿåì êíîïó ñ ýòè èä, ïîòîì ñîçäà¸ì
351
	$int 0x40;
372
	$int 0x40;
352
	EBX = x<<16+w;
373
	EBX = x<<16+w;
353
	ECX = y<<16+h;
374
	ECX = y<<16+h;
354
 	$pop edx
375
 	$pop edx
355
	$int 0x40
376
	$int 0x40
356
}
377
}
357
 
378
 
358
inline fastcall void DeleteButton( EDX)
379
inline fastcall void DeleteButton( EDX)
359
{
380
{
360
	EAX = 8;
381
	EAX = 8;
361
	EDX += BT_DEL;
382
	EDX += BT_DEL;
362
	$int 0x40;
383
	$int 0x40;
363
}
384
}
364
 
385
 
365
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
386
void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
366
{
387
{
367
	EAX = 4;
388
	EAX = 4;
368
	EBX = x<<16+y;
389
	EBX = x<<16+y;
369
	ECX = fontType<<24+color;
390
	ECX = fontType<<24+color;
370
	$int 0x40;
391
	$int 0x40;
371
}
392
}
372
 
393
 
373
void DrawBar(dword x,y,w,h,EDX)
394
void DrawBar(dword x,y,w,h,EDX)
374
{
395
{
375
	EAX = 13;
396
	EAX = 13;
376
	EBX = x<<16+w;
397
	EBX = x<<16+w;
377
	ECX = y<<16+h;
398
	ECX = y<<16+h;
378
 	$int 0x40
399
 	$int 0x40
379
}
400
}
380
 
401
 
381
void DrawRegion_3D(dword x,y,width,height,color1,color2)
402
void DrawRegion_3D(dword x,y,width,height,color1,color2)
382
{
403
{
383
	DrawBar(x,y,width+1,1,color1);
404
	DrawBar(x,y,width+1,1,color1);
384
	DrawBar(x,y+1,1,height-1,color1);
405
	DrawBar(x,y+1,1,height-1,color1);
385
	DrawBar(x+width,y+1,1,height,color2);
406
	DrawBar(x+width,y+1,1,height,color2);
386
	DrawBar(x,y+height,width,1,color2);
407
	DrawBar(x,y+height,width,1,color2);
387
}
408
}
388
 
409
 
389
void DrawFlatButton(dword x,y,width,height,id,color,text)
410
void DrawFlatButton(dword x,y,width,height,id,color,text)
390
{
411
{
391
	DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
412
	DrawRegion_3D(x,y,width,height,0x94AECE,0x94AECE);
392
	DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
413
	DrawRegion_3D(x+1,y+1,width-2,height-2,0xFFFFFF,0xC7C7C7);
393
	DrawBar(x+2,y+2,width-3,height-3,color);
414
	DrawBar(x+2,y+2,width-3,height-3,color);
394
	IF (id<>0)	DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF);
415
	IF (id<>0)	DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF);
395
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
416
	WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text,0);
396
}
417
}
397
 
418
 
398
void PutPaletteImage(dword EBX,w,h,x,y, EDI)
419
void PutPaletteImage(dword EBX,w,h,x,y, EDI)
399
{
420
{
400
	EAX = 65;
421
	EAX = 65;
401
	ECX = w<<16+h;
422
	ECX = w<<16+h;
402
	EDX = x<<16+y;
423
	EDX = x<<16+y;
403
	ESI = 8;
424
	ESI = 8;
404
	EBP = 0;
425
	EBP = 0;
405
	$int 0x40
426
	$int 0x40
406
} 
427
} 
407
 
428
 
408
void PutImage(dword EBX,w,h,x,y)
429
void PutImage(dword EBX,w,h,x,y)
409
{
430
{
410
	EAX = 7;
431
	EAX = 7;
411
	ECX = w<<16+h;
432
	ECX = w<<16+h;
412
	EDX = x<<16+y;
433
	EDX = x<<16+y;
413
	$int 0x40
434
	$int 0x40
414
}
435
}
415
 
436
 
416
//------------------------------------------------------------------------------
437
//------------------------------------------------------------------------------
417
inline fastcall void debug( EDX)
438
inline fastcall void debug( EDX)
418
{
439
{
-
 
440
	$push eax
-
 
441
	$push ebx
-
 
442
	$push ecx
419
	$mov eax, 63
443
	$mov eax, 63
420
	$mov ebx, 1
444
	$mov ebx, 1
421
next_char:
445
next_char:
422
	$mov ecx, DSDWORD[edx]
446
	$mov ecx, DSDWORD[edx]
423
	$or	 cl, cl
447
	$or	 cl, cl
424
	$jz  done
448
	$jz  done
425
	$int 0x40
449
	$int 0x40
426
	$inc edx
450
	$inc edx
427
	$jmp next_char
451
	$jmp next_char
428
done:
452
done:
429
	$mov cl, 13
453
	$mov cl, 13
430
	$int 0x40
454
	$int 0x40
431
	$mov cl, 10
455
	$mov cl, 10
432
	$int 0x40
456
	$int 0x40
433
}
-
 
434
 
-
 
435
inline fastcall void WriteFullDebug( ESI)
-
 
436
{
-
 
437
	WriteDebug("");
457
	$pop eax
438
	WriteDebug(ESI);
458
	$pop ebx
439
	
-
 
440
	WriteDebug("Number of files:");
-
 
441
	WriteDebug(IntToStr(count)); 
-
 
442
	
-
 
443
	WriteDebug("but_num:");
-
 
444
	WriteDebug(IntToStr(but_num));
-
 
445
	
-
 
446
	WriteDebug("curbtn");
-
 
447
	WriteDebug(IntToStr(curbtn));
-
 
448
	
-
 
449
	WriteDebug("ra_kadrom:");
-
 
450
	WriteDebug(IntToStr(za_kadrom));
-
 
451
	
-
 
452
	Pause(200);
459
	$pop ecx
453
}
460
}
454
>
461
>
455
>
462
>
456
>
463
>
457
>
464
>
458
>
465
>
459
>
466
>
460
>
467
>
461
>
468
>
462
>
469
>
463
>
470
>
464
>
471
>
465
>
472
>
466
>
473
>
467
>
474
>
468
>
475
>
469
>
476
>
470
>
477
>
471
>
478
>
472
>
479
>
473
>
480
>
474
>
481
>