shave some bytes

This commit is contained in:
4am 2021-06-21 11:57:02 -04:00
parent e2a397815c
commit ce2e3b5813
59 changed files with 137 additions and 178 deletions

View File

@ -217,8 +217,7 @@ b4bbcompare
bcs _b4bbexit bcs _b4bbexit
lda #$0C lda #$0C
ldx #$84 ldx #$84
ldy #$03 jsr compare3
jsr compare
!byte $4C,$BB,$B4 !byte $4C,$BB,$B4
bcs _b4bbexit bcs _b4bbexit
ldx #$02 ; track ldx #$02 ; track

View File

@ -33,10 +33,18 @@
jmp modify jmp modify
;jmodify1 ;jmodify1
jmp modify1 jmp modify1
;jmodify2
jmp modify2
;jmodify3
jmp modify3
;jcompare ;jcompare
jmp compare jmp compare
;jcompare1 ;jcompare1
jmp compare1 jmp compare1
;jcompare2
jmp compare2
;jcompare3
jmp compare3
;gDisplayBytes ;gDisplayBytes
!fill 10 ; array of ten bytes for use as !fill 10 ; array of ten bytes for use as
; substitution strings ; substitution strings

View File

@ -189,9 +189,13 @@ gTargetType = gOnAClearDayYouCanReadForever-$01 ; byte
gRAMDiskRef = gTargetType-$01 ; byte gRAMDiskRef = gTargetType-$01 ; byte
gHardDiskRef = gRAMDiskRef-$01 ; byte gHardDiskRef = gRAMDiskRef-$01 ; byte
gDisplayBytes = gHardDiskRef-$0A ; 10 bytes 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 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 jmodify = jmodify1-$03 ; 3-byte
jPrintByID = jmodify-$03 ; 3-byte jPrintByID = jmodify-$03 ; 3-byte
jSearchTrack = jPrintByID-$03 ; 3-byte jSearchTrack = jPrintByID-$03 ; 3-byte
@ -206,8 +210,12 @@ gNIBTableBase = gNIBTableFF-$7F ; 127 byte
!ifdef MODULE { !ifdef MODULE {
compare = jcompare compare = jcompare
compare1 = jcompare1 compare1 = jcompare1
compare2 = jcompare2
compare3 = jcompare3
modify = jmodify modify = jmodify
modify1 = jmodify1 modify1 = jmodify1
modify2 = jmodify2
modify3 = jmodify3
PrintByID = jPrintByID PrintByID = jPrintByID
SearchTrack = jSearchTrack SearchTrack = jSearchTrack
CallRWTS = jCallRWTS CallRWTS = jCallRWTS

View File

@ -173,10 +173,20 @@ all_done_set
sec sec
rts 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 compare1
ldy #$01 ldy #$01
; /!\ execution falls through here ; /!\ execution falls through here
;------------------------------- ;-------------------------------
; compare subroutine ; compare subroutine
; in: A = sector ; in: A = sector

View File

@ -37,8 +37,7 @@
!byte $4C,$3B,$02; JMP $023B !byte $4C,$3B,$02; JMP $023B
bcs + bcs +
ldx #$45 ldx #$45
ldy #$03 jsr compare3 ; and T00,S00,$45 =
jsr compare ; and T00,S00,$45 =
!byte $4C,$01,$03; JMP $0301 !byte $4C,$01,$03; JMP $0301
tax tax
+ +

View File

@ -33,12 +33,11 @@
!byte $20,$D1,$02; JSR $02D1 !byte $20,$D1,$02; JSR $02D1
bcs + bcs +
ldx #$41 ldx #$41
ldy #$03 jsr compare3
jsr compare
!byte $4C,$01,$03; JMP $0301 !byte $4C,$01,$03; JMP $0301
bcc + bcc +
ldx #$37 ldx #$37
jsr compare jsr compare3
!byte $4C,$01,$03; JMP $0301 !byte $4C,$01,$03; JMP $0301
+ tax + tax
} }

View File

@ -115,15 +115,14 @@ IDDOS33
; DOS 3.3 and most derivatives have STA $08FE at $081C ; DOS 3.3 and most derivatives have STA $08FE at $081C
; ;
ldx #$1C ldx #$1C
ldy #$03 jsr compare3 ; if T00,S00,$1C ==
jsr compare ; if T00,S00,$1C ==
!byte $8D,$FE,$08 !byte $8D,$FE,$08
bcc @exit ; passport-test-suite/Binomial Multiplication.woz [C=0] matches bcc @exit ; passport-test-suite/Binomial Multiplication.woz [C=0] matches
; ;
; Variant jumps to $08F0 and back but is still safe to trace. ; Variant jumps to $08F0 and back but is still safe to trace.
; Check for this jump and also match the code at $08F0 exactly. ; 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 !byte $4C,$F0,$08; JMP $08F0
bcs @exit ; unknown code at $081C -> failure bcs @exit ; unknown code at $081C -> failure
ldx #$F0 ldx #$F0

