diff --git a/README.md b/README.md index 08636e24..e122942f 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,11 @@ magenboy [path_to_rom] [other_optional_flags] ``` ### Optional flags + * `--log` - Print logs in debug mode to a file * `--file-audio` - Saves the audio to a file * `--no-vsync` - Disable vsync +* `--bootrom [path to bootrom file]` - Specify the path for a bootrom (If not specified the emualtor will look for `dmg_boot.bin` at the cwd) ## GameBoy diff --git a/gb/src/main.rs b/gb/src/main.rs index 8d2b6a7f..23693b75 100644 --- a/gb/src/main.rs +++ b/gb/src/main.rs @@ -118,7 +118,14 @@ fn emulation_thread_main(args: Vec, program_name: String, spsc_gfx_devic let audio_devices = MultiAudioDevice::new(devices); let mut mbc = initialize_mbc(&program_name); let joypad_provider = SdlJoypadProvider::new(buttons_mapper); - let mut gameboy = match fs::read("Dependencies/Init/dmg_boot.bin"){ + let bootrom_path = if check_for_terminal_feature_flag(&args, "--bootrom"){ + let index = args.iter().position(|v| *v == String::from("--bootrom")).unwrap(); + args.get(index + 1).expect("Error! you must specify a value for the --bootrom parameter").clone() + }else{ + String::from("dmg_boot.bin") + }; + + let mut gameboy = match fs::read(bootrom_path){ Result::Ok(file)=>{ info!("found bootrom!");