-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
agon-cli-emulator binary, with some new command line options. sdcard …
…update
Showing
11 changed files
with
201 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[workspace] | ||
members = ["agon-light-emulator-debugger"] | ||
members = ["agon-light-emulator-debugger", "agon-ez80-emulator", "agon-cli-emulator"] | ||
|
||
[workspace.package] | ||
version = "0.9.75" | ||
version = "0.9.76" | ||
edition = "2021" | ||
authors = ["Tom Morton <[email protected]>"] | ||
license = "GPL-3.0" | ||
|
@@ -29,7 +29,7 @@ sdl2-sys = "*" | |
sdl2 = "0.36.0" | ||
pico-args = "0.5.0" | ||
agon-ez80-emulator = { workspace = true } | ||
agon-light-emulator-debugger = { path = "agon-light-emulator-debugger" } | ||
agon-light-emulator-debugger = { workspace = true } | ||
libloading = "0.8.0" | ||
home = "0.5.9" | ||
serialport = "4.3.0" | ||
|
@@ -42,3 +42,5 @@ raw_tty = "0.1.0" | |
|
||
[workspace.dependencies] | ||
agon-ez80-emulator = { path = "agon-ez80-emulator" } | ||
agon-light-emulator-debugger = { path = "agon-light-emulator-debugger" } | ||
agon-cli-emulator = { path = "agon-cli-emulator" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "agon-cli-emulator" | ||
version.workspace = true | ||
edition.workspace = true | ||
authors.workspace = true | ||
license.workspace = true | ||
|
||
[dependencies] | ||
agon-ez80-emulator = { workspace = true } | ||
agon-light-emulator-debugger = { workspace = true } | ||
pico-args = "0.5.0" | ||
|
||
#[target.'cfg(target_os = "linux")'.dependencies] | ||
#raw_tty = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const HELP: &str = "\ | ||
Agon CLI Emulator | ||
USAGE: | ||
agon-cli-emulator [OPTIONS] | ||
OPTIONS: | ||
-h, --help Prints help information | ||
--mos PATH Use a different MOS.bin firmware | ||
--sdcard-img <file> Use a raw SDCard image rather than the host filesystem | ||
--sdcard <path> Sets the path of the emulated SDCard | ||
-u, --unlimited-cpu Don't limit eZ80 CPU frequency | ||
-z, --zero Initialize ram with zeroes instead of random values | ||
"; | ||
|
||
#[derive(Debug)] | ||
pub struct AppArgs { | ||
//pub debugger: bool, | ||
pub sdcard: Option<String>, | ||
pub sdcard_img: Option<String>, | ||
pub unlimited_cpu: bool, | ||
pub zero: bool, | ||
pub mos_bin: Option<std::path::PathBuf>, | ||
} | ||
|
||
pub fn parse_args() -> Result<AppArgs, pico_args::Error> { | ||
let mut pargs = pico_args::Arguments::from_env(); | ||
|
||
// for `make install` | ||
if pargs.contains("--prefix") { | ||
print!("{}", option_env!("PREFIX").unwrap_or("")); | ||
std::process::exit(0); | ||
} | ||
|
||
if pargs.contains(["-h", "--help"]) { | ||
print!("{}", HELP); | ||
std::process::exit(0); | ||
} | ||
|
||
let args = AppArgs { | ||
//debugger: pargs.contains(["-d", "--debugger"]), | ||
sdcard: pargs.opt_value_from_str("--sdcard")?, | ||
sdcard_img: pargs.opt_value_from_str("--sdcard-img")?, | ||
unlimited_cpu: pargs.contains(["-u", "--unlimited_cpu"]), | ||
zero: pargs.contains(["-z", "--zero"]), | ||
mos_bin: pargs.opt_value_from_str("--mos")?, | ||
}; | ||
|
||
let remaining = pargs.finish(); | ||
if !remaining.is_empty() { | ||
eprintln!("Warning: unused arguments left: {:?}.", remaining); | ||
} | ||
|
||
Ok(args) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule sdcard
updated
11 files
+4 −4 | README.md | |
+ − | bin/agon-bench.bin | |
+ − | bin/ez80asm.bin | |
+12 −0 | mos/emulator_exit_failure.asm | |
+ − | mos/emulator_exit_failure.bin | |
+12 −0 | mos/emulator_exit_success.asm | |
+ − | mos/emulator_exit_success.bin | |
+ − | mos/ez80asm.bin | |
+ − | mos/ez80asm.ldr | |
+ − | mos/hexload.bin | |
+ − | mos/hexload.dll |