fixed bug where stack inspector shows incorrect addresses

This commit is contained in:
2026-02-04 01:59:43 +00:00
parent fa8aa1cd29
commit cb65a928c8
+3 -4
View File
@@ -51,7 +51,6 @@ impl Component for StackInspector {
ui.label("Address"); ui.label("Address");
ui.label("Value"); ui.label("Value");
ui.end_row(); ui.end_row();
for (i, value) in for (i, value) in
state.stack_view.chunks(4).take(32).enumerate() state.stack_view.chunks(4).take(32).enumerate()
{ {
@@ -59,9 +58,9 @@ impl Component for StackInspector {
"Could not read 4 byte instruction or data! Something is wrong.", "Could not read 4 byte instruction or data! Something is wrong.",
)); ));
ui.label(format!( ui.label(format!(
"{} [{}]", "+{} [{}]",
i, i*4,
state.reg_file.get(Register::Spr).expect("SPR should never be invalid") - i as u32 * 4 state.reg_file.get(Register::Spr).expect("SPR should never be invalid") + i as u32 * 4
)); ));
ui.label(format!("0x{value:08X} ({value})")); ui.label(format!("0x{value:08X} ({value})"));
ui.end_row(); ui.end_row();