OPL: proper frequency on OPL1/2
This commit is contained in:
parent
2d922d5e09
commit
1bc8bc8746
|
@ -25,7 +25,7 @@
|
||||||
#define rWrite(a,v) if (!skipRegisterWrites) {pendingWrites[a]=v;}
|
#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 immWrite(a,v) if (!skipRegisterWrites) {writes.emplace(a,v); if (dumpWrites) {addWrite(a,v);} }
|
||||||
|
|
||||||
#define CHIP_FREQBASE 9440540
|
#define CHIP_FREQBASE chipFreqBase
|
||||||
|
|
||||||
// N = invalid
|
// N = invalid
|
||||||
#define N 255
|
#define N 255
|
||||||
|
@ -456,9 +456,11 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
||||||
chan[c.chan].outVol=chan[c.chan].vol;
|
chan[c.chan].outVol=chan[c.chan].vol;
|
||||||
}
|
}
|
||||||
if (chan[c.chan].insChanged) {
|
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<ops; i++) {
|
for (int i=0; i<ops; i++) {
|
||||||
unsigned short baseAddr=slotMap[slots[i][c.chan]];
|
unsigned char slot=slots[i][c.chan];
|
||||||
|
if (slot==255) continue;
|
||||||
|
unsigned short baseAddr=slotMap[slot];
|
||||||
DivInstrumentFM::Operator& op=chan[c.chan].state.op[(ops==4)?orderedOpsL[i]:i];
|
DivInstrumentFM::Operator& op=chan[c.chan].state.op[(ops==4)?orderedOpsL[i]:i];
|
||||||
|
|
||||||
if (isMuted[c.chan]) {
|
if (isMuted[c.chan]) {
|
||||||
|
@ -812,12 +814,14 @@ void DivPlatformOPL::setOPLType(int type, bool drums) {
|
||||||
slotsDrums=slotsOPL2Drums;
|
slotsDrums=slotsOPL2Drums;
|
||||||
slots=drums?slotsDrums:slotsNonDrums;
|
slots=drums?slotsDrums:slotsNonDrums;
|
||||||
chanMap=chanMapOPL2;
|
chanMap=chanMapOPL2;
|
||||||
|
chipFreqBase=9440540*0.25;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
slotsNonDrums=slotsOPL3;
|
slotsNonDrums=slotsOPL3;
|
||||||
slotsDrums=slotsOPL3Drums;
|
slotsDrums=slotsOPL3Drums;
|
||||||
slots=drums?slotsDrums:slotsNonDrums;
|
slots=drums?slotsDrums:slotsNonDrums;
|
||||||
chanMap=chanMapOPL3;
|
chanMap=chanMapOPL3;
|
||||||
|
chipFreqBase=9440540;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
oplType=type;
|
oplType=type;
|
||||||
|
|
|
@ -68,6 +68,7 @@ class DivPlatformOPL: public DivDispatch {
|
||||||
const unsigned char** slotsDrums;
|
const unsigned char** slotsDrums;
|
||||||
const unsigned char** slots;
|
const unsigned char** slots;
|
||||||
const unsigned short* chanMap;
|
const unsigned short* chanMap;
|
||||||
|
double chipFreqBase;
|
||||||
int delay, oplType;
|
int delay, oplType;
|
||||||
unsigned char lastBusy;
|
unsigned char lastBusy;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue