This commit is contained in:
LTVA1 2024-08-09 14:33:34 +03:00
parent 6bf391b4bc
commit 37fc2ece2c

View file

@ -664,8 +664,6 @@ int DivPlatformSID3::dispatch(DivCommand c) {
chan[c.chan].ring = ins->c64.ringMod; chan[c.chan].ring = ins->c64.ringMod;
chan[c.chan].phase = ins->sid3.phase_mod; chan[c.chan].phase = ins->sid3.phase_mod;
chan[c.chan].oneBitNoise = ins->sid3.oneBitNoise; chan[c.chan].oneBitNoise = ins->sid3.oneBitNoise;
chan[c.chan].oneBitNoise = ins->sid3.oneBitNoise;
chan[c.chan].oneBitNoise = ins->sid3.oneBitNoise;
chan[c.chan].mix_mode = ins->sid2.mixMode; chan[c.chan].mix_mode = ins->sid2.mixMode;
@ -805,8 +803,18 @@ int DivPlatformSID3::dispatch(DivCommand c) {
return SID3_MAX_VOL; return SID3_MAX_VOL;
break; break;
case DIV_CMD_WAVE: case DIV_CMD_WAVE:
chan[c.chan].wave = c.value & 0xff; DivInstrument* ins=parent->getIns(chan[c.chan].ins,DIV_INS_SID3);
rWrite(SID3_REGISTER_WAVEFORM + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].wave);
if(c.chan == SID3_NUM_CHANNELS - 1 && ins->sid3.doWavetable)
{
chan[c.chan].wavetable = c.value & 0xff;
ws.changeWave1(chan[c.chan].wave);
}
else
{
chan[c.chan].wave = c.value & 0xff;
rWrite(SID3_REGISTER_WAVEFORM + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].wave);
}
break; break;
case DIV_CMD_SID3_SPECIAL_WAVE: case DIV_CMD_SID3_SPECIAL_WAVE:
chan[c.chan].special_wave = c.value % SID3_NUM_SPECIAL_WAVES; chan[c.chan].special_wave = c.value % SID3_NUM_SPECIAL_WAVES;
@ -868,8 +876,18 @@ int DivPlatformSID3::dispatch(DivCommand c) {
updateNoiseLFSRMask(c.chan); updateNoiseLFSRMask(c.chan);
break; break;
case DIV_CMD_SID3_1_BIT_NOISE: case DIV_CMD_SID3_1_BIT_NOISE:
chan[c.chan].oneBitNoise = c.value & 1; if(c.chan == SID3_NUM_CHANNELS - 1) //wave chan
updateFlags(c.chan, chan[c.chan].gate); {
rWrite(SID3_REGISTER_WAVEFORM + c.chan * SID3_REGISTERS_PER_CHANNEL, c.value & 1); //PCM mode
}
else
{
if((uint32_t)chan[c.chan].oneBitNoise != (c.value & 1))
{
chan[c.chan].oneBitNoise = c.value & 1;
updateFlags(c.chan, chan[c.chan].gate);
}
}
break; break;
case DIV_CMD_C64_FINE_DUTY: case DIV_CMD_C64_FINE_DUTY:
chan[c.chan].duty = (c.value & 0xfff) << 4; chan[c.chan].duty = (c.value & 0xfff) << 4;