From 18fb2a4b9f471cfbb3987e37c0c18fb00ed85c6b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 6 Dec 2021 03:26:39 -0500 Subject: [PATCH] C64: more work! --- src/engine/platform/c64.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/engine/platform/c64.cpp b/src/engine/platform/c64.cpp index f5052f0cc..4682bed9a 100644 --- a/src/engine/platform/c64.cpp +++ b/src/engine/platform/c64.cpp @@ -54,12 +54,15 @@ void DivPlatformC64::tick() { } if (chan[i].testWhen>0) { if (--chan[i].testWhen<1) { + sid.write(i*7+5,0); + sid.write(i*7+6,0); sid.write(i*7+4,(chan[i].wave<<4)|8); } } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { DivInstrument* ins=parent->getIns(chan[i].ins); chan[i].freq=(chan[i].baseFreq*(ONE_SEMITONE+chan[i].pitch))/ONE_SEMITONE; + if (chan[i].freq>0xffff) chan[i].freq=0xffff; if (chan[i].keyOn) { sid.write(i*7+5,(ins->c64.a<<4)|(ins->c64.d)); sid.write(i*7+6,(ins->c64.s<<4)|(ins->c64.r)); @@ -156,6 +159,7 @@ int DivPlatformC64::dispatch(DivCommand c) { break; case DIV_CMD_PRE_PORTA: chan[c.chan].std.init(parent->getIns(chan[c.chan].ins)); + chan[c.chan].keyOn=true; chan[c.chan].inPorta=c.value; break; case DIV_CMD_PRE_NOTE: