YM2151/2610/2612/Game Boy: fix panning - UNTESTED

This commit is contained in:
tildearrow 2022-03-06 14:39:20 -05:00
parent 2bfb84cd1e
commit 3b8388d90c
8 changed files with 30 additions and 65 deletions

View file

@ -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 {

View file

@ -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;

View file

@ -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:
chan[c.chan].pan=3;
break;
if (c.value==0) {
chan[c.chan].pan=3;
} 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;

View file

@ -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:
opChan[ch].pan=3;
break;
if (c.value==0) {
opChan[ch].pan=3;
} 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));

View file

@ -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:
chan[c.chan].pan=3;
break;
if (c.value==0) {
chan[c.chan].pan=3;
} 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));

View file

@ -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:
chan[c.chan].pan=3;
break;
if (c.value==0) {
chan[c.chan].pan=3;
} 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));

View file

@ -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:
opChan[ch].pan=3;
break;
if (c.value==0) {
opChan[ch].pan=3;
} else {
opChan[ch].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
}
DivInstrument* ins=parent->getIns(opChan[ch].ins);
// TODO: ???

View file

@ -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:
opChan[ch].pan=3;
break;
if (c.value==0) {
opChan[ch].pan=3;
} else {
opChan[ch].pan=((c.value&15)>0)|(((c.value>>4)>0)<<1);
}
DivInstrument* ins=parent->getIns(opChan[ch].ins);
// TODO: ???