add support for Harvey protection, consolidate similar log messages [fixes Harvey by Primes]

This commit is contained in:
4am 2020-07-14 16:36:31 -04:00
parent d7a79419ef
commit de7f80b18a
10 changed files with 196 additions and 101 deletions

View File

@ -496,3 +496,53 @@ xSVE
!byte $4C,$71,$A9
rts
}
;-------------------------------
; xHarvey
; check if disk has Harvey protection
; which has a one-time RWTS swap
; after loading DOS
;
; in: $B600..$BFFF contains boot1
; out: RWTS may have been patched in memory
; all flags and registers clobbered
;-------------------------------
!zone {
xHarvey
lda #$B7
ldx #$47
ldy #$03
jsr CompareMemory
!byte $4C,$82,$A2
bcs .exit
ldx #$00
stx gAddress
inx
stx gTrack
inx
stx gSector
ldx #$09
stx gAddress+1
jsr ReadSector ; read T01S01 into $900
bcs .exit
lda #$09
ldx #$32
ldy #$18
jsr CompareMemory
!byte $A9,WILDCARD
!byte $8D,$55,$B9
!byte $8D,$7A,$BC
!byte $A9,WILDCARD
!byte $8D,$5D,$B8
!byte $8D,$FC,$B8
!byte $A9,WILDCARD
!byte $8D,$60,$BC
!byte $4C,$84,$9D
bcs .exit
lda #$60
sta $0947 ; RTS instead of JMP
jsr $0932 ; call to apply RWTS patches
lda #kSectorSwitchToBuiltinRWTS
sta T02S0F
.exit rts
}

View File

@ -305,6 +305,7 @@ ADStyle
.noSVE
jsr xB660
jsr xB4BB
jsr xHarvey
jmp ReadWithRWTS
UseUniversal
@ -812,6 +813,7 @@ _applyToAll
!source "patchers/e7everywhere.a" ; gIsBoot0 || gIsProDOS only
!source "patchers/choplifter.a" ; gIsChoplifter only
!source "patchers/pdi.a" ; gIsDiversi only
!source "patchers/harvey.a" ; T01 only
lda gPatchCount
beq .nopatches

40
src/patchers/harvey.a Normal file
View File

@ -0,0 +1,40 @@
;-------------------------------
; #HARVEY
; late-stage RWTS swapper
;
; tested on
; Buzz Bang Harvey (Queue)
; Harvey by Primes (Queue)
;-------------------------------
!zone {
bit gMode ; nothing to do here in verify-only mode
bpl .exit
lda gIsBoot0
bne .exit
ldx gTrack
dex
bne .exit
lda #$01
ldx #$95
ldy #$03
jsr compare ; if T01,S01,$95 ==
!byte $4C,$32,$A3
bcs .exit
lda #$A2
sta gDisplayBytes
lda #$82
sta gDisplayBytes+1
lda #$01
sta gDisplayBytes+2
lda #s_beforedos
jsr PrintByID
lda #$01
inx ; #$96 because both compare and PrintByID preserve X
tay
jsr modify ; then set T01,S01,$96 =
!byte $47
.exit
}

View File

@ -25,9 +25,12 @@
!byte $C8 ; INY
!byte $D0,$F5 ; BNE -
bcs .exit ; passport-test-suite/BackAid.woz [C=0] matches
sta gDisplayBytes+2 ; sector (A is still #$00 here)
lda #$20
sta gDisplayBytes
lda #s_jmpb412
sta gDisplayBytes ; address (hi)
lda #$12
sta gDisplayBytes+1 ; address (lo)
lda #s_beforedos
jsr PrintByID
lda #$00
ldx #$EC

View File

@ -47,8 +47,12 @@
; LDA $C088,X
; JMP $9D84
bcs .exit ; passport-test-suite/Binomial Multiplication.woz [C=0] matches
sta gDisplayBytes
lda #s_jmpb400
sta gDisplayBytes+2 ; sector
lda #$B4
sta gDisplayBytes ; address (hi)
lda #$00
sta gDisplayBytes+1 ; address (lo)
lda #s_beforedos
jsr PrintByID
lda #$03
ldx #$00

View File

@ -25,9 +25,12 @@
!byte $C8 ; INY
!byte $C0,$FF ; CPY #$FF
bcs .exit ; passport-test-suite/America Coast to Coast.woz [C=0] matches
sta gDisplayBytes+2 ; sector (A is still #$00 here)
lda #$B4
sta gDisplayBytes
lda #s_jmpb412
sta gDisplayBytes ; address (hi)
lda #$12
sta gDisplayBytes+1 ; address (lo)
lda #s_beforedos
jsr PrintByID
lda #$00
ldx #$F6

View File

@ -48,7 +48,7 @@
ldx gIsDOS32
bne +
lda #$0A
+ sta gDisplayBytes
+ sta gDisplayBytes+2 ; sector
ldx #$D7
ldy #$04
jsr compare ; and T02,S0x,$D7 ==
@ -63,7 +63,11 @@
bcs .exit ; passport-test-suite/Snooper Troops Case 2.woz [C=0] matches
.found
pha
lda #s_jmpb4bb
lda #$B4
sta gDisplayBytes ; address (hi)
lda #$BB
sta gDisplayBytes+1 ; address (lo)
lda #s_beforedos
jsr PrintByID
pla
inx

View File

@ -75,7 +75,8 @@ T02 !byte $FF,$FF,$FF,$FF,$FF
T02S05 !byte $FF
!byte $FF,$FF,$FF,$FF,$FF,$FF
T02S0C !byte $FF
!byte $FF,$FF,$FF
!byte $FF,$FF
T02S0F !byte $FF
T03 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
T04 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
T05 !byte $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF

View File

@ -61,8 +61,6 @@ StringTableLow
!byte <.rol1e
!byte <.runhello
!byte <.e7
!byte <.jmpb4bb
!byte <.jmpb400
!byte <.jmpbeca
!byte <.bb03
!byte <.thunder
@ -97,7 +95,7 @@ StringTableLow
!byte <.quickdos
!byte <.diversidos
!byte <.prontodos
!byte <.jmpb412
!byte <.beforedos
!byte <.laureate
!byte <.bbf9
!byte <.micrograms
@ -183,8 +181,6 @@ StringTableHigh
!byte >.rol1e
!byte >.runhello
!byte >.e7
!byte >.jmpb4bb
!byte >.jmpb400
!byte >.jmpbeca
!byte >.bb03
!byte >.thunder
@ -219,7 +215,7 @@ StringTableHigh
!byte >.quickdos
!byte >.diversidos
!byte >.prontodos
!byte >.jmpb412
!byte >.beforedos
!byte >.laureate
!byte >.bbf9
!byte >.micrograms
@ -284,7 +280,7 @@ StringTableHigh
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2020-07-13",$00
!text "Passport by 4am 2020-07-14",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "
@ -439,12 +435,6 @@ StringTableHigh
!text "startup program.",$8D,$00
.e7
!text "T%t,S%0 Found E7 bitstream",$8D,$00
.jmpb4bb
!text "T%t,S%0 Disk calls a protection check at"
!text "$B4BB before initializing DOS.",$8D,$00
.jmpb400
!text "T%t,S%0 Disk calls a protection check at"
!text "$B400 before initializing DOS.",$8D,$00
.jmpbeca
!text "T00,S02 RWTS requires extra nibbles and",$8D
!text "timing bits after the data prologue by",$8D
@ -532,9 +522,9 @@ StringTableHigh
!text "T00,S00 Found Diversi-DOS bootloader",$8D,$00
.prontodos
!text "T00,S00 Found Pronto-DOS bootloader",$8D,$00
.jmpb412
!text "T02,S00 Disk calls a protection check",$8D
!text "at $%012 before initializing DOS.",$8D,$00
.beforedos
!text "T%t,S%2 Disk calls a protection check",$8D
!text "at $%0%1 before initializing DOS.",$8D,$00
.laureate
!text "T00,S00 Found Laureate bootloader",$8D,$00
.bbf9

View File

@ -47,79 +47,77 @@ s_jmpbcf0 = $29
s_rol1e = $2A
s_runhello = $2B
s_e7 = $2C
s_jmpb4bb = $2D
s_jmpb400 = $2E
s_jmpbeca = $2F
s_bb03 = $30
s_thunder = $31
s_jmpae8e = $32
s_diskvol = $33
s_d5d5f7 = $34
s_construct= $35
s_datasoftb0 = $36
s_datasoft = $37
s_lsr6a = $38
s_bcs08 = $39
s_jmpb660 = $3A
s_protdos = $3B
s_decryptrwts =$3C
s_protserial = $3D
s_fbff = $3E
s_encoded44 = $3F
s_encoded53 = $40
s_specdel = $41
s_bytrack = $42
s_a5count = $43
s_restart = $44
s_corrupter= $45
s_eab0 = $46
s_eatrk6 = $47
s_eeef = $48
s_poke = $49
s_bootcounter = $4A
s_milliken = $4B
s_jsr8b3 = $4C
s_daviddos = $4D
s_quickdos = $4E
s_diversidos = $4F
s_prontodos = $50
s_jmpb412 = $51
s_laureate = $52
s_bbf9 = $53
s_micrograms = $54
s_cmpbne0 = $55
s_writeram = $56
s_d5timing = $57
s_advint = $58
s_dos32b0 = $59
s_bootwrite = $5A
s_rwtswrite = $5B
s_rdos = $5C
s_sra = $5D
s_muse = $5E
s_origin = $5F
s_volumename = $60
s_dinkeydos = $61
s_trillium = $62
s_tamper = $63
s_microfun = $64
s_advent = $65
s_gathering = $66
s_davidson = $67
s_rdos13 = $68
s_ssi = $69
s_aacount = $6A
s_infocom18 = $6B
s_toverify = $6C
s_13sector = $6D
s_dakin5 = $6E
s_springboard =$6F
s_hallabs = $70
s_holle = $71
s_hoffman = $72
s_diskvol0 = $73
s_e7everywhere=$74
s_choplifter = $75
s_pdi = $76
s_sve = $77
STRINGCOUNT = $78
s_jmpbeca = $2D
s_bb03 = $2E
s_thunder = $2F
s_jmpae8e = $30
s_diskvol = $31
s_d5d5f7 = $32
s_construct= $33
s_datasoftb0 = $34
s_datasoft = $35
s_lsr6a = $36
s_bcs08 = $37
s_jmpb660 = $38
s_protdos = $39
s_decryptrwts =$3A
s_protserial = $3B
s_fbff = $3C
s_encoded44 = $3D
s_encoded53 = $3E
s_specdel = $3F
s_bytrack = $40
s_a5count = $41
s_restart = $42
s_corrupter= $43
s_eab0 = $44
s_eatrk6 = $45
s_eeef = $46
s_poke = $47
s_bootcounter = $48
s_milliken = $49
s_jsr8b3 = $4A
s_daviddos = $4B
s_quickdos = $4C
s_diversidos = $4D
s_prontodos = $4E
s_beforedos = $4F
s_laureate = $50
s_bbf9 = $51
s_micrograms = $52
s_cmpbne0 = $53
s_writeram = $54
s_d5timing = $55
s_advint = $56
s_dos32b0 = $57
s_bootwrite = $58
s_rwtswrite = $59
s_rdos = $5A
s_sra = $5B
s_muse = $5C
s_origin = $5D
s_volumename = $5E
s_dinkeydos = $5F
s_trillium = $60
s_tamper = $61
s_microfun = $62
s_advent = $63
s_gathering = $64
s_davidson = $65
s_rdos13 = $66
s_ssi = $67
s_aacount = $68
s_infocom18 = $69
s_toverify = $6A
s_13sector = $6B
s_dakin5 = $6C
s_springboard =$6D
s_hallabs = $6E
s_holle = $6F
s_hoffman = $70
s_diskvol0 = $71
s_e7everywhere=$72
s_choplifter = $73
s_pdi = $74
s_sve = $75
STRINGCOUNT = $76