dev220: SNES anti-click
This commit is contained in:
parent
eadb6daf81
commit
11935fb525
|
@ -52,10 +52,10 @@ class DivWorkPool;
|
||||||
#define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock();
|
#define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock();
|
||||||
#define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false;
|
#define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false;
|
||||||
|
|
||||||
//#define DIV_UNSTABLE
|
#define DIV_UNSTABLE
|
||||||
|
|
||||||
#define DIV_VERSION "0.6.7"
|
#define DIV_VERSION "dev220"
|
||||||
#define DIV_ENGINE_VERSION 219
|
#define DIV_ENGINE_VERSION 220
|
||||||
// for imports
|
// for imports
|
||||||
#define DIV_VERSION_MOD 0xff01
|
#define DIV_VERSION_MOD 0xff01
|
||||||
#define DIV_VERSION_FC 0xff02
|
#define DIV_VERSION_FC 0xff02
|
||||||
|
|
|
@ -2102,6 +2102,16 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SNES no anti-click
|
||||||
|
if (ds.version<220) {
|
||||||
|
for (int i=0; i<ds.systemLen; i++) {
|
||||||
|
if (ds.system[i]==DIV_SYSTEM_SNES) {
|
||||||
|
ds.systemFlags[i].set("antiClick",false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (active) quitDispatch();
|
if (active) quitDispatch();
|
||||||
BUSY_BEGIN_SOFT;
|
BUSY_BEGIN_SOFT;
|
||||||
saveLock.lock();
|
saveLock.lock();
|
||||||
|
|
|
@ -255,6 +255,18 @@ void DivPlatformSNES::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (koff!=0) {
|
if (koff!=0) {
|
||||||
|
// TODO: improve
|
||||||
|
if (antiClick) {
|
||||||
|
for (int i=0; i<8; i++) {
|
||||||
|
if (koff&(1<<i)) {
|
||||||
|
logV("KOFF: %d",i);
|
||||||
|
chWrite(i,5,0);
|
||||||
|
chWrite(i,7,0x9f);
|
||||||
|
chan[i].shallWriteEnv=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rWriteDelay(0x7e,0,64);
|
||||||
|
}
|
||||||
rWriteDelay(0x5c,koff,8);
|
rWriteDelay(0x5c,koff,8);
|
||||||
}
|
}
|
||||||
if (writeControl) {
|
if (writeControl) {
|
||||||
|
|
|
@ -1970,6 +1970,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
||||||
echoFilter[7]=flags.getInt("echoFilter7",0);
|
echoFilter[7]=flags.getInt("echoFilter7",0);
|
||||||
|
|
||||||
bool interpolationOff=flags.getBool("interpolationOff",false);
|
bool interpolationOff=flags.getBool("interpolationOff",false);
|
||||||
|
bool antiClick=flags.getBool("antiClick",true);
|
||||||
|
|
||||||
ImGui::Text(_("Volume scale:"));
|
ImGui::Text(_("Volume scale:"));
|
||||||
if (CWSliderInt(_("Left##VolScaleL"),&vsL,0,127)) {
|
if (CWSliderInt(_("Left##VolScaleL"),&vsL,0,127)) {
|
||||||
|
@ -2090,6 +2091,10 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
||||||
altered=true;
|
altered=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::Checkbox(_("Anti-click"),&antiClick)) {
|
||||||
|
altered=true;
|
||||||
|
}
|
||||||
|
|
||||||
if (altered) {
|
if (altered) {
|
||||||
e->lockSave([&]() {
|
e->lockSave([&]() {
|
||||||
flags.set("volScaleL",127-vsL);
|
flags.set("volScaleL",127-vsL);
|
||||||
|
@ -2109,6 +2114,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
||||||
flags.set("echoFilter7",echoFilter[7]);
|
flags.set("echoFilter7",echoFilter[7]);
|
||||||
flags.set("echoMask",echoMask);
|
flags.set("echoMask",echoMask);
|
||||||
flags.set("interpolationOff",interpolationOff);
|
flags.set("interpolationOff",interpolationOff);
|
||||||
|
flags.set("antiClick",antiClick);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue