Properly handle result of M68K::step

This commit is contained in:
pjht 2023-03-15 19:01:44 -05:00
parent a0eaccaf7f
commit 1cff8b26ce
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E

View File

@ -171,7 +171,14 @@ fn main() -> Result<(), anyhow::Error> {
let pc = state.cpu.pc();
out += &disas_fmt(&mut state.cpu, pc, &state.symbol_tables).0;
}
state.cpu.step();
match state.cpu.step() {
Ok(_) => (),
Err(bus_error) => {
println!("{bus_error}");
state.cpu.stopped=true;
break;
}
}
}
if args.get_flag("print_regs") {
out += &format!("{}\n", state.cpu);
@ -214,7 +221,14 @@ fn main() -> Result<(), anyhow::Error> {
let pc = state.cpu.pc();
out += &disas_fmt(&mut state.cpu, pc, &state.symbol_tables).0;
}
state.cpu.step();
match state.cpu.step() {
Ok(_) => (),
Err(bus_error) => {
println!("{bus_error}");
state.cpu.stopped=true;
break;
}
}
}
out += &format!("{}\n", state.cpu);
let pc = state.cpu.pc();