From 5fe7cfec621ed11b9f82d6403ba88b070acdfd09 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Mon, 13 Nov 2023 15:28:33 -0500 Subject: [PATCH] Read that ROM --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5947037..21a7aa1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +use std::fs::File; +use std::io::Read; use winit::{event_loop::EventLoop, window::WindowBuilder}; use clap::{Parser}; @@ -10,6 +12,12 @@ struct Args { fn main() -> Result<(), impl std::error::Error> { let args = Args::parse(); + let mut file = File::open(args.rom_path).expect("No ROM found!"); + let mut buffer = Vec::new(); + + file.read_to_end(&mut buffer).expect("Failed to read ROM!"); + + println!("{:#04X?}", buffer); let event_loop = EventLoop::new().unwrap();