View File

@ -22,8 +22,7 @@
!byte $85,$3F !byte $85,$3F
bcs @notMicrograms ; passport-test-suite/Shapes and Patterns.woz [C=0] matches bcs @notMicrograms ; passport-test-suite/Shapes and Patterns.woz [C=0] matches
ldx #$42 ldx #$42
ldy #$02 jsr compare2
jsr compare
!byte $4C,$00 !byte $4C,$00
; passport-test-suite/Shapes and Patterns.woz [C=0] matches ; passport-test-suite/Shapes and Patterns.woz [C=0] matches
tax tax

View File

@ -12,8 +12,7 @@
IDPhoenix IDPhoenix
lda #$00 lda #$00
ldx #$B8 ldx #$B8
ldy #$03 jsr compare3
jsr compare
!byte $AC,$B7,$F6 !byte $AC,$B7,$F6
rts ; passport-test-suite/Zoom Grafix 26-JAN-82.woz [C=0] matches rts ; passport-test-suite/Zoom Grafix 26-JAN-82.woz [C=0] matches
} }

View File

@ -97,8 +97,7 @@ TraceSpecDel4
lda #$0B lda #$0B
ldx #$00 ldx #$00
ldy #$03 jsr compare3 ; if $1B00 ==
jsr compare ; if $1B00 ==
!byte $4C,$4D,$2A !byte $4C,$4D,$2A
SDfail SDfail
php php

View File

@ -19,13 +19,11 @@
!byte $C9,$09 !byte $C9,$09
bcs @notTSR bcs @notTSR
ldx #$FE ldx #$FE
ldy #$02 jsr compare2
jsr compare
!byte $B0,$0F !byte $B0,$0F
bcs @notTSR bcs @notTSR
ldx #$1C ldx #$1C
iny jsr compare3
jsr compare
!byte $20,$B3,$08 !byte $20,$B3,$08
; passport-test-suite/Dawn Patrol.woz [C=0] matches ; passport-test-suite/Dawn Patrol.woz [C=0] matches
@notTSR @notTSR

View File

@ -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 modify1
ldy #$01 ldy #$01
; /!\ execution falls through here ; /!\ execution falls through here
;------------------------------- ;-------------------------------
; modify subroutine ; modify subroutine
; in: A = starting address (high byte) ; in: A = starting address (high byte)

View File

@ -19,8 +19,7 @@
jsr inx8 jsr inx8
jsr PrintByID jsr PrintByID
!byte s_a5count !byte s_a5count
ldy #$02 jsr modify2
jsr modify
!byte $D0,$7B ; BNE +$7B !byte $D0,$7B ; BNE +$7B
.exit .exit
} }

View File

@ -27,8 +27,7 @@
bcs .exit ; passport-test-suite/S.A.G.A. 6.woz [C=0] matches bcs .exit ; passport-test-suite/S.A.G.A. 6.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_advint !byte s_advint
ldy #$03 jsr modify3
jsr modify
!byte $D1 ;CLC !byte $D1 ;CLC
!byte $59,$A7 ;BCC +$6E !byte $59,$A7 ;BCC +$6E
.exit .exit

View File

@ -33,8 +33,7 @@
bcs .exit ; passport-test-suite/Odd One Out 1990.woz [C=0] matches bcs .exit ; passport-test-suite/Odd One Out 1990.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_bbf9 !byte s_bbf9
ldy #$02 jsr modify2
jsr modify
!byte $18,$60 !byte $18,$60
.exit .exit
} }

View File

@ -19,8 +19,7 @@
bcs .exit ; passport-test-suite/Elementary Vol. 2 v3.2 limited backup.woz [C=0] matches bcs .exit ; passport-test-suite/Elementary Vol. 2 v3.2 limited backup.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_bootcounter !byte s_bootcounter
ldy #$03 jsr modify3 ; then set T01,S00,$00 =
jsr modify ; then set T01,S00,$00 =
!byte $4C,$03,$1B !byte $4C,$03,$1B
.exit .exit
} }

View File

