Merge pull request #9121 from Sammi-Husky/bat-registers

DolphinQt/Debugger: Fix DBAT and IBAT registers in RegisterWidget
This commit is contained in:
LC 2020-10-19 07:56:42 -04:00 committed by GitHub
commit 49c7a5b289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 1 deletions

View File

@ -242,7 +242,10 @@ void RegisterWidget::PopulateTable()
[i](u64 value) { rPS(i).SetPS1(value); }); [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 // IBAT registers
AddRegister( AddRegister(
@ -252,6 +255,14 @@ void RegisterWidget::PopulateTable()
PowerPC::ppcState.spr[SPR_IBAT0L + i * 2]; PowerPC::ppcState.spr[SPR_IBAT0L + i * 2];
}, },
nullptr); 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 // DBAT registers
AddRegister( AddRegister(
i + 8, 5, RegisterType::dbat, "DBAT" + std::to_string(i), i + 8, 5, RegisterType::dbat, "DBAT" + std::to_string(i),
@ -260,6 +271,17 @@ void RegisterWidget::PopulateTable()
PowerPC::ppcState.spr[SPR_DBAT0L + i * 2]; PowerPC::ppcState.spr[SPR_DBAT0L + i * 2];
}, },
nullptr); 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 // Graphics quantization registers
AddRegister( AddRegister(
i + 16, 7, RegisterType::gqr, "GQR" + std::to_string(i), i + 16, 7, RegisterType::gqr, "GQR" + std::to_string(i),