mirror of
https://github.com/holub/mame
synced 2025-04-25 17:56:43 +03:00
vgmplay: Disable POKEY and QSound devices if not required
This commit is contained in:
parent
e6f15f526e
commit
9eb8c177bb
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user