pgm: adapt to recent blkdev change
With fsGetC becoming a "random address" API, it broke pgm. This commit fixes it. To avoid adding the weight of a blkdev in pgm, I manage the read offset directly in pgm.
This commit is contained in:
parent
c18d42f08b
commit
a7ce9f6fc6
@ -452,15 +452,21 @@ fsGetC:
|
||||
xor a
|
||||
jp unsetZ ; returns
|
||||
.proceed:
|
||||
push hl
|
||||
call fsPlaceH
|
||||
jp fsblkGetC ; returns
|
||||
call fsblkGetC
|
||||
pop hl
|
||||
ret
|
||||
|
||||
; 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.
|
||||
; TODO: detect end of block alloc
|
||||
fsPutC:
|
||||
push hl
|
||||
call fsPlaceH
|
||||
jp fsblkPutC ; returns
|
||||
call fsblkPutC
|
||||
pop hl
|
||||
ret
|
||||
|
||||
; Mount the fs subsystem upon the currently selected blockdev at current offset.
|
||||
; Verify is block is valid and error out if its not, mounting nothing.
|
||||
|
@ -57,11 +57,13 @@ pgmRun:
|
||||
push hl ; unparsed args
|
||||
ld ix, PGM_HANDLE
|
||||
call fsOpen
|
||||
ld hl, PGM_CODEADDR
|
||||
ld hl, 0 ; addr that we read in file handle
|
||||
ld de, PGM_CODEADDR ; addr in mem we write to
|
||||
.loop:
|
||||
call fsGetC ; we use Z at end of loop
|
||||
ld (hl), a ; Z preserved
|
||||
ld (de), a ; Z preserved
|
||||
inc hl ; Z preserved in 16-bit
|
||||
inc de ; Z preserved in 16-bit
|
||||
jr z, .loop
|
||||
|
||||
pop hl ; recall args
|
||||
|
Loading…
Reference in New Issue
Block a user