SCC: fix forceIns (finally)

fixes #447
This commit is contained in:
tildearrow 2022-05-12 02:39:46 -05:00
parent 4e2e542c7a
commit cdf4c55f0f
2 changed files with 13 additions and 1 deletions

View File

@ -105,6 +105,11 @@ void DivPlatformSCC::acquire(short* bufL, short* bufR, size_t start, size_t len)
void DivPlatformSCC::updateWave(int ch) {
int dstCh=(!isPlus && ch>=4)?3:ch;
if (ch==3) {
lastUpdated34=3;
} else if (ch==4) {
lastUpdated34=4;
}
for (int i=0; i<32; i++) {
rWrite(dstCh*32+i,(unsigned char)chan[ch].ws.output[i]-128);
}
@ -281,10 +286,15 @@ void DivPlatformSCC::forceIns() {
for (int i=0; i<5; i++) {
chan[i].insChanged=true;
chan[i].freqChanged=true;
if (chan[i].active) {
if (isPlus || i<3) {
updateWave(i);
}
}
if (!isPlus) {
if (lastUpdated34>=3) {
updateWave(lastUpdated34);
}
}
}
void* DivPlatformSCC::getChanState(int ch) {
@ -318,6 +328,7 @@ void DivPlatformSCC::reset() {
if (dumpWrites) {
addWrite(0xffffffff,0);
}
lastUpdated34=0;
}
bool DivPlatformSCC::isStereo() {

View File

@ -57,6 +57,7 @@ class DivPlatformSCC: public DivDispatch {
DivDispatchOscBuffer* oscBuf[5];
bool isMuted[5];
unsigned char writeOscBuf;
int lastUpdated34;
scc_core* scc;
bool isPlus;