From 3eaac7029135800942e147edaec9806dd7a489b7 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Wed, 2 Jul 2025 21:22:53 -0500 Subject: [PATCH] interpreter: increase keyon delay --- Makefile | 2 +- src/interpreter.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index dc39c65..7c1915a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all: xm_player.elf -OPT = -O2 +OPT = -O1 MAKEFILE_PATH := $(patsubst %/,%,$(dir $(abspath $(firstword $(MAKEFILE_LIST))))) LIB ?= $(MAKEFILE_PATH)/dreamcast diff --git a/src/interpreter.cpp b/src/interpreter.cpp index cbaec2f..89ef1cd 100644 --- a/src/interpreter.cpp +++ b/src/interpreter.cpp @@ -249,10 +249,12 @@ void interrupt() break; } */ - if (state.channel[ch].keyon == 255) { - wait(); aica_sound.channel[ch].KYONB(1); + if (state.channel[ch].keyon > 128) { state.channel[ch].keyon -= 1; } + if (state.channel[ch].keyon == 128) { + wait(); aica_sound.channel[ch].KYONB(1); + } } wait(); aica_sound.channel[0].KYONEX(1); @@ -261,7 +263,7 @@ void interrupt() } for (int ch = 0; ch < 64; ch++) { int keyon = state.channel[ch].keyon; - if (keyon != 255 && keyon != 0) { + if (keyon < 128 && keyon != 0) { state.channel[ch].keyon -= 1; } }