From caa6f3091da1a3f8bbcd2771284ef9c9578092c1 Mon Sep 17 00:00:00 2001 From: MooingLemur Date: Sat, 31 Aug 2024 11:05:34 -0700 Subject: [PATCH] ZSM: exclude keydown events on loop lookahead --- src/engine/export/zsm.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/export/zsm.cpp b/src/engine/export/zsm.cpp index 81c5021a0..d5786edd9 100644 --- a/src/engine/export/zsm.cpp +++ b/src/engine/export/zsm.cpp @@ -674,7 +674,10 @@ void DivExportZSM::run() { if (writes.size()>0) logD("zsmOps: Writing %d messages to chip %d",writes.size(),i); for (DivRegWrite& write: writes) { - if (i==YM) zsm.writeYM(write.addr&0xff,write.val); + if (i==YM) { + if (done && write.addr==0x08 && (write.val&0x78)>0) continue; // don't process keydown on lookahead + zsm.writeYM(write.addr&0xff,write.val); + } if (i==VERA) { if (done && write.addr>=64) continue; // don't process any PCM or sync events on the loop lookahead zsm.writePSG(write.addr&0xff,write.val);