memory editor

This commit is contained in:
kirjavascript 2023-03-11 00:28:05 +00:00
parent 72e0ceca2e
commit 5be8e11dbc

View file

@ -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::<String>();
ui.label(format!("{:02x} {}", i, bytes));
}
});
});
}