diff options
author | Aaditya Dhruv <[email protected]> | 2023-12-28 16:28:17 -0600 |
---|---|---|
committer | Aaditya Dhruv <[email protected]> | 2023-12-28 16:28:17 -0600 |
commit | 4ffc735eeb6c5148b7255a954ea36f91cdb777cf (patch) | |
tree | 014872e7807a1c2b01308ef49d3f62b583ce8616 /src/main.rs | |
parent | 9b0bfa4eb6e8537bb739d4cff038aa584bef2dbf (diff) |
Add barebones CPU structure
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(); + } } |