diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index e7a11a9..5a29737 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,21 @@ +use clap::Parser; +mod cpu; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + // Name of the ROM file + #[arg(short, long)] + name: String, +} + + fn main() { - println!("Hello, world!"); + let args = Args::parse(); + let mut cpu = cpu::chip::Chip::new(); + cpu.load_rom(&args.name); + loop { + cpu.fetch(); + cpu.execute(); + } } |