From c2dce7520a87fe2d8b60c05ba93cc12e70a42932 Mon Sep 17 00:00:00 2001 From: ekeeke31 Date: Wed, 27 Jan 2010 07:13:04 +0000 Subject: [PATCH] fixed YM2612 reset values --- source/sound/ym2612.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/source/sound/ym2612.c b/source/sound/ym2612.c index 9ac1bc8..2c53161 100644 --- a/source/sound/ym2612.c +++ b/source/sound/ym2612.c @@ -1800,10 +1800,14 @@ static void reset_channels(FM_CH *CH , int num ) for( c = 0 ; c < num ; c++ ) { - CH[c].fc = 0; + CH[c].mem_value = 0; + CH[c].op1_out[0] = 0; + CH[c].op1_out[1] = 0; for(s = 0 ; s < 4 ; s++ ) { - CH[c].SLOT[s].ssg = 0; + CH[c].SLOT[s].Incr = -1; + CH[c].SLOT[s].key = 0; + CH[c].SLOT[s].phase = 0; CH[c].SLOT[s].ssgn = 0; CH[c].SLOT[s].state = EG_OFF; CH[c].SLOT[s].volume = MAX_ATT_INDEX; @@ -1928,21 +1932,27 @@ int YM2612ResetChip(void) { int i; - ym2612.OPN.eg_timer = 0; - ym2612.OPN.eg_cnt = 0; + ym2612.OPN.eg_timer = 0; + ym2612.OPN.eg_cnt = 0; - ym2612.OPN.lfo_timer = 0; - ym2612.OPN.lfo_cnt = 0; - ym2612.OPN.LFO_AM = 0; - ym2612.OPN.LFO_PM = 0; + ym2612.OPN.lfo_timer = 0; + ym2612.OPN.lfo_cnt = 0; + ym2612.OPN.LFO_AM = 0; + ym2612.OPN.LFO_PM = 0; - ym2612.OPN.ST.TAC = 0; - ym2612.OPN.ST.TBC = 0; + ym2612.OPN.ST.TAC = 0; + ym2612.OPN.ST.TBC = 0; + + ym2612.OPN.SL3.key_csm = 0; + + ym2612.dacen = 0; + ym2612.dacout = 0; OPNWriteMode(0x27,0x30); OPNWriteMode(0x26,0x00); OPNWriteMode(0x25,0x00); OPNWriteMode(0x24,0x00); + OPNWriteMode(0x22,0x00); reset_channels(&ym2612.CH[0] , 6 ); @@ -1957,9 +1967,6 @@ int YM2612ResetChip(void) OPNWriteReg(i|0x100,0); } - /* DAC mode clear */ - ym2612.dacen = 0; - ym2612.dacout = 0; return 0; }