From 5520d4ab69bda646e563a89806cba4eb4a3a0fb0 Mon Sep 17 00:00:00 2001 From: John Breaux Date: Sat, 25 Mar 2023 18:33:05 -0500 Subject: [PATCH] io.rs: Dump memory to file (already used by main, oops!) --- src/io.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/io.rs b/src/io.rs index 8b69481..c7ddedc 100644 --- a/src/io.rs +++ b/src/io.rs @@ -134,3 +134,11 @@ pub fn get_keys(window: &mut Window, cpu: &mut CPU) { .iter() .for_each(|key| cpu.press(identify_key(*key))); } + +pub fn debug_dump_screen(bus: &Bus) -> Result<()> { + Ok(std::fs::write( + "screen_dump.bin", + bus.get_region(Region::Screen) + .expect("Screen should exist, but does not"), + )?) +}