add step by
This commit is contained in:
parent
edb348ec60
commit
e40bf4f786
1 changed files with 14 additions and 5 deletions
19
src/main.rs
19
src/main.rs
|
@ -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()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue