]> git.sur5r.net Git - cc65/blob - libsrc/pce/psg.s
Made the code that logs indirect-goto referals be a little more efficient.
[cc65] / libsrc / pce / psg.s
1         .export         psg_init
2
3         .include        "pce.inc"
4
5         .segment        "ONCE"
6 psg_init:
7         stz     PSG_GLOBAL_PAN          ; Silence global balance
8         ldx     #6 - 1
9
10 psg_clear_loop:
11         stx     PSG_CHAN_SELECT         ; Select channel
12         stz     PSG_FREQ_LO             ; Clear frequency LSB
13         stz     PSG_FREQ_HI             ; Clear frequency MSB
14         stz     PSG_CHAN_CTRL           ; Clear volume
15         stz     PSG_CHAN_PAN            ; Clear balance
16         stz     PSG_NOISE               ; Clear noise control
17         stz     PSG_LFO_FREQ            ; Clear LFO frequency
18         stz     PSG_LFO_CTRL            ; Clear LFO control
19
20         ldy     #$20
21 psg_clear_waveform:
22         stz     PSG_CHAN_DATA           ; Clear waveform byte
23         dey
24         bne     psg_clear_waveform
25
26         dex
27         bpl     psg_clear_loop
28         rts