RDsave 1.41: printing messages in window when available, ram-drive can't be saved on /rd/1 now, some bug fixed.

git-svn-id: svn://kolibrios.org@4270 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2013-11-21 13:20:19 +00:00
parent cc2baba95d
commit 1f997efbdd

View File

@ -8,7 +8,7 @@
; Heavyiron 01.12.2013 - new logic ; Heavyiron 01.12.2013 - new logic
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
appname equ 'RDsave ' appname equ 'RDsave '
version equ '1.4' version equ '1.41'
debug equ no debug equ no
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à  use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
@ -54,30 +54,31 @@ stdcall dll.Init,[init_lib]
invoke ini_get_int,ini_file,asettings,aautoclose,0 invoke ini_get_int,ini_file,asettings,aautoclose,0
mov [autoclose],eax mov [autoclose],eax
invoke ini_get_str,ini_file,apath,apath,fname_buf,4096,path
stdcall _lstrcpy,ini_path,fname_buf
mov ecx,PARAMS stdcall _lstrcpy,filename_area,start_temp_file_name
cmp byte[ecx], 0
mov eax,PARAMS
cmp byte[eax], 0
je no_params je no_params
cmp byte[ecx], 'h' cmp byte[eax], 'h'
je @f je @f
cmp byte[ecx], 'H' cmp byte[eax], 'H'
jne .no_h jne .no_h
@@: @@:
mov [hidden],1 mov [hidden],1
jmp no_params jmp no_params
.no_h: .no_h:
mov [param],1 mov [param],1
stdcall _lstrcpy,fname_buf,eax
xor eax,eax
mov ah,2 mov ah,2
jmp noclose jmp noclose
no_params:
invoke ini_get_str,ini_file,apath,apath,fname_buf,4096,path
stdcall _lstrcpy,filename_area,start_temp_file_name
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
stdcall _lstrcpy,check_dir,fname_buf no_params:
stdcall _lstrcpy,check_dir,ini_path
call check_path call check_path
test eax,eax test eax,eax
jz path_ok jz path_ok
@ -120,7 +121,6 @@ path_ok:
cmp [hidden],1 cmp [hidden],1
jne red jne red
mov ah,2 mov ah,2
mov ecx,fname_buf
jmp noclose jmp noclose
red: red:
call draw_window call draw_window
@ -140,7 +140,6 @@ button:
mcall 17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨ mcall 17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
dec ah dec ah
jz close jz close
mov ecx,fname_buf
cmp ah,1 ; ª­®¯ª  á id=1("§ ªàëâì")? cmp ah,1 ; ª­®¯ª  á id=1("§ ªàëâì")?
jne noclose jne noclose
close: close:
@ -151,7 +150,6 @@ key:
mcall 2 mcall 2
cmp ah,0x1b cmp ah,0x1b
je close je close
mov ecx,fname_buf
cmp ah,0x0D cmp ah,0x0D
jne @f jne @f
mov ah,2 mov ah,2
@ -161,6 +159,7 @@ key:
jne still jne still
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
noclose: noclose:
mov ecx,fname_buf
push 16 push 16
mov ebx,1 mov ebx,1
cmp byte[ecx+1],'f' cmp byte[ecx+1],'f'
@ -197,7 +196,24 @@ not_fdd:
jmp noclose jmp noclose
doit: doit:
cmp [param],0
jne @f
call save_ini call save_ini
@@:
cmp byte[ecx+1],'r'
je @f
cmp byte[ecx+1],'R'
jne not_rd
@@:
mov edx,rdError
call print_err
cmp [param],1
je @f
jmp still
@@:
mov [param],0
jmp no_params
not_rd:
pop eax pop eax
mcall mcall
call check_for_error call check_for_error
@ -205,6 +221,7 @@ doit:
je @f je @f
jmp still jmp still
@@: @@:
mov [param],0
jmp no_params jmp no_params
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
@ -219,34 +236,63 @@ stdcall _lstrcat,check_dir,fname_buf
mov edx,error11 mov edx,error11
jmp print_err jmp print_err
@@: @@:
mov edi, error_msg
cmp eax, 11 cmp eax, 11
ja .unknown ja .unknown
mov esi, [errors+eax*4] mov edx, [errors+eax*4]
@@: stdcall _lstrcat,error_msg,edx
lodsb
stosb
test al, al
jnz @b
mov edx, error_msg mov edx, error_msg
jmp print_err jmp print_err
.unknown: .unknown:
mov edx, aUnknownError mov edx, aUnknownError
print_err: print_err:
mov dword [is_notify + 8], edx pushad
mcall 70, is_notify stdcall _lstrlen,ini_path
invoke ini_set_str,ini_file,apath,apath,ini_path,eax
stdcall _lstrcpy,fname_buf,ini_path
popad
cmp [hidden],1
je @f
cmp [param],1
je @f
stdcall _lstrlen,edx
imul eax,6
mov ebx,390
sub ebx,eax
sar ebx,1
shl ebx,16
add ebx,96
mov ecx,[sc.work_text]
or ecx,0xc0880000
mcall 4, , , , ,[sc.work]
ret
@@:
mov dword [is_notify + 8], edx
mcall 70, is_notify
ret ret
print_ok: print_ok:
mov dword [is_notify + 8], edx
mcall 70, is_notify
cmp [hidden],1 cmp [hidden],1
je @f
cmp [param],1
je @f
stdcall _lstrlen,edx
imul eax,6
mov ebx,390
sub ebx,eax
sar ebx,1
shl ebx,16
add ebx,96
mov ecx,[sc.work_text]
or ecx,0xc0008800
mcall 4, , , , ,[sc.work]
mcall 5,100
cmp [autoclose],1
je close je close
cmp [autoclose],0
je @f
mcall 5,50
jmp close
@@:
ret ret
@@:
mov dword [is_notify + 8], edx
mcall 70, is_notify
mcall 5,100
jmp close
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
draw_PathShow: draw_PathShow:
pushad pushad
@ -290,7 +336,7 @@ draw_window:
mov edx,[sc.work] mov edx,[sc.work]
or edx,0x34000000 or edx,0x34000000
mcall 0,<200,400>,<200,120>, , ,title mcall 0,<200,400>,<200,130>, , ,title
;buttons ;buttons
mcall 8,<198,70>,<68,20>,2,[sc.work_button] mcall 8,<198,70>,<68,20>,2,[sc.work_button]
@ -336,7 +382,9 @@ error8 db '
error9 db '” ©«®¢ ï áâàãªâãà  à §àã襭 ',0 error9 db '” ©«®¢ ï áâàãªâãà  à §àã襭 ',0
error10 db '„®áâ㯠§ ¯à¥éñ­',0 error10 db '„®áâ㯠§ ¯à¥éñ­',0
error11 db 'Žè¨¡ª  ãáâனá⢠',0 error11 db 'Žè¨¡ª  ãáâனá⢠',0
aUnknownError db '<27>¥¨§¢¥áâ­ ï ®è¨¡ª ',0 aUnknownError db '<27>¥¨§¢¥áâ­ ï ®è¨¡ª ',0
rdError db '<27>¥«ì§ï á®åà ­ïâì ®¡à § ¢ á ¬®£® ᥡï',0
error_msg db 'Žè¨¡ª : ',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
else if lang eq et else if lang eq et
save db 'Salvesta',0 save db 'Salvesta',0
@ -356,6 +404,8 @@ error9 db 'FAT tabel vigane',0
error10 db 'Juurdepääs keelatud',0 error10 db 'Juurdepääs keelatud',0
error11 db 'Seadme viga',0 error11 db 'Seadme viga',0
aUnknownError db 'Tundmatu viga',0 aUnknownError db 'Tundmatu viga',0
rdError db 'You can't save image on itself',0
error_msg db 'Viga: ',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
else if lang eq it else if lang eq it
save db ' Salva',0 save db ' Salva',0
@ -375,6 +425,8 @@ error9 db 'Tabella FAT corrotta',0
error10 db 'Accesso negato',0 error10 db 'Accesso negato',0
error11 db 'Errore di device',0 error11 db 'Errore di device',0
aUnknownError db 'Errore sconosciuto',0 aUnknownError db 'Errore sconosciuto',0
rdError db 'You can't save image on itself',0
error_msg db 'Errore: ',0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
else else
save db ' Save',0 save db ' Save',0
@ -394,10 +446,9 @@ error9 db 'File structure is destroyed',0
error10 db 'Access denied',0 error10 db 'Access denied',0
error11 db 'Device error',0 error11 db 'Device error',0
aUnknownError db 'Unknown error',0 aUnknownError db 'Unknown error',0
rdError db 'You can't save image on itself',0
error_msg db 'Error: ',0
end if end if
title db appname,version,0
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
errors: errors:
dd ok dd ok
@ -413,6 +464,9 @@ errors:
dd error10 dd error10
dd error11 dd error11
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
title db appname,version,0
;Lib_DATA ;Lib_DATA
;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨. ;‚ᥣ¤  ᮡ«î¤ âì ¯®á«¥¤®¢ â¥«ì­®áâì ¢ ¨¬¥­¨.
system_dir_Boxlib db '/sys/lib/box_lib.obj',0 system_dir_Boxlib db '/sys/lib/box_lib.obj',0
@ -601,12 +655,8 @@ check_dir:
sc system_colors sc system_colors
;mouse_dd rd 1
autoclose rd 1 autoclose rd 1
error_msg rb 128
folder_data: folder_data:
rb 304*32+32 ; 9 Kb rb 304*32+32 ; 9 Kb
;--------------------------------------------------------------------- ;---------------------------------------------------------------------