add support for Swordthrust RWTS

This commit is contained in:
4am 2018-10-04 10:29:00 -04:00
parent 132a8eb138
commit 26ae141203
4 changed files with 72 additions and 1 deletions

View File

@ -209,6 +209,35 @@ _Inspect1a
bcs + bcs +
jsr $BC61 jsr $BC61
; ;
; Check for alternate RWTS entry point (e.g. Swordthrust)
;
+ lda jCallRWTS+2
sec
sbc #$06
ldx #$75
ldy #(@end_swordthrust-@begin_swordthrust)
jsr CompareMemory
@begin_swordthrust
PHP
SEI
PHA
LDX $B7EC
LDA $BED0,X
EOR $B942
STA $B8FC
STA $B85D
PLA
JSR $BD00
@end_swordthrust
bcs +
stx jCallRWTS+1; set new RWTS entry point to $B775
lda #$B7
sta jCallRWTS+2
lda #<gTrack ; this entry point assumes track number is in $B7EC
sta $B779 ; which isn't true, so change the code to look at
lda #>gTrack ; Passport's gTrack instead
sta $B77A
;
; good to go ; good to go
; ;
+ jmp ADStyle ; use this RWTS to read the disk + jmp ADStyle ; use this RWTS to read the disk

View File

@ -110,6 +110,7 @@ AnalyzeT00
!source "../patchers/microfun2.a" !source "../patchers/microfun2.a"
!source "../patchers/panglosdos.a" !source "../patchers/panglosdos.a"
!source "../patchers/rdos13.a" !source "../patchers/rdos13.a"
!source "../patchers/swordthrust.a"
;add only above this line ;add only above this line
rts rts

View File

@ -0,0 +1,41 @@
;-------------------------------
; #SWORDTHRUST
; custom RWTS entry point at $B775 changes parameters based on track
;
; Tested on
; - Swordthrust
;-------------------------------
!zone {
bit gMode ; nothing to do here in verify-only mode
bpl .exit
lda #$01
ldx #$75
ldy #(@end_swordthrust-@begin_swordthrust)
jsr compare
@begin_swordthrust
PHP
SEI
PHA
LDX $B7EC
LDA $BED0,X
EOR $B942
STA $B8FC
STA $B85D
PLA
JSR $BD00
@end_swordthrust
bcs .exit
sta gDisplayBytes
lda #s_bytrack
jsr PrintByID
lda #$01
ldx #$81
ldy #$01
jsr modify
!byte $2C
ldx #$84
ldy #$01
jsr modify
!byte $2C
.exit
}

View File

@ -147,7 +147,7 @@ StringTable
; can be set directly before calling PrintByID. ; can be set directly before calling PrintByID.
; ;
.header .header
!text "Passport by 4am 2018-10-03",$00 !text "Passport by 4am 2018-10-04",$00
.mainmenu .mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " " !text " "