From cb0b667129c6d975f5ea67cdf0c7c2db6ac1793c Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 17 Aug 2024 17:23:34 +0200 Subject: [PATCH] maple: don't assert dma interrupt if using hardware dma trigger Fixes Virtua Cop 2 pause when shooting. Regression due to ecce915 Issue #474 --- core/hw/maple/maple_if.cpp | 39 +++++++++++++++++--------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/core/hw/maple/maple_if.cpp b/core/hw/maple/maple_if.cpp index 69321e308e..168edeb35f 100644 --- a/core/hw/maple/maple_if.cpp +++ b/core/hw/maple/maple_if.cpp @@ -47,34 +47,29 @@ void maple_vblank() { if (SB_MDEN & 1) { - if (SDCKBOccupied) + if (SB_MDTSEL == 1) { - maple_schd(0, 0, 0, nullptr); - SDCKBOccupied = false; - } - else - { - if (SB_MDTSEL == 1) - { - if (maple_ddt_pending_reset) - { - DEBUG_LOG(MAPLE, "DDT vblank ; reset pending"); - } - else - { - DEBUG_LOG(MAPLE, "DDT vblank"); - SB_MDST = 1; - maple_DoDma(); - // if trigger reset is manual, mark it as pending - if ((SB_MSYS >> 12) & 1) - maple_ddt_pending_reset = true; - } + // Hardware trigger on vblank + if (maple_ddt_pending_reset) { + DEBUG_LOG(MAPLE, "DDT vblank ; reset pending"); } else { - maple_ddt_pending_reset = false; + DEBUG_LOG(MAPLE, "DDT vblank"); + SB_MDST = 1; + maple_DoDma(); + // if trigger reset is manual, mark it as pending + if ((SB_MSYS >> 12) & 1) + maple_ddt_pending_reset = true; } } + else + { + maple_ddt_pending_reset = false; + if (SDCKBOccupied) + maple_schd(0, 0, 0, nullptr); + } + SDCKBOccupied = false; } if (settings.platform.isConsole()) maple_handle_reconnect();