From 2380c2f4ea07c190b5be625bed8b250870077219 Mon Sep 17 00:00:00 2001 From: StapleButter Date: Thu, 13 Apr 2017 04:16:57 +0200 Subject: [PATCH] hopefully fix the DMA bug without breaking everything this time. --- src/ARM.cpp | 6 +++++- src/ARM.h | 1 + src/NDS.cpp | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ARM.cpp b/src/ARM.cpp index 5cd5d855..6bed1b53 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -325,7 +325,11 @@ s32 ARM::Execute() { if (Halted) { - if (NDS::HaltInterrupted(Num)) + if (Halted == 2) + { + Halted = 0; + } + else if (NDS::HaltInterrupted(Num)) { Halted = 0; if (NDS::IME[Num]&1) diff --git a/src/ARM.h b/src/ARM.h index 79c2bce3..3631f86c 100644 --- a/src/ARM.h +++ b/src/ARM.h @@ -43,6 +43,7 @@ public: void Halt(u32 halt) { + if (halt==2 && Halted==1) return; Halted = halt; } diff --git a/src/NDS.cpp b/src/NDS.cpp index ac28f74d..98eda419 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -561,12 +561,12 @@ void StopCPU(u32 cpu, u32 mask) if (cpu) { CPUStop |= (mask << 16); - //ARM7->Halt(2); + ARM7->Halt(2); } else { CPUStop |= mask; - //ARM9->Halt(2); + ARM9->Halt(2); } }