pub fn step(&mut self, m: &mut MemoryBus, audio: &mut impl AudioDevice) {
        // step timer
        self.frame_tick += 1;
        // we can use the first bit of the frame_tick as an even odd flag
        let toggle = self.frame_tick & 1 == 0;
        self.step_timer(m, toggle);
        // This is equivalent to firing at roughly 240 hz
        if self.frame_tick >= 7458 {
            self.frame_tick = 0;
            self.step_framecounter(m);
        }
        self.sample_tick += 1;
        if self.sample_tick >= self.sample_cap {
            self.sample_tick = 0;
            self.send_sample(m, audio);
        }
    }
/// Steps the apu forward by one CPU tick
Steps the apu forward by one CPU tick
Steps the apu forward by one CPU tick
pub fn step(&mut self, m: &mut MemoryBus, audio: &mut impl AudioDevice) {
        // step timer
        self.frame_tick += 1;
        // we can use the first bit of the frame_tick as an even odd flag
        let toggle = self.frame_tick & 1 == 0;
        self.step_timer(m, toggle);
        // This is equivalent to firing at roughly 240 hz
        if self.frame_tick >= 7458 {
            self.frame_tick = 0;
            self.step_framecounter(m);
        }
        self.sample_tick += 1;
        if self.sample_tick >= self.sample_cap {
            self.sample_tick = 0;
            self.send_sample(m, audio);
        }
    }
pub fn step ( & mut self , m : & mut MemoryBus , audio : & mut impl AudioDevice ) { // step timer self . frame_tick += 1 ; // we can use the first bit of the frame_tick as an even odd flag let toggle = self . frame_tick & 1 == 0 ; self . step_timer ( m , toggle ) ; // This is equivalent to firing at roughly 240 hz if self . frame_tick >= 7458 { self . frame_tick = 0 ; self . step_framecounter ( m ) ; } self . sample_tick += 1 ; if self . sample_tick >= self . sample_cap { self . sample_tick = 0 ; self . send_sample ( m , audio ) ; } }
Steps the apu forward by one CPU tick
Steps the apu forward by one CPU tick
&mut self
m
&mut MemoryBus
audio
&mut impl AudioDevice
&mut self
m
&mut MemoryBus
audio
&mut impl AudioDevice