From 8fdcea2e2083d153c3fa729f0df991f434bf246d Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sat, 21 Jan 2023 11:38:58 +0100 Subject: [PATCH] maple: delay raising overrun interrupt when dest isn't in RAM Only raise error when copying data back to RAM. Fixes Cheats 'N Codes Volume 1 --- core/hw/maple/maple_if.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/hw/maple/maple_if.cpp b/core/hw/maple/maple_if.cpp index a518b75c4..7de602f48 100644 --- a/core/hw/maple/maple_if.cpp +++ b/core/hw/maple/maple_if.cpp @@ -164,10 +164,7 @@ static void maple_DoDma() { WARN_LOG(MAPLE, "DMA Error: destination not in system ram: %x", header_2); #endif - asic_RaiseInterrupt(holly_MAPLE_OVERRUN); - SB_MDST = 0; - mapleDmaOut.clear(); - return; + header_2 = 0; } u32* p_data = (u32 *)GetMemPtr(addr + 8, plen * sizeof(u32)); @@ -274,6 +271,11 @@ static int maple_schd(int tag, int c, int j) { for (const auto& pair : mapleDmaOut) { + if (pair.first == 0) + { + asic_RaiseInterrupt(holly_MAPLE_OVERRUN); + continue; + } size_t size = pair.second.size() * sizeof(u32); u32 *p = (u32 *)GetMemPtr(pair.first, size); memcpy(p, pair.second.data(), size);