1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-16 18:08:04 +00:00
cc65/libsrc/pce/psg.s

29 lines
898 B
ArmAsm
Raw Normal View History

2015-08-29 13:58:57 +00:00
.export psg_init
2015-10-02 14:50:22 +00:00
.include "pce.inc"
.segment "ONCE"
psg_init:
2015-11-17 14:14:15 +00:00
stz PSG_GLOBAL_PAN ; Silence global balance
ldx #6 - 1
2015-09-04 12:14:17 +00:00
psg_clear_loop:
2015-09-04 12:14:17 +00:00
stx PSG_CHAN_SELECT ; Select channel
stz PSG_FREQ_LO ; Clear frequency LSB
stz PSG_FREQ_HI ; Clear frequency MSB
stz PSG_CHAN_CTRL ; Clear volume
stz PSG_CHAN_PAN ; Clear balance
stz PSG_NOISE ; Clear noise control
stz PSG_LFO_FREQ ; Clear LFO frequency
stz PSG_LFO_CTRL ; Clear LFO control
ldy #$20
2015-08-29 13:58:57 +00:00
psg_clear_waveform:
2015-09-04 12:14:17 +00:00
stz PSG_CHAN_DATA ; Clear waveform byte
dey
2015-08-29 13:58:57 +00:00
bne psg_clear_waveform
dex
bpl psg_clear_loop
2015-08-29 13:58:57 +00:00
rts