summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLC <mathew1800@gmail.com>2020-10-19 07:56:42 -0400
committerGitHub <noreply@github.com>2020-10-19 07:56:42 -0400
commit49c7a5b289bced9f2ba1cd93af426357bfbceda6 (patch)
tree1d2252b0a335f726a5d3f5460840863cd3ad604d /Source/Core
parentfc5fbf51347b4e59472526dbf1c492296514c3e8 (diff)
parentfa866062cae92144af091e2cb16a1dce52200778 (diff)
Merge pull request #9121 from Sammi-Husky/bat-registers
DolphinQt/Debugger: Fix DBAT and IBAT registers in RegisterWidget
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Debugger/RegisterWidget.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
index 8a75394fb7..baab7f5159 100644
--- a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
+++ b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
@@ -242,7 +242,10 @@ void RegisterWidget::PopulateTable()
[i](u64 value) { rPS(i).SetPS1(value); });
}
- for (int i = 0; i < 8; i++)
+ // The IBAT and DBAT registers have a large gap between
+ // registers 3 and 4 so we can't just use SPR_IBAT0U or
+ // SPR_DBAT0U as low-index the entire way
+ for (int i = 0; i < 4; i++)
{
// IBAT registers
AddRegister(
@@ -252,6 +255,14 @@ void RegisterWidget::PopulateTable()
PowerPC::ppcState.spr[SPR_IBAT0L + i * 2];
},
nullptr);
+ AddRegister(
+ i + 4, 5, RegisterType::ibat, "IBAT" + std::to_string(4 + i),
+ [i] {
+ return (static_cast<u64>(PowerPC::ppcState.spr[SPR_IBAT4U + i * 2]) << 32) +
+ PowerPC::ppcState.spr[SPR_IBAT4L + i * 2];
+ },
+ nullptr);
+
// DBAT registers
AddRegister(
i + 8, 5, RegisterType::dbat, "DBAT" + std::to_string(i),
@@ -260,6 +271,17 @@ void RegisterWidget::PopulateTable()
PowerPC::ppcState.spr[SPR_DBAT0L + i * 2];
},
nullptr);
+ AddRegister(
+ i + 12, 5, RegisterType::dbat, "DBAT" + std::to_string(4 + i),
+ [i] {
+ return (static_cast<u64>(PowerPC::ppcState.spr[SPR_DBAT4U + i * 2]) << 32) +
+ PowerPC::ppcState.spr[SPR_DBAT4L + i * 2];
+ },
+ nullptr);
+ }
+
+ for (int i = 0; i < 8; i++)
+ {
// Graphics quantization registers
AddRegister(
i + 16, 7, RegisterType::gqr, "GQR" + std::to_string(i),