diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2018-03-22 17:14:28 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2018-03-22 17:14:28 -0400 |
commit | 9eb8c177bbcad019602acb55cbb6f9be35345e1e (patch) | |
tree | 8c16f90f2b3571592719ebdd0c5e71383d666d2a | |
parent | e6f15f526ec737c3a6e5c7caece61c71f74d6298 (diff) |
vgmplay: Disable POKEY and QSound devices if not required
-rw-r--r-- | src/devices/sound/pokey.cpp | 15 | ||||
-rw-r--r-- | src/emu/diexec.cpp | 8 | ||||
-rw-r--r-- | src/mame/drivers/vgmplay.cpp | 6 |
3 files changed, 17 insertions, 12 deletions
diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index 9792bcb8ec5..b82463a3e8e 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -201,8 +201,6 @@ void pokey_device::device_start() //int sample_rate = clock(); int i; - m_clock_period = attotime::from_hz(clock()); - /* Setup channels */ for (i=0; i<POKEY_CHANNELS; i++) { @@ -364,12 +362,15 @@ void pokey_device::device_post_load() void pokey_device::device_clock_changed() { - m_clock_period = attotime::from_hz(clock()); + m_clock_period = clocks_to_attotime(1); - if (m_stream != nullptr) - m_stream->set_sample_rate(clock()); - else - m_stream = stream_alloc(0, 1, clock()); + if (clock() != 0) + { + if (m_stream != nullptr) + m_stream->set_sample_rate(clock()); + else + m_stream = stream_alloc(0, 1, clock()); + } } //------------------------------------------------- diff --git a/src/emu/diexec.cpp b/src/emu/diexec.cpp index 8770349cf5f..d6885201a66 100644 --- a/src/emu/diexec.cpp +++ b/src/emu/diexec.cpp @@ -465,11 +465,11 @@ void device_execute_interface::interface_pre_reset() // reset the total number of cycles m_totalcycles = 0; - // enable all devices (except for disabled devices) - if (!disabled()) - resume(SUSPEND_ANY_REASON); - else + // enable all devices (except for disabled and unclocked devices) + if (disabled()) suspend(SUSPEND_REASON_DISABLE, true); + else if (device().clock() != 0) + resume(SUSPEND_ANY_REASON); } diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp index 79082bcf1fb..528d2dee81f 100644 --- a/src/mame/drivers/vgmplay.cpp +++ b/src/mame/drivers/vgmplay.cpp @@ -1119,7 +1119,11 @@ uint8_t vgmplay_state::r8(int off) const void vgmplay_state::machine_start() { - //m_nescpu-> + // Disable executing devices if not required + m_pokey[0]->set_unscaled_clock(0); + m_pokey[1]->set_unscaled_clock(0); + m_qsound->set_unscaled_clock(0); + uint32_t size = 0; if(m_file->exists() && m_file->length() > 0) { size = m_file->length(); |