DSPSpy: Hide loop stack registers - they aren't relevant for most investigations.

Highlight differences on both sides.
Show the accelerator subregs in order.
Make it possible to include some code from Dolphin into DSPSpy, good for grabbing useful #defines. (had to change the GEKKO log to POWERPC).

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3120 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-05-01 15:17:03 +00:00
parent 397af9ade4
commit b0bb4e6335
19 changed files with 103 additions and 88 deletions
+3 -3
View File
@@ -378,7 +378,7 @@ void Advance()
}
if (!first)
{
WARN_LOG(GEKKO, "WARNING - no events in queue. Setting downcount to 10000");
WARN_LOG(POWERPC, "WARNING - no events in queue. Setting downcount to 10000");
downcount += 10000;
}
else
@@ -397,14 +397,14 @@ void LogPendingEvents()
Event *ptr = first;
while (ptr)
{
INFO_LOG(GEKKO, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type);
INFO_LOG(POWERPC, "PENDING: Now: %lld Pending: %lld Type: %d", globalTimer, ptr->time, ptr->type);
ptr = ptr->next;
}
}
void Idle()
{
DEBUG_LOG(GEKKO, "Idle");
DEBUG_LOG(POWERPC, "Idle");
idledCycles += downcount;
downcount = 0;
+1 -1
View File
@@ -660,7 +660,7 @@ void CatchUpGPU()
//MessageBox(0,"Breakpoint enabled",0,0);
if ((fifo.CPReadPointer & ~0x1F) == (fifo.CPBreakpoint & ~0x1F))
{
//_assert_msg_(GEKKO,0,"BP: %08x",fifo.CPBreakpoint);
//_assert_msg_(POWERPC,0,"BP: %08x",fifo.CPBreakpoint);
//LOG(COMMANDPROCESSOR,"!!! BP irq raised");
fifo.bFF_Breakpoint = 1;
m_CPStatusReg.Breakpoint = 1;
@@ -148,7 +148,7 @@ void Run()
//2: check for breakpoint
if (BreakPoints::IsAddressBreakPoint(PC))
{
INFO_LOG(GEKKO, "Hit Breakpoint - %08x", PC);
INFO_LOG(POWERPC, "Hit Breakpoint - %08x", PC);
CCPU::Break();
if (BreakPoints::IsTempBreakPoint(PC))
BreakPoints::Remove(PC);
@@ -193,7 +193,7 @@ void unknown_instruction(UGeckoInstruction _inst)
DisassembleGekko(Memory::ReadUnchecked_U32(last_pc), last_pc, disasm, 256);
printf("Last PC = %08x : %s\n", last_pc, disasm);
Debugger::PrintCallstack();
_dbg_assert_msg_(GEKKO, 0, "\nIntCPU: Unknown instr %08x at PC = %08x last_PC = %08x LR = %08x\n", _inst.hex, PC, last_pc, LR);
_dbg_assert_msg_(POWERPC, 0, "\nIntCPU: Unknown instr %08x at PC = %08x last_PC = %08x LR = %08x\n", _inst.hex, PC, last_pc, LR);
}
} // namespace
@@ -108,7 +108,7 @@ void HLEFunction(UGeckoInstruction _inst)
void CompiledBlock(UGeckoInstruction _inst)
{
_assert_msg_(GEKKO, 0, "CompiledBlock - shouldn't be here!");
_assert_msg_(POWERPC, 0, "CompiledBlock - shouldn't be here!");
}
void rfi(UGeckoInstruction _inst)
@@ -129,7 +129,7 @@ void rfi(UGeckoInstruction _inst)
void rfid(UGeckoInstruction _inst)
{
_dbg_assert_msg_(GEKKO,0,"Instruction unimplemented (does this instruction even exist?)","rfid");
_dbg_assert_msg_(POWERPC,0,"Instruction unimplemented (does this instruction even exist?)","rfid");
m_EndBlock = true;
}
@@ -169,7 +169,7 @@ void twi(UGeckoInstruction _inst)
s32 b = _inst.SIMM_16;
s32 TO = _inst.TO;
ERROR_LOG(GEKKO, "twi rA %x SIMM %x TO %0x", a, b, TO);
ERROR_LOG(POWERPC, "twi rA %x SIMM %x TO %0x", a, b, TO);
if ( ((a < b) && (TO & 0x10))
|| ((a > b) && (TO & 0x08))
@@ -397,7 +397,7 @@ void tw(UGeckoInstruction _inst)
s32 b = m_GPR[_inst.RB];
s32 TO = _inst.TO;
ERROR_LOG(GEKKO, "tw rA %0x rB %0x TO %0x", a, b, TO);
ERROR_LOG(POWERPC, "tw rA %0x rB %0x TO %0x", a, b, TO);
if ( ((a < b) && (TO & 0x10))
|| ((a > b) && (TO & 0x08))
@@ -265,7 +265,7 @@ void stwu(UGeckoInstruction _inst)
void dcba(UGeckoInstruction _inst)
{
_assert_msg_(GEKKO,0,"dcba - Not implemented - not a Gekko instruction");
_assert_msg_(POWERPC,0,"dcba - Not implemented - not a Gekko instruction");
}
void dcbf(UGeckoInstruction _inst)
@@ -285,24 +285,24 @@ void dcbf(UGeckoInstruction _inst)
void dcbi(UGeckoInstruction _inst)
{
//Used during initialization
//_assert_msg_(GEKKO,0,"dcbi - Not implemented");
//_assert_msg_(POWERPC,0,"dcbi - Not implemented");
}
void dcbst(UGeckoInstruction _inst)
{
//_assert_msg_(GEKKO,0,"dcbst - Not implemented");
//_assert_msg_(POWERPC,0,"dcbst - Not implemented");
}
void dcbt(UGeckoInstruction _inst)
{
//This should tell GFX plugin to throw out any cached data here
//Used by Ikaruga
//_assert_msg_(GEKKO,0,"dcbt - Not implemented");
//_assert_msg_(POWERPC,0,"dcbt - Not implemented");
}
void dcbtst(UGeckoInstruction _inst)
{
_assert_msg_(GEKKO,0,"dcbtst - Not implemented");
_assert_msg_(POWERPC,0,"dcbtst - Not implemented");
}
// __________________________________________________________________________________________________
@@ -324,17 +324,17 @@ void dcbz(UGeckoInstruction _inst)
void eciwx(UGeckoInstruction _inst)
{
_assert_msg_(GEKKO,0,"eciwx - Not implemented");
_assert_msg_(POWERPC,0,"eciwx - Not implemented");
}
void ecowx(UGeckoInstruction _inst)
{
_assert_msg_(GEKKO,0,"ecowx - Not implemented");
_assert_msg_(POWERPC,0,"ecowx - Not implemented");
}
void eieio(UGeckoInstruction _inst)
{
_assert_msg_(GEKKO,0,"eieio - Not implemented");
_assert_msg_(POWERPC,0,"eieio - Not implemented");
}
void icbi(UGeckoInstruction _inst)
@@ -110,7 +110,7 @@ void Helper_Quantize(const u32 _Addr, const float _fValue,
break;
default:
_dbg_assert_msg_(GEKKO,0,"PS dequantize","Unknown type to read");
_dbg_assert_msg_(POWERPC,0,"PS dequantize","Unknown type to read");
break;
}
}
@@ -147,7 +147,7 @@ float Helper_Dequantize(const u32 _Addr, const EQuantizeType _quantizeType,
break;
default:
_dbg_assert_msg_(GEKKO,0,"PS dequantize","Unknown type to read");
_dbg_assert_msg_(POWERPC,0,"PS dequantize","Unknown type to read");
fResult = 0;
break;
}
@@ -297,7 +297,7 @@ void mftb(UGeckoInstruction _inst)
int iIndex = (_inst.TBR >> 5) | ((_inst.TBR & 0x1F) << 5);
if (iIndex == 268) m_GPR[_inst.RD] = TL;
else if (iIndex == 269) m_GPR[_inst.RD] = TU;
else _dbg_assert_(GEKKO,0);
else _dbg_assert_(POWERPC, 0);
}
@@ -372,14 +372,14 @@ void mtspr(UGeckoInstruction _inst)
//TODO(ector): Protect LC memory if LCE is false.
//TODO(ector): Honor PSE.
//_assert_msg_(GEKKO, WriteGatherPipeEnable, "Write gather pipe not enabled!");
//_assert_msg_(POWERPC, WriteGatherPipeEnable, "Write gather pipe not enabled!");
//if ((HID2.PSE == 0))
// MessageBox(NULL, "PSE in HID2 is set", "Warning", MB_OK);
}
break;
case SPR_WPAR:
_assert_msg_(GEKKO, m_GPR[_inst.RD] == 0x0C008000, "Gather pipe @ %08x");
_assert_msg_(POWERPC, m_GPR[_inst.RD] == 0x0C008000, "Gather pipe @ %08x");
GPFifo::ResetGatherPipe();
break;
+4 -4
View File
@@ -313,7 +313,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
UGeckoInstruction untouched_op = Memory::ReadUnchecked_U32(code[i].address);
if (untouched_op.OPCD == 1) // Do handle HLE instructions.
inst = untouched_op;
_assert_msg_(GEKKO, inst.hex != 0, "Zero Op - Error flattening %08x op %08x", address + i*4, inst.hex);
_assert_msg_(POWERPC, inst.hex != 0, "Zero Op - Error flattening %08x op %08x", address + i*4, inst.hex);
code[i].inst = inst;
code[i].branchTo = -1;
code[i].branchToIndex = -1;
@@ -321,7 +321,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
GekkoOPInfo *opinfo = GetOpInfo(inst);
if (opinfo)
numCycles += opinfo->numCyclesMinusOne + 1;
_assert_msg_(GEKKO, opinfo != 0, "Invalid Op - Error flattening %08x op %08x", address + i*4, inst.hex);
_assert_msg_(POWERPC, opinfo != 0, "Invalid Op - Error flattening %08x op %08x", address + i*4, inst.hex);
bool follow = false;
u32 destination;
if (inst.OPCD == 18)
@@ -355,7 +355,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
}
}
_assert_msg_(GEKKO, foundExit, "Analyzer ERROR - Function %08x too big", blockstart);
_assert_msg_(POWERPC, foundExit, "Analyzer ERROR - Function %08x too big", blockstart);
num_inst++; // why?
st->numCycles = numCycles;
@@ -381,7 +381,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
code[i].wantsPS1 = false;
const GekkoOPInfo *opinfo = GetOpInfo(code[i].inst);
_assert_msg_(GEKKO, opinfo != 0, "Invalid Op - Error scanning %08x op %08x",address+i*4,inst.hex);
_assert_msg_(POWERPC, opinfo != 0, "Invalid Op - Error scanning %08x op %08x",address+i*4,inst.hex);
int flags = opinfo->flags;
if (flags & FL_TIMER)
+5 -5
View File
@@ -86,7 +86,7 @@ GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
case 59: return m_infoTable59[_inst.SUBOP5];
case 63: return m_infoTable63[_inst.SUBOP10];
default:
_assert_msg_(GEKKO,0,"GetOpInfo - invalid subtable op %08x @ %08x", _inst.hex, PC);
_assert_msg_(POWERPC,0,"GetOpInfo - invalid subtable op %08x @ %08x", _inst.hex, PC);
return 0;
}
}
@@ -94,7 +94,7 @@ GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
{
if ((info->type & 0xFFFFFF) == OPTYPE_INVALID)
{
_assert_msg_(GEKKO,0,"GetOpInfo - invalid op %08x @ %08x", _inst.hex, PC);
_assert_msg_(POWERPC,0,"GetOpInfo - invalid op %08x @ %08x", _inst.hex, PC);
return 0;
}
return m_infoTable[_inst.OPCD];
@@ -115,7 +115,7 @@ Interpreter::_interpreterInstruction GetInterpreterOp(UGeckoInstruction _inst)
case 59: return Interpreter::m_opTable59[_inst.SUBOP5];
case 63: return Interpreter::m_opTable63[_inst.SUBOP10];
default:
_assert_msg_(GEKKO,0,"GetInterpreterOp - invalid subtable op %08x @ %08x", _inst.hex, PC);
_assert_msg_(POWERPC,0,"GetInterpreterOp - invalid subtable op %08x @ %08x", _inst.hex, PC);
return 0;
}
}
@@ -123,7 +123,7 @@ Interpreter::_interpreterInstruction GetInterpreterOp(UGeckoInstruction _inst)
{
if ((info->type & 0xFFFFFF) == OPTYPE_INVALID)
{
_assert_msg_(GEKKO,0,"GetInterpreterOp - invalid op %08x @ %08x", _inst.hex, PC);
_assert_msg_(POWERPC,0,"GetInterpreterOp - invalid op %08x @ %08x", _inst.hex, PC);
return 0;
}
return Interpreter::m_opTable[_inst.OPCD];
@@ -739,7 +739,7 @@ void PrintInstructionRunCounts()
{
if (temp[i].count == 0)
break;
DEBUG_LOG(GEKKO, "%s : %i", temp[i].name,temp[i].count);
DEBUG_LOG(POWERPC, "%s : %i", temp[i].name,temp[i].count);
//PanicAlert("%s : %i", temp[i].name,temp[i].count);
}
}
+11 -11
View File
@@ -237,7 +237,7 @@ void CheckExceptions()
MSR &= ~0x04EF36;
NPC = 0x80000400;
INFO_LOG(GEKKO, "EXCEPTION_ISI");
INFO_LOG(POWERPC, "EXCEPTION_ISI");
ppcState.Exceptions &= ~EXCEPTION_ISI;
}
else if (ppcState.Exceptions & EXCEPTION_PROGRAM)
@@ -250,7 +250,7 @@ void CheckExceptions()
MSR &= ~0x04EF36;
NPC = 0x80000700;
INFO_LOG(GEKKO, "EXCEPTION_PROGRAM");
INFO_LOG(POWERPC, "EXCEPTION_PROGRAM");
ppcState.Exceptions &= ~EXCEPTION_PROGRAM;
}
else if (ppcState.Exceptions & EXCEPTION_SYSCALL)
@@ -261,7 +261,7 @@ void CheckExceptions()
MSR &= ~0x04EF36;
NPC = 0x80000C00;
INFO_LOG(GEKKO, "EXCEPTION_SYSCALL (PC=%08x)", PC);
INFO_LOG(POWERPC, "EXCEPTION_SYSCALL (PC=%08x)", PC);
ppcState.Exceptions &= ~EXCEPTION_SYSCALL;
}
else if (ppcState.Exceptions & EXCEPTION_FPU_UNAVAILABLE)
@@ -273,7 +273,7 @@ void CheckExceptions()
MSR &= ~0x04EF36;
NPC = 0x80000800;
INFO_LOG(GEKKO, "EXCEPTION_FPU_UNAVAILABLE");
INFO_LOG(POWERPC, "EXCEPTION_FPU_UNAVAILABLE");
ppcState.Exceptions &= ~EXCEPTION_FPU_UNAVAILABLE;
}
else if (ppcState.Exceptions & EXCEPTION_DSI)
@@ -285,7 +285,7 @@ void CheckExceptions()
NPC = 0x80000300;
//DSISR and DAR regs are changed in GenerateDSIException()
INFO_LOG(GEKKO, "EXCEPTION_DSI");
INFO_LOG(POWERPC, "EXCEPTION_DSI");
ppcState.Exceptions &= ~EXCEPTION_DSI;
}
else if (ppcState.Exceptions & EXCEPTION_ALIGNMENT)
@@ -300,7 +300,7 @@ void CheckExceptions()
//TODO crazy amount of DSISR options to check out
INFO_LOG(GEKKO, "EXCEPTION_ALIGNMENT");
INFO_LOG(POWERPC, "EXCEPTION_ALIGNMENT");
ppcState.Exceptions &= ~EXCEPTION_ALIGNMENT;
}
@@ -316,10 +316,10 @@ void CheckExceptions()
MSR &= ~0x04EF36;
NPC = 0x80000500;
INFO_LOG(GEKKO, "EXCEPTION_EXTERNAL_INT");
INFO_LOG(POWERPC, "EXCEPTION_EXTERNAL_INT");
ppcState.Exceptions &= ~EXCEPTION_EXTERNAL_INT;
_dbg_assert_msg_(GEKKO, (SRR1 & 0x02) != 0, "GEKKO", "EXTERNAL_INT unrecoverable???");
_dbg_assert_msg_(POWERPC, (SRR1 & 0x02) != 0, "GEKKO", "EXTERNAL_INT unrecoverable???");
}
else if (ppcState.Exceptions & EXCEPTION_DECREMENTER)
{
@@ -329,13 +329,13 @@ void CheckExceptions()
MSR &= ~0x04EF36;
NPC = 0x80000900;
INFO_LOG(GEKKO, "EXCEPTION_DECREMENTER");
INFO_LOG(POWERPC, "EXCEPTION_DECREMENTER");
ppcState.Exceptions &= ~EXCEPTION_DECREMENTER;
}
else
{
_dbg_assert_msg_(GEKKO, 0, "Unknown EXT interrupt: Exceptions == %08x", ppcState.Exceptions);
ERROR_LOG(GEKKO, "Unknown EXTERNAL INTERRUPT exception: Exceptions == %08x", ppcState.Exceptions);
_dbg_assert_msg_(POWERPC, 0, "Unknown EXT interrupt: Exceptions == %08x", ppcState.Exceptions);
ERROR_LOG(POWERPC, "Unknown EXTERNAL INTERRUPT exception: Exceptions == %08x", ppcState.Exceptions);
}
}
}
+1 -1
View File
@@ -81,7 +81,7 @@ int SyncTrace()
{
if (PowerPC::ppcState.gpr[i] != state.gpr[i])
{
DEBUG_LOG(GEKKO, "DIFFERENCE - r%i (local %08x, remote %08x)", i, PowerPC::ppcState.gpr[i], state.gpr[i]);
DEBUG_LOG(POWERPC, "DIFFERENCE - r%i (local %08x, remote %08x)", i, PowerPC::ppcState.gpr[i], state.gpr[i]);
difference = true;
}
}