mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 06:21:26 +12:00
cleanup rsx fifo debugger command display
This commit is contained in:
parent
098d634328
commit
c50d459b1e
2 changed files with 34 additions and 27 deletions
|
@ -734,7 +734,7 @@ std::string rsx::get_method_name(const u32 id)
|
||||||
return std::string("CELL_GCM_") + found->second;
|
return std::string("CELL_GCM_") + found->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt::format("Unknown/illegal method [0x%08x]", id << 2);
|
return fmt::format("Unknown/illegal method [0x%04x]", id << 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Various parameter pretty printing function
|
// Various parameter pretty printing function
|
||||||
|
|
|
@ -635,7 +635,7 @@ void rsx_debugger::GetMemory()
|
||||||
// Write information
|
// Write information
|
||||||
for(u32 i=0, addr = m_addr; i < item_count; i++, addr += 4)
|
for(u32 i=0, addr = m_addr; i < item_count; i++, addr += 4)
|
||||||
{
|
{
|
||||||
QTableWidgetItem* address_item = new QTableWidgetItem(qstr(fmt::format("%08x", addr)));
|
QTableWidgetItem* address_item = new QTableWidgetItem(qstr(fmt::format("%07x", addr)));
|
||||||
address_item->setData(Qt::UserRole, addr);
|
address_item->setData(Qt::UserRole, addr);
|
||||||
m_list_commands->setItem(i, 0, address_item);
|
m_list_commands->setItem(i, 0, address_item);
|
||||||
|
|
||||||
|
@ -1085,31 +1085,38 @@ QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 ioAddr)
|
||||||
std::string disasm;
|
std::string disasm;
|
||||||
|
|
||||||
#define DISASM(string, ...) { if(disasm.empty()) disasm = fmt::format((string), ##__VA_ARGS__); else disasm += (' ' + fmt::format((string), ##__VA_ARGS__)); }
|
#define DISASM(string, ...) { if(disasm.empty()) disasm = fmt::format((string), ##__VA_ARGS__); else disasm += (' ' + fmt::format((string), ##__VA_ARGS__)); }
|
||||||
|
|
||||||
|
if (cmd & RSX_METHOD_NON_METHOD_CMD_MASK)
|
||||||
|
{
|
||||||
if((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD)
|
if((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD)
|
||||||
{
|
{
|
||||||
u32 jumpAddr = cmd & RSX_METHOD_OLD_JUMP_OFFSET_MASK;
|
u32 jumpAddr = cmd & RSX_METHOD_OLD_JUMP_OFFSET_MASK;
|
||||||
DISASM("JUMP: %08x -> %08x", ioAddr, jumpAddr);
|
DISASM("JUMP to 0x%07x", jumpAddr);
|
||||||
}
|
}
|
||||||
else if((cmd & RSX_METHOD_NEW_JUMP_CMD_MASK) == RSX_METHOD_NEW_JUMP_CMD)
|
else if((cmd & RSX_METHOD_NEW_JUMP_CMD_MASK) == RSX_METHOD_NEW_JUMP_CMD)
|
||||||
{
|
{
|
||||||
u32 jumpAddr = cmd & RSX_METHOD_NEW_JUMP_OFFSET_MASK;
|
u32 jumpAddr = cmd & RSX_METHOD_NEW_JUMP_OFFSET_MASK;
|
||||||
DISASM("JUMP: %08x -> %08x", ioAddr, jumpAddr);
|
DISASM("JUMP to 0x%07x", jumpAddr);
|
||||||
}
|
}
|
||||||
else if((cmd & RSX_METHOD_CALL_CMD_MASK) == RSX_METHOD_CALL_CMD)
|
else if((cmd & RSX_METHOD_CALL_CMD_MASK) == RSX_METHOD_CALL_CMD)
|
||||||
{
|
{
|
||||||
u32 callAddr = cmd & RSX_METHOD_CALL_OFFSET_MASK;
|
u32 callAddr = cmd & RSX_METHOD_CALL_OFFSET_MASK;
|
||||||
DISASM("CALL: %08x -> %08x", ioAddr, callAddr);
|
DISASM("CALL to 0x%07x", callAddr);
|
||||||
}
|
}
|
||||||
if((cmd & ~0xfffc) == RSX_METHOD_RETURN_CMD)
|
else if((cmd & RSX_METHOD_RETURN_MASK) == RSX_METHOD_RETURN_CMD)
|
||||||
{
|
{
|
||||||
DISASM("RETURN");
|
DISASM("RETURN");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if((cmd & ~(RSX_METHOD_NON_INCREMENT_CMD | 0xfffc)) == 0)
|
{
|
||||||
|
DISASM("Not a command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((cmd & RSX_METHOD_NOP_MASK) == RSX_METHOD_NOP_CMD)
|
||||||
{
|
{
|
||||||
DISASM("NOP");
|
DISASM("NOP");
|
||||||
}
|
}
|
||||||
else if (!(cmd & RSX_METHOD_NON_METHOD_CMD_MASK))
|
else
|
||||||
{
|
{
|
||||||
auto args = vm::get_super_ptr<u32>(RSXIOMem.RealAddr(ioAddr + 4));
|
auto args = vm::get_super_ptr<u32>(RSXIOMem.RealAddr(ioAddr + 4));
|
||||||
|
|
||||||
|
@ -1121,7 +1128,7 @@ QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 ioAddr)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case_16(NV4097_SET_TEXTURE_OFFSET, 0x20):
|
case_16(NV4097_SET_TEXTURE_OFFSET, 0x20):
|
||||||
DISASM("Texture Offset[%d]: %08x", index, (u32)args[0]);
|
DISASM("Texture Offset[%d]: %07x", index, (u32)args[0]);
|
||||||
switch ((args[1] & 0x3) - 1)
|
switch ((args[1] & 0x3) - 1)
|
||||||
{
|
{
|
||||||
case CELL_GCM_LOCATION_LOCAL: DISASM("(Local memory);"); break;
|
case CELL_GCM_LOCATION_LOCAL: DISASM("(Local memory);"); break;
|
||||||
|
@ -1145,12 +1152,12 @@ QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 ioAddr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((cmd & RSX_METHOD_NON_INCREMENT_CMD_MASK) == RSX_METHOD_NON_INCREMENT_CMD)
|
if((cmd & RSX_METHOD_NON_INCREMENT_CMD_MASK) == RSX_METHOD_NON_INCREMENT_CMD && count > 1)
|
||||||
{
|
{
|
||||||
DISASM("Non Increment cmd");
|
DISASM("Non Increment cmd");
|
||||||
}
|
}
|
||||||
|
|
||||||
DISASM("[0x%08x(", cmd);
|
DISASM("(");
|
||||||
|
|
||||||
for(uint i=0; i<count; ++i)
|
for(uint i=0; i<count; ++i)
|
||||||
{
|
{
|
||||||
|
@ -1158,7 +1165,7 @@ QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 ioAddr)
|
||||||
disasm += fmt::format("0x%x", (u32)args[i]);
|
disasm += fmt::format("0x%x", (u32)args[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
disasm += ")]";
|
disasm += ")";
|
||||||
}
|
}
|
||||||
#undef DISASM
|
#undef DISASM
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue