fire_tiny: shave a few more bytes off

This commit is contained in:
Vince Weaver 2018-12-30 16:57:19 -05:00
parent 5c67f08f41
commit 70ecf26c92

View File

@ -17,7 +17,8 @@
; 149 bytes -- use monitor GR ; 149 bytes -- use monitor GR
; 149 bytes -- load into zero page ; 149 bytes -- load into zero page
; 140 bytes -- start using zero-page addressing ; 140 bytes -- start using zero-page addressing
; 139 bytes -- rotate instead of mask for low bit
; 138 bytes -- bcs instead of jmp
; Zero Page ; Zero Page
SEEDL = $4E SEEDL = $4E
@ -56,28 +57,27 @@ white_loop:
fire_loop: fire_loop:
ldx #44 ; 22 * 2 ldx #44 ; 22 * 2 ; 2
yloop: yloop:
lda <gr_offsets,X ; 2
sta <smc2+1 ; 2
lda <gr_offsets+1,X ; 2
sta <smc2+2 ; 2
lda <gr_offsets+2,X ; 2
sta <smc1+1 ; 2
lda <gr_offsets+3,X ; 2
sta <smc1+2 ; 2
lda <gr_offsets,X stx TEMPY ; 2
sta <smc2+1
lda <gr_offsets+1,X
sta <smc2+2
lda <gr_offsets+2,X
sta <smc1+1
lda <gr_offsets+3,X
sta <smc1+2
stx TEMPY ldy #39 ; 2
ldy #39
xloop: xloop:
smc1: smc1:
lda $7d0,Y lda $7d0,Y ; 3
sta TEMP sta TEMP ; 2
and #$7 ; mask off and #$7 ; mask off ; 2
tax tax ; 1
;============================= ;=============================
; random8 ; random8
@ -97,20 +97,20 @@ noEor: sta SEEDL
; end inlined RNG ; end inlined RNG
and #$1 ror ; shift into carry ; 1
beq no_change bcc no_change ; 2
decrement: decrement:
lda <color_progression,X lda <color_progression,X ; 2
jmp done_change bcs done_change ; 2
no_change: no_change:
lda TEMP lda TEMP ; 2
done_change: done_change:
smc2: smc2:
sta $750,Y sta $750,Y ; 3
dey dey ; 1
bpl xloop bpl xloop ; 2
ldx TEMPY ldx TEMPY