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
|
/// Just run BootROM
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
run_bootrom: bool,
|
run_bootrom: bool,
|
||||||
|
|
||||||
|
/// Step emulation by...
|
||||||
|
#[arg(long)]
|
||||||
|
step_by: Option<usize>,
|
||||||
}
|
}
|
||||||
|
|
||||||
type Address = u16;
|
type Address = u16;
|
||||||
|
@ -177,11 +181,16 @@ fn main() {
|
||||||
memory: Memory::init(run_rom),
|
memory: Memory::init(run_rom),
|
||||||
state,
|
state,
|
||||||
};
|
};
|
||||||
loop {
|
match args.step_by {
|
||||||
for _ in 0..10 {
|
Some(step_size) => loop {
|
||||||
cpu.exec_next();
|
for _ in 0..step_size {
|
||||||
}
|
cpu.exec_next();
|
||||||
pause();
|
}
|
||||||
|
pause();
|
||||||
|
},
|
||||||
|
None => loop {
|
||||||
|
cpu.exec_next()
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue