port ExtCh op macro code to OPN family, part 6

This commit is contained in:
tildearrow 2022-12-23 19:00:03 -05:00
parent f19472f84a
commit 75416fc63e
4 changed files with 18 additions and 11 deletions

View File

@ -173,11 +173,6 @@ int DivPlatformYM2203Ext::dispatch(DivCommand c) {
immWrite(0x27,extMode?0x40:0);
break;
}
case DIV_CMD_FM_LFO: { // ???
lfoValue=(c.value&7)|((c.value>>4)<<3);
rWrite(0x22,lfoValue);
break;
}
case DIV_CMD_FM_FB: {
chan[2].state.fb=c.value&7;
rWrite(chanOffs[2]+ADDR_FB_ALG,(chan[2].state.alg&7)|(chan[2].state.fb<<3));

View File

@ -950,7 +950,9 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
break;
}
case DIV_CMD_FM_LFO: {
rWrite(0x22,(c.value&7)|((c.value>>4)<<3));
if (c.chan>=6) break;
lfoValue=(c.value&7)|((c.value>>4)<<3);
rWrite(0x22,lfoValue);
break;
}
case DIV_CMD_FM_FB: {
@ -1200,6 +1202,7 @@ void DivPlatformYM2608::forceIns() {
chan[i].freqChanged=true;
}
}
immWrite(0x22,lfoValue);
for (int i=9; i<16; i++) {
chan[i].insChanged=true;
if (i>14) { // ADPCM-B
@ -1276,6 +1279,7 @@ void DivPlatformYM2608::reset() {
}
lastBusy=60;
lfoValue=8;
sampleBank=0;
writeRSSOff=0;
writeRSSOn=0;
@ -1286,7 +1290,7 @@ void DivPlatformYM2608::reset() {
extMode=false;
// LFO
immWrite(0x22,0x08);
immWrite(0x22,lfoValue);
// PCM volume
immWrite(0x11,globalRSSVolume); // A

View File

@ -930,7 +930,9 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
break;
}
case DIV_CMD_FM_LFO: {
rWrite(0x22,(c.value&7)|((c.value>>4)<<3));
if (c.chan>=psgChanOffs) break;
lfoValue=(c.value&7)|((c.value>>4)<<3);
rWrite(0x22,lfoValue);
break;
}
case DIV_CMD_FM_FB: {
@ -1173,6 +1175,7 @@ void DivPlatformYM2610::forceIns() {
chan[i].freqChanged=true;
}
}
immWrite(0x22,lfoValue);
for (int i=adpcmAChanOffs; i<=adpcmBChanOffs; i++) {
chan[i].insChanged=true;
}
@ -1247,6 +1250,7 @@ void DivPlatformYM2610::reset() {
}
lastBusy=60;
lfoValue=8;
sampleBank=0;
DivPlatformYM2610Base::reset();
@ -1255,7 +1259,7 @@ void DivPlatformYM2610::reset() {
extMode=false;
// LFO
immWrite(0x22,0x08);
immWrite(0x22,lfoValue);
// PCM volume
immWrite(0x101,globalADPCMAVolume); // A

View File

@ -993,7 +993,9 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
break;
}
case DIV_CMD_FM_LFO: {
rWrite(0x22,(c.value&7)|((c.value>>4)<<3));
if (c.chan>=psgChanOffs) break;
lfoValue=(c.value&7)|((c.value>>4)<<3);
rWrite(0x22,lfoValue);
break;
}
case DIV_CMD_FM_FB: {
@ -1236,6 +1238,7 @@ void DivPlatformYM2610B::forceIns() {
chan[i].freqChanged=true;
}
}
immWrite(0x22,lfoValue);
for (int i=adpcmAChanOffs; i<=adpcmBChanOffs; i++) {
chan[i].insChanged=true;
}
@ -1310,6 +1313,7 @@ void DivPlatformYM2610B::reset() {
}
lastBusy=60;
lfoValue=8;
sampleBank=0;
DivPlatformYM2610Base::reset();
@ -1318,7 +1322,7 @@ void DivPlatformYM2610B::reset() {
extMode=false;
// LFO
immWrite(0x22,0x08);
immWrite(0x22,lfoValue);
// PCM volume
immWrite(0x101,0x3f); // A