diff --git a/Source/Project64-core/MemoryExceptionFilter.cpp b/Source/Project64-core/MemoryExceptionFilter.cpp index be3795835..c998ebe52 100644 --- a/Source/Project64-core/MemoryExceptionFilter.cpp +++ b/Source/Project64-core/MemoryExceptionFilter.cpp @@ -196,7 +196,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xB6: if (!g_MMU->LB_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -206,7 +206,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xB7: if (!g_MMU->LH_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -216,7 +216,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xBE: if (!g_MMU->LB_NonMemory(MemAddress, (uint32_t *)Reg, true)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -226,7 +226,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0xBF: if (!g_MMU->LH_NonMemory(MemAddress, (uint32_t *)Reg, true)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -247,7 +247,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x8B: if (!g_MMU->LH_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -257,7 +257,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x89: if (!g_MMU->SH_NonMemory(MemAddress, *(uint16_t *)Reg)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); @@ -276,7 +276,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex } if (!g_MMU->SH_NonMemory(MemAddress, *(uint16_t *)ReadPos)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -294,7 +294,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x88: if (!g_MMU->SB_NonMemory(MemAddress, *(uint8_t *)Reg)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -304,7 +304,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x8A: if (!g_MMU->LB_NonMemory(MemAddress, (uint32_t *)Reg, false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -314,7 +314,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x8B: if (!g_MMU->LW_NonMemory(MemAddress, (uint32_t *)Reg)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -324,7 +324,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex case 0x89: if (!g_MMU->SW_NonMemory(MemAddress, *(uint32_t *)Reg)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -342,7 +342,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex } if (!g_MMU->SB_NonMemory(MemAddress, *(uint8_t *)ReadPos)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -360,7 +360,7 @@ bool CMipsMemoryVM::FilterX86Exception(uint32_t MemAddress, X86_CONTEXT & contex } if (!g_MMU->SW_NonMemory(MemAddress, *(uint32_t *)ReadPos)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nX86 Address: %08X", MemAddress, (uint8_t *)*context.Eip).c_str()); } @@ -475,7 +475,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context { if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -487,7 +487,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context { if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -501,7 +501,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //42 f8 03 c0 str.w ip, [r2, r3] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->imm2.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -515,7 +515,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //c9 f8 00 b0 str.w r11, [r9] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->imm2.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -529,7 +529,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //dc f8 70 70 ldr.w r7, [ip, #112] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode32->imm12.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -544,7 +544,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //e789300c str r3, [r9, ip] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -557,7 +557,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context { if (!g_MMU->SB_NonMemory(MemAddress, *ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -571,7 +571,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //17c32001 strbne r2, [r3, r1] if (!g_MMU->SB_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -585,7 +585,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //11c020b0 strhne r2, [r0] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm8.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -599,7 +599,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context // 00 80 strh r0, [r0, #0] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -613,7 +613,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context // 14 52 strh r4, [r2, r0] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode->Reg.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -627,7 +627,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //2e 60 str r6, [r5, #0] if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -641,7 +641,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //3F 68 ldr r7, [r7, #0] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -655,7 +655,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //b8 70 strb r0, [r7, #2] if (!g_MMU->SB_NonMemory(MemAddress, *ArmRegisters[OpCode->Imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store byte\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -669,7 +669,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //118320b1 strhne r2, [r3, r1] if (!g_MMU->SH_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -683,7 +683,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //e48a1004 str r1, [sl], #4 if (!g_MMU->SW_NonMemory(MemAddress, *ArmRegisters[OpCode32->reg_cond_imm12.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to store word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -697,7 +697,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //f833 c001 ldrh.w ip, [r3, r1] if (!g_MMU->LH_NonMemory(MemAddress, ArmRegisters[OpCode32->uint16.rt], false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -711,7 +711,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //e19a20b2 ldrh r2, [sl, r2] if (!g_MMU->LH_NonMemory(MemAddress, ArmRegisters[OpCode32->uint32.rt], false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -726,7 +726,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //11d000b0 ldrhne r0, [r0] if (!g_MMU->LH_NonMemory(MemAddress, ArmRegisters[OpCode32->reg_cond.rt], false)) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load half word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -740,7 +740,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //1790a001 ldrne sl, [r0, r1] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode32->reg_cond_imm5.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } @@ -754,7 +754,7 @@ bool CMipsMemoryVM::FilterArmException(uint32_t MemAddress, mcontext_t & context //52 f8 21 30 ldr.w r3, [r2, r1, lsl #2] if (!g_MMU->LW_NonMemory(MemAddress, ArmRegisters[OpCode32->imm2.rt])) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("Failed to load word\n\nMIPS Address: %08X\nPC Address: %08X", MemAddress, context.arm_pc).c_str()); } diff --git a/Source/Project64-core/N64System/Mips/Dma.cpp b/Source/Project64-core/N64System/Mips/Dma.cpp index d1f077cdf..8afc5925c 100644 --- a/Source/Project64-core/N64System/Mips/Dma.cpp +++ b/Source/Project64-core/N64System/Mips/Dma.cpp @@ -207,7 +207,7 @@ void CDMA::PI_DMA_WRITE() g_Reg->PI_STATUS_REG |= PI_STATUS_DMA_BUSY; if (g_Reg->PI_DRAM_ADDR_REG + PI_WR_LEN_REG > g_MMU->RdramSize()) { - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("PI_DMA_WRITE not in Memory: %08X", g_Reg->PI_DRAM_ADDR_REG + PI_WR_LEN_REG).c_str()); } + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("PI_DMA_WRITE not in Memory: %08X", g_Reg->PI_DRAM_ADDR_REG + PI_WR_LEN_REG).c_str()); } g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->CheckInterrupts(); @@ -476,7 +476,7 @@ void CDMA::PI_DMA_WRITE() return; } - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("PI_DMA_WRITE not in ROM: %08X", PI_CART_ADDR_REG).c_str()); } diff --git a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp index b9dc356f9..4363f4090 100644 --- a/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/Arm/ArmRecompilerOps.cpp @@ -6101,7 +6101,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -6141,7 +6141,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x03F8000C: break; case 0x03F80014: break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6180,7 +6180,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x04080000: MoveConstToVariable(Value & 0xFFC, &g_Reg->SP_PC_REG, "SP_PC_REG"); break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6199,7 +6199,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_RegWorkingSet.AfterCallDirect(); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6314,7 +6314,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6390,7 +6390,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x04400034: MoveConstToVariable(Value, &g_Reg->VI_Y_SCALE_REG, "VI_Y_SCALE_REG"); break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6437,7 +6437,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x04500014: MoveConstToVariable(Value, &g_Reg->AI_BITRATE_REG, "AI_BITRATE_REG"); break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6486,7 +6486,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x04600030: MoveConstToVariable((Value & 0xFF), &g_Reg->PI_BSD_DOM2_RLS_REG, "PI_BSD_DOM2_RLS_REG"); break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6502,7 +6502,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x0470000C: MoveConstToVariable(Value, &g_Reg->RI_SELECT_REG, "RI_SELECT_REG"); break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6543,7 +6543,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6563,7 +6563,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6585,7 +6585,7 @@ void CArmRecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) break; default: CPU_Message(" Should be moving %X in to %08X ?!?", Value, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -6622,7 +6622,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -6652,7 +6652,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) case 0x03F80014: break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6700,7 +6700,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) else { CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6743,7 +6743,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6815,7 +6815,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) case 0x04400034: MoveArmRegToVariable(Reg, &g_Reg->VI_Y_SCALE_REG, "VI_Y_SCALE_REG"); break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6867,7 +6867,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) case 0x04500014: MoveArmRegToVariable(Reg, &g_Reg->AI_BITRATE_REG, "AI_BITRATE_REG"); break; default: MoveArmRegToVariable(Reg, PAddr + g_MMU->Rdram(), stdstr_f("RDRAM + %X", PAddr).c_str()); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6904,7 +6904,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) m_RegWorkingSet.AfterCallDirect(); break; case 0x04600010: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6948,7 +6948,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6964,7 +6964,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) case 0x04700010: MoveArmRegToVariable(Reg, &g_Reg->RI_REFRESH_REG, "RI_REFRESH_REG"); break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -6999,7 +6999,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -7051,7 +7051,7 @@ void CArmRecompilerOps::SW_Register(ArmReg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", ArmRegName(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -7163,7 +7163,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) case 0x04080000: MoveVariableToArmReg(&g_Reg->SP_PC_REG, "SP_PC_REG", Reg); break; default: MoveConstToArmReg(Reg, (uint32_t)0); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -7189,7 +7189,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) case 0x0430000C: MoveVariableToArmReg(&g_Reg->MI_INTR_MASK_REG, "MI_INTR_MASK_REG", Reg); break; default: 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()); } + if (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 (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } @@ -7209,7 +7209,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) break; default: 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()); } + if (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 (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } @@ -7266,7 +7266,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) break; default: 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()); } + if (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 (HaveDebugger()) { g_Notify->BreakPoint(__FILE__, __LINE__); } } @@ -7289,7 +7289,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) case 0x04600030: MoveVariableToArmReg(&g_Reg->PI_BSD_DOM2_RLS_REG, "PI_BSD_DOM2_RLS_REG", Reg); break; default: MoveConstToArmReg(Reg, (uint32_t)0); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -7304,7 +7304,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) case 0x04700010: MoveVariableToArmReg(&g_Reg->RI_REFRESH_REG, "RI_REFRESH_REG", Reg); break; default: MoveConstToArmReg(Reg, (uint32_t)0); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -7319,7 +7319,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) case 0x04800018: MoveVariableToArmReg(&g_Reg->SI_STATUS_REG, "SI_STATUS_REG", Reg); break; default: MoveConstToArmReg(Reg, (uint32_t)0); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -7359,7 +7359,7 @@ void CArmRecompilerOps::LW_KnownAddress(ArmReg Reg, uint32_t VAddr) case 0x05000548: MoveVariableToArmReg(&g_Reg->ASIC_TEST_PIN_SEL, "ASIC_TEST_PIN_SEL", Reg); break; default: MoveConstToArmReg(Reg, (uint32_t)0); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } diff --git a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp index 9a0ee3605..9e99a9d15 100644 --- a/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp +++ b/Source/Project64-core/N64System/Recompiler/x86/x86RecompilerOps.cpp @@ -2777,7 +2777,7 @@ void CX86RecompilerOps::LB_KnownAddress(x86Reg Reg, uint32_t VAddr, bool SignExt { MoveConstToX86reg(0, Reg); CPU_Message("%s\nFailed to translate address %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address %08X", __FUNCTION__, VAddr).c_str()); } @@ -2807,7 +2807,7 @@ void CX86RecompilerOps::LB_KnownAddress(x86Reg Reg, uint32_t VAddr, bool SignExt break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to compile address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -2848,7 +2848,7 @@ void CX86RecompilerOps::LH_KnownAddress(x86Reg Reg, uint32_t VAddr, bool SignExt { MoveConstToX86reg(0, Reg); CPU_Message("%s\nFailed to translate address %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address %08X", __FUNCTION__, VAddr).c_str()); } @@ -2878,7 +2878,7 @@ void CX86RecompilerOps::LH_KnownAddress(x86Reg Reg, uint32_t VAddr, bool SignExt break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to compile address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3271,7 +3271,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) case 0x04080000: MoveVariableToX86reg(&g_Reg->SP_PC_REG, "SP_PC_REG", Reg); break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3304,7 +3304,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) case 0x0430000C: MoveVariableToX86reg(&g_Reg->MI_INTR_MASK_REG, "MI_INTR_MASK_REG", Reg); break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } } break; case 0x04400000: @@ -3328,7 +3328,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3395,7 +3395,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3419,7 +3419,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) case 0x04600030: MoveVariableToX86reg(&g_Reg->PI_BSD_DOM2_RLS_REG, "PI_BSD_DOM2_RLS_REG", Reg); break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3432,7 +3432,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) case 0x04700010: MoveVariableToX86reg(&g_Reg->RI_REFRESH_REG, "RI_REFRESH_REG", Reg); break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3444,7 +3444,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) case 0x04800018: MoveVariableToX86reg(&g_Reg->SI_STATUS_REG, "SI_STATUS_REG", Reg); break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3482,7 +3482,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) case 0x05000548: MoveVariableToX86reg(&g_Reg->ASIC_TEST_PIN_SEL, "ASIC_TEST_PIN_SEL", Reg); break; default: MoveConstToX86reg(0, Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -3513,7 +3513,7 @@ void CX86RecompilerOps::LW_KnownAddress(x86Reg Reg, uint32_t VAddr) else { MoveConstToX86reg(((PAddr & 0xFFFF) << 16) | (PAddr & 0xFFFF), Reg); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); @@ -10580,7 +10580,7 @@ void CX86RecompilerOps::SB_Const(uint8_t Value, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) { g_Notify->DisplayError(stdstr_f("%s, \nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s, \nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } return; } @@ -10598,7 +10598,7 @@ void CX86RecompilerOps::SB_Const(uint8_t Value, uint32_t VAddr) MoveConstByteToVariable(Value, PAddr + g_MMU->Rdram(), VarName); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %02X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -10628,7 +10628,7 @@ void CX86RecompilerOps::SB_Register(x86Reg Reg, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -10649,7 +10649,7 @@ void CX86RecompilerOps::SB_Register(x86Reg Reg, uint32_t VAddr) MoveX86regByteToVariable(Reg, PAddr + g_MMU->Rdram(), VarName); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -10677,7 +10677,7 @@ void CX86RecompilerOps::SH_Const(uint16_t Value, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -10698,7 +10698,7 @@ void CX86RecompilerOps::SH_Const(uint16_t Value, uint32_t VAddr) MoveConstHalfToVariable(Value, PAddr + g_MMU->Rdram(), VarName); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %04X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -10728,7 +10728,7 @@ void CX86RecompilerOps::SH_Register(x86Reg Reg, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -10749,7 +10749,7 @@ void CX86RecompilerOps::SH_Register(x86Reg Reg, uint32_t VAddr) MoveX86regHalfToVariable(Reg, PAddr + g_MMU->Rdram(), VarName); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, PAddr).c_str()); } @@ -10778,7 +10778,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -10818,7 +10818,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x03F8000C: break; case 0x03F80014: break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -10871,7 +10871,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x0404001C: MoveConstToVariable(0, &g_Reg->SP_SEMAPHORE_REG, "SP_SEMAPHORE_REG"); break; case 0x04080000: MoveConstToVariable(Value & 0xFFC, &g_Reg->SP_PC_REG, "SP_PC_REG"); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -10895,7 +10895,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) #endif break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11013,7 +11013,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) } break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11077,7 +11077,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x04400030: MoveConstToVariable(Value, &g_Reg->VI_X_SCALE_REG, "VI_X_SCALE_REG"); break; case 0x04400034: MoveConstToVariable(Value, &g_Reg->VI_Y_SCALE_REG, "VI_Y_SCALE_REG"); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11126,7 +11126,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) default: sprintf(VarName, "RDRAM + %X", PAddr); MoveConstToVariable(Value, PAddr + g_MMU->Rdram(), VarName); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11191,7 +11191,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x0460002C: MoveConstToVariable((Value & 0xFF), &g_Reg->PI_BSD_DOM2_PGS_REG, "PI_BSD_DOM2_PGS_REG"); break; case 0x04600030: MoveConstToVariable((Value & 0xFF), &g_Reg->PI_BSD_DOM2_RLS_REG, "PI_BSD_DOM2_RLS_REG"); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11205,7 +11205,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) case 0x04700008: MoveConstToVariable(Value, &g_Reg->RI_CURRENT_LOAD_REG, "RI_CURRENT_LOAD_REG"); break; case 0x0470000C: MoveConstToVariable(Value, &g_Reg->RI_SELECT_REG, "RI_SELECT_REG"); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11262,7 +11262,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_RegWorkingSet.AfterCallDirect(); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11280,7 +11280,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) m_RegWorkingSet.AfterCallDirect(); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11308,7 +11308,7 @@ void CX86RecompilerOps::SW_Const(uint32_t Value, uint32_t VAddr) } break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store %08X in %08X?", __FUNCTION__, Value, VAddr).c_str()); } @@ -11354,7 +11354,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) { CPU_Message("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\nFailed to translate address: %08X", __FUNCTION__, VAddr).c_str()); } @@ -11428,7 +11428,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) else { CPU_Message(" Should be moving %s in to %08X ?!?", x86_Name(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11473,7 +11473,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", x86_Name(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11542,7 +11542,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) case 0x04400034: MoveX86regToVariable(Reg, &g_Reg->VI_Y_SCALE_REG, "VI_Y_SCALE_REG"); break; default: CPU_Message(" Should be moving %s in to %08X ?!?", x86_Name(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11600,7 +11600,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) default: sprintf(VarName, "RDRAM + %X", PAddr); MoveX86regToVariable(Reg, PAddr + g_MMU->Rdram(), VarName); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11649,7 +11649,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) m_RegWorkingSet.AfterCallDirect(); break; case 0x04600010: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11699,7 +11699,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", x86_Name(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11713,7 +11713,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) case 0x0470000C: MoveX86regToVariable(Reg, &g_Reg->RI_SELECT_REG, "RI_SELECT_REG"); break; case 0x04700010: MoveX86regToVariable(Reg, &g_Reg->RI_REFRESH_REG, "RI_REFRESH_REG"); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11764,7 +11764,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) m_RegWorkingSet.AfterCallDirect(); break; default: - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } @@ -11826,7 +11826,7 @@ void CX86RecompilerOps::SW_Register(x86Reg Reg, uint32_t VAddr) break; default: CPU_Message(" Should be moving %s in to %08X ?!?", x86_Name(Reg), VAddr); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + if (ShowUnhandledMemory()) { g_Notify->DisplayError(stdstr_f("%s\ntrying to store in %08X?", __FUNCTION__, VAddr).c_str()); } diff --git a/Source/Project64-core/Settings/DebugSettings.cpp b/Source/Project64-core/Settings/DebugSettings.cpp index 78a274436..ccdc0cec5 100644 --- a/Source/Project64-core/Settings/DebugSettings.cpp +++ b/Source/Project64-core/Settings/DebugSettings.cpp @@ -33,6 +33,7 @@ uint32_t CDebugSettings::m_ExceptionBreakpoints = 0; uint32_t CDebugSettings::m_FpExceptionBreakpoints = 0; uint32_t CDebugSettings::m_IntrBreakpoints = 0; uint32_t CDebugSettings::m_RcpIntrBreakpoints = 0; +bool CDebugSettings::m_ShowUnhandledMemory = false; CDebugSettings::CDebugSettings() { @@ -57,7 +58,8 @@ CDebugSettings::CDebugSettings() g_Settings->RegisterChangeCB(Debugger_FpExceptionBreakpoints, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->RegisterChangeCB(Debugger_IntrBreakpoints, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->RegisterChangeCB(Debugger_RcpIntrBreakpoints, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); - + g_Settings->RegisterChangeCB(Debugger_ShowUnhandledMemory, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); + RefreshSettings(); } } @@ -83,6 +85,7 @@ CDebugSettings::~CDebugSettings() g_Settings->UnregisterChangeCB(Debugger_FpExceptionBreakpoints, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->UnregisterChangeCB(Debugger_IntrBreakpoints, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->UnregisterChangeCB(Debugger_RcpIntrBreakpoints, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); + g_Settings->UnregisterChangeCB(Debugger_ShowUnhandledMemory, this, (CSettings::SettingChangedFunc)StaticRefreshSettings); } } @@ -105,6 +108,7 @@ void CDebugSettings::RefreshSettings() m_FpExceptionBreakpoints = m_HaveDebugger ? g_Settings->LoadDword(Debugger_FpExceptionBreakpoints) : 0; m_IntrBreakpoints = m_HaveDebugger ? g_Settings->LoadDword(Debugger_IntrBreakpoints) : 0; m_RcpIntrBreakpoints = m_HaveDebugger ? g_Settings->LoadDword(Debugger_RcpIntrBreakpoints) : 0; - + m_ShowUnhandledMemory = m_HaveDebugger && g_Settings->LoadBool(Debugger_ShowUnhandledMemory); + m_Debugging = m_HaveDebugger && (m_HaveExecutionBP || m_WaitingForStep || m_HaveWriteBP || m_HaveReadBP); } \ No newline at end of file diff --git a/Source/Project64-core/Settings/DebugSettings.h b/Source/Project64-core/Settings/DebugSettings.h index 36f98ab5d..8f64de72b 100644 --- a/Source/Project64-core/Settings/DebugSettings.h +++ b/Source/Project64-core/Settings/DebugSettings.h @@ -36,7 +36,8 @@ public: static inline uint32_t FpExceptionBreakpoints(void) { return m_FpExceptionBreakpoints; } static inline uint32_t IntrBreakpoints(void) { return m_IntrBreakpoints; } static inline uint32_t RcpIntrBreakpoints(void) { return m_RcpIntrBreakpoints; } - + static inline bool ShowUnhandledMemory(void) { return m_ShowUnhandledMemory; } + private: static void StaticRefreshSettings(CDebugSettings * _this) { @@ -63,7 +64,8 @@ private: static uint32_t m_FpExceptionBreakpoints; static uint32_t m_IntrBreakpoints; static uint32_t m_RcpIntrBreakpoints; - + static bool m_ShowUnhandledMemory; + static int32_t m_RefCount; static bool m_Registered; };