MSM5232: add detune option

This commit is contained in:
tildearrow 2022-10-01 03:27:57 -05:00
parent 5e18edb229
commit 81ac2ba3b1
3 changed files with 18 additions and 3 deletions

View File

@ -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;

View File

@ -63,7 +63,7 @@ class DivPlatformMSM5232: public DivDispatch {
};
std::queue<QueuedWrite> writes;
int cycles, curChan, delay;
int cycles, curChan, delay, detune;
short temp[16];
msm5232_device* msm;
unsigned char regPool[128];

View File

@ -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: