Merge branch 'master' of github.com:tildearrow/furnace
This commit is contained in:
commit
782fee380f
|
|
@ -92,7 +92,7 @@ void DivPlatformGA20::tick(bool sysTick) {
|
|||
chan[i].std.next();
|
||||
if (chan[i].std.vol.had) {
|
||||
const signed char macroVol=VOL_SCALE_LOG((chan[i].vol&0xff),(0xff*MIN(chan[i].macroVolMul,chan[i].std.vol.val))/chan[i].macroVolMul,0xff);
|
||||
if ((!isMuted[i]) && (macroVol!=chan[i].outVol)) {
|
||||
if (macroVol!=chan[i].outVol) {
|
||||
chan[i].outVol=macroVol;
|
||||
chan[i].volumeChanged=true;
|
||||
}
|
||||
|
|
@ -121,7 +121,7 @@ void DivPlatformGA20::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
if (chan[i].volumeChanged) {
|
||||
chan[i].resVol=(chan[i].active && isMuted[i])?0:chan[i].outVol&0xff;
|
||||
chan[i].resVol=chan[i].outVol&0xff;
|
||||
chWrite(i,0x5,chan[i].resVol);
|
||||
chan[i].volumeChanged=false;
|
||||
}
|
||||
|
|
@ -175,9 +175,7 @@ void DivPlatformGA20::tick(bool sysTick) {
|
|||
chWrite(i,6,2);
|
||||
if (!chan[i].std.vol.had) {
|
||||
chan[i].outVol=chan[i].vol;
|
||||
if (!isMuted[i]) {
|
||||
chan[i].volumeChanged=true;
|
||||
}
|
||||
chan[i].volumeChanged=true;
|
||||
}
|
||||
chan[i].keyOn=false;
|
||||
}
|
||||
|
|
@ -218,9 +216,7 @@ int DivPlatformGA20::dispatch(DivCommand c) {
|
|||
chan[c.chan].macroInit(ins);
|
||||
if (!parent->song.brokenOutVol && !chan[c.chan].std.vol.will) {
|
||||
chan[c.chan].outVol=chan[c.chan].vol;
|
||||
if (!isMuted[c.chan]) {
|
||||
chan[c.chan].volumeChanged=true;
|
||||
}
|
||||
chan[c.chan].volumeChanged=true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -244,9 +240,7 @@ int DivPlatformGA20::dispatch(DivCommand c) {
|
|||
chan[c.chan].vol=c.value;
|
||||
if (!chan[c.chan].std.vol.has) {
|
||||
chan[c.chan].outVol=c.value;
|
||||
if (!isMuted[c.chan]) {
|
||||
chan[c.chan].volumeChanged=true;
|
||||
}
|
||||
chan[c.chan].volumeChanged=true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -320,6 +314,7 @@ int DivPlatformGA20::dispatch(DivCommand c) {
|
|||
|
||||
void DivPlatformGA20::muteChannel(int ch, bool mute) {
|
||||
isMuted[ch]=mute;
|
||||
ga20.set_mute(ch,mute);
|
||||
chan[ch].volumeChanged=true;
|
||||
}
|
||||
|
||||
|
|
@ -358,6 +353,7 @@ void DivPlatformGA20::reset() {
|
|||
// keyoff all channels
|
||||
chWrite(i,5,0);
|
||||
chWrite(i,6,0);
|
||||
if (isMuted[i]) ga20.set_mute(i,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ void iremga20_device::sound_stream_update(short** outputs, int len)
|
|||
ch.play = false;
|
||||
else
|
||||
{
|
||||
sampleout = (sample - 0x80) * (s32)ch.volume;
|
||||
sampleout = ch.mute ? 0 : (sample - 0x80) * (s32)ch.volume;
|
||||
ch.counter--;
|
||||
if (ch.counter <= ch.rate)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public:
|
|||
void write(u32 offset, u8 data);
|
||||
u8 read(u32 offset);
|
||||
|
||||
inline void set_mute(const int ch, const bool mute) { m_channel[ch & 3].mute = mute; }
|
||||
|
||||
// device-level overrides
|
||||
void device_reset();
|
||||
|
||||
|
|
@ -53,7 +55,8 @@ private:
|
|||
counter(0),
|
||||
end(0),
|
||||
volume(0),
|
||||
play(0)
|
||||
play(0),
|
||||
mute(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -63,6 +66,7 @@ private:
|
|||
u32 end;
|
||||
u32 volume;
|
||||
bool play;
|
||||
bool mute;
|
||||
};
|
||||
|
||||
u8 m_regs[0x20];
|
||||
|
|
|
|||
Loading…
Reference in a new issue