really support 24-bit seek

This commit is contained in:
Peter Ferrie 2021-10-18 22:01:58 -07:00
parent 68e2fbd688
commit 47ca72a1b7
2 changed files with 41 additions and 21 deletions

View File

@ -149,8 +149,8 @@ CHEATS_ENABLED = %00001000
iCurBlockLo = $D401 ; constant
iCurBlockHi = $D403 ; constant
launchpatch = $D655 ; glue.launch.a
iAddToPath = $FE64 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
itraverse = $D933 ; Roger Rabbit, avoid, use Infiltrator 2 style instead
iAddToPath = $FE6C ; Roger Rabbit, avoid, use Infiltrator 2 style instead
itraverse = $D94A ; Roger Rabbit, avoid, use Infiltrator 2 style instead
ldrhi = $56 ; constant
namlo = $57 ; constant
namhi = $58 ; constant

View File

@ -222,43 +222,63 @@ resetval=$f0
stx blkofflo
stx blkoffhi
stx reqcmd
@seekloop
jsr @reset
ldx sizelo
ldy sizelo
bne @seek64
cmp ldrhi
bcc @seek64
bne @seek32
ldx ldrlo
beq @seek32
@seek64
sta sizehi
sta sizelo
jsr @seekreset
lda ldrhi
sbc #resetval
sta ldrhi
cmp ldrlo
bcc @seek64
@seek32
lda ldrhi
ldx ldrlo
+HIDE_NEXT_BYTE
@seek64
tax
sta sizehi
lda ldrlo
sta sizelo
jsr @seekreset
stx sizelo
lda ldrhi
pha
lda sizehi
pha
lda ldrlo
pha
txa
pha
tya
pha
jsr @seekreset
pla
tay
sec
pla
sta ldrlo
pla
sbc ldrlo
sta ldrlo
pla
sta ldrhi
pla
sbc ldrhi
sta ldrhi
tya
sbc #0
sta sizelo
ora ldrlo
bne @jmp_zp
dec blkidx
sta treeidx
ora ldrhi
bne @seekloop
@link_jmpzp
beq @jmp_zp ;always
jmp @jmp_zp
@seekreset
jsr hddrdwrpart
@reset
lda #resetval
sta blefthi
stx bleftlo
sta bleftlo
rts
@imp_read