From 519bf244b91f8f93f4d9a4331f41363496e292ac Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 23 May 2022 00:07:32 -0500 Subject: [PATCH] OPL: fix kick volume in drums mode --- src/engine/platform/opl.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 312a4d135..867c14019 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -352,7 +352,7 @@ void DivPlatformOPL::tick(bool sysTick) { if (isMuted[i]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[i].state.alg][j] || i>=melodicChans) { + if (isOutputL[ops==4][chan[i].state.alg][j] || i>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[i].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -479,7 +479,7 @@ void DivPlatformOPL::tick(bool sysTick) { if (isMuted[i]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[i].state.alg][j] || i>=melodicChans) { + if (isOutputL[ops==4][chan[i].state.alg][j] || i>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[i].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -688,7 +688,7 @@ void DivPlatformOPL::muteChannel(int ch, bool mute) { if (isMuted[ch]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[ch].state.alg][i] || ch>=melodicChans) { + if (isOutputL[ops==4][chan[ch].state.alg][i] || ch>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[ch].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -808,7 +808,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { if (isMuted[c.chan]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[c.chan].state.alg][i] || c.chan>=melodicChans) { + if (isOutputL[ops==4][chan[c.chan].state.alg][i] || c.chan>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[c.chan].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -911,7 +911,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { if (isMuted[c.chan]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[c.chan].state.alg][i] || c.chan>=melodicChans) { + if (isOutputL[ops==4][chan[c.chan].state.alg][i] || c.chan>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[c.chan].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -1060,7 +1060,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { if (isMuted[c.chan]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[c.chan].state.alg][c.value] || c.chan>=melodicChans) { + if (isOutputL[ops==4][chan[c.chan].state.alg][c.value] || c.chan>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[c.chan].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -1290,7 +1290,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { if (isMuted[c.chan]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[c.chan].state.alg][i] || c.chan>=melodicChans) { + if (isOutputL[ops==4][chan[c.chan].state.alg][i] || c.chan>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[c.chan].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -1307,7 +1307,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { if (isMuted[c.chan]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[c.chan].state.alg][c.value] || c.chan>=melodicChans) { + if (isOutputL[ops==4][chan[c.chan].state.alg][c.value] || c.chan>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[c.chan].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6)); @@ -1380,7 +1380,7 @@ void DivPlatformOPL::forceIns() { if (isMuted[i]) { rWrite(baseAddr+ADDR_KSL_TL,63|(op.ksl<<6)); } else { - if (isOutputL[ops==4][chan[i].state.alg][j] || i>=melodicChans) { + if (isOutputL[ops==4][chan[i].state.alg][j] || i>melodicChans) { rWrite(baseAddr+ADDR_KSL_TL,(63-(((63-op.tl)*(chan[i].outVol&0x3f))/63))|(op.ksl<<6)); } else { rWrite(baseAddr+ADDR_KSL_TL,op.tl|(op.ksl<<6));