diff --git a/frontends/sdl/src/main.rs b/frontends/sdl/src/main.rs index 017932bc36cf8cd3a2960b1af3c5252c2ae9c8ee..7938f0dbd3d0646ee92c873385b03c626873b8f1 100644 --- a/frontends/sdl/src/main.rs +++ b/frontends/sdl/src/main.rs @@ -662,6 +662,13 @@ struct Args { #[arg(short, long, default_value_t = String::from("printer"), help = "Serial device to be used")] device: String, + #[arg( + long, + default_value_t = false, + help = "If set no boot ROM will be loaded" + )] + no_boot: bool, + #[arg(long, default_value_t = false, help = "If set no PPU will be used")] no_ppu: bool, @@ -740,7 +747,7 @@ fn main() { // parses the provided command line arguments and uses them to // obtain structured values let args = Args::parse(); - let mode: GameBoyMode = if args.mode == "auto" { + let mode = if args.mode == "auto" { GameBoyMode::Dmg } else { GameBoyMode::from_string(&args.mode) @@ -760,7 +767,7 @@ fn main() { game_boy.set_dma_enabled(!args.no_dma); game_boy.set_timer_enabled(!args.no_timer); game_boy.attach_serial(device); - game_boy.load(true); + game_boy.load(!args.no_boot); // prints the current version of the emulator (informational message) println!("========= Boytacean =========\n{}", game_boy); diff --git a/src/data.rs b/src/data.rs index 53c6dff7fd2083c9faff6779da88e82254020b11..dffe95421e2bb646d88e878f0676240e0acb5a8e 100644 --- a/src/data.rs +++ b/src/data.rs @@ -8,6 +8,7 @@ pub enum BootRom { DmgBootix, MgbBootix, Cgb, + None, } pub const DMG_BOOT: [u8; 256] = [ diff --git a/src/gb.rs b/src/gb.rs index fda32828ca23549a36d44536218d45cad2792441..87b2379fa0412c2186a5e3b463fc3c05904f5778 100644 --- a/src/gb.rs +++ b/src/gb.rs @@ -535,6 +535,7 @@ impl GameBoy { BootRom::DmgBootix => self.load_boot(&DMG_BOOTIX), BootRom::MgbBootix => self.load_boot(&MGB_BOOTIX), BootRom::Cgb => self.load_boot(&CGB_BOOT), + BootRom::None => (), } } @@ -957,6 +958,7 @@ impl GameBoy { BootRom::DmgBootix => self.load_boot_path("./res/boot/dmg_bootix.bin"), BootRom::MgbBootix => self.load_boot_path("./res/boot/mgb_bootix.bin"), BootRom::Cgb => self.load_boot_path("./res/boot/cgb_boot.bin"), + BootRom::None => (), } }