Skip to content
Snippets Groups Projects
Verified Commit 6c498c02 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

fix: support for auto mode in initial load

Previously only new ROM loading operations would take into consideration the auto-mode.
This fix affects the SDL frontend only.
parent 007f1e69
No related branches found
No related tags found
No related merge requests found
Pipeline #2917 passed
......@@ -712,7 +712,7 @@ struct Args {
)]
cycles: u64,
#[arg(short, long, default_value_t = String::from("../../res/roms/demo/pocket.gb"), help = "Path to the ROM file to be loaded")]
#[arg(short, long, default_value_t = String::from("../../res/roms/test/cgb_acid2.gbc"), help = "Path to the ROM file to be loaded")]
rom_path: String,
}
......@@ -750,7 +750,11 @@ fn main() {
// creates a new Game Boy instance and loads both the boot ROM
// and the initial game ROM to "start the engine"
let mut game_boy = GameBoy::new(Some(mode));
let device = build_device(&args.device);
if auto_mode {
let mode = Cartridge::from_file(&args.rom_path).gb_mode();
game_boy.set_mode(mode);
}
let device: Box<dyn SerialDevice> = build_device(&args.device);
game_boy.set_ppu_enabled(!args.no_ppu);
game_boy.set_apu_enabled(!args.no_apu);
game_boy.set_dma_enabled(!args.no_dma);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment