chore: inline some functions
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
2021-09-20 01:31:03 -03:00
parent bcd67cb317
commit 5882678bc5
6 changed files with 19 additions and 4 deletions

View File

@@ -17,8 +17,8 @@ pub fn run_frame(emu: &mut Emulator, gamepad: &mut Gilrs, key: &WinitInputHelper
if let Some(event) = gamepad.next_event() {
joypad::handle_gamepad_input(emu.joyp_mut(), event);
}
joypad::handle_keyboard_input(emu.joyp_mut(), key);
while elapsed < CYCLES_IN_FRAME {
elapsed += emu.step();
}
@@ -44,15 +44,18 @@ impl Emulator {
}
fn step(&mut self) -> Cycle {
self.cpu.step()
let cycles = self.cpu.step();
self.timestamp += cycles;
cycles
}
fn load_cart(&mut self, rom: Vec<u8>) {
self.cpu.bus_mut().load_cart(rom)
}
#[inline]
fn joyp_mut(&mut self) -> &mut Joypad {
&mut self.cpu.bus_mut().joypad
self.cpu.bus_mut().joyp_mut()
}
pub fn set_prod(&mut self, prod: SampleProducer<f32>) {