From 2365321d46540dd9ec2a4307b1a38b33304368fe Mon Sep 17 00:00:00 2001 From: MooingLemur Date: Fri, 11 Aug 2023 01:30:45 -0700 Subject: [PATCH] make clear the tuningoffset is okay to overflow --- src/engine/zsmOps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/zsmOps.cpp b/src/engine/zsmOps.cpp index 124847446..c85186253 100644 --- a/src/engine/zsmOps.cpp +++ b/src/engine/zsmOps.cpp @@ -115,7 +115,7 @@ SafeWriter* DivEngine::saveZSM(unsigned int zsmrate, bool loop) { // displaying the entire song held in pitch bend. // Tunings offsets that exceed a half semitone // will simply be represented in a different key - signed char tuningoffset=(signed char)round(3072*(log(song.tuning/440.0)/log(2))); + signed char tuningoffset=(signed char)(round(3072*(log(song.tuning/440.0)/log(2))))&0xff; zsm.writeSync(0x01,tuningoffset); while (!done) {