aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-06-06 12:29:15 +0200
committerAstatin <[email protected]>2025-06-06 12:29:15 +0200
commitaa5ebbc872b3f9b93add3d2060fa47a82ab0525f (patch)
tree59773a87797447573f52a7f5676a9a41f3ac1f2e /src/main.rs
parent0c7f945407561f7c4531b2780e908bb2098551d8 (diff)
Add skip bootrom & dumps on stop
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 9a48983..cee08f2 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -19,36 +19,49 @@ struct Cli {
/// The gameboy rom file
rom: String,
- /// Setting uses more battery and set the CPU to 100% but could sometimes solve inconsistent timing.
- #[arg(long)]
- loop_lock_timing: bool,
-
+ /// Serial communication input from a FIFO file
#[arg(long)]
fifo_input: Option<String>,
+ /// Serial communication output from a FIFO file
#[arg(long)]
fifo_output: Option<String>,
+ /// Record the inputs into a file when they happen so it can be replayed with --replay-input
#[arg(long)]
record_input: Option<String>,
+ /// Replay the inputs from the file recorded by record_input
#[arg(long)]
replay_input: Option<String>,
+ /// The file to which the state will be save when using the X (North) button of the controller
+ /// and loaded from when using the --load-state parameter
#[arg(long)]
state_file: Option<String>,
+ /// Start at the state defined by --state-file instead of the start of bootrom with empty mem
#[arg(short, long, default_value_t = false)]
load_state: bool,
+ /// Gets inputs from keyboard instead of gamepad
#[arg(short, long, default_value_t = false)]
keyboard: bool,
#[arg(short, long, default_value_t = 1.0)]
speed: f32,
+ /// Will print all of the opcodes executed (WARNING: THERE ARE MANY)
#[arg(short, long, default_value_t = false)]
debug: bool,
+
+ /// Skip bootrom (will start the execution at 0x100 with all registers empty
+ #[arg(long, default_value_t = false)]
+ skip_bootrom: bool,
+
+ /// Dump state to files on stop
+ #[arg(long, default_value_t = false)]
+ stop_dump_state: bool,
}
fn main() {
@@ -92,5 +105,13 @@ fn main() {
gameboy.load_state().unwrap();
}
+ if cli.skip_bootrom {
+ gameboy.skip_bootrom();
+ }
+
gameboy.start();
+
+ if cli.stop_dump_state {
+ gameboy.dump_state().unwrap();
+ }
}