OPL: fix channel muting - PLEASE READ!

**SUBMODULES UPDATED** - Nuked-OPL3 is no longer a submodule as I
had to directly modify the core for this
if you mess up while removing Nuked-OPL3 from your repo, delete
everything and clone again

fixes #414
This commit is contained in:
tildearrow 2022-05-04 18:06:32 -05:00
parent e50df18393
commit b75336bcb6
10 changed files with 2175 additions and 6 deletions

View file

@ -564,6 +564,9 @@ int DivPlatformOPL::toFreq(int freq) {
void DivPlatformOPL::muteChannel(int ch, bool mute) {
isMuted[ch]=mute;
if (ch<melodicChans) {
fm.channel[outChanMap[ch]].muted=mute;
}
int ops=(slots[3][ch]!=255 && chan[ch].state.ops==4 && oplType==3)?4:2;
chan[ch].fourOp=(ops==4);
update4OpMask=true;
@ -1226,10 +1229,12 @@ void DivPlatformOPL::reset() {
properDrums=properDrumsSys;
if (oplType==3) {
chanMap=properDrums?chanMapOPL3Drums:chanMapOPL3;
outChanMap=outChanMapOPL3;
melodicChans=properDrums?15:18;
totalChans=properDrums?20:18;
} else {
chanMap=properDrums?chanMapOPL2Drums:chanMapOPL2;
outChanMap=outChanMapOPL2;
melodicChans=properDrums?6:9;
totalChans=properDrums?11:9;
}
@ -1240,6 +1245,10 @@ void DivPlatformOPL::reset() {
chan[i].vol=0x3f;
chan[i].outVol=0x3f;
}
for (int i=0; i<melodicChans; i++) {
fm.channel[outChanMap[i]].muted=isMuted[i];
}
for (int i=0; i<512; i++) {
oldWrites[i]=-1;

View file

@ -22,7 +22,7 @@
#include "../dispatch.h"
#include "../macroInt.h"
#include <queue>
#include "../../../extern/Nuked-OPL3/opl3.h"
#include "../../../extern/opl/opl3.h"
class DivPlatformOPL: public DivDispatch {
protected: