remove cycle start

This commit is contained in:
Alex Janka 2023-02-24 13:19:13 +11:00
parent b574e1b1bf
commit db57cf58e1

View file

@ -1,7 +1,6 @@
use self::memory::{Interrupt, Memory}; use self::memory::{Interrupt, Memory};
use crate::verbose_println; use crate::verbose_println;
use gilrs::Gilrs; use gilrs::Gilrs;
use std::time::Instant;
mod instructions; mod instructions;
pub mod memory; pub mod memory;
@ -28,7 +27,6 @@ pub struct Cpu {
halted: bool, halted: bool,
should_halt_bug: bool, should_halt_bug: bool,
gamepad_handler: Gilrs, gamepad_handler: Gilrs,
cycle_start: Instant,
} }
impl Cpu { impl Cpu {
@ -44,12 +42,10 @@ impl Cpu {
halted: false, halted: false,
should_halt_bug: false, should_halt_bug: false,
gamepad_handler, gamepad_handler,
cycle_start: Instant::now(),
} }
} }
pub fn exec_next(&mut self) { pub fn exec_next(&mut self) {
self.cycle_start = Instant::now();
let interrupt_cycles = self.handle_interrupts(); let interrupt_cycles = self.handle_interrupts();
self.increment_timers(interrupt_cycles); self.increment_timers(interrupt_cycles);