From ea49c760c58b826c5d0a5b70bc08810a12b28d08 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 24 Mar 2022 04:53:09 -0500 Subject: [PATCH] OPLL: part 1 of fixing drum volumes --- src/engine/platform/opll.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/opll.cpp b/src/engine/platform/opll.cpp index 4f21ba21..fc19daf6 100644 --- a/src/engine/platform/opll.cpp +++ b/src/engine/platform/opll.cpp @@ -651,6 +651,7 @@ int DivPlatformOPLL::dispatch(DivCommand c) { void DivPlatformOPLL::forceIns() { for (int i=0; i<9; i++) { + if (i>=6 && properDrums) continue; // update custom preset if (chan[i].state.opllPreset==0 && i==lastCustomMemory) { DivInstrumentFM::Operator& mod=chan[i].state.op[0]; @@ -675,7 +676,7 @@ void DivPlatformOPLL::forceIns() { } } } - if (drums) { + if (drums) { // WHAT?! FIX THIS! immWrite(0x16,0x20); immWrite(0x26,0x05); immWrite(0x16,0x20); @@ -687,6 +688,12 @@ void DivPlatformOPLL::forceIns() { immWrite(0x18,0xC0); immWrite(0x28,0x01); } + // UNTESTED + if (properDrums) { + rWrite(0x36,drumVol[0]); + rWrite(0x37,drumVol[1]|(drumVol[4]<<4)); + rWrite(0x38,drumVol[3]|(drumVol[2]<<4)); + } drumState=0; }