N64: Fixed a bug with saving/loading a state before the first frame, causing the audio frequency to be very wrong, and breaking the resampler

This commit is contained in:
pjgat09 2013-05-11 15:34:07 +00:00
parent effdf1f6dc
commit 7b2ad6a1f8
2 changed files with 19 additions and 12 deletions

View File

@ -319,18 +319,25 @@ EXPORT void CALL AiDacrateChanged( int SystemType )
if (!l_PluginInit)
return;
switch (SystemType)
{
case SYSTEM_NTSC:
f = 48681812 / (*AudioInfo.AI_DACRATE_REG + 1);
break;
case SYSTEM_PAL:
f = 49656530 / (*AudioInfo.AI_DACRATE_REG + 1);
break;
case SYSTEM_MPAL:
f = 48628316 / (*AudioInfo.AI_DACRATE_REG + 1);
break;
}
if (*AudioInfo.AI_DACRATE_REG == 0)
{
f = DEFAULT_FREQUENCY;
}
else
{
switch (SystemType)
{
case SYSTEM_NTSC:
f = 48681812 / (*AudioInfo.AI_DACRATE_REG + 1);
break;
case SYSTEM_PAL:
f = 49656530 / (*AudioInfo.AI_DACRATE_REG + 1);
break;
case SYSTEM_MPAL:
f = 48628316 / (*AudioInfo.AI_DACRATE_REG + 1);
break;
}
}
InitializeAudio(f);
}