diff --git a/.gitignore b/.gitignore index ea8c4bf..5020c5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target + +test/ diff --git a/src/decompiler/main.rs b/src/decompiler/main.rs index 457b5c4..926470e 100644 --- a/src/decompiler/main.rs +++ b/src/decompiler/main.rs @@ -1,10 +1,12 @@ -use std::fs; +use std::{env, fs}; use core::slice::Iter; const REGISTERS: [&str; 8] = [ "B", "C", "D", "E", "H", "L", "M", "A" ]; fn main() { - let file = fs::read("/home/lea/Downloads/invadeez/invadeez/rom/invaders.h").expect("where file"); + let mut args = env::args(); + let filename = args.nth(1).expect("Provide a path to a file to disassemble as an argument"); + let file = fs::read(filename).expect("where file"); let mut data = file.iter(); while let Some(byte) = data.next() {