Chip8-em init commit
This commit is contained in:
27
src/main.rs
Normal file
27
src/main.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
use clap::Parser;
|
||||
|
||||
mod chip8;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about = "Chip 8 Emulator")]
|
||||
struct Args {
|
||||
/// Turn on debug mode
|
||||
#[arg(short, long, action = clap::ArgAction::SetTrue)]
|
||||
debug: bool,
|
||||
/// Set path for chip8 binary file to run
|
||||
#[arg(short, long)]
|
||||
file: Option<String>,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
// TODO: should define my raylib/sound/etc handles here eventually and pass them down
|
||||
|
||||
if let Some(filepath) = args.file {
|
||||
if args.debug {
|
||||
chip8::run(filepath, true);
|
||||
} else {
|
||||
chip8::run(filepath, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user