That init isn't sufficient for turning off the audio. I use this code myself
Code: Select all
| halt Z80 and init FM chip
/* Allow the 68k to access the FM chip */
move.w #0x100,0xA11100
move.w #0x100,0xA11200
| reset YM2612
lea FMReset(pc),a5
lea 0xA00000,a0
move.w #0x4000,d1
moveq #26,d2
5:
move.b (a5)+,d1 /* FM reg */
move.b (a5)+,0(a0,d1.w) /* FM data */
nop
nop
dbra d2,5b
moveq #0x30,d0
moveq #0x5F,d2
6:
move.b d0,0x4000(a0) /* FM reg */
nop
nop
move.b #0xFF,0x4001(a0) /* FM data */
nop
nop
move.b d0,0x4002(a0) /* FM reg */
nop
nop
move.b #0xFF,0x4003(a0) /* FM data */
nop
nop
addq.b #1,d0
dbra d2,6b
| reset PSG
lea PSGReset(pc),a5
lea 0xC00000,a0
move.b (a5)+,0x0011(a0)
move.b (a5)+,0x0011(a0)
move.b (a5)+,0x0011(a0)
move.b (a5),0x0011(a0)
<cut>
FMReset:
/* disable LFO */
.byte 0,0x22
.byte 1,0x00
/* disable timer & set channel 6 to normal mode */
.byte 0,0x27
.byte 1,0x00
/* all KEY_OFF */
.byte 0,0x28
.byte 1,0x00
.byte 1,0x04
.byte 1,0x01
.byte 1,0x05
.byte 1,0x02
.byte 1,0x06
/* disable DAC */
.byte 0,0x2A
.byte 1,0x80
.byte 0,0x2B
.byte 1,0x00
/* turn off channels */
.byte 0,0xB4
.byte 1,0x00
.byte 0,0xB5
.byte 1,0x00
.byte 0,0xB6
.byte 1,0x00
.byte 2,0xB4
.byte 3,0x00
.byte 2,0xB5
.byte 3,0x00
.byte 2,0xB6
.byte 3,0x00
| PSG register initialization values
PSGReset:
.byte 0x9f /* set ch0 attenuation to max */
.byte 0xbf /* set ch1 attenuation to max */
.byte 0xdf /* set ch2 attenuation to max */
.byte 0xff /* set ch3 attenuation to max */
.align 4
That absolutely turns off all sound, but when you start the sound back up, FM percussions played FIRST don't sound right the first time they are keyed on for some reason. There's no problem with anything other than percussion that I've seen.