Fixed command line arguments after upgrading to clap 3.2.20

This commit is contained in:
transistor 2022-09-12 22:43:55 -07:00
parent 873741846c
commit c161fe5eb9
5 changed files with 38 additions and 10 deletions

View File

@ -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"

View File

@ -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> '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();

View File

@ -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();

View File

@ -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<I>(matches: ArgMatches, init: I) where I: FnOnce(&mut MiniFrontendBuilder) -> Result<System, Error> + 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,
};

View File

@ -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