diff --git a/src/engine/platform/msm5232.cpp b/src/engine/platform/msm5232.cpp index 2bc3d8b6..39e9d08b 100644 --- a/src/engine/platform/msm5232.cpp +++ b/src/engine/platform/msm5232.cpp @@ -81,7 +81,7 @@ void DivPlatformMSM5232::tick(bool sysTick) { chan[i].std.next(); if (chan[i].std.vol.had) { chan[i].outVol=VOL_SCALE_LOG(chan[i].vol&31,MIN(31,chan[i].std.vol.val),31); - // TODO: volume write? + // MSM5232 doesn't even have volume control :< } if (chan[i].std.arp.had) { if (!chan[i].inPorta) { @@ -300,7 +300,8 @@ void DivPlatformMSM5232::notifyInsDeletion(void* ins) { void DivPlatformMSM5232::setFlags(const DivConfig& flags) { chipClock=2119040; - msm->set_clock(chipClock); + detune=flags.getInt("detune",0); + msm->set_clock(chipClock+detune*1024); rate=msm->get_rate(); for (int i=0; i<8; i++) { oscBuf[i]->rate=rate; diff --git a/src/engine/platform/msm5232.h b/src/engine/platform/msm5232.h index 18964983..7bfe7950 100644 --- a/src/engine/platform/msm5232.h +++ b/src/engine/platform/msm5232.h @@ -63,7 +63,7 @@ class DivPlatformMSM5232: public DivDispatch { }; std::queue writes; - int cycles, curChan, delay; + int cycles, curChan, delay, detune; short temp[16]; msm5232_device* msm; unsigned char regPool[128]; diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index 74c96271..960d0f9d 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -1290,6 +1290,20 @@ bool FurnaceGUI::drawSysConf(int chan, DivSystem type, DivConfig& flags, bool mo break; } + case DIV_SYSTEM_MSM5232: { + int detune=flags.getInt("detune",0); + + if (CWSliderInt("Detune",&detune,-127,127)) { + if (detune<-127) detune=-127; + if (detune>127) detune=127; + altered=true; + } rightClickable + + if (altered) { + flags.set("detune",detune); + } + break; + } case DIV_SYSTEM_SWAN: case DIV_SYSTEM_VERA: case DIV_SYSTEM_BUBSYS_WSG: