jingle sound is sane now

This commit is contained in:
FeralChild64 committed 2020-12-29 15:16:51 +01:00
1 parent b1131e219f
commit eab6efbe07
1 file changed
+19 -32
@@ -2,8 +2,6 @@
;; #LAYOUT# * * #IGNORE
; XXX invent something pleasant to hear, afterwards size-optimize the code
m65_chrout_screen_BELL: ; play bell (jingle)
lda M65_BELLDSBL
@@ -11,7 +9,15 @@ m65_chrout_screen_BELL: ; play bell (jingle)
; Play bell on both left&right secondary SIDs - first reset the SIDs
jsr m65_chrout_screen_BELL_clear
ldx #$1F
lda #$00
@1:
sta __SID_BASE + $20,x
sta __SID_BASE + $60,x
dex
bpl @1
; Set jingle parameters
lda #$0A ; volume
sta SID_SIGVOL + $20
@@ -20,44 +26,36 @@ m65_chrout_screen_BELL: ; play bell (jingle)
ldx #$04 ; wait loop, to prevent popping sound
jsr m65_chrout_screen_BELL_wait
lda #$23 ; channel 1 - attack/decay
lda #$1D ; channel 1 - attack/decay
sta SID_ATDCY1 + $20
sta SID_ATDCY1 + $60
lda #$91 ; channel 1 - sustain/release
lda #$06 ; channel 1 - sustain/release
sta SID_SUREL1 + $20
sta SID_SUREL1 + $60
lda #$1D ; channel 1 - frequency (HI)
lda #$21 ; channel 1 - frequency (HI)
sta SID_FREHI1 + $20
sta SID_FREHI1 + $60
lda #$42 ; channel 3 - frequency (HI)
sta SID_FREHI3 + $20
sta SID_FREHI3 + $60
lda #$00 ; channel 1 - frequency (LO)
sta SID_FRELO1 + $20
sta SID_FRELO1 + $60
lda #$00 ; channel 3 - frequency (LO)
sta SID_FRELO3 + $20
sta SID_FRELO3 + $60
lda #$10 ; channel 3 - waveform (triangle)
sta SID_VCREG3 + $20
sta SID_VCREG3 + $60
; Play jingle
lda #$17 ; channel 1 - waveform (triangle), synchronized, modulated
lda #$11 ; channel 1 - waveform (triangle)
sta SID_VCREG1 + $20
sta SID_VCREG1 + $60
ldx #$0F ; wait loop
ldx #$08 ; wait loop
jsr m65_chrout_screen_BELL_wait
lda #$14 ; stop the jingle
lda #$10
sta SID_VCREG1 + $20
sta SID_VCREG1 + $60
ldx #$04 ; wait loop
ldx #$04 ; wait loop before clear, to prevent popping sound
jsr m65_chrout_screen_BELL_wait
; FALLTROUGH
@@ -66,7 +64,7 @@ m65_chrout_screen_BELL_done:
jmp m65_chrout_screen_done
m65_chrout_screen_BELL_wait: ; XXX this can probably be deduplicated
m65_chrout_screen_BELL_wait: ; XXX this can probably be deduplicated
phx
ldx #$FF
@@ -76,17 +74,6 @@ m65_chrout_screen_BELL_wait: ; XXX this can probably be deduplicated
bne m65_chrout_screen_BELL_wait
rts
m65_chrout_screen_BELL_clear:
ldx #$1F
lda #$00
@1:
sta __SID_BASE + $20,x
sta __SID_BASE + $60,x
dex
bpl @1
rts
m65_chrout_esc_G: ; enable bell
lda #$00