GUI: fix loop not updating samples on SNES
This commit is contained in:
parent
85f739497f
commit
0c79280aae
|
@ -985,6 +985,16 @@ int DivEngine::loadSampleROM(String path, ssize_t expectedSize, unsigned char*&
|
||||||
return 0;
|
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() {
|
int DivEngine::loadSampleROMs() {
|
||||||
if (yrw801ROM!=NULL) {
|
if (yrw801ROM!=NULL) {
|
||||||
delete[] yrw801ROM;
|
delete[] yrw801ROM;
|
||||||
|
@ -1016,6 +1026,8 @@ void DivEngine::renderSamples() {
|
||||||
sPreview.pos=0;
|
sPreview.pos=0;
|
||||||
sPreview.dir=false;
|
sPreview.dir=false;
|
||||||
|
|
||||||
|
logD("rendering samples...");
|
||||||
|
|
||||||
// step 0: make sample format mask
|
// step 0: make sample format mask
|
||||||
unsigned int formatMask=1U<<16; // 16-bit is always on
|
unsigned int formatMask=1U<<16; // 16-bit is always on
|
||||||
for (int i=0; i<song.systemLen; i++) {
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
|
|
@ -906,6 +906,9 @@ class DivEngine {
|
||||||
// load sample ROMs
|
// load sample ROMs
|
||||||
int loadSampleROMs();
|
int loadSampleROMs();
|
||||||
|
|
||||||
|
// get the sample format mask
|
||||||
|
unsigned int getSampleFormatMask();
|
||||||
|
|
||||||
// UNSAFE render samples - only execute when locked
|
// UNSAFE render samples - only execute when locked
|
||||||
void renderSamples();
|
void renderSamples();
|
||||||
|
|
||||||
|
|
|
@ -447,7 +447,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
||||||
}
|
}
|
||||||
if (returnAfterPre) return;
|
if (returnAfterPre) return;
|
||||||
} else {
|
} else {
|
||||||
logV("honoring delay at position %d",whatRow);
|
//logV("honoring delay at position %d",whatRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].delayLocked) return;
|
if (chan[i].delayLocked) return;
|
||||||
|
|
|
@ -120,6 +120,9 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
sample->loopEnd=sample->samples;
|
sample->loopEnd=sample->samples;
|
||||||
}
|
}
|
||||||
updateSampleTex=true;
|
updateSampleTex=true;
|
||||||
|
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
|
||||||
|
e->renderSamplesP();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered() && sample->depth==DIV_SAMPLE_DEPTH_BRR) {
|
if (ImGui::IsItemHovered() && sample->depth==DIV_SAMPLE_DEPTH_BRR) {
|
||||||
ImGui::SetTooltip("changing the loop in a BRR sample may result in glitches!");
|
ImGui::SetTooltip("changing the loop in a BRR sample may result in glitches!");
|
||||||
|
@ -156,6 +159,9 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
sample->loopStart=sample->loopEnd;
|
sample->loopStart=sample->loopEnd;
|
||||||
}
|
}
|
||||||
updateSampleTex=true;
|
updateSampleTex=true;
|
||||||
|
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
|
||||||
|
e->renderSamplesP();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemActive()) {
|
if (ImGui::IsItemActive()) {
|
||||||
keepLoopAlive=true;
|
keepLoopAlive=true;
|
||||||
|
@ -175,6 +181,9 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
sample->loopEnd=sample->samples;
|
sample->loopEnd=sample->samples;
|
||||||
}
|
}
|
||||||
updateSampleTex=true;
|
updateSampleTex=true;
|
||||||
|
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
|
||||||
|
e->renderSamplesP();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemActive()) {
|
if (ImGui::IsItemActive()) {
|
||||||
keepLoopAlive=true;
|
keepLoopAlive=true;
|
||||||
|
@ -693,6 +702,9 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
sample->loopEnd=sample->samples;
|
sample->loopEnd=sample->samples;
|
||||||
}
|
}
|
||||||
updateSampleTex=true;
|
updateSampleTex=true;
|
||||||
|
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
|
||||||
|
e->renderSamplesP();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered() && sample->depth==DIV_SAMPLE_DEPTH_BRR) {
|
if (ImGui::IsItemHovered() && sample->depth==DIV_SAMPLE_DEPTH_BRR) {
|
||||||
ImGui::SetTooltip("changing the loop in a BRR sample may result in glitches!");
|
ImGui::SetTooltip("changing the loop in a BRR sample may result in glitches!");
|
||||||
|
@ -729,6 +741,9 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
if (sample->loopStart>sample->loopEnd) {
|
if (sample->loopStart>sample->loopEnd) {
|
||||||
sample->loopStart=sample->loopEnd;
|
sample->loopStart=sample->loopEnd;
|
||||||
}
|
}
|
||||||
|
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
|
||||||
|
e->renderSamplesP();
|
||||||
|
}
|
||||||
updateSampleTex=true;
|
updateSampleTex=true;
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemActive()) {
|
if (ImGui::IsItemActive()) {
|
||||||
|
@ -748,6 +763,9 @@ void FurnaceGUI::drawSampleEdit() {
|
||||||
if (sample->loopEnd>=(int)sample->samples) {
|
if (sample->loopEnd>=(int)sample->samples) {
|
||||||
sample->loopEnd=sample->samples;
|
sample->loopEnd=sample->samples;
|
||||||
}
|
}
|
||||||
|
if (e->getSampleFormatMask()&(1U<<DIV_SAMPLE_DEPTH_BRR)) {
|
||||||
|
e->renderSamplesP();
|
||||||
|
}
|
||||||
updateSampleTex=true;
|
updateSampleTex=true;
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemActive()) {
|
if (ImGui::IsItemActive()) {
|
||||||
|
|
Loading…
Reference in a new issue