mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +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;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
chan[c.chan].chVolL=((c.value>>4)==1);
|
||||
chan[c.chan].chVolR=((c.value&15)==1);
|
||||
chan[c.chan].chVolL=((c.value>>4)>0);
|
||||
chan[c.chan].chVolR=((c.value&15)>0);
|
||||
if (isMuted[c.chan]) {
|
||||
rWrite(chanOffs[c.chan]+ADDR_LR_FB_ALG,(chan[c.chan].state.alg&7)|(chan[c.chan].state.fb<<3));
|
||||
} else {
|
||||
|
|
|
@ -340,6 +340,7 @@ int DivPlatformGB::dispatch(DivCommand c) {
|
|||
case DIV_CMD_PANNING: {
|
||||
lastPan&=~(0x11<<c.chan);
|
||||
if (c.value==0) c.value=0x11;
|
||||
c.value=((c.value&15)>0)|(((c.value>>4)>0)<<4)
|
||||
lastPan|=c.value<<c.chan;
|
||||
rWrite(0x25,procMute());
|
||||
break;
|
||||
|
|
|
@ -590,16 +590,10 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
chan[c.chan].ins=c.value;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
switch (c.value) {
|
||||
case 0x01:
|
||||
chan[c.chan].pan=1;
|
||||
break;
|
||||
case 0x10:
|
||||
chan[c.chan].pan=2;
|
||||
break;
|
||||
default:
|
||||
if (c.value==0) {
|
||||
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));
|
||||
break;
|
||||
|
|
|
@ -106,16 +106,10 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
|
|||
opChan[ch].ins=c.value;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
switch (c.value) {
|
||||
case 0x01:
|
||||
opChan[ch].pan=1;
|
||||
break;
|
||||
case 0x10:
|
||||
opChan[ch].pan=2;
|
||||
break;
|
||||
default:
|
||||
if (c.value==0) {
|
||||
opChan[ch].pan=3;
|
||||
break;
|
||||
} else {
|
||||
opChan[ch].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||
}
|
||||
// TODO: ???
|
||||
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;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
switch (c.value) {
|
||||
case 0x01:
|
||||
chan[c.chan].pan=1;
|
||||
break;
|
||||
case 0x10:
|
||||
chan[c.chan].pan=2;
|
||||
break;
|
||||
default:
|
||||
if (c.value==0) {
|
||||
chan[c.chan].pan=3;
|
||||
break;
|
||||
} else {
|
||||
chan[c.chan].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||
}
|
||||
if (c.chan>12) {
|
||||
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;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
switch (c.value) {
|
||||
case 0x01:
|
||||
chan[c.chan].pan=1;
|
||||
break;
|
||||
case 0x10:
|
||||
chan[c.chan].pan=2;
|
||||
break;
|
||||
default:
|
||||
if (c.value==0) {
|
||||
chan[c.chan].pan=3;
|
||||
break;
|
||||
} else {
|
||||
chan[c.chan].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
|
||||
}
|
||||
if (c.chan>14) {
|
||||
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;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
switch (c.value) {
|
||||
case 0x01:
|
||||
opChan[ch].pan=1;
|
||||
break;
|
||||
case 0x10:
|
||||
opChan[ch].pan=2;
|
||||
break;
|
||||
default:
|
||||
if (c.value==0) {
|
||||
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);
|
||||
// TODO: ???
|
||||
|
|
|
@ -97,16 +97,10 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
|
|||
opChan[ch].ins=c.value;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
switch (c.value) {
|
||||
case 0x01:
|
||||
opChan[ch].pan=1;
|
||||
break;
|
||||
case 0x10:
|
||||
opChan[ch].pan=2;
|
||||
break;
|
||||
default:
|
||||
if (c.value==0) {
|
||||
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);
|
||||
// TODO: ???
|
||||
|
|
Loading…
Reference in a new issue