Put some debug conditionals around some printfs

This commit is contained in:
twinaphex 2018-02-22 22:23:10 +01:00
parent c179351426
commit 80a21f2ba8

View File

@ -568,6 +568,7 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
assert(code < 16);
#ifdef DEBUG
if(code != EXCEPTION_INT && code != EXCEPTION_BP && code != EXCEPTION_SYSCALL)
{
static const char* exmne[16] =
@ -578,6 +579,7 @@ uint32 NO_INLINE PS_CPU::Exception(uint32 code, uint32 PC, const uint32 NP, cons
PSX_DBG(PSX_DBG_WARNING, "[CPU] Exception %s(0x%02x) @ PC=0x%08x(NP=0x%08x, BDBT=0x%02x), Instr=0x%08x, IPCache=0x%02x, CAUSE=0x%08x, SR=0x%08x, IRQC_Status=0x%04x, IRQC_Mask=0x%04x\n",
exmne[code], code, PC, NP, BDBT, instr, IPCache, CP0.CAUSE, CP0.SR, IRQ_GetRegister(IRQ_GSREG_STATUS, NULL, 0), IRQ_GetRegister(IRQ_GSREG_MASK, NULL, 0));
}
#endif
if(CP0.SR & (1 << 22)) // BEV
handler = 0xBFC00180;
@ -1177,10 +1179,12 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
break;
case CP0REG_DCIC:
#ifdef DEBUG
if(val)
{
PSX_DBG(PSX_DBG_WARNING, "[CPU] Non-zero write to DCIC: 0x%08x\n", val);
}
#endif
CP0.DCIC = val & 0xFF80003F;
break;
@ -1212,7 +1216,9 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
const uint32 immediate = (int32)(int16)(instr & 0xFFFF);
const bool result = (false == (bool)(instr & (1U << 16)));
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] BC0x instruction(0x%08x) @ PC=0x%08x\n", instr, PC);
#endif
DO_BRANCH(result, (immediate << 2), ~0U, false, 0);
}
@ -1336,7 +1342,9 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
const uint32 immediate = (int32)(int16)(instr & 0xFFFF);
const bool result = (false == (bool)(instr & (1U << 16)));
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] BC2x instruction(0x%08x) @ PC=0x%08x\n", instr, PC);
#endif
DO_BRANCH(result, (immediate << 2), ~0U, false, 0);
}
@ -1367,7 +1375,9 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
{
const uint32 sub_op = (instr >> 21) & 0x1F;
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] COP%u instruction(0x%08x) @ PC=0x%08x\n", (instr >> 26) & 0x3, instr, PC);
#endif
if(sub_op == 0x08 || sub_op == 0x0C)
{
@ -1401,7 +1411,9 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
}
else
{
#ifdef DEBUG
PSX_DBG(PSX_DBG_WARNING, "[CPU] LWC%u instruction(0x%08x) @ PC=0x%08x\n", (instr >> 26) & 0x3, instr, PC);
#endif
ReadMemory<uint32>(timestamp, address, false, true);
}
@ -1457,11 +1469,13 @@ pscpu_timestamp_t PS_CPU::RunReal(pscpu_timestamp_t timestamp_in)
CP0.BADA = address;
new_PC = Exception(EXCEPTION_ADES, PC, new_PC, instr);
}
#ifdef DEBUG
else
{
PSX_DBG(PSX_DBG_WARNING, "[CPU] SWC%u instruction(0x%08x) @ PC=0x%08x\n", (instr >> 26) & 0x3, instr, PC);
//WriteMemory<uint32>(timestamp, address, SOMETHING);
}
#endif
}
END_OPF;