diff --git a/frontend/src/debug/mod.rs b/frontend/src/debug/mod.rs index 2d61a82..36f6102 100644 --- a/frontend/src/debug/mod.rs +++ b/frontend/src/debug/mod.rs @@ -22,6 +22,31 @@ impl Debug { palette::palette_window(&ctx, &emu); self.vram.render(&ctx, &emu); + egui::Window::new("memory") + .show(ctx, |ui| { + + // emu.core.mem.ram + let bytes_row = 16; + let total_bytes = 0x10000; + let rows = total_bytes / bytes_row; + + egui::ScrollArea::vertical() + .max_height(512.) + .show_rows(ui, 8., rows, |ui, row_range| { + for i in row_range { + let offset = i * bytes_row; + let bytes = (offset..offset+bytes_row) + .enumerate() + .map(|(idx, offset)| { + format!(" {:02x}", emu.core.mem.ram[idx + offset]) + }).collect::(); + + + ui.label(format!("{:02x} {}", i, bytes)); + } + }); + + }); }