mirror of
https://github.com/jeremysrand/BuGS.git
synced 2025-01-29 12:31:12 +00:00
Finish changing the sound code to adopt the new method for modifying registers.
This commit is contained in:
parent
9d42dd3c59
commit
13f8602048
@ -17,12 +17,12 @@
|
||||
<key>DiskImage.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
<key>doNotBuild.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>3</integer>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
260
BuGS/gameSound.s
260
BuGS/gameSound.s
@ -155,212 +155,18 @@ soundInit entry
|
||||
pea FIRE_SOUND_ADDR
|
||||
jsl loadFireSound
|
||||
|
||||
short m
|
||||
lda >SOUND_SYSTEM_VOLUME
|
||||
and #$0f
|
||||
ora #$20
|
||||
sta >SOUND_CONTROL_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_LOW+FIRE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FIRE_FREQ_LOW
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_HIGH+FIRE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FIRE_FREQ_HIGH
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_SIZE+FIRE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FIRE_SIZE
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_POINTER+FIRE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FIRE_SOUND_ADDR/256
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_CONTROL+FIRE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FIRE_CONTROL+SOUND_HALTED+SOUND_RIGHT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
lda #FIRE_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
long m
|
||||
|
||||
; Extra life sound
|
||||
pea EXTRA_LIFE_SOUND_ADDR
|
||||
jsl loadExtraLifeSound
|
||||
|
||||
short m
|
||||
lda >SOUND_SYSTEM_VOLUME
|
||||
and #$0f
|
||||
ora #$20
|
||||
sta >SOUND_CONTROL_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_LOW+EXTRA_LIFE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #EXTRA_LIFE_FREQ_LOW
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_HIGH+EXTRA_LIFE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #EXTRA_LIFE_FREQ_HIGH
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_VOLUME+EXTRA_LIFE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #EXTRA_LIFE_VOLUME
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_SIZE+EXTRA_LIFE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #EXTRA_LIFE_SIZE
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_POINTER+EXTRA_LIFE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #EXTRA_LIFE_SOUND_ADDR/256
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_CONTROL+EXTRA_LIFE_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #EXTRA_LIFE_CONTROL+SOUND_HALTED+SOUND_RIGHT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
lda #EXTRA_LIFE_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
long m
|
||||
|
||||
; Flea sound
|
||||
pea FLEA_SOUND_ADDR
|
||||
jsl loadFleaSound
|
||||
|
||||
short m
|
||||
lda >SOUND_SYSTEM_VOLUME
|
||||
and #$0f
|
||||
ora #$20
|
||||
sta >SOUND_CONTROL_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_LOW+FLEA_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda fleaFreqs
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_HIGH+FLEA_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda fleaFreqs+1
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_VOLUME+FLEA_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #$0
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_SIZE+FLEA_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FLEA_SIZE
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_POINTER+FLEA_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #FLEA_SOUND_ADDR/256
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_CONTROL+FLEA_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
lda #SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
long m
|
||||
|
||||
; Scorpion sound
|
||||
pea SCORPION_SOUND_ADDR
|
||||
jsl loadScorpionSound
|
||||
|
||||
short m
|
||||
lda >SOUND_SYSTEM_VOLUME
|
||||
and #$0f
|
||||
ora #$20
|
||||
sta >SOUND_CONTROL_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_LOW+SCORPION_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #SCORPION_FREQ_LOW
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_FREQ_HIGH+SCORPION_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #SCORPION_FREQ_HIGH
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_VOLUME+SCORPION_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #$0
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_SIZE+SCORPION_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #SCORPION_SIZE
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_POINTER+SCORPION_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #SCORPION_SOUND_ADDR/256
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
|
||||
lda #SOUND_REG_CONTROL+SCORPION_OSC_NUM
|
||||
sta >SOUND_ADDR_LOW
|
||||
lda #SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
lda #SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER
|
||||
sta >SOUND_DATA_REG
|
||||
sta >SOUND_DATA_REG
|
||||
long m
|
||||
|
||||
; Set registers
|
||||
short m
|
||||
_docWait
|
||||
@ -368,7 +174,6 @@ soundInit entry
|
||||
and #$0f
|
||||
sta >SOUND_CONTROL_REG
|
||||
|
||||
|
||||
ldx #soundRegDefaults
|
||||
soundInit_loop anop
|
||||
ldy |$0,x
|
||||
@ -1141,9 +946,74 @@ soundRegDefaults anop
|
||||
dc i1'SOUND_REG_CONTROL+KILL_OSC_NUM+1',i1'KILL_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
|
||||
; Fire registers
|
||||
dc i1'SOUND_REG_FREQ_LOW+FIRE_OSC_NUM',i1'FIRE_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_LOW+FIRE_OSC_NUM+1',i1'FIRE_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+FIRE_OSC_NUM',i1'FIRE_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+FIRE_OSC_NUM+1',i1'FIRE_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_SIZE+FIRE_OSC_NUM',i1'FIRE_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+FIRE_OSC_NUM+1',i1'FIRE_SIZE'
|
||||
dc i1'SOUND_REG_POINTER+FIRE_OSC_NUM',i1'FIRE_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+FIRE_OSC_NUM+1',i1'FIRE_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_CONTROL+FIRE_OSC_NUM',i1'FIRE_CONTROL+SOUND_HALTED+SOUND_RIGHT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+FIRE_OSC_NUM+1',i1'FIRE_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
|
||||
; Extra life registers
|
||||
dc i1'SOUND_REG_FREQ_LOW+EXTRA_LIFE_OSC_NUM',i1'EXTRA_LIFE_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_LOW+EXTRA_LIFE_OSC_NUM+1',i1'EXTRA_LIFE_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+EXTRA_LIFE_OSC_NUM',i1'EXTRA_LIFE_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+EXTRA_LIFE_OSC_NUM+1',i1'EXTRA_LIFE_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_VOLUME+EXTRA_LIFE_OSC_NUM',i1'EXTRA_LIFE_VOLUME'
|
||||
dc i1'SOUND_REG_VOLUME+EXTRA_LIFE_OSC_NUM+1',i1'EXTRA_LIFE_VOLUME'
|
||||
dc i1'SOUND_REG_SIZE+EXTRA_LIFE_OSC_NUM',i1'EXTRA_LIFE_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+EXTRA_LIFE_OSC_NUM+1',i1'EXTRA_LIFE_SIZE'
|
||||
dc i1'SOUND_REG_POINTER+EXTRA_LIFE_OSC_NUM',i1'EXTRA_LIFE_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+EXTRA_LIFE_OSC_NUM+1',i1'EXTRA_LIFE_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_CONTROL+EXTRA_LIFE_OSC_NUM',i1'EXTRA_LIFE_CONTROL+SOUND_HALTED+SOUND_RIGHT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+EXTRA_LIFE_OSC_NUM+1',i1'EXTRA_LIFE_CONTROL+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
|
||||
; Flea registers
|
||||
dc i1'SOUND_REG_VOLUME+FLEA_OSC_NUM',i1'0'
|
||||
dc i1'SOUND_REG_VOLUME+FLEA_OSC_NUM+1',i1'0'
|
||||
dc i1'SOUND_REG_VOLUME+FLEA_OSC_NUM+2',i1'0'
|
||||
dc i1'SOUND_REG_VOLUME+FLEA_OSC_NUM+3',i1'0'
|
||||
dc i1'SOUND_REG_SIZE+FLEA_OSC_NUM',i1'FLEA_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+FLEA_OSC_NUM+1',i1'FLEA_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+FLEA_OSC_NUM+2',i1'FLEA_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+FLEA_OSC_NUM+3',i1'FLEA_SIZE'
|
||||
dc i1'SOUND_REG_POINTER+FLEA_OSC_NUM',i1'FLEA_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+FLEA_OSC_NUM+1',i1'FLEA_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+FLEA_OSC_NUM+2',i1'FLEA_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+FLEA_OSC_NUM+3',i1'FLEA_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_CONTROL+FLEA_OSC_NUM',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+FLEA_OSC_NUM+1',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+FLEA_OSC_NUM+2',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+FLEA_OSC_NUM+3',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
|
||||
; Scorpion registers
|
||||
dc i1'SOUND_REG_FREQ_LOW+SCORPION_OSC_NUM',i1'SCORPION_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_LOW+SCORPION_OSC_NUM+1',i1'SCORPION_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_LOW+SCORPION_OSC_NUM+2',i1'SCORPION_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_LOW+SCORPION_OSC_NUM+3',i1'SCORPION_FREQ_LOW'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+SCORPION_OSC_NUM',i1'SCORPION_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+SCORPION_OSC_NUM+1',i1'SCORPION_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+SCORPION_OSC_NUM+2',i1'SCORPION_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_FREQ_HIGH+SCORPION_OSC_NUM+3',i1'SCORPION_FREQ_HIGH'
|
||||
dc i1'SOUND_REG_VOLUME+SCORPION_OSC_NUM',i1'0'
|
||||
dc i1'SOUND_REG_VOLUME+SCORPION_OSC_NUM+1',i1'0'
|
||||
dc i1'SOUND_REG_VOLUME+SCORPION_OSC_NUM+2',i1'0'
|
||||
dc i1'SOUND_REG_VOLUME+SCORPION_OSC_NUM+3',i1'0'
|
||||
dc i1'SOUND_REG_SIZE+SCORPION_OSC_NUM',i1'SCORPION_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+SCORPION_OSC_NUM+1',i1'SCORPION_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+SCORPION_OSC_NUM+2',i1'SCORPION_SIZE'
|
||||
dc i1'SOUND_REG_SIZE+SCORPION_OSC_NUM+3',i1'SCORPION_SIZE'
|
||||
dc i1'SOUND_REG_POINTER+SCORPION_OSC_NUM',i1'SCORPION_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+SCORPION_OSC_NUM+1',i1'SCORPION_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+SCORPION_OSC_NUM+2',i1'SCORPION_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_POINTER+SCORPION_OSC_NUM+3',i1'SCORPION_SOUND_ADDR/256'
|
||||
dc i1'SOUND_REG_CONTROL+SCORPION_OSC_NUM',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+SCORPION_OSC_NUM+1',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_RIGHT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+SCORPION_OSC_NUM+2',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
dc i1'SOUND_REG_CONTROL+SCORPION_OSC_NUM+3',i1'SOUND_ONE_SHOT_MODE+SOUND_HALTED+SOUND_LEFT_SPEAKER'
|
||||
|
||||
soundRegDefaultsEnd anop
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user