diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index 64ec6b0a..7e470de8 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -54,9 +54,12 @@ void DivPlatformMSM6295::acquire(short* bufL, short* bufR, size_t start, size_t bufL[h]=msm->out()<<4; - if (++updateOsc>=64) { + if (++updateOsc>=22) { updateOsc=0; // TODO: per-channel osc + for (int i=0; i<4; i++) { + oscBuf[i]->data[oscBuf[i]->needle++]=msm->m_voice[i].m_muted?0:(msm->m_voice[i].m_out<<6); + } } } } @@ -182,6 +185,7 @@ int DivPlatformMSM6295::dispatch(DivCommand c) { void DivPlatformMSM6295::muteChannel(int ch, bool mute) { isMuted[ch]=mute; + msm->m_voice[ch].m_muted=mute; } void DivPlatformMSM6295::forceIns() { diff --git a/src/engine/platform/sound/oki/msm6295.cpp b/src/engine/platform/sound/oki/msm6295.cpp index 6d7b860c..7a455e1b 100644 --- a/src/engine/platform/sound/oki/msm6295.cpp +++ b/src/engine/platform/sound/oki/msm6295.cpp @@ -117,7 +117,7 @@ void msm6295_core::tick() for (int i = 0; i < 4; i++) { m_voice[i].tick(); - m_out += m_voice[i].m_out; + if (!m_voice[i].m_muted) m_out += m_voice[i].m_out; } } diff --git a/src/engine/platform/sound/oki/msm6295.hpp b/src/engine/platform/sound/oki/msm6295.hpp index 13dc6155..f5684a29 100644 --- a/src/engine/platform/sound/oki/msm6295.hpp +++ b/src/engine/platform/sound/oki/msm6295.hpp @@ -52,6 +52,7 @@ private: 3/* -20.5dB */, 2/* -24.0dB */ }; // scale out to 5 bit for optimization +public: // msm6295 voice structs struct voice_t : vox_decoder_t { @@ -70,6 +71,7 @@ private: msm6295_core &m_host; u16 m_clock = 0; // clock counter bool m_busy = false; // busy status + bool m_muted = false; // muted u8 m_command = 0; // current command u32 m_addr = 0; // current address s8 m_nibble = 0; // current nibble @@ -78,6 +80,7 @@ private: s32 m_out = 0; // output }; voice_t m_voice[4]; +private: vgsound_emu_mem_intf &m_intf; // common memory interface bool m_ss = false; // SS pin controls divider, input clock / 33 * (SS ? 5 : 4)