kolibrios/programs/system/rdsave/trunk/rdsave.asm

343 lines
7.6 KiB
NASM
Raw Normal View History

;
; RDsave <20><><EFBFBD> Kolibri (0.6.5.0 <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
;
; Mario79 2005
; Heavyiron 12.02.2007
;
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> FASM'<27><>
;
;---------------------------------------------------------------------
include 'lang.inc'
include '..\..\..\macros.inc'
appname equ 'RDsave '
version equ '1.2'
use32 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E0A5A6> <20><><EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD>
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
db 'MENUET01' ; 8-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> MenuetOS
dd 0x01 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><EFBFBD><E1A5A3> 1)
dd START ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd I_END ; ࠧ<><E0A0A7><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
dd 0x2000 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
dd 0x2000 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
dd 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E0A0AC>஢ (<28><> <20><EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
dd 0x0 ; <20><><EFBFBD>ࢨ஢<E0A2A8><E0AEA2><EFBFBD>
include '..\..\..\develop\examples\editbox\trunk\editbox.inc'
use_edit_box structure_of_potock,22,5
;---------------------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
;---------------------------------------------------------------------
START:
mov eax, 40
mov ebx, 100111b
mcall
red: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
call draw_window ; <20><><EFBFBD><EFBFBD><EBA2A0> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
;---------------------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------
;---------------------------------------------------------------------
still:
push 10
pop eax
mcall
dec eax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>?
jz red ; <20><20><> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
dec eax
jz key
dec eax
jz button
mouse:
mouse_edit_boxes editbox,editbox_end
jmp still
button:
mov al,17 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mcall
cmp ah,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> id=1("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")?
jne noclose
or eax,-1 ; <20><EFBFBD><E3ADAA><EFBFBD> -1: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
mcall
noclose:
cmp ah,2
jne path_2
call clear_err
mov al,16
mov ebx,1
mcall
call check_for_error
jmp still
path_2:
cmp ah,3
jne path_3
call clear_err
mov al,16
mov ebx,2
mcall
call check_for_error
jmp still
path_3:
cmp ah,4
jne path_4
call clear_err
mov al,18
mov ebx,6
mov ecx,path3
mcall
call check_for_error
jmp still
path_4:
call clear_err
mov eax,18
mov ebx,6
mov ecx,path4
mcall
call check_for_error
jmp still
key:
mov al,2
mcall
key_edit_boxes editbox,editbox_end
jmp still
check_for_error: ;<3B><><EFBFBD><E0A0A1><20><EFBFBD><E8A8A1>
cmp eax,0
jne err1
mov ecx,[sc.work_text]
mov edx,ok
jmp print
err1:
cmp eax,1
jne err3
mov ecx,0xdd2222
mov edx,error11
jmp print
err3:
cmp eax,3
jne err5
mov ecx,0xdd2222
mov edx,error3
jmp print
err5:
cmp eax,5
jne err8
mov ecx,0xdd2222
mov edx,error5
jmp print
err8:
cmp eax,8
jne err9
mov ecx,0xdd2222
mov edx,error8
jmp print
err9:
cmp eax,9
jne err10
mov ecx,0xdd2222
mov edx,error9
jmp print
err10:
cmp eax,10
jne err11
mov ecx,0xdd2222
mov edx,error10
jmp print
err11:
mov ecx,0xdd2222
mov edx,error11
jmp print
print:
mov eax,4 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,20 shl 16 + 148
or ecx,0x80000000
mcall
ret
clear_err:
mov al,13
mov ebx,15 shl 16 + 240
mov ecx,145 shl 16 +15
mov edx,[sc.work]
mcall
ret
;---------------------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ----------------------------------
;---------------------------------------------------------------------
draw_window:
mov eax,48
mov ebx,3
mov ecx,sc
mov edx,sizeof.system_colors
mcall
mov eax,12 ; <20><EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
mov bl,1 ; 1 - <20><><EFBFBD><E7A8AD><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD>
mcall
; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
xor eax,eax ; <20><EFBFBD><E3ADAA><EFBFBD> 0 : <20><><EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
mov ebx,200 shl 16 + 270 ; [x <20><><EFBFBD><EFBFBD><EFBFBD>] *65536 + [x ࠧ<><E0A0A7><EFBFBD>]
mov ecx,200 shl 16 + 190 ; [y <20><><EFBFBD><EFBFBD><EFBFBD>] *65536 + [y ࠧ<><E0A0A7><EFBFBD>]
mov edx,[sc.work] ; 梥<><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> RRGGBB,8->color gl
or edx,0x33000000
mov edi,title ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
mcall
draw_edit_boxes editbox,editbox_end,use_f9,structure_of_potock ;<3B><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> edit box'<27><>
mov al,13 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><><E2A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,194 shl 16 + 60
mov ecx,34 shl 16 +15
mov edx,0x444444
mcall
add ecx,20 shl 16
mcall
add ecx,20 shl 16
mcall
add ecx,40 shl 16
mcall
mov eax,8 ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
sub ebx,4 shl 16
sub ecx,4 shl 16
mov edx,5
mov esi,[sc.work_button]
mcall
sub ecx,40 shl 16
dec edx
mcall
sub ecx,20 shl 16
dec edx
mcall
sub ecx,20 shl 16
dec edx
mcall
mov al,4 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov ebx,45 shl 16 + 12
mov ecx,[sc.work_text]
or ecx,0x80000000
mov edx,label1
mcall
mov ebx,150 shl 16 + 35
mov edx,path1
mcall
add ebx,20
mov edx,path2
mcall
mov ebx,75 shl 16 + 75
mov edx,path3
mcall
mov ebx,30 shl 16 + 97
mov edx,label2
mcall
mov ebx,40 shl 16 + 135
mov edx,label3
mcall
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mov ebx,195 shl 16 + 35
mov edx,save
mcall
add ebx,20
mcall
add ebx,20
mcall
add ebx,40
mcall
mov al,12 ; <20><EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
mov ebx,2 ; 2, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD>
mcall
ret ; <20><><EFBFBD><E5AEA4> <20><> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD>
;---------------------------------------------------------------------
;--- <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------------
;---------------------------------------------------------------------
title db appname,version,0
editbox:
edit1 edit_box 170,10,113,0xffffff,0xaabbcc,0,0,0,512,path4,ed_focus,26,26
editbox_end:
if lang eq ru
save db '<27><><EFBFBD><EFBFBD><E0A0AD><EFBFBD>',0
label1 db '<27><EFBFBD><EBA1A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>⮢:',0
label2 db '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><E4A0A9>:',0
label3 db '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E2A2AE><EFBFBD><EFBFBD>',0
ok db 'RAM-<2D><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A0AD> <20>ᯥ譮',0
error3 db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E4A0A9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>',0
error5 db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>',0
error8 db '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>᪥',0
error9 db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> FAT ࠧ<><E0A0A7><EFBFBD>',0
error10 db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>饭',0
error11 db '<27><EFBFBD><E8A8A1> <20><><EFBFBD><EFBFBD>⢠',0
else
save db ' Save',0
label1 db 'Select one of the variants:',0
label2 db ' Or enter full path to file:',0
label3 db ' All folders must exist',0
ok db 'RAM-drive was saved successfully',0
error3 db 'Unknown file system',0
error5 db 'Incorrect path',0
error8 db 'Disk is full',0
error9 db 'FAT table corrupted',0
error10 db 'Access denied',0
error11 db 'Device error',0
end if
mouse_flag: dd 0x0
path1 db '/fd/1/',0
path2 db '/fd/2/',0
path3 db '/hd0/1/kolibri.img',0
path4 db '/hd0/1/kolibri/kolibri.img',0 ;<3B><><EFBFBD><><EFBFBD><E0A2AD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A0AD><EFBFBD><EFBFBD>
;---------------------------------------------------------------------
I_END: ; <20><><20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
rb 514
sc system_colors
structure_of_potock:
rb 100