mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 21:15:11 +00:00
MSM5232: channel muting
This commit is contained in:
parent
81ac2ba3b1
commit
aed738e0d5
3 changed files with 20 additions and 10 deletions
|
@ -226,7 +226,7 @@ int DivPlatformMSM5232::dispatch(DivCommand c) {
|
|||
|
||||
void DivPlatformMSM5232::muteChannel(int ch, bool mute) {
|
||||
isMuted[ch]=mute;
|
||||
// TODO: this
|
||||
msm->mute(ch,mute);
|
||||
}
|
||||
|
||||
void DivPlatformMSM5232::forceIns() {
|
||||
|
@ -281,6 +281,7 @@ void DivPlatformMSM5232::reset() {
|
|||
|
||||
for (int i=0; i<8; i++) {
|
||||
rWrite(i,0);
|
||||
msm->mute(i,isMuted[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -225,8 +225,13 @@ void msm5232_device::init_voice(int i)
|
|||
m_voi[i].eg = 0.0;
|
||||
m_voi[i].eg_arm = 0;
|
||||
m_voi[i].pitch = -1.0;
|
||||
m_voi[i].mute = false;
|
||||
}
|
||||
|
||||
void msm5232_device::mute(int voice, bool mute)
|
||||
{
|
||||
m_voi[voice].mute = mute;
|
||||
}
|
||||
|
||||
void msm5232_device::gate_update()
|
||||
{
|
||||
|
@ -571,16 +576,18 @@ void msm5232_device::TG_group_advance(int groupidx)
|
|||
}
|
||||
|
||||
/* calculate signed output */
|
||||
o16 += ( (out16-(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
o8 += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
o4 += ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
o2 += ( (out2 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
if (!voi->mute) {
|
||||
o16 += ( (out16-(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
o8 += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
o4 += ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
o2 += ( (out2 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||
|
||||
if (i == 1 && groupidx == 1)
|
||||
{
|
||||
solo16 += ( (out16-(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
||||
solo8 += ( (out8 -(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
||||
}
|
||||
if (i == 1 && groupidx == 1)
|
||||
{
|
||||
solo16 += ( (out16-(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
||||
solo8 += ( (out8 -(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
||||
}
|
||||
}
|
||||
|
||||
voi++;
|
||||
i--;
|
||||
|
|
|
@ -19,6 +19,7 @@ public:
|
|||
|
||||
void write(unsigned int offset, uint8_t data);
|
||||
void set_clock(int clock);
|
||||
void mute(int voice, bool mute);
|
||||
|
||||
// device-level overrides
|
||||
void device_start();
|
||||
|
@ -34,6 +35,7 @@ public:
|
|||
private:
|
||||
struct VOICE {
|
||||
uint8_t mode;
|
||||
bool mute;
|
||||
|
||||
int TG_count_period;
|
||||
int TG_count;
|
||||
|
|
Loading…
Reference in a new issue