More rework from last night of the sound code to adopt new register writes.

This commit is contained in:
Jeremy Rand 2021-01-22 14:15:22 -05:00
parent 0d681e3571
commit 25765e6975

View File

@ -953,36 +953,27 @@ stopSpiderSound_doIt anop
sta spiderSoundIsPlaying sta spiderSoundIsPlaying
short m short m
_docWait
lda >SOUND_SYSTEM_VOLUME lda >SOUND_SYSTEM_VOLUME
and #$0f and #$0f
ora #$20
sta >SOUND_CONTROL_REG sta >SOUND_CONTROL_REG
lda #SOUND_REG_VOLUME+SPIDER_OSC_NUM _writeReg #SOUND_REG_VOLUME+SPIDER_OSC_NUM,#0
sta >SOUND_ADDR_LOW _writeReg #SOUND_REG_VOLUME+SPIDER_OSC_NUM+1,#0
lda #$0 _writeReg #SOUND_REG_VOLUME+SPIDER_OSC_NUM+2,#0
sta >SOUND_DATA_REG _writeReg #SOUND_REG_VOLUME+SPIDER_OSC_NUM+3,#0
sta >SOUND_DATA_REG
sta >SOUND_DATA_REG
sta >SOUND_DATA_REG
lda #SOUND_REG_CONTROL+SPIDER_OSC_NUM
sta >SOUND_ADDR_LOW
lda #SOUND_ONE_SHOT_MODE+SOUND_RIGHT_SPEAKER
sta >SOUND_DATA_REG
sta >SOUND_DATA_REG
lda #SOUND_ONE_SHOT_MODE+SOUND_LEFT_SPEAKER
sta >SOUND_DATA_REG
sta >SOUND_DATA_REG
lda #SOUND_REG_CONTROL+SPIDER_OSC_NUM _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM,#SOUND_ONE_SHOT_MODE+SOUND_RIGHT_SPEAKER
sta >SOUND_ADDR_LOW _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM+1,#SOUND_ONE_SHOT_MODE+SOUND_RIGHT_SPEAKER
lda #SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM+2,#SOUND_ONE_SHOT_MODE+SOUND_LEFT_SPEAKER
sta >SOUND_DATA_REG _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM+3,#SOUND_ONE_SHOT_MODE+SOUND_LEFT_SPEAKER
sta >SOUND_DATA_REG
lda #SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM,#SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER
sta >SOUND_DATA_REG _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM+1,#SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER
sta >SOUND_DATA_REG _writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM+2,#SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER
_writeReg #SOUND_REG_CONTROL+SPIDER_OSC_NUM+3,#SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER
long m long m
rtl rtl
@ -997,30 +988,31 @@ startScorpionSound_doIt anop
stz scorpionSoundIsPlaying stz scorpionSoundIsPlaying
short m short m
_docWait
lda >SOUND_SYSTEM_VOLUME lda >SOUND_SYSTEM_VOLUME
and #$0f and #$0f
ora #$20
sta >SOUND_CONTROL_REG sta >SOUND_CONTROL_REG
lda #SOUND_REG_CONTROL+SCORPION_OSC_NUM _writeReg #SOUND_REG_CONTROL+SCORPION_OSC_NUM,#SCORPION_CONTROL+SOUND_HALTED+SOUND_RIGHT_SPEAKER
sta >SOUND_ADDR_LOW _writeReg #SOUND_REG_CONTROL+SCORPION_OSC_NUM+1,#SCORPION_CONTROL+SOUND_RIGHT_SPEAKER
lda #SCORPION_CONTROL+SOUND_HALTED+SOUND_RIGHT_SPEAKER _writeReg #SOUND_REG_CONTROL+SCORPION_OSC_NUM+2,#SCORPION_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER
sta >SOUND_DATA_REG _writeReg #SOUND_REG_CONTROL+SCORPION_OSC_NUM+3,#SCORPION_CONTROL+SOUND_LEFT_SPEAKER
lda #SCORPION_CONTROL+SOUND_RIGHT_SPEAKER
sta >SOUND_DATA_REG
lda #SCORPION_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER
sta >SOUND_DATA_REG
lda #SCORPION_CONTROL+SOUND_LEFT_SPEAKER
sta >SOUND_DATA_REG
lda #SOUND_REG_VOLUME+SCORPION_OSC_NUM ldy #SOUND_REG_VOLUME+SCORPION_OSC_NUM
sta >SOUND_ADDR_LOW lda tileRightVolume,x
jsr writeReg
iny
lda tileRightVolume,x
jsr writeReg
iny
lda tileRightVolume,x lda tileRightVolume,x
sta >SOUND_DATA_REG
sta >SOUND_DATA_REG
eor #$ff eor #$ff
sta >SOUND_DATA_REG jsr writeReg
sta >SOUND_DATA_REG iny
lda tileRightVolume,x
eor #$ff
jsr writeReg
long m long m
rtl rtl
@ -1032,19 +1024,25 @@ updateScorpionSound entry
updateScorpionSound_doIt anop updateScorpionSound_doIt anop
short m short m
_docWait
lda >SOUND_SYSTEM_VOLUME lda >SOUND_SYSTEM_VOLUME
and #$0f and #$0f
ora #$20
sta >SOUND_CONTROL_REG sta >SOUND_CONTROL_REG
lda #SOUND_REG_VOLUME+SCORPION_OSC_NUM ldy #SOUND_REG_VOLUME+SCORPION_OSC_NUM
sta >SOUND_ADDR_LOW lda tileRightVolume,x
jsr writeReg
iny
lda tileRightVolume,x
jsr writeReg
iny
lda tileRightVolume,x lda tileRightVolume,x
sta >SOUND_DATA_REG
sta >SOUND_DATA_REG
eor #$ff eor #$ff
sta >SOUND_DATA_REG jsr writeReg
sta >SOUND_DATA_REG iny
lda tileRightVolume,x
eor #$ff
jsr writeReg
long m long m
rtl rtl