diff --git a/src/main.rs b/src/main.rs index be1c917..01f973a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ use clap::{ArgGroup, Parser}; use minifb::{Window, WindowOptions}; use processor::{ memory::{Memory, ROM}, - CPU, + Registers, CPU, }; use std::{ fs, @@ -14,8 +14,6 @@ use std::{ sync::RwLock, }; -use crate::processor::Registers; - #[macro_export] macro_rules! verbose_println { ($($tts:tt)*) => { diff --git a/src/processor/gpu.rs b/src/processor/gpu.rs index 773b3d6..d5c8657 100644 --- a/src/processor/gpu.rs +++ b/src/processor/gpu.rs @@ -1,9 +1,9 @@ +use crate::{ + processor::{as_signed, get_bit, set_bit, set_or_clear_bit, CPU}, + FACTOR, HEIGHT, WIDTH, +}; use minifb::{Window, WindowOptions}; -use crate::{FACTOR, HEIGHT, WIDTH}; - -use super::{as_signed, get_bit, set_bit, set_or_clear_bit, CPU}; - mod tile_window; #[derive(PartialEq)] diff --git a/src/processor/gpu/tile_window.rs b/src/processor/gpu/tile_window.rs index 23037dd..73149c4 100644 --- a/src/processor/gpu/tile_window.rs +++ b/src/processor/gpu/tile_window.rs @@ -1,13 +1,15 @@ use crate::{ - processor::{get_bit, CPU}, + processor::{ + get_bit, + gpu::{ + bits_to_mapped_colour, scale_buffer, Palette, TiledataArea, TILE_WINDOW_EDGE_LENGTH, + TILE_WINDOW_EDGE_LENGTH_SCALED, + }, + CPU, + }, FACTOR, }; -use super::{ - bits_to_mapped_colour, scale_buffer, Palette, TiledataArea, TILE_WINDOW_EDGE_LENGTH, - TILE_WINDOW_EDGE_LENGTH_SCALED, -}; - impl CPU { pub(super) fn draw_sprite_window(&mut self, area: TiledataArea, palette: Palette) { for tile_y in 0..16 { diff --git a/src/processor/instructions/primitives.rs b/src/processor/instructions/primitives.rs index a522cbc..faf7869 100644 --- a/src/processor/instructions/primitives.rs +++ b/src/processor/instructions/primitives.rs @@ -1,6 +1,5 @@ -use std::ops::{BitAnd, BitOr}; - use crate::processor::{get_bit, get_rotation_carry, rotate, Direction, Flags, SplitRegister, CPU}; +use std::ops::{BitAnd, BitOr}; impl CPU { pub(crate) fn pop_word(&mut self) -> u16 { diff --git a/src/processor/memory.rs b/src/processor/memory.rs index 4046c5e..8667ef1 100644 --- a/src/processor/memory.rs +++ b/src/processor/memory.rs @@ -1,10 +1,9 @@ -use std::io::{stdout, Write}; - +use crate::{ + processor::{clear_bit, get_bit}, + verbose_println, +}; use minifb::Key; - -use crate::verbose_println; - -use super::{clear_bit, get_bit}; +use std::io::{stdout, Write}; pub(crate) type Address = u16; pub(crate) type ROM = Vec; diff --git a/src/processor/mod.rs b/src/processor/mod.rs index 50791d8..e3c5773 100644 --- a/src/processor/mod.rs +++ b/src/processor/mod.rs @@ -1,11 +1,8 @@ -use std::{mem::transmute, time::Duration}; - -use minifb::Window; - -use crate::{processor::instructions::instructions::set, verbose_println}; - use self::gpu::GPU; use self::memory::Memory; +use crate::{processor::instructions::instructions::set, verbose_println}; +use minifb::Window; +use std::{mem::transmute, time::Duration}; pub mod gpu; mod instructions; diff --git a/src/processor/opcodes.rs b/src/processor/opcodes.rs index a51bfe8..7d5750a 100644 --- a/src/processor/opcodes.rs +++ b/src/processor/opcodes.rs @@ -1,4 +1,4 @@ -use super::{ +use crate::processor::{ as_signed, instructions::instructions::{res, set}, Flags, Reg8, SplitRegister, CPU,