blue_flame: more optimization, still 5 bytes too big

This commit is contained in:
Vince Weaver 2023-02-03 22:57:53 -05:00
parent 3e84b26e7b
commit 5cb27a5524
5 changed files with 31 additions and 77 deletions

View File

@ -15,6 +15,8 @@
; 1038 bytes (+18) -- re-arrange sound init so don't have to set Y to 0
; 1035 bytes (+15) -- combine memory zeroing functions
; 1033 bytes (+13) -- inline letters code
; 1029 bytes (+9) -- remove unecessary initialization in column code
; 1025 bytes (+5) -- optimize page flip
.include "zp.inc"
.include "hardware.inc"

View File

@ -91,24 +91,6 @@ xdraw_offset_smc:
jmp XDRAW0 ; tail call
.if 0
;=======================
; flip page
;=======================
flip_page:
lda HGR_PAGE
eor #$60
sta HGR_PAGE
clc
rol
rol
tax
lda PAGE1,X
rts
.endif
.if 0
@ -156,11 +138,6 @@ loop:
.align $100
rotate_pattern:
; offset by 3 to give original effect
; .byte 0,3,6
.byte 9, 9,6,3,0, 0,$FD,$FA,$F7, $F7,$FA,$FD, 0
.byte 0,3,6
deater_offsets:
.byte 0 ; D
@ -171,6 +148,7 @@ deater_offsets:
.byte 30 ; R
.byte $FF ; end
ma2e_offsets:
.byte 8 ; E
.byte 47 ; 2
@ -197,6 +175,11 @@ desire_ends:
ma2e_ends:
.byte 188,156,124,92
rotate_pattern:
; offset by 3 to give original effect
; .byte 0,3,6
.byte 9, 9,6,3,0, 0,$FD,$FA,$F7, $F7,$FA,$FD, 0
.byte 0,3,6
shape_table:
@ -212,6 +195,9 @@ shape_table_s: .byte $27,$2c,$95,$2b, $36,$3f,$00 ; 54
shape_table_i: .byte $d2,$ed,$24,$e4, $2d,$00 ; 61
shape_table_hline: .byte $2b,$05,$00 ; 67
;shape_table_vline: .byte $12,$24,$24,$00 ; 67
;shape_table_o: .byte $23,$2c,$35,$36, $3e,$27,$04,$00 ;
;shape_table_v: .byte $18,$30,$36,$35, $28,$24,$04,$00 ;

View File

@ -15,46 +15,7 @@
sier_parallax:
.if 0
;===================
; init screen
; already done for us
; jsr HGR ; clear PAGE1
; jsr HGR2 ; clear PAGE2
;===================
; int tables
ldx #191
sinit_loop:
txa
pha
jsr HPOSN
pla
tax
lda GBASL
sta hgr_lookup_l,X
lda GBASH
and #$1F ; 20 30 001X 40 50 010X
sta hgr_lookup_h,X
dex
cpx #$ff
bne sinit_loop
ldx #39
div4_loop:
txa
asl
asl
sta div4_lookup,X
dex
bpl div4_loop
.endif
; table init moved to main routine
parallax_forever:
@ -71,10 +32,18 @@ parallax_forever:
eor #$60 ; flip draw_page
sta HGR_PAGE
; asl asl rol eor
; want: $40 -> $80 C=1 $00 c=0 $01 $00 (page1)
; $20 -> $40 C=0 $80 c=1, $00 $01 (page2)
; what if asl asl asl rol
; $40 -> $80 -> $00 -> $00 -> $00
; $20 -> $40 -> $80 -> C=1 -> $01
asl
asl
asl
rol
eor #$1
tax
lda PAGE1,X ; flip show_page

View File

@ -1,11 +1,5 @@
; shimmery blue pattern
INDEXL = $F6
INDEXH = $F7
;HGR2 = $F3D8 ; set hires page2 and clear $4000-$5fff
;WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
even_lookup=$f000
odd_lookup=$f100
@ -16,13 +10,13 @@ staggered:
; tax ; init X to 0
ldx #0
stx INDEXL ; set INDEXL to 0
; set earlier
; ldx #0
; stx INDEXL ; set INDEXL to 0
; pulse loop horizontal
outer_loop:
; lda #$40 ; reset INDEXH to begin page2
lda #$20 ; reset INDEXH to begin page2
lda #$20 ; reset INDEXH to begin page1
sta INDEXH
inner_loop:
@ -44,18 +38,20 @@ inner_loop:
and #$7
tax
; lda #$60 ; see if done
lda #$40 ; see if done
cmp INDEXH
bne inner_loop
; lda #100 ; A is $60 here
; lda #100 ; A is $40 here
jsr WAIT ; pause a bit
; A is 0 here
inx ; offset next FRAME
; if FRAMEH is 4 then done
lda FRAMEH
cmp #4
bne outer_loop

View File

@ -21,7 +21,8 @@ FRAME = $80
FRAMEH = $81
WHICH_TRACK = $82
SONG_COUNTDOWN = $83
INDEXL = $84
INDEXH = $85
OUR_ROT = $A5