Skip to content

Commit

Permalink
2018 edition, tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Gekkio committed Dec 7, 2018
1 parent 59547e9 commit f75cc25
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -6,6 +6,7 @@ name = "mooneye-gb"
version = "0.2.0-pre"
authors = ["Joonas Javanainen <joonas.javanainen@gmail.com>"]
license = "GPL-3.0+"
edition = "2018"

[dependencies]
arraydeque = "0.4"
Expand Down
3 changes: 2 additions & 1 deletion core/src/config/bootrom.rs
Expand Up @@ -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(),
)),
}
})
Expand Down
12 changes: 9 additions & 3 deletions core/src/hardware/mod.rs
Expand Up @@ -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;

Expand Down Expand Up @@ -328,7 +328,10 @@ impl Hardware {
self.timer.tick_cycle(&mut self.irq);
f(self)
}
fn read_cycle_timer<T>(&mut self, addr: T) -> u8 where Timer: MappedHardware<T> {
fn read_cycle_timer<T>(&mut self, addr: T) -> u8
where
Timer: MappedHardware<T>,
{
self.emulate_internal();
self.timer.read_cycle(addr, &mut self.irq)
}
Expand All @@ -337,7 +340,10 @@ impl Hardware {
self.timer.tick_cycle(&mut self.irq);
f(self)
}
fn write_cycle_timer<T>(&mut self, addr: T, value: u8) where Timer: MappedHardware<T> {
fn write_cycle_timer<T>(&mut self, addr: T, value: u8)
where
Timer: MappedHardware<T>,
{
self.emulate_internal();
self.timer.write_cycle(addr, value, &mut self.irq)
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/emu_thread.rs
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/mod.rs
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Expand Up @@ -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;
Expand Down

0 comments on commit f75cc25

Please sign in to comment.