GUI: fix loop not updating samples on SNES

This commit is contained in:
tildearrow 2022-10-02 01:32:12 -05:00
parent 85f739497f
commit 0c79280aae
4 changed files with 34 additions and 1 deletions

View file

@ -985,6 +985,16 @@ int DivEngine::loadSampleROM(String path, ssize_t expectedSize, unsigned char*&
return 0;
}
unsigned int DivEngine::getSampleFormatMask() {
unsigned int formatMask=1U<<16; // 16-bit is always on
for (int i=0; i<song.systemLen; i++) {
const DivSysDef* s=getSystemDef(song.system[i]);
if (s==NULL) continue;
formatMask|=s->sampleFormatMask;
}
return formatMask;
}
int DivEngine::loadSampleROMs() {
if (yrw801ROM!=NULL) {
delete[] yrw801ROM;
@ -1016,6 +1026,8 @@ void DivEngine::renderSamples() {
sPreview.pos=0;
sPreview.dir=false;
logD("rendering samples...");
// step 0: make sample format mask
unsigned int formatMask=1U<<16; // 16-bit is always on
for (int i=0; i<song.systemLen; i++) {

View file

@ -906,6 +906,9 @@ class DivEngine {
// load sample ROMs
int loadSampleROMs();
// get the sample format mask
unsigned int getSampleFormatMask();
// UNSAFE render samples - only execute when locked
void renderSamples();

View file

@ -447,7 +447,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
}
if (returnAfterPre) return;
} else {
logV("honoring delay at position %d",whatRow);
//logV("honoring delay at position %d",whatRow);
}
if (chan[i].delayLocked) return;