get rom path from command line
This commit is contained in:
parent
0112138b78
commit
a1390d8e45
1 changed files with 6 additions and 3 deletions
|
@ -1,7 +1,10 @@
|
|||
use crate::display::RatatuiDisplay;
|
||||
use crate::emulator::Emulator;
|
||||
use crate::input::CrossTermInput;
|
||||
use crate::sound::TerminalSound;
|
||||
use env_logger;
|
||||
use std::env;
|
||||
use std::path::PathBuf;
|
||||
|
||||
mod display;
|
||||
mod emulator;
|
||||
|
@ -12,10 +15,10 @@ mod stack;
|
|||
|
||||
fn main() -> Result<(), anyhow::Error> {
|
||||
env_logger::init();
|
||||
let rom_path = PathBuf::from(env::args().skip(1).next().expect("rom path not provided."));
|
||||
|
||||
let mut emulator = Emulator::new(RatatuiDisplay::new(), TerminalSound);
|
||||
|
||||
emulator.emulate(String::from("./roms/3-corax+.ch8"))?;
|
||||
let mut emulator = Emulator::new(RatatuiDisplay::new(), TerminalSound, CrossTermInput::new());
|
||||
emulator.emulate(rom_path.to_str().unwrap())?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue