summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author smf- <smf-@users.noreply.github.com>2018-07-30 15:21:41 +0100
committer smf- <smf-@users.noreply.github.com>2018-07-30 15:21:41 +0100
commit6f4d3570bcee39592862fd65824300ef02f2eee5 (patch)
tree74de2be0b9ce3b2ca80b890ebebd621be78b7a49
parentdc45fa90cbb9ff26702171643fd2cf8fbda7a93b (diff)
trigger the clock hacks on specific values, to avoid causing problems with correct files (nw)
-rw-r--r--src/mame/drivers/vgmplay.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp
index 8fd9a0b1907..238a0905843 100644
--- a/src/mame/drivers/vgmplay.cpp
+++ b/src/mame/drivers/vgmplay.cpp
@@ -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))