mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-29 02:51:24 +00:00
compound system flattening, part 3
added a new strategy to determine system name
This commit is contained in:
parent
319c559f47
commit
a29a89224e
3 changed files with 174 additions and 9 deletions
|
@ -365,6 +365,9 @@ class DivEngine {
|
|||
// get preferred instrument type
|
||||
DivInstrumentType getPreferInsType(int ch);
|
||||
|
||||
// get song system name
|
||||
const char* getSongSystemName();
|
||||
|
||||
// get sys name
|
||||
const char* getSystemName(DivSystem sys);
|
||||
|
||||
|
|
|
@ -380,7 +380,132 @@ int DivEngine::getTotalChannelCount() {
|
|||
return chans;
|
||||
}
|
||||
|
||||
// TODO: replace with a better strategy to determine name
|
||||
const char* DivEngine::getSongSystemName() {
|
||||
switch (song.systemLen) {
|
||||
case 0:
|
||||
return "help! what's going on!";
|
||||
case 1:
|
||||
if (song.system[0]==DIV_SYSTEM_AY8910) {
|
||||
switch (song.systemFlags[0]&0x3f) {
|
||||
case 0: // AY-3-8910, 1.79MHz
|
||||
case 1: // AY-3-8910, 1.77MHz
|
||||
case 2: // AY-3-8910, 1.75MHz
|
||||
return "ZX Spectrum";
|
||||
case 3: // AY-3-8910, 2MHz
|
||||
return "Fujitsu Micro-7";
|
||||
case 4: // AY-3-8910, 1.5MHz
|
||||
return "Vectrex";
|
||||
case 5: // AY-3-8910, 1MHz
|
||||
return "Amstrad CPC";
|
||||
case 6: // AY-3-8910, 0.somethingMhz
|
||||
return "Intellivision";
|
||||
case 8: // AY-3-8910, 0.somethingMhz
|
||||
return "Intellivision (PAL)";
|
||||
|
||||
case 0x10: // YM2149, 1.79MHz
|
||||
return "MSX";
|
||||
case 0x13: // YM2149, 2MHz
|
||||
return "Atari ST";
|
||||
case 0x26: // 5B NTSC
|
||||
return "Sunsoft 5B standalone";
|
||||
case 0x28: // 5B PAL
|
||||
return "Sunsoft 5B standalone (PAL)";
|
||||
|
||||
default:
|
||||
if ((song.systemFlags[0]&0x30)==0x00) {
|
||||
return "AY-3-8910";
|
||||
} else if ((song.systemFlags[0]&0x30)==0x10) {
|
||||
return "Yamaha YM2149";
|
||||
} else if ((song.systemFlags[0]&0x30)==0x20) {
|
||||
return "Overclocked Sunsoft 5B";
|
||||
}
|
||||
}
|
||||
} else if (song.system[0]==DIV_SYSTEM_SMS) {
|
||||
switch (song.systemFlags[0]&0x0f) {
|
||||
case 0: case 1:
|
||||
return "Sega Master System";
|
||||
case 6:
|
||||
return "BBC Micro";
|
||||
}
|
||||
} else if (song.system[0]==DIV_SYSTEM_YM2612) {
|
||||
switch (song.systemFlags[0]&3) {
|
||||
case 2:
|
||||
return "FM Towns";
|
||||
}
|
||||
} else if (song.system[0]==DIV_SYSTEM_YM2151) {
|
||||
switch (song.systemFlags[0]&3) {
|
||||
case 2:
|
||||
return "Sharp X68000";
|
||||
}
|
||||
} else if (song.system[0]==DIV_SYSTEM_SAA1099) {
|
||||
switch (song.systemFlags[0]&3) {
|
||||
case 0:
|
||||
return "SAM Coupé";
|
||||
}
|
||||
}
|
||||
return getSystemName(song.system[0]);
|
||||
case 2:
|
||||
if (song.system[0]==DIV_SYSTEM_YM2612 && song.system[1]==DIV_SYSTEM_SMS) {
|
||||
return "Sega Genesis/Mega Drive";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_YM2612_EXT && song.system[1]==DIV_SYSTEM_SMS) {
|
||||
return "Sega Genesis Extended Channel 3";
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_C64_6581 && song.system[1]==DIV_SYSTEM_C64_6581) {
|
||||
return "Commodore 64 with dual 6581";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_C64_8580 && song.system[1]==DIV_SYSTEM_C64_8580) {
|
||||
return "Commodore 64 with dual 8580";
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_YM2151 && song.system[1]==DIV_SYSTEM_SEGAPCM_COMPAT) {
|
||||
return "YM2151 + SegaPCM Arcade (compatibility)";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_YM2151 && song.system[1]==DIV_SYSTEM_SEGAPCM) {
|
||||
return "YM2151 + SegaPCM Arcade";
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_SAA1099 && song.system[1]==DIV_SYSTEM_SAA1099) {
|
||||
return "Creative Music System";
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_GB && song.system[1]==DIV_SYSTEM_AY8910) {
|
||||
return "Game Boy with AY expansion";
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_VRC6) {
|
||||
return "NES + Konami VRC6";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_VRC7) {
|
||||
return "NES + Konami VRC7";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_OPLL) {
|
||||
return "NES + Yamaha OPLL";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_FDS) {
|
||||
return "Famicom Disk System";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_N163) {
|
||||
return "NES + Namco 163";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_MMC5) {
|
||||
return "NES + MMC5";
|
||||
}
|
||||
if (song.system[0]==DIV_SYSTEM_NES && song.system[1]==DIV_SYSTEM_AY8910) {
|
||||
return "NES + Sunsoft 5B";
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_AY8910 && song.system[1]==DIV_SYSTEM_AY8910) {
|
||||
return "Bally Midway MCR";
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
}
|
||||
return "multi-system";
|
||||
}
|
||||
|
||||
const char* DivEngine::getSystemName(DivSystem sys) {
|
||||
switch (sys) {
|
||||
case DIV_SYSTEM_NULL:
|
||||
|
@ -390,7 +515,7 @@ const char* DivEngine::getSystemName(DivSystem sys) {
|
|||
case DIV_SYSTEM_GENESIS:
|
||||
return "Sega Genesis/Mega Drive";
|
||||
case DIV_SYSTEM_SMS:
|
||||
return "Sega Master System";
|
||||
return "TI SN76489";
|
||||
case DIV_SYSTEM_SMS_OPLL:
|
||||
return "Sega Master System + FM Expansion";
|
||||
case DIV_SYSTEM_GB:
|
||||
|
@ -437,7 +562,7 @@ const char* DivEngine::getSystemName(DivSystem sys) {
|
|||
case DIV_SYSTEM_OPLL:
|
||||
return "Yamaha OPLL";
|
||||
case DIV_SYSTEM_FDS:
|
||||
return "Famicom Disk System";
|
||||
return "Famicom Disk System (chip)";
|
||||
case DIV_SYSTEM_MMC5:
|
||||
return "MMC5";
|
||||
case DIV_SYSTEM_N163:
|
||||
|
@ -449,7 +574,7 @@ const char* DivEngine::getSystemName(DivSystem sys) {
|
|||
case DIV_SYSTEM_OPL:
|
||||
return "Yamaha OPL";
|
||||
case DIV_SYSTEM_OPL2:
|
||||
return "Adlib Music Synthesizer Card";
|
||||
return "Yamaha OPL2";
|
||||
case DIV_SYSTEM_OPL3:
|
||||
return "Yamaha OPL3";
|
||||
case DIV_SYSTEM_MULTIPCM:
|
||||
|
@ -463,7 +588,7 @@ const char* DivEngine::getSystemName(DivSystem sys) {
|
|||
case DIV_SYSTEM_SWAN:
|
||||
return "WonderSwan";
|
||||
case DIV_SYSTEM_SAA1099:
|
||||
return "SAM Coupé";
|
||||
return "Philips SAA1099";
|
||||
case DIV_SYSTEM_OPZ:
|
||||
return "Yamaha TX81Z/YS200";
|
||||
case DIV_SYSTEM_POKEMINI:
|
||||
|
|
|
@ -422,12 +422,10 @@ void FurnaceGUI::setFileName(String name) {
|
|||
}
|
||||
|
||||
void FurnaceGUI::updateWindowTitle() {
|
||||
String type=getSystemName(e->song.system[0]);
|
||||
if (e->song.systemLen>1) type="multi-system";
|
||||
if (e->song.name.empty()) {
|
||||
SDL_SetWindowTitle(sdlWin,fmt::sprintf("Furnace (%s)",type).c_str());
|
||||
SDL_SetWindowTitle(sdlWin,fmt::sprintf("Furnace (%s)",e->getSongSystemName()).c_str());
|
||||
} else {
|
||||
SDL_SetWindowTitle(sdlWin,fmt::sprintf("%s - Furnace (%s)",e->song.name,type).c_str());
|
||||
SDL_SetWindowTitle(sdlWin,fmt::sprintf("%s - Furnace (%s)",e->song.name,e->getSongSystemName()).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4513,19 +4511,24 @@ bool FurnaceGUI::loop() {
|
|||
case DIV_SYSTEM_YM2612_EXT: {
|
||||
if (ImGui::RadioButton("NTSC (7.67MHz)",(flags&3)==0)) {
|
||||
e->setSysFlags(i,(flags&0x80000000)|0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("PAL (7.61MHz)",(flags&3)==1)) {
|
||||
e->setSysFlags(i,(flags&0x80000000)|1,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("FM Towns (8MHz)",(flags&3)==2)) {
|
||||
e->setSysFlags(i,(flags&0x80000000)|2,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("AtGames Genesis (6.13MHz)",(flags&3)==3)) {
|
||||
e->setSysFlags(i,(flags&0x80000000)|3,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
bool ladder=flags&0x80000000;
|
||||
if (ImGui::Checkbox("Enable DAC distortion",&ladder)) {
|
||||
e->setSysFlags(i,(flags&(~0x80000000))|(ladder?0x80000000:0),restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4533,22 +4536,28 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::Text("Clock rate:");
|
||||
if (ImGui::RadioButton("NTSC (3.58MHz)",(flags&3)==0)) {
|
||||
e->setSysFlags(i,(flags&(~3))|0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("PAL (3.55MHz)",(flags&3)==1)) {
|
||||
e->setSysFlags(i,(flags&(~3))|1,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("BBC Micro (4MHz)",(flags&3)==2)) {
|
||||
e->setSysFlags(i,(flags&(~3))|2,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
ImGui::Text("Chip type:");
|
||||
if (ImGui::RadioButton("Sega VDP/Master System",((flags>>2)&3)==0)) {
|
||||
e->setSysFlags(i,(flags&(~12))|0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("TI SN76489",((flags>>2)&3)==1)) {
|
||||
e->setSysFlags(i,(flags&(~12))|4,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("TI SN76489 with Atari-like short noise",((flags>>2)&3)==2)) {
|
||||
e->setSysFlags(i,(flags&(~12))|8,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
/*if (ImGui::RadioButton("Game Gear",(flags>>2)==3)) {
|
||||
e->setSysFlags(i,(flags&3)|12);
|
||||
|
@ -4557,29 +4566,36 @@ bool FurnaceGUI::loop() {
|
|||
bool noPhaseReset=flags&16;
|
||||
if (ImGui::Checkbox("Disable noise period change phase reset",&noPhaseReset)) {
|
||||
e->setSysFlags(i,(flags&(~16))|(noPhaseReset<<4),restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DIV_SYSTEM_YM2151:
|
||||
if (ImGui::RadioButton("NTSC (3.58MHz)",flags==0)) {
|
||||
e->setSysFlags(i,0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("PAL (3.55MHz)",flags==1)) {
|
||||
e->setSysFlags(i,1,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("X68000 (4MHz)",flags==2)) {
|
||||
e->setSysFlags(i,2,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
case DIV_SYSTEM_NES:
|
||||
if (ImGui::RadioButton("NTSC (1.79MHz)",flags==0)) {
|
||||
e->setSysFlags(i,0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("PAL (1.67MHz)",flags==1)) {
|
||||
e->setSysFlags(i,1,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("Dendy (1.77MHz)",flags==2)) {
|
||||
e->setSysFlags(i,2,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
case DIV_SYSTEM_AY8910:
|
||||
|
@ -4587,47 +4603,60 @@ bool FurnaceGUI::loop() {
|
|||
ImGui::Text("Clock rate:");
|
||||
if (ImGui::RadioButton("1.79MHz (ZX Spectrum/MSX NTSC)",(flags&15)==0)) {
|
||||
e->setSysFlags(i,(flags&(~15))|0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("1.77MHz (ZX Spectrum/MSX PAL)",(flags&15)==1)) {
|
||||
e->setSysFlags(i,(flags&(~15))|1,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("1.75MHz (ZX Spectrum)",(flags&15)==2)) {
|
||||
e->setSysFlags(i,(flags&(~15))|2,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("2MHz (Atari ST)",(flags&15)==3)) {
|
||||
e->setSysFlags(i,(flags&(~15))|3,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("1.5MHz (Vectrex)",(flags&15)==4)) {
|
||||
e->setSysFlags(i,(flags&(~15))|4,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("1MHz (Amstrad CPC)",(flags&15)==5)) {
|
||||
e->setSysFlags(i,(flags&(~15))|5,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("0.89MHz (Sunsoft 5B)",(flags&15)==6)) {
|
||||
e->setSysFlags(i,(flags&(~15))|6,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("1.67MHz (?)",(flags&15)==7)) {
|
||||
e->setSysFlags(i,(flags&(~15))|7,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("0.83MHz (Sunsoft 5B on PAL)",(flags&15)==8)) {
|
||||
e->setSysFlags(i,(flags&(~15))|8,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (e->song.system[i]==DIV_SYSTEM_AY8910) {
|
||||
ImGui::Text("Chip type:");
|
||||
if (ImGui::RadioButton("AY-3-8910",(flags&0x30)==0)) {
|
||||
e->setSysFlags(i,(flags&(~0x30))|0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("YM2149(F)",(flags&0x30)==16)) {
|
||||
e->setSysFlags(i,(flags&(~0x30))|16,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("Sunsoft 5B",(flags&0x30)==32)) {
|
||||
e->setSysFlags(i,(flags&(~0x30))|32,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
}
|
||||
bool stereo=flags&0x40;
|
||||
ImGui::BeginDisabled((flags&0x30)==32);
|
||||
if (ImGui::Checkbox("Stereo##_AY_STEREO",&stereo)) {
|
||||
e->setSysFlags(i,(flags&(~0x40))|(stereo?0x40:0),restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
break;
|
||||
|
@ -4635,12 +4664,15 @@ bool FurnaceGUI::loop() {
|
|||
case DIV_SYSTEM_SAA1099:
|
||||
if (ImGui::RadioButton("SAM Coupé (8MHz)",flags==0)) {
|
||||
e->setSysFlags(i,0,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("NTSC (7.15MHz)",flags==1)) {
|
||||
e->setSysFlags(i,1,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
if (ImGui::RadioButton("PAL (7.09MHz)",flags==2)) {
|
||||
e->setSysFlags(i,2,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
case DIV_SYSTEM_AMIGA: {
|
||||
|
@ -4650,6 +4682,7 @@ bool FurnaceGUI::loop() {
|
|||
if (stereoSep<0) stereoSep=0;
|
||||
if (stereoSep>127) stereoSep=127;
|
||||
e->setSysFlags(i,(flags&1)|((stereoSep&127)<<8),restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
/* TODO LATER: I want 0.5 out already
|
||||
if (ImGui::RadioButton("Amiga 500 (OCS)",(flags&2)==0)) {
|
||||
|
@ -4661,6 +4694,7 @@ bool FurnaceGUI::loop() {
|
|||
sysPal=flags&1;
|
||||
if (ImGui::Checkbox("PAL",&sysPal)) {
|
||||
e->setSysFlags(i,(flags&2)|sysPal,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4671,6 +4705,7 @@ bool FurnaceGUI::loop() {
|
|||
if (echoBufSize<0) echoBufSize=0;
|
||||
if (echoBufSize>2725) echoBufSize=2725;
|
||||
e->setSysFlags(i,(flags & ~4095) | ((2725 - echoBufSize) & 4095),restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
ImGui::Text("Echo feedback:");
|
||||
int echoFeedback=(flags>>12)&255;
|
||||
|
@ -4678,6 +4713,7 @@ bool FurnaceGUI::loop() {
|
|||
if (echoFeedback<0) echoFeedback=0;
|
||||
if (echoFeedback>255) echoFeedback=255;
|
||||
e->setSysFlags(i,(flags & ~(255 << 12)) | ((echoFeedback & 255) << 12),restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -4692,6 +4728,7 @@ bool FurnaceGUI::loop() {
|
|||
default:
|
||||
if (ImGui::Checkbox("PAL",&sysPal)) {
|
||||
e->setSysFlags(i,sysPal,restart);
|
||||
updateWindowTitle();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue