From b76b4424319749747e3ad8f1b3b633d71ff45422 Mon Sep 17 00:00:00 2001 From: 4am Date: Wed, 16 Jun 2021 13:36:20 -0400 Subject: [PATCH] shave some bytes --- src/passport.a | 70 +++++++++++++++++++++++++----------- src/patchers/a5count.a | 4 +-- src/patchers/a6bc95.a | 4 +-- src/patchers/bbf9.a | 4 +-- src/patchers/fbffencrypted.a | 5 +-- src/patchers/fbffpascal.a | 6 ++-- src/patchers/hallabs.a | 4 +-- src/patchers/harvey.a | 2 -- src/patchers/jmpb400.a | 4 +-- src/patchers/jmpb412.a | 2 ++ src/patchers/jsr8635.a | 4 +-- src/patchers/leisure.a | 4 +-- src/patchers/memory.config.a | 4 +-- src/patchers/origin.a | 4 +-- src/patchers/pdi.a | 5 +-- src/patchers/polarware.a | 4 +-- src/patchers/prodos6a.a | 4 +-- src/patchers/prodosmecc.a | 6 ++-- src/patchers/prodosrwts.a | 4 +-- src/patchers/sierra.a | 4 +-- src/patchers/sigcheck.a | 4 +-- src/patchers/t02volumename.a | 4 +-- src/strings/en.a | 2 +- 23 files changed, 94 insertions(+), 64 deletions(-) diff --git a/src/passport.a b/src/passport.a index 8b955c9..8a2a402 100755 --- a/src/passport.a +++ b/src/passport.a @@ -283,34 +283,19 @@ AnalyzeTrack ; only run these modules in crack mode !source "patchers/universale7.a" !source "patchers/c9ff.a" - !source "patchers/a6bc95.a" ; gIsPascal only - !source "patchers/a5count.a" ; gIsPascal only !source "patchers/d5d5f7.a" ; gIsPascal || (gIsBoot0 && gPossibleD5D5F7) only - !source "patchers/prodosrwts.a" ; gIsProDOS only - !source "patchers/prodos6a.a" ; gIsProDOS only - !source "patchers/prodosmecc.a" ; gIsProDOS only - !source "patchers/bbf9.a" ; gIsProDOS only - !source "patchers/memory.config.a" ; gIsProDOS only - !source "patchers/origin.a" ; gIsProDOS only !source "patchers/rwtsswapmecc.a" ; gMECCFastloadType || gPossibleMECCSwapper only !source "patchers/meccdqc.a" ; gMECCFastloadType==1 && gT07 only !source "patchers/rwtsswappenguin.a" ; T01 only !source "patchers/protecteddos.a" ; gIsProtDOS only !source "patchers/fbff.a" - !source "patchers/fbffencrypted.a" ; gIsProDOS only - !source "patchers/fbffpascal.a" ; gIsPascal only - !source "patchers/polarware.a" ; gIsProDOS only - !source "patchers/sierra.a" ; gIsBoot0 only !source "patchers/corrupter.a" ; T13 only !source "patchers/ea.a" ; gIsEA || gIsBoot0 only !source "patchers/gamco.a" ; gPossibleGamco only !source "patchers/optimum.a" ; gIsOptimum only !source "patchers/bootcounter.a" ; T01 only - !source "patchers/jmpb412.a" ; T02 only !source "patchers/jmp2012.a" ; T02 only - !source "patchers/jmpb400.a" ; T02 && gIsBoot0 only !source "patchers/advint.a" ; gAdventureInternational only - !source "patchers/jsr8635.a" ; gIsBoot0 only !source "patchers/jmpb4bb.a" ; T02 only !source "patchers/dos32muse.a" ; T01 && gIsDOS32 only !source "patchers/sra.a" ; gIsDOS32 || gIsBoot0 only @@ -325,20 +310,65 @@ AnalyzeTrack !source "patchers/ssi.a" ; gIsRDOS13 only !source "patchers/rdosfmt.a" ; gIsRDOS13 only !source "patchers/aacount.a" - !source "patchers/hallabs.a" ; T01 only !source "patchers/holle.a" ; gIsHolle only !source "patchers/zoomgrafix.a" ; gIsPhoenix only !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 !source "patchers/tsr.a" ; T04 && gIsTSR only !source "patchers/woodbury.a" ; gPossibleWoodbury only - !source "patchers/leisure.a" ; gIsProDOS && T22 only !source "patchers/b4bbbasic.a" ; gPossibleB4BBBasic only !source "patchers/errord51.a" ; gIsLowDOS only - !source "patchers/sigcheck.a" ; gIsDiversi only !source "patchers/555.a" ; gIs555 only + ; + ; DOS 3.3-specific patchers + ; + lda gIsBoot0 + beq + + jmp _endDOS33Patchers ++ + !source "patchers/hallabs.a" ; gIsBoot0 && T01 only + !source "patchers/harvey.a" ; gIsBoot0 && T01 only + !source "patchers/jmpb400.a" ; gIsBoot0 && T02 only + !source "patchers/jmpb412.a" ; gIsBoot0 && T02 only + !source "patchers/jsr8635.a" ; gIsBoot0 only + !source "patchers/sierra.a" ; gIsBoot0 only +_endDOS33Patchers + ; + ; Diversi-DOS-specific patchers + ; + lda gIsDiversi + bne _endDiversiPatchers + !source "patchers/pdi.a" ; gIsDiversi only + !source "patchers/sigcheck.a" ; gIsDiversi only +_endDiversiPatchers + ; + ; ProDOS-specific patchers + ; + lda gIsProDOS + beq + + jmp _endProDOSPatchers ++ + !source "patchers/bbf9.a" ; gIsProDOS only + !source "patchers/fbffencrypted.a" ; gIsProDOS only + !source "patchers/leisure.a" ; gIsProDOS && T22 only + !source "patchers/memory.config.a" ; gIsProDOS only + !source "patchers/origin.a" ; gIsProDOS only + !source "patchers/polarware.a" ; gIsProDOS only + !source "patchers/prodos6a.a" ; gIsProDOS only + !source "patchers/prodosmecc.a" ; gIsProDOS only + !source "patchers/prodosrwts.a" ; gIsProDOS only +_endProDOSPatchers + ; + ; Pascal-specific patchers + ; + lda gIsPascal + beq + + jmp _endPascalPatchers ++ + !source "patchers/a5count.a" ; gIsPascal only + !source "patchers/a6bc95.a" ; gIsPascal only + !source "patchers/fbffpascal.a" ; gIsPascal only +_endPascalPatchers _checkPatchCount lda gPatchCount diff --git a/src/patchers/a5count.a b/src/patchers/a5count.a index 57b77a9..6fe1180 100644 --- a/src/patchers/a5count.a +++ b/src/patchers/a5count.a @@ -5,8 +5,8 @@ ; e.g. Game Frame One, Game Frame Two ;------------------------------- !zone { - lda gIsPascal ; only ever seen this protection - bne .exit ; on Pascal disks + ; gIsPascal is TRUE here + ; (only ever seen this protection on Pascal disks) ldy #$0A jsr SearchTrack diff --git a/src/patchers/a6bc95.a b/src/patchers/a6bc95.a index 021366c..5adf32a 100755 --- a/src/patchers/a6bc95.a +++ b/src/patchers/a6bc95.a @@ -4,8 +4,8 @@ ; e.g. The Secrets of Science Island ;------------------------------- !zone { - lda gIsPascal ; only ever seen this protection - bne .exit ; on Pascal disks + ; gIsPascal is TRUE here + ; (only ever seen this protection on Pascal disks) ldy #$09 jsr SearchTrack diff --git a/src/patchers/bbf9.a b/src/patchers/bbf9.a index e67e76e..d4a0253 100644 --- a/src/patchers/bbf9.a +++ b/src/patchers/bbf9.a @@ -16,8 +16,8 @@ ; 1-2-3 Sequence Me (1991) ;------------------------------- !zone { - lda gIsProDOS - bne .exit + ; gIsProDOS is TRUE here + ldy #$08 jsr SearchTrack !byte $8E,$C0 diff --git a/src/patchers/fbffencrypted.a b/src/patchers/fbffencrypted.a index 535e955..ff240dc 100644 --- a/src/patchers/fbffencrypted.a +++ b/src/patchers/fbffencrypted.a @@ -22,8 +22,9 @@ ; ;------------------------------- !zone { - lda gIsProDOS ; only seen this protection on ProDOS disks - bne .exit + ; gIsProDOS is TRUE here + ; (only ever seen this protection on ProDOS disks) + ldy #$06 jsr SearchTrack ; (all bytes are XOR #$FF) !byte $39,$FD ; DEC $02 diff --git a/src/patchers/fbffpascal.a b/src/patchers/fbffpascal.a index 95d1f83..89acd1e 100644 --- a/src/patchers/fbffpascal.a +++ b/src/patchers/fbffpascal.a @@ -1,5 +1,5 @@ ;------------------------------- -; #FBFF +; #FBFFPASCAL ; a variant of Activision's Timing Bit Detection ; linked as an Apple Pascal module ; (soft switches are hard-coded to slot 6) @@ -12,8 +12,8 @@ ; Power Up! The Typewriter ;------------------------------- !zone { - lda gIsPascal ; only seen this protection on Pascal disks - bne .exit + ; gIsPascal is TRUE here + ldy #$14 jsr SearchTrack !byte $AD,$E9,$C0; LDA $C0E9 diff --git a/src/patchers/hallabs.a b/src/patchers/hallabs.a index 54836f9..443953b 100644 --- a/src/patchers/hallabs.a +++ b/src/patchers/hallabs.a @@ -7,8 +7,8 @@ ; Super Taxman II (HAL Labs) ;------------------------------- !zone { - lda gIsBoot0 - bne .exit + ; gIsBoot0 is TRUE here + ldx gTrack dex bne .exit diff --git a/src/patchers/harvey.a b/src/patchers/harvey.a index d109107..df4b659 100644 --- a/src/patchers/harvey.a +++ b/src/patchers/harvey.a @@ -7,8 +7,6 @@ ; Harvey by Primes (Queue) ;------------------------------- !zone { - lda gIsBoot0 - bne .exit ldx gTrack dex bne .exit diff --git a/src/patchers/jmpb400.a b/src/patchers/jmpb400.a index a24c57b..f0bda4c 100644 --- a/src/patchers/jmpb400.a +++ b/src/patchers/jmpb400.a @@ -14,8 +14,8 @@ ; Success With Math - Multiplying and Dividing Fractions (1984, Mindscape) ;------------------------------- !zone { - lda gIsBoot0 - bne .exit + ; gIsBoot0 is TRUE here + lda gTrack cmp #$02 bne .exit diff --git a/src/patchers/jmpb412.a b/src/patchers/jmpb412.a index d4c3803..ddf717f 100644 --- a/src/patchers/jmpb412.a +++ b/src/patchers/jmpb412.a @@ -11,6 +11,8 @@ ; America Coast to Coast (Mindscape release) ;------------------------------- !zone { + ; gIsBoot0 is TRUE here + lda gTrack cmp #$02 bne .exit diff --git a/src/patchers/jsr8635.a b/src/patchers/jsr8635.a index 7d06aba..3ef341e 100644 --- a/src/patchers/jsr8635.a +++ b/src/patchers/jsr8635.a @@ -12,8 +12,8 @@ ; First Steps to Reading: Phonics II (1985, Grolier) ;------------------------------- !zone { - lda gIsBoot0 - bne .exit + ; gIsBoot0 is TRUE here + lda #$0F sta .sector+1 .sector lda #$FF ; modified at runtime diff --git a/src/patchers/leisure.a b/src/patchers/leisure.a index c03bed2..25c33f5 100644 --- a/src/patchers/leisure.a +++ b/src/patchers/leisure.a @@ -7,8 +7,8 @@ ; - Risk v1.4 (Leisure Genius) ;------------------------------- !zone { - lda gIsProDOS - bne .exit + ; gIsProDOS is TRUE here + lda gTrack cmp #$22 bne .exit diff --git a/src/patchers/memory.config.a b/src/patchers/memory.config.a index 492c7d0..c2ff374 100644 --- a/src/patchers/memory.config.a +++ b/src/patchers/memory.config.a @@ -18,8 +18,8 @@ ; GeoWhiz (1990, Silver Burdett and Ginn) ;------------------------------- !zone { - lda gIsProDOS ; only if ProDOS - bne .exit + ; gIsProDOS is TRUE here + ldy #$0C jsr SearchTrack !byte $AE,$C3,$CF,$CE,$C6,$C9,$C7 ; ".CONFIG" diff --git a/src/patchers/origin.a b/src/patchers/origin.a index 0b78b6f..509354c 100644 --- a/src/patchers/origin.a +++ b/src/patchers/origin.a @@ -12,8 +12,8 @@ ; - Ultima V ;------------------------------- !zone { - lda gIsProDOS ; only if ProDOS - bne .exit + ; gIsProDOS is TRUE here + lda #$0F sta .sector+1 .sector lda #$FF ; modified at runtime diff --git a/src/patchers/pdi.a b/src/patchers/pdi.a index 78db418..e59defa 100644 --- a/src/patchers/pdi.a +++ b/src/patchers/pdi.a @@ -11,8 +11,9 @@ ; - Leadsheeter Utilities ;------------------------------- !zone { - lda gIsDiversi ; only seen this protection on Diversi-DOS disks - bne .exit + ; gIsDiversi is TRUE here + ; (only ever seen this protection on Diversi-DOS disks) + ldy #14 jsr SearchTrack !byte $A0,$0F ; LDY #$0F diff --git a/src/patchers/polarware.a b/src/patchers/polarware.a index 3e4e700..ff691ae 100644 --- a/src/patchers/polarware.a +++ b/src/patchers/polarware.a @@ -15,8 +15,8 @@ ; ;------------------------------- !zone { - lda gIsProDOS ; only seen this protection on ProDOS disks - bne .exit + ; gIsProDOS is TRUE here + ldy #$06 jsr SearchTrack ; (all bytes are XOR #$EF) !byte $29,$6D ; DEC $82 diff --git a/src/patchers/prodos6a.a b/src/patchers/prodos6a.a index 773f7b0..3e2cedf 100644 --- a/src/patchers/prodos6a.a +++ b/src/patchers/prodos6a.a @@ -7,8 +7,8 @@ ; so we get a nice CRACK COMPLETE message) ;------------------------------- !zone { - lda gIsProDOS ; only if ProDOS (separate check for DOS) - bne .exit + ; gIsProDOS is TRUE here + lda #$0F sta .sector+1 .sector lda #$FF ; modified at runtime diff --git a/src/patchers/prodosmecc.a b/src/patchers/prodosmecc.a index 85f1743..917c2a1 100755 --- a/src/patchers/prodosmecc.a +++ b/src/patchers/prodosmecc.a @@ -5,10 +5,8 @@ ; [thanks LoGo] ;------------------------------- !zone { - lda gIsProDOS - beq + - jmp .exit -+ + ; gIsProDOS is TRUE here + ldy #$0E jsr SearchTrack !byte $50,$54,$58,$5C,$60,$64,$68,$00 diff --git a/src/patchers/prodosrwts.a b/src/patchers/prodosrwts.a index f750fc2..6b55dea 100755 --- a/src/patchers/prodosrwts.a +++ b/src/patchers/prodosrwts.a @@ -5,8 +5,8 @@ ;------------------------------- !zone { _prodosrwts - lda gIsProDOS - bne .exit + ; gIsProDOS is TRUE here + ldy #$14 jsr SearchTrack !byte $29,$FC diff --git a/src/patchers/sierra.a b/src/patchers/sierra.a index fc33faf..bc22aa2 100755 --- a/src/patchers/sierra.a +++ b/src/patchers/sierra.a @@ -377,8 +377,8 @@ jmp .exit .dosearch - lda gIsBoot0 - bne .jmpexit + ; gIsBoot0 is TRUE here + ldy #15 jsr SearchTrack !byte $CE,WILDCARD,WILDCARD ;DEC $xxxx diff --git a/src/patchers/sigcheck.a b/src/patchers/sigcheck.a index a7e3551..c40f807 100644 --- a/src/patchers/sigcheck.a +++ b/src/patchers/sigcheck.a @@ -8,8 +8,8 @@ ; - Projectile and Circular Motion ;------------------------------- !zone { - lda gIsDiversi ; only ever seen this protection - bne .exit ; on Diversi-DOS disks + ; gIsDiversi is TRUE here + ; (only ever seen this protection on Diversi-DOS disks) ldy #$0A jsr SearchTrack diff --git a/src/patchers/t02volumename.a b/src/patchers/t02volumename.a index aa0192e..d23dbd8 100644 --- a/src/patchers/t02volumename.a +++ b/src/patchers/t02volumename.a @@ -3,11 +3,11 @@ ; print disk volume name and number after reading track 2 ;------------------------------- !zone { + ; gIsBoot0 is TRUE here + lda gTrack cmp #$02 bne .exit - lda gIsBoot0 - bne .exit lda #$00 ; look for volume name on T02,S00 (Pronto-DOS) jsr .findVolumeName bcc + ; passport-test-suite/America Coast to Coast.woz [C=0] matches diff --git a/src/strings/en.a b/src/strings/en.a index 08c3b3c..f65b4a8 100755 --- a/src/strings/en.a +++ b/src/strings/en.a @@ -341,7 +341,7 @@ StringTableHigh .passport !text "Passport ",$00 .header - !text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-06-14",$00 + !text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-06-16",$00 .bar9 !text "_________",$00 .bar18