Skip to content

Commit

Permalink
Remove loop detection exit logic
Browse files Browse the repository at this point in the history
  • Loading branch information
joajfreitas committed Jul 9, 2024
1 parent 1ca614f commit e3d8d32
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
15 changes: 0 additions & 15 deletions fpt/src/lr35902.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,21 +637,6 @@ impl LR35902 {
// Run instructions
/// Run one t-cycle - from actual crystal @ 4 or 8 MHz (double speed mode)
pub fn t_cycle(&mut self) {
static mut PREVIOUS_PC: u16 = 0;
static mut PC_COUNTER: u16 = 0;
// test roms get stuck in the same pc when finished
unsafe {
if PREVIOUS_PC != self.pc() {
PREVIOUS_PC = self.pc();
PC_COUNTER = 0;
} else {
PC_COUNTER += 1;
if PC_COUNTER == 100 {
std::process::exit(0);
}
}
}

let inst = self.decode();
self.set_inst_cycle_count(self.inst_cycle_count() + 1);
// Only actually mutate CPU state on the last t-cycle of the instruction
Expand Down
2 changes: 0 additions & 2 deletions fpt/tests/templates/header
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ fn rom_test(rom_path: &str, termination_address: u16) {{
loop {{
match debug_events.pop_back().unwrap() {{
DebugEvent::Breakpoint(_) => {{
println!("breakpoint");
break 'outer;
}}
DebugEvent::Instrpoint(_) => {{
println!("instrpoint");
assert!(check_registers(&gb) == true);
continue 'outer;
}}
Expand Down

0 comments on commit e3d8d32

Please sign in to comment.