Skip to content

Commit

Permalink
fix check_interrupt_prediction test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodrigodd committed Jun 14, 2023
1 parent 77bb37b commit 428f507
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/tests/check_interrupt_prediction.rs
Expand Up @@ -109,7 +109,7 @@ fn test_interrupt_prediction(rom: &str, timeout: u64) -> bool {
let vblank = Arc::new(Mutex::new(VBlank::default()));

let mut game_boy_a = GameBoy::new(None, cartridge.clone());
game_boy_a.predict_interrupt = false;
game_boy_a.predict_interrupt = true;
game_boy_a.v_blank = Some(Box::new({
let vblank = vblank.clone();
move |gb| {
Expand All @@ -123,7 +123,7 @@ fn test_interrupt_prediction(rom: &str, timeout: u64) -> bool {
}));

let mut game_boy_b = GameBoy::new(None, cartridge);
game_boy_b.predict_interrupt = true;
game_boy_b.predict_interrupt = false;
game_boy_b.v_blank = Some(Box::new({
let vblank = vblank.clone();
move |gb| {
Expand All @@ -149,7 +149,8 @@ fn test_interrupt_prediction(rom: &str, timeout: u64) -> bool {
inter.interpret_op();
}
// print!("\u{001b}[0m");
{
// the gameboy with predict interrupt may skip most part of a halt.
while game_boy_b.clock_count < game_boy_a.clock_count {
let mut inter = Interpreter(&mut game_boy_b);
inter.interpret_op();
}
Expand Down

0 comments on commit 428f507

Please sign in to comment.