diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index c53068b..ca6219f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -228,9 +228,6 @@ fn main() { cpu.step(); //println!("cpu at 0x{:04x}", cpu.get_pc()); while cpu.cycle > 0 { - if ppu.tick() || ppu.tick() || ppu.tick() { - cpu.trigger_nmi(); - } cnt += 1; if cnt >= CYC_PER_FRAME { win.render(); @@ -239,13 +236,17 @@ fn main() { if duration_per_frame > e { let diff = duration_per_frame - e; sleep(diff); - //println!("{} faster", diff.subsec_nanos() as f64 / 1e6); + println!("{} faster", diff.subsec_nanos() as f64 / 1e6); } else { - //println!("{} slower", (e - duration_per_frame).subsec_nanos() as f64 / 1e6); + println!("{} slower", (e - duration_per_frame).subsec_nanos() as f64 / 1e6); } timer = Instant::now(); cnt -= CYC_PER_FRAME; } + + if ppu.tick() || ppu.tick() || ppu.tick() { + cpu.trigger_nmi(); + } cpu.cycle -= 1; } } |