clanup
This commit is contained in:
parent
8302f2132f
commit
9242ffc4e6
1 changed files with 13 additions and 15 deletions
16
dither4.s
16
dither4.s
|
@ -159,15 +159,14 @@ wait_loop:
|
|||
sta AUDC1 ; 4 cyc
|
||||
.endmacro
|
||||
|
||||
.macro audio_prep
|
||||
.macro audio_prep ; 8-9 cycles
|
||||
; Y is VCOUNT at entry
|
||||
lda (sample_ptr),y ; 5/6 cyc
|
||||
sta audiotemp ; 3 cyc
|
||||
.endmacro
|
||||
|
||||
; call with A pre-loaded to audiotemp
|
||||
.macro audio_play_lo
|
||||
;lda audiotemp ; 3 cyc
|
||||
.macro audio_play_lo ; 8 cycles
|
||||
; A is loaded with packed audio byte at entry
|
||||
and #$0f ; 2 cyc
|
||||
ora #$10 ; 2 cyc
|
||||
sta AUDC1 ; 4 cyc
|
||||
|
@ -217,25 +216,24 @@ wait_loop:
|
|||
inner_scanline frame_offset, 0 ; 23-26 cycles before break, 12 cycles after
|
||||
|
||||
ldy scanline ; 3 cycles
|
||||
audio_prep
|
||||
audio_play_lo
|
||||
audio_prep ; 8-9 cycles
|
||||
audio_play_lo ; 8 cycles
|
||||
|
||||
ldy scanline ; 3 cycles
|
||||
inner_scanline frame_offset, 128 ; 23-26 cycles before break, 12 cycles after
|
||||
|
||||
audio_play_hi
|
||||
audio_play_hi ; 12 cycles
|
||||
|
||||
; pair cleanup: 6 cycles
|
||||
ldy VCOUNT ; 4 cycles
|
||||
bne each_scanline_pair ; 2 cycles
|
||||
|
||||
; Do bookkeeping during vblank!
|
||||
audio_inc ; 22-32 cycles
|
||||
|
||||
; frame cleanup: 11 cycles
|
||||
lda frame_counter ; 3 cycles
|
||||
eor #1 ; 2 cycles
|
||||
sta frame_counter ; 3 cycles
|
||||
;jmp wait_start ; 3 cycles
|
||||
jmp each_frame ; 3 cycles
|
||||
.endscope
|
||||
.endmacro
|
||||
|
|
Loading…
Reference in a new issue