OPL: some fixes
This commit is contained in:
parent
219c5a0522
commit
4c5c4a647b
|
@ -481,6 +481,10 @@ void DivPlatformOPL::muteChannel(int ch, bool mute) {
|
||||||
int DivPlatformOPL::dispatch(DivCommand c) {
|
int DivPlatformOPL::dispatch(DivCommand c) {
|
||||||
// TODO: drums mode!
|
// TODO: drums mode!
|
||||||
if (c.chan>=melodicChans) return 0;
|
if (c.chan>=melodicChans) return 0;
|
||||||
|
// ineffective in 4-op mode
|
||||||
|
if (oplType==3 && c.chan<14 && (c.chan&1) && c.cmd!=DIV_CMD_GET_VOLMAX && c.cmd!=DIV_ALWAYS_SET_VOLUME) {
|
||||||
|
if (chan[c.chan-1].fourOp) return 0;
|
||||||
|
}
|
||||||
switch (c.cmd) {
|
switch (c.cmd) {
|
||||||
case DIV_CMD_NOTE_ON: {
|
case DIV_CMD_NOTE_ON: {
|
||||||
DivInstrument* ins=parent->getIns(chan[c.chan].ins);
|
DivInstrument* ins=parent->getIns(chan[c.chan].ins);
|
||||||
|
@ -589,6 +593,9 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_CMD_GET_VOLUME: {
|
case DIV_CMD_GET_VOLUME: {
|
||||||
|
if (pretendYMU) {
|
||||||
|
return pow(((double)chan[c.chan].vol/63.0),2.0)*127.0;
|
||||||
|
}
|
||||||
return chan[c.chan].vol;
|
return chan[c.chan].vol;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -599,6 +606,7 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
||||||
chan[c.chan].ins=c.value;
|
chan[c.chan].ins=c.value;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PANNING: {
|
case DIV_CMD_PANNING: {
|
||||||
|
if (oplType!=3) break;
|
||||||
if (c.value==0) {
|
if (c.value==0) {
|
||||||
chan[c.chan].pan=3;
|
chan[c.chan].pan=3;
|
||||||
} else {
|
} else {
|
||||||
|
@ -616,7 +624,6 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
||||||
rWrite(chanMap[c.chan+1]+ADDR_LR_FB_ALG,((chan[c.chan].state.alg>>1)&1)|(chan[c.chan].state.fb<<1)|((chan[c.chan].pan&3)<<4));
|
rWrite(chanMap[c.chan+1]+ADDR_LR_FB_ALG,((chan[c.chan].state.alg>>1)&1)|(chan[c.chan].state.fb<<1)|((chan[c.chan].pan&3)<<4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//rWrite(chanOffs[c.chan]+ADDR_LRAF,(isMuted[c.chan]?0:(chan[c.chan].pan<<6))|(chan[c.chan].state.fms&7)|((chan[c.chan].state.ams&3)<<4));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DIV_CMD_PITCH: {
|
case DIV_CMD_PITCH: {
|
||||||
|
@ -739,6 +746,8 @@ int DivPlatformOPL::dispatch(DivCommand c) {
|
||||||
void DivPlatformOPL::forceIns() {
|
void DivPlatformOPL::forceIns() {
|
||||||
for (int i=0; i<melodicChans; i++) {
|
for (int i=0; i<melodicChans; i++) {
|
||||||
int ops=(slots[3][i]!=255 && chan[i].state.ops==4 && oplType==3)?4:2;
|
int ops=(slots[3][i]!=255 && chan[i].state.ops==4 && oplType==3)?4:2;
|
||||||
|
chan[i].insChanged=true;
|
||||||
|
chan[i].freqChanged=true;
|
||||||
chan[i].fourOp=(ops==4);
|
chan[i].fourOp=(ops==4);
|
||||||
for (int j=0; j<ops; j++) {
|
for (int j=0; j<ops; j++) {
|
||||||
unsigned char slot=slots[j][i];
|
unsigned char slot=slots[j][i];
|
||||||
|
@ -839,11 +848,11 @@ bool DivPlatformOPL::isStereo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivPlatformOPL::keyOffAffectsArp(int ch) {
|
bool DivPlatformOPL::keyOffAffectsArp(int ch) {
|
||||||
return (ch>5);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivPlatformOPL::keyOffAffectsPorta(int ch) {
|
bool DivPlatformOPL::keyOffAffectsPorta(int ch) {
|
||||||
return (ch>5);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformOPL::notifyInsChange(int ins) {
|
void DivPlatformOPL::notifyInsChange(int ins) {
|
||||||
|
|
Loading…
Reference in New Issue