From a0009b0d0072ba7ea0aafa923b4fe7c6afb4e10b Mon Sep 17 00:00:00 2001 From: "msaarna@gmail.com" Date: Sun, 27 Mar 2022 19:19:37 -0400 Subject: [PATCH] two-tone kludge --- src/devices/sound/pokey.cpp | 9 ++++++--- src/devices/sound/pokey.h | 1 - 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index 8016dcaa..1f04306b 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -666,8 +666,10 @@ uint32_t pokey_device::step_one_clock(void) else m_channel[CHAN1].reset_channel(); - if (m_SKCTL & SK_TWOTONE) - m_channel[CHAN2].reset_channel(); +// ** In two-tone mode both channels should reset each other, but activating +// ** this one causes off-pitch notes with two-tone music... +// if (m_SKCTL & SK_TWOTONE) +// m_channel[CHAN2].reset_channel(); process_channel(CHAN1); @@ -676,11 +678,13 @@ uint32_t pokey_device::step_one_clock(void) m_irq_f(IRQ_TIMR1); } + if (m_channel[CHAN2].check_borrow()) { int isJoined = (m_AUDCTL & CH12_JOINED); if (isJoined) m_channel[CHAN1].reset_channel(); + if (m_SKCTL & SK_TWOTONE) m_channel[CHAN1].reset_channel(); @@ -693,7 +697,6 @@ uint32_t pokey_device::step_one_clock(void) m_irq_f(IRQ_TIMR2); } - if (m_channel[CHAN3].check_borrow()) { int isJoined = (m_AUDCTL & CH34_JOINED); diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h index 67dcc202..8d757f3a 100644 --- a/src/devices/sound/pokey.h +++ b/src/devices/sound/pokey.h @@ -269,7 +269,6 @@ private: inline void sample(void) { m_filter_sample = m_output; } inline void reset_channel(void) { m_counter = m_AUDF ^ 0xff; } - inline void reset_channel1(void) { m_counter = (m_AUDF ^ 0xff)-1; } inline void inc_chan(int cycles) {