@ -13,8 +13,7 @@
bne .exit bne .exit
lda #$08 lda #$08
ldx #$D6 ldx #$D6
ldy #$02 jsr compare2 ; if T01,S08,$D6 ==
jsr compare ; if T01,S08,$D6 ==
!byte $4C,$D5 !byte $4C,$D5
bcs .exit ; passport-test-suite/Castle Wolfenstein.woz [C=0] matches bcs .exit ; passport-test-suite/Castle Wolfenstein.woz [C=0] matches
iny iny

View File

@ -34,7 +34,6 @@ E7Everywhere
bcs + ; passport-test-suite/Garfield Trivia Game.woz [C=0] matches bcs + ; passport-test-suite/Garfield Trivia Game.woz [C=0] matches
jsr PrintByID ; passport-test-suite/Curious George Goes Shopping.woz [C=0] matches jsr PrintByID ; passport-test-suite/Curious George Goes Shopping.woz [C=0] matches
!byte s_e7everywhere !byte s_e7everywhere
ldy #$02 jsr modify2
jsr modify
!byte $18,$60 ; CLC/RTS !byte $18,$60 ; CLC/RTS
+ +

View File

@ -36,8 +36,7 @@
jsr PrintByID jsr PrintByID
!byte s_fbff !byte s_fbff
lda gDisplayBytes lda gDisplayBytes
ldy #$03 jsr modify3
jsr modify
; unconditional jump to success path ; unconditional jump to success path
!byte $18 ; CLC !byte $18 ; CLC
!byte $90 ; BCC + !byte $90 ; BCC +

View File

@ -13,8 +13,7 @@
lda #$01 lda #$01
ldx #$95 ldx #$95
ldy #$03 jsr compare3 ; if T01,S01,$95 ==
jsr compare ; if T01,S01,$95 ==
!byte $4C,$32,$A3 !byte $4C,$32,$A3
bcs .exit ; passport-test-suite/Harvey by Primes.woz [C=0] here bcs .exit ; passport-test-suite/Harvey by Primes.woz [C=0] here
@ -26,8 +25,7 @@
!byte s_beforedos !byte s_beforedos
inx inx
tay jsr modify1 ; then set T01,S01,$96 =
jsr modify ; then set T01,S01,$96 =
!byte $47 !byte $47
.exit .exit
} }

View File

@ -189,8 +189,7 @@
inx inx
inx inx
inx inx
ldy #$02 jsr modify2 ; disable CPU-burning JSR after data prologue
jsr modify ; disable CPU-burning JSR after data prologue
!byte $F0,$03 !byte $F0,$03
+ +
ldy #(.dataEpilogue1End-.dataEpilogue1Start) ldy #(.dataEpilogue1End-.dataEpilogue1Start)
@ -223,8 +222,7 @@
LDY $2F LDY $2F
.diskVolumeEnd .diskVolumeEnd
bcs + bcs +
ldy #$02 jsr modify2 ; don't use disk volume number to initialize data field checksum
jsr modify ; don't use disk volume number to initialize data field checksum
LDY #$00 LDY #$00
+ +
ldy #(.alternatingTrackEnd-.alternatingTrackStart) ldy #(.alternatingTrackEnd-.alternatingTrackStart)

View File

@ -32,8 +32,7 @@
!byte s_beforedos !byte s_beforedos
ldx #$EC ldx #$EC
ldy #$02 jsr modify2 ; then set T02,S00,$EC =
jsr modify ; then set T02,S00,$EC =
!byte $84,$9D !byte $84,$9D
.exit .exit
} }

View File

@ -34,8 +34,7 @@
!byte s_beforedos !byte s_beforedos
ldx #$F6 ldx #$F6
ldy #$02 jsr modify2 ; then set T02,S00,$F6 =
jsr modify ; then set T02,S00,$F6 =
!byte $84,$9D !byte $84,$9D
.exit .exit
} }

View File

@ -69,8 +69,7 @@
!byte s_beforedos !byte s_beforedos
inx inx
ldy #$03 jsr modify3 ; then set offset+1 to
jsr modify ; then set offset+1 to
!byte $4C,$84,$9D !byte $4C,$84,$9D
.exit .exit
} }

View File

@ -26,8 +26,7 @@
jsr PrintByID jsr PrintByID
!byte s_pdi !byte s_pdi
jsr inx0C jsr inx0C
ldy #$02 jsr modify2
jsr modify
!byte $99,$8E ; jmp directly to decoder !byte $99,$8E ; jmp directly to decoder
.exit .exit
} }

View File

@ -152,11 +152,10 @@
; bypass check for duplicate T00,S00 ; bypass check for duplicate T00,S00
; ;
ldx #$93 ldx #$93
ldy #$03 jsr compare3 ; if T00,S01,$93 ==
jsr compare ; if T00,S01,$93 ==
!byte $4C,$00,$B8 !byte $4C,$00,$B8
bcs .skipcheck ; passport-test-suite/Ultima IV.woz [C=0] matches 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 !byte $AC,$E5,$B7
.skipcheck .skipcheck

