shave some bytes

This commit is contained in:
4am 2021-06-13 01:43:46 -04:00
parent 9fa5659a73
commit 8edd3da266
39 changed files with 63 additions and 95 deletions

View File

@ -150,8 +150,8 @@ match_size2
lda match_buffer2+2
sec
sbc #BASEPAGE
clc
sta gDisplayBytes
clc
rts
; cold path
@ -181,8 +181,8 @@ all_done_set
; stack = string to compare
; #WILDCARD in search string matches any 1 byte
; (like "." character in regular expressions)
; out: C clear if string matches
; or set if not matched
; out: C = 0 if string matches, and gDisplayBytes set to A
; C = 1 if not matched
; A,X,Y preserved
; $tmp zero page clobbered
; $cmp1 zero page clobbered
@ -230,4 +230,6 @@ CompareMemory
compare_tmp_y=*+1
ldy #$FD ; SMC
plp
rts
bcs +
sta gDisplayBytes
+ rts

View File

@ -415,8 +415,8 @@ _byte_skip_hi:
!source "id/davidson.a"
!source "id/holle.a"
!source "id/phoenix.a"
!source "id/555.a"
!source "id/bootfailure.a"
!source "id/555.a"
!source "print.a"
!source "compare.a"
!source "modify.a"

View File

@ -8,26 +8,25 @@
;-------------------------------
!zone {
lda #$0F
sta gDisplayBytes
.loop lda gDisplayBytes
sta .sector+1
.sector lda #$FD ; SMC
ldx #$04
ldy #$0E
jsr compare
!byte $CE,$07,$02; DEC $0207
!byte $EF,$07,$02; ??? $0207 (becomes INC)
!byte $A0,$27 ; LDY #$27
!byte $D0,$02 ; BNE *+4
!byte $00 ; BRK
!byte $6C,$B9,$00; JMP ($00B9)
bcs + ; passport-test-suite/Moebius.woz [C=0] matches
!byte $CE,$07,$02 ; DEC $0207
!byte $EF,$07,$02 ; ??? $0207 (becomes INC)
!byte $A0,$27 ; LDY #$27
!byte $D0,$02 ; BNE *+4
!byte $00 ; BRK
!byte $6C,$B9,$00 ; JMP ($00B9)
bcs + ; passport-test-suite/Moebius.woz [C=0] matches
jsr PrintByID
!byte s_aacount
lda gDisplayBytes
ldy #$01
jsr modify
!byte $60 ; RTS
!byte $60 ; RTS
+
dec gDisplayBytes
bpl .loop
dec .sector+1
bpl .sector
.exit
}

View File

@ -16,7 +16,6 @@
lda gIsRWTS ; if DOS 3.3 RWTS
bne .exit
lda #$03
sta gDisplayBytes
ldx #$4F
ldy #$11
jsr compare ; and T00,S03,$4F ==

View File

@ -35,7 +35,6 @@
jsr compare ; if T00,S0(5|7),$03 ==
!byte $4E,$06,$BB
bcs .no
sta gDisplayBytes
jsr PrintByID
!byte s_bb03
lda gIsDavidDOS

View File

@ -17,7 +17,6 @@
!byte WILDCARD,$CE,$17,$18,$D0,$05,$A9,$80
!byte $8D,$18,$18
bcs .exit ; passport-test-suite/Elementary Vol. 2 v3.2 limited backup.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_bootcounter
ldy #$03

View File

@ -21,7 +21,6 @@
!byte $EA ; NOP
!byte $EA ; NOP
bcs .exit
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldy #$0A

View File

@ -34,7 +34,6 @@
jsr compare ; and T00,S03,$9A ==
JMP $B6B3
bcs .exit ; passport-test-suite/MIRV.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_dakin5
ldy #$03

View File

@ -21,7 +21,6 @@
!byte $AD,$E9,$C0
!byte $AD,$EE,$C0
bcs .exit ; passport-test-suite/Fathoms 40.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_datasoft
lda #$01

View File

@ -58,7 +58,6 @@
bcs .exit
.veryyes
sta gDisplayBytes
jsr PrintByID ; preserves registers
!byte s_diskvol

View File

@ -19,7 +19,6 @@ EARTHWARE
jsr compare
!byte $4C,$89,$B6
bcs @exit ; passport-test-suite/Zoo Master.woz [C=0] here
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldy #$03

View File

@ -20,17 +20,14 @@
!byte $4C,$32,$A3
bcs .exit ; passport-test-suite/Harvey by Primes.woz [C=0] here
lda #$A2
sta gDisplayBytes
lda #$82
sta gDisplayBytes+1
lda #$01
sta gDisplayBytes+2
ldy #$A2
sty gDisplayBytes+1 ; address (hi)
ldy #$82
sty gDisplayBytes+2 ; address (lo)
jsr PrintByID
!byte s_beforedos
lda #$01
inx ; #$96 because both compare and PrintByID preserve X
inx
tay
jsr modify ; then set T01,S01,$96 =
!byte $47

View File

@ -16,7 +16,6 @@
;-------------------------------
!zone {
lda #$0C
sta gDisplayBytes
ldx #$00
ldy #$19
jsr compare ; and T00,S0C,$00 ==

View File

@ -23,14 +23,14 @@
!byte $C8 ; INY
!byte $D0,$F5 ; BNE -
bcs .exit ; passport-test-suite/BackAid.woz [C=0] matches
sta gDisplayBytes+2 ; sector (A is still #$00 here)
lda #$20
sta gDisplayBytes ; address (hi)
lda #$12
sta gDisplayBytes+1 ; address (lo)
ldy #$20
sty gDisplayBytes+1 ; address (hi)
ldy #$12
sty gDisplayBytes+2 ; address (lo)
jsr PrintByID
!byte s_beforedos
lda #$00
ldx #$EC
ldy #$02
jsr modify ; then set T02,S00,$EC =

View File

@ -29,6 +29,7 @@
!byte $49,$4C ; EOR #$4C
!byte $99,$12,$B4; STA $B412,Y
bcs .exit
ldx #$D5
ldy #$16
jsr compare ; and T02,S03,$D5 ==
@ -45,15 +46,14 @@
; LDA $C088,X
; JMP $9D84
bcs .exit ; passport-test-suite/Binomial Multiplication.woz [C=0] matches
sta gDisplayBytes+2 ; sector
lda #$B4
sta gDisplayBytes ; address (hi)
lda #$00
sta gDisplayBytes+1 ; address (lo)
tax
ldx #$B4
stx gDisplayBytes+1 ; address (hi)
ldx #$00
stx gDisplayBytes+2 ; address (lo)
jsr PrintByID
!byte s_beforedos
lda #$03
tay
jsr modify ; then set T02,S03,$00 =
!byte $4C,$84,$9D

View File

@ -23,14 +23,14 @@
!byte $C8 ; INY
!byte $C0,$FF ; CPY #$FF
bcs .exit ; passport-test-suite/America Coast to Coast.woz [C=0] matches
sta gDisplayBytes+2 ; sector (A is still #$00 here)
lda #$B4
sta gDisplayBytes ; address (hi)
lda #$12
sta gDisplayBytes+1 ; address (lo)
ldy #$B4
sty gDisplayBytes ; address (hi)
ldy #$12
sty gDisplayBytes+1 ; address (lo)
jsr PrintByID
!byte s_beforedos
lda #$00
ldx #$F6
ldy #$02
jsr modify ; then set T02,S00,$F6 =

View File

@ -46,25 +46,28 @@
ldx gIsDOS32
bne +
lda #$0A
+ sta gDisplayBytes+2 ; sector
+
ldx #$D7
ldy #$04
jsr compare ; and T02,S0x,$D7 ==
!byte $D8 ; CLD
!byte $AD,$FF,$CF; LDA $CFFF
bcc .found ; passport-test-suite/Kamikaze.woz [C=0] matches
ldx #$DD
jsr compare ; or T02,S0x,$DD ==
!byte $D8 ; CLD
!byte $AD,$FF,$CF; LDA $CFFF
bcs .exit ; passport-test-suite/Snooper Troops Case 2.woz [C=0] matches
.found
ldy #$B4
sty gDisplayBytes ; address (hi)
sty gDisplayBytes+1 ; address (hi)
ldy #$BB
sty gDisplayBytes+1 ; address (lo)
sty gDisplayBytes+2 ; address (lo)
jsr PrintByID
!byte s_beforedos
inx
ldy #$03
jsr modify ; then set offset+1 to

View File

@ -10,23 +10,22 @@
!zone {
lda gIsRWTS ; if DOS 3.3-shaped RWTS
bne .exit
lda #$B5
sta gDisplayBytes+1 ; address (hi)
lda #$00
sta gDisplayBytes+2 ; address (lo)
lda #$0C
ldx #$84
ldy #$03
jsr compare ; if T00,S0C,$84 ==
!byte $4C,$00,$B5; JMP $B500
bcs .exit
;A is preserved, still #$0C
sta gDisplayBytes+2 ; sector
lda #$B5
sta gDisplayBytes ; address (hi)
lda #$00
sta gDisplayBytes+1 ; address (lo)
jsr PrintByID
!byte s_beforedos
lda #$0C
;X is preserved, still #$84
ldy #$03
jsr modify ; then set T00,$0C,$84 =
!byte $AD,$E9,$B7
.exit

View File

@ -27,7 +27,6 @@ _jmpb660
!byte $A0,$56
!byte $4C,$60,$B6
bcs .exit ; passport-test-suite/Analogies Tutorial.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_jmpb660
ldx #$F6

View File

@ -148,7 +148,6 @@ _jmpbbfe
!byte $00,$00,$00,$00,$00
bcc .exit ; passport-test-suite/Quadrilaterals.woz [C=1] here
sta gDisplayBytes
ldy #4
- lda $1560, y
sta gDisplayBytes+1, y

View File

@ -18,7 +18,6 @@ _jmpbcf0
!byte $D0,$A9
!byte $4C,$F0,$BC
bcs .exit ; passport-test-suite/Easy as ABC.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_jmpbcf0
ldy #$08

View File

@ -17,7 +17,6 @@
lda #$0F
sta .sector+1
.sector lda #$FF ; modified at runtime
sta gDisplayBytes
ldx #$00
ldy #$0A
jsr compare

View File

@ -23,7 +23,6 @@
!byte $AD,$EC,$B7
!byte $F0
bcs .exit
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldx #$D1

View File

@ -25,7 +25,6 @@
!byte $C9,$03
!byte $90
bcs .exit
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldx #$B8

View File

@ -32,7 +32,6 @@
!byte $A0,$01 ; LDY #$01
!byte $4C,$5D,$3E; JMP $3E5D
bcs .exit
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldx #$BD

View File

@ -15,7 +15,6 @@
jsr compare ; if T00,S06,$F2 ==
!byte $20,$B6,$B6
bcs .exit ; passport-test-suite/The Function Game.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldy #$01

View File

@ -17,7 +17,6 @@
lda #$0F
sta .sector+1
.sector lda #$FF ; modified at runtime
sta gDisplayBytes
ldx #$81
ldy #$18
jsr compare

View File

@ -12,7 +12,6 @@
lda #$0F
sta .sector+1
.sector lda #$FF ; modified at runtime
sta gDisplayBytes
ldx #$A5
ldy #$08
jsr compare

View File

@ -30,7 +30,6 @@ _rol1e
jsr compare ; and T00,S03,$64 ==
!byte $A5,$1E
bcs .exit ; passport-test-suite/Crypto Cube.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_rol1e
jsr modify ; then set T00,S03,$64 =

View File

@ -26,7 +26,6 @@
+
; DOS 3.3 variant
lda #$03
sta gDisplayBytes
ldx #$4F ; T00,S03,$4F
jsr -
bcc .yeslsr ; passport-test-suite/The Seasons.woz [C=0] matches
@ -36,7 +35,6 @@
bcc .yeslsr ; passport-test-suite/Roadwar 2000.woz [C=0] matches
; Pascal variant
lda #$0D
sta gDisplayBytes
ldx #$05 ; T00,S0D,$05
jsr -
bcs .endlsr ; passport-test-suite/GATO v1.3.woz [C=0] matches
@ -53,7 +51,6 @@
;-------------------------------
; DOS 3.3 variant
lda #$03
sta gDisplayBytes
ldx #$8B
ldy #$15
jsr compare ; if T00,S03,$8B ==
@ -97,7 +94,6 @@
;-------------------------------
; DOS 3.3 variant
lda #$03
sta gDisplayBytes
ldx #$8B
ldy #$09
jsr compare ; if T00,S03,$8B ==
@ -108,7 +104,6 @@
bcc .yesbne0 ; passport-test-suite/The Home Accountant.woz [C=0] matches
; David-DOS variant
lda #$05
sta gDisplayBytes
jsr compare ; or T00,S05,$8B ==
!byte $BD,$8C,$C0
!byte $10,$FB
@ -127,7 +122,6 @@
; for the second address epilogue nibble
;-------------------------------
lda #$03
sta gDisplayBytes
ldx #$95
ldy #$09
jsr compare ; if T00,S03,$95 ==

View File

@ -87,7 +87,6 @@
!byte $C9,$1D ;CMP #$1D
!byte $B0 ;BCS *+xx
bcs +
sta gDisplayBytes
jsr PrintByID
!byte s_tamper
inx
@ -589,7 +588,6 @@
bcs .exit
.yes
sta gDisplayBytes
bit gMode ; don't print anything in verify mode
bpl +
jsr PrintByID

View File

@ -21,7 +21,6 @@
CMP $C08C,X
!byte $D0,$A9 ; BNE $B942
bcs .exit ; passport-test-suite/Easy as ABC.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_springboard
ldx #$98

View File

@ -21,7 +21,6 @@
lda #$0F
.start sta .sector+1
.sector lda #$FF ; modified above
sta gDisplayBytes
ldx #$3A
ldy #$09
jsr compare

View File

@ -21,7 +21,6 @@
lda #$0F
sta .sector+1
.sector lda #$FF ; modified above
sta gDisplayBytes
ldx #$00
ldy #$08
jsr compare

View File

@ -23,7 +23,6 @@
JSR $BD00
@end_swordthrust
bcs .exit ; passport-test-suite/Swordthrust 1 The King's Testing Ground.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack
ldx #$81

View File

@ -18,7 +18,7 @@
;
; We've found what looks like a DOS 3.3-ish disk volume name, so print it
;
+ sta gDisplayBytes
+
adc #BASEPAGE ; carry is guaranteed to be clear here
sta .a+2
jsr PrintByID

View File

@ -18,9 +18,10 @@
!byte $20,$2D,$F1
!byte $C9,$00
bcs .exit ; passport-test-suite/Nine Princes in Amber.woz [C=0] matches
sta gDisplayBytes
jsr PrintByID
!byte s_trillium
inx
inx
inx

View File

@ -25,7 +25,6 @@
!byte $8D,$8D,$BE
bcs .exit ; passport-test-suite/Dawn Patrol.woz [C=0] here
sta gDisplayBytes
jsr PrintByID
!byte s_bytrack

View File

@ -343,7 +343,7 @@ StringTableHigh
.passport
!text "Passport ",$00
.header
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-06-12",$00
!text "@",s_passport,"by 4am@",s_space7,"@",s_space7," 2021-06-13",$00
.bar9
!text "_________",$00
.bar18
@ -636,8 +636,8 @@ StringTableHigh
.prontodos
!text "@",s_found,"Pronto-DOS @",s_bootloader,$8D,$00
.beforedos
!text "T%t,S%2 Disk calls a @",s_protectioncheck,$8D
!text "at $%0%1 before initializing DOS",$8D,$00
!text "T%t,S%0 Disk calls a @",s_protectioncheck,$8D
!text "at $%1%2 before initializing DOS",$8D,$00
.laureate
!text "@",s_found,"Laureate @",s_bootloader,$8D,$00
.bbf9