mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 01:35:07 +00:00
YM2151/2610/2612/Game Boy: fix panning - UNTESTED
This commit is contained in:
parent
2bfb84cd1e
commit
3b8388d90c
8 changed files with 30 additions and 65 deletions
|
@ -495,8 +495,8 @@ int DivPlatformArcade::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: {
|
||||||
chan[c.chan].chVolL=((c.value>>4)==1);
|
chan[c.chan].chVolL=((c.value>>4)>0);
|
||||||
chan[c.chan].chVolR=((c.value&15)==1);
|
chan[c.chan].chVolR=((c.value&15)>0);
|
||||||
if (isMuted[c.chan]) {
|
if (isMuted[c.chan]) {
|
||||||
rWrite(chanOffs[c.chan]+ADDR_LR_FB_ALG,(chan[c.chan].state.alg&7)|(chan[c.chan].state.fb<<3));
|
rWrite(chanOffs[c.chan]+ADDR_LR_FB_ALG,(chan[c.chan].state.alg&7)|(chan[c.chan].state.fb<<3));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -340,6 +340,7 @@ int DivPlatformGB::dispatch(DivCommand c) {
|
||||||
case DIV_CMD_PANNING: {
|
case DIV_CMD_PANNING: {
|
||||||
lastPan&=~(0x11<<c.chan);
|
lastPan&=~(0x11<<c.chan);
|
||||||
if (c.value==0) c.value=0x11;
|
if (c.value==0) c.value=0x11;
|
||||||
|
c.value=((c.value&15)>0)|(((c.value>>4)>0)<<4)
|
||||||
lastPan|=c.value<<c.chan;
|
lastPan|=c.value<<c.chan;
|
||||||
rWrite(0x25,procMute());
|
rWrite(0x25,procMute());
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -590,16 +590,10 @@ int DivPlatformGenesis::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: {
|
||||||
switch (c.value) {
|
if (c.value==0) {
|
||||||
case 0x01:
|
|
||||||
chan[c.chan].pan=1;
|
|
||||||
break;
|
|
||||||
case 0x10:
|
|
||||||
chan[c.chan].pan=2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
chan[c.chan].pan=3;
|
chan[c.chan].pan=3;
|
||||||
break;
|
} else {
|
||||||
|
chan[c.chan].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||||
}
|
}
|
||||||
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));
|
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;
|
||||||
|
|
|
@ -106,16 +106,10 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
|
||||||
opChan[ch].ins=c.value;
|
opChan[ch].ins=c.value;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PANNING: {
|
case DIV_CMD_PANNING: {
|
||||||
switch (c.value) {
|
if (c.value==0) {
|
||||||
case 0x01:
|
|
||||||
opChan[ch].pan=1;
|
|
||||||
break;
|
|
||||||
case 0x10:
|
|
||||||
opChan[ch].pan=2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
opChan[ch].pan=3;
|
opChan[ch].pan=3;
|
||||||
break;
|
} else {
|
||||||
|
opChan[ch].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||||
}
|
}
|
||||||
// TODO: ???
|
// TODO: ???
|
||||||
rWrite(chanOffs[2]+0xb4,(opChan[ch].pan<<6)|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4));
|
rWrite(chanOffs[2]+0xb4,(opChan[ch].pan<<6)|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4));
|
||||||
|
|
|
@ -892,16 +892,10 @@ int DivPlatformYM2610::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: {
|
||||||
switch (c.value) {
|
if (c.value==0) {
|
||||||
case 0x01:
|
|
||||||
chan[c.chan].pan=1;
|
|
||||||
break;
|
|
||||||
case 0x10:
|
|
||||||
chan[c.chan].pan=2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
chan[c.chan].pan=3;
|
chan[c.chan].pan=3;
|
||||||
break;
|
} else {
|
||||||
|
chan[c.chan].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||||
}
|
}
|
||||||
if (c.chan>12) {
|
if (c.chan>12) {
|
||||||
immWrite(0x11,isMuted[c.chan]?0:(chan[c.chan].pan<<6));
|
immWrite(0x11,isMuted[c.chan]?0:(chan[c.chan].pan<<6));
|
||||||
|
|
|
@ -955,16 +955,10 @@ int DivPlatformYM2610B::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: {
|
||||||
switch (c.value) {
|
if (c.value==0) {
|
||||||
case 0x01:
|
|
||||||
chan[c.chan].pan=1;
|
|
||||||
break;
|
|
||||||
case 0x10:
|
|
||||||
chan[c.chan].pan=2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
chan[c.chan].pan=3;
|
chan[c.chan].pan=3;
|
||||||
break;
|
} else {
|
||||||
|
chan[c.chan].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||||
}
|
}
|
||||||
if (c.chan>14) {
|
if (c.chan>14) {
|
||||||
immWrite(0x11,isMuted[c.chan]?0:(chan[c.chan].pan<<6));
|
immWrite(0x11,isMuted[c.chan]?0:(chan[c.chan].pan<<6));
|
||||||
|
|
|
@ -97,16 +97,10 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) {
|
||||||
opChan[ch].ins=c.value;
|
opChan[ch].ins=c.value;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PANNING: {
|
case DIV_CMD_PANNING: {
|
||||||
switch (c.value) {
|
if (c.value==0) {
|
||||||
case 0x01:
|
|
||||||
opChan[ch].pan=1;
|
|
||||||
break;
|
|
||||||
case 0x10:
|
|
||||||
opChan[ch].pan=2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
opChan[ch].pan=3;
|
opChan[ch].pan=3;
|
||||||
break;
|
} else {
|
||||||
|
opChan[ch].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||||
}
|
}
|
||||||
DivInstrument* ins=parent->getIns(opChan[ch].ins);
|
DivInstrument* ins=parent->getIns(opChan[ch].ins);
|
||||||
// TODO: ???
|
// TODO: ???
|
||||||
|
|
|
@ -97,16 +97,10 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
|
||||||
opChan[ch].ins=c.value;
|
opChan[ch].ins=c.value;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_PANNING: {
|
case DIV_CMD_PANNING: {
|
||||||
switch (c.value) {
|
if (c.value==0) {
|
||||||
case 0x01:
|
|
||||||
opChan[ch].pan=1;
|
|
||||||
break;
|
|
||||||
case 0x10:
|
|
||||||
opChan[ch].pan=2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
opChan[ch].pan=3;
|
opChan[ch].pan=3;
|
||||||
break;
|
} else {
|
||||||
|
opChan[ch].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||||
}
|
}
|
||||||
DivInstrument* ins=parent->getIns(opChan[ch].ins);
|
DivInstrument* ins=parent->getIns(opChan[ch].ins);
|
||||||
// TODO: ???
|
// TODO: ???
|
||||||
|
|
Loading…
Reference in a new issue