MSM5232: channel muting
This commit is contained in:
parent
81ac2ba3b1
commit
aed738e0d5
|
@ -226,7 +226,7 @@ int DivPlatformMSM5232::dispatch(DivCommand c) {
|
||||||
|
|
||||||
void DivPlatformMSM5232::muteChannel(int ch, bool mute) {
|
void DivPlatformMSM5232::muteChannel(int ch, bool mute) {
|
||||||
isMuted[ch]=mute;
|
isMuted[ch]=mute;
|
||||||
// TODO: this
|
msm->mute(ch,mute);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformMSM5232::forceIns() {
|
void DivPlatformMSM5232::forceIns() {
|
||||||
|
@ -281,6 +281,7 @@ void DivPlatformMSM5232::reset() {
|
||||||
|
|
||||||
for (int i=0; i<8; i++) {
|
for (int i=0; i<8; i++) {
|
||||||
rWrite(i,0);
|
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 = 0.0;
|
||||||
m_voi[i].eg_arm = 0;
|
m_voi[i].eg_arm = 0;
|
||||||
m_voi[i].pitch = -1.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()
|
void msm5232_device::gate_update()
|
||||||
{
|
{
|
||||||
|
@ -571,16 +576,18 @@ void msm5232_device::TG_group_advance(int groupidx)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* calculate signed output */
|
/* calculate signed output */
|
||||||
o16 += ( (out16-(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
if (!voi->mute) {
|
||||||
o8 += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
o16 += ( (out16-(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||||
o4 += ( (out4 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
o8 += ( (out8 -(1<<(STEP_SH-1))) * voi->egvol) >> STEP_SH;
|
||||||
o2 += ( (out2 -(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)
|
if (i == 1 && groupidx == 1)
|
||||||
{
|
{
|
||||||
solo16 += ( (out16-(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
solo16 += ( (out16-(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
||||||
solo8 += ( (out8 -(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
solo8 += ( (out8 -(1<<(STEP_SH-1))) << 11) >> STEP_SH;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
voi++;
|
voi++;
|
||||||
i--;
|
i--;
|
||||||
|
|
|
@ -19,6 +19,7 @@ public:
|
||||||
|
|
||||||
void write(unsigned int offset, uint8_t data);
|
void write(unsigned int offset, uint8_t data);
|
||||||
void set_clock(int clock);
|
void set_clock(int clock);
|
||||||
|
void mute(int voice, bool mute);
|
||||||
|
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
void device_start();
|
void device_start();
|
||||||
|
@ -34,6 +35,7 @@ public:
|
||||||
private:
|
private:
|
||||||
struct VOICE {
|
struct VOICE {
|
||||||
uint8_t mode;
|
uint8_t mode;
|
||||||
|
bool mute;
|
||||||
|
|
||||||
int TG_count_period;
|
int TG_count_period;
|
||||||
int TG_count;
|
int TG_count;
|
||||||
|
|
Loading…
Reference in New Issue