View File

@ -52,8 +52,7 @@
!byte $B9,WILDCARD,WILDCARD !byte $B9,WILDCARD,WILDCARD
!byte $8D,$AC,$D5 !byte $8D,$AC,$D5
bcs + ; passport-test-suite/MECC Dataquest - Europe and Soviet Union.woz [C=0] matches bcs + ; passport-test-suite/MECC Dataquest - Europe and Soviet Union.woz [C=0] matches
ldy #$03 jsr modify3
jsr modify
!byte $A9,$00 !byte $A9,$00
!byte $24 !byte $24
+ +

View File

@ -496,19 +496,16 @@
tax tax
lda .cmp1+1 lda .cmp1+1
pha pha
ldy #2 jsr compare2
jsr compare
!byte $B5,$B7 !byte $B5,$B7
pla pla
bcc + bcc +
pha pha
ldy #2 jsr compare2
jsr compare
!byte $D9,$03 !byte $D9,$03
pla pla
bcc + bcc +
ldy #2 jsr compare2
jsr compare
!byte $00,$BD !byte $00,$BD
.bcsexit5 .bcsexit5
bcs .bcsexit6 bcs .bcsexit6

View File

@ -88,8 +88,7 @@
adc #$48 adc #$48
tax tax
pla pla
ldy #2 jsr modify2
jsr modify
!byte $A0,$B9 !byte $A0,$B9
bvc .jmpexit bvc .jmpexit

View File

@ -29,8 +29,7 @@ SRA
jsr PrintByID jsr PrintByID
!byte s_sra !byte s_sra
inx inx
ldy #$02 jsr modify2
jsr modify
!byte $0F,$5A ; new JSR entry point !byte $0F,$5A ; new JSR entry point
@next dec @sector+1 @next dec @sector+1
bpl @sector bpl @sector

View File

@ -40,16 +40,15 @@
bcs .nextsector bcs .nextsector
ldx #$76 ldx #$76
ldy #$03 jsr compare3
jsr compare
!byte $23,$2A,$28 !byte $23,$2A,$28
bcc .variant1 ; passport-test-suite/Creative Contraptions.woz [C=0] matches bcc .variant1 ; passport-test-suite/Creative Contraptions.woz [C=0] matches
jsr compare jsr compare3
!byte $70,$79,$77 !byte $70,$79,$77
bcc .variant2 ; passport-test-suite/Wortgefecht.woz [C=0] matches 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 !byte $23,$2A,$24 ; passport-test-suite/Metric System Tutor.woz [C=0] matches
bcc .variant3 bcc .variant3

View File

@ -14,8 +14,7 @@ T00_ARTSCI
lda #$0A lda #$0A
ldx #$FE ldx #$FE
ldy #$02 jsr compare2
jsr compare
!byte $DE,$D5 !byte $DE,$D5
bcs + bcs +

View File

@ -28,8 +28,7 @@
bne .exit bne .exit
lda #$05 ; sector to check for DOS 3.3 variant lda #$05 ; sector to check for DOS 3.3 variant
.check ldx #$03 .check ldx #$03
ldy #$03 jsr compare3 ; if T00,S0(5|7),$03 ==
jsr compare ; if T00,S0(5|7),$03 ==
!byte $4E,$06,$BB !byte $4E,$06,$BB
bcs .exit bcs .exit
jsr PrintByID jsr PrintByID
@ -40,11 +39,11 @@
lda #$01 lda #$01
ldx #$38 ldx #$38
jsr compare ; if T00,S01,$38 == jsr compare3 ; if T00,S01,$38 ==
!byte $20,$03,$BB; JSR $BB03 !byte $20,$03,$BB; JSR $BB03
bcc .variant1 bcc .variant1
jsr compare ; if T00,S01,$38 == jsr compare3 ; if T00,S01,$38 ==
!byte $4C,$03,$BB; JMP $BB03 !byte $4C,$03,$BB; JMP $BB03
bcs .exit bcs .exit
lda #$05 lda #$05
@ -55,13 +54,11 @@
!byte $39,$41 !byte $39,$41
bcs .exit bcs .exit
;variant3 ;variant3
ldy #$02 jsr modify2 ; then set T00,S05,$6B =
jsr modify ; then set T00,S05,$6B =
!byte $6B,$F6 ; encrypted, decrypts to 'BNE +$5C' which will unconditionally branch to success path at $BBC9 !byte $6B,$F6 ; encrypted, decrypts to 'BNE +$5C' which will unconditionally branch to success path at $BBC9
lda #$06 lda #$06
ldx #$0F ldx #$0F
dey jsr modify1 ; and set T00,S06,$0F =
jsr modify ; and set T00,S06,$0F =
!byte $89 ; encrypted, decrypts to $10 which is the expected nibble count value !byte $89 ; encrypted, decrypts to $10 which is the expected nibble count value
; passport-test-suite/Trivia Fever.woz [V=0] reaches here ; passport-test-suite/Trivia Fever.woz [V=0] reaches here
bvc .exit ; unconditional branch (V is always 0 coming out of modify) bvc .exit ; unconditional branch (V is always 0 coming out of modify)

