2006-01-03 12:43:31 +03:00
|
|
|
file_handler:
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
.operation=0
|
|
|
|
.position=4
|
|
|
|
.reserved=8
|
|
|
|
.n_bytes=12
|
|
|
|
.bufer=16
|
|
|
|
.name=20
|
|
|
|
.st_size=20+1024
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
open: ;esi=name_string
|
|
|
|
;retorna eax
|
|
|
|
pushad
|
|
|
|
mov ecx,file_handler.st_size
|
|
|
|
call mallocz
|
|
|
|
mov [esp+28],edi
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
push edi
|
|
|
|
mov ecx,1024
|
2006-01-03 12:43:31 +03:00
|
|
|
add edi,file_handler.name
|
|
|
|
call movedata
|
|
|
|
pop edi
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
; test if file exists
|
|
|
|
lea ebx,[edi+file_handler.operation]
|
|
|
|
mov byte[ebx],5
|
|
|
|
mov dword[ebx+16],fileattr
|
|
|
|
mov eax,70
|
|
|
|
int 0x40
|
|
|
|
cmp eax,2
|
|
|
|
jz .virtual
|
2006-01-03 12:43:31 +03:00
|
|
|
test eax,eax
|
|
|
|
jnz close.b
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
@@:
|
2006-01-03 12:43:31 +03:00
|
|
|
clc
|
|
|
|
popad
|
|
|
|
ret
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
.virtual:
|
|
|
|
mov byte [fileattr], 0x10
|
|
|
|
jmp @b
|
2006-01-03 12:43:31 +03:00
|
|
|
|
|
|
|
close:
|
|
|
|
pushad
|
|
|
|
.b:
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
mov edi,[esp+28]
|
2006-01-03 12:43:31 +03:00
|
|
|
call free
|
|
|
|
popad
|
|
|
|
xor eax,eax
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
read: ;(f,bufer,nbytes) eax,edi,ecx ncr
|
|
|
|
;retorna bytes leidos en ecx
|
|
|
|
pushad
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 17:06:57 +04:00
|
|
|
lea ebx, [eax+file_handler.operation]
|
|
|
|
mov byte [ebx], 0
|
|
|
|
mov [ebx+12], ecx
|
|
|
|
mov [ebx+16], edi
|
|
|
|
mov eax, 70
|
|
|
|
int 0x40
|
|
|
|
cmp ebx, -1
|
|
|
|
sbb ebx, -1
|
|
|
|
mov eax, [esp+28]
|
|
|
|
add [eax+file_handler.position], ebx
|
|
|
|
mov [esp+24], ebx
|
2006-01-03 12:43:31 +03:00
|
|
|
popad
|
|
|
|
ret
|
|
|
|
|
|
|
|
ftell: mov edx,[eax+file_handler.position]
|
|
|
|
ret
|
|
|
|
lseek: ;eax=file edx=pos
|
|
|
|
mov [eax+file_handler.position],edx
|
|
|
|
ret
|
|
|
|
skip: ;eax=file edx=bytes to skip
|
|
|
|
add [eax+file_handler.position],edx
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|