diff --git a/src/adstyle.a b/src/adstyle.a index 2872bd5..a48a2fb 100644 --- a/src/adstyle.a +++ b/src/adstyle.a @@ -217,8 +217,7 @@ b4bbcompare bcs _b4bbexit lda #$0C ldx #$84 - ldy #$03 - jsr compare + jsr compare3 !byte $4C,$BB,$B4 bcs _b4bbexit ldx #$02 ; track diff --git a/src/apicode.a b/src/apicode.a index 3284825..1eb8349 100644 --- a/src/apicode.a +++ b/src/apicode.a @@ -33,10 +33,18 @@ jmp modify ;jmodify1 jmp modify1 +;jmodify2 + jmp modify2 +;jmodify3 + jmp modify3 ;jcompare jmp compare ;jcompare1 jmp compare1 +;jcompare2 + jmp compare2 +;jcompare3 + jmp compare3 ;gDisplayBytes !fill 10 ; array of ten bytes for use as ; substitution strings diff --git a/src/apidefs.a b/src/apidefs.a index 811daff..0404fb9 100644 --- a/src/apidefs.a +++ b/src/apidefs.a @@ -189,9 +189,13 @@ gTargetType = gOnAClearDayYouCanReadForever-$01 ; byte gRAMDiskRef = gTargetType-$01 ; byte gHardDiskRef = gRAMDiskRef-$01 ; byte gDisplayBytes = gHardDiskRef-$0A ; 10 bytes -jcompare1 = gDisplayBytes-$03 ; 3-byte +jcompare3 = gDisplayBytes-$03 ; 3-byte +jcompare2 = jcompare3-$03 ; 3-byte +jcompare1 = jcompare2-$03 ; 3-byte jcompare = jcompare1-$03 ; 3-byte -jmodify1 = jcompare-$03 ; 3-byte +jmodify3 = jcompare-$03 ; 3-byte +jmodify2 = jmodify3-$03 ; 3-byte +jmodify1 = jmodify2-$03 ; 3-byte jmodify = jmodify1-$03 ; 3-byte jPrintByID = jmodify-$03 ; 3-byte jSearchTrack = jPrintByID-$03 ; 3-byte @@ -206,8 +210,12 @@ gNIBTableBase = gNIBTableFF-$7F ; 127 byte !ifdef MODULE { compare = jcompare compare1 = jcompare1 +compare2 = jcompare2 +compare3 = jcompare3 modify = jmodify modify1 = jmodify1 +modify2 = jmodify2 +modify3 = jmodify3 PrintByID = jPrintByID SearchTrack = jSearchTrack CallRWTS = jCallRWTS diff --git a/src/compare.a b/src/compare.a index 3d8542e..f91d0e4 100755 --- a/src/compare.a +++ b/src/compare.a @@ -173,10 +173,20 @@ all_done_set sec rts +; utility functions for common cases +; (from the caller's perspective, these have the side effect of setting Y, +; since the compare routine will 'save' and 'restore' the value we're setting here) +compare3 + ldy #$03 + !byte $2C + ; /!\ execution falls through here +compare2 + ldy #$02 + !byte $2C + ; /!\ execution falls through here compare1 ldy #$01 ; /!\ execution falls through here - ;------------------------------- ; compare subroutine ; in: A = sector diff --git a/src/id/dos32.a b/src/id/dos32.a index c0113a4..6ee179a 100644 --- a/src/id/dos32.a +++ b/src/id/dos32.a @@ -37,8 +37,7 @@ !byte $4C,$3B,$02; JMP $023B bcs + ldx #$45 - ldy #$03 - jsr compare ; and T00,S00,$45 = + jsr compare3 ; and T00,S00,$45 = !byte $4C,$01,$03; JMP $0301 tax + diff --git a/src/id/dos32lo.a b/src/id/dos32lo.a index a6119d2..1a569b1 100644 --- a/src/id/dos32lo.a +++ b/src/id/dos32lo.a @@ -33,12 +33,11 @@ !byte $20,$D1,$02; JSR $02D1 bcs + ldx #$41 - ldy #$03 - jsr compare + jsr compare3 !byte $4C,$01,$03; JMP $0301 bcc + ldx #$37 - jsr compare + jsr compare3 !byte $4C,$01,$03; JMP $0301 + tax } diff --git a/src/id/dos33.a b/src/id/dos33.a index 231415c..3e76a86 100755 --- a/src/id/dos33.a +++ b/src/id/dos33.a @@ -115,15 +115,14 @@ IDDOS33 ; DOS 3.3 and most derivatives have STA $08FE at $081C ; ldx #$1C - ldy #$03 - jsr compare ; if T00,S00,$1C == + jsr compare3 ; if T00,S00,$1C == !byte $8D,$FE,$08 bcc @exit ; passport-test-suite/Binomial Multiplication.woz [C=0] matches ; ; Variant jumps to $08F0 and back but is still safe to trace. ; Check for this jump and also match the code at $08F0 exactly. ; - jsr compare ; if T00,S00,$1C == + jsr compare3 ; if T00,S00,$1C == !byte $4C,$F0,$08; JMP $08F0 bcs @exit ; unknown code at $081C -> failure ldx #$F0 diff --git a/src/id/micrograms.a b/src/id/micrograms.a index aadeb22..1268d6f 100644 --- a/src/id/micrograms.a +++ b/src/id/micrograms.a @@ -22,8 +22,7 @@ !byte $85,$3F bcs @notMicrograms ; passport-test-suite/Shapes and Patterns.woz [C=0] matches ldx #$42 - ldy #$02 - jsr compare + jsr compare2 !byte $4C,$00 ; passport-test-suite/Shapes and Patterns.woz [C=0] matches tax diff --git a/src/id/phoenix.a b/src/id/phoenix.a index 5915b31..a91c44e 100644 --- a/src/id/phoenix.a +++ b/src/id/phoenix.a @@ -12,8 +12,7 @@ IDPhoenix lda #$00 ldx #$B8 - ldy #$03 - jsr compare + jsr compare3 !byte $AC,$B7,$F6 rts ; passport-test-suite/Zoom Grafix 26-JAN-82.woz [C=0] matches } diff --git a/src/id/trace33p.a b/src/id/trace33p.a index b0dba94..b954643 100755 --- a/src/id/trace33p.a +++ b/src/id/trace33p.a @@ -97,8 +97,7 @@ TraceSpecDel4 lda #$0B ldx #$00 - ldy #$03 - jsr compare ; if $1B00 == + jsr compare3 ; if $1B00 == !byte $4C,$4D,$2A SDfail php diff --git a/src/id/tsr.a b/src/id/tsr.a index dc0a601..4d0fcc0 100644 --- a/src/id/tsr.a +++ b/src/id/tsr.a @@ -19,13 +19,11 @@ !byte $C9,$09 bcs @notTSR ldx #$FE - ldy #$02 - jsr compare + jsr compare2 !byte $B0,$0F bcs @notTSR ldx #$1C - iny - jsr compare + jsr compare3 !byte $20,$B3,$08 ; passport-test-suite/Dawn Patrol.woz [C=0] matches @notTSR diff --git a/src/modify.a b/src/modify.a index d3df97d..2cdc2eb 100755 --- a/src/modify.a +++ b/src/modify.a @@ -1,7 +1,17 @@ +; utility functions for common cases +; (from the caller's perspective, these have the side effect of setting Y, +; since the modify routine will 'save' and 'restore' the value we're setting here) +modify3 + ldy #$03 + !byte $2C + ; /!\ execution falls through here +modify2 + ldy #$02 + !byte $2C + ; /!\ execution falls through here modify1 ldy #$01 ; /!\ execution falls through here - ;------------------------------- ; modify subroutine ; in: A = starting address (high byte) diff --git a/src/patchers/a5count.a b/src/patchers/a5count.a index 6fe1180..58ef850 100644 --- a/src/patchers/a5count.a +++ b/src/patchers/a5count.a @@ -19,8 +19,7 @@ jsr inx8 jsr PrintByID !byte s_a5count - ldy #$02 - jsr modify + jsr modify2 !byte $D0,$7B ; BNE +$7B .exit } diff --git a/src/patchers/advint.a b/src/patchers/advint.a index 96fa0ea..10a9923 100644 --- a/src/patchers/advint.a +++ b/src/patchers/advint.a @@ -27,8 +27,7 @@ bcs .exit ; passport-test-suite/S.A.G.A. 6.woz [C=0] matches jsr PrintByID !byte s_advint - ldy #$03 - jsr modify + jsr modify3 !byte $D1 ;CLC !byte $59,$A7 ;BCC +$6E .exit diff --git a/src/patchers/bbf9.a b/src/patchers/bbf9.a index d4a0253..ecad624 100644 --- a/src/patchers/bbf9.a +++ b/src/patchers/bbf9.a @@ -33,8 +33,7 @@ bcs .exit ; passport-test-suite/Odd One Out 1990.woz [C=0] matches jsr PrintByID !byte s_bbf9 - ldy #$02 - jsr modify + jsr modify2 !byte $18,$60 .exit } diff --git a/src/patchers/bootcounter.a b/src/patchers/bootcounter.a index ae32560..c764f8b 100644 --- a/src/patchers/bootcounter.a +++ b/src/patchers/bootcounter.a @@ -19,8 +19,7 @@ bcs .exit ; passport-test-suite/Elementary Vol. 2 v3.2 limited backup.woz [C=0] matches jsr PrintByID !byte s_bootcounter - ldy #$03 - jsr modify ; then set T01,S00,$00 = + jsr modify3 ; then set T01,S00,$00 = !byte $4C,$03,$1B .exit } diff --git a/src/patchers/dos32muse.a b/src/patchers/dos32muse.a index 1a068ad..ba0c18f 100644 --- a/src/patchers/dos32muse.a +++ b/src/patchers/dos32muse.a @@ -13,8 +13,7 @@ bne .exit lda #$08 ldx #$D6 - ldy #$02 - jsr compare ; if T01,S08,$D6 == + jsr compare2 ; if T01,S08,$D6 == !byte $4C,$D5 bcs .exit ; passport-test-suite/Castle Wolfenstein.woz [C=0] matches iny diff --git a/src/patchers/e7everywhere.a b/src/patchers/e7everywhere.a index 4800051..600e2cc 100644 --- a/src/patchers/e7everywhere.a +++ b/src/patchers/e7everywhere.a @@ -34,7 +34,6 @@ E7Everywhere bcs + ; passport-test-suite/Garfield Trivia Game.woz [C=0] matches jsr PrintByID ; passport-test-suite/Curious George Goes Shopping.woz [C=0] matches !byte s_e7everywhere - ldy #$02 - jsr modify + jsr modify2 !byte $18,$60 ; CLC/RTS + diff --git a/src/patchers/fbffpascal.a b/src/patchers/fbffpascal.a index 89acd1e..585f62d 100644 --- a/src/patchers/fbffpascal.a +++ b/src/patchers/fbffpascal.a @@ -36,8 +36,7 @@ jsr PrintByID !byte s_fbff lda gDisplayBytes - ldy #$03 - jsr modify + jsr modify3 ; unconditional jump to success path !byte $18 ; CLC !byte $90 ; BCC + diff --git a/src/patchers/harvey.a b/src/patchers/harvey.a index df4b659..1556ebb 100644 --- a/src/patchers/harvey.a +++ b/src/patchers/harvey.a @@ -13,8 +13,7 @@ lda #$01 ldx #$95 - ldy #$03 - jsr compare ; if T01,S01,$95 == + jsr compare3 ; if T01,S01,$95 == !byte $4C,$32,$A3 bcs .exit ; passport-test-suite/Harvey by Primes.woz [C=0] here @@ -26,8 +25,7 @@ !byte s_beforedos inx - tay - jsr modify ; then set T01,S01,$96 = + jsr modify1 ; then set T01,S01,$96 = !byte $47 .exit } diff --git a/src/patchers/holle.a b/src/patchers/holle.a index e1f55c0..7623397 100644 --- a/src/patchers/holle.a +++ b/src/patchers/holle.a @@ -189,8 +189,7 @@ inx inx inx - ldy #$02 - jsr modify ; disable CPU-burning JSR after data prologue + jsr modify2 ; disable CPU-burning JSR after data prologue !byte $F0,$03 + ldy #(.dataEpilogue1End-.dataEpilogue1Start) @@ -223,8 +222,7 @@ LDY $2F .diskVolumeEnd bcs + - ldy #$02 - jsr modify ; don't use disk volume number to initialize data field checksum + jsr modify2 ; don't use disk volume number to initialize data field checksum LDY #$00 + ldy #(.alternatingTrackEnd-.alternatingTrackStart) diff --git a/src/patchers/jmp2012.a b/src/patchers/jmp2012.a index 0924986..8c05e40 100644 --- a/src/patchers/jmp2012.a +++ b/src/patchers/jmp2012.a @@ -32,8 +32,7 @@ !byte s_beforedos ldx #$EC - ldy #$02 - jsr modify ; then set T02,S00,$EC = + jsr modify2 ; then set T02,S00,$EC = !byte $84,$9D .exit } diff --git a/src/patchers/jmpb412.a b/src/patchers/jmpb412.a index ddf717f..c90461a 100644 --- a/src/patchers/jmpb412.a +++ b/src/patchers/jmpb412.a @@ -34,8 +34,7 @@ !byte s_beforedos ldx #$F6 - ldy #$02 - jsr modify ; then set T02,S00,$F6 = + jsr modify2 ; then set T02,S00,$F6 = !byte $84,$9D .exit } diff --git a/src/patchers/jmpb4bb.a b/src/patchers/jmpb4bb.a index bcd26b1..bacc04f 100755 --- a/src/patchers/jmpb4bb.a +++ b/src/patchers/jmpb4bb.a @@ -69,8 +69,7 @@ !byte s_beforedos inx - ldy #$03 - jsr modify ; then set offset+1 to + jsr modify3 ; then set offset+1 to !byte $4C,$84,$9D .exit } diff --git a/src/patchers/pdi.a b/src/patchers/pdi.a index e59defa..d49bc9b 100644 --- a/src/patchers/pdi.a +++ b/src/patchers/pdi.a @@ -26,8 +26,7 @@ jsr PrintByID !byte s_pdi jsr inx0C - ldy #$02 - jsr modify + jsr modify2 !byte $99,$8E ; jmp directly to decoder .exit } diff --git a/src/patchers/protecteddos.a b/src/patchers/protecteddos.a index cc7c1e6..97d0c28 100755 --- a/src/patchers/protecteddos.a +++ b/src/patchers/protecteddos.a @@ -152,11 +152,10 @@ ; bypass check for duplicate T00,S00 ; ldx #$93 - ldy #$03 - jsr compare ; if T00,S01,$93 == + jsr compare3 ; if T00,S01,$93 == !byte $4C,$00,$B8 bcs .skipcheck ; passport-test-suite/Ultima IV.woz [C=0] matches - jsr modify ; then set T00,S01,$93 = + jsr modify3 ; then set T00,S01,$93 = !byte $AC,$E5,$B7 .skipcheck diff --git a/src/patchers/rwtsswapmecc.a b/src/patchers/rwtsswapmecc.a index 17172b1..4b26333 100755 --- a/src/patchers/rwtsswapmecc.a +++ b/src/patchers/rwtsswapmecc.a @@ -52,8 +52,7 @@ !byte $B9,WILDCARD,WILDCARD !byte $8D,$AC,$D5 bcs + ; passport-test-suite/MECC Dataquest - Europe and Soviet Union.woz [C=0] matches - ldy #$03 - jsr modify + jsr modify3 !byte $A9,$00 !byte $24 + diff --git a/src/patchers/sierra.a b/src/patchers/sierra.a index fe6fb26..a42ce5a 100755 --- a/src/patchers/sierra.a +++ b/src/patchers/sierra.a @@ -496,19 +496,16 @@ tax lda .cmp1+1 pha - ldy #2 - jsr compare + jsr compare2 !byte $B5,$B7 pla bcc + pha - ldy #2 - jsr compare + jsr compare2 !byte $D9,$03 pla bcc + - ldy #2 - jsr compare + jsr compare2 !byte $00,$BD .bcsexit5 bcs .bcsexit6 diff --git a/src/patchers/sierra13.a b/src/patchers/sierra13.a index 4d18665..b03b066 100644 --- a/src/patchers/sierra13.a +++ b/src/patchers/sierra13.a @@ -88,8 +88,7 @@ adc #$48 tax pla - ldy #2 - jsr modify + jsr modify2 !byte $A0,$B9 bvc .jmpexit diff --git a/src/patchers/sra.a b/src/patchers/sra.a index 4382a2b..9ff79fd 100644 --- a/src/patchers/sra.a +++ b/src/patchers/sra.a @@ -29,8 +29,7 @@ SRA jsr PrintByID !byte s_sra inx - ldy #$02 - jsr modify + jsr modify2 !byte $0F,$5A ; new JSR entry point @next dec @sector+1 bpl @sector diff --git a/src/patchers/ssprot.a b/src/patchers/ssprot.a index edf4cbf..5273d6a 100644 --- a/src/patchers/ssprot.a +++ b/src/patchers/ssprot.a @@ -40,16 +40,15 @@ bcs .nextsector ldx #$76 - ldy #$03 - jsr compare + jsr compare3 !byte $23,$2A,$28 bcc .variant1 ; passport-test-suite/Creative Contraptions.woz [C=0] matches - jsr compare + jsr compare3 !byte $70,$79,$77 bcc .variant2 ; passport-test-suite/Wortgefecht.woz [C=0] matches - jsr compare + jsr compare3 !byte $23,$2A,$24 ; passport-test-suite/Metric System Tutor.woz [C=0] matches bcc .variant3 diff --git a/src/patchers/t00_artsci.a b/src/patchers/t00_artsci.a index ce2193a..f998d63 100644 --- a/src/patchers/t00_artsci.a +++ b/src/patchers/t00_artsci.a @@ -14,8 +14,7 @@ T00_ARTSCI lda #$0A ldx #$FE - ldy #$02 - jsr compare + jsr compare2 !byte $DE,$D5 bcs + diff --git a/src/patchers/t00_bb03.a b/src/patchers/t00_bb03.a index 24fb447..2bb577b 100755 --- a/src/patchers/t00_bb03.a +++ b/src/patchers/t00_bb03.a @@ -28,8 +28,7 @@ bne .exit lda #$05 ; sector to check for DOS 3.3 variant .check ldx #$03 - ldy #$03 - jsr compare ; if T00,S0(5|7),$03 == + jsr compare3 ; if T00,S0(5|7),$03 == !byte $4E,$06,$BB bcs .exit jsr PrintByID @@ -40,11 +39,11 @@ lda #$01 ldx #$38 - jsr compare ; if T00,S01,$38 == + jsr compare3 ; if T00,S01,$38 == !byte $20,$03,$BB; JSR $BB03 bcc .variant1 - jsr compare ; if T00,S01,$38 == + jsr compare3 ; if T00,S01,$38 == !byte $4C,$03,$BB; JMP $BB03 bcs .exit lda #$05 @@ -55,13 +54,11 @@ !byte $39,$41 bcs .exit ;variant3 - ldy #$02 - jsr modify ; then set T00,S05,$6B = + jsr modify2 ; then set T00,S05,$6B = !byte $6B,$F6 ; encrypted, decrypts to 'BNE +$5C' which will unconditionally branch to success path at $BBC9 lda #$06 ldx #$0F - dey - jsr modify ; and set T00,S06,$0F = + jsr modify1 ; and set T00,S06,$0F = !byte $89 ; encrypted, decrypts to $10 which is the expected nibble count value ; passport-test-suite/Trivia Fever.woz [V=0] reaches here bvc .exit ; unconditional branch (V is always 0 coming out of modify) diff --git a/src/patchers/t00_datasoft2.a b/src/patchers/t00_datasoft2.a index 44a26fb..10932f9 100644 --- a/src/patchers/t00_datasoft2.a +++ b/src/patchers/t00_datasoft2.a @@ -17,13 +17,12 @@ lda #$01 ldx #$48 - ldy #$02 - jsr compare + jsr compare2 !byte $00,$9B bcs .exit ; passport-test-suite/Fathoms 40.woz [C=0] matches jsr PrintByID !byte s_datasoft - jsr modify + jsr modify2 !byte $76,$9C .exit } diff --git a/src/patchers/t00_diskvol.a b/src/patchers/t00_diskvol.a index 9345021..45897f4 100755 --- a/src/patchers/t00_diskvol.a +++ b/src/patchers/t00_diskvol.a @@ -63,8 +63,7 @@ lda #$08 inx inx ; now $12 or $18 (depending on which compare matched) - ldy #$02 - jsr modify ; then set T00,S08,$12/18 = + jsr modify2 ; then set T00,S08,$12/18 = !byte $A9,$00 ; LDA #$00 .exit } diff --git a/src/patchers/t00_dos32.a b/src/patchers/t00_dos32.a index 6e51d7c..1eeb8c4 100644 --- a/src/patchers/t00_dos32.a +++ b/src/patchers/t00_dos32.a @@ -41,8 +41,7 @@ lda #$01 ldx #$38 - ldy #$03 - jsr compare + jsr compare3 !byte $20,$93,$37 bcs + ; passport-test-suite/Bellhop.woz [C=0] matches jsr modify1 diff --git a/src/patchers/t00_dos32dlm.a b/src/patchers/t00_dos32dlm.a index 09f4de3..055308c 100644 --- a/src/patchers/t00_dos32dlm.a +++ b/src/patchers/t00_dos32dlm.a @@ -12,13 +12,12 @@ !zone { lda gIsDOS32 bne .exit - lda #$0b + lda #$0B ldx #$84 - ldy #$03 - jsr compare ; if T00,S0B,$84 == + jsr compare3 ; if T00,S0B,$84 == !byte $4C,$F0,$BC bcs .exit ; passport-test-suite/Demolition Division.woz [C=0] matches - jsr modify ; then set T00,S0B,$84 = + jsr modify3 ; then set T00,S0B,$84 = !byte $AD,$E9,$B7 .exit } diff --git a/src/patchers/t00_earthware.a b/src/patchers/t00_earthware.a index 2367c10..02bf420 100644 --- a/src/patchers/t00_earthware.a +++ b/src/patchers/t00_earthware.a @@ -16,12 +16,11 @@ EARTHWARE lda #$02 ldx #$F6 - ldy #$03 - jsr compare + jsr compare3 !byte $4C,$89,$B6 bcs @exit ; passport-test-suite/Zoo Master.woz [C=0] here jsr PrintByID !byte s_bytrack - jsr modify + jsr modify3 !byte $BD,$8C,$C0 @exit diff --git a/src/patchers/t00_jmpb500.a b/src/patchers/t00_jmpb500.a index f3c2976..ab29943 100644 --- a/src/patchers/t00_jmpb500.a +++ b/src/patchers/t00_jmpb500.a @@ -18,15 +18,14 @@ lda #$0C ldx #$84 - ldy #$03 - jsr compare ; if T00,S0C,$84 == + jsr compare3 ; if T00,S0C,$84 == !byte $4C,$00,$B5; JMP $B500 bcs .exit jsr PrintByID !byte s_beforedos - jsr modify ; then set T00,$0C,$84 = + jsr modify3 ; then set T00,$0C,$84 = !byte $AD,$E9,$B7 .exit } diff --git a/src/patchers/t00_jmpbbfe.a b/src/patchers/t00_jmpbbfe.a index 9802b04..2801303 100755 --- a/src/patchers/t00_jmpbbfe.a +++ b/src/patchers/t00_jmpbbfe.a @@ -98,8 +98,7 @@ _jmpbbfe lda #$00 ldx #$4B - ldy #$02 - jsr compare ; if T00,S00,$4B == + jsr compare2 ; if T00,S00,$4B == !byte $FE,$BB bcs .exit @@ -128,8 +127,7 @@ _jmpbbfe inx inx inx - ldy #$03 - jsr modify + jsr modify3 !byte $6C,$FD,$08 ldx #$FE diff --git a/src/patchers/t00_jmpbeb1.a b/src/patchers/t00_jmpbeb1.a index 2d9ac6d..64d8dd0 100755 --- a/src/patchers/t00_jmpbeb1.a +++ b/src/patchers/t00_jmpbeb1.a @@ -56,8 +56,7 @@ _jmpbeb1 !byte $A9 bcs .exit ldx #$5E - ldy #$03 - jsr compare ; and T00,S02,$5E == + jsr compare3 ; and T00,S02,$5E == !byte $20,$BB,WILDCARD bcs .exit ; passport-test-suite/Easy as ABC.woz [C=0] matches ldx #$49 ; passport-test-suite/Spelling Rules.woz [C=0] matches diff --git a/src/patchers/t00_jsrb6cc.a b/src/patchers/t00_jsrb6cc.a index c937028..87f3f5e 100644 --- a/src/patchers/t00_jsrb6cc.a +++ b/src/patchers/t00_jsrb6cc.a @@ -11,8 +11,7 @@ lda #$07 ldx #$00 - ldy #$03 - jsr compare + jsr compare3 !byte $20,$CC,$B6 bcs .exit txa diff --git a/src/patchers/t00_laureate.a b/src/patchers/t00_laureate.a index 37f65e2..a66c70a 100644 --- a/src/patchers/t00_laureate.a +++ b/src/patchers/t00_laureate.a @@ -34,11 +34,10 @@ lda #$0A ldx #$12 - ldy #$02 - jsr compare + jsr compare2 !byte $B1,$48 bcs .exit - jsr modify + jsr modify2 !byte $A9,$00 .exit } diff --git a/src/patchers/t00_mastery.a b/src/patchers/t00_mastery.a index 88ef71b..0fc640d 100644 --- a/src/patchers/t00_mastery.a +++ b/src/patchers/t00_mastery.a @@ -11,8 +11,7 @@ lda #$07 ldx #$00 - ldy #$03 - jsr compare + jsr compare3 !byte $20,$AF,$BE bcs .exit lda #$08 diff --git a/src/patchers/t00_methods.a b/src/patchers/t00_methods.a index e90edb2..3f09141 100644 --- a/src/patchers/t00_methods.a +++ b/src/patchers/t00_methods.a @@ -11,8 +11,7 @@ lda #$08 ldx #$5A - ldy #$03 - jsr compare ; and T00,S08,$5A == + jsr compare3 ; and T00,S08,$5A == !byte $4C,$B4,$36; JMP $36B4 bcs .exit lda #$00 @@ -40,8 +39,7 @@ !byte $24 ; BIT tya ldx #$47 - ldy #$03 - jsr compare ; if T00,S01,$47 == + jsr compare3 ; if T00,S01,$47 == !byte $4C,$CE,$36; JMP $36CE bcs .exit inx diff --git a/src/patchers/t00_microfun.a b/src/patchers/t00_microfun.a index ce0f36a..11a1635 100644 --- a/src/patchers/t00_microfun.a +++ b/src/patchers/t00_microfun.a @@ -23,8 +23,7 @@ bcs .exit ; passport-test-suite/Miner 2049er.woz [C=0] matches jsr PrintByID !byte s_microfun - ldy #$02 - jsr modify + jsr modify2 !byte $18 ; CLC !byte $60 ; RTS .exit diff --git a/src/patchers/t00_microfun2.a b/src/patchers/t00_microfun2.a index b71ef6d..70e5fdc 100644 --- a/src/patchers/t00_microfun2.a +++ b/src/patchers/t00_microfun2.a @@ -11,11 +11,10 @@ lda #$02 ldx #$5E - ldy #$03 - jsr compare + jsr compare3 !byte $4C,$B8,$B6 bcs .exit ; passort-test-suite/Crown Of Arthain.woz [C=0] matches - jsr modify + jsr modify3 !byte $20,$B8,$B8 .exit } diff --git a/src/patchers/t00_milliken.a b/src/patchers/t00_milliken.a index cb502cd..85558fb 100644 --- a/src/patchers/t00_milliken.a +++ b/src/patchers/t00_milliken.a @@ -11,11 +11,10 @@ bne .exit lda #$01 ldx #$48 - ldy #$02 - jsr compare ; and T00,S01,$48 == + jsr compare2 ; and T00,S01,$48 == !byte $03,$9B bcs .exit ; passport-test-suite/Tangrams Puzzler.woz [C=0] matches - jsr modify ; then set T00,S01,$48 = + jsr modify2 ; then set T00,S01,$48 = !byte $84,$9D .exit } diff --git a/src/patchers/t00_muserwts.a b/src/patchers/t00_muserwts.a index 9e50266..2e4dce5 100644 --- a/src/patchers/t00_muserwts.a +++ b/src/patchers/t00_muserwts.a @@ -14,8 +14,7 @@ bne .exit lda #$06 ldx #$F2 - ldy #$03 - jsr compare ; if T00,S06,$F2 == + jsr compare3 ; if T00,S06,$F2 == !byte $20,$B6,$B6 bcs .exit ; passport-test-suite/The Function Game.woz [C=0] matches jsr PrintByID diff --git a/src/patchers/t00_nibtable.a b/src/patchers/t00_nibtable.a index d95d8cf..e2c5bad 100755 --- a/src/patchers/t00_nibtable.a +++ b/src/patchers/t00_nibtable.a @@ -11,40 +11,30 @@ _nibtable lda #$02 ldx #$6D - ldy #$03 - jsr compare ; and T00,S02,$6D == + jsr compare3 ; and T00,S02,$6D == !byte $BD,$29,$BA bcs .checkwrite - lda #$02 ldx #$82 - ldy #$03 - jsr compare ; and T00,S02,$82 == + jsr compare3 ; and T00,S02,$82 == !byte $BD,$29,$BA bcs .checkwrite - lda #$02 ldx #$95 - ldy #$03 - jsr compare ; and T00,S02,$95 == + jsr compare3 ; and T00,S02,$95 == !byte $BD,$29,$BA bcs .checkwrite jsr .fixwrite .checkwrite lda #$03 ldx #$09 - ldy #$03 - jsr compare ; if T00,S03,$09 == + jsr compare3 ; if T00,S03,$09 == !byte $59,$00,$BA bcs .exit - lda #$03 ldx #$1A - ldy #$03 - jsr compare ; and T00,S03,$1A == + jsr compare3 ; and T00,S03,$1A == !byte $59,$00,$BA bcs .exit - lda #$03 ldx #$2A - ldy #$03 - jsr compare ; and T00,S03,$2A == + jsr compare3 ; and T00,S03,$2A == !byte $D9,$00,$BA bcs .exit jsr .fixread diff --git a/src/patchers/t00_panglosdos.a b/src/patchers/t00_panglosdos.a index 7b723f7..17de143 100644 --- a/src/patchers/t00_panglosdos.a +++ b/src/patchers/t00_panglosdos.a @@ -29,8 +29,7 @@ inx inx inx - ldy #$02 - jsr modify + jsr modify2 !byte $A9,$00 ;LDA #$00 ldy #$06 jsr SearchTrack @@ -42,8 +41,7 @@ inx inx inx - ldy #$02 - jsr modify + jsr modify2 !byte $A9,$00 ;LDA #$00 ;Monopoly @@ -61,7 +59,7 @@ jsr SearchTrack !byte $4C,$56,$BB ;JMP $BB56 bcs .exit - jsr modify + jsr modify3 !byte $AD,$00,$E0 ;LDA $E000 .exit } diff --git a/src/patchers/t00_rdos13.a b/src/patchers/t00_rdos13.a index ea327ec..91db6e1 100644 --- a/src/patchers/t00_rdos13.a +++ b/src/patchers/t00_rdos13.a @@ -1,5 +1,5 @@ ;------------------------------- -; #RDOS13 +; #rdos13 ; patch RDOS to be 16-sector compatible ; ; module by qkumba @@ -45,11 +45,10 @@ lda #$0A ldx #$75 - ldy #2 - jsr compare + jsr compare2 !byte $C9,$D5 ;CMP #$D5 bcc + - jsr modify + jsr modify2 !byte $C9,$D5 ;CMP #$D5 + diff --git a/src/patchers/t00_rol1e.a b/src/patchers/t00_rol1e.a index 9959df5..14f5799 100755 --- a/src/patchers/t00_rol1e.a +++ b/src/patchers/t00_rol1e.a @@ -26,13 +26,12 @@ _rol1e !byte $BD,$02,$01 bcs .exit ldx #$64 - ldy #$02 - jsr compare ; and T00,S03,$64 == + jsr compare2 ; and T00,S03,$64 == !byte $A5,$1E bcs .exit ; passport-test-suite/Crypto Cube.woz [C=0] matches jsr PrintByID !byte s_rol1e - jsr modify ; then set T00,S03,$64 = + jsr modify2 ; then set T00,S03,$64 = !byte $A9,$F7 .exit } diff --git a/src/patchers/t00_rps.a b/src/patchers/t00_rps.a index c2c80c2..8afce97 100755 --- a/src/patchers/t00_rps.a +++ b/src/patchers/t00_rps.a @@ -26,8 +26,7 @@ lda #$01 ldx #$48 - ldy #$02 - jsr compare ; if T00,S01,$48 == + jsr compare2 ; if T00,S01,$48 == !byte $C1,$B3 bcs .exit ; primary pattern not found, bail @@ -45,16 +44,16 @@ lda #$01 ; presence of JMP $B6B3 also indicates code at ldx #$48 ; $B41F that copies the real DOS code back to $B6B3 - ldy #$02 ; so we modify $B747 to jump to that (it exits via $9D84) - jsr modify ; and set T00,S01,$48 = + ; so we modify $B747 to jump to that (it exits via $9D84) + jsr modify2 ; and set T00,S01,$48 = !byte $1F,$B4 bvc .variant1 ; always branches .variant0 lda #$01 ; lack of JMP $B6B3 indicates an earlier variant ldx #$48 ; which has no useful code at $B3C1, so we - ldy #$02 ; modify $B747 to jump directly to $9D84 - jsr modify + ; modify $B747 to jump directly to $9D84 + jsr modify2 !byte $84,$9D ; /!\ execution falls through here @@ -62,8 +61,7 @@ ;A=#$01 here regardless of how we got here ;Y=#$02 here regardless of how we got here ldx #$87 - iny - jsr compare ; if T00,S01,$87 == + jsr compare3 ; if T00,S01,$87 == !byte $6C,$58,$9D bcs .variant2 ; passport-test-suite/Pac-Man (Thunder Mountain).woz [C=0] here ldx #$8E @@ -76,8 +74,7 @@ .variant2 inx - ldy #$03 - jsr compare ; if T00,S01,$88 == + jsr compare3 ; if T00,S01,$88 == !byte $6C,$58,$9D bcs .exit ; passport/test-suite/Problem Solving in Algebra.woz [C=0] here ; if we didn't find indirect jump in either location, bail diff --git a/src/patchers/t00_rwts.a b/src/patchers/t00_rwts.a index 995a1ba..c1b768e 100755 --- a/src/patchers/t00_rwts.a +++ b/src/patchers/t00_rwts.a @@ -144,8 +144,7 @@ pla inx inx - ldy #2 - jsr compare + jsr compare2 .cmpbyte5 !byte $20,$D1 ; SMC diff --git a/src/patchers/t00_sunburst.a b/src/patchers/t00_sunburst.a index f6d590d..a590922 100755 --- a/src/patchers/t00_sunburst.a +++ b/src/patchers/t00_sunburst.a @@ -87,8 +87,7 @@ bcs .exit lda #$08 ldx #$8C - ldy #$02 - jsr compare ; and T00,S08,$8C == + jsr compare2 ; and T00,S08,$8C == !byte $69,$BA bcc .yes ; passport-test-suite/Green Globs and Graphing Equations.woz [C=0] matches .exit @@ -109,8 +108,7 @@ !byte $20,$C3,$BC lda #$08 ldx #$8C - ldy #$02 - jsr modify ; and set T00,S08,$8C = + jsr modify2 ; and set T00,S08,$8C = !byte $A0,$B9 .exit2 } diff --git a/src/patchers/t00_sve.a b/src/patchers/t00_sve.a index 82ae96b..de5eead 100644 --- a/src/patchers/t00_sve.a +++ b/src/patchers/t00_sve.a @@ -12,11 +12,10 @@ lda #$08 ldx #$5A - ldy #$03 - jsr compare + jsr compare3 !byte $4C,$71,$A9 ; JMP $A971 bcs .exit - jsr modify + jsr modify3 !byte $48,$A0,$01 lda #$06 ldx #$56 diff --git a/src/patchers/trillium.a b/src/patchers/trillium.a index 32fec98..256b5c9 100644 --- a/src/patchers/trillium.a +++ b/src/patchers/trillium.a @@ -13,8 +13,7 @@ bne .exit lda #$0F ldx #$31 - ldy #$03 - jsr compare + jsr compare3 !byte $C9,$CF,$A0 bcs .exit lda #TRUE diff --git a/src/patchers/woodbury.a b/src/patchers/woodbury.a index a710354..6b0201d 100644 --- a/src/patchers/woodbury.a +++ b/src/patchers/woodbury.a @@ -26,8 +26,7 @@ jsr PrintByID !byte s_badblock jsr inx4 - ldy #$02 - jsr modify + jsr modify2 !byte $F0,$0E .exit }