From 3ee3ce6689749c0c437a4ddf4c27f10154536c01 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 16 Jun 2021 22:03:03 -0700 Subject: [PATCH] shave some bytes --- src/patchers/sierra.a | 20 +++++--------------- src/wholetrack.a | 21 ++++++++------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/patchers/sierra.a b/src/patchers/sierra.a index bc22aa2..20d0d54 100755 --- a/src/patchers/sierra.a +++ b/src/patchers/sierra.a @@ -391,11 +391,6 @@ bcc + jmp .trybox + sta .cmp1+1 - sta .cmp2+1 - sta .cmp3+1 - sta .cmp4+1 - sta .cmp5+1 - sta .cmp6+1 pha adc #BASEPAGE sta .page1+2 @@ -464,8 +459,7 @@ txa adc #9 tax -.cmp2 - lda #$D1 + lda .cmp1+1 pha ldy #5 jsr compare @@ -505,8 +499,7 @@ sec bne .bcsexit4 + inx -.cmp3 - lda #$D1 + lda .cmp1+1 ldy #11 jsr compare !byte $8C,$F4,$B7 ;STY $B7F4 @@ -519,8 +512,7 @@ txa adc #11 tax -.cmp4 - lda #$D1 + lda .cmp1+1 pha ldy #2 jsr compare @@ -540,8 +532,7 @@ bcs .bcsexit6 + inx inx -.cmp5 - lda #$D1 + lda .cmp1+1 pha ldy #3 jsr compare @@ -568,8 +559,7 @@ pla adc #4 sta .tryalt+1 -.cmp6 - lda #$D1 + lda .cmp1+1 pha ldy #3 jsr compare diff --git a/src/wholetrack.a b/src/wholetrack.a index 5db1737..c884aeb 100755 --- a/src/wholetrack.a +++ b/src/wholetrack.a @@ -88,23 +88,19 @@ IsF7F6 bne - sec beq @driveoff -+ jsr ReadNib - cmp #$F6 - bne @restart - jsr ReadNib - cmp #$EF - bne @restart - jsr ReadNib - cmp #$EE - bne @restart - jsr ReadNib - cmp #$AB ++ ldx #3 +- jsr ReadNib + cmp @f7f6_sequence,x bne @restart + dex + bpl - clc @driveoff lda $C0E8 rts +@f7f6_sequence + !byte $AB,$E,$EF,$F6 ;------------------------------- ; SetupF7F6SecondRound ; @@ -202,6 +198,7 @@ IsUnformatted ; ; Timing-sensitive code! Cycle counts in margin for worst case path ; + clc @reset ldy #$00 @loop ldx $C0EC ; 4 bpl @loop ; 2 when not taken @@ -217,9 +214,7 @@ IsUnformatted iny ; 2 bne @loop ; 3 when taken sec - !byte $24 @unformatted - clc lda $C0E8 lda #$3F