Genesis: fix sample desync when muting DAC channel

This commit is contained in:
tildearrow 2022-01-22 02:36:58 -05:00
parent 4327654415
commit 371c23a7ee

View file

@ -20,12 +20,12 @@ void DivPlatformGenesis::acquire(short* bufL, short* bufR, size_t start, size_t
DivSample* s=parent->song.sample[dacSample];
if (!isMuted[5]) {
if (s->depth==8) {
immWrite(0x2a,(unsigned char)s->rendData[dacPos++]+0x80);
immWrite(0x2a,(unsigned char)s->rendData[dacPos]+0x80);
} else {
immWrite(0x2a,((unsigned short)s->rendData[dacPos++]+0x8000)>>8);
immWrite(0x2a,((unsigned short)s->rendData[dacPos]+0x8000)>>8);
}
}
if (dacPos>=s->rendLength) {
if (++dacPos>=s->rendLength) {
if (s->loopStart>=0 && s->loopStart<=(int)s->rendLength) {
dacPos=s->loopStart;
} else {