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) {