Subversion Repositories Kolibri OS

Rev

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

Rev 2803 Rev 2810
Line 28... Line 28...
28
#define OLD		-1
28
#define OLD		-1
29
#define true		1
29
#define true		1
30
#define false		0
30
#define false		0
31
//-------------------------------------------------------------------------
31
//-------------------------------------------------------------------------
Line 32... Line 32...
32
 
32
 
-
 
33
struct mouse
33
struct mouse{
34
{
34
 dword x,y,lkm,pkm,hor,vert;
35
	dword x,y,lkm,pkm,hor,vert;
35
 void get();
36
	void get();
Line 36... Line 37...
36
};
37
};
Line 63... Line 64...
63
	//hor = EAX;
64
	//hor = EAX;
64
	vert = EBX;
65
	vert = EBX;
65
}
66
}
Line 66... Line 67...
66
 
67
 
-
 
68
 
67
 
69
struct system_colors
68
struct system_colors{
70
{
69
	dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph;
71
	dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph;
-
 
72
	void get();
70
	void get();
73
};
71
};
74
 
72
void system_colors::get()
75
void system_colors::get()
73
{
76
{
74
	EAX = 48;
77
	EAX = 48;
Line 78... Line 81...
78
	$int 0x40
81
	$int 0x40
79
}
82
}
Line 80... Line 83...
80
 
83
 
Line 81... Line 84...
81
//------------------------------------------------------------------------------
84
//------------------------------------------------------------------------------
-
 
85
 
82
 
86
inline fastcall dword WaitEvent()
83
inline fastcall dword WaitEvent(){
87
{
84
	$mov eax,10
88
	$mov eax,10
Line 85... Line 89...
85
	$int 0x40
89
	$int 0x40
-
 
90
}
86
}
91
 
87
 
92
inline fastcall dword CheckEvent()
88
inline fastcall dword CheckEvent(){
93
{
Line 89... Line 94...
89
	$mov eax,11
94
	$mov eax,11
-
 
95
	$int 0x40
90
	$int 0x40
96
}
91
}
97
 
92
 
98
inline fastcall dword WaitEventTimeout( EBX)
Line 93... Line 99...
93
inline fastcall dword WaitEventTimeout(dword EBX){
99
{
94
	$mov eax,23
100
	$mov eax,23
95
	$int 0x40
101
	$int 0x40
96
} 
102
} 
97
 
103
 
Line 107... Line 113...
107
	$mov ecx,1 //᪠­ª®¤ë
113
	$mov ecx,1 //᪠­ª®¤ë
108
	$int 0x40
114
	$int 0x40
109
}
115
}
Line 110... Line 116...
110
 
116
 
-
 
117
 
111
 
118
inline fastcall word GetKey()  //+Gluk fix
112
inline fastcall word GetKey(){ //Gluk fix
119
{
113
		$push edx
120
		$push edx
114
@getkey:
121
@getkey:
115
		$mov  eax,2
122
		$mov  eax,2
Line 125... Line 132...
125
		$pop edx
132
		$pop edx
126
		$shr eax,8
133
		$shr eax,8
127
}
134
}
Line 128... Line 135...
128
 
135
 
129
 
-
 
-
 
136
 
130
inline fastcall Pause(dword EBX)
137
inline fastcall Pause( EBX)
131
{					// ã§ , ¢ á®âëå ¤®«ïå ᥪ㭤ë EBX = value
138
{
132
	$mov eax, 5
139
	$mov eax, 5
Line 133... Line 140...
133
	$int 0x40
140
	$int 0x40
Line 134... Line 141...
134
}
141
}
-
 
142
 
135
 
143
//------------------------------------------------------------------------------
136
//==================================================================
144
 
137
 
145
inline fastcall word GetButtonID()
138
inline fastcall word GetButtonID(){
146
{
Line 139... Line 147...
139
	$mov eax,17
147
	$mov eax,17
-
 
148
	$int  0x40
-
 
149
	$shr eax,8
140
	$int  0x40
150
}
141
	$shr eax,8
151
 
142
}
152
struct proc_info
143
 
153
{
144
struct proc_info{
154
	#define SelfInfo -1
145
	dword	use_cpu;
155
	dword	use_cpu;
146
	word	pos_in_stack,num_slot,rezerv1;
156
	word	pos_in_stack,num_slot,rezerv1;
147
	char	name[11];
157
	char	name[11];
148
	char	rezerv2;
158
	char	rezerv2;
149
	dword	adress,use_memory,ID,left,top,width,height;
159
	dword	adress,use_memory,ID,left,top,width,height;
150
	word	status_slot,rezerv3;
-
 
151
	dword	work_left,work_top,work_width,work_height;
160
	word	status_slot,rezerv3;
Line 152... Line 161...
152
	char	status_window;
161
	dword	work_left,work_top,work_width,work_height;
153
	void	GetInfo(dword ECX);
162
	char	status_window;
154
	byte    reserved[1024-71];
163
	void	GetInfo( ECX);
155
#define SelfInfo -1
164
	byte    reserved[1024-71];
156
};
165
};
Line 174... Line 183...
174
	EBX = 7;
183
	EBX = 7;
175
	$int 0x40
184
	$int 0x40
176
}
185
}
Line 177... Line 186...
177
 
186
 
-
 
187
 
178
 
188
inline fastcall ExitProcess()
179
inline fastcall ExitProcess(){
189
{
180
	$mov eax,-1;
190
	$mov eax,-1;
Line 181... Line 191...
181
	$int 0x40
191
	$int 0x40
-
 
192
}
182
}
193
 
183
 
194
inline fastcall int KillProcess( ECX)
184
inline fastcall int KillProcess(dword ECX){
195
{
185
	$mov eax,18;
196
	$mov eax,18;
Line 186... Line 197...
186
	$mov ebx,18;
197
	$mov ebx,18;
Line 187... Line 198...
187
	$int 0x40
198
	$int 0x40
188
}
199
}
-
 
200
 
189
 
201
//------------------------------------------------------------------------------
190
//==================================================================
202
 
191
 
203
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
192
//eax = ÿçûê ñèñòåìû (1=eng, 2=fi, 3=ger, 4=rus)
-
 
193
inline fastcall int GetSystemLanguage(){
204
inline fastcall int GetSystemLanguage()
Line 194... Line 205...
194
 EAX = 26;
205
{
195
 EBX = 5;
206
	EAX = 26;
196
 $int 0x40
207
	EBX = 5;
197
 RETURN EAX; 
208
	$int 0x40
198
}
209
}
199
 
210
 
Line 226... Line 237...
226
	$int 0x40
237
	$int 0x40
227
	$shr eax, 16
238
	$shr eax, 16
228
	$and eax,0x0000FFFF
239
	$and eax,0x0000FFFF
229
}
240
}
Line 230... Line 241...
230
 
241
 
231
inline fastcall MoveSize(dword EBX,ECX,EDX,ESI)
242
inline fastcall MoveSize( EBX,ECX,EDX,ESI)
232
{
243
{
233
	EAX = 67;
244
	EAX = 67;
234
	$int 0x40
245
	$int 0x40
Line 235... Line 246...
235
}
246
}
236
 
247
 
237
inline fastcall dword LoadLibrary(dword ECX)
248
inline fastcall dword LoadLibrary( ECX)
238
{
249
{
239
	$mov eax, 68 
250
	$mov eax, 68 
240
	$mov ebx, 19
251
	$mov ebx, 19
Line 241... Line 252...
241
	$int  0x40
252
	$int  0x40
242
}
253
}
-
 
254
 
243
 
255
//------------------------------------------------------------------------------
244
//------------------------------------------------------------------------------
256
inline fastcall dword strlen( EDI)
245
inline fastcall dword strlen(dword EDI){
257
{
246
	EAX=0;
258
	EAX=0;
247
	ECX=-1;
259
	ECX=-1;
Line -... Line 260...
-
 
260
	$REPNE $SCASB
248
	$REPNE $SCASB
261
	EAX-=2+ECX;
249
	EAX-=2+ECX;
262
}
250
}
263
 
251
 
264
 
252
inline fastcall copystr(dword ESI,EDI)
265
inline fastcall strcpy( EDI, ESI)
253
{
266
{
254
	$cld
267
	$cld
255
l1:
268
l2:
256
	$lodsb
269
	$lodsb
Line 257... Line -...
257
	$stosb
-
 
258
	$test al,al
270
	$stosb
259
	$jnz l1
271
	$test al,al
-
 
272
	$jnz l2
-
 
273
}
-
 
274
 
-
 
275
inline fastcall strcat( EDI, ESI)
-
 
276
{
-
 
277
  asm {
-
 
278
    MOV EBX, EDI
-
 
279
    XOR ECX, ECX
-
 
280
    XOR EAX, EAX
-
 
281
    DEC ECX
-
 
282
    REPNE SCASB
-
 
283
    DEC EDI
-
 
284
    MOV EDX, EDI
-
 
285
    MOV EDI, ESI
-
 
286
    XOR ECX, ECX
-
 
287
    XOR EAX, EAX
-
 
288
    DEC ECX
260
}
289
    REPNE SCASB
-
 
290
    XOR ECX, 0FFFFFFFFH
-
 
291
    MOV EDI, EDX
261
 
292
    MOV EDX, ECX
-
 
293
    MOV EAX, EDI
-
 
294
    SHR ECX, 2
-
 
295
    REP MOVSD
262
 
296
    MOV ECX, EDX
Line 263... Line 297...
263
byte fastcall TestBit(EAX, CL)
297
    AND ECX, 3
264
{
298
    REP MOVSB
265
	$shr eax,cl
299
    MOV EAX, EBX
266
	$and eax,1
300
	}
267
}
301
}
268
 
302
 
269
char buffer[11]="";
303
char buffer[11]="";
Line 332... Line 366...
332
	} while(AL!=0);
366
	} while(AL!=0);
333
	return last;
367
	return last;
334
}
368
}
Line 335... Line 369...
335
 
369
 
336
 
370
 
337
inline fastcall dword upcase(dword ESI)
371
inline fastcall dword upcase( ESI)
338
{
372
{
339
	do{
373
	do{
340
		AL=DSBYTE[ESI];
374
		AL=DSBYTE[ESI];
Line 353... Line 387...
353
			CONTINUE;
387
			CONTINUE;
354
		}
388
		}
355
	}while(AL!=0);
389
	}while(AL!=0);
356
}
390
}
Line -... Line 391...
-
 
391
 
-
 
392
byte fastcall TestBit( EAX, CL)
-
 
393
{
-
 
394
	$shr eax,cl
-
 
395
	$and eax,1
-
 
396
}
-
 
397
 
-
 
398
//------------------------------------------------------------------------------
-
 
399
 
Line 357... Line 400...
357
 
400
 
358
 
401
 
359
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
402
void DefineAndDrawWindow(dword x,y,sizeX,sizeY,byte mainAreaType,dword mainAreaColour,byte headerType,dword headerColour,EDI)
360
{
403
{
Line 373... Line 416...
373
	EBX = 2;
416
	EBX = 2;
374
	$int 0x40
417
	$int 0x40
375
}
418
}
Line 376... Line 419...
376
 
419
 
377
 
420
 
378
inline fastcall int CreateThread(dword ECX,EDX)
421
inline fastcall int CreateThread( ECX,EDX)
379
{
422
{
380
	EAX = 51;
423
	EAX = 51;
381
	EBX = 1;
424
	EBX = 1;
Line 382... Line 425...
382
	$int 0x40
425
	$int 0x40
383
}
426
}
384
 
427
 
385
inline fastcall int GetSlot(dword ECX)
428
inline fastcall int GetSlot( ECX)
386
{
429
{
387
	EAX = 18;
430
	EAX = 18;
Line 428... Line 471...
428
	EDX = x<<16+y;
471
	EDX = x<<16+y;
429
	EBP = 0;
472
	EBP = 0;
430
	$int 0x40
473
	$int 0x40
431
} 
474
} 
Line 432... Line 475...
432
 
475
 
-
 
476
inline fastcall void PutPixel( EBX,ECX,EDX)
433
inline fastcall void PutPixel(dword EBX,ECX,EDX){
477
{
434
  EAX=1;
478
  EAX=1;
435
  $int 0x40
479
  $int 0x40
Line 436... Line 480...
436
}
480
}
Line 453... Line 497...
453
	ECX = y<<16+h;
497
	ECX = y<<16+h;
454
 	$pop edx
498
 	$pop edx
455
	$int 0x40
499
	$int 0x40
456
}
500
}
Line 457... Line 501...
457
 
501
 
458
inline fastcall void DeleteButton(dword EDX)
502
inline fastcall void DeleteButton( EDX)
459
{
503
{
460
	EAX = 8;
504
	EAX = 8;
461
	EDX += BT_DEL;
505
	EDX += BT_DEL;
462
	$int 0x40;
506
	$int 0x40;
Line 498... Line 542...
498
	}
542
	}
499
}
543
}
Line 500... Line 544...
500
 
544
 
Line 501... Line 545...
501
//------------------------------------------------------------------------------
545
//------------------------------------------------------------------------------
502
 
546
 
503
inline fastcall void debug(dword EDX)
547
inline fastcall void debug( EDX)
504
{
548
{
505
	$push ebx
549
	$push ebx
506
	$push ecx
550
	$push ecx