trigger the clock hacks on specific values, to avoid causing problems with correct files (nw)

This commit is contained in:
smf- 2018-07-30 15:21:41 +01:00
parent dc45fa90cb
commit 6f4d3570bc

View File

@ -1801,8 +1801,13 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
if (version >= 0x161 && data_start >= 0xa0 && (r32(0x9c) & 0x40000000))
logerror("Warning: file requests an unsupported 2nd K051649\n");
m_k054539[0]->set_clock_scale(384); // HACK: VGMs contain 48,000 instead of 18,432,000
m_k054539[1]->set_clock_scale(384); // HACK: VGMs contain 48,000 instead of 18,432,000
// HACK: Some VGMs contain 48,000 instead of 18,432,000
if (version >= 0x161 && data_start >= 0xa4 && (r32(0xa0) & ~0x40000000) == 48000)
{
m_k054539[0]->set_clock_scale(384);
m_k054539[1]->set_clock_scale(384);
}
m_k054539[0]->set_unscaled_clock(version >= 0x161 && data_start >= 0xa4 ? r32(0xa0) & ~0x40000000 : 0);
m_k054539[1]->set_unscaled_clock(version >= 0x161 && data_start >= 0xa4 && (r32(0xa0) & 0x40000000) ? r32(0xa0) & ~0x40000000 : 0);
@ -1820,7 +1825,10 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state, load_file)
m_pokey[0]->set_unscaled_clock(version >= 0x161 && data_start >= 0xb4 ? r32(0xb0) & ~0x40000000 : 0);
m_pokey[1]->set_unscaled_clock(version >= 0x161 && data_start >= 0xb4 && (r32(0xb0) & 0x40000000) ? r32(0xb0) & ~0x40000000 : 0);
m_qsound->set_clock_scale(15); // HACK: VGMs contain 4,000,000 instead of 60,000,000
// HACK: VGMs contain 4,000,000 instead of 60,000,000
if (version >= 0x161 && data_start >= 0xb8 && r32(0xb4) == 4000000)
m_qsound->set_clock_scale(15);
m_qsound->set_unscaled_clock(version >= 0x161 && data_start >= 0xb8 ? r32(0xb4) : 0);
if (version >= 0x171 && data_start >= 0xbc && r32(0xb8))