diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 2c005ee9..d8426553 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -25,7 +25,7 @@ #define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;} #define immWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} } -#define CHIP_FREQBASE 9440540 +#define CHIP_FREQBASE chipFreqBase // N = invalid #define N 255 @@ -456,9 +456,11 @@ int DivPlatformOPL::dispatch(DivCommand c) { chan[c.chan].outVol=chan[c.chan].vol; } if (chan[c.chan].insChanged) { - int ops=(slots[3][c.chan]!=255 && ins->fm.ops==4)?4:2; + int ops=(slots[3][c.chan]!=255 && ins->fm.ops==4 && oplType==3)?4:2; for (int i=0; i 4) { period_counter[ch] -= sub_run_time; @@ -116,7 +114,6 @@ void WSwan::SoundUpdate(uint32_t v30mz_timestamp) sample_pos[ch] = (sample_pos[ch] + 1) & 0x1F; MK_SAMPLE_CACHE; - SYNCSAMPLE(meow_timestamp + period_counter[ch]); period_counter[ch] += tmp_pt; } } diff --git a/src/engine/platform/sound/swan.h b/src/engine/platform/sound/swan.h index b1b0af74..a1d01fa5 100644 --- a/src/engine/platform/sound/swan.h +++ b/src/engine/platform/sound/swan.h @@ -76,7 +76,6 @@ private: uint32_t last_ts; uint8_t wsRAM[64]; - int16_t sBuf[2]; }; #endif diff --git a/src/engine/platform/swan.cpp b/src/engine/platform/swan.cpp index 8fdca1d4..21987180 100644 --- a/src/engine/platform/swan.cpp +++ b/src/engine/platform/swan.cpp @@ -152,7 +152,7 @@ void DivPlatformSwan::tick() { unsigned char sndCtrl=(pcm?0x20:0)|(sweep?0x40:0)|((noise>0)?0x80:0); for (int i=0; i<4; i++) { chan[i].std.next(); - if (chan[i].std.willVol) { + if (chan[i].std.hadVol) { int env=chan[i].std.vol; if(parent->getIns(chan[i].ins)->type==DIV_INS_AMIGA) { env=MIN(env/4,15); @@ -320,7 +320,7 @@ int DivPlatformSwan::dispatch(DivCommand c) { case DIV_CMD_VOLUME: if (chan[c.chan].vol!=c.value) { chan[c.chan].vol=c.value; - if (!chan[c.chan].std.willVol) { + if (!chan[c.chan].std.hadVol) { calcAndWriteOutVol(c.chan,15); } } @@ -392,9 +392,7 @@ int DivPlatformSwan::dispatch(DivCommand c) { break; case DIV_CMD_PANNING: { chan[c.chan].pan=c.value; - if (!chan[c.chan].std.willVol) { - calcAndWriteOutVol(c.chan,15); - } + calcAndWriteOutVol(c.chan,chan[c.chan].std.willVol?chan[c.chan].std.vol:15); break; } case DIV_CMD_LEGATO: diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 475d017c..dc72ccad 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -4969,6 +4969,7 @@ bool FurnaceGUI::loop() { break; } case DIV_SYSTEM_GB: + case DIV_SYSTEM_SWAN: case DIV_SYSTEM_YM2610: case DIV_SYSTEM_YM2610_EXT: case DIV_SYSTEM_YM2610_FULL: