From 032b5868da82e30d46c33ab8fb414c9c1fc0747e Mon Sep 17 00:00:00 2001 From: 45Tatami Date: Tue, 7 May 2024 19:41:25 +0200 Subject: [PATCH] wip --- src/emu.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/emu.rs b/src/emu.rs index 362ba01..2845665 100644 --- a/src/emu.rs +++ b/src/emu.rs @@ -141,9 +141,12 @@ impl GameBoy { Err(e) => panic!("{e}"), }; - let mut bios = fs::File::open("DMG_ROM.bin").expect("could not open bios"); - bios.read_exact(&mut self.boot_rom) - .expect("fail to read rom"); + let bios_filename = "DMG_ROM.bin"; + if let Ok(mut bios) = fs::File::open(bios_filename) { + bios.read_exact(&mut self.boot_rom).expect("fail to read rom {bios_filename}"); + } else { + println!("could not find bios file; continuing without"); + } } pub fn register_breakpoint(&mut self, adr: &str) {