blockdev: fix broken blkSeek/blkTell

scas didn't warn about this, but it seems that `jr` calls were out of
range. Seek and Tell was broken. Replacing `jr` with `jp` does the
trick.
This commit is contained in:
Virgil Dupras 2019-05-12 13:57:37 -04:00
parent c77d96da22
commit 1ea5bedb4f

View File

@ -37,6 +37,8 @@
; ;
; Tell: ; Tell:
; Return the position of the "pointer" in HL ; Return the position of the "pointer" in HL
;
; All routines are expected to preserve unused registers.
; *** DEFINES *** ; *** DEFINES ***
@ -69,8 +71,9 @@ blkSel:
push af push af
push de push de
push hl push hl
ld hl, blkDevTbl ld hl, blkDevTbl
cp 0 or a ; cp 0
jr z, .afterloop ; index is zero? don't loop jr z, .afterloop ; index is zero? don't loop
push bc push bc
ld b, a ld b, a
@ -81,31 +84,32 @@ blkSel:
pop bc pop bc
.afterloop: .afterloop:
push hl push hl
call intoHL call intoHL
call writeHLinDE call writeHLinDE
inc de inc de
inc de inc de
pop hl pop hl
inc hl inc hl
inc hl inc hl
push hl push hl
call intoHL call intoHL
call writeHLinDE call writeHLinDE
inc de inc de
inc de inc de
pop hl pop hl
inc hl inc hl
inc hl inc hl
push hl push hl
call intoHL call intoHL
call writeHLinDE call writeHLinDE
inc de inc de
inc de inc de
pop hl pop hl
inc hl inc hl
inc hl inc hl
call intoHL call intoHL
call writeHLinDE call writeHLinDE
pop hl pop hl
pop de pop de
pop af pop af
@ -236,12 +240,12 @@ _blkSeek:
ld hl, 0xffff ld hl, 0xffff
.seek: .seek:
pop de pop de
jr _blkCall jp _blkCall
; Returns the current position of the selected device in HL. ; Returns the current position of the selected device in HL.
blkTell: blkTell:
ld ix, (BLOCKDEV_TELL) ld ix, (BLOCKDEV_TELL)
jr _blkCall jp _blkCall
; This label is at the end of the file on purpose: the glue file should include ; This label is at the end of the file on purpose: the glue file should include
; a list of device routine table entries just after the include. Each line ; a list of device routine table entries just after the include. Each line