Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5576 → Rev 5582

/programs/cmm/lib/file_system.h
33,8 → 33,8
 
:void DrawDate(dword x, y, color, in_date)
{
//char text[10];
EDI = in_date;
char text[15];
/*EDI = in_date;
EAX = 47;
EBX = 2<<16;
EDX = x<<16+y;
47,10 → 47,10
EDX += 18<<16;
EBX = 4<<16;
ECX = EDI.date.year;
$int 0x40;
$int 0x40;*/
//sprintf(#text,"%d.%d.%d",EDI.date.day,EDI.date.month,EDI.date.year);
//WriteText(x, y, 0x80, 0x80<<24+color, #text);
//sprintf(#text,"%s","ddf");
WriteText(x, y, 0x80, color, "adas\0");
}
 
 
/programs/cmm/lib/kolibri.h
1,6 → 1,6
//CODED by Veliant, Leency, Nable. GNU GPL licence.
 
#define LIB_KOLIBRI_H
#define INCLUDE_KOLIBRI_H
 
#startaddress 0
#code32 TRUE
92,10 → 92,10
* up - key release events
* move - event mouse movements
* click - when clicked
* dblclick - double-click the default 50 ms
* dblclick - double-click the default 50 (500 ms)
*/
 
dword __TMP_TIME,MOUSE_TIME;
:dword __TMP_TIME,MOUSE_TIME;
:struct mouse
{
signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,left,top;
296,7 → 296,7
}
 
//------------------------------------------------------------------------------
dword wait_event_code;
:dword wait_event_code;
inline fastcall dword WaitEvent()
{
$mov eax,10
375,6 → 375,18
//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
}
 
inline void draw_line(dword x1,y1,x2,y2,color)
{
x2--;y2--;y1--;
$mov EAX,38
EBX = x1<<16;
EBX |= x2;
ECX = y1<<16;
ECX |= y2;
$mov EDX,color
$int 0x40
}
 
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
{
$mov eax, 68
761,6 → 773,19
$int 0x40
}
 
inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
{
EAX = 18;
EBX = 22;
ECX = 3;
EDX = ID_REFRESH;
$int 0x40
EAX = 18;
EBX = 3;
EDX = ID_ACTIVE;
$int 0x40
}
 
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
{
EAX = 8;
808,15 → 833,31
return mem;
}
 
:struct _screen
{
dword width,height;
} screen;
 
:struct _skin
{
dword width,height;
} skin;
 
dword __generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
 
dword program_path_length;
:dword program_path_length;
 
//The initialization of the initial data before running
void load_init_main()
{
//program_path_length = strlen(program_path);
skin.height = GetSkinHeight();
screen.width = GetScreenWidth();
screen.height = GetScreenHeight();
//program_path_length = strlen(I_Path);
MOUSE_TIME = 50; //Default 500 ms.
__generator = GetStartTime();
//mem_Init();
main();
}
/programs/cmm/lib/random.h
46,7 → 46,7
$pop ebx
}
 
:inline long unirand0(void)
inline long unirand0(void)
{
long k,ans,tmp,save;
save = __generator;
63,7 → 63,7
}
 
:long RAND_A,RAND_C,RAND_TMP;
:inline long rand(signed long x1,x2)
inline long rand(signed long x1,x2)
{
long tmp,xx;
RAND_A = __generator;
/programs/cmm/lib/strings.h
178,7 → 178,7
$jnz L2
}
 
:inline dword strncpy(dword text1, text2, signed len)
inline dword strncpy(dword text1, text2, signed len)
signed o1,o2;
{
if(!text1)||(!len) return text1;
237,7 → 237,7
}
*/
 
byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
inline byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
inline void strltrim(dword text){
int s;
dword back_text;
451,7 → 451,7
}
}
 
dword strcmpi(dword cmp1, cmp2)
inline dword strcmpi(dword cmp1, cmp2)
{
char si, ue;
 
470,7 → 470,7
}
}
 
dword strstri(dword searchin, usestr_s)
inline dword strstri(dword searchin, usestr_s)
{
dword usestr_e = usestr_s;
char si, ue;
489,7 → 489,7
}
 
 
unsigned int strcpyb(dword search_in, copyin, startstr, endstr)
inline unsigned int strcpyb(dword search_in, copyin, startstr, endstr)
{
dword startp, endp;
dword copyin_start_off = copyin;
662,7 → 662,7
return ret;
}
 
:inline fastcall itoa_(signed int EDI, ESI)
inline fastcall itoa_(signed int EDI, ESI)
{
$pusha
EBX = EDI;
695,7 → 695,7
return EBX;
}
 
:inline dword memchr(dword s,int c,signed len)
inline dword memchr(dword s,int c,signed len)
{
if(!len) return NULL;
do {
706,7 → 706,7
return NULL;
}
 
:inline dword strdup(dword text)
inline dword strdup(dword text)
{
dword l = strlen(text);
dword ret = malloc(l+1);
715,7 → 715,7
return ret;
}
 
:inline dword strndup(dword str, signed maxlen)
inline dword strndup(dword str, signed maxlen)
{
dword copy,len;
 
729,8 → 729,37
return copy;
}
 
:inline cdecl int sprintf(dword buf, format,...)
inline dword hexdec(dword text)
{
char s;
dword ret,l;
//l = strlen(text);
ret = 0;
s = DSBYTE[text];
//if(l==6)
while(s)
{
ret <<= 4;
if(s>='A')&&(s<='F')ret |= s-'A'+10;
else if(s>='a')&&(s<='f')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'a'+10;
text++;
s = DSBYTE[text];
}
/*else if(l==3) while(s)
{
ret <<= 4;
if(s>='A')&&(s<='F')ret |= s-'A'+10;
else if(s>='a')&&(s<='f')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'a'+10;
text++;
s = DSBYTE[text];
}*/
return ret;
}
 
inline cdecl int sprintf(dword buf, format,...)
{
byte s;
char X[10];
dword ret, tmp, l;
813,7 → 842,7
return buf-ret;
}
 
void debugi(dword d_int)
inline void debugi(dword d_int)
{
char tmpch[12];
itoa_(#tmpch, d_int);