View File

@ -17,13 +17,12 @@
lda #$01 lda #$01
ldx #$48 ldx #$48
ldy #$02 jsr compare2
jsr compare
!byte $00,$9B !byte $00,$9B
bcs .exit ; passport-test-suite/Fathoms 40.woz [C=0] matches bcs .exit ; passport-test-suite/Fathoms 40.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_datasoft !byte s_datasoft
jsr modify jsr modify2
!byte $76,$9C !byte $76,$9C
.exit .exit
} }

View File

@ -63,8 +63,7 @@
lda #$08 lda #$08
inx inx
inx ; now $12 or $18 (depending on which compare matched) inx ; now $12 or $18 (depending on which compare matched)
ldy #$02 jsr modify2 ; then set T00,S08,$12/18 =
jsr modify ; then set T00,S08,$12/18 =
!byte $A9,$00 ; LDA #$00 !byte $A9,$00 ; LDA #$00
.exit .exit
} }

View File

@ -41,8 +41,7 @@
lda #$01 lda #$01
ldx #$38 ldx #$38
ldy #$03 jsr compare3
jsr compare
!byte $20,$93,$37 !byte $20,$93,$37
bcs + ; passport-test-suite/Bellhop.woz [C=0] matches bcs + ; passport-test-suite/Bellhop.woz [C=0] matches
jsr modify1 jsr modify1

View File

@ -12,13 +12,12 @@
!zone { !zone {
lda gIsDOS32 lda gIsDOS32
bne .exit bne .exit
lda #$0b lda #$0B
ldx #$84 ldx #$84
ldy #$03 jsr compare3 ; if T00,S0B,$84 ==
jsr compare ; if T00,S0B,$84 ==
!byte $4C,$F0,$BC !byte $4C,$F0,$BC
bcs .exit ; passport-test-suite/Demolition Division.woz [C=0] matches 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 !byte $AD,$E9,$B7
.exit .exit
} }

View File

@ -16,12 +16,11 @@
EARTHWARE EARTHWARE
lda #$02 lda #$02
ldx #$F6 ldx #$F6
ldy #$03 jsr compare3
jsr compare
!byte $4C,$89,$B6 !byte $4C,$89,$B6
bcs @exit ; passport-test-suite/Zoo Master.woz [C=0] here bcs @exit ; passport-test-suite/Zoo Master.woz [C=0] here
jsr PrintByID jsr PrintByID
!byte s_bytrack !byte s_bytrack
jsr modify jsr modify3
!byte $BD,$8C,$C0 !byte $BD,$8C,$C0
@exit @exit

View File

@ -18,15 +18,14 @@
lda #$0C lda #$0C
ldx #$84 ldx #$84
ldy #$03 jsr compare3 ; if T00,S0C,$84 ==
jsr compare ; if T00,S0C,$84 ==
!byte $4C,$00,$B5; JMP $B500 !byte $4C,$00,$B5; JMP $B500
bcs .exit bcs .exit
jsr PrintByID jsr PrintByID
!byte s_beforedos !byte s_beforedos
jsr modify ; then set T00,$0C,$84 = jsr modify3 ; then set T00,$0C,$84 =
!byte $AD,$E9,$B7 !byte $AD,$E9,$B7
.exit .exit
} }

View File

@ -98,8 +98,7 @@ _jmpbbfe
lda #$00 lda #$00
ldx #$4B ldx #$4B
ldy #$02 jsr compare2 ; if T00,S00,$4B ==
jsr compare ; if T00,S00,$4B ==
!byte $FE,$BB !byte $FE,$BB
bcs .exit bcs .exit
@ -128,8 +127,7 @@ _jmpbbfe
inx inx
inx inx
inx inx
ldy #$03 jsr modify3
jsr modify
!byte $6C,$FD,$08 !byte $6C,$FD,$08
ldx #$FE ldx #$FE

View File

@ -56,8 +56,7 @@ _jmpbeb1
!byte $A9 !byte $A9
bcs .exit bcs .exit
ldx #$5E ldx #$5E
ldy #$03 jsr compare3 ; and T00,S02,$5E ==
jsr compare ; and T00,S02,$5E ==
!byte $20,$BB,WILDCARD !byte $20,$BB,WILDCARD
bcs .exit ; passport-test-suite/Easy as ABC.woz [C=0] matches bcs .exit ; passport-test-suite/Easy as ABC.woz [C=0] matches
ldx #$49 ; passport-test-suite/Spelling Rules.woz [C=0] matches ldx #$49 ; passport-test-suite/Spelling Rules.woz [C=0] matches

View File

@ -11,8 +11,7 @@
lda #$07 lda #$07
ldx #$00 ldx #$00
ldy #$03 jsr compare3
jsr compare
!byte $20,$CC,$B6 !byte $20,$CC,$B6
bcs .exit bcs .exit
txa txa

View File

@ -34,11 +34,10 @@
lda #$0A lda #$0A
ldx #$12 ldx #$12
ldy #$02 jsr compare2
jsr compare
!byte $B1,$48 !byte $B1,$48
bcs .exit bcs .exit
jsr modify jsr modify2
!byte $A9,$00 !byte $A9,$00
.exit .exit
} }

View File

@ -11,8 +11,7 @@
lda #$07 lda #$07
ldx #$00 ldx #$00
ldy #$03 jsr compare3
jsr compare
!byte $20,$AF,$BE !byte $20,$AF,$BE
bcs .exit bcs .exit
lda #$08 lda #$08

View File

@ -11,8 +11,7 @@
lda #$08 lda #$08
ldx #$5A ldx #$5A
ldy #$03 jsr compare3 ; and T00,S08,$5A ==
jsr compare ; and T00,S08,$5A ==
!byte $4C,$B4,$36; JMP $36B4 !byte $4C,$B4,$36; JMP $36B4
bcs .exit bcs .exit
lda #$00 lda #$00
@ -40,8 +39,7 @@
!byte $24 ; BIT !byte $24 ; BIT
tya tya
ldx #$47 ldx #$47
ldy #$03 jsr compare3 ; if T00,S01,$47 ==
jsr compare ; if T00,S01,$47 ==
!byte $4C,$CE,$36; JMP $36CE !byte $4C,$CE,$36; JMP $36CE
bcs .exit bcs .exit
inx inx

View File

@ -23,8 +23,7 @@
bcs .exit ; passport-test-suite/Miner 2049er.woz [C=0] matches bcs .exit ; passport-test-suite/Miner 2049er.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_microfun !byte s_microfun
ldy #$02 jsr modify2
jsr modify
!byte $18 ; CLC !byte $18 ; CLC
!byte $60 ; RTS !byte $60 ; RTS
.exit .exit

View File

@ -11,11 +11,10 @@
lda #$02 lda #$02
ldx #$5E ldx #$5E
ldy #$03 jsr compare3
jsr compare
!byte $4C,$B8,$B6 !byte $4C,$B8,$B6
bcs .exit ; passort-test-suite/Crown Of Arthain.woz [C=0] matches bcs .exit ; passort-test-suite/Crown Of Arthain.woz [C=0] matches
jsr modify jsr modify3
!byte $20,$B8,$B8 !byte $20,$B8,$B8
.exit .exit
} }

View File

@ -11,11 +11,10 @@
bne .exit bne .exit
lda #$01 lda #$01
ldx #$48 ldx #$48
ldy #$02 jsr compare2 ; and T00,S01,$48 ==
jsr compare ; and T00,S01,$48 ==
!byte $03,$9B !byte $03,$9B
bcs .exit ; passport-test-suite/Tangrams Puzzler.woz [C=0] matches 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 !byte $84,$9D
.exit .exit
} }

View File

@ -14,8 +14,7 @@
bne .exit bne .exit
lda #$06 lda #$06
ldx #$F2 ldx #$F2
ldy #$03 jsr compare3 ; if T00,S06,$F2 ==
jsr compare ; if T00,S06,$F2 ==
!byte $20,$B6,$B6 !byte $20,$B6,$B6
bcs .exit ; passport-test-suite/The Function Game.woz [C=0] matches bcs .exit ; passport-test-suite/The Function Game.woz [C=0] matches
jsr PrintByID jsr PrintByID

View File

