dev125 - prepare for ExtCh FM macros

This commit is contained in:
tildearrow 2022-11-07 18:39:04 -05:00
parent 06ddf07d48
commit 8d8bdfd1f7
10 changed files with 56 additions and 6 deletions

View file

@ -47,8 +47,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock(); #define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false; #define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev124" #define DIV_VERSION "dev125"
#define DIV_ENGINE_VERSION 124 #define DIV_ENGINE_VERSION 125
// for imports // for imports
#define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02 #define DIV_VERSION_FC 0xff02

View file

@ -2616,6 +2616,21 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} }
} }
// ExtCh compat flag
if (ds.version<125) {
for (int i=0; i<ds.systemLen; i++) {
if (ds.system[i]==DIV_SYSTEM_YM2612_EXT ||
ds.system[i]==DIV_SYSTEM_YM2612_FRAC_EXT ||
ds.system[i]==DIV_SYSTEM_YM2610_EXT ||
ds.system[i]==DIV_SYSTEM_YM2610_FULL_EXT ||
ds.system[i]==DIV_SYSTEM_YM2610B_EXT ||
ds.system[i]==DIV_SYSTEM_OPN_EXT ||
ds.system[i]==DIV_SYSTEM_PC98_EXT) {
ds.systemFlags[i].set("noExtMacros",true);
}
}
}
if (active) quitDispatch(); if (active) quitDispatch();
BUSY_BEGIN_SOFT; BUSY_BEGIN_SOFT;
saveLock.lock(); saveLock.lock();

View file

@ -1219,6 +1219,7 @@ void DivPlatformGenesis::setFlags(const DivConfig& flags) {
break; break;
} }
ladder=flags.getBool("ladderEffect",false); ladder=flags.getBool("ladderEffect",false);
noExtMacros=flags.getBool("noExtMacros",false);
OPN2_SetChipType(ladder?ym3438_mode_ym2612:0); OPN2_SetChipType(ladder?ym3438_mode_ym2612:0);
if (useYMFM) { if (useYMFM) {
if (fm_ymfm!=NULL) delete fm_ymfm; if (fm_ymfm!=NULL) delete fm_ymfm;

View file

@ -111,7 +111,7 @@ class DivPlatformGenesis: public DivPlatformOPN {
int softPCMTimer; int softPCMTimer;
bool extMode, softPCM, useYMFM; bool extMode, softPCM, noExtMacros, useYMFM;
bool ladder; bool ladder;
unsigned char dacVolTable[128]; unsigned char dacVolTable[128];

View file

@ -952,6 +952,7 @@ void DivPlatformYM2203::setFlags(const DivConfig& flags) {
ayDiv=16; ayDiv=16;
break; break;
} }
noExtMacros=flags.getBool("noExtMacros",false);
rate=fm->sample_rate(chipClock); rate=fm->sample_rate(chipClock);
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
oscBuf[i]->rate=rate; oscBuf[i]->rate=rate;

View file

@ -91,7 +91,7 @@ class DivPlatformYM2203: public DivPlatformOPN {
DivPlatformAY8910* ay; DivPlatformAY8910* ay;
unsigned char sampleBank; unsigned char sampleBank;
bool extMode; bool extMode, noExtMacros;
unsigned char prescale; unsigned char prescale;
friend void putDispatchChip(void*,int); friend void putDispatchChip(void*,int);

View file

@ -1394,6 +1394,7 @@ void DivPlatformYM2608::setFlags(const DivConfig& flags) {
ayDiv=32; ayDiv=32;
break; break;
} }
noExtMacros=flags.getBool("noExtMacros",false);
rate=fm->sample_rate(chipClock); rate=fm->sample_rate(chipClock);
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {
oscBuf[i]->rate=rate; oscBuf[i]->rate=rate;

View file

@ -106,7 +106,7 @@ class DivPlatformYM2608: public DivPlatformOPN {
unsigned char writeRSSOff, writeRSSOn; unsigned char writeRSSOff, writeRSSOn;
int globalRSSVolume; int globalRSSVolume;
bool extMode; bool extMode, noExtMacros;
unsigned char prescale; unsigned char prescale;
double NOTE_OPNB(int ch, int note); double NOTE_OPNB(int ch, int note);

View file

@ -141,7 +141,7 @@ template<int ChanNum> class DivPlatformYM2610Base: public DivPlatformOPN {
unsigned char sampleBank; unsigned char sampleBank;
bool extMode; bool extMode, noExtMacros;
unsigned char writeADPCMAOff, writeADPCMAOn; unsigned char writeADPCMAOff, writeADPCMAOn;
int globalADPCMAVolume; int globalADPCMAVolume;
@ -269,6 +269,7 @@ template<int ChanNum> class DivPlatformYM2610Base: public DivPlatformOPN {
chipClock=8000000.0; chipClock=8000000.0;
break; break;
} }
noExtMacros=flags.getBool("noExtMacros",false);
rate=chipClock/16; rate=chipClock/16;
for (int i=0; i<ChanNum; i++) { for (int i=0; i<ChanNum; i++) {
oscBuf[i]->rate=rate; oscBuf[i]->rate=rate;

View file

@ -32,6 +32,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
case DIV_SYSTEM_YM2612_FRAC_EXT: { case DIV_SYSTEM_YM2612_FRAC_EXT: {
int clockSel=flags.getInt("clockSel",0); int clockSel=flags.getInt("clockSel",0);
bool ladder=flags.getBool("ladderEffect",0); bool ladder=flags.getBool("ladderEffect",0);
bool noExtMacros=flags.getBool("noExtMacros",false);
if (ImGui::RadioButton("NTSC (7.67MHz)",clockSel==0)) { if (ImGui::RadioButton("NTSC (7.67MHz)",clockSel==0)) {
clockSel=0; clockSel=0;
@ -56,11 +57,17 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
if (ImGui::Checkbox("Enable DAC distortion",&ladder)) { if (ImGui::Checkbox("Enable DAC distortion",&ladder)) {
altered=true; altered=true;
} }
if (type==DIV_SYSTEM_YM2612_EXT || type==DIV_SYSTEM_YM2612_FRAC_EXT) {
if (ImGui::Checkbox("Disable ExtCh FM macros (compatibility)",&noExtMacros)) {
altered=true;
}
}
if (altered) { if (altered) {
e->lockSave([&]() { e->lockSave([&]() {
flags.set("clockSel",clockSel); flags.set("clockSel",clockSel);
flags.set("ladderEffect",ladder); flags.set("ladderEffect",ladder);
flags.set("noExtMacros",noExtMacros);
}); });
} }
break; break;
@ -439,6 +446,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
case DIV_SYSTEM_YM2610B: case DIV_SYSTEM_YM2610B:
case DIV_SYSTEM_YM2610B_EXT: { case DIV_SYSTEM_YM2610B_EXT: {
int clockSel=flags.getInt("clockSel",0); int clockSel=flags.getInt("clockSel",0);
bool noExtMacros=flags.getBool("noExtMacros",false);
if (ImGui::RadioButton("8MHz (Neo Geo MVS)",clockSel==0)) { if (ImGui::RadioButton("8MHz (Neo Geo MVS)",clockSel==0)) {
clockSel=0; clockSel=0;
@ -449,9 +457,16 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
altered=true; altered=true;
} }
if (type==DIV_SYSTEM_YM2610_EXT || type==DIV_SYSTEM_YM2610_FULL_EXT || type==DIV_SYSTEM_YM2610B_EXT) {
if (ImGui::Checkbox("Disable ExtCh FM macros (compatibility)",&noExtMacros)) {
altered=true;
}
}
if (altered) { if (altered) {
e->lockSave([&]() { e->lockSave([&]() {
flags.set("clockSel",clockSel); flags.set("clockSel",clockSel);
flags.set("noExtMacros",noExtMacros);
}); });
} }
break; break;
@ -789,6 +804,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
case DIV_SYSTEM_OPN_EXT: { case DIV_SYSTEM_OPN_EXT: {
int clockSel=flags.getInt("clockSel",0); int clockSel=flags.getInt("clockSel",0);
int prescale=flags.getInt("prescale",0); int prescale=flags.getInt("prescale",0);
bool noExtMacros=flags.getBool("noExtMacros",false);
ImGui::Text("Clock rate:"); ImGui::Text("Clock rate:");
if (ImGui::RadioButton("3.58MHz (NTSC)",clockSel==0)) { if (ImGui::RadioButton("3.58MHz (NTSC)",clockSel==0)) {
@ -829,10 +845,17 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
altered=true; altered=true;
} }
if (type==DIV_SYSTEM_OPN_EXT) {
if (ImGui::Checkbox("Disable ExtCh FM macros (compatibility)",&noExtMacros)) {
altered=true;
}
}
if (altered) { if (altered) {
e->lockSave([&]() { e->lockSave([&]() {
flags.set("clockSel",clockSel); flags.set("clockSel",clockSel);
flags.set("prescale",prescale); flags.set("prescale",prescale);
flags.set("noExtMacros",noExtMacros);
}); });
} }
break; break;
@ -841,6 +864,7 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
case DIV_SYSTEM_PC98_EXT: { case DIV_SYSTEM_PC98_EXT: {
int clockSel=flags.getInt("clockSel",0); int clockSel=flags.getInt("clockSel",0);
int prescale=flags.getInt("prescale",0); int prescale=flags.getInt("prescale",0);
bool noExtMacros=flags.getBool("noExtMacros",false);
ImGui::Text("Clock rate:"); ImGui::Text("Clock rate:");
if (ImGui::RadioButton("8MHz (Arcade)",clockSel==0)) { if (ImGui::RadioButton("8MHz (Arcade)",clockSel==0)) {
@ -865,10 +889,17 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo
altered=true; altered=true;
} }
if (type==DIV_SYSTEM_PC98_EXT) {
if (ImGui::Checkbox("Disable ExtCh FM macros (compatibility)",&noExtMacros)) {
altered=true;
}
}
if (altered) { if (altered) {
e->lockSave([&]() { e->lockSave([&]() {
flags.set("clockSel",clockSel); flags.set("clockSel",clockSel);
flags.set("prescale",prescale); flags.set("prescale",prescale);
flags.set("noExtMacros",noExtMacros);
}); });
} }
break; break;