From 1e6b660d2cdbaaf566cfd42de617716b143f0109 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 May 2022 11:05:28 -0500 Subject: [PATCH 1/6] OPN: hopefully several ExtCh fixes --- src/engine/platform/ym2203ext.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/engine/platform/ym2203ext.cpp b/src/engine/platform/ym2203ext.cpp index 9ca77e9fc..74bf9bac1 100644 --- a/src/engine/platform/ym2203ext.cpp +++ b/src/engine/platform/ym2203ext.cpp @@ -21,7 +21,7 @@ #include "../engine.h" #include -#include "ym2610shared.h" +#include "ym2203shared.h" #include "fmshared_OPN.h" int DivPlatformYM2203Ext::dispatch(DivCommand c) { @@ -489,9 +489,6 @@ void DivPlatformYM2203Ext::forceIns() { chan[i].freqChanged=true; } } - for (int i=3; i<6; i++) { - chan[i].insChanged=true; - } ay->forceIns(); ay->flushWrites(); From 2fbc39bc903cae7265033caee7f8ae53919eb013 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 May 2022 11:28:59 -0500 Subject: [PATCH 2/6] N163: fix potential linear pitch regression how in the world --- src/engine/platform/n163.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/n163.cpp b/src/engine/platform/n163.cpp index 9318b4f8b..691cdc04a 100644 --- a/src/engine/platform/n163.cpp +++ b/src/engine/platform/n163.cpp @@ -357,7 +357,9 @@ void DivPlatformN163::tick(bool sysTick) { chan[i].waveUpdated=false; } if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) { - chan[i].freq=parent->calcFreq((((chan[i].baseFreq*chan[i].waveLen)*(chanMax+1))/16),chan[i].pitch,false,0,chan[i].pitch2,chipClock,CHIP_FREQBASE); + // TODO: what is this mess? + chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,0,chan[i].pitch2,chipClock,CHIP_FREQBASE); + chan[i].freq=(((chan[i].freq*chan[i].waveLen)*(chanMax+1))/16); if (chan[i].freq<0) chan[i].freq=0; if (chan[i].freq>0x3ffff) chan[i].freq=0x3ffff; if (chan[i].keyOn) { From 85d9a52deeb98362480770aa69c60c0c355d7ccd Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 May 2022 11:37:15 -0500 Subject: [PATCH 3/6] fix potential hangs in saveFur again --- src/engine/fileOps.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index c63601a4f..feae353d3 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -2669,16 +2669,19 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) { if (song.ins.size()>256) { logE("maximum number of instruments is 256!"); lastError="maximum number of instruments is 256"; + saveLock.unlock(); return NULL; } if (song.wave.size()>256) { logE("maximum number of wavetables is 256!"); lastError="maximum number of wavetables is 256"; + saveLock.unlock(); return NULL; } if (song.sample.size()>256) { logE("maximum number of samples is 256!"); lastError="maximum number of samples is 256"; + saveLock.unlock(); return NULL; } From cddee6331edade9e3409bd1855223ce6fd1f2868 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 May 2022 12:02:00 -0500 Subject: [PATCH 4/6] ZX beeper: clarify effects (will be done later) --- src/engine/platform/zxbeeper.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/engine/platform/zxbeeper.cpp b/src/engine/platform/zxbeeper.cpp index 145cfe5b5..5fc3942fc 100644 --- a/src/engine/platform/zxbeeper.cpp +++ b/src/engine/platform/zxbeeper.cpp @@ -29,20 +29,11 @@ const char** DivPlatformZXBeeper::getRegisterSheet() { const char* DivPlatformZXBeeper::getEffectName(unsigned char effect) { switch (effect) { - case 0x10: - return "10xx: Change waveform"; - break; - case 0x11: - return "11xx: Toggle noise mode"; - break; case 0x12: - return "12xx: Setup LFO (0: disabled; 1: 1x depth; 2: 16x depth; 3: 256x depth)"; - break; - case 0x13: - return "13xx: Set LFO speed"; + return "12xx: Set pulse width"; break; case 0x17: - return "17xx: Toggle PCM mode"; + return "17xx: Trigger overlay drum"; break; } return NULL; From 051c79a7e8693134f0c8ab2f04df56639d5df0cf Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 May 2022 12:02:38 -0500 Subject: [PATCH 5/6] update to-do list --- TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/TODO.md b/TODO.md index 62364e065..94e7f8df6 100644 --- a/TODO.md +++ b/TODO.md @@ -1,5 +1,6 @@ # to-do for 0.6pre1 +- fix an OPLL/OPL fixed drum freq regression caused by full linear pitch - piano/input pad - note input via piano - input pad From a292bc109d07705bcd931db6b3020664cc3b6242 Mon Sep 17 00:00:00 2001 From: Laurens Holst Date: Sun, 15 May 2022 20:35:21 +0200 Subject: [PATCH 6/6] Have OPN* platforms set the correct YM2149 chip type. They were setting the Sunsoft type, which doubled the frequency division since c5c612c354. --- src/engine/platform/ym2203.cpp | 12 ++++++------ src/engine/platform/ym2608.cpp | 2 +- src/engine/platform/ym2610.cpp | 2 +- src/engine/platform/ym2610b.cpp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index 10fde1f29..057c98b76 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -1057,19 +1057,19 @@ void DivPlatformYM2203::setSkipRegisterWrites(bool value) { } void DivPlatformYM2203::setFlags(unsigned int flags) { - unsigned char ayFlags=32; + unsigned char ayFlags=16; if (flags==3) { chipClock=3000000.0; - ayFlags=36; + ayFlags=20; } else if (flags==2) { chipClock=4000000.0; - ayFlags=35; + ayFlags=19; } else if (flags==1) { chipClock=COLOR_PAL*4.0/5.0; - ayFlags=33; + ayFlags=17; } else { chipClock=COLOR_NTSC; - ayFlags=32; + ayFlags=16; } ay->setFlags(ayFlags); rate=fm->sample_rate(chipClock); @@ -1090,7 +1090,7 @@ int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, unsigned in fm->set_fidelity(ymfm::OPN_FIDELITY_MIN); // YM2149, 2MHz ay=new DivPlatformAY8910; - ay->init(p,3,sugRate,35); + ay->init(p,3,sugRate,19); ay->toggleRegisterDump(true); setFlags(flags); diff --git a/src/engine/platform/ym2608.cpp b/src/engine/platform/ym2608.cpp index b7e18e69d..730b62255 100644 --- a/src/engine/platform/ym2608.cpp +++ b/src/engine/platform/ym2608.cpp @@ -1459,7 +1459,7 @@ int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, unsigned in } // YM2149, 2MHz ay=new DivPlatformAY8910; - ay->init(p,3,sugRate,35); + ay->init(p,3,sugRate,19); ay->toggleRegisterDump(true); reset(); return 16; diff --git a/src/engine/platform/ym2610.cpp b/src/engine/platform/ym2610.cpp index ce3e4b7c1..f096f8f23 100644 --- a/src/engine/platform/ym2610.cpp +++ b/src/engine/platform/ym2610.cpp @@ -1454,7 +1454,7 @@ int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, unsigned in fm=new ymfm::ym2610(iface); // YM2149, 2MHz ay=new DivPlatformAY8910; - ay->init(p,3,sugRate,35); + ay->init(p,3,sugRate,19); ay->toggleRegisterDump(true); reset(); return 14; diff --git a/src/engine/platform/ym2610b.cpp b/src/engine/platform/ym2610b.cpp index 5a36aaaf4..c002f4b36 100644 --- a/src/engine/platform/ym2610b.cpp +++ b/src/engine/platform/ym2610b.cpp @@ -1432,7 +1432,7 @@ int DivPlatformYM2610B::init(DivEngine* p, int channels, int sugRate, unsigned i fm=new ymfm::ym2610b(iface); // YM2149, 2MHz ay=new DivPlatformAY8910; - ay->init(p,3,sugRate,35); + ay->init(p,3,sugRate,19); ay->toggleRegisterDump(true); reset(); return 16;