From 89f8c8fa19a274fcd1540a50b474c13128f12615 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 14 Jun 2023 17:35:17 -0500 Subject: [PATCH] OPLL: try to fix vol macro for drums --- src/engine/platform/opll.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/opll.cpp b/src/engine/platform/opll.cpp index 8f30a9dd..d0effd15 100644 --- a/src/engine/platform/opll.cpp +++ b/src/engine/platform/opll.cpp @@ -101,8 +101,17 @@ void DivPlatformOPLL::tick(bool sysTick) { if (chan[i].std.vol.had) { chan[i].outVol=VOL_SCALE_LOG_BROKEN(chan[i].vol,MIN(15,chan[i].std.vol.val),15); - if (i<9) { - rWrite(0x30+i,((15-VOL_SCALE_LOG_BROKEN(chan[i].outVol,15-chan[i].state.op[1].tl,15))&15)|(chan[i].state.opllPreset<<4)); + + if (i>=6 && properDrums) { + drumVol[i-6]=15-chan[i].outVol; + rWrite(0x36,drumVol[0]); + rWrite(0x37,drumVol[1]|(drumVol[4]<<4)); + rWrite(0x38,drumVol[3]|(drumVol[2]<<4)); + break; + } else if (i<6 || !drums) { + if (i<9) { + rWrite(0x30+i,((15-VOL_SCALE_LOG_BROKEN(chan[i].outVol,15-chan[i].state.op[1].tl,15))&15)|(chan[i].state.opllPreset<<4)); + } } }