Make menu items functional

This commit is contained in:
2024-11-04 22:18:57 -05:00
parent 756835f90e
commit 593475960d
6 changed files with 255 additions and 21 deletions
+13 -5
View File
@@ -1,4 +1,4 @@
use std::{path::PathBuf, thread};
use std::{path::PathBuf, process, thread};
use anyhow::Result;
use app::App;
@@ -14,16 +14,24 @@ mod shrooms_vb_core;
#[derive(Parser)]
struct Args {
rom: PathBuf,
rom: Option<PathBuf>,
}
fn main() -> Result<()> {
let args = Args::parse();
let (builder, client) = EmulatorBuilder::new();
let builder = builder.with_rom(&args.rom);
let (mut builder, client) = EmulatorBuilder::new();
if let Some(path) = args.rom {
builder = builder.with_rom(&path);
}
thread::spawn(move || {
let mut emulator = builder.build().unwrap();
let mut emulator = match builder.build() {
Ok(e) => e,
Err(err) => {
eprintln!("Error initializing emulator: {err}");
process::exit(1);
}
};
emulator.run();
});