From 0371c20d3215a1c03a73cc5256c31780c24e9fa6 Mon Sep 17 00:00:00 2001 From: zilmar Date: Mon, 5 Sep 2022 11:00:15 +0930 Subject: [PATCH] Core: Use BreakOnUnhandledMemory in SPRegistersHandler when breaking --- .../N64System/MemoryHandler/SPRegistersHandler.cpp | 10 +++++----- .../Project64-core/N64System/Mips/MemoryVirtualMem.cpp | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Source/Project64-core/N64System/MemoryHandler/SPRegistersHandler.cpp b/Source/Project64-core/N64System/MemoryHandler/SPRegistersHandler.cpp index 476ed3112..b89782ce2 100644 --- a/Source/Project64-core/N64System/MemoryHandler/SPRegistersHandler.cpp +++ b/Source/Project64-core/N64System/MemoryHandler/SPRegistersHandler.cpp @@ -53,7 +53,7 @@ bool SPRegistersHandler::Read32(uint32_t Address, uint32_t & Value) case 0x04080000: Value = SP_PC_REG; break; default: Value = 0; - if (HaveDebugger()) + if (BreakOnUnhandledMemory()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -73,7 +73,7 @@ bool SPRegistersHandler::Read32(uint32_t Address, uint32_t & Value) case 0x0404001C: LogMessage("%08X: read from SP_SEMAPHORE_REG (%08X)", m_PC, Value); break; case 0x04080000: LogMessage("%08X: read from SP_PC (%08X)", m_PC, Value); break; default: - if (HaveDebugger()) + if (BreakOnUnhandledMemory()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -98,7 +98,7 @@ bool SPRegistersHandler::Write32(uint32_t Address, uint32_t Value, uint32_t Mask case 0x0404001C: LogMessage("%08X: Writing 0x%08X (Mask: 0x%08X) to SP_SEMAPHORE_REG", m_PC, Value, Mask); break; case 0x04080000: LogMessage("%08X: Writing 0x%08X (Mask: 0x%08X) to SP_PC", m_PC, Value, Mask); break; default: - if (HaveDebugger()) + if (BreakOnUnhandledMemory()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -128,7 +128,7 @@ bool SPRegistersHandler::Write32(uint32_t Address, uint32_t Value, uint32_t Mask m_RspIntrReg &= ~MI_INTR_SP; m_Reg.CheckInterrupts(); } - if ((MaskedValue & SP_SET_INTR) != 0) { if (HaveDebugger()) { g_Notify->DisplayError("SP_SET_INTR"); } } + if ((MaskedValue & SP_SET_INTR) != 0) { if (BreakOnUnhandledMemory()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } if ((MaskedValue & SP_CLR_SSTEP) != 0) { SP_STATUS_REG &= ~SP_STATUS_SSTEP; } if ((MaskedValue & SP_SET_SSTEP) != 0) { SP_STATUS_REG |= SP_STATUS_SSTEP; } if ((MaskedValue & SP_CLR_INTR_BREAK) != 0) { SP_STATUS_REG &= ~SP_STATUS_INTR_BREAK; } @@ -159,7 +159,7 @@ bool SPRegistersHandler::Write32(uint32_t Address, uint32_t Value, uint32_t Mask case 0x0404001C: SP_SEMAPHORE_REG = 0; break; case 0x04080000: SP_PC_REG = MaskedValue & 0xFFC; break; default: - if (HaveDebugger()) + if (BreakOnUnhandledMemory()) { g_Notify->BreakPoint(__FILE__, __LINE__); } diff --git a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp index 90879d403..93d3d9e6d 100755 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp @@ -646,7 +646,10 @@ bool CMipsMemoryVM::LH_NonMemory(uint32_t VAddr, uint16_t & Value) } else { - g_Notify->BreakPoint(__FILE__, __LINE__); + if (BreakOnUnhandledMemory()) + { + g_Notify->BreakPoint(__FILE__, __LINE__); + } Value = 0; } return true;