This commit is contained in:
Brooke Vibber 2022-11-30 03:36:25 -08:00
parent d44924aeb4
commit 7dfa1dfb26

107
dither4.s
View file

@ -131,54 +131,33 @@ wait_loop:
each_scanline:
; it'll fire on unused lines, but harmlessly
.macro audio_prep
; audio sample; low nybble
;ldx #0
;lda (sample_ptr,x)
;sta temp2
jmp fake
; audio sample; low nybble
ldx #0
lda (sample_ptr,x)
sta temp2
; high nybble
;lsr a
;lsr a
;lsr a
;lsr a
; set the volume-only bit
;ora #$10
;pha
; high nybble
lsr a
lsr a
lsr a
lsr a
; set the volume-only bit
ora #$10
pha
; low nybble
;lda temp2
;and #$0f
; set the volume-only bit
;ora #$10
lda #0
pha
pha
.endmacro
; low nybble
lda temp2
and #$0f
; set the volume-only bit
ora #$10
lda #0
pha
.macro audio_inc
; Increment sample ptr
clc
lda sample_ptrl
adc #1
sta sample_ptrl
lda sample_ptrh
adc #0
sta sample_ptrh
lda sample_ptrh
cmp #.hibyte(audio_samples_end)
bne audio_cont
lda sample_ptrl
cmp #.lobyte(audio_samples_end)
bne audio_cont
lda #.lobyte(audio_samples)
sta sample_ptrl
lda #.hibyte(audio_samples)
sta sample_ptrh
audio_cont:
.endmacro
fake:
lda #18
pha
pha
.macro inner_scanline
ldy scanline
@ -200,22 +179,44 @@ each_scanline:
sty COLPF2
; Audio sample
;pla
;sta AUDC1
pla
sta AUDC1
inc scanline
.endmacro
;audio_prep
inner_scanline
inc scanline
;audio_inc ; too slow?
; Increment sample ptr
jmp audio_cont
inc sample_ptrl
bne audio_cont
inc sample_ptrh
lda sample_ptrh
cmp #.hibyte(audio_samples_end)
bne audio_cont
lda sample_ptrl
cmp #.lobyte(audio_samples_end)
bne audio_cont
lda #.lobyte(audio_samples)
sta sample_ptrl
lda #.hibyte(audio_samples)
sta sample_ptrh
audio_cont:
inner_scanline
inc scanline
lda VCOUNT
cmp #130
bne each_scanline
cmp #130 ;#130
;bne each_scanline
bne foo
jmp wait_start
foo:
jmp each_scanline
.endproc