mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-17 07:58:10 +11:00
fs: fix broken fopn on id > 0
This commit is contained in:
parent
a7ce9f6fc6
commit
2483ee699d
@ -461,6 +461,7 @@ fsGetC:
|
|||||||
; Write byte A in handle (IX) and advance the handle's position.
|
; Write byte A in handle (IX) and advance the handle's position.
|
||||||
; Z is set on success, unset if handle is at the end of the file.
|
; Z is set on success, unset if handle is at the end of the file.
|
||||||
; TODO: detect end of block alloc
|
; TODO: detect end of block alloc
|
||||||
|
; TODO: grow file size if appropriate
|
||||||
fsPutC:
|
fsPutC:
|
||||||
push hl
|
push hl
|
||||||
call fsPlaceH
|
call fsPlaceH
|
||||||
|
@ -71,7 +71,15 @@ fopnCmd:
|
|||||||
push de
|
push de
|
||||||
ld a, (hl) ; file handle index
|
ld a, (hl) ; file handle index
|
||||||
ld de, FS_HANDLES
|
ld de, FS_HANDLES
|
||||||
call addDE ; DE now stores pointer to file handle
|
or a ; cp 0
|
||||||
|
jr z, .noInc ; DE already point to correct handle
|
||||||
|
ld b, a
|
||||||
|
.loop:
|
||||||
|
ld a, FS_HANDLE_SIZE
|
||||||
|
call addDE
|
||||||
|
djnz .loop
|
||||||
|
.noInc:
|
||||||
|
; DE now stores pointer to file handle
|
||||||
inc hl
|
inc hl
|
||||||
call intoHL ; HL now holds the string we look for
|
call intoHL ; HL now holds the string we look for
|
||||||
call fsFindFN
|
call fsFindFN
|
||||||
|
Loading…
Reference in New Issue
Block a user