From f09c97336ed5b917c1018d295cae5b1c86c91cda Mon Sep 17 00:00:00 2001 From: ekeeke Date: Wed, 21 Feb 2024 20:25:04 +0100 Subject: [PATCH] [Core/CD] added clear of CDC decoder interrupt pending flag when decoding is disabled (verified on real hardware, cf. Krikzz's mcd-verificator) --- core/cd_hw/cdc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/cd_hw/cdc.c b/core/cd_hw/cdc.c index fb30e53..20a9dcc 100644 --- a/core/cd_hw/cdc.c +++ b/core/cd_hw/cdc.c @@ -680,6 +680,16 @@ void cdc_reg_w(unsigned char data) /* set CRCOK bit only if decoding is enabled */ cdc.stat[0] = data & BIT_DECEN; + /* decoding disabled ? */ + if (!(data & BIT_DECEN)) + { + /* clear pending decoder interrupt */ + cdc.ifstat |= BIT_DECI; + + /* update CDC IRQ state */ + cdc.irq &= ~BIT_DECI; + } + /* update STAT2 register */ if (data & BIT_AUTORQ) {