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

reafctor: rorder of parsing values

parent 5e9ea7fa
No related branches found
No related tags found
1 merge request!25Game Genie support
Pipeline #3148 canceled
......@@ -789,12 +789,6 @@ fn main() {
// parses the provided command line arguments and uses them to
// obtain structured values
let args = Args::parse();
let mode = if args.mode == "auto" {
GameBoyMode::Dmg
} else {
GameBoyMode::from_string(&args.mode)
};
let auto_mode = args.mode == "auto";
// in case the default ROM path is provided and the file does not
// exist then fails gracefully
......@@ -804,6 +798,15 @@ fn main() {
return;
}
// tries to build the target mode from the mode argument
// parsing it if it does not contain the "auto" value
let mode = if args.mode == "auto" {
GameBoyMode::Dmg
} else {
GameBoyMode::from_string(&args.mode)
};
let auto_mode = args.mode == "auto";
// 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));
......
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