From 02da306d9a8bc3c101258a3f896e5c49adb10af0 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 13 Mar 2019 15:40:34 -0400 Subject: [PATCH] DolphinQt/Debugger/RegisterColumn: Add HID registers to the register pane Adds the Hardware Implementation-Dependent registers to the register pane, which makes it much nicer to see which hardware-specific features are enabled or disabled. --- Source/Core/DolphinQt/Debugger/RegisterColumn.h | 1 + Source/Core/DolphinQt/Debugger/RegisterWidget.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/Source/Core/DolphinQt/Debugger/RegisterColumn.h b/Source/Core/DolphinQt/Debugger/RegisterColumn.h index 1604aea401..b8df6cff6f 100644 --- a/Source/Core/DolphinQt/Debugger/RegisterColumn.h +++ b/Source/Core/DolphinQt/Debugger/RegisterColumn.h @@ -27,6 +27,7 @@ enum class RegisterType srr, // Machine status save/restore register (SRR0 - SRR1) sr, // Segment register (SR0 - SR15) gqr, // Graphics quantization registers (GQR0 - GQR7) + hid, // Hardware Implementation-Dependent registers (HID0-2, HID4) exceptions, // Keeps track of currently triggered exceptions int_mask, // ??? int_cause, // ??? diff --git a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp index ffe776e19f..59c4c7b507 100644 --- a/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/RegisterWidget.cpp @@ -255,6 +255,16 @@ void RegisterWidget::PopulateTable() [i] { return PowerPC::ppcState.spr[SPR_GQR0 + i]; }, nullptr); } + // HID registers + AddRegister(24, 7, RegisterType::hid, "HID0", [] { return PowerPC::ppcState.spr[SPR_HID0]; }, + [](u64 value) { PowerPC::ppcState.spr[SPR_HID0] = static_cast(value); }); + AddRegister(25, 7, RegisterType::hid, "HID1", [] { return PowerPC::ppcState.spr[SPR_HID1]; }, + [](u64 value) { PowerPC::ppcState.spr[SPR_HID1] = static_cast(value); }); + AddRegister(26, 7, RegisterType::hid, "HID2", [] { return PowerPC::ppcState.spr[SPR_HID2]; }, + [](u64 value) { PowerPC::ppcState.spr[SPR_HID2] = static_cast(value); }); + AddRegister(27, 7, RegisterType::hid, "HID4", [] { return PowerPC::ppcState.spr[SPR_HID4]; }, + [](u64 value) { PowerPC::ppcState.spr[SPR_HID4] = static_cast(value); }); + for (int i = 0; i < 16; i++) { // SR registers