From b087b28325298952aff552f9227ba83ab2afffcd Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 20 Jul 2023 16:50:19 -0500 Subject: [PATCH] remove Namco 163 name setting --- src/engine/engine.h | 4 ---- src/engine/platform/n163.cpp | 2 +- src/engine/sysDef.cpp | 17 +++-------------- src/gui/dataList.cpp | 1 - src/gui/gui.cpp | 6 +----- src/gui/gui.h | 2 -- src/gui/insEdit.cpp | 6 +++--- src/gui/settings.cpp | 14 +------------- 8 files changed, 9 insertions(+), 43 deletions(-) diff --git a/src/engine/engine.h b/src/engine/engine.h index d9772cd37..e07338db2 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -64,9 +64,6 @@ #define DIV_VERSION_S3M 0xff03 #define DIV_VERSION_FTM 0xff04 -// "Namco C163" -#define DIV_C163_DEFAULT_NAME "Namco 163" - enum DivStatusView { DIV_STATUS_NOTHING=0, DIV_STATUS_PATTERN, @@ -465,7 +462,6 @@ class DivEngine { int reversePitchTable[4096]; int pitchTable[4096]; short effectSlotMap[4096]; - char c163NameCS[1024]; int midiBaseChan; bool midiPoly; size_t midiAgeCounter; diff --git a/src/engine/platform/n163.cpp b/src/engine/platform/n163.cpp index 06fa22f89..6a0bfb043 100644 --- a/src/engine/platform/n163.cpp +++ b/src/engine/platform/n163.cpp @@ -166,7 +166,7 @@ void DivPlatformN163::updateWave(int ch, int wave, int pos, int len) { void DivPlatformN163::updateWaveCh(int ch) { if (ch<=chanMax) { - logV("updateWave with pos %d and len %d",chan[ch].wavePos,chan[ch].waveLen); + //logV("updateWave with pos %d and len %d",chan[ch].wavePos,chan[ch].waveLen); updateWave(ch,-1,chan[ch].wavePos,chan[ch].waveLen); if (chan[ch].active && !isMuted[ch]) { chan[ch].volumeChanged=true; diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index e92cca1c4..1529575da 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -200,9 +200,7 @@ String DivEngine::getSongSystemLegacyName(DivSong& ds, bool isMultiSystemAccepta return "Famicom Disk System"; } if (ds.system[0]==DIV_SYSTEM_NES && ds.system[1]==DIV_SYSTEM_N163) { - String ret="Famicom + "; - ret+=getConfString("c163Name",DIV_C163_DEFAULT_NAME); - return ret; + return "Famicom + Namco 163"; } if (ds.system[0]==DIV_SYSTEM_NES && ds.system[1]==DIV_SYSTEM_MMC5) { return "Famicom + MMC5"; @@ -230,11 +228,7 @@ String DivEngine::getSongSystemLegacyName(DivSong& ds, bool isMultiSystemAccepta String ret=""; for (int i=0; i0) ret+=" + "; - if (ds.system[i]==DIV_SYSTEM_N163) { - ret+=getConfString("c163Name",DIV_C163_DEFAULT_NAME); - } else { - ret+=getSystemName(ds.system[i]); - } + ret+=getSystemName(ds.system[i]); } return ret; @@ -242,11 +236,6 @@ String DivEngine::getSongSystemLegacyName(DivSong& ds, bool isMultiSystemAccepta const char* DivEngine::getSystemName(DivSystem sys) { if (sysDefs[sys]==NULL) return "Unknown"; - if (sys==DIV_SYSTEM_N163) { - String c1=getConfString("c163Name",DIV_C163_DEFAULT_NAME); - strncpy(c163NameCS,c1.c_str(),1023); - return c163NameCS; - } return sysDefs[sys]->name; } @@ -998,7 +987,7 @@ void DivEngine::registerSystems() { ); sysDefs[DIV_SYSTEM_N163]=new DivSysDef( - "Namco 163/C163/129/160/106/whatever", NULL, 0x8c, 0, 8, false, true, 0, false, 0, + "Namco 163", NULL, 0x8c, 0, 8, false, true, 0, false, 0, "an expansion chip for the Famicom, with full wavetable.", {"Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", "Channel 8"}, {"CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "CH7", "CH8"}, diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index fa5b46471..971030ee7 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -77,7 +77,6 @@ void FurnaceGUI::insListItem(int i, int dir, int asset) { if (i>=0 && isong.insLen) { DivInstrument* ins=e->song.ins[i]; insType=(ins->type>DIV_INS_MAX)?"Unknown":insTypes[ins->type]; - if (ins->type==DIV_INS_N163) insType=settings.c163Name.c_str(); switch (ins->type) { case DIV_INS_FM: ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_FM]); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index cd92c003f..4e24219e1 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -682,11 +682,7 @@ void FurnaceGUI::autoDetectSystem() { if (k.second>1) { e->song.systemName+=fmt::sprintf("%d×",k.second); } - if (k.first==DIV_SYSTEM_N163) { - e->song.systemName+=settings.c163Name; - } else { - e->song.systemName+=e->getSystemName(k.first); - } + e->song.systemName+=e->getSystemName(k.first); isFirst=false; } } diff --git a/src/gui/gui.h b/src/gui/gui.h index 8b3460fa1..02cbaac63 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1527,7 +1527,6 @@ class FurnaceGUI { String audioDevice; String midiInDevice; String midiOutDevice; - String c163Name; String renderBackend; String renderDriver; String initialSysName; @@ -1681,7 +1680,6 @@ class FurnaceGUI { audioDevice(""), midiInDevice(""), midiOutDevice(""), - c163Name(""), renderBackend(""), renderDriver(""), initialSysName("Sega Genesis/Mega Drive"), diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 93ff0baf9..01438ace0 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -2305,7 +2305,7 @@ void FurnaceGUI::drawInsEdit() { ins->type=(DivInstrumentType)insType; } */ - if (ImGui::BeginCombo("##Type",insType==DIV_INS_N163?settings.c163Name.c_str():insTypes[insType])) { + if (ImGui::BeginCombo("##Type",insTypes[insType])) { std::vector insTypeList; if (settings.displayAllInsTypes) { for (int i=0; insTypes[i]; i++) { @@ -2315,7 +2315,7 @@ void FurnaceGUI::drawInsEdit() { insTypeList=e->getPossibleInsTypes(); } for (DivInstrumentType i: insTypeList) { - if (ImGui::Selectable(i==DIV_INS_N163?settings.c163Name.c_str():insTypes[i],insType==i)) { + if (ImGui::Selectable(insTypes[i],insType==i)) { ins->type=i; // reset macro zoom @@ -4665,7 +4665,7 @@ void FurnaceGUI::drawInsEdit() { sampleMapFocused=false; } } - if (ins->type==DIV_INS_N163) if (ImGui::BeginTabItem(settings.c163Name.c_str())) { + if (ins->type==DIV_INS_N163) if (ImGui::BeginTabItem("Namco 163")) { if (ImGui::InputInt("Waveform##WAVE",&ins->n163.wave,1,10)) { PARAMETER if (ins->n163.wave<0) ins->n163.wave=0; if (ins->n163.wave>=e->song.waveLen) ins->n163.wave=e->song.waveLen-1; diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index cbc71aed6..508778acb 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -1638,12 +1638,6 @@ void FurnaceGUI::drawSettings() { ImGui::Separator(); - ImGui::Text("Namco 163 chip name"); - ImGui::SameLine(); - ImGui::InputTextWithHint("##C163Name",DIV_C163_DEFAULT_NAME,&settings.c163Name); - - ImGui::Separator(); - ImGui::Text("Channel colors:"); if (ImGui::RadioButton("Single##CHC0",settings.channelColors==0)) { settings.channelColors=0; @@ -2067,11 +2061,7 @@ void FurnaceGUI::drawSettings() { UI_COLOR_CONFIG(GUI_COLOR_INSTR_OPL,"FM (OPL)"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_FDS,"FDS"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_VBOY,"Virtual Boy"); - // special case - String c163Label=fmt::sprintf("%s##CC_GUI_COLOR_INSTR_N163",settings.c163Name); - if (ImGui::ColorEdit4(c163Label.c_str(),(float*)&uiColors[GUI_COLOR_INSTR_N163])) { - applyUISettings(false); - } + UI_COLOR_CONFIG(GUI_COLOR_INSTR_N163,"Namco 163"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_SCC,"Konami SCC"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_OPZ,"FM (OPZ)"); UI_COLOR_CONFIG(GUI_COLOR_INSTR_POKEY,"POKEY"); @@ -2662,7 +2652,6 @@ void FurnaceGUI::syncSettings() { settings.audioChans=e->getConfInt("audioChans",2); settings.midiInDevice=e->getConfString("midiInDevice",""); settings.midiOutDevice=e->getConfString("midiOutDevice",""); - settings.c163Name=e->getConfString("c163Name",DIV_C163_DEFAULT_NAME); settings.renderDriver=e->getConfString("renderDriver",""); settings.sdlAudioDriver=e->getConfString("sdlAudioDriver",""); settings.audioQuality=e->getConfInt("audioQuality",0); @@ -3011,7 +3000,6 @@ void FurnaceGUI::commitSettings() { e->setConf("audioDevice",settings.audioDevice); e->setConf("midiInDevice",settings.midiInDevice); e->setConf("midiOutDevice",settings.midiOutDevice); - e->setConf("c163Name",settings.c163Name); e->setConf("renderDriver",settings.renderDriver); e->setConf("sdlAudioDriver",settings.sdlAudioDriver); e->setConf("audioQuality",settings.audioQuality);