shave some bytes

This commit is contained in:
4am 2021-06-13 01:06:09 -04:00
parent c6df2ec549
commit 9fa5659a73
34 changed files with 16 additions and 64 deletions

View File

@ -12,7 +12,7 @@ WILDCARD = $97
; out: C clear if string found
; or set if not found
; If C is clear, then
; A = sector where string was found
; A = @gDisplayBytes = sector where string was found
; X = starting offset where string was found
; all other registers and flags clobbered
;-------------------------------
@ -151,6 +151,7 @@ match_size2
sec
sbc #BASEPAGE
clc
sta gDisplayBytes
rts
; cold path

View File

@ -154,9 +154,8 @@ Pass
!byte s_writingto
jsr PrintByID
!byte s_slotanddrive
jsr SwapProDOS ; ProDOS out -> in
jsr WriteRAMToDisk
; C=1 if error, and A=MLI error code
jsr SwapProDOS ; ProDOS out -> in (preserves registers+flags)
jsr WriteRAMToDisk ; C=1 if error, and A=MLI error code
jsr SwapProDOS ; ProDOS in -> out (preserves registers+flags)
bit KEY ; preserves C
bmi Cancel
@ -176,27 +175,27 @@ Pass
sta +
jsr PrintByID
+ !byte $FD ; SMC
jmp TheEnd
bvc .TheEnd ; always branches
Cancel
jsr PrintByID
!byte s_canceled
jmp TheEnd
bvc .TheEnd ; always branches
FatalError
jsr PrintByID
!byte s_fail
lda gTrack
cmp #$22
bne @TheEnd
bne .TheEnd
lda gSector
cmp #$0F
beq @failont22s0f
ldx gIsDOS32
bne @TheEnd
bne .TheEnd
cmp #$0C
bne @TheEnd
bne .TheEnd
@failont22s0f
jsr PrintByID
!byte s_fatal220f
@TheEnd jmp TheEnd
.TheEnd jmp TheEnd

View File

@ -16,7 +16,6 @@
!byte $4C,$A5,$00; JMP $00A5
!byte $C9,$A5 ; CMP #$A5
bcs .exit ; passport-test-suite/Game Frame One.woz [C=0] matches
sta gDisplayBytes
jsr inx8
jsr PrintByID
!byte s_a5count

View File

@ -31,7 +31,6 @@
!byte $AE,$F8,$01; LDX $01F8
!byte $A9
bcs .exit
sta gDisplayBytes
jsr PrintByID
!byte s_a6bc95
ldy #$01

View File

@ -25,7 +25,6 @@
!byte $74,$45,$09 ;LDA $C08C,X
!byte $D9,$32 ;BPL -$FB
bcs .exit ; passport-test-suite/S.A.G.A. 6.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_advint
ldy #$03

View File

@ -27,7 +27,6 @@
STA ($3C),Y
@searchend
bcs .exit ; passport-test-suite/Photar.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldy #$01

View File

@ -31,7 +31,6 @@
!byte $A6,WILDCARD
!byte $BD,$89,$C0
bcs .exit ; passport-test-suite/Odd One Out 1990.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_bbf9
ldy #$02

View File

@ -31,7 +31,6 @@
!byte $38 ; SEC
!byte $60 ; RTS
bcs .exit ; passport-test-suite/Mr. Pixel's Programming Paint Set.woz [C=0] matches
sta gDisplayBytes
jsr inx9
ldy #$01
jsr modify

View File

@ -50,7 +50,7 @@
!byte $18 ; CLC
!byte $6D ; ADC
bcs .exit ; passport-test-suite/RoboMath.woz [C=0] matches
sta gDisplayBytes ; passport-test-suite/Notecard Maker.woz [C=0] matches
; passport-test-suite/Notecard Maker.woz [C=0] matches
jsr PrintByID
!byte s_d5d5f7
ldy #$01

View File

@ -11,7 +11,6 @@
jsr SearchTrack
!byte $5D,$D4,$80,$49,00,$19
bcs .exit ; passport-test-suite/Tomahawk.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_datasoft
ldy #$01

View File

@ -17,7 +17,6 @@
jsr SearchTrack
!byte $08,$80,$00,$FD,$1C,$D1,$0D,$EC
bcs .exit ; passport-test-suite/Read 'N Roll.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_badblock
inx

View File

@ -36,7 +36,6 @@
!byte $8D
;
bcs .exit ; passport-test-suite/Garfield Trivia Game.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_e7everywhere
ldy #$02

View File

@ -119,7 +119,6 @@
!byte $07,$01 ;SUB #$4d
!byte $0F,$F5,$70 ;BNE $a9f6
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -151,7 +150,6 @@
!byte $D0,$7C ;BNE +$7C
!byte $60 ;RTS
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -173,7 +171,6 @@
!byte $07,$1C ;SUB #$50
!byte $0F,$78,$60 ;BNE $B97B
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -195,7 +192,6 @@
!byte $20,$67,$67 ;JSR $6767
!byte $20,$AA,$BF ;JSR $BFAA
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -212,7 +208,6 @@
!byte $C9,$52 ;CMP #$52
!byte $F0,$03 ;BEQ +$03
bcs +
sta gDisplayBytes
jsr PrintByID
!byte s_tamper
jsr inx6
@ -226,7 +221,6 @@
!byte $C9,$52 ;CMP #$52
!byte $D0,$DB ;BNE -$DB
bcs +
sta gDisplayBytes
jsr PrintByID
!byte s_tamper
jsr inx4
@ -364,7 +358,6 @@
!byte $E9,$00 ;SBC #$00
!byte $48 ;PHA
bcs +
sta gDisplayBytes
jsr PrintByID
!byte s_tamper
inx
@ -382,7 +375,6 @@
!byte $C9,$A0 ;CMP #$A0
!byte $F0 ;BEQ *+xx
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -407,7 +399,6 @@
!byte $04,$F1,$70 ;LDA $a9f2
!byte $07 ;CMP #$xx
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -498,7 +489,6 @@
!byte $5E,$00
!byte $5E,$0D
bcs +
sta gDisplayBytes
jsr PrintByID
!byte s_tamper
inx
@ -538,7 +528,6 @@
!byte $D0,$F8 ;BNE $8111
!byte $E6,$98 ;INC $98
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper

View File

@ -25,7 +25,6 @@ ERRORD51
!byte $8D,WILDCARD,WILDCARD
!byte $20
bcs @exit
sta gDisplayBytes
pha
clc
adc #BASEPAGE

View File

@ -102,7 +102,6 @@
!byte $F0,WILDCARD
!byte $BC,$8C,$C0
bcs .exit ; passport-test-suite/Maniac Mansion.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_fbff
ldy #$05

View File

@ -29,11 +29,10 @@
!byte $39,$FD ; DEC $02
!byte $2F,$FB ; BNE +4
!byte $39,$FC ; DEC $03
bcs .exit ; passport-test-suite/Oo-Topos.woz [C=0] matches
bcs .exit ; passport-test-suite/Oo-Topos.woz [C=0] matches
inx
inx
inx
sta gDisplayBytes
jsr PrintByID
!byte s_fbff
ldy #$01

View File

@ -27,7 +27,6 @@
!byte $AC,$EC,$C0; LDY $C0EC
bcs .exit ; passport-test-suite/The Typewriter.woz [C=0] matches
stx .a+1
sta gDisplayBytes
adc #BASEPAGE ; carry is guaranteed to be clear here
sta .a+2
ldy #$10 ; get the branch offset from the WILDCARD above

View File

@ -17,10 +17,8 @@
!byte $03,$31,$32,$38,$02,$31,$31,$02
!byte $39,$36
bcs .exit ; passport-test-suite/Essential Grammar.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_poke
ldy #$12
jsr modify
!byte $34,$34,$01,$30,$02,$31,$30,$03
!byte $32,$33,$34,$03,$31,$36,$39,$02

View File

@ -35,8 +35,6 @@
!byte $20
@search2end
bcs .exit ; passport-test-suite/Super Taxman II.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_hallabs
ldy #$01

View File

@ -20,7 +20,6 @@
!byte $D0,$01
!byte $60
bcs .exit ; passport-test-suite/Clue Master Detective.woz [C=0] matches
sta gDisplayBytes
ldy #$01
sty gDisplayBytes+1
jsr PrintByID

View File

@ -26,7 +26,6 @@
!byte $8D,$08,$C0 ; STA $C008
!byte $B5,$42 ; LDA $42,X
bcs .exit ; passport-test-suite/Rosie the Counting Rabbit.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_runhello
inx

View File

@ -20,7 +20,6 @@
!byte $84,$27 ; STY $27
!byte $BD,$8C,$C0; LDA $C08C,X
bcs .exit ; passport-test-suite/Miner 2049er.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_microfun
ldy #$02

View File

@ -22,7 +22,6 @@
!byte $10,$F7 ; BPL *-9
!byte $4C,$E3,$93 ; JMP $93E3
bcs .exit ; passport-test-suite/Polywriter.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_pdi
jsr inx0C

View File

@ -26,7 +26,6 @@
inx ; passport-test-suite/The Crimson Crown.woz [C=0] reaches here
inx
inx
sta gDisplayBytes
jsr PrintByID
!byte s_fbff
ldy #$01
@ -43,7 +42,6 @@
!byte $F0,$09 ; BEQ +9
!byte $AE ; LDX
bcs .exit ; passport-test-suite/The Crimson Crown.woz [C=0] matches
sta gDisplayBytes
jsr inx9
jsr PrintByID
!byte s_tamper

View File

@ -14,7 +14,6 @@
!byte $50,$54,$58,$5C,$60,$64,$68,$00
!byte $20,$10,$30,WILDCARD,$AA,$EB
bcs + ; passport-test-suite/Mystery Objects v1.1.woz [C=0] matches
sta gDisplayBytes
jsr inx0B
ldy #$01
jsr compare
@ -40,7 +39,6 @@
!byte $24,$38
!byte $60
bcs + ; passport-test-suite/Miner's Cave.woz [C=0] matches
sta gDisplayBytes
jsr inx9
ldy #$01
jsr modify
@ -55,7 +53,6 @@
!byte $81,$C0,$28,$D0,$09,$8D,WILDCARD,WILDCARD
!byte $C9,$DE,$F0,$02,$18,$24,$38,$60
bcs + ; passport-test-suite/Spelling Press v1.1.woz [C=0] matches
sta gDisplayBytes
jsr inx0B
jsr inx0B
ldy #$01

View File

@ -20,7 +20,6 @@ _prodosrwts
!byte $F0,$01
!byte $38
bcs .exit ; passport-test-suite/Mystery Objects v1.1.woz [C=0] matches
sta gDisplayBytes
jsr inx0F
ldy #$01
jsr compare

View File

@ -13,7 +13,6 @@
!byte $A9,$D5
!byte $8D,$7A,$BC
bcs + ; passport-test-suite/Word Wizards v1.0.woz [C=0] matches
sta gDisplayBytes
jsr inx5
ldy #$01
jsr modify
@ -28,7 +27,6 @@
!byte $A2,$06
!byte $BD
bcs + ; passport-test-suite/Zoyon Patrol v1.0.woz [C=0] matches
sta gDisplayBytes
jsr inx4
ldy #$01
jsr modify
@ -41,7 +39,6 @@
!byte $D0,$11
!byte $B9
bcs + ; passport-test-suite/MECC Dataquest Composer [C=0] matches
sta gDisplayBytes
jsr inx5
ldy #$01
jsr modify
@ -58,7 +55,6 @@
!byte $B9,WILDCARD,WILDCARD
!byte $8D,$AC,$D5
bcs + ; passport-test-suite/MECC Dataquest - Europe and Soviet Union.woz [C=0] matches
sta gDisplayBytes
ldy #$03
jsr modify
!byte $A9,$00

View File

@ -287,7 +287,7 @@
!byte $BD,$89,$C0 ;LDA $C089,X
jsr inx4
bcs ++
+ sta gDisplayBytes
+
jsr PrintByID
!byte s_sierra
ldy #$01
@ -307,7 +307,6 @@
!byte WILDCARD ;INX or DEX
!byte $D0,$FB ;BNE *-5
bcs +
sta gDisplayBytes
pha
jsr PrintByID
!byte s_tamper
@ -332,7 +331,6 @@
!byte $CD,WILDCARD,WILDCARD ;CMP $xxxx
!byte $D0,$30 ;BNE *+$32
bcs +
sta gDisplayBytes
jsr PrintByID
!byte s_tamper
ldy #$01

View File

@ -19,7 +19,6 @@
!byte $A9,$FF
!byte $48
bcs .exit ; passport-test-suite/Advanced Electricity.woz [C=0] matches
sta gDisplayBytes
jsr inx8
ldy #$01
jsr modify

View File

@ -21,7 +21,6 @@
!byte $EA ; NOP
bcs + ; passport-test-suite/Epidemic.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_ssi
ldy #$01
@ -35,7 +34,6 @@
!byte $A9,$44 ; LDA #$22
!byte $20 ; JSR ...
bcs .exit ; passport-test-suite/Sixgun Shootout.woz [C=0] matches
sta gDisplayBytes
ldy #$01
jsr modify
!byte $60 ; RTS

View File

@ -26,7 +26,6 @@
!byte $AD,$83,$C0; LDA $C083
!byte $AD,$83,$C0; LDA $C083
bcs .exit ; passport-test-suite/Rendezvous with Rama rev. 2.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_trillium
ldy #$01

View File

@ -23,7 +23,6 @@
!byte $D0,$05
!byte $A9,$00
bcs .exit ; passport-test-suite/PlayWriter.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_badblock
jsr inx4

View File

@ -14,7 +14,6 @@
!byte $4C,$4D,$D0,$E2,$28,$4B,$42,$C9 ; 'LM = PEEK(KB - 2058)' in BASIC
!byte $32,$30,$35,$38
bcs .exit ; passport-test-suite/Zoom Grafix 26-JAN-82.woz [C=0] matches
sta gDisplayBytes
ldy #$00
sty gDisplayBytes+1
jsr PrintByID

View File

@ -8,7 +8,8 @@ kForceLower !byte $FF ; AND mask for lowercase letters
; auto-uppercases on older machines
; in: string ID (byte) on stack
; out: all registers preserved
; all flags clobbered
; oVerflow bit clear
; all other flags clobbered
; stack set to after params
;-------------------------------
PrintByID
@ -106,6 +107,7 @@ PrintByID
pla
tay
pla
clv
rts
@include
sta @id