From f620782919c3b95e15db37bef565fdc9f75e8e0b Mon Sep 17 00:00:00 2001 From: cam900 Date: Sat, 24 Sep 2022 09:27:33 +0900 Subject: [PATCH 1/3] Fix playback issue --- src/engine/platform/msm6295.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index b85bc1a5..925fefed 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -88,21 +88,22 @@ void DivPlatformMSM6295::acquire(short* bufL, short* bufR, size_t start, size_t } void DivPlatformMSM6295::tick(bool sysTick) { - if (parent->song.disableSampleMacro) return; for (int i=0; i<4; i++) { - chan[i].std.next(); - if (chan[i].std.vol.had) { - chan[i].outVol=VOL_SCALE_LOG(chan[i].std.vol.val,chan[i].vol,8); - } - if (chan[i].std.duty.had) { - if (rateSel!=(chan[i].std.duty.val&1)) { - rateSel=chan[i].std.duty.val&1; - rWrite(12,!rateSel); + if (parent->song.disableSampleMacro) { + chan[i].std.next(); + if (chan[i].std.vol.had) { + chan[i].outVol=VOL_SCALE_LOG(chan[i].std.vol.val,chan[i].vol,8); } - } - if (chan[i].std.phaseReset.had) { - if (chan[i].std.phaseReset.val && chan[i].active) { - chan[i].keyOn=true; + if (chan[i].std.duty.had) { + if (rateSel!=(chan[i].std.duty.val&1)) { + rateSel=chan[i].std.duty.val&1; + rWrite(12,!rateSel); + } + } + if (chan[i].std.phaseReset.had) { + if (chan[i].std.phaseReset.val && chan[i].active) { + chan[i].keyOn=true; + } } } if (chan[i].keyOn || chan[i].keyOff) { From 4bf46f9315836eeafccb869f790ec09ad7b7d482 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sat, 24 Sep 2022 09:27:46 +0900 Subject: [PATCH 2/3] Oops --- src/engine/platform/msm6295.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index 925fefed..a898ba15 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -89,7 +89,7 @@ void DivPlatformMSM6295::acquire(short* bufL, short* bufR, size_t start, size_t void DivPlatformMSM6295::tick(bool sysTick) { for (int i=0; i<4; i++) { - if (parent->song.disableSampleMacro) { + if (!parent->song.disableSampleMacro) { chan[i].std.next(); if (chan[i].std.vol.had) { chan[i].outVol=VOL_SCALE_LOG(chan[i].std.vol.val,chan[i].vol,8); From a5fb9b766e8d51dbdf55926c58ad6cef138075bb Mon Sep 17 00:00:00 2001 From: cam900 Date: Sat, 24 Sep 2022 09:28:30 +0900 Subject: [PATCH 3/3] disableSampleMacro for MSM6258 --- src/engine/platform/msm6258.cpp | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/src/engine/platform/msm6258.cpp b/src/engine/platform/msm6258.cpp index 11936618..ded3899e 100644 --- a/src/engine/platform/msm6258.cpp +++ b/src/engine/platform/msm6258.cpp @@ -91,28 +91,30 @@ void DivPlatformMSM6258::acquire(short* bufL, short* bufR, size_t start, size_t void DivPlatformMSM6258::tick(bool sysTick) { for (int i=0; i<1; i++) { - chan[i].std.next(); - if (chan[i].std.duty.had) { - if (rateSel!=(chan[i].std.duty.val&3)) { - rateSel=chan[i].std.duty.val&3; - rWrite(12,rateSel); + if (!parent->song.disableSampleMacro) { + chan[i].std.next(); + if (chan[i].std.duty.had) { + if (rateSel!=(chan[i].std.duty.val&3)) { + rateSel=chan[i].std.duty.val&3; + rWrite(12,rateSel); + } } - } - if (chan[i].std.panL.had) { - if (chan[i].pan!=(chan[i].std.panL.val&3)) { - chan[i].pan=chan[i].std.panL.val&3; - rWrite(2,chan[i].pan); + if (chan[i].std.panL.had) { + if (chan[i].pan!=(chan[i].std.panL.val&3)) { + chan[i].pan=chan[i].std.panL.val&3; + rWrite(2,chan[i].pan); + } } - } - if (chan[i].std.ex1.had) { - if (clockSel!=(chan[i].std.ex1.val&1)) { - clockSel=chan[i].std.ex1.val&1; - rWrite(8,clockSel); + if (chan[i].std.ex1.had) { + if (clockSel!=(chan[i].std.ex1.val&1)) { + clockSel=chan[i].std.ex1.val&1; + rWrite(8,clockSel); + } } - } - if (chan[i].std.phaseReset.had) { - if (chan[i].std.phaseReset.val && chan[i].active) { - chan[i].keyOn=true; + if (chan[i].std.phaseReset.had) { + if (chan[i].std.phaseReset.val && chan[i].active) { + chan[i].keyOn=true; + } } } if (chan[i].keyOn || chan[i].keyOff) {