GUI: fix SNES echo filter input in chip manager
This commit is contained in:
parent
36473eb9ec
commit
58edecb9f9
|
@ -4195,7 +4195,7 @@ bool FurnaceGUI::loop() {
|
|||
exitDisabledTimer=1;
|
||||
for (int i=0; i<e->song.systemLen; i++) {
|
||||
if (ImGui::TreeNode(fmt::sprintf("%d. %s##_SYSP%d",i+1,getSystemName(e->song.system[i]),i).c_str())) {
|
||||
drawSysConf(i,e->song.system[i],e->song.systemFlags[i],true,true);
|
||||
drawSysConf(i,i,e->song.system[i],e->song.systemFlags[i],true,true);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1317,7 +1317,8 @@ class FurnaceGUI {
|
|||
String workingDirVGMExport, workingDirZSMExport, workingDirROMExport, workingDirFont, workingDirColors, workingDirKeybinds;
|
||||
String workingDirLayout, workingDirROM, workingDirTest;
|
||||
String mmlString[32];
|
||||
String mmlStringW, mmlStringSNES, grooveString, grooveListString, mmlStringModTable;
|
||||
String mmlStringW, grooveString, grooveListString, mmlStringModTable;
|
||||
String mmlStringSNES[DIV_MAX_CHIPS];
|
||||
String folderString;
|
||||
|
||||
std::vector<DivSystem> sysSearchResults;
|
||||
|
@ -2176,7 +2177,7 @@ class FurnaceGUI {
|
|||
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
|
||||
void drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, float maxRr, const ImVec2& size, unsigned short instType);
|
||||
void drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size);
|
||||
bool drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange, bool fromMenu=false);
|
||||
bool drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& flags, bool modifyOnChange, bool fromMenu=false);
|
||||
void kvsConfig(DivInstrument* ins, bool supportsKVS=true);
|
||||
void drawFMPreview(const ImVec2& size);
|
||||
void renderFMPreview(const DivInstrument* ins, int pos=0);
|
||||
|
|
|
@ -653,7 +653,7 @@ void FurnaceGUI::drawSettings() {
|
|||
String sysFlagsS=settings.initialSys.getString(fmt::sprintf("flags%d",i),"");
|
||||
DivConfig sysFlags;
|
||||
sysFlags.loadFromBase64(sysFlagsS.c_str());
|
||||
if (drawSysConf(-1,sysID,sysFlags,false)) {
|
||||
if (drawSysConf(-1,i,sysID,sysFlags,false)) {
|
||||
settings.initialSys.set(fmt::sprintf("flags%d",i),sysFlags.toBase64());
|
||||
}
|
||||
ImGui::TreePop();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "misc/cpp/imgui_stdlib.h"
|
||||
#include <imgui.h>
|
||||
|
||||
bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange, bool fromMenu) {
|
||||
bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& flags, bool modifyOnChange, bool fromMenu) {
|
||||
bool altered=false;
|
||||
bool restart=modifyOnChange;
|
||||
bool supportsCustomRate=true;
|
||||
|
@ -1750,11 +1750,11 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
|
|||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); // wavetable text input size found here
|
||||
if (ImGui::InputText("##MMLWave",&mmlStringSNES)) {
|
||||
if (ImGui::InputText("##MMLWave",&mmlStringSNES[sysPos])) {
|
||||
int actualData[256];
|
||||
int discardIt=0;
|
||||
memset(actualData,0,256*sizeof(int));
|
||||
decodeMMLStrW(mmlStringSNES,actualData,discardIt,snesFilterHex?0:-128,snesFilterHex?255:127,snesFilterHex);
|
||||
decodeMMLStrW(mmlStringSNES[sysPos],actualData,discardIt,snesFilterHex?0:-128,snesFilterHex?255:127,snesFilterHex);
|
||||
if (snesFilterHex) {
|
||||
for (int i=0; i<8; i++) {
|
||||
if (actualData[i]>=128) actualData[i]-=256;
|
||||
|
@ -1772,7 +1772,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
|
|||
actualData[i]=echoFilter[i];
|
||||
}
|
||||
}
|
||||
encodeMMLStr(mmlStringSNES,actualData,8,-1,-1,snesFilterHex);
|
||||
encodeMMLStr(mmlStringSNES[sysPos],actualData,8,-1,-1,snesFilterHex);
|
||||
}
|
||||
|
||||
int filterSum=(
|
||||
|
|
|
@ -79,7 +79,7 @@ void FurnaceGUI::drawSysManager() {
|
|||
}
|
||||
ImGui::TableNextColumn();
|
||||
if (ImGui::TreeNode(fmt::sprintf("%d. %s##_SYSM%d",i+1,getSystemName(e->song.system[i]),i).c_str())) {
|
||||
drawSysConf(i,e->song.system[i],e->song.systemFlags[i],true);
|
||||
drawSysConf(i,i,e->song.system[i],e->song.systemFlags[i],true);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
|
|
Loading…
Reference in a new issue