add support for SRA protection check hidden in character generator

This commit is contained in:
4am 2017-10-06 10:46:40 -04:00
parent d68ac00436
commit 51d16db26b
3 changed files with 50 additions and 2 deletions

View File

@ -762,6 +762,7 @@ _applyToAll
!source "patchers/advint.a" ; gAdventureInternational only
!source "patchers/jsr8635.a" ; gIsRWTS only
!source "patchers/dos32jmpb4bb.a" ; T01 && gIsDOS32 only
!source "patchers/sra.a" ; gIsDOS32 or gIsRWTS only
lda gPatchCount
beq .nopatches

43
src/patchers/sra.a Normal file
View File

@ -0,0 +1,43 @@
;-------------------------------
; #SRA
; nibble check hidden inside character generator (file named MPG CODE)
; seen on 13- and 16-sector disks by Science Research Associates
;
; tested on
; Decimals C-2 (1981, SRA)
; Decimals C-3 (1981, SRA)
; Fractions C-2 (1981, SRA)
; Fractions C-3 (1981, SRA)
; Multiplication B (1981, SRA)
; Measurement D-1 (1983, SRA)
;-------------------------------
!zone {
lda gIsDOS32
bne +
lda #$0C
bne .start ; always branches
+ lda gIsBoot0
bne .exit
lda #$0F
.start sta .sector+1
.sector lda #$FF ; modified above
sta gDisplayBytes
ldx #$3A
ldy #$09
jsr compare
!byte $20,$00,$7B ; JSR $7B00
!byte $8D,$6C,$7A ; STA $7A6C
!byte $AD,$B1,$78 ; LDA $78B1
bcs .nextsector
lda #s_sra
jsr PrintByID
lda .sector+1
inx
ldy #$02
jsr modify
!byte $0F,$5A ; new JSR entry point
.nextsector
dec .sector+1
bpl .sector
.exit
}

View File

@ -108,7 +108,8 @@ s_dos32b0 = $59
s_bootwrite = $5A
s_rwtswrite = $5B
s_rdos = $5C
STRINGCOUNT = $5D
s_sra = $5D
STRINGCOUNT = $5E
!zone {
StringTable
@ -205,6 +206,7 @@ StringTable
!word .bootwrite
!word .rwtswrite
!word .rdos
!word .sra
;
; Text can contain substitution strings, which
; are replaced by current values at runtime. Each
@ -230,7 +232,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2017-10-01",$00
!text "Passport by 4am 2017-10-06",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -510,4 +512,6 @@ StringTable
!text "T00,S02 Writing built-in RWTS",$8D,$00
.rdos
!text "T00,S00 Found RDOS bootloader",$8D,$00
.sra
!text "T%t,S%0 Found SRA protection check",$8D,$00
}