tweak
This commit is contained in:
parent
cf2a18e0d7
commit
0bae8670ba
1 changed files with 7 additions and 4 deletions
11
dither4.s
11
dither4.s
|
@ -209,25 +209,28 @@ wait_loop:
|
||||||
|
|
||||||
.macro run_frame frame_offset
|
.macro run_frame frame_offset
|
||||||
.scope
|
.scope
|
||||||
|
; each scanline is 228 color clocks
|
||||||
|
; that's 114 CPU cycles
|
||||||
|
; minus 41-43 for DMA leaves 71-73 clock cycles per line
|
||||||
|
|
||||||
each_scanline_pair:
|
each_scanline_pair:
|
||||||
sty scanline ; 3 cycles
|
sty scanline ; 3 cycles
|
||||||
inner_scanline frame_offset, 0 ; 23-26 cycles before break, 12 cycles after
|
inner_scanline frame_offset, 0 ; 23-26 cycles before break, 12 cycles after
|
||||||
|
|
||||||
audio_play_raw ; 11-12 cycles
|
audio_play_raw ; 11-12 cycles
|
||||||
audio_inc ; 7-24 cycles
|
audio_inc ; 7-24 cycles
|
||||||
|
|
||||||
ldy scanline ; 3 cycles
|
ldy scanline ; 3 cycles
|
||||||
inner_scanline frame_offset, 128 ; 23-26 cycles before break, 12 cycles after
|
inner_scanline frame_offset, 128 ; 23-26 cycles before break, 12 cycles after
|
||||||
|
|
||||||
; save for later lookup
|
; pair cleanup: 6 cycles
|
||||||
ldy VCOUNT ; 4 cycles
|
ldy VCOUNT ; 4 cycles
|
||||||
cpy #0 ; 2 cycles
|
|
||||||
bne each_scanline_pair ; 2 cycles
|
bne each_scanline_pair ; 2 cycles
|
||||||
|
|
||||||
|
; frame cleanup: 11 cycles
|
||||||
lda frame_counter ; 3 cycles
|
lda frame_counter ; 3 cycles
|
||||||
eor #1 ; 2 cycles
|
eor #1 ; 2 cycles
|
||||||
sta frame_counter ; 3 cycles
|
sta frame_counter ; 3 cycles
|
||||||
|
|
||||||
jmp wait_start ; 3 cycles
|
jmp wait_start ; 3 cycles
|
||||||
.endscope
|
.endscope
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
Loading…
Reference in a new issue