add step by

This commit is contained in:
Alex Janka 2023-01-17 08:58:37 +11:00
parent edb348ec60
commit e40bf4f786

View file

@ -21,6 +21,10 @@ struct Args {
/// Just run BootROM
#[arg(long)]
run_bootrom: bool,
/// Step emulation by...
#[arg(long)]
step_by: Option<usize>,
}
type Address = u16;
@ -177,11 +181,16 @@ fn main() {
memory: Memory::init(run_rom),
state,
};
loop {
for _ in 0..10 {
cpu.exec_next();
}
pause();
match args.step_by {
Some(step_size) => loop {
for _ in 0..step_size {
cpu.exec_next();
}
pause();
},
None => loop {
cpu.exec_next()
},
}
}