Eolite 1.45: crash fixed, remove malloc/free every time as user open file, make some global labels local

git-svn-id: svn://kolibrios.org@3113 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-12-15 14:11:03 +00:00
parent bef68cee11
commit a7e652271e
5 changed files with 53 additions and 36 deletions

View File

@ -20,7 +20,7 @@ int BUTTON_HEIGHT=18;
#define ONLY_OPEN 2
//ïåðåìåííûå
#define title "Eolite File Manager v1.43"
#define title "Eolite File Manager v1.45"
dword selection_col = 0x94AECE;
dword lpanel_col = 0x00699C;
@ -56,8 +56,8 @@ int scroll_size;
int toolbar_buttons_x[6]={9,46,85,134,167,203};
char tmp_disk_del_param[]="d0";
int toolbar_buttons_x[7]={9,46,85,134,167,203};
char tmp_disk_del_param[3]="d0\0";
dword file_mas[6898];
int j, i, mouse_dd;
@ -111,7 +111,7 @@ void main()
IF (del_active) break;
id=GetSlot(Form.ID);
IF (id<>ActiveProcess()) break; //åñëè îêíî íå àêòèâíî íà ñîáûòèÿ ìûøè íå ğåàãèğóåì
IF (id<>GetActiveProcess()) break; //åñëè îêíî íå àêòèâíî íà ñîáûòèÿ ìûøè íå ğåàãèğóåì
IF (!rename_active) edit_box_mouse stdcall(#edit1); ELSE edit_box_mouse stdcall(#edit2);

View File

@ -38,9 +38,9 @@ void about_dialog()
DefineAndDrawWindow(600,150,181,256,0x34,0x10EFEBEF,"About Eolite");
DrawBar(0,0,172,50,0x8494C4); //ãîëóáîå ñçàäè
PutPaletteImage(#logo,85,85,43,7,#logo_pal);
WriteText(46,100,0x90,0xBF40BF,"Eolite v1.43",0);
$add ebx, 1<<16
$int 0x40
WriteText(46,100,0x90,0xBF40BF,"Eolite v1.45",0);
$add ebx, 1<<16
$int 0x40
WriteText(55,120,0x80,0,"Developers:",0);
WriteText(39,130,0x80,0,"Leency & Veliant",0);
WriteText(45,140,0x80,0,"KolibriOS Team",0);

View File

@ -29,16 +29,20 @@ unsigned char *ERROR_TEXT[]={
void GetIni(byte onload)
{
byte section[32]='', parametr[32]='', option[256]='', InfType=0;
word bukva[1];
char bukva[2];
int errornum;
dword buff, fsize, tj;
dword fsize, tj;
static dword buff;
//÷èòàåì ôàéë
free(buff);
buff = malloc(12000);
IF (onload==1) copystr(".ini", #program_path+strlen(#program_path));
IF (onload==1)
{
free(buff);
buff = malloc(12000);
copystr(".ini", #program_path+strlen(#program_path));
}
ReadFile(0, 12000, buff, #program_path);
IF (EAX<>6) //åñëè ôàéëà ñ íàñòğîéêàìè íåò â ïàïêå ñ ïğîãğàììîé ñìîòğèì â ïàïêå ïî-óìîë÷àíèş
ReadFile(0, 12000, buff, "/sys/File managers/Eolite.ini");
IF (EAX<>6) ReadFile(0, 12000, buff, "/sys/File managers/Eolite.ini");
IF (EAX<>6) //åñëè ôàéëà ñ íàñòðîéêàìè òóïî íåò ïå÷àëüêà
{
IF (onload==1) notify("Eolite.ini not found. Defaults will be used.");

View File

@ -107,13 +107,20 @@ inline fastcall int GetSlot( ECX)
$int 0x40
}
inline fastcall int ActiveProcess()
inline fastcall int GetActiveProcess()
{
$mov eax,18;
$mov ebx,7;
$int 0x40
}
inline fastcall void ActivateWindow( ECX)
{
EAX = 18;
EBX = 3;
$int 0x40
}
//-------------------------------------------------------------------------------
inline fastcall dword WaitEvent(){
@ -129,17 +136,17 @@ inline fastcall void SetEventMask( EBX)
inline fastcall word GetKey(){ //+Gluk fix
$push edx
@getkey:
GETKEY:
$mov eax,2
$int 0x40
$cmp eax,1
$jne getkeyi
$jne GETKEYI
$mov ah,dh
$jmp getkeyii //jz?
@getkeyi:
$jmp GETKEYII //jz?
GETKEYI:
$mov dh,ah
$jmp getkey
@getkeyii:
$jmp GETKEY
GETKEYII:
$pop edx
EAX = EAX >> 8;
}
@ -207,6 +214,13 @@ inline fastcall dword GetScreenHeight()
$and eax,0x0000FFFF
}
inline fastcall dword GetScreenWidth()
{
$mov eax, 14
$int 0x40
$shr eax, 16
}
inline fastcall void MoveSize( EBX,ECX,EDX,ESI){
$mov eax,67;
$int 0x40
@ -294,14 +308,14 @@ inline fastcall void debug( EDX)
{
$mov eax, 63
$mov ebx, 1
next_char:
NEXT_CHAR:
$mov ecx, DSDWORD[edx]
$or cl, cl
$jz done
$jz DONE
$int 0x40
$inc edx
$jmp next_char
done:
$jmp NEXT_CHAR
DONE:
$mov cl, 13
$int 0x40
$mov cl, 10

View File

@ -17,11 +17,11 @@ inline fastcall dword strlen( EDI)
inline fastcall copystr( ESI,EDI)
{
$cld
l1:
L1:
$lodsb
$stosb
$test al,al
$jnz l1
$jnz L1
}
char buffer[11];
@ -30,26 +30,25 @@ inline fastcall dword IntToStr( ESI)
$mov edi, #buffer
$mov ecx, 10
$test esi, esi
$jns f1
$jns F1
$mov al, '-'
$stosb
$neg esi
f1:
F1:
$mov eax, esi
$push -'0'
f2:
F2:
$xor edx, edx
$div ecx
$push edx
$test eax, eax
$jnz f2
f3:
$jnz F2
F3:
$pop eax
$add al, '0'
$stosb
$jnz f3
$jnz F3
$mov eax, #buffer
//$ret
}
inline fastcall dword StrToInt()
@ -128,11 +127,11 @@ inline fastcall TitleCase( EDX)
inline fastcall strcpy( EDI, ESI)
{
$cld
l2:
L2:
$lodsb
$stosb
$test al,al
$jnz l2
$jnz L2
}