From 13c90eb542e934931fc874c4f455e63e3fc745c5 Mon Sep 17 00:00:00 2001 From: drmortalwombat <90205530+drmortalwombat@users.noreply.github.com> Date: Fri, 6 Jun 2025 20:00:38 +0200 Subject: [PATCH] Change SIDFX state machine reset --- include/audio/sidfx.c | 7 ++++++- include/audio/sidfx.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/audio/sidfx.c b/include/audio/sidfx.c index c12280b..0dcb631 100644 --- a/include/audio/sidfx.c +++ b/include/audio/sidfx.c @@ -35,6 +35,11 @@ bool sidfx_idle(byte chn) return channels[chn].state == SIDFX_IDLE; } +char sidfx_cnt(byte chn) +{ + return channels[chn].cnt; +} + void sidfx_play(byte chn, const SIDFX * fx, byte cnt) { SIDFXState ns = channels[chn].state; @@ -158,7 +163,7 @@ inline void sidfx_loop_ch(byte ch) channels[ch].cnt--; channels[ch].com = com; channels[ch].priority = com->priority; - if (com->time0) + if (com->time1) channels[ch].state = SIDFX_RESET_0; else channels[ch].state = SIDFX_READY; diff --git a/include/audio/sidfx.h b/include/audio/sidfx.h index 97dbcb9..4777afc 100644 --- a/include/audio/sidfx.h +++ b/include/audio/sidfx.h @@ -20,6 +20,8 @@ inline void sidfx_play(byte chn, const SIDFX * fx, byte cnt); void sidfx_stop(byte chn); +char sidfx_cnt(byte chn); + void sidfx_loop(void); void sidfx_loop_2(void);