From 681c1d9fd7e6bf50ce93b1770d43503b40527c04 Mon Sep 17 00:00:00 2001 From: MooingLemur Date: Fri, 11 Aug 2023 14:55:52 -0700 Subject: [PATCH] implement requested changes --- src/engine/zsm.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/zsm.cpp b/src/engine/zsm.cpp index 14e823040..2776379a0 100644 --- a/src/engine/zsm.cpp +++ b/src/engine/zsm.cpp @@ -67,7 +67,7 @@ void DivZSM::init(unsigned int rate) { ymMask=0; psgMask=0; // Optimize writes - optimize=false; + optimize=true; } int DivZSM::getoffset() { @@ -213,7 +213,7 @@ void DivZSM::setLoopPoint() { } void DivZSM::setOptimize(bool o) { - optimize = o; + optimize=o; } SafeWriter* DivZSM::finish() { @@ -284,8 +284,8 @@ void DivZSM::flushWrites() { // if optimize=true, suppress writes to PSG voices that are not audible (volume=0 or R+L=0) // ZSMKit has a feature that can benefit from having silent channels // updated, so this is something that can be toggled off or on for export - if (optimize && i%4!=2 && (psgState[psg_NEW][(i&0x3c)+2]&0x3f)==0) continue; // vol - if (optimize && i%4!=2 && (psgState[psg_NEW][(i&0x3c)+2]&0xc0)==0) continue; // R+L + if (optimize && (i&3)!=2 && (psgState[psg_NEW][(i&0x3c)+2]&0x3f)==0) continue; // vol + if (optimize && (i&3)!=2 && (psgState[psg_NEW][(i&0x3c)+2]&0xc0)==0) continue; // R+L psgState[psg_PREV][i]=psgState[psg_NEW][i]; w->writeC(i); w->writeC(psgState[psg_NEW][i]);