don't clear incremental palettes before stepping

This commit is contained in:
4am 2021-11-30 21:29:38 -05:00
parent 7f96f96132
commit d826236cc7

View File

@ -37,26 +37,12 @@ dst = $FE ; word
iny iny
bne - bne -
;Y=0
sta $C004 sta $C004
lda #$60 ; clear $2000 bytes at $6000/main
sta src+1 ; for use as incremental palettes
ldx #$20
tya
- sta (src), y
iny
bne -
inc src+1
dex
bne -
; lda #$00
; sta src
lda #$9E lda #$9E
sta src+1 sta src+1
ldx #$0F ; palette counter ($0F -> $00, not used as index) ldx #$0F ; palette counter ($0F -> $00, not used as index)
rb_palette_loop rb_palette_loop
ldy #$00 ; byte offset of color # within palette (00.1F) ldy #$00 ; byte offset within palette (00 -> 1F, used as index)
rb_color_loop rb_color_loop
lda #$00 lda #$00
sta fracv sta fracv
@ -73,7 +59,8 @@ rb_color_loop
asl asl
asl asl
sta incv sta incv
- lda fracv rb_step_loop
lda fracv
clc clc
adc incv adc incv
sta fracv sta fracv
@ -83,7 +70,7 @@ rb_color_loop
sta (dst), y sta (dst), y
inc dst+1 inc dst+1
inc dst+1 inc dst+1
bpl - bpl rb_step_loop
iny iny
cpy #$20 cpy #$20
bcc rb_color_loop bcc rb_color_loop
@ -96,13 +83,11 @@ rb_color_loop
+ dex + dex
bpl rb_palette_loop bpl rb_palette_loop
; lda #$00
; sta src
lda #$9E lda #$9E
sta src+1 sta src+1
ldx #$0F ; palette # ldx #$0F ; palette counter ($0F -> $00, not used as index)
g_palette_loop g_palette_loop
ldy #$00 ; byte offset of color # within palette (00.1F) ldy #$00 ; byte offset within palette (00 -> 1E by 2, used as index)
g_color_loop g_color_loop
lda #$00 lda #$00
sta fracv sta fracv
@ -116,7 +101,8 @@ g_color_loop
lda (src), y ; get final Green value for this color in this palette lda (src), y ; get final Green value for this color in this palette
and #$F0 ; Green value is bits 4-7, mask out other bits and #$F0 ; Green value is bits 4-7, mask out other bits
sta incv sta incv
- lda fracv g_step_loop
lda fracv
clc clc
adc incv adc incv
sta fracv sta fracv
@ -129,7 +115,7 @@ g_color_loop
sta (dst), y sta (dst), y
inc dst+1 inc dst+1
inc dst+1 inc dst+1
bpl - bpl g_step_loop
iny iny
iny ; high nibble of second color byte is always 0 so skip it iny ; high nibble of second color byte is always 0 so skip it
cpy #$20 cpy #$20
@ -167,7 +153,6 @@ copy2 lda $6300, y ; SMC
bmi exit bmi exit
dex dex
bpl copyloop bpl copyloop
exit sta $C004 exit jmp UnwaitForVBL
jmp UnwaitForVBL
!source "src/wait.a" !source "src/wait.a"