From e993eaca0e7f695f8ab9705e3df0b56a836e81bd Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 21 Feb 2017 12:05:23 -0500 Subject: [PATCH 1/9] refactor MECC routines, collapse MECC logging, and add support for another MECC fastloader variant --- src/id/inspect0.a | 31 +++--- src/id/mecc.a | 153 ++++++++++++++--------------- src/passport.a | 7 +- src/patchers/{meccm8.a => mecc1.a} | 2 +- src/patchers/{meccm7.a => mecc2.a} | 2 +- src/patchers/{meccm6.a => mecc3.a} | 8 +- src/patchers/mecc4.a | 73 ++++++++++++++ src/strings/en.a | 28 ++---- 8 files changed, 187 insertions(+), 117 deletions(-) rename src/patchers/{meccm8.a => mecc1.a} (94%) rename src/patchers/{meccm7.a => mecc2.a} (94%) rename src/patchers/{meccm6.a => mecc3.a} (91%) create mode 100644 src/patchers/mecc4.a diff --git a/src/id/inspect0.a b/src/id/inspect0.a index 87e222b..e66e76e 100755 --- a/src/id/inspect0.a +++ b/src/id/inspect0.a @@ -141,19 +141,26 @@ IDBootloader ; jsr IDMECC bcs .notmecc - jsr IDMECCM8 - bcs .notmeccm8 - jmp foundmeccm8 -.notmeccm8 - jsr IDMECCM7 - bcs .notmeccm7 - jmp foundmeccm7 + lda #s_mecc + jsr PrintByID + jsr CopyUniversal + jsr IDMECC1 + bcs .notmecc1 + jmp foundmecc1 +.notmecc1 + jsr IDMECC2 + bcs .notmecc2 + jmp foundmecc2 -.notmeccm7 - jsr IDMECCM6 - bcs .notmeccm6 - jmp foundmeccm6 -.notmeccm6 +.notmecc2 + jsr IDMECC3 + bcs .notmecc3 + jmp foundmecc3 +.notmecc3 + jsr IDMECC4 + bcs .notmecc4 + jmp foundmecc4 +.notmecc4 .notmecc ; ; Try to identify the encrypted Datasoft bootloader. diff --git a/src/id/mecc.a b/src/id/mecc.a index e533389..4aa8ca3 100755 --- a/src/id/mecc.a +++ b/src/id/mecc.a @@ -2,15 +2,18 @@ ; IDMECC ; identify MECC custom bootloader ; note: there are several MECC RWTSes that share -; the same bootloader, so further checks will be -; required to distinguish between them +; the same early bootloader, so further checks +; are required to distinguish between them after +; this function matches ; ; in: track buffer contains T00,S00 ; out: C clear if MECC bootloader was found +; (and track buffer now contains all of track 0) ; C set if not found ; all other flags clobbered ; all registers clobbered ;------------------------------- +!zone { IDMECC lda #$00 ldx #$00 @@ -19,34 +22,37 @@ IDMECC !byte $01,$4C,$1A,$08,$17,$0F,$00,$00 !byte $0D,$0B,$09,$07,$05,$03,$01,$0E !byte $0C,$0A,$08,$06,$04,$02,$0F + bcs .exit + lda #$00 + sta gTrack + sta gAddress + lda #$0F + sta gSector + clc + adc #BASEPAGE + sta gAddress+1 +- jsr ReadSector + bcs .exit + dec gAddress+1 + dec gSector + bne - +.exit rts +} ;------------------------------- -; IDMECCM8 -; identify MECC "M8" bootloader +; IDMECC1 +; identify MECC bootloader variant #1 +; (labeled "M8" on original disks) ; -; in: track buffer contains T00,S00 +; in: track buffer contains all of track 0 ; out: C clear if MECC "M8" bootloader was found ; C set if not found ; all other flags clobbered ; all registers clobbered ;------------------------------- !zone { -IDMECCM8 - lda #$00 - sta gTrack - sta gAddress - lda #$0B - sta gSector - clc - adc #BASEPAGE - sta gAddress+1 - jsr ReadSector - bcs .exit - -; This entry point is also called by the meccm8 patcher -; in lieu of keeping a global variable around. -IDMECCM8RWTS +IDMECC1 lda #$0B ldx #$02 ldy #$06 @@ -84,7 +90,7 @@ IDMECCM8RWTS .exit rts -foundmeccm8 +foundmecc1 ; ; We found an "M8" MECC bootloader. Now we create ; an RWTS that can read the rest of the disk. @@ -92,9 +98,6 @@ foundmeccm8 ; and data prologues based on the parameters of the ; original disk. ; - lda #s_meccb0 - jsr PrintByID - jsr CopyUniversal lda #$00 sta modsrc lda #$0B @@ -124,31 +127,20 @@ foundmeccm8 } ;------------------------------- -; IDMECCM7 -; identify MECC "M7" bootloader +; IDMECC2 +; identify MECC bootloader variant #2 +; (labeled "M7" on original disks) ; -; in: track buffer contains T00,S00 +; in: track buffer contains all of track 0 ; out: C clear if MECC "M7" bootloader was found ; C set if not found ; all other flags clobbered ; all registers clobbered ;------------------------------- !zone { -IDMECCM7 - lda #$00 - sta gTrack - sta gAddress - lda #$07 - sta gSector - clc - adc #BASEPAGE - sta gAddress+1 - jsr ReadSector - bcs .exit -; This entry point is also called by the meccm7 patcher -; in lieu of keeping a global variable around. -IDMECCM7RWTS +IDMECC2 lda #$07 +IDMECC4a ldx #$7D ldy #$06 jsr compare ; IF T00,S07,$7D == @@ -181,7 +173,7 @@ IDMECCM7RWTS .exit rts -foundmeccm7 +foundmecc2 ; ; We found an "M7" MECC bootloader. Now we create ; an RWTS that can read the rest of the disk. @@ -189,17 +181,13 @@ foundmeccm7 ; and data prologues based on the parameters of the ; original disk. ; - lda #s_meccm7 - jsr PrintByID - - jsr CopyUniversal - - lda #$00 - sta modsrc lda #$07 +foundmecc4a clc adc #BASEPAGE sta modsrc+1 + lda #$00 + sta modsrc ldy #$83 lda (modsrc),y lsr @@ -223,34 +211,18 @@ foundmeccm7 } ;------------------------------- -; IDMECCM6 -; identify MECC "M6" bootloader +; IDMECC3 +; identify MECC bootloader (M7 variant +; found in Word Muncher v1.1 and others) ; -; in: track buffer contains T00,S00 -; out: C clear if MECC "M6" bootloader was found +; in: track buffer contains all of track 0 +; out: C clear if this MECC bootloader variant was found ; C set if not found ; all other flags clobbered ; all registers clobbered ;------------------------------- !zone { -IDMECCM6 - lda #$00 - sta gTrack - sta gAddress - lda #$0B - sta gSector - clc - adc #BASEPAGE - sta gAddress+1 - jsr ReadSector - bcs .exit - dec gSector - dec gAddress+1 - jsr ReadSector - bcs .exit -; This entry point is also called by the meccm6 patcher -; in lieu of keeping a global variable around. -IDMECCM6RWTS +IDMECC3 lda #$0A ldx #$E2 ldy #$06 @@ -285,19 +257,14 @@ IDMECCM6RWTS .exit rts -foundmeccm6 +foundmecc3 ; -; We found an "M6" MECC bootloader. Now we create +; We found a MECC bootloader. Now we create ; an RWTS that can read the rest of the disk. ; Starting with our built-in RWTS, we modify address ; and data prologues based on the parameters of the ; original disk. ; - lda #s_meccm6 - jsr PrintByID - - jsr CopyUniversal - lda #$00 sta modsrc lda #$0A @@ -326,3 +293,33 @@ foundmeccm6 sta $B8FC jmp ADStyle } + +;------------------------------- +; IDMECC4 +; identify MECC bootloader variant #4 +; (labeled "M7" on original disks) +; same as variant #2 but everything is +; on T00,S08 instead of T00,S07 +; +; in: track buffer contains all of track 0 +; out: C clear if MECC bootloader was found +; C set if not found +; all other flags clobbered +; all registers clobbered +;------------------------------- +!zone { +IDMECC4 + lda #$08 + jmp IDMECC4a + +foundmecc4 +; +; We found a MECC bootloader. Now we create +; an RWTS that can read the rest of the disk. +; Starting with our built-in RWTS, we modify address +; and data prologues based on the parameters of the +; original disk. +; + lda #$08 + jmp foundmecc4a +} diff --git a/src/passport.a b/src/passport.a index 5a6569e..0e62cde 100755 --- a/src/passport.a +++ b/src/passport.a @@ -670,9 +670,10 @@ _applyToT00 !source "patchers/bademu.a" !source "patchers/bademu2.a" !source "patchers/rwts.a" - !source "patchers/meccm8.a" - !source "patchers/meccm7.a" - !source "patchers/meccm6.a" + !source "patchers/mecc1.a" + !source "patchers/mecc2.a" + !source "patchers/mecc3.a" + !source "patchers/mecc4.a" !source "patchers/rol1e.a" !source "patchers/jmpb4bb.a" !source "patchers/jmpb4bbhi.a" diff --git a/src/patchers/meccm8.a b/src/patchers/mecc1.a similarity index 94% rename from src/patchers/meccm8.a rename to src/patchers/mecc1.a index d92d7e9..88c8098 100755 --- a/src/patchers/meccm8.a +++ b/src/patchers/mecc1.a @@ -8,7 +8,7 @@ _meccm8 jsr IDMECC bcs .exit - jsr IDMECCM8RWTS + jsr IDMECC1 bcs .exit lda #$0B ldx #$08 diff --git a/src/patchers/meccm7.a b/src/patchers/mecc2.a similarity index 94% rename from src/patchers/meccm7.a rename to src/patchers/mecc2.a index 3a573c2..5c958b0 100755 --- a/src/patchers/meccm7.a +++ b/src/patchers/mecc2.a @@ -8,7 +8,7 @@ _meccm7 jsr IDMECC bcs .exit - jsr IDMECCM7RWTS + jsr IDMECC2 bcs .exit lda #$07 ldx #$83 diff --git a/src/patchers/meccm6.a b/src/patchers/mecc3.a similarity index 91% rename from src/patchers/meccm6.a rename to src/patchers/mecc3.a index fa1eda0..e379de5 100644 --- a/src/patchers/meccm6.a +++ b/src/patchers/mecc3.a @@ -1,14 +1,14 @@ ;------------------------------- -; #MECCM6 +; #MECC3 ; MECC fastloader with custom ; address and data prologues -; e.g. early versions of Word Munchers +; e.g. Word Munchers v1.1 ;------------------------------- !zone { -_meccm6 +_mecc3 jsr IDMECC bcs .exit - jsr IDMECCM6RWTS + jsr IDMECC3 bcs .exit lda #$0A ldx #$E8 diff --git a/src/patchers/mecc4.a b/src/patchers/mecc4.a new file mode 100644 index 0000000..545fdf1 --- /dev/null +++ b/src/patchers/mecc4.a @@ -0,0 +1,73 @@ +;------------------------------- +; #MECC4 +; MECC fastloader with custom +; address and data prologues +; e.g. A-201 Conquering Whole Numbers +;------------------------------- +!zone { +_mecc4 + jsr IDMECC + bcs .exit + jsr IDMECC4 + bcs .exit + lda #$08 + ldx #$83 + ldy #$01 + jsr compare ; if T00,S08,$83 != + !byte $D5 + bcc .addr2 + ldy #$01 + jsr modify ; then set T00,S08,$83 = + !byte $D5 +.addr2 + lda #$08 + ldx #$8D + ldy #$01 + jsr compare ; if T00,S08,$8D != + !byte $AA + bcc .addr3 + ldy #$01 + jsr modify ; then set T00,S08,$8D = + !byte $AA +.addr3 + lda #$08 + ldx #$98 + ldy #$01 + jsr compare ; if T00,S08,$98 != + !byte $96 + bcc .data1 + ldy #$01 + jsr modify ; then set T00,S08,$98 = + !byte $96 +.data1 + lda #$08 + ldx #$15 + ldy #$01 + jsr compare ; if T00,S08,$15 != + !byte $D5 + bcc .data2 + ldy #$01 + jsr modify ; then set T00,S08,$15 = + !byte $D5 +.data2 + lda #$08 + ldx #$1F + ldy #$01 + jsr compare ; if T00,S08,$1F != + !byte $AA + bcc .data3 + ldy #$01 + jsr modify ; then set T00,S08,$1F = + !byte $AA +.data3 + lda #$08 + ldx #$2A + ldy #$01 + jsr compare ; if T00,S08,$2A != + !byte $AD + bcc .exit + ldy #$01 + jsr modify ; then set T00,S08,$2A = + !byte $AD +.exit +} diff --git a/src/strings/en.a b/src/strings/en.a index 1e6d8c7..f0ed22f 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -53,7 +53,7 @@ s_modifyto = $22 s_dosb0 = $23 s_prodosb0 = $24 s_pascalb0 = $25 -s_meccb0 = $26 +s_mecc = $26 s_sierra = $27 s_a6bc95 = $28 s_jmpbcf0 = $29 @@ -68,7 +68,7 @@ s_thunder = $31 s_jmpae8e = $32 s_diskvol = $33 s_d5d5f7 = $34 -s_meccm7 = $35 +s_construct= $35 s_datasoftb0 = $36 s_datasoft = $37 s_lsr6a = $38 @@ -89,9 +89,7 @@ s_eab0 = $46 s_eatrk6 = $47 s_eeef = $48 s_poke = $49 -s_construct= $4A -s_meccm6 = $4B -STRINGCOUNT = $4C +STRINGCOUNT = $4A !zone { StringTable @@ -133,7 +131,7 @@ StringTable !word .dosboot0 !word .prodosboot0 !word .pascalboot0 - !word .meccboot0 + !word .mecc !word .sierra !word .a6bc95 !word .jmpbcf0 @@ -148,7 +146,7 @@ StringTable !word .jmpae8e !word .diskvol !word .d5d5f7 - !word .meccm7 + !word .construct !word .datasoftb0 !word .datasoft !word .lsr6a @@ -169,8 +167,6 @@ StringTable !word .eatrk6 !word .eeef !word .poke - !word .construct - !word .meccm6 ; ; Text can contain substitution strings, which ; are replaced by current values at runtime. Each @@ -196,7 +192,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-02-20",00 + !text "Passport by 4am 2017-02-21",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " @@ -335,8 +331,8 @@ StringTable !text "T00,S00 Found ProDOS bootloader",$8D,00 .pascalboot0 !text "T00,S00 Found Pascal bootloader",$8D,00 -.meccboot0 - !text "T00 Found MECC M8 bootloader",$8D,00 +.mecc + !text "T00,S00 Found MECC bootloader",$8D,00 .sierra !text "T%t,S%0 Found Sierra protection check",$8D,00 .a6bc95 @@ -378,8 +374,8 @@ StringTable !text "disk volume number.",$8D,00 .d5d5f7 !text "T%t,S%0 Found D5D5F7 protection check",$8D,00 -.meccm7 - !text "T00 Found MECC M7 bootloader",$8D,00 +.construct + !text "T01,S0F Reconstructing missing data",$8D,$00 .datasoftb0 !text "T00,S00 Found Datasoft bootloader",$8D,00 .datasoft @@ -431,8 +427,4 @@ StringTable .poke !text "T%t,S%0 BASIC program POKEs protection",$8D !text "check into memory and CALLs it.",$8D,$00 -.construct - !text "T01,S0F Reconstructing missing data",$8D,$00 -.meccm6 - !text "T00 Found MECC M6 bootloader",$8D,00 } From 4e97ab1740f3d95a8358ac065ce9d9bd7f56a76d Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 21 Feb 2017 12:12:45 -0500 Subject: [PATCH 2/9] update comments --- src/id/mecc.a | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/id/mecc.a b/src/id/mecc.a index 4aa8ca3..007e696 100755 --- a/src/id/mecc.a +++ b/src/id/mecc.a @@ -92,7 +92,7 @@ IDMECC1 foundmecc1 ; -; We found an "M8" MECC bootloader. Now we create +; We found a MECC bootloader. Now we create ; an RWTS that can read the rest of the disk. ; Starting with our built-in RWTS, we modify address ; and data prologues based on the parameters of the @@ -175,7 +175,7 @@ IDMECC4a foundmecc2 ; -; We found an "M7" MECC bootloader. Now we create +; We found a MECC bootloader. Now we create ; an RWTS that can read the rest of the disk. ; Starting with our built-in RWTS, we modify address ; and data prologues based on the parameters of the @@ -297,7 +297,7 @@ foundmecc3 ;------------------------------- ; IDMECC4 ; identify MECC bootloader variant #4 -; (labeled "M7" on original disks) +; (labeled "M8" on original disks) ; same as variant #2 but everything is ; on T00,S08 instead of T00,S07 ; From eac74b2d1a34e7e971cb959c1061c1cc1c5a4d0a Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 25 Feb 2017 10:40:02 -0500 Subject: [PATCH 3/9] tweak a6bc95 patcher again [fixes Countries of the World] --- src/patchers/a6bc95.a | 6 ++---- src/strings/en.a | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/patchers/a6bc95.a b/src/patchers/a6bc95.a index 1a7992c..acbcd8c 100755 --- a/src/patchers/a6bc95.a +++ b/src/patchers/a6bc95.a @@ -15,19 +15,17 @@ _a6bc95 !byte $C9,$A6 ; CMP #$A6 !byte $D0,$ED ; BNE -$ED bcs .exit - ldy #$09 + ldy #$07 jsr SearchTrack !byte $BD,$8C,$C0; LDA $C08C,X !byte $10,$FB ; BPL -$FB !byte $C9,$BC ; CMP #$BC - !byte $D0,$E4 ; BNE -$E4 bcs .exit - ldy #$09 + ldy #$07 jsr SearchTrack !byte $BD,$8C,$C0; LDA $C08C,X !byte $10,$FB ; BPL -$FB !byte $C9,$95 ; CMP #$95 - !byte $D0,$DB ; BNE -$DB bcs .exit ldy #$0E jsr SearchTrack diff --git a/src/strings/en.a b/src/strings/en.a index f0ed22f..57d0782 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -192,7 +192,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-02-21",00 + !text "Passport by 4am 2017-02-25",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " From 53df548d9f63a5dbb830de0f14cdccdbaada6aca Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Fri, 3 Mar 2017 08:32:45 -0800 Subject: [PATCH 4/9] fix Arctic Fox --- src/patchers/ea.a | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/patchers/ea.a b/src/patchers/ea.a index cd6659b..075c595 100644 --- a/src/patchers/ea.a +++ b/src/patchers/ea.a @@ -177,6 +177,37 @@ _ea jsr modify !byte $00 ;new checksum value for cmp ++ ldy #9 + jsr SearchTrack + !byte $20,$84,$6E ;JSR $6E84 + !byte $A5,$11 ;LDA $11 + !byte $C9,$52 ;CMP #$52 + !byte $F0,$03 ;BEQ +$03 + bcs + + inx + inx + inx + inx + inx + inx + ldy #1 + jsr modify + !byte $50 ;new checksum value for cmp + ++ ldy #7 + jsr SearchTrack + !byte $20,$86,$6E ;JSR $6E86 + !byte $C9,$52 ;CMP #$52 + !byte $D0,$DB ;BNE -$DB + bcs + + inx + inx + inx + inx + ldy #1 + jsr modify + !byte $50 ;new checksum value for cmp + + ldy #12 jsr SearchTrack !byte $20,$3E,$91 ;JSR $913E From 51323ea92b9a8e58ea586d005e97fa4e4d14fd7d Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 3 Mar 2017 11:50:27 -0500 Subject: [PATCH 5/9] fix RELBASE and build date after latest EA patches --- src/passport.a | 2 +- src/strings/en.a | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/passport.a b/src/passport.a index 0e62cde..2842f5f 100755 --- a/src/passport.a +++ b/src/passport.a @@ -94,7 +94,7 @@ flag = $FF ; byte } ; Application constants (not zero addresses) -RELBASE = $6800 ; address to move Passport code +RELBASE = $6700 ; address to move Passport code ; so that it's out of the way LOWPOINT = $4300 ; lowest available address for code BASEPAGE = $10 ; Special Delivery tracer assumes diff --git a/src/strings/en.a b/src/strings/en.a index 57d0782..a458d25 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -192,7 +192,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-02-25",00 + !text "Passport by 4am 2017-03-03",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " From 22c8342ee3781c8aa1c1d335b7a6260993eb696e Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Fri, 3 Mar 2017 20:15:02 -0800 Subject: [PATCH 6/9] fix Boulder Dash --- src/patchers/ea.a | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/patchers/ea.a b/src/patchers/ea.a index 075c595..eef7cda 100644 --- a/src/patchers/ea.a +++ b/src/patchers/ea.a @@ -256,7 +256,7 @@ _ea !byte $05,$CC,$DC ;JSRA $05cf !byte $04,$EB,$19 ;LDA $c0e8 !byte $04,$E1,$DE ;LDA $07e2 - bcs .exit + bcs + pha txa adc #21 @@ -266,6 +266,24 @@ _ea jsr modify !byte $E0 ;lda from known-zero instead ++ ldy #16 + jsr SearchTrack + !byte $49,$4E ;EOR #$4E + !byte $09,$2B ;ORA #$2B + !byte $48 ;PHA + !byte $A9,$04 ;LDA #$04 + !byte $48 ;PHA + !byte $A5,$4F ;LDA $4F + !byte $45,$4F ;EOR $4F + !byte $18 ;CLC + !byte $E9,$00 ;SBC #$00 + !byte $48 ;PHA + bcs .exit + inx + ldy #1 + jsr modify + !byte $E8 ;new checksum value for eor + .dostitles lda gIsBoot0 bne .exit From 438711b396dd3852d6da6b595d34ccb4836cb264 Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 4 Mar 2017 10:29:44 -0500 Subject: [PATCH 7/9] add support for detecting ProDOS RWTS that alternates D4/D5 prologue, requires timing bit for address epilogue --- src/passport.a | 1 + src/patchers/prodos6a.a | 38 ++++++++++++++++++++++++++++++++++++++ src/patchers/rwts.a | 2 ++ src/strings/en.a | 6 +++--- 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 src/patchers/prodos6a.a diff --git a/src/passport.a b/src/passport.a index 2842f5f..a884a01 100755 --- a/src/passport.a +++ b/src/passport.a @@ -697,6 +697,7 @@ _applyToAll !source "patchers/a5count.a" !source "patchers/d5d5f7.a" !source "patchers/prodosrwts.a" + !source "patchers/prodos6a.a" !source "patchers/prodosmecc.a" !source "patchers/rwtsswapmecc.a" !source "patchers/protecteddos.a" diff --git a/src/patchers/prodos6a.a b/src/patchers/prodos6a.a new file mode 100644 index 0000000..de24ba9 --- /dev/null +++ b/src/patchers/prodos6a.a @@ -0,0 +1,38 @@ +;------------------------------- +; #PRODOS6A +; disk allows either $D4 or $D5 for the +; first address prologue nibble +; (no patches required, but we want to +; log it) +;------------------------------- +!zone { +prodos6a + lda gIsProDOS ; only if ProDOS (separate check for DOS) + bne .exit + lda #$0F + sta .sector+1 +.sector lda #$FF ; modified at runtime + sta gDisplayBytes + ldx #$A5 + ldy #$08 + jsr compare + !byte $BD,$8C,$C0,$10,$FB,$4A,$C9,$6A + bcs + + lda #s_lsr6a + jsr PrintByID + inc gPatchCount ++ + lda .sector+1 + ldx #$EF + ldy #$07 + jsr compare + !byte $48,$68,$BD,$8C,$C0,$C9,$08 + bcs .nextsector + lda #s_bcs08 + jsr PrintByID + inc gPatchCount +.nextsector + dec .sector+1 + bpl .sector +.exit +} diff --git a/src/patchers/rwts.a b/src/patchers/rwts.a index 22c1df6..5b6dba4 100755 --- a/src/patchers/rwts.a +++ b/src/patchers/rwts.a @@ -634,6 +634,7 @@ rwtspatcher lda gIsRWTS ; if DOS 3.3 RWTS bne .lsr6a lda #$03 + sta gDisplayBytes ldx #$4F ldy #$0A jsr compare ; and T00,S03,$4F == @@ -654,6 +655,7 @@ rwtspatcher lda gIsRWTS ; if DOS 3.3 RWTS bne .bcs08 lda #$03 + sta gDisplayBytes ldx #$8B ldy #$15 jsr compare ; and T00,S03,$8B == diff --git a/src/strings/en.a b/src/strings/en.a index a458d25..7bfafd1 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -192,7 +192,7 @@ StringTable ; can be set directly before calling PrintByID. ; .header - !text "Passport by 4am 2017-03-03",00 + !text "Passport by 4am 2017-03-04",00 .mainmenu !text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D !text " " @@ -381,10 +381,10 @@ StringTable .datasoft !text "T%t,S%0 Found Datasoft protection check",$8D,00 .lsr6a - !text "T00,S03 RWTS accepts $D4 or $D5 for the",$8D + !text "T%t,S%0 RWTS accepts $D4 or $D5 for the",$8D !text "first address prologue nibble.",$8D,00 .bcs08 - !text "T00,S03 RWTS accepts $DE or a timing bit" + !text "T%t,S%0 RWTS accepts $DE or a timing bit" !text "for the first address epilogue nibble.",$8D,00 .jmpb660 !text "T00,S02 RWTS requires timing bits after",$8D From 5aa05b7cebff251219067fa925e6a3af9931e674 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sat, 4 Mar 2017 16:54:39 -0800 Subject: [PATCH 8/9] support Bard's Tale II --- src/patchers/ea.a | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/patchers/ea.a b/src/patchers/ea.a index eef7cda..6605e38 100644 --- a/src/patchers/ea.a +++ b/src/patchers/ea.a @@ -266,6 +266,26 @@ _ea jsr modify !byte $E0 ;lda from known-zero instead ++ ldy #23 + jsr SearchTrack + !byte $03,$4C ;LDI #$00 + !byte $07,$E1,$DE ;STA $07e2 + !byte $04,$CC,$DC ;JSRA $05cf + !byte $04,$CC,$DC ;JSRA $05cf + !byte $04,$CC,$DC ;JSRA $05cf + !byte $04,$CC,$DC ;JSRA $05cf + !byte $05,$EB,$19 ;LDA $c0e8 + !byte $05,$E1,$DE ;LDA $07e2 + bcs + + pha + txa + adc #21 + tax + pla + ldy #1 + jsr modify + !byte $E0 ;lda from known-zero instead + + ldy #16 jsr SearchTrack !byte $49,$4E ;EOR #$4E From 6eaa2b42c406716f55a927ddcc43f86a877a3b2b Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Sat, 4 Mar 2017 18:28:27 -0800 Subject: [PATCH 9/9] support PCS 1983 --- src/id/trace.a | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/id/trace.a b/src/id/trace.a index 4fccdbf..682cecb 100755 --- a/src/id/trace.a +++ b/src/id/trace.a @@ -60,11 +60,13 @@ _Inspect1a clc adc #$06 sta b4bbcompare+1 - sec - sbc #$02 - sta .x3+1 - sta .x4+1 - sta callrwts+2 + tax + dex + stx .x5+1 + dex + stx .x3+1 + stx .x4+1 + stx callrwts+2 jsr ProtectedDOS ; check for a specific (encrypted) ; bootloader called "Protected DOS" bcs .notprotdos @@ -96,7 +98,7 @@ _Inspect1a ldy #$02 jsr CompareMemory !byte $20,00 - bcc + + bcc .x5 ; ; Check for RWTS variant that has extra code before ; JSR $B800 e.g. Verb Viper (DLM), Advanced Analogies (Hartley) @@ -106,7 +108,19 @@ _Inspect1a ldy #$02 jsr CompareMemory !byte $20,00 - bcc + + bcc .x5 + jmp UseUniversal ; give up tracing; this RWTS is unsupported +; +; Check for RWTS variant that uses non-standard address for slot +; LDX $1FE8 e.g. Pinball Construction Set (1983) +; we don't like that one +; +.x5 lda #$FF ; check for "LDX $1FE8" at $BE43 + ldx #$43 + ldy #$03 + jsr CompareMemory + !byte $AE,$E8,$1F + bcs + jmp UseUniversal ; give up tracing; this RWTS is unsupported + jmp ADStyle ; use this RWTS to read the disk