fix 601x-604x

This commit is contained in:
tildearrow 2024-08-28 17:07:05 -05:00
parent 62842fbb39
commit 87b172015c
6 changed files with 84 additions and 6 deletions

View file

@ -762,7 +762,20 @@ int DivPlatformArcade::dispatch(DivCommand c) {
break; break;
} }
case DIV_CMD_FM_OPMASK: case DIV_CMD_FM_OPMASK:
chan[c.chan].opMask=c.value&15; switch (c.value>>4) {
case 1:
case 2:
case 3:
case 4:
chan[c.chan].opMask&=~(1<<((c.value>>4)-1));
if (c.value&15) {
chan[c.chan].opMask|=(1<<((c.value>>4)-1));
}
break;
default:
chan[c.chan].opMask=c.value&15;
break;
}
if (chan[c.chan].active) { if (chan[c.chan].active) {
chan[c.chan].opMaskChanged=true; chan[c.chan].opMaskChanged=true;
} }

View file

@ -1465,7 +1465,20 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
} }
case DIV_CMD_FM_OPMASK: case DIV_CMD_FM_OPMASK:
if (c.chan>=psgChanOffs) break; if (c.chan>=psgChanOffs) break;
chan[c.chan].opMask=c.value&15; switch (c.value>>4) {
case 1:
case 2:
case 3:
case 4:
chan[c.chan].opMask&=~(1<<((c.value>>4)-1));
if (c.value&15) {
chan[c.chan].opMask|=(1<<((c.value>>4)-1));
}
break;
default:
chan[c.chan].opMask=c.value&15;
break;
}
if (chan[c.chan].active) { if (chan[c.chan].active) {
chan[c.chan].opMaskChanged=true; chan[c.chan].opMaskChanged=true;
} }

View file

@ -1006,7 +1006,20 @@ int DivPlatformYM2203::dispatch(DivCommand c) {
} }
case DIV_CMD_FM_OPMASK: case DIV_CMD_FM_OPMASK:
if (c.chan>=psgChanOffs) break; if (c.chan>=psgChanOffs) break;
chan[c.chan].opMask=c.value&15; switch (c.value>>4) {
case 1:
case 2:
case 3:
case 4:
chan[c.chan].opMask&=~(1<<((c.value>>4)-1));
if (c.value&15) {
chan[c.chan].opMask|=(1<<((c.value>>4)-1));
}
break;
default:
chan[c.chan].opMask=c.value&15;
break;
}
if (chan[c.chan].active) { if (chan[c.chan].active) {
chan[c.chan].opMaskChanged=true; chan[c.chan].opMaskChanged=true;
} }

View file

@ -1539,7 +1539,20 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
} }
case DIV_CMD_FM_OPMASK: case DIV_CMD_FM_OPMASK:
if (c.chan>=psgChanOffs) break; if (c.chan>=psgChanOffs) break;
chan[c.chan].opMask=c.value&15; switch (c.value>>4) {
case 1:
case 2:
case 3:
case 4:
chan[c.chan].opMask&=~(1<<((c.value>>4)-1));
if (c.value&15) {
chan[c.chan].opMask|=(1<<((c.value>>4)-1));
}
break;
default:
chan[c.chan].opMask=c.value&15;
break;
}
if (chan[c.chan].active) { if (chan[c.chan].active) {
chan[c.chan].opMaskChanged=true; chan[c.chan].opMaskChanged=true;
} }

View file

@ -1509,7 +1509,20 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
} }
case DIV_CMD_FM_OPMASK: case DIV_CMD_FM_OPMASK:
if (c.chan>=psgChanOffs) break; if (c.chan>=psgChanOffs) break;
chan[c.chan].opMask=c.value&15; switch (c.value>>4) {
case 1:
case 2:
case 3:
case 4:
chan[c.chan].opMask&=~(1<<((c.value>>4)-1));
if (c.value&15) {
chan[c.chan].opMask|=(1<<((c.value>>4)-1));
}
break;
default:
chan[c.chan].opMask=c.value&15;
break;
}
if (chan[c.chan].active) { if (chan[c.chan].active) {
chan[c.chan].opMaskChanged=true; chan[c.chan].opMaskChanged=true;
} }

View file

@ -1578,7 +1578,20 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
} }
case DIV_CMD_FM_OPMASK: case DIV_CMD_FM_OPMASK:
if (c.chan>=psgChanOffs) break; if (c.chan>=psgChanOffs) break;
chan[c.chan].opMask=c.value&15; switch (c.value>>4) {
case 1:
case 2:
case 3:
case 4:
chan[c.chan].opMask&=~(1<<((c.value>>4)-1));
if (c.value&15) {
chan[c.chan].opMask|=(1<<((c.value>>4)-1));
}
break;
default:
chan[c.chan].opMask=c.value&15;
break;
}
if (chan[c.chan].active) { if (chan[c.chan].active) {
chan[c.chan].opMaskChanged=true; chan[c.chan].opMaskChanged=true;
} }