From c7ee0ce6421983757c9107e7a07a66789e387c61 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 25 Jan 2022 16:52:55 -0500 Subject: [PATCH] save my register writes --- src/engine/platform/sms.cpp | 11 ++++++++++- src/engine/platform/sms.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index 5dc5aeac7..ec0286da4 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -4,7 +4,7 @@ #define FREQ_BASE 1712.0f -#define rWrite(v) {sn->write(v); if (dumpWrites) {addWrite(0x200,v);} } +#define rWrite(v) {if (!skipRegisterWrites) {sn->write(v); if (dumpWrites) {addWrite(0x200,v);}}} void DivPlatformSMS::acquire(short* bufL, short* bufR, size_t start, size_t len) { sn->sound_stream_update(bufL+start,len); @@ -178,6 +178,15 @@ void DivPlatformSMS::muteChannel(int ch, bool mute) { if (chan[ch].active) rWrite(0x90|ch<<5|(isMuted[ch]?15:(15-(chan[ch].outVol&15)))); } +void DivPlatformSMS::forceIns() { + for (int i=0; i<4; i++) { + if (chan[i].active) { + chan[i].insChanged=true; + chan[i].freqChanged=true; + } + } +} + void DivPlatformSMS::reset() { for (int i=0; i<4; i++) { chan[i]=DivPlatformSMS::Channel(); diff --git a/src/engine/platform/sms.h b/src/engine/platform/sms.h index 01dad852b..5dc754119 100644 --- a/src/engine/platform/sms.h +++ b/src/engine/platform/sms.h @@ -36,6 +36,7 @@ class DivPlatformSMS: public DivDispatch { void acquire(short* bufL, short* bufR, size_t start, size_t len); int dispatch(DivCommand c); void reset(); + void forceIns(); void tick(); void muteChannel(int ch, bool mute); bool keyOffAffectsArp(int ch);