diff --git a/Cargo.toml b/Cargo.toml index fe655ddb..a9f305c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ name = "mooneye-gb" version = "0.2.0-pre" authors = ["Joonas Javanainen "] license = "GPL-3.0+" +edition = "2018" [dependencies] arraydeque = "0.4" diff --git a/core/src/config/bootrom.rs b/core/src/config/bootrom.rs index d16a7dbe..e493ce26 100644 --- a/core/src/config/bootrom.rs +++ b/core/src/config/bootrom.rs @@ -124,7 +124,8 @@ impl Bootrom { Model::Mgb => include_bytes!("../../bootroms/mgb_boot.bin"), Model::Sgb => include_bytes!("../../bootroms/sgb_boot.bin"), Model::Sgb2 => include_bytes!("../../bootroms/sgb2_boot.bin"), - }.clone(), + } + .clone(), )), } }) diff --git a/core/src/hardware/mod.rs b/core/src/hardware/mod.rs index 6138307d..be096fe6 100644 --- a/core/src/hardware/mod.rs +++ b/core/src/hardware/mod.rs @@ -26,7 +26,7 @@ use hardware::gpu::Gpu; use hardware::irq::{Interrupt, InterruptRequest, Irq}; use hardware::joypad::Joypad; use hardware::serial::Serial; -use hardware::timer::{Timer, Div, Tima, Tma, Tac}; +use hardware::timer::{Div, Tac, Tima, Timer, Tma}; use hardware::work_ram::WorkRam; use GbKey; @@ -328,7 +328,10 @@ impl Hardware { self.timer.tick_cycle(&mut self.irq); f(self) } - fn read_cycle_timer(&mut self, addr: T) -> u8 where Timer: MappedHardware { + fn read_cycle_timer(&mut self, addr: T) -> u8 + where + Timer: MappedHardware, + { self.emulate_internal(); self.timer.read_cycle(addr, &mut self.irq) } @@ -337,7 +340,10 @@ impl Hardware { self.timer.tick_cycle(&mut self.irq); f(self) } - fn write_cycle_timer(&mut self, addr: T, value: u8) where Timer: MappedHardware { + fn write_cycle_timer(&mut self, addr: T, value: u8) + where + Timer: MappedHardware, + { self.emulate_internal(); self.timer.write_cycle(addr, value, &mut self.irq) } diff --git a/src/frontend/emu_thread.rs b/src/frontend/emu_thread.rs index a14bd5f0..d6eb6eba 100644 --- a/src/frontend/emu_thread.rs +++ b/src/frontend/emu_thread.rs @@ -7,8 +7,8 @@ use std::sync::mpsc; use std::thread; use std::time::Duration; -use frame_times::FrameTimes; -use perf_counter::PerfCounter; +use crate::frame_times::FrameTimes; +use crate::perf_counter::PerfCounter; #[derive(Debug)] pub struct EmuThreadHandle { diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index d875259d..81ec5171 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -25,13 +25,13 @@ use std::time::Duration; use self::gui::Screen; use self::renderer::Renderer; -use fps_counter::FpsCounter; -use frame_times::FrameTimes; +use crate::fps_counter::FpsCounter; +use crate::frame_times::FrameTimes; +use crate::perf_counter::PerfCounter; use mooneye_gb::config::{Bootrom, Cartridge, HardwareConfig}; use mooneye_gb::emulation::{EmuEvents, EmuTime}; use mooneye_gb::machine::Machine; use mooneye_gb::*; -use perf_counter::PerfCounter; mod emu_thread; mod gui; diff --git a/src/main.rs b/src/main.rs index b9d30bf7..19904659 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,7 +41,7 @@ use simplelog::{LevelFilter, TermLogger}; use std::path::Path; use std::process; -use frontend::SdlFrontend; +use crate::frontend::SdlFrontend; mod fps_counter; mod frame_times;