@ -11,40 +11,30 @@ _nibtable
lda #$02 lda #$02
ldx #$6D ldx #$6D
ldy #$03 jsr compare3 ; and T00,S02,$6D ==
jsr compare ; and T00,S02,$6D ==
!byte $BD,$29,$BA !byte $BD,$29,$BA
bcs .checkwrite bcs .checkwrite
lda #$02
ldx #$82 ldx #$82
ldy #$03 jsr compare3 ; and T00,S02,$82 ==
jsr compare ; and T00,S02,$82 ==
!byte $BD,$29,$BA !byte $BD,$29,$BA
bcs .checkwrite bcs .checkwrite
lda #$02
ldx #$95 ldx #$95
ldy #$03 jsr compare3 ; and T00,S02,$95 ==
jsr compare ; and T00,S02,$95 ==
!byte $BD,$29,$BA !byte $BD,$29,$BA
bcs .checkwrite bcs .checkwrite
jsr .fixwrite jsr .fixwrite
.checkwrite .checkwrite
lda #$03 lda #$03
ldx #$09 ldx #$09
ldy #$03 jsr compare3 ; if T00,S03,$09 ==
jsr compare ; if T00,S03,$09 ==
!byte $59,$00,$BA !byte $59,$00,$BA
bcs .exit bcs .exit
lda #$03
ldx #$1A ldx #$1A
ldy #$03 jsr compare3 ; and T00,S03,$1A ==
jsr compare ; and T00,S03,$1A ==
!byte $59,$00,$BA !byte $59,$00,$BA
bcs .exit bcs .exit
lda #$03
ldx #$2A ldx #$2A
ldy #$03 jsr compare3 ; and T00,S03,$2A ==
jsr compare ; and T00,S03,$2A ==
!byte $D9,$00,$BA !byte $D9,$00,$BA
bcs .exit bcs .exit
jsr .fixread jsr .fixread

View File

@ -29,8 +29,7 @@
inx inx
inx inx
inx inx
ldy #$02 jsr modify2
jsr modify
!byte $A9,$00 ;LDA #$00 !byte $A9,$00 ;LDA #$00
ldy #$06 ldy #$06
jsr SearchTrack jsr SearchTrack
@ -42,8 +41,7 @@
inx inx
inx inx
inx inx
ldy #$02 jsr modify2
jsr modify
!byte $A9,$00 ;LDA #$00 !byte $A9,$00 ;LDA #$00
;Monopoly ;Monopoly
@ -61,7 +59,7 @@
jsr SearchTrack jsr SearchTrack
!byte $4C,$56,$BB ;JMP $BB56 !byte $4C,$56,$BB ;JMP $BB56
bcs .exit bcs .exit
jsr modify jsr modify3
!byte $AD,$00,$E0 ;LDA $E000 !byte $AD,$00,$E0 ;LDA $E000
.exit .exit
} }

View File

@ -1,5 +1,5 @@
;------------------------------- ;-------------------------------
; #RDOS13 ; #rdos13
; patch RDOS to be 16-sector compatible ; patch RDOS to be 16-sector compatible
; ;
; module by qkumba ; module by qkumba
@ -45,11 +45,10 @@
lda #$0A lda #$0A
ldx #$75 ldx #$75
ldy #2 jsr compare2
jsr compare
!byte $C9,$D5 ;CMP #$D5 !byte $C9,$D5 ;CMP #$D5
bcc + bcc +
jsr modify jsr modify2
!byte $C9,$D5 ;CMP #$D5 !byte $C9,$D5 ;CMP #$D5
+ +

View File

@ -26,13 +26,12 @@ _rol1e
!byte $BD,$02,$01 !byte $BD,$02,$01
bcs .exit bcs .exit
ldx #$64 ldx #$64
ldy #$02 jsr compare2 ; and T00,S03,$64 ==
jsr compare ; and T00,S03,$64 ==
!byte $A5,$1E !byte $A5,$1E
bcs .exit ; passport-test-suite/Crypto Cube.woz [C=0] matches bcs .exit ; passport-test-suite/Crypto Cube.woz [C=0] matches
jsr PrintByID jsr PrintByID
!byte s_rol1e !byte s_rol1e
jsr modify ; then set T00,S03,$64 = jsr modify2 ; then set T00,S03,$64 =
!byte $A9,$F7 !byte $A9,$F7
.exit .exit
} }

View File

@ -26,8 +26,7 @@
lda #$01 lda #$01
ldx #$48 ldx #$48
ldy #$02 jsr compare2 ; if T00,S01,$48 ==
jsr compare ; if T00,S01,$48 ==
!byte $C1,$B3 !byte $C1,$B3
bcs .exit ; primary pattern not found, bail bcs .exit ; primary pattern not found, bail
@ -45,16 +44,16 @@
lda #$01 ; presence of JMP $B6B3 also indicates code at lda #$01 ; presence of JMP $B6B3 also indicates code at
ldx #$48 ; $B41F that copies the real DOS code back to $B6B3 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) ; so we modify $B747 to jump to that (it exits via $9D84)
jsr modify ; and set T00,S01,$48 = jsr modify2 ; and set T00,S01,$48 =
!byte $1F,$B4 !byte $1F,$B4
bvc .variant1 ; always branches bvc .variant1 ; always branches
.variant0 .variant0
lda #$01 ; lack of JMP $B6B3 indicates an earlier variant lda #$01 ; lack of JMP $B6B3 indicates an earlier variant
ldx #$48 ; which has no useful code at $B3C1, so we ldx #$48 ; which has no useful code at $B3C1, so we
ldy #$02 ; modify $B747 to jump directly to $9D84 ; modify $B747 to jump directly to $9D84
jsr modify jsr modify2
!byte $84,$9D !byte $84,$9D
; /!\ execution falls through here ; /!\ execution falls through here
@ -62,8 +61,7 @@
;A=#$01 here regardless of how we got here ;A=#$01 here regardless of how we got here
;Y=#$02 here regardless of how we got here ;Y=#$02 here regardless of how we got here
ldx #$87 ldx #$87
iny jsr compare3 ; if T00,S01,$87 ==
jsr compare ; if T00,S01,$87 ==
!byte $6C,$58,$9D !byte $6C,$58,$9D
bcs .variant2 ; passport-test-suite/Pac-Man (Thunder Mountain).woz [C=0] here bcs .variant2 ; passport-test-suite/Pac-Man (Thunder Mountain).woz [C=0] here
ldx #$8E ldx #$8E
@ -76,8 +74,7 @@
.variant2 .variant2
inx inx
ldy #$03 jsr compare3 ; if T00,S01,$88 ==
jsr compare ; if T00,S01,$88 ==
!byte $6C,$58,$9D !byte $6C,$58,$9D
bcs .exit ; passport/test-suite/Problem Solving in Algebra.woz [C=0] here bcs .exit ; passport/test-suite/Problem Solving in Algebra.woz [C=0] here
; if we didn't find indirect jump in either location, bail ; if we didn't find indirect jump in either location, bail

View File

@ -144,8 +144,7 @@
pla pla
inx inx
inx inx
ldy #2 jsr compare2
jsr compare
.cmpbyte5 .cmpbyte5
!byte $20,$D1 ; SMC !byte $20,$D1 ; SMC

View File

@ -87,8 +87,7 @@
bcs .exit bcs .exit
lda #$08 lda #$08
ldx #$8C ldx #$8C
ldy #$02 jsr compare2 ; and T00,S08,$8C ==
jsr compare ; and T00,S08,$8C ==
!byte $69,$BA !byte $69,$BA
bcc .yes ; passport-test-suite/Green Globs and Graphing Equations.woz [C=0] matches bcc .yes ; passport-test-suite/Green Globs and Graphing Equations.woz [C=0] matches
.exit .exit
@ -109,8 +108,7 @@
!byte $20,$C3,$BC !byte $20,$C3,$BC
lda #$08 lda #$08
ldx #$8C ldx #$8C
ldy #$02 jsr modify2 ; and set T00,S08,$8C =
jsr modify ; and set T00,S08,$8C =
!byte $A0,$B9 !byte $A0,$B9
.exit2 .exit2
} }

View File

@ -12,11 +12,10 @@
lda #$08 lda #$08
ldx #$5A ldx #$5A
ldy #$03 jsr compare3
jsr compare
!byte $4C,$71,$A9 ; JMP $A971 !byte $4C,$71,$A9 ; JMP $A971
bcs .exit bcs .exit
jsr modify jsr modify3
!byte $48,$A0,$01 !byte $48,$A0,$01
lda #$06 lda #$06
ldx #$56 ldx #$56

View File

@ -13,8 +13,7 @@
bne .exit bne .exit
lda #$0F lda #$0F
ldx #$31 ldx #$31
ldy #$03 jsr compare3
jsr compare
!byte $C9,$CF,$A0 !byte $C9,$CF,$A0
bcs .exit bcs .exit
lda #TRUE lda #TRUE

View File

@ -26,8 +26,7 @@
jsr PrintByID jsr PrintByID
!byte s_badblock !byte s_badblock
jsr inx4 jsr inx4
ldy #$02 jsr modify2
jsr modify
!byte $F0,$0E !byte $F0,$0E
.exit .exit
} }