proper envelope, phase reset macro, prepare for ad-hoc ADSR params change via macros

This commit is contained in:
LTVA1 2024-08-04 21:28:09 +03:00
parent 986b64bbf0
commit 2e321b66c2
3 changed files with 141 additions and 108 deletions

View file

@ -211,6 +211,16 @@ void DivPlatformSID3::tick(bool sysTick)
panChanged = true;
chan[i].panRight = chan[i].std.panR.val & 0xff;
}
if (chan[i].std.phaseReset.had) {
chan[i].phaseReset = chan[i].std.phaseReset.val & 1;
if(chan[i].phaseReset)
{
updateFlags(i, chan[i].gate);
}
chan[i].phaseReset = false;
}
if(panChanged)
{
@ -242,10 +252,12 @@ void DivPlatformSID3::tick(bool sysTick)
updateFlags(i, false); //gate off TODO: make it properly?
updateFlags(i, true); //gate on
chan[i].gate = true;
}
if (chan[i].keyOff)
{
updateFlags(i, false); //gate off
chan[i].gate = false;
}
if (chan[i].freq<0) chan[i].freq=0;