c-- libraries update

git-svn-id: svn://kolibrios.org@3003 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-11-05 11:59:41 +00:00
parent 1838b89b65
commit 41086737df
5 changed files with 69 additions and 29 deletions

View File

@ -115,7 +115,6 @@ inline fastcall ScancodesGeting(){
$int 0x40 $int 0x40
} }
inline fastcall word GetKey() //+Gluk fix inline fastcall word GetKey() //+Gluk fix
{ {
$push edx $push edx
@ -212,12 +211,11 @@ inline fastcall int KillProcess( ECX)
$int 0x40 $int 0x40
} }
inline fastcall int ExitSystem( ECX)
{
#define TURN_OFF 2 #define TURN_OFF 2
#define REBOOT 3 #define REBOOT 3
#define KERNEL 4 #define KERNEL 4
inline fastcall int ExitSystem( ECX)
{
$mov eax, 18 $mov eax, 18
$mov ebx, 9 $mov ebx, 9
$int 0x40 $int 0x40
@ -282,6 +280,12 @@ inline fastcall int TestBit( EAX, CL)
$and eax,1 $and eax,1
} }
inline fastcall int PlaySpeaker( ESI)
{
$mov eax, 55
$mov ebx, 55
$int 0x40
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -323,6 +327,15 @@ void WriteText(dword x,y,byte fontType, dword color, EDX, ESI)
$int 0x40; $int 0x40;
} }
void WriteNumber(dword x,y,byte fontType, dword color, count, ECX)
{
EAX = 47;
EBX = count<<16;
EDX = x<<16+y;
ESI = fontType<<24+color;
$int 0x40;
}
void CopyScreen(dword EBX, x, y, sizeX, sizeY) void CopyScreen(dword EBX, x, y, sizeX, sizeY)
{ {
EAX = 36; EAX = 36;

View File

@ -21,9 +21,11 @@
dword generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë dword generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
:int random(int max) inline fastcall int random( ECX)
// get pseudo-random number - ïîëó÷èòü ïñåâäîñëó÷àéíîå ÷èñëî // get pseudo-random number - ïîëó÷èòü ïñåâäîñëó÷àéíîå ÷èñëî
{ {
$push ebx
$rdtsc // eax & edx $rdtsc // eax & edx
$xor eax,edx $xor eax,edx
$not eax $not eax
@ -35,11 +37,12 @@ dword generator; // random number generator -
generator = EBX; generator = EBX;
EAX += EBX; EAX += EBX;
EAX = EAX % max; EAX = EAX % ECX;
return EAX;
$pop ebx
} }
:randomize() inline fastcall randomize()
// initialize random number generator - èíèöèàëèçèðîâàòü ãåíåðàòîð ñëó÷àéíûõ ÷èñåë // initialize random number generator - èíèöèàëèçèðîâàòü ãåíåðàòîð ñëó÷àéíûõ ÷èñåë
{ {
asm asm

View File

@ -10,6 +10,7 @@
// atoi( EAX) // atoi( EAX)
// strupr( ESI) // strupr( ESI)
// strlwr( ESI) // strlwr( ESI)
// strttl( EDX)
// strtok( ESI) // strtok( ESI)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -47,6 +48,8 @@ L1:
} }
} }
/* /*
inline fastcall signed int strcmpi( ESI,EDI) inline fastcall signed int strcmpi( ESI,EDI)
@ -216,6 +219,22 @@ inline fastcall strlwr( ESI)
}while(AL!=0); }while(AL!=0);
} }
inline fastcall strttl( EDX)
{
AL=DSBYTE[EDX];
IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f;
IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //à-ï
IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //à-ï
do{
EDX++;
AL=DSBYTE[EDX];
IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; CONTINUE;}
IF(AL>='')&&(AL<='<EFBFBD>')DSBYTE[EDX]=AL|0x20; // 
IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80; //à-ï
}while(AL!=0);
}
inline fastcall unsigned int strstr( EBX, EDX) inline fastcall unsigned int strstr( EBX, EDX)
{ {

View File

@ -0,0 +1,25 @@
//ýòî âñòàâèòü ïîñëå çàãðóçêè îñíîâíûõ áèáëèîòåê
dword libtruetype = #att;
char att[] = "/sys/lib/truetype.obj"; //"truetype.obj\0";
dword truetype = #att_truetype;
dword get_length = #att_get_length;
dword get_width = #att_get_width;
dword text_out = #att_text_out;
dword am3__ = 0x0;
dword bm3__ = 0x0;
//import libimg , \
char att_truetype[] = "truetype";
char att_get_length[] = "get_length";
char att_get_width[] = "get_width";
char att_text_out[] = "text_out";
//load_dll2(libtruetype, #truetype,0);
//à ýòî - â ìîìåíò îòðèñîâêè îêíà
//text_out stdcall (#text, -1, 40, 0xFF0000, 100, 100);

View File

@ -1,20 +0,0 @@
//ýòî âñòàâèòü ïîñëå çàãðóçêè îñíîâíûõ áèáëèîòåê
dword libtruetype = #att;
char att[23] = "/sys/lib/truetype.obj\0"; //"truetype.obj\0";
dword truetype = #att_truetype;
dword get_length = #att_get_length;
dword get_width = #att_get_width;
dword text_out = #att_text_out;
dword am3__ = 0x0;
dword bm3__ = 0x0;
char att_truetype[10] = "truetype\0";
char att_get_length[12] = "get_length\0";
char att_get_width[11] = "get_width\0";
char att_text_out[10] = "text_out\0";