From 47ca72a1b7d8305137020e5125446ba545f738f0 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Mon, 18 Oct 2021 22:01:58 -0700 Subject: [PATCH] really support 24-bit seek --- src/constants.a | 4 +-- src/prodos.impl.lc2.a | 58 +++++++++++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/src/constants.a b/src/constants.a index 3fe32c0ec..159f1ede2 100644 --- a/src/constants.a +++ b/src/constants.a @@ -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 diff --git a/src/prodos.impl.lc2.a b/src/prodos.impl.lc2.a index ded4f1355..9e41971c2 100644 --- a/src/prodos.impl.lc2.a +++ b/src/prodos.impl.lc2.a @@ -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