mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +00:00
chip flags rewrite, part 6
fix GUI (partially)
This commit is contained in:
parent
468f434b66
commit
89311690a0
6 changed files with 216 additions and 201 deletions
|
@ -80,6 +80,8 @@ String DivConfig::toBase64() {
|
||||||
ret+="==";
|
ret+="==";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logV("toBase64: %s",ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +173,8 @@ bool DivConfig::loadFromBase64(const char* buf) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logV("fromBase64: %s",data);
|
||||||
|
|
||||||
return loadFromMemory(data.c_str());
|
return loadFromMemory(data.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3467,76 +3467,8 @@ void DivEngine::setOrder(unsigned char order) {
|
||||||
BUSY_END;
|
BUSY_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, String key, bool value, bool restart) {
|
void DivEngine::updateSysFlags(int system, bool restart) {
|
||||||
BUSY_BEGIN_SOFT;
|
BUSY_BEGIN_SOFT;
|
||||||
saveLock.lock();
|
|
||||||
song.systemFlags[system].set(key,value);
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
|
||||||
disCont[system].setRates(got.rate);
|
|
||||||
if (restart && isPlaying()) {
|
|
||||||
playSub(false);
|
|
||||||
}
|
|
||||||
BUSY_END;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, String key, int value, bool restart) {
|
|
||||||
BUSY_BEGIN_SOFT;
|
|
||||||
saveLock.lock();
|
|
||||||
song.systemFlags[system].set(key,value);
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
|
||||||
disCont[system].setRates(got.rate);
|
|
||||||
if (restart && isPlaying()) {
|
|
||||||
playSub(false);
|
|
||||||
}
|
|
||||||
BUSY_END;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, String key, float value, bool restart) {
|
|
||||||
BUSY_BEGIN_SOFT;
|
|
||||||
saveLock.lock();
|
|
||||||
song.systemFlags[system].set(key,value);
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
|
||||||
disCont[system].setRates(got.rate);
|
|
||||||
if (restart && isPlaying()) {
|
|
||||||
playSub(false);
|
|
||||||
}
|
|
||||||
BUSY_END;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, String key, double value, bool restart) {
|
|
||||||
BUSY_BEGIN_SOFT;
|
|
||||||
saveLock.lock();
|
|
||||||
song.systemFlags[system].set(key,value);
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
|
||||||
disCont[system].setRates(got.rate);
|
|
||||||
if (restart && isPlaying()) {
|
|
||||||
playSub(false);
|
|
||||||
}
|
|
||||||
BUSY_END;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, String key, const char* value, bool restart) {
|
|
||||||
BUSY_BEGIN_SOFT;
|
|
||||||
saveLock.lock();
|
|
||||||
song.systemFlags[system].set(key,value);
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
|
||||||
disCont[system].setRates(got.rate);
|
|
||||||
if (restart && isPlaying()) {
|
|
||||||
playSub(false);
|
|
||||||
}
|
|
||||||
BUSY_END;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DivEngine::setSysFlags(int system, String key, String value, bool restart) {
|
|
||||||
BUSY_BEGIN_SOFT;
|
|
||||||
saveLock.lock();
|
|
||||||
song.systemFlags[system].set(key,value);
|
|
||||||
saveLock.unlock();
|
|
||||||
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
disCont[system].dispatch->setFlags(song.systemFlags[system]);
|
||||||
disCont[system].setRates(got.rate);
|
disCont[system].setRates(got.rate);
|
||||||
if (restart && isPlaying()) {
|
if (restart && isPlaying()) {
|
||||||
|
|
|
@ -821,13 +821,8 @@ class DivEngine {
|
||||||
// go to order
|
// go to order
|
||||||
void setOrder(unsigned char order);
|
void setOrder(unsigned char order);
|
||||||
|
|
||||||
// set system flags
|
// update system flags
|
||||||
void setSysFlags(int system, String key, bool value, bool restart);
|
void updateSysFlags(int system, bool restart);
|
||||||
void setSysFlags(int system, String key, int value, bool restart);
|
|
||||||
void setSysFlags(int system, String key, float value, bool restart);
|
|
||||||
void setSysFlags(int system, String key, double value, bool restart);
|
|
||||||
void setSysFlags(int system, String key, const char* value, bool restart);
|
|
||||||
void setSysFlags(int system, String key, String value, bool restart);
|
|
||||||
|
|
||||||
// set Hz
|
// set Hz
|
||||||
void setSongRate(float hz, bool pal);
|
void setSongRate(float hz, bool pal);
|
||||||
|
|
|
@ -1619,7 +1619,7 @@ class FurnaceGUI {
|
||||||
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
|
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 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);
|
void drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size);
|
||||||
void drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange);
|
bool drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange);
|
||||||
void kvsConfig(DivInstrument* ins);
|
void kvsConfig(DivInstrument* ins);
|
||||||
|
|
||||||
// these ones offer ctrl-wheel fine value changes.
|
// these ones offer ctrl-wheel fine value changes.
|
||||||
|
|
|
@ -270,7 +270,7 @@ void FurnaceGUI::drawSettings() {
|
||||||
if (ImGui::Button("Current system")) {
|
if (ImGui::Button("Current system")) {
|
||||||
settings.initialSys.clear();
|
settings.initialSys.clear();
|
||||||
for (int i=0; i<e->song.systemLen; i++) {
|
for (int i=0; i<e->song.systemLen; i++) {
|
||||||
settings.initialSys.set(fmt::sprintf("id%d",i),e->getSystemDef(e->song.system[i])->id);
|
settings.initialSys.set(fmt::sprintf("id%d",i),e->systemToFileFur(e->song.system[i]));
|
||||||
settings.initialSys.set(fmt::sprintf("vol%d",i),(int)e->song.systemVol[i]);
|
settings.initialSys.set(fmt::sprintf("vol%d",i),(int)e->song.systemVol[i]);
|
||||||
settings.initialSys.set(fmt::sprintf("pan%d",i),(int)e->song.systemPan[i]);
|
settings.initialSys.set(fmt::sprintf("pan%d",i),(int)e->song.systemPan[i]);
|
||||||
settings.initialSys.set(fmt::sprintf("flags%d",i),e->song.systemFlags[i].toBase64());
|
settings.initialSys.set(fmt::sprintf("flags%d",i),e->song.systemFlags[i].toBase64());
|
||||||
|
@ -285,27 +285,24 @@ void FurnaceGUI::drawSettings() {
|
||||||
for (totalAvailSys=0; availableSystems[totalAvailSys]; totalAvailSys++);
|
for (totalAvailSys=0; availableSystems[totalAvailSys]; totalAvailSys++);
|
||||||
if (totalAvailSys>0) {
|
if (totalAvailSys>0) {
|
||||||
for (int i=0; i<howMany; i++) {
|
for (int i=0; i<howMany; i++) {
|
||||||
/*
|
settings.initialSys.set(fmt::sprintf("id%d",i),e->systemToFileFur((DivSystem)availableSystems[rand()%totalAvailSys]));
|
||||||
settings.initialSys.push_back(availableSystems[rand()%totalAvailSys]);
|
settings.initialSys.set(fmt::sprintf("vol%d",i),64);
|
||||||
settings.initialSys.push_back(64);
|
settings.initialSys.set(fmt::sprintf("pan%d",i),0);
|
||||||
settings.initialSys.push_back(0);
|
settings.initialSys.set(fmt::sprintf("flags%d",i),"");
|
||||||
settings.initialSys.push_back(0);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/*
|
settings.initialSys.set("id0",e->systemToFileFur(DIV_SYSTEM_DUMMY));
|
||||||
settings.initialSys.push_back(DIV_SYSTEM_DUMMY);
|
settings.initialSys.set("vol0",64);
|
||||||
settings.initialSys.push_back(64);
|
settings.initialSys.set("pan0",0);
|
||||||
settings.initialSys.push_back(0);
|
settings.initialSys.set("flags0","");
|
||||||
settings.initialSys.push_back(0);
|
howMany=1;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
// randomize system name
|
// randomize system name
|
||||||
std::vector<String> wordPool[6];
|
std::vector<String> wordPool[6];
|
||||||
/*
|
for (int i=0; i<howMany; i++) {
|
||||||
for (size_t i=0; i<settings.initialSys.size()/4; i++) {
|
|
||||||
int wpPos=0;
|
int wpPos=0;
|
||||||
String sName=e->getSystemName((DivSystem)settings.initialSys[i*4]);
|
DivSystem sysID=e->systemFromFileFur(settings.initialSys.getInt(fmt::sprintf("id%d",i),0));
|
||||||
|
String sName=e->getSystemName(sysID);
|
||||||
String nameWord;
|
String nameWord;
|
||||||
sName+=" ";
|
sName+=" ";
|
||||||
for (char& i: sName) {
|
for (char& i: sName) {
|
||||||
|
@ -326,16 +323,15 @@ void FurnaceGUI::drawSettings() {
|
||||||
settings.initialSysName+=wordPool[i][rand()%wordPool[i].size()];
|
settings.initialSysName+=wordPool[i][rand()%wordPool[i].size()];
|
||||||
settings.initialSysName+=" ";
|
settings.initialSysName+=" ";
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Button("Reset to defaults")) {
|
if (ImGui::Button("Reset to defaults")) {
|
||||||
settings.initialSys.clear();
|
settings.initialSys.clear();
|
||||||
settings.initialSys.set("id0",e->getSystemDef(DIV_SYSTEM_YM2612)->id);
|
settings.initialSys.set("id0",e->systemToFileFur(DIV_SYSTEM_YM2612));
|
||||||
settings.initialSys.set("vol0",64);
|
settings.initialSys.set("vol0",64);
|
||||||
settings.initialSys.set("pan0",0);
|
settings.initialSys.set("pan0",0);
|
||||||
settings.initialSys.set("flags0","");
|
settings.initialSys.set("flags0","");
|
||||||
settings.initialSys.set("id1",e->getSystemDef(DIV_SYSTEM_SMS)->id);
|
settings.initialSys.set("id1",e->systemToFileFur(DIV_SYSTEM_SMS));
|
||||||
settings.initialSys.set("vol1",64);
|
settings.initialSys.set("vol1",64);
|
||||||
settings.initialSys.set("pan1",0);
|
settings.initialSys.set("pan1",0);
|
||||||
settings.initialSys.set("flags1","");
|
settings.initialSys.set("flags1","");
|
||||||
|
@ -362,6 +358,7 @@ void FurnaceGUI::drawSettings() {
|
||||||
for (int j=0; availableSystems[j]; j++) {
|
for (int j=0; availableSystems[j]; j++) {
|
||||||
if (ImGui::Selectable(getSystemName((DivSystem)availableSystems[j]),sysID==availableSystems[j])) {
|
if (ImGui::Selectable(getSystemName((DivSystem)availableSystems[j]),sysID==availableSystems[j])) {
|
||||||
sysID=(DivSystem)availableSystems[j];
|
sysID=(DivSystem)availableSystems[j];
|
||||||
|
settings.initialSys.set(fmt::sprintf("id%d",i),(int)e->systemToFileFur(sysID));
|
||||||
settings.initialSys.set(fmt::sprintf("flags%d",i),"");
|
settings.initialSys.set(fmt::sprintf("flags%d",i),"");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -371,6 +368,7 @@ void FurnaceGUI::drawSettings() {
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if (ImGui::Checkbox("Invert",&doInvert)) {
|
if (ImGui::Checkbox("Invert",&doInvert)) {
|
||||||
sysVol^=128;
|
sysVol^=128;
|
||||||
|
settings.initialSys.set(fmt::sprintf("vol%d",i),(int)sysVol);
|
||||||
}
|
}
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
//ImGui::BeginDisabled(settings.initialSys.size()<=4);
|
//ImGui::BeginDisabled(settings.initialSys.size()<=4);
|
||||||
|
@ -381,16 +379,21 @@ void FurnaceGUI::drawSettings() {
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x-(50.0f*dpiScale));
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x-(50.0f*dpiScale));
|
||||||
if (CWSliderScalar("Volume",ImGuiDataType_S8,&vol,&_ZERO,&_ONE_HUNDRED_TWENTY_SEVEN)) {
|
if (CWSliderScalar("Volume",ImGuiDataType_S8,&vol,&_ZERO,&_ONE_HUNDRED_TWENTY_SEVEN)) {
|
||||||
sysVol=(sysVol&128)|vol;
|
sysVol=(sysVol&128)|vol;
|
||||||
|
settings.initialSys.set(fmt::sprintf("vol%d",i),(int)sysVol);
|
||||||
} rightClickable
|
} rightClickable
|
||||||
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x-(50.0f*dpiScale));
|
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x-(50.0f*dpiScale));
|
||||||
CWSliderScalar("Panning",ImGuiDataType_S8,&sysPan,&_MINUS_ONE_HUNDRED_TWENTY_SEVEN,&_ONE_HUNDRED_TWENTY_SEVEN); rightClickable
|
if (CWSliderScalar("Panning",ImGuiDataType_S8,&sysPan,&_MINUS_ONE_HUNDRED_TWENTY_SEVEN,&_ONE_HUNDRED_TWENTY_SEVEN)) {
|
||||||
|
settings.initialSys.set(fmt::sprintf("pan%d",i),(int)sysPan);
|
||||||
|
} rightClickable
|
||||||
|
|
||||||
// oh please MSVC don't cry
|
// oh please MSVC don't cry
|
||||||
if (ImGui::TreeNode("Configure")) {
|
if (ImGui::TreeNode("Configure")) {
|
||||||
String sysFlagsS=settings.initialSys.getString(fmt::sprintf("flags%d",i),"");
|
String sysFlagsS=settings.initialSys.getString(fmt::sprintf("flags%d",i),"");
|
||||||
DivConfig sysFlags;
|
DivConfig sysFlags;
|
||||||
sysFlags.loadFromBase64(sysFlagsS.c_str());
|
sysFlags.loadFromBase64(sysFlagsS.c_str());
|
||||||
drawSysConf(-1,sysID,sysFlags,false);
|
if (drawSysConf(-1,sysID,sysFlags,false)) {
|
||||||
|
settings.initialSys.set(fmt::sprintf("flags%d",i),sysFlags.toBase64());
|
||||||
|
}
|
||||||
ImGui::TreePop();
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2461,11 +2464,11 @@ void FurnaceGUI::syncSettings() {
|
||||||
settings.initialSys.loadFromBase64(initialSys2.c_str());
|
settings.initialSys.loadFromBase64(initialSys2.c_str());
|
||||||
if (settings.initialSys.getInt("id0",0)==0) {
|
if (settings.initialSys.getInt("id0",0)==0) {
|
||||||
settings.initialSys.clear();
|
settings.initialSys.clear();
|
||||||
settings.initialSys.set("id0",e->getSystemDef(DIV_SYSTEM_YM2612)->id);
|
settings.initialSys.set("id0",e->systemToFileFur(DIV_SYSTEM_YM2612));
|
||||||
settings.initialSys.set("vol0",64);
|
settings.initialSys.set("vol0",64);
|
||||||
settings.initialSys.set("pan0",0);
|
settings.initialSys.set("pan0",0);
|
||||||
settings.initialSys.set("flags0","");
|
settings.initialSys.set("flags0","");
|
||||||
settings.initialSys.set("id1",e->getSystemDef(DIV_SYSTEM_SMS)->id);
|
settings.initialSys.set("id1",e->systemToFileFur(DIV_SYSTEM_SMS));
|
||||||
settings.initialSys.set("vol1",64);
|
settings.initialSys.set("vol1",64);
|
||||||
settings.initialSys.set("pan1",0);
|
settings.initialSys.set("pan1",0);
|
||||||
settings.initialSys.set("flags1","");
|
settings.initialSys.set("flags1","");
|
||||||
|
|
|
@ -19,177 +19,250 @@
|
||||||
|
|
||||||
#include "gui.h"
|
#include "gui.h"
|
||||||
|
|
||||||
void FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange) {
|
bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool modifyOnChange) {
|
||||||
ImGui::Text("temporarily unavailable!");
|
bool altered=false;
|
||||||
return;
|
|
||||||
/*
|
|
||||||
bool restart=settings.restartOnFlagChange && modifyOnChange;
|
bool restart=settings.restartOnFlagChange && modifyOnChange;
|
||||||
bool sysPal=flags&1;
|
|
||||||
unsigned int copyOfFlags=flags;
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DIV_SYSTEM_YM2612:
|
case DIV_SYSTEM_YM2612:
|
||||||
case DIV_SYSTEM_YM2612_EXT:
|
case DIV_SYSTEM_YM2612_EXT:
|
||||||
case DIV_SYSTEM_YM2612_FRAC:
|
case DIV_SYSTEM_YM2612_FRAC:
|
||||||
case DIV_SYSTEM_YM2612_FRAC_EXT: {
|
case DIV_SYSTEM_YM2612_FRAC_EXT: {
|
||||||
if (ImGui::RadioButton("NTSC (7.67MHz)",(flags&(~0x80000000))==0)) {
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
copyOfFlags=(flags&0x80000000)|0;
|
bool ladder=flags.getBool("ladderEffect",0);
|
||||||
|
|
||||||
|
if (ImGui::RadioButton("NTSC (7.67MHz)",clockSel==0)) {
|
||||||
|
clockSel=0;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("PAL (7.61MHz)",(flags&(~0x80000000))==1)) {
|
if (ImGui::RadioButton("PAL (7.61MHz)",clockSel==1)) {
|
||||||
copyOfFlags=(flags&0x80000000)|1;
|
clockSel=1;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("FM Towns (8MHz)",(flags&(~0x80000000))==2)) {
|
if (ImGui::RadioButton("FM Towns (8MHz)",clockSel==2)) {
|
||||||
copyOfFlags=(flags&0x80000000)|2;
|
clockSel=2;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("AtGames Genesis (6.13MHz)",(flags&(~0x80000000))==3)) {
|
if (ImGui::RadioButton("AtGames Genesis (6.13MHz)",clockSel==3)) {
|
||||||
copyOfFlags=(flags&0x80000000)|3;
|
clockSel=3;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("Sega System 32 (8.05MHz)",(flags&(~0x80000000))==4)) {
|
if (ImGui::RadioButton("Sega System 32 (8.05MHz)",clockSel==4)) {
|
||||||
copyOfFlags=(flags&0x80000000)|4;
|
clockSel=4;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
bool ladder=flags&0x80000000;
|
|
||||||
if (ImGui::Checkbox("Enable DAC distortion",&ladder)) {
|
if (ImGui::Checkbox("Enable DAC distortion",&ladder)) {
|
||||||
copyOfFlags=(flags&(~0x80000000))|(ladder?0x80000000:0);
|
altered=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (altered) {
|
||||||
|
e->lockSave([&]() {
|
||||||
|
flags.set("clockSel",clockSel);
|
||||||
|
flags.set("ladderEffect",ladder);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_SYSTEM_SMS: {
|
case DIV_SYSTEM_SMS: {
|
||||||
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
int chipType=flags.getInt("chipType",0);
|
||||||
|
bool noPhaseReset=flags.getBool("noPhaseReset",false);
|
||||||
|
|
||||||
ImGui::Text("Clock rate:");
|
ImGui::Text("Clock rate:");
|
||||||
if (ImGui::RadioButton("3.58MHz (NTSC)",(flags&0xff03)==0x0000)) {
|
if (ImGui::RadioButton("3.58MHz (NTSC)",clockSel==0)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0000;
|
clockSel=0;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("3.55MHz (PAL)",(flags&0xff03)==0x0001)) {
|
if (ImGui::RadioButton("3.55MHz (PAL)",clockSel==1)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0001;
|
clockSel=1;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("4MHz (BBC Micro)",(flags&0xff03)==0x0002)) {
|
if (ImGui::RadioButton("4MHz (BBC Micro)",clockSel==2)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0002;
|
clockSel=2;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("1.79MHz (Half NTSC)",(flags&0xff03)==0x0003)) {
|
if (ImGui::RadioButton("1.79MHz (Half NTSC)",clockSel==3)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0003;
|
clockSel=3;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("3MHz (Exed Exes)",(flags&0xff03)==0x0100)) {
|
if (ImGui::RadioButton("3MHz (Exed Exes)",clockSel==4)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0100;
|
clockSel=4;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("2MHz (Sega System 1)",(flags&0xff03)==0x0101)) {
|
if (ImGui::RadioButton("2MHz (Sega System 1)",clockSel==5)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0101;
|
clockSel=5;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("447KHz (TI-99/4A)",(flags&0xff03)==0x0102)) {
|
if (ImGui::RadioButton("447KHz (TI-99/4A)",clockSel==6)) {
|
||||||
copyOfFlags=(flags&(~0xff03))|0x0102;
|
clockSel=6;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
ImGui::Text("Chip type:");
|
ImGui::Text("Chip type:");
|
||||||
if (ImGui::RadioButton("Sega VDP/Master System",(flags&0xcc)==0x00)) {
|
if (ImGui::RadioButton("Sega VDP/Master System",chipType==0)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x00;
|
chipType=0;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("TI SN76489",(flags&0xcc)==0x04)) {
|
if (ImGui::RadioButton("TI SN76489",chipType==1)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x04;
|
chipType=1;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("TI SN76489 with Atari-like short noise",(flags&0xcc)==0x08)) {
|
if (ImGui::RadioButton("TI SN76489 with Atari-like short noise",chipType==2)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x08;
|
chipType=2;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("Game Gear",(flags&0xcc)==0x0c)) {
|
if (ImGui::RadioButton("Game Gear",chipType==3)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x0c;
|
chipType=3;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("TI SN76489A",(flags&0xcc)==0x40)) {
|
if (ImGui::RadioButton("TI SN76489A",chipType==4)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x40;
|
chipType=4;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("TI SN76496",(flags&0xcc)==0x44)) {
|
if (ImGui::RadioButton("TI SN76496",chipType==5)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x44;
|
chipType=5;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("NCR 8496",(flags&0xcc)==0x48)) {
|
if (ImGui::RadioButton("NCR 8496",chipType==6)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x48;
|
chipType=6;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("Tandy PSSJ 3-voice sound",(flags&0xcc)==0x4c)) {
|
if (ImGui::RadioButton("Tandy PSSJ 3-voice sound",chipType==7)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x4c;
|
chipType=7;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("TI SN94624",(flags&0xcc)==0x80)) {
|
if (ImGui::RadioButton("TI SN94624",chipType==8)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x80;
|
chipType=8;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("TI SN76494",(flags&0xcc)==0x84)) {
|
if (ImGui::RadioButton("TI SN76494",chipType==9)) {
|
||||||
copyOfFlags=(flags&(~0xcc))|0x84;
|
chipType=9;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
bool noPhaseReset=flags&16;
|
|
||||||
if (ImGui::Checkbox("Disable noise period change phase reset",&noPhaseReset)) {
|
if (ImGui::Checkbox("Disable noise period change phase reset",&noPhaseReset)) {
|
||||||
copyOfFlags=(flags&(~16))|(noPhaseReset<<4);
|
altered=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (altered) {
|
||||||
|
e->lockSave([&]() {
|
||||||
|
flags.set("clockSel",clockSel);
|
||||||
|
flags.set("chipType",chipType);
|
||||||
|
flags.set("noPhaseReset",noPhaseReset);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_SYSTEM_PCE: {
|
case DIV_SYSTEM_PCE: {
|
||||||
sysPal=flags&1;
|
bool clockSel=flags.getInt("clockSel",0);
|
||||||
if (ImGui::Checkbox("Pseudo-PAL",&sysPal)) {
|
int chipType=flags.getInt("chipType",0);
|
||||||
copyOfFlags=(flags&(~1))|(unsigned int)sysPal;
|
bool noAntiClick=flags.getBool("noAntiClick",false);
|
||||||
|
|
||||||
|
if (ImGui::Checkbox("Pseudo-PAL",&clockSel)) {
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
bool antiClick=flags&8;
|
if (ImGui::Checkbox("Disable anti-click",&noAntiClick)) {
|
||||||
if (ImGui::Checkbox("Disable anti-click",&antiClick)) {
|
altered=true;
|
||||||
copyOfFlags=(flags&(~8))|(antiClick<<3);
|
|
||||||
}
|
}
|
||||||
ImGui::Text("Chip revision:");
|
ImGui::Text("Chip revision:");
|
||||||
if (ImGui::RadioButton("HuC6280 (original)",(flags&4)==0)) {
|
if (ImGui::RadioButton("HuC6280 (original)",chipType==0)) {
|
||||||
copyOfFlags=(flags&(~4))|0;
|
chipType=0;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("HuC6280A (SuperGrafx)",(flags&4)==4)) {
|
if (ImGui::RadioButton("HuC6280A (SuperGrafx)",chipType==1)) {
|
||||||
copyOfFlags=(flags&(~4))|4;
|
chipType=1;
|
||||||
|
altered=true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (altered) {
|
||||||
|
flags.set("clockSel",(int)clockSel);
|
||||||
|
flags.set("chipType",chipType);
|
||||||
|
flags.set("noPhaseReset",noAntiClick);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_SYSTEM_SOUND_UNIT: {
|
case DIV_SYSTEM_SOUND_UNIT: {
|
||||||
|
int clockSel=flags.getInt("clockSel",0);
|
||||||
|
bool echo=flags.getBool("echo",false);
|
||||||
|
bool swapEcho=flags.getBool("swapEcho",false);
|
||||||
|
int sampleMemSize=flags.getInt("sampleMemSize",0);
|
||||||
|
bool pdm=flags.getBool("pdm",false);
|
||||||
|
int echoDelay=flags.getInt("echoDelay",0);
|
||||||
|
int echoFeedback=flags.getInt("echoFeedback",0);
|
||||||
|
int echoResolution=flags.getInt("echoResolution",0);
|
||||||
|
int echoVol=(signed char)flags.getInt("echoVol",0);
|
||||||
|
|
||||||
ImGui::Text("CPU rate:");
|
ImGui::Text("CPU rate:");
|
||||||
if (ImGui::RadioButton("6.18MHz (NTSC)",(flags&3)==0)) {
|
if (ImGui::RadioButton("6.18MHz (NTSC)",clockSel==0)) {
|
||||||
copyOfFlags=(flags&(~3))|0;
|
clockSel=0;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("5.95MHz (PAL)",(flags&3)==1)) {
|
if (ImGui::RadioButton("5.95MHz (PAL)",clockSel==1)) {
|
||||||
copyOfFlags=(flags&(~3))|1;
|
clockSel=1;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
ImGui::Text("Sample memory:");
|
ImGui::Text("Sample memory:");
|
||||||
if (ImGui::RadioButton("8K (rev A/B/E)",(flags&16)==0)) {
|
if (ImGui::RadioButton("8K (rev A/B/E)",sampleMemSize==0)) {
|
||||||
copyOfFlags=(flags&(~16))|0;
|
sampleMemSize=0;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("64K (rev D/F)",(flags&16)==16)) {
|
if (ImGui::RadioButton("64K (rev D/F)",sampleMemSize==1)) {
|
||||||
copyOfFlags=(flags&(~16))|16;
|
sampleMemSize=1;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
ImGui::Text("DAC resolution");
|
ImGui::Text("DAC resolution:");
|
||||||
if (ImGui::RadioButton("16-bit (rev A/B/D/F)",(flags&32)==0)) {
|
if (ImGui::RadioButton("16-bit (rev A/B/D/F)",pdm==0)) {
|
||||||
copyOfFlags=(flags&(~32))|0;
|
pdm=false;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
if (ImGui::RadioButton("1-bit PDM (rev C/E)",(flags&32)==32)) {
|
if (ImGui::RadioButton("1-bit PDM (rev C/E)",pdm==1)) {
|
||||||
copyOfFlags=(flags&(~32))|32;
|
pdm=true;
|
||||||
|
altered=true;
|
||||||
}
|
}
|
||||||
bool echo=flags&4;
|
|
||||||
if (ImGui::Checkbox("Enable echo",&echo)) {
|
if (ImGui::Checkbox("Enable echo",&echo)) {
|
||||||
copyOfFlags=(flags&(~4))|(echo<<2);
|
altered=true;
|
||||||
}
|
}
|
||||||
bool flipEcho=flags&8;
|
if (ImGui::Checkbox("Swap echo channels",&swapEcho)) {
|
||||||
if (ImGui::Checkbox("Swap echo channels",&flipEcho)) {
|
altered=true;
|
||||||
copyOfFlags=(flags&(~8))|(flipEcho<<3);
|
|
||||||
}
|
}
|
||||||
ImGui::Text("Echo delay:");
|
ImGui::Text("Echo delay:");
|
||||||
int echoBufSize=(flags&0x3f00)>>8;
|
if (CWSliderInt("##EchoBufSize",&echoDelay,0,63)) {
|
||||||
if (CWSliderInt("##EchoBufSize",&echoBufSize,0,63)) {
|
if (echoDelay<0) echoDelay=0;
|
||||||
if (echoBufSize<0) echoBufSize=0;
|
if (echoDelay>63) echoDelay=63;
|
||||||
if (echoBufSize>63) echoBufSize=63;
|
altered=true;
|
||||||
copyOfFlags=(flags&~0x3f00)|(echoBufSize<<8);
|
|
||||||
} rightClickable
|
} rightClickable
|
||||||
ImGui::Text("Echo resolution:");
|
ImGui::Text("Echo resolution:");
|
||||||
int echoResolution=(flags&0xf00000)>>20;
|
|
||||||
if (CWSliderInt("##EchoResolution",&echoResolution,0,15)) {
|
if (CWSliderInt("##EchoResolution",&echoResolution,0,15)) {
|
||||||
if (echoResolution<0) echoResolution=0;
|
if (echoResolution<0) echoResolution=0;
|
||||||
if (echoResolution>15) echoResolution=15;
|
if (echoResolution>15) echoResolution=15;
|
||||||
copyOfFlags=(flags&(~0xf00000))|(echoResolution<<20);
|
altered=true;
|
||||||
} rightClickable
|
} rightClickable
|
||||||
ImGui::Text("Echo feedback:");
|
ImGui::Text("Echo feedback:");
|
||||||
int echoFeedback=(flags&0xf0000)>>16;
|
|
||||||
if (CWSliderInt("##EchoFeedback",&echoFeedback,0,15)) {
|
if (CWSliderInt("##EchoFeedback",&echoFeedback,0,15)) {
|
||||||
if (echoFeedback<0) echoFeedback=0;
|
if (echoFeedback<0) echoFeedback=0;
|
||||||
if (echoFeedback>15) echoFeedback=15;
|
if (echoFeedback>15) echoFeedback=15;
|
||||||
copyOfFlags=(flags&(~0xf0000))|(echoFeedback<<16);
|
altered=true;
|
||||||
} rightClickable
|
} rightClickable
|
||||||
ImGui::Text("Echo volume:");
|
ImGui::Text("Echo volume:");
|
||||||
int echoVolume=(signed char)((flags&0xff000000)>>24);
|
if (CWSliderInt("##EchoVolume",&echoVol,-128,127)) {
|
||||||
if (CWSliderInt("##EchoVolume",&echoVolume,-128,127)) {
|
if (echoVol<-128) echoVol=-128;
|
||||||
if (echoVolume<-128) echoVolume=-128;
|
if (echoVol>127) echoVol=127;
|
||||||
if (echoVolume>127) echoVolume=127;
|
altered=true;
|
||||||
copyOfFlags=(flags&(~0xff000000))|(((unsigned char)echoVolume)<<24);
|
|
||||||
} rightClickable
|
} rightClickable
|
||||||
|
|
||||||
|
if (altered) {
|
||||||
|
flags.set("clockSel",clockSel);
|
||||||
|
flags.set("echo",echo);
|
||||||
|
flags.set("swapEcho",swapEcho);
|
||||||
|
flags.set("sampleMemSize",sampleMemSize);
|
||||||
|
flags.set("pdm",pdm);
|
||||||
|
flags.set("echoDelay",echoDelay);
|
||||||
|
flags.set("echoFeedback",echoFeedback);
|
||||||
|
flags.set("echoResolution",echoResolution);
|
||||||
|
flags.set("echoVol",(unsigned char)echoVol);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
case DIV_SYSTEM_GB: {
|
case DIV_SYSTEM_GB: {
|
||||||
bool antiClick=flags&8;
|
bool antiClick=flags&8;
|
||||||
if (ImGui::Checkbox("Disable anti-click",&antiClick)) {
|
if (ImGui::Checkbox("Disable anti-click",&antiClick)) {
|
||||||
|
@ -787,18 +860,26 @@ void FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
|
||||||
copyOfFlags=sysPal;
|
copyOfFlags=sysPal;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
|
default:
|
||||||
|
ImGui::Text("Wait... is that right? No... I don't think so.");
|
||||||
|
|
||||||
|
if (ImGui::Button("But it is right!")) {
|
||||||
|
showError("https://github.com/tildearrow/furnace/issues/new");
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copyOfFlags!=flags) {
|
if (altered) {
|
||||||
if (chan>=0) {
|
if (chan>=0) {
|
||||||
e->setSysFlags(chan,copyOfFlags,restart);
|
e->updateSysFlags(chan,restart);
|
||||||
if (e->song.autoSystem) {
|
if (e->song.autoSystem) {
|
||||||
autoDetectSystem();
|
autoDetectSystem();
|
||||||
}
|
}
|
||||||
updateWindowTitle();
|
updateWindowTitle();
|
||||||
} else {
|
|
||||||
flags=copyOfFlags;
|
|
||||||
}
|
}
|
||||||
|
MARK_MODIFIED;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
return altered;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue