maintain gTrack and gSector outside RWTS parameter table (fixes Castle Wolfenstein, other early MUSE)

This commit is contained in:
4am 2017-10-08 17:54:03 -04:00
parent 846becbeed
commit 546494dc88
2 changed files with 23 additions and 7 deletions

View File

@ -9,10 +9,23 @@
; C set if read failed ; C set if read failed
;------------------------------- ;-------------------------------
ReadSector ReadSector
lda #$AA ; lots of custom RWTS routines ;
sta $31 ; need these zero page locations ; Lots of custom RWTS routines need these zero page locations
lda #$AD ; set to magic values ; set to magic values. Always the same values though!
;
lda #$AA
sta $31
lda #$AD
sta $4E 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 lda gIsProtDOS
beq _protread beq _protread
@ -20,7 +33,7 @@ ReadSector
setuprwts setuprwts
ldy #<gRWTSParams ldy #<gRWTSParams
lda #>gRWTSParams lda #>gRWTSParams
callrwts jsr $FF00 ; modified at runtime (see Inspect1) callrwts jsr $FF00 ; modified at runtime
bcc endread bcc endread
lda gOnAClearDayYouCanReadForever lda gOnAClearDayYouCanReadForever
beq setuprwts beq setuprwts
@ -91,10 +104,13 @@ PreReadSector
.exit rts .exit rts
} }
gRWTSParams ; used to read each sector
!byte $01,$60,$01,$00
gTrack !byte $00 gTrack !byte $00
gSector !byte $00 gSector !byte $00
gRWTSParams ; used to read each sector
!byte $01,$60,$01,$00
_track !byte $00
_sector !byte $00
!word dct !word dct
gAddress !word $1F00 gAddress !word $1F00
!byte $00,$00,$01,$00,$FE,$60,$01,$00,$00 !byte $00,$00,$01,$00,$FE,$60,$01,$00,$00

View File

@ -232,7 +232,7 @@ StringTable
; can be set directly before calling PrintByID. ; can be set directly before calling PrintByID.
; ;
.header .header
!text "Passport by 4am 2017-10-07",$00 !text "Passport by 4am 2017-10-08",$00
.mainmenu .mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " " !text " "