now stable in emulator

This commit is contained in:
Brooke Vibber 2022-12-11 17:46:56 -08:00
parent 2b9c14449a
commit 9ca396d27f

View file

@ -197,12 +197,17 @@ wait_loop:
cmp #.hibyte(audio_samples_end) ; 2 cyc cmp #.hibyte(audio_samples_end) ; 2 cyc
bmi audio_cont ; 2 cyc bmi audio_cont ; 2 cyc
sta WSYNC
; 10 cycles, optional ; 10 cycles, optional
lda #.lobyte(audio_samples) ; 2 lda #.lobyte(audio_samples) ; 2
sta sample_ptrl ; 3 sta sample_ptrl ; 3
lda #.hibyte(audio_samples) ; 2 lda #.hibyte(audio_samples) ; 2
sta sample_ptrh ; 3 sta sample_ptrh ; 3
sta WSYNC
ldy VCOUNT ; 4 cycles
audio_cont: audio_cont:
.endmacro .endmacro
@ -231,10 +236,12 @@ wait_loop:
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
jmp each_frame ; 3 cycles
.endscope .endscope
.endmacro .endmacro
each_frame:
lda frame_counter ; 3 cycles lda frame_counter ; 3 cycles
beq run_frame1 ; 2 cycles beq run_frame1 ; 2 cycles
jmp run_frame2 ; 3 cycles jmp run_frame2 ; 3 cycles