From 7e1e7bf39b2f3b5037c317eff1b5c6f0271f6b76 Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 16 Jan 2018 08:23:21 +1100 Subject: [PATCH] [Debugger] Change bHaveDebugger to HaveDebugger --- .../Project64-core/MemoryExceptionFilter.cpp | 24 +++--- .../N64System/Interpreter/InterpreterCPU.cpp | 14 ++-- .../N64System/Interpreter/InterpreterOps.cpp | 56 +++++++------- .../Interpreter/InterpreterOps32.cpp | 10 +-- Source/Project64-core/N64System/Mips/Dma.cpp | 12 +-- .../Project64-core/N64System/Mips/Eeprom.cpp | 8 +- .../N64System/Mips/FlashRam.cpp | 14 ++-- .../N64System/Mips/MemoryVirtualMem.cpp | 52 ++++++------- .../N64System/Mips/RegisterClass.cpp | 10 +-- Source/Project64-core/N64System/N64Class.cpp | 2 +- .../Project64-core/N64System/N64RomClass.cpp | 2 +- .../Recompiler/Arm/ArmRecompilerOps.cpp | 74 +++++++++---------- .../N64System/Recompiler/Arm/ArmRegInfo.cpp | 14 ++-- .../Recompiler/x86/x86RecompilerOps.cpp | 20 ++--- .../N64System/Recompiler/x86/x86RegInfo.cpp | 14 ++-- Source/Project64-core/Plugins/PluginBase.cpp | 2 +- Source/Project64-core/Plugins/PluginClass.cpp | 2 +- .../Project64-core/Settings/DebugSettings.cpp | 13 ++-- .../Project64-core/Settings/DebugSettings.h | 6 +- .../UserInterface/Debugger/ScriptInstance.cpp | 3 +- Source/Project64/UserInterface/MainMenu.cpp | 6 +- 21 files changed, 181 insertions(+), 177 deletions(-) diff --git a/Source/Project64-core/MemoryExceptionFilter.cpp b/Source/Project64-core/MemoryExceptionFilter.cpp index 92d91f3f7..88ed5b1b5 100644 --- a/Source/Project64-core/MemoryExceptionFilter.cpp +++ b/Source/Project64-core/MemoryExceptionFilter.cpp @@ -38,7 +38,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex if ((int32_t)(MemAddress) < 0 || MemAddress > 0x1FFFFFFF) { WriteTrace(TraceExceptionHandler, TraceError, "Invalid memory adderess: %X", MemAddress); - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -55,7 +55,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex uint32_t End = Start + *context.Ecx; if ((int32_t)Start < 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -89,7 +89,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex g_Recompiler->ClearRecompCode_Phys(Start & ~0xFFF, 0x1000, CRecompiler::Remove_ProtectedMem); return true; } - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -172,7 +172,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x86: ReadPos += 5; break; case 0x87: ReadPos += 5; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -181,7 +181,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex if (Reg == NULL) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -234,7 +234,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex *context.Eip = (uint32_t)ReadPos; return true; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -268,7 +268,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xC7: if (Reg != context.Eax) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -284,7 +284,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex *context.Eip = (uint32_t)(ReadPos + 2); return true; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -334,7 +334,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xC6: if (Reg != context.Eax) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -352,7 +352,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xC7: if (Reg != context.Eax) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -368,7 +368,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex *context.Eip = (uint32_t)(ReadPos + 4); return true; } - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -837,7 +837,7 @@ int32_t CMipsMemoryVM::MemoryFilter(uint32_t dwExptCode, void * lpExceptionPoint #if defined(_M_IX86) && defined(_WIN32) if (dwExptCode != EXCEPTION_ACCESS_VIOLATION || g_MMU == NULL) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp index 9cd98bba5..c5ee440e7 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterCPU.cpp @@ -97,7 +97,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2) case R4300i_SPECIAL_DDIVU: break; default: - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); } @@ -128,7 +128,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2) case R4300i_COP0_CO_TLBWR: break; case R4300i_COP0_CO_TLBP: break; default: - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?\n6", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); } @@ -137,7 +137,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2) } else { - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?\n7", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); } @@ -166,7 +166,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2) case R4300i_COP1_W: break; case R4300i_COP1_L: break; default: - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); } @@ -214,7 +214,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2) case R4300i_SDC1: break; case R4300i_SD: break; default: - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); } @@ -298,7 +298,7 @@ void CInterpreterCPU::ExecuteCPU() continue; } - if (CDebugSettings::bHaveDebugger() && !g_Debugger->CPUStepStarted()) + if (CDebugSettings::HaveDebugger() && !g_Debugger->CPUStepStarted()) { // Skip command if instructed by the debugger PROGRAM_COUNTER += 4; @@ -316,7 +316,7 @@ void CInterpreterCPU::ExecuteCPU() _GPR[0].DW = 0; /* MIPS $zero hard-wired to 0 */ NextTimer -= CountPerOp; - if (CDebugSettings::bHaveDebugger()) { g_Debugger->CPUStep(); } + if (CDebugSettings::HaveDebugger()) { g_Debugger->CPUStep(); } PROGRAM_COUNTER += 4; switch (R4300iOp::m_NextInstruction) diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp index e75e2dca5..beaf09853 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps.cpp @@ -1239,7 +1239,7 @@ void R4300iOp::SB() uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if (!g_MMU->SB_VAddr(Address, _GPR[m_Opcode.rt].UB[0])) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1259,7 +1259,7 @@ void R4300iOp::SH() } if (!g_MMU->SH_VAddr(Address, _GPR[m_Opcode.rt].UHW[0])) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1279,7 +1279,7 @@ void R4300iOp::SWL() if (!g_MMU->LW_VAddr((Address & ~3), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1295,7 +1295,7 @@ void R4300iOp::SWL() if (!g_MMU->SW_VAddr((Address & ~0x03), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1319,7 +1319,7 @@ void R4300iOp::SW() } if (!g_MMU->SW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1350,7 +1350,7 @@ void R4300iOp::SDL() if (!g_MMU->LD_VAddr((Address & ~7), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1366,7 +1366,7 @@ void R4300iOp::SDL() if (!g_MMU->SD_VAddr((Address & ~7), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1398,7 +1398,7 @@ void R4300iOp::SDR() if (!g_MMU->LD_VAddr((Address & ~7), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1414,7 +1414,7 @@ void R4300iOp::SDR() if (!g_MMU->SD_VAddr((Address & ~7), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1434,7 +1434,7 @@ void R4300iOp::SWR() if (!g_MMU->LW_VAddr((Address & ~3), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1450,7 +1450,7 @@ void R4300iOp::SWR() if (!g_MMU->SW_VAddr((Address & ~0x03), Value)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1542,7 +1542,7 @@ void R4300iOp::LD() } if (!g_MMU->LD_VAddr(Address, _GPR[m_Opcode.rt].UDW)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1571,7 +1571,7 @@ void R4300iOp::LDC1() } if (!g_MMU->LD_VAddr(Address, *(uint64_t *)_FPR_D[m_Opcode.ft])) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1593,7 +1593,7 @@ void R4300iOp::SWC1() if (!g_MMU->SW_VAddr(Address, *(uint32_t *)_FPR_S[m_Opcode.ft])) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1615,7 +1615,7 @@ void R4300iOp::SDC1() } if (!g_MMU->SD_VAddr(Address, *(int64_t *)_FPR_D[m_Opcode.ft])) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1635,7 +1635,7 @@ void R4300iOp::SD() } if (!g_MMU->SD_VAddr(Address, _GPR[m_Opcode.rt].UDW)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1831,7 +1831,7 @@ void R4300iOp::SPECIAL_DDIV() } else { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("DDIV by 0 ???"); } @@ -1847,7 +1847,7 @@ void R4300iOp::SPECIAL_DDIVU() } else { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("DDIVU by 0 ???"); } @@ -1946,7 +1946,7 @@ void R4300iOp::SPECIAL_DSUBU() void R4300iOp::SPECIAL_TEQ() { - if (_GPR[m_Opcode.rs].DW == _GPR[m_Opcode.rt].DW && bHaveDebugger()) + if (_GPR[m_Opcode.rs].DW == _GPR[m_Opcode.rt].DW && HaveDebugger()) { g_Notify->DisplayError("Should trap this ???"); } @@ -2094,7 +2094,7 @@ void R4300iOp::REGIMM_BGEZAL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { if (g_Reg->m_PROGRAM_COUNTER < 0x80000400) { @@ -2188,7 +2188,7 @@ void R4300iOp::COP0_MT() { _CP0[m_Opcode.rd] = _GPR[m_Opcode.rt].UW[0]; } - if ((_CP0[m_Opcode.rd] & 0x18) != 0 && bHaveDebugger()) + if ((_CP0[m_Opcode.rd] & 0x18) != 0 && HaveDebugger()) { g_Notify->DisplayError("Left kernel mode ??"); } @@ -2196,7 +2196,7 @@ void R4300iOp::COP0_MT() break; case 13: //cause _CP0[m_Opcode.rd] &= 0xFFFFCFF; - if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && bHaveDebugger()) + if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && HaveDebugger()) { g_Notify->DisplayError("Set IP0 or IP1"); } @@ -2279,7 +2279,7 @@ void R4300iOp::COP1_CF() TEST_COP1_USABLE_EXCEPTION(); if (m_Opcode.fs != 31 && m_Opcode.fs != 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); } @@ -2315,7 +2315,7 @@ void R4300iOp::COP1_CT() } return; } - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("CTC1 what register are you writing to ?"); } @@ -2580,7 +2580,7 @@ void R4300iOp::COP1_S_CMP() if (_isnan(Temp0) || _isnan(Temp1)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: Nan ?", __FUNCTION__).c_str()); } @@ -2589,7 +2589,7 @@ void R4300iOp::COP1_S_CMP() unorded = true; if ((m_Opcode.funct & 8) != 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Signal InvalidOperationException\nin r4300i_COP1_S_CMP\n%X %ff\n%X %ff", Temp0, Temp0, Temp1, Temp1).c_str()); } @@ -2824,7 +2824,7 @@ void R4300iOp::COP1_D_CMP() if (_isnan(Temp0.D) || _isnan(Temp1.D)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: Nan ?", __FUNCTION__).c_str()); } @@ -2833,7 +2833,7 @@ void R4300iOp::COP1_D_CMP() unorded = true; if ((m_Opcode.funct & 8) != 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Signal InvalidOperationException\nin %s", __FUNCTION__).c_str()); } diff --git a/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp b/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp index 1f7a1d24b..2dbaa3fb7 100644 --- a/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp +++ b/Source/Project64-core/N64System/Interpreter/InterpreterOps32.cpp @@ -1184,7 +1184,7 @@ void R4300iOp32::SPECIAL_SLTU() void R4300iOp32::SPECIAL_TEQ() { - if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && CDebugSettings::bHaveDebugger()) + if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && CDebugSettings::HaveDebugger()) { g_Notify->DisplayError("Should trap this ???"); } @@ -1302,7 +1302,7 @@ void R4300iOp32::REGIMM_BGEZAL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (CDebugSettings::bHaveDebugger()) + if (CDebugSettings::HaveDebugger()) { if (g_Reg->m_PROGRAM_COUNTER < 0x80000400) { @@ -1397,7 +1397,7 @@ void R4300iOp32::COP0_MT() { _CP0[m_Opcode.rd] = _GPR[m_Opcode.rt].UW[0]; } - if ((_CP0[m_Opcode.rd] & 0x18) != 0 && CDebugSettings::bHaveDebugger()) + if ((_CP0[m_Opcode.rd] & 0x18) != 0 && CDebugSettings::HaveDebugger()) { g_Notify->DisplayError("Left kernel mode ??"); } @@ -1405,7 +1405,7 @@ void R4300iOp32::COP0_MT() break; case 13: //cause _CP0[m_Opcode.rd] &= 0xFFFFCFF; - if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && CDebugSettings::bHaveDebugger()) + if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && CDebugSettings::HaveDebugger()) { g_Notify->DisplayError("Set IP0 or IP1"); } @@ -1427,7 +1427,7 @@ void R4300iOp32::COP1_CF() TEST_COP1_USABLE_EXCEPTION if (m_Opcode.fs != 31 && m_Opcode.fs != 0) { - if (CDebugSettings::bHaveDebugger()) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); } + if (CDebugSettings::HaveDebugger()) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); } return; } _GPR[m_Opcode.rt].W[0] = (int32_t)_FPCR[m_Opcode.fs]; diff --git a/Source/Project64-core/N64System/Mips/Dma.cpp b/Source/Project64-core/N64System/Mips/Dma.cpp index b5eb0ad54..6455e1ba5 100644 --- a/Source/Project64-core/N64System/Mips/Dma.cpp +++ b/Source/Project64-core/N64System/Mips/Dma.cpp @@ -62,7 +62,7 @@ void CDMA::PI_DMA_READ() if (g_Reg->PI_DRAM_ADDR_REG + PI_RD_LEN_REG > g_MMU->RdramSize()) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("PI_DMA_READ not in Memory: %08X", g_Reg->PI_DRAM_ADDR_REG + PI_RD_LEN_REG).c_str()); } @@ -187,7 +187,7 @@ void CDMA::PI_DMA_READ() g_Reg->CheckInterrupts(); return; } - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("PI_DMA_READ where are you dmaing to ? : %08X", g_Reg->PI_CART_ADDR_REG).c_str()); } @@ -483,7 +483,7 @@ void CDMA::SP_DMA_READ() if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\nSP_DRAM_ADDR_REG not in RDRam space : % 08X", __FUNCTION__, g_Reg->SP_DRAM_ADDR_REG).c_str()); } @@ -494,7 +494,7 @@ void CDMA::SP_DMA_READ() if (g_Reg->SP_RD_LEN_REG + 1 + (g_Reg->SP_MEM_ADDR_REG & 0xFFF) > 0x1000) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\nCould not fit copy in memory segment",__FUNCTION__).c_str()); } @@ -525,7 +525,7 @@ void CDMA::SP_DMA_WRITE() { if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\nSP_DRAM_ADDR_REG not in RDRam space : %08X", __FUNCTION__, g_Reg->SP_DRAM_ADDR_REG).c_str()); } @@ -534,7 +534,7 @@ void CDMA::SP_DMA_WRITE() if (g_Reg->SP_WR_LEN_REG + 1 + (g_Reg->SP_MEM_ADDR_REG & 0xFFF) > 0x1000) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("SP DMA WRITE\ncould not fit copy in memory segement"); } diff --git a/Source/Project64-core/N64System/Mips/Eeprom.cpp b/Source/Project64-core/N64System/Mips/Eeprom.cpp index c782ff991..303c5a981 100644 --- a/Source/Project64-core/N64System/Mips/Eeprom.cpp +++ b/Source/Project64-core/N64System/Mips/Eeprom.cpp @@ -72,22 +72,22 @@ void CEeprom::EepromCommand(uint8_t * Command) } break; case 4: // Read from Eeprom - if (Command[0] != 2 && bHaveDebugger()) + if (Command[0] != 2 && HaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } - if (Command[1] != 8 && bHaveDebugger()) + if (Command[1] != 8 && HaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } ReadFrom(&Command[4], Command[3]); break; case 5: //Write to Eeprom - if (Command[0] != 10 && bHaveDebugger()) + if (Command[0] != 10 && HaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } - if (Command[1] != 1 && bHaveDebugger()) + if (Command[1] != 1 && HaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } diff --git a/Source/Project64-core/N64System/Mips/FlashRam.cpp b/Source/Project64-core/N64System/Mips/FlashRam.cpp index 24caa0eb6..d20d2554b 100644 --- a/Source/Project64-core/N64System/Mips/FlashRam.cpp +++ b/Source/Project64-core/N64System/Mips/FlashRam.cpp @@ -40,7 +40,7 @@ void CFlashram::DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len } if (len > sizeof(FlipBuffer)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: DmaFromFlashram FlipBuffer to small (len: %d)", __FUNCTION__, len).c_str()); } @@ -48,7 +48,7 @@ void CFlashram::DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len } if ((len & 3) != 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: Unaligned flash ram read ???", __FUNCTION__).c_str()); } @@ -72,7 +72,7 @@ void CFlashram::DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len case FLASHRAM_MODE_STATUS: if (StartOffset != 0 && len != 8) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: Reading m_FlashStatus not being handled correctly\nStart: %X len: %X", __FUNCTION__, StartOffset, len).c_str()); } @@ -81,7 +81,7 @@ void CFlashram::DmaFromFlashram(uint8_t * dest, int32_t StartOffset, int32_t len *((uint32_t *)(dest)+1) = (uint32_t)(m_FlashStatus & 0xFFFFFFFF); break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: Start: %X, Offset: %X len: %X", __FUNCTION__, dest - g_MMU->Rdram(), StartOffset, len).c_str()); } @@ -96,7 +96,7 @@ void CFlashram::DmaToFlashram(uint8_t * Source, int32_t StartOffset, int32_t len m_FlashRamPointer = Source; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: Start: %X, Offset: %X len: %X", __FUNCTION__, Source - g_MMU->Rdram(), StartOffset, len).c_str()); } @@ -109,7 +109,7 @@ uint32_t CFlashram::ReadFromFlashStatus(uint32_t PAddr) { case 0x08000000: return (uint32_t)(m_FlashStatus >> 32); default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s: PAddr (%X)", __FUNCTION__, PAddr).c_str()); } @@ -217,7 +217,7 @@ void CFlashram::WriteToFlashCommand(uint32_t FlashRAM_Command) m_FlashStatus = 0x1111800400C2001E; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Writing %X to flash ram command register", FlashRAM_Command).c_str()); } diff --git a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp index abf514b49..f19cb118c 100644 --- a/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp +++ b/Source/Project64-core/N64System/Mips/MemoryVirtualMem.cpp @@ -1060,7 +1060,7 @@ void CMipsMemoryVM::ChangeSpStatus() g_Reg->m_RspIntrReg &= ~MI_INTR_SP; g_Reg->CheckInterrupts(); } - if ((RegModValue & SP_SET_INTR) != 0 && bHaveDebugger()) + if ((RegModValue & SP_SET_INTR) != 0 && HaveDebugger()) { g_Notify->DisplayError("SP_SET_INTR"); } @@ -1235,7 +1235,7 @@ void CMipsMemoryVM::Load32RDRAMRegisters(void) case 0x03F00024: m_MemLookupValue.UW[0] = g_Reg->RDRAM_DEVICE_MANUF_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1257,7 +1257,7 @@ void CMipsMemoryVM::Load32SPRegisters(void) case 0x04080000: m_MemLookupValue.UW[0] = g_Reg->SP_PC_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1275,7 +1275,7 @@ void CMipsMemoryVM::Load32DPCommand(void) case 0x0410001C: m_MemLookupValue.UW[0] = g_Reg->DPC_TMEM_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1292,7 +1292,7 @@ void CMipsMemoryVM::Load32MIPSInterface(void) case 0x0430000C: m_MemLookupValue.UW[0] = g_Reg->MI_INTR_MASK_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1322,7 +1322,7 @@ void CMipsMemoryVM::Load32VideoInterface(void) case 0x04400034: m_MemLookupValue.UW[0] = g_Reg->VI_Y_SCALE_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1362,7 +1362,7 @@ void CMipsMemoryVM::Load32AudioInterface(void) break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1388,7 +1388,7 @@ void CMipsMemoryVM::Load32PeripheralInterface(void) case 0x04600030: m_MemLookupValue.UW[0] = g_Reg->PI_BSD_DOM2_RLS_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1409,7 +1409,7 @@ void CMipsMemoryVM::Load32RDRAMInterface(void) case 0x0470001C: m_MemLookupValue.UW[0] = g_Reg->RI_WERROR_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1423,7 +1423,7 @@ void CMipsMemoryVM::Load32SerialInterface(void) case 0x04800018: m_MemLookupValue.UW[0] = g_Reg->SI_STATUS_REG; break; default: m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1482,7 +1482,7 @@ void CMipsMemoryVM::Load32CartridgeDomain2Address1(void) default: m_MemLookupValue.UW[0] = m_MemLookupAddress & 0xFFFF; m_MemLookupValue.UW[0] = (m_MemLookupValue.UW[0] << 16) | m_MemLookupValue.UW[0]; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1510,7 +1510,7 @@ void CMipsMemoryVM::Load32CartridgeDomain2Address2(void) } else if (g_System->m_SaveUsing != SaveChip_FlashRam) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1529,7 +1529,7 @@ void CMipsMemoryVM::Load32PifRam(void) { //m_MemLookupValue.UW[0] = swap32by8(*(uint32_t *)(&PifRom[PAddr - 0x1FC00000])); m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1543,7 +1543,7 @@ void CMipsMemoryVM::Load32PifRam(void) else { m_MemLookupValue.UW[0] = 0; - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1596,7 +1596,7 @@ void CMipsMemoryVM::Write32RDRAMRegisters(void) case 0x03F8000C: break; case 0x03F80014: break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1744,7 +1744,7 @@ void CMipsMemoryVM::Write32SPRegisters(void) case 0x0404001C: g_Reg->SP_SEMAPHORE_REG = 0; break; case 0x04080000: g_Reg->SP_PC_REG = m_MemLookupValue.UW[0] & 0xFFC; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1832,7 +1832,7 @@ void CMipsMemoryVM::Write32DPCommandRegisters(void) #endif break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1928,7 +1928,7 @@ void CMipsMemoryVM::Write32MIPSInterface(void) } break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -1987,7 +1987,7 @@ void CMipsMemoryVM::Write32VideoInterface(void) case 0x04400030: g_Reg->VI_X_SCALE_REG = m_MemLookupValue.UW[0]; break; case 0x04400034: g_Reg->VI_Y_SCALE_REG = m_MemLookupValue.UW[0]; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2030,7 +2030,7 @@ void CMipsMemoryVM::Write32AudioInterface(void) break; case 0x04500014: g_Reg->AI_BITRATE_REG = m_MemLookupValue.UW[0]; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2077,7 +2077,7 @@ void CMipsMemoryVM::Write32PeripheralInterface(void) case 0x0460002C: g_Reg->PI_BSD_DOM2_PGS_REG = (m_MemLookupValue.UW[0] & 0xFF); break; case 0x04600030: g_Reg->PI_BSD_DOM2_RLS_REG = (m_MemLookupValue.UW[0] & 0xFF); break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2097,7 +2097,7 @@ void CMipsMemoryVM::Write32RDRAMInterface(void) case 0x04700018: g_Reg->RI_RERROR_REG = m_MemLookupValue.UW[0]; break; case 0x0470001C: g_Reg->RI_WERROR_REG = m_MemLookupValue.UW[0]; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2123,7 +2123,7 @@ void CMipsMemoryVM::Write32SerialInterface(void) g_Reg->CheckInterrupts(); break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2158,7 +2158,7 @@ void CMipsMemoryVM::Write32CartridgeDomain2Address1(void) case 0x05000530: g_Reg->ASIC_SEC_BYTE = m_MemLookupValue.UW[0]; break; case 0x05000548: g_Reg->ASIC_TEST_PIN_SEL = m_MemLookupValue.UW[0]; break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2181,7 +2181,7 @@ void CMipsMemoryVM::Write32CartridgeDomain2Address2(void) } /*if ((m_MemLookupAddress & 0x1FFFFFFF) != 0x08010000) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2200,7 +2200,7 @@ void CMipsMemoryVM::Write32PifRam(void) { if ((m_MemLookupAddress & 0x1FFFFFFF) < 0x1FC007C0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } diff --git a/Source/Project64-core/N64System/Mips/RegisterClass.cpp b/Source/Project64-core/N64System/Mips/RegisterClass.cpp index 528f87526..ed175a744 100644 --- a/Source/Project64-core/N64System/Mips/RegisterClass.cpp +++ b/Source/Project64-core/N64System/Mips/RegisterClass.cpp @@ -355,7 +355,7 @@ void CRegisters::CheckInterrupts() void CRegisters::DoAddressError(bool DelaySlot, uint32_t BadVaddr, bool FromRead) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("AddressError"); if ((STATUS_REGISTER & STATUS_EXL) != 0) @@ -412,7 +412,7 @@ void CRegisters::FixFpuLocations() void CRegisters::DoBreakException(bool DelaySlot) { - if (bHaveDebugger()) + if (HaveDebugger()) { if ((STATUS_REGISTER & STATUS_EXL) != 0) { @@ -440,7 +440,7 @@ void CRegisters::DoBreakException(bool DelaySlot) void CRegisters::DoCopUnusableException(bool DelaySlot, int Coprocessor) { - if (bHaveDebugger()) + if (HaveDebugger()) { if ((STATUS_REGISTER & STATUS_EXL) != 0) { @@ -540,7 +540,7 @@ void CRegisters::DoTLBReadMiss(bool DelaySlot, uint32_t BadVaddr) } else { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s", BadVaddr, g_TLB->AddressDefined(BadVaddr) ? "true" : "false").c_str()); } @@ -550,7 +550,7 @@ void CRegisters::DoTLBReadMiss(bool DelaySlot, uint32_t BadVaddr) void CRegisters::DoSysCallException(bool DelaySlot) { - if (bHaveDebugger()) + if (HaveDebugger()) { if ((STATUS_REGISTER & STATUS_EXL) != 0) { diff --git a/Source/Project64-core/N64System/N64Class.cpp b/Source/Project64-core/N64System/N64Class.cpp index 25cde87a3..b2e186d6b 100644 --- a/Source/Project64-core/N64System/N64Class.cpp +++ b/Source/Project64-core/N64System/N64Class.cpp @@ -530,7 +530,7 @@ void CN64System::StartEmulation2(bool NewThread) WriteTrace(TraceN64System, TraceDebug, "Start (NewThread: %s)", NewThread ? "true" : "false"); if (NewThread) { - if (bHaveDebugger()) + if (HaveDebugger()) { StartLog(); } diff --git a/Source/Project64-core/N64System/N64RomClass.cpp b/Source/Project64-core/N64System/N64RomClass.cpp index 859c36166..6e7732bcb 100644 --- a/Source/Project64-core/N64System/N64RomClass.cpp +++ b/Source/Project64-core/N64System/N64RomClass.cpp @@ -308,7 +308,7 @@ void CN64Rom::CalculateCicChip() m_CicChip = GetCicChipID(m_ROMImage, &CRC); if (m_CicChip == CIC_UNKNOWN) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Unknown CIC checksum:\n%I64X.", CRC).c_str()); } diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp index 7f87815e6..087e32368 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp @@ -164,7 +164,7 @@ void CArmRecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE B } break; default: - if (bHaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); } + if (HaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); } } } else @@ -402,7 +402,7 @@ void CArmRecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE B } else { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n%s\nNextInstruction = %X", __FUNCTION__, m_NextInstruction).c_str()); } @@ -538,7 +538,7 @@ void CArmRecompilerOps::Compile_BranchLikely(BRANCH_COMPARE CompareType, bool Li m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n%s\nNextInstruction = %X", __FUNCTION__, m_NextInstruction).c_str()); } @@ -1801,7 +1801,7 @@ void CArmRecompilerOps::J() m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n%s\nNextInstruction = %X", __FUNCTION__, m_NextInstruction).c_str()); } @@ -2462,7 +2462,7 @@ void CArmRecompilerOps::SW(bool bCheckLLbit) } else { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -2556,7 +2556,7 @@ void CArmRecompilerOps::CACHE() case 25: break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("cache: %d", m_Opcode.rt).c_str()); } @@ -2898,7 +2898,7 @@ void CArmRecompilerOps::SPECIAL_JR() } m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n%s\nNextInstruction = %X", __FUNCTION__, m_NextInstruction).c_str()); } @@ -2977,7 +2977,7 @@ void CArmRecompilerOps::SPECIAL_JALR() } m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n%s\nNextInstruction = %X", __FUNCTION__, m_NextInstruction).c_str()); } @@ -3490,7 +3490,7 @@ void CArmRecompilerOps::SPECIAL_SLT() { if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } @@ -6103,7 +6103,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04100000: @@ -6122,7 +6122,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04300000: @@ -6237,7 +6237,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04400000: @@ -6313,7 +6313,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04500000: /* AI registers */ @@ -6360,7 +6360,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04600000: @@ -6406,7 +6406,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04700000: @@ -6422,7 +6422,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04800000: @@ -6463,7 +6463,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x05000000: @@ -6483,7 +6483,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; } @@ -6505,7 +6505,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } } @@ -6572,7 +6572,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04000000: @@ -6620,7 +6620,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } } break; @@ -6663,7 +6663,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04400000: @@ -6865,7 +6865,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04700000: @@ -6881,7 +6881,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04800000: @@ -6916,7 +6916,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x05000000: @@ -6968,7 +6968,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } } @@ -6978,7 +6978,7 @@ void CArmRecompilerOps::LB_KnownAddress(ArmReg Reg, uint32_t VAddr, bool SignExt if (VAddr < 0x80000000 || VAddr >= 0xC0000000) { - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } return; } @@ -7008,7 +7008,7 @@ void CArmRecompilerOps::LB_KnownAddress(ArmReg Reg, uint32_t VAddr, bool SignExt break; default: CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } } @@ -7081,7 +7081,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04100000: @@ -7104,7 +7104,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) MoveConstToArmReg(Reg, (uint32_t)0); if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04400000: @@ -7124,7 +7124,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) MoveConstToArmReg(Reg, (uint32_t)0); if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04500000: /* AI registers */ @@ -7181,7 +7181,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) MoveConstToArmReg(Reg, (uint32_t)0); if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04600000: @@ -7207,7 +7207,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04700000: @@ -7222,7 +7222,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x04800000: @@ -7237,7 +7237,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } break; case 0x05000000: @@ -7277,7 +7277,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } } else @@ -7303,7 +7303,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) else { CPU_Message(" Should be loading from %08X ?!?", VAddr); - if (bHaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } + if (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } } } diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp index 6b7419067..75dee5e7d 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmRegInfo.cpp @@ -264,7 +264,7 @@ void CArmRegInfo::Map_GPR_32bit(int32_t MipsReg, bool SignValue, int32_t MipsReg Reg = FreeArmReg(false); if (Reg < 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); } g_Notify->BreakPoint(__FILE__, __LINE__); return; } @@ -337,7 +337,7 @@ void CArmRegInfo::Map_GPR_64bit(int32_t MipsReg, int32_t MipsRegToLoad) if (MipsReg == 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nWhy are you trying to map reg 0"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nWhy are you trying to map reg 0"); } g_Notify->BreakPoint(__FILE__, __LINE__); return; } @@ -348,7 +348,7 @@ void CArmRegInfo::Map_GPR_64bit(int32_t MipsReg, int32_t MipsRegToLoad) regHi = FreeArmReg(false); if (regHi < 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } g_Notify->BreakPoint(__FILE__, __LINE__); return; } @@ -357,7 +357,7 @@ void CArmRegInfo::Map_GPR_64bit(int32_t MipsReg, int32_t MipsRegToLoad) reglo = FreeArmReg(false); if (reglo < 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } g_Notify->BreakPoint(__FILE__, __LINE__); return; } @@ -375,7 +375,7 @@ void CArmRegInfo::Map_GPR_64bit(int32_t MipsReg, int32_t MipsRegToLoad) regHi = FreeArmReg(false); if (regHi < 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } g_Notify->BreakPoint(__FILE__, __LINE__); return; } @@ -474,7 +474,7 @@ void CArmRegInfo::UnMap_GPR(uint32_t MipsReg, bool WriteBackValue) if (MipsReg == 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\n\nWhy are you trying to unmap reg 0", __FUNCTION__).c_str()); } @@ -510,7 +510,7 @@ void CArmRegInfo::WriteBack_GPR(uint32_t MipsReg, bool Unmapping) } if (MipsReg == 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\n\nWhy are you trying to unmap reg 0", __FUNCTION__).c_str()); } diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 12261a5a9..012aec321 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -278,7 +278,7 @@ void CX86RecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE B } break; default: - if (bHaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); } + if (HaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); } } } else @@ -512,7 +512,7 @@ void CX86RecompilerOps::Compile_Branch(BRANCH_COMPARE CompareType, BRANCH_TYPE B } else { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction).c_str()); } @@ -645,7 +645,7 @@ void CX86RecompilerOps::Compile_BranchLikely(BRANCH_COMPARE CompareType, bool Li m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n%s\nNextInstruction = %X", __FUNCTION__, m_NextInstruction).c_str()); } @@ -1947,7 +1947,7 @@ void CX86RecompilerOps::J() m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n\nJ\nNextInstruction = %X", m_NextInstruction).c_str()); } @@ -2478,7 +2478,7 @@ void CX86RecompilerOps::CACHE() case 25: break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("cache: %d", m_Opcode.rt).c_str()); } @@ -4874,7 +4874,7 @@ void CX86RecompilerOps::SPECIAL_JR() } m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction).c_str()); } @@ -4956,7 +4956,7 @@ void CX86RecompilerOps::SPECIAL_JALR() } m_NextInstruction = END_BLOCK; } - else if (bHaveDebugger()) + else if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction).c_str()); } @@ -6088,7 +6088,7 @@ void CX86RecompilerOps::SPECIAL_XOR() if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) { - if (bHaveDebugger()) { g_Notify->DisplayError("XOR 1"); } + if (HaveDebugger()) { g_Notify->DisplayError("XOR 1"); } CX86RecompilerOps::UnknownOpcode(); } else @@ -7702,12 +7702,12 @@ void CX86RecompilerOps::COP0_MT() AndConstToVariable(0xFFFFCFF, &_CP0[m_Opcode.rd], CRegName::Cop0[m_Opcode.rd]); if (IsConst(m_Opcode.rt)) { - if ((GetMipsRegLo(m_Opcode.rt) & 0x300) != 0 && bHaveDebugger()) + if ((GetMipsRegLo(m_Opcode.rt) & 0x300) != 0 && HaveDebugger()) { g_Notify->DisplayError("Set IP0 or IP1"); } } - /*else if (bHaveDebugger()) + /*else if (HaveDebugger()) { UnknownOpcode(); return; diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp index 5920423f3..7a53da19c 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RegInfo.cpp @@ -211,7 +211,7 @@ void CX86RegInfo::ChangeFPURegFormat(int32_t Reg, FPU_STATE OldFormat, FPU_STATE return; } - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError("ChangeFormat: Register not on stack!!"); } @@ -388,7 +388,7 @@ void CX86RegInfo::Load_FPR_ToTop(int32_t Reg, int32_t RegToLoad, FPU_STATE Forma fpuLoadQwordFromX86Reg(&StackTopPos(), TempReg); break; default: - if (bHaveDebugger()) { g_Notify->DisplayError(stdstr_f("Load_FPR_ToTop\nUnkown format to load %d", Format).c_str()); } + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("Load_FPR_ToTop\nUnkown format to load %d", Format).c_str()); } } SetX86Protected(TempReg, false); FpuRoundingModel(StackTopPos()) = RoundDefault; @@ -628,7 +628,7 @@ void CX86RegInfo::Map_GPR_32bit(int32_t MipsReg, bool SignValue, int32_t MipsReg Reg = FreeX86Reg(); if (Reg < 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); } g_Notify->BreakPoint(__FILE__, __LINE__); return; } @@ -691,7 +691,7 @@ void CX86RegInfo::Map_GPR_64bit(int32_t MipsReg, int32_t MipsRegToLoad) if (MipsReg == 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nWhy are you trying to map reg 0"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nWhy are you trying to map reg 0"); } return; } @@ -701,7 +701,7 @@ void CX86RegInfo::Map_GPR_64bit(int32_t MipsReg, int32_t MipsRegToLoad) x86Hi = FreeX86Reg(); if (x86Hi < 0) { - if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } + if (HaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } return; } SetX86Protected(x86Hi, true); @@ -1120,7 +1120,7 @@ void CX86RegInfo::UnMap_FPR(int32_t Reg, bool WriteBackValue) fpuStoreQwordFromX86Reg(&StackTopPos(), TempReg, true); break; default: - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\nUnknown format to load %d", __FUNCTION__, m_x86fpu_State[StackTopPos()]).c_str()); } @@ -1147,7 +1147,7 @@ void CX86RegInfo::UnMap_GPR(uint32_t Reg, bool WriteBackValue) { if (Reg == 0) { - if (bHaveDebugger()) + if (HaveDebugger()) { g_Notify->DisplayError(stdstr_f("%s\n\nWhy are you trying to unmap reg 0", __FUNCTION__).c_str()); } diff --git a/Source/Project64-core/Plugins/PluginBase.cpp b/Source/Project64-core/Plugins/PluginBase.cpp index 99555b925..78e037f73 100644 --- a/Source/Project64-core/Plugins/PluginBase.cpp +++ b/Source/Project64-core/Plugins/PluginBase.cpp @@ -48,7 +48,7 @@ bool CPlugin::Load(const char * FileName) // Try to load the plugin DLL //Try to load the DLL library - m_LibHandle = pjutil::DynLibOpen(FileName, bHaveDebugger()); + m_LibHandle = pjutil::DynLibOpen(FileName, HaveDebugger()); WriteTrace(PluginTraceType(), TraceDebug, "Loaded: %s LibHandle: %X", FileName, m_LibHandle); if (m_LibHandle == NULL) diff --git a/Source/Project64-core/Plugins/PluginClass.cpp b/Source/Project64-core/Plugins/PluginClass.cpp index 07e7547e9..faefa5b33 100644 --- a/Source/Project64-core/Plugins/PluginClass.cpp +++ b/Source/Project64-core/Plugins/PluginClass.cpp @@ -160,7 +160,7 @@ void CPlugins::CreatePlugins(void) if (m_RSP != NULL && m_RSP->EnableDebugging) { WriteTrace(TraceRSPPlugin, TraceInfo, "EnableDebugging starting"); - m_RSP->EnableDebugging(bHaveDebugger()); + m_RSP->EnableDebugging(HaveDebugger()); WriteTrace(TraceRSPPlugin, TraceInfo, "EnableDebugging done"); } WriteTrace(TracePlugins, TraceInfo, "Done"); diff --git a/Source/Project64-core/Settings/DebugSettings.cpp b/Source/Project64-core/Settings/DebugSettings.cpp index a1b26c0b2..be15e90c1 100644 --- a/Source/Project64-core/Settings/DebugSettings.cpp +++ b/Source/Project64-core/Settings/DebugSettings.cpp @@ -15,7 +15,8 @@ int CDebugSettings::m_RefCount = 0; bool CDebugSettings::m_Registered = false; -bool CDebugSettings::m_bHaveDebugger = false; +bool CDebugSettings::m_HaveDebugger = true; +bool CDebugSettings::m_Debugging = true; bool CDebugSettings::m_Stepping = true; bool CDebugSettings::m_bRecordRecompilerAsm = false; bool CDebugSettings::m_bShowTLBMisses = false; @@ -58,11 +59,13 @@ CDebugSettings::~CDebugSettings() void CDebugSettings::RefreshSettings() { - m_bHaveDebugger = g_Settings->LoadBool(Debugger_Enabled); - m_bRecordRecompilerAsm = m_bHaveDebugger && g_Settings->LoadBool(Debugger_RecordRecompilerAsm); - m_bShowTLBMisses = m_bHaveDebugger && g_Settings->LoadBool(Debugger_ShowTLBMisses); - m_bShowDivByZero = m_bHaveDebugger && g_Settings->LoadBool(Debugger_ShowDivByZero); + m_HaveDebugger = g_Settings->LoadBool(Debugger_Enabled); + m_bRecordRecompilerAsm = m_HaveDebugger && g_Settings->LoadBool(Debugger_RecordRecompilerAsm); + m_bShowTLBMisses = m_HaveDebugger && g_Settings->LoadBool(Debugger_ShowTLBMisses); + m_bShowDivByZero = m_HaveDebugger && g_Settings->LoadBool(Debugger_ShowDivByZero); m_RecordExecutionTimes = g_Settings->LoadBool(Debugger_RecordExecutionTimes); m_Stepping = g_Settings->LoadBool(Debugger_SteppingOps); m_HaveExecutionBP = g_Settings->LoadBool(Debugger_HaveExecutionBP); + + m_Debugging = m_HaveDebugger && m_HaveExecutionBP; } \ No newline at end of file diff --git a/Source/Project64-core/Settings/DebugSettings.h b/Source/Project64-core/Settings/DebugSettings.h index 35222094b..9068697fc 100644 --- a/Source/Project64-core/Settings/DebugSettings.h +++ b/Source/Project64-core/Settings/DebugSettings.h @@ -18,7 +18,8 @@ public: CDebugSettings(); virtual ~CDebugSettings(); - static inline bool bHaveDebugger(void) { return m_bHaveDebugger; } + static inline bool HaveDebugger(void) { return m_HaveDebugger; } + static inline bool isDebugging(void) { return m_Debugging; } static inline bool isStepping(void) { return m_Stepping; } static inline bool bRecordRecompilerAsm(void) { return m_bRecordRecompilerAsm; } static inline bool bShowTLBMisses(void) { return m_bShowTLBMisses; } @@ -34,7 +35,8 @@ private: void RefreshSettings(void); - static bool m_bHaveDebugger; + static bool m_HaveDebugger; + static bool m_Debugging; static bool m_Stepping; static bool m_bRecordRecompilerAsm; static bool m_bShowTLBMisses; diff --git a/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp b/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp index f17bd2c6e..2956d9bdc 100644 --- a/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp +++ b/Source/Project64/UserInterface/Debugger/ScriptInstance.cpp @@ -1382,8 +1382,7 @@ duk_ret_t CScriptInstance::js_ConsoleClear(duk_context* ctx) duk_ret_t CScriptInstance::js_Pause(duk_context* ctx) { CScriptInstance* _this = FetchInstance(ctx); - CBreakpoints* breakpoints = _this->m_Debugger->Breakpoints(); - breakpoints->Pause(); + g_System->Pause(); return 1; } diff --git a/Source/Project64/UserInterface/MainMenu.cpp b/Source/Project64/UserInterface/MainMenu.cpp index 43d13c606..6b58dc09a 100644 --- a/Source/Project64/UserInterface/MainMenu.cpp +++ b/Source/Project64/UserInterface/MainMenu.cpp @@ -956,7 +956,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) /* Profile Menu ****************/ MenuItemList DebugProfileMenu; - if (bHaveDebugger()) + if (HaveDebugger()) { Item.Reset(ID_PROFILE_PROFILE, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Record Execution Times"); if (g_Settings->LoadBool(Debugger_RecordExecutionTimes)) { Item.SetItemTicked(true); } @@ -978,7 +978,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) MenuItemList DebugMemoryMenu; MenuItemList DebugInterrupt; MenuItemList DebugNotificationMenu; - if (bHaveDebugger()) + if (HaveDebugger()) { /* Debug - Interrupt *******************/ @@ -1272,7 +1272,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) MainTitleMenu.push_back(Item); if (!inBasicMode) { - if (bHaveDebugger()) + if (HaveDebugger()) { Item.Reset(SUB_MENU, MENU_DEBUGGER, EMPTY_STDSTR, &DebugMenu); if (RomLoading) { Item.SetItemEnabled(false); }