diff --git a/frontends/moa-minifb/Cargo.toml b/frontends/moa-minifb/Cargo.toml index 59c3cde..92bb5f3 100644 --- a/frontends/moa-minifb/Cargo.toml +++ b/frontends/moa-minifb/Cargo.toml @@ -10,5 +10,5 @@ default-run = "moa-genesis" moa = { path = "../../" } moa-common = { path = "../moa-common/", features = ["audio"] } minifb = "0.19" -clap = "3.0.0-beta.5" +clap = "3.2.20" diff --git a/frontends/moa-minifb/src/bin/moa-genesis.rs b/frontends/moa-minifb/src/bin/moa-genesis.rs index e240168..b5b2e94 100644 --- a/frontends/moa-minifb/src/bin/moa-genesis.rs +++ b/frontends/moa-minifb/src/bin/moa-genesis.rs @@ -1,10 +1,13 @@ +use clap::Arg; + use moa_minifb; use moa::machines::genesis::{build_genesis, SegaGenesisOptions}; fn main() { let matches = moa_minifb::new("Sega Genesis/Mega Drive Emulator") - .arg(" 'ROM file to load (must be flat binary)'") + .arg(Arg::new("ROM") + .help("ROM file to load (must be flat binary)")) .get_matches(); let mut options = SegaGenesisOptions::new(); diff --git a/frontends/moa-minifb/src/bin/moa-trs80.rs b/frontends/moa-minifb/src/bin/moa-trs80.rs index aebb99a..40e4539 100644 --- a/frontends/moa-minifb/src/bin/moa-trs80.rs +++ b/frontends/moa-minifb/src/bin/moa-trs80.rs @@ -1,10 +1,17 @@ +use clap::Arg; + use moa_minifb; use moa::machines::trs80::{build_trs80, Trs80Options}; fn main() { let matches = moa_minifb::new("TRS-80 Emulator") - .arg("-r, --rom=[FILE] 'ROM file to load at the start of memory'") + .arg(Arg::new("ROM") + .short('r') + .long("rom") + .takes_value(true) + .value_name("FILE") + .help("ROM file to load at the start of memory")) .get_matches(); let mut options = Trs80Options::new(); diff --git a/frontends/moa-minifb/src/lib.rs b/frontends/moa-minifb/src/lib.rs index 514b5d3..680317d 100644 --- a/frontends/moa-minifb/src/lib.rs +++ b/frontends/moa-minifb/src/lib.rs @@ -5,7 +5,7 @@ use std::time::Duration; use std::sync::{Arc, Mutex}; use minifb::{self, Key}; -use clap::{App, ArgMatches}; +use clap::{App, Arg, ArgMatches}; use moa::error::Error; use moa::system::System; @@ -28,11 +28,28 @@ const HEIGHT: u32 = 224; pub fn new(name: &str) -> App { App::new(name) - .arg("-s, --scale=[1,2,4] 'Scale the screen'") - .arg("-t, --threaded 'Run the simulation in a separate thread'") - .arg("-x, --speed=[] 'Adjust the speed of the simulation'") - .arg("-d, --debugger 'Start the debugger before running machine'") - .arg("-a, --disable-audio 'Disable audio output'") + .arg(Arg::new("scale") + .short('s') + .long("scale") + .takes_value(true) + .help("Scale the screen")) + .arg(Arg::new("threaded") + .short('t') + .long("threaded") + .help("Run the simulation in a separate thread")) + .arg(Arg::new("speed") + .short('x') + .long("speed") + .takes_value(true) + .help("Adjust the speed of the simulation")) + .arg(Arg::new("debugger") + .short('d') + .long("debugger") + .help("Start the debugger before running machine")) + .arg(Arg::new("disable-audio") + .short('a') + .long("disable-audio") + .help("Disable audio output")) } pub fn run(matches: ArgMatches, init: I) where I: FnOnce(&mut MiniFrontendBuilder) -> Result + Send + 'static { @@ -184,6 +201,7 @@ impl MiniFrontend { Some(1) => minifb::Scale::X1, Some(2) => minifb::Scale::X2, Some(4) => minifb::Scale::X4, + Some(8) => minifb::Scale::X8, _ => minifb::Scale::X2, }; diff --git a/todo.txt b/todo.txt index 7e030f5..a2e4d14 100644 --- a/todo.txt +++ b/todo.txt @@ -83,7 +83,7 @@ Macintosh: * check all instructions in the docs - * unimplemented: BFFFO, BFINS, CHK, ILLEGAL, NBCD, NEGX, RTR, RTD + * unimplemented: BFFFO, BFINS, NBCD, RTD * >=MC68020 undecoded & unimplemented: BKPT, CALLM, CAS, CAS2, CHK2, CMP2, RTM, PACK, TRAPcc, UNPK * add support for MMU