Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DolphinQt/Debugger: Fix DBAT and IBAT registers in RegisterWidget #9121

Merged
merged 1 commit into from
Oct 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 23 additions & 1 deletion Source/Core/DolphinQt/Debugger/RegisterWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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),
Expand All @@ -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),
Expand Down