diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index 94546ed1..329af958 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -660,6 +660,7 @@ void DivPlatformAY8910::setFlags(unsigned int flags) { break; } ay->device_start(); + ay->device_reset(); stereo=(flags>>6)&1; } diff --git a/src/engine/platform/sound/ay8910.cpp b/src/engine/platform/sound/ay8910.cpp index 3dddf82c..7b38ad31 100644 --- a/src/engine/platform/sound/ay8910.cpp +++ b/src/engine/platform/sound/ay8910.cpp @@ -1063,6 +1063,7 @@ void ay8910_device::sound_stream_update(short** outputs, int outLen) tone = &m_tone[chan]; const int period = tone->period * (m_step_mul << 1); tone->count += is_expanded_mode() ? 32 : ((m_feature & PSG_HAS_EXPANDED_MODE) ? 1 : 2); + if (period==0) continue; while (tone->count >= period) { tone->duty_cycle = (tone->duty_cycle - 1) & 0x1f;