MSM6295: per-channel osc and muting

This commit is contained in:
tildearrow 2022-05-23 03:18:56 -05:00
parent d3edc58cb1
commit ced2940336
3 changed files with 9 additions and 2 deletions

View file

@ -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() {

View file

@ -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;
}
}

View file

@ -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)