[Project64] Change g_Settings->LoadBool(Debugger_Enabled) to CDebugSettings::bHaveDebugger()

This commit is contained in:
zilmar 2017-09-13 20:08:47 +10:00
parent 52e0470f5b
commit 857f87116e
3 changed files with 33 additions and 33 deletions

View File

@ -97,7 +97,7 @@ bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2)
case R4300i_SPECIAL_DDIVU: case R4300i_SPECIAL_DDIVU:
break; break;
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); 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_TLBWR: break;
case R4300i_COP0_CO_TLBP: break; case R4300i_COP0_CO_TLBP: break;
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?\n6", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); 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 else
{ {
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?\n7", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); 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_W: break;
case R4300i_COP1_L: break; case R4300i_COP1_L: break;
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); 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_SDC1: break;
case R4300i_SD: break; case R4300i_SD: break;
default: default:
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError(stdstr_f("Does %s effect Delay slot at %X?", R4300iOpcodeName(Command.Hex, PC + 4), PC).c_str()); 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; continue;
} }
if (!g_Debugger->CPUStepStarted()) if (CDebugSettings::bHaveDebugger() && !g_Debugger->CPUStepStarted())
{ {
// Skip command if instructed by the debugger // Skip command if instructed by the debugger
PROGRAM_COUNTER += 4; PROGRAM_COUNTER += 4;
@ -315,7 +315,7 @@ void CInterpreterCPU::ExecuteCPU()
m_R4300i_Opcode[Opcode.op](); m_R4300i_Opcode[Opcode.op]();
NextTimer -= CountPerOp; NextTimer -= CountPerOp;
g_Debugger->CPUStep(); if (CDebugSettings::bHaveDebugger()) { g_Debugger->CPUStep(); }
PROGRAM_COUNTER += 4; PROGRAM_COUNTER += 4;
switch (R4300iOp::m_NextInstruction) switch (R4300iOp::m_NextInstruction)

View File

@ -2094,7 +2094,7 @@ void R4300iOp::REGIMM_BGEZAL()
m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4;
if ((*_PROGRAM_COUNTER) == m_JumpToLocation) if ((*_PROGRAM_COUNTER) == m_JumpToLocation)
{ {
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
if (g_Reg->m_PROGRAM_COUNTER < 0x80000400) if (g_Reg->m_PROGRAM_COUNTER < 0x80000400)
{ {

View File

@ -376,7 +376,7 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter()
Jump_CoP1_S[5] = R4300iOp::COP1_S_ABS; Jump_CoP1_S[5] = R4300iOp::COP1_S_ABS;
Jump_CoP1_S[6] = R4300iOp::COP1_S_MOV; Jump_CoP1_S[6] = R4300iOp::COP1_S_MOV;
Jump_CoP1_S[7] = R4300iOp::COP1_S_NEG; Jump_CoP1_S[7] = R4300iOp::COP1_S_NEG;
Jump_CoP1_S[8] = R4300iOp::COP1_S_ROUND_L; Jump_CoP1_S[8] = R4300iOp::COP1_S_ROUND_L;
Jump_CoP1_S[9] = R4300iOp::COP1_S_TRUNC_L; Jump_CoP1_S[9] = R4300iOp::COP1_S_TRUNC_L;
Jump_CoP1_S[10] = R4300iOp::COP1_S_CEIL_L; Jump_CoP1_S[10] = R4300iOp::COP1_S_CEIL_L;
Jump_CoP1_S[11] = R4300iOp::COP1_S_FLOOR_L; Jump_CoP1_S[11] = R4300iOp::COP1_S_FLOOR_L;
@ -1184,7 +1184,7 @@ void R4300iOp32::SPECIAL_SLTU()
void R4300iOp32::SPECIAL_TEQ() void R4300iOp32::SPECIAL_TEQ()
{ {
if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && g_Settings->LoadBool(Debugger_Enabled)) if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError("Should trap this ???"); g_Notify->DisplayError("Should trap this ???");
} }
@ -1302,18 +1302,18 @@ void R4300iOp32::REGIMM_BGEZAL()
m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4;
if ((*_PROGRAM_COUNTER) == m_JumpToLocation) if ((*_PROGRAM_COUNTER) == m_JumpToLocation)
{ {
if (g_Settings->LoadBool(Debugger_Enabled)) if (CDebugSettings::bHaveDebugger())
{ {
if (g_Reg->m_PROGRAM_COUNTER < 0x80000400) if (g_Reg->m_PROGRAM_COUNTER < 0x80000400)
{ {
// Break out of possible checksum halt // Break out of possible checksum halt
g_Notify->DisplayMessage(5, "Broke out of permanent loop! Invalid checksum?"); g_Notify->DisplayMessage(5, "Broke out of permanent loop! Invalid checksum?");
m_JumpToLocation = (*_PROGRAM_COUNTER) + 8; m_JumpToLocation = (*_PROGRAM_COUNTER) + 8;
_GPR[31].DW = (int32_t)((*_PROGRAM_COUNTER) + 8); _GPR[31].DW = (int32_t)((*_PROGRAM_COUNTER) + 8);
R4300iOp::m_NextInstruction = DELAY_SLOT; R4300iOp::m_NextInstruction = DELAY_SLOT;
return; return;
} }
} }
if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0))
{ {
CInterpreterCPU::InPermLoop(); CInterpreterCPU::InPermLoop();
@ -1397,7 +1397,7 @@ void R4300iOp32::COP0_MT()
{ {
_CP0[m_Opcode.rd] = _GPR[m_Opcode.rt].UW[0]; _CP0[m_Opcode.rd] = _GPR[m_Opcode.rt].UW[0];
} }
if ((_CP0[m_Opcode.rd] & 0x18) != 0 && g_Settings->LoadBool(Debugger_Enabled)) if ((_CP0[m_Opcode.rd] & 0x18) != 0 && CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError("Left kernel mode ??"); g_Notify->DisplayError("Left kernel mode ??");
} }
@ -1405,7 +1405,7 @@ void R4300iOp32::COP0_MT()
break; break;
case 13: //cause case 13: //cause
_CP0[m_Opcode.rd] &= 0xFFFFCFF; _CP0[m_Opcode.rd] &= 0xFFFFCFF;
if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && g_Settings->LoadBool(Debugger_Enabled)) if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && CDebugSettings::bHaveDebugger())
{ {
g_Notify->DisplayError("Set IP0 or IP1"); g_Notify->DisplayError("Set IP0 or IP1");
} }
@ -1427,7 +1427,7 @@ void R4300iOp32::COP1_CF()
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION
if (m_Opcode.fs != 31 && m_Opcode.fs != 0) if (m_Opcode.fs != 31 && m_Opcode.fs != 0)
{ {
if (g_Settings->LoadBool(Debugger_Enabled)) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); } if (CDebugSettings::bHaveDebugger()) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); }
return; return;
} }
_GPR[m_Opcode.rt].W[0] = (int32_t)_FPCR[m_Opcode.fs]; _GPR[m_Opcode.rt].W[0] = (int32_t)_FPCR[m_Opcode.fs];