Megadrive (burn_ym2612.cpp): prevent crash if savestate functions are used after a reset.

This commit is contained in:
dinkc64 2014-08-04 18:37:54 +00:00
parent 6df9411161
commit 33028eb0ca
1 changed files with 4 additions and 0 deletions

View File

@ -308,9 +308,13 @@ void BurnYM2612Exit()
DebugSnd_YM2612Initted = 0;
}
void BurnStateExit();
INT32 BurnYM2612Init(INT32 num, INT32 nClockFrequency, FM_IRQHANDLER IRQCallback, INT32 (*StreamCallback)(INT32), double (*GetTimeCallback)(), INT32 bAddSignal)
{
DebugSnd_YM2612Initted = 1;
BurnStateExit(); // prevent crash (in fm.c, bottom of YM2612Init()) if the postload function is double-called (e.g.after a reset) Aug 4, 2014 - dink
if (num > MAX_YM2612) num = MAX_YM2612;