From 546494dc88de15d13a5b330c21939be7ed97dcb3 Mon Sep 17 00:00:00 2001 From: 4am Date: Sun, 8 Oct 2017 17:54:03 -0400 Subject: [PATCH] maintain gTrack and gSector outside RWTS parameter table (fixes Castle Wolfenstein, other early MUSE) --- src/rwts.a | 28 ++++++++++++++++++++++------ src/strings/en.a | 2 +- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/rwts.a b/src/rwts.a index 9f41734..69020ed 100755 --- a/src/rwts.a +++ b/src/rwts.a @@ -9,10 +9,23 @@ ; C set if read failed ;------------------------------- ReadSector - lda #$AA ; lots of custom RWTS routines - sta $31 ; need these zero page locations - lda #$AD ; set to magic values +; +; Lots of custom RWTS routines need these zero page locations +; set to magic values. Always the same values though! +; + lda #$AA + sta $31 + lda #$AD sta $4E +; +; Copy requested track and sector into RWTS parameter table. +; These are maintained outside the table because some disks +; alter the values from inside the RWTS. (MUSE) +; + lda gTrack + sta _track + lda gSector + sta _sector lda gIsProtDOS beq _protread @@ -20,7 +33,7 @@ ReadSector setuprwts ldy #gRWTSParams -callrwts jsr $FF00 ; modified at runtime (see Inspect1) +callrwts jsr $FF00 ; modified at runtime bcc endread lda gOnAClearDayYouCanReadForever beq setuprwts @@ -91,10 +104,13 @@ PreReadSector .exit rts } -gRWTSParams ; used to read each sector - !byte $01,$60,$01,$00 gTrack !byte $00 gSector !byte $00 + +gRWTSParams ; used to read each sector + !byte $01,$60,$01,$00 +_track !byte $00 +_sector !byte $00 !word dct gAddress !word $1F00 !byte $00,$00,$01,$00,$FE,$60,$01,$00,$00 diff --git a/src/strings/en.a b/src/strings/en.a index b4f5526..e1443c8 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -232,7 +232,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-10-07",$00 + !text "Passport by 4am 2017-10-08",$00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " "