diff --git a/src/engine/platform/vic20.cpp b/src/engine/platform/vic20.cpp index 253c4fb7..aea12643 100644 --- a/src/engine/platform/vic20.cpp +++ b/src/engine/platform/vic20.cpp @@ -79,7 +79,7 @@ void DivPlatformVIC20::calcAndWriteOutVol(int ch, int env) { } void DivPlatformVIC20::writeOutVol(int ch) { - if (!isMuted[ch] && chan[ch].active) { + if (chan[ch].active) { rWrite(14,chan[ch].outVol); } } @@ -99,6 +99,20 @@ void DivPlatformVIC20::tick(bool sysTick) { } chan[i].freqChanged=true; } + if (chan[i].std.duty.had) { + if (chan[i].onOff!=chan[i].std.duty.val) { + chan[i].onOff=chan[i].std.duty.val; + if (chan[i].active) { + if (chan[i].onOff) { + chan[i].keyOn=true; + chan[i].keyOff=false; + } else { + chan[i].keyOn=false; + chan[i].keyOff=true; + } + } + } + } if (chan[i].std.wave.had) { if (chan[i].wave!=chan[i].std.wave.val) { chan[i].wave=chan[i].std.wave.val&0x0f; @@ -156,6 +170,7 @@ int DivPlatformVIC20::dispatch(DivCommand c) { chan[c.chan].freqChanged=true; chan[c.chan].note=c.value; } + chan[c.chan].onOff=true; chan[c.chan].active=true; chan[c.chan].keyOn=true; chan[c.chan].macroInit(ins); diff --git a/src/engine/platform/vic20.h b/src/engine/platform/vic20.h index 1b8584a7..5125bd96 100644 --- a/src/engine/platform/vic20.h +++ b/src/engine/platform/vic20.h @@ -27,10 +27,12 @@ class DivPlatformVIC20: public DivDispatch { struct Channel: public SharedChannel { int wave, waveWriteCycle; + bool onOff; Channel(): SharedChannel(15), wave(0), - waveWriteCycle(-1) {} + waveWriteCycle(-1), + onOff(true) {} }; Channel chan[4]; DivDispatchOscBuffer* oscBuf[4]; diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 1f9951da..1b16e2dc 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -5125,7 +5125,7 @@ void FurnaceGUI::drawInsEdit() { dutyMax=ins->amiga.useSample?0:255; } if (ins->type==DIV_INS_TIA || ins->type==DIV_INS_AMIGA || ins->type==DIV_INS_SCC || - ins->type==DIV_INS_PET || ins->type==DIV_INS_VIC || ins->type==DIV_INS_SEGAPCM || + ins->type==DIV_INS_PET || ins->type==DIV_INS_SEGAPCM || ins->type==DIV_INS_FM || ins->type==DIV_INS_K007232 || ins->type==DIV_INS_GA20 || ins->type==DIV_INS_SM8521 || ins->type==DIV_INS_PV1000) { dutyMax=0; @@ -5142,6 +5142,10 @@ void FurnaceGUI::drawInsEdit() { dutyLabel="Noise"; dutyMax=1; } + if (ins->type==DIV_INS_VIC) { + dutyLabel="On/Off"; + dutyMax=1; + } if (ins->type==DIV_INS_SWAN) { dutyLabel="Noise"; dutyMax=ins->amiga.useSample?0:8;