move gpu to mmio module
This commit is contained in:
parent
c622a2ae4a
commit
5dba0e039a
|
@ -16,8 +16,6 @@ use std::{
|
|||
io::{self, stdout, Write},
|
||||
};
|
||||
|
||||
use crate::processor::gpu;
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! verbose_println {
|
||||
($($tts:tt)*) => {
|
||||
|
@ -95,7 +93,7 @@ fn main() {
|
|||
3
|
||||
})
|
||||
.unwrap();
|
||||
gpu::init_statics();
|
||||
crate::processor::memory::mmio::gpu::init_statics();
|
||||
|
||||
let rom: Rom = match fs::read(args.rom) {
|
||||
Ok(data) => Rom::load(data),
|
||||
|
|
|
@ -5,7 +5,7 @@ use gilrs::ConnectedGamepadsIterator;
|
|||
use minifb::Key;
|
||||
// use std::io::{stdout, Write};
|
||||
|
||||
mod mmio;
|
||||
pub mod mmio;
|
||||
pub(crate) mod rom;
|
||||
|
||||
pub(crate) type Address = u16;
|
||||
|
|
|
@ -41,7 +41,7 @@ pub struct Gpu {
|
|||
}
|
||||
|
||||
impl Gpu {
|
||||
pub(super) fn new(enable_tile_window: bool) -> Self {
|
||||
pub fn new(enable_tile_window: bool) -> Self {
|
||||
let tile_window = if enable_tile_window {
|
||||
let mut window = Window::new(
|
||||
"Tiles",
|
|
@ -3,11 +3,13 @@ use minifb::Window;
|
|||
use crate::{
|
||||
processor::{
|
||||
get_bit,
|
||||
gpu::{
|
||||
bits_to_mapped_colour, scale_buffer, Palette, TiledataArea, TILE_WINDOW_HEIGHT,
|
||||
TILE_WINDOW_HEIGHT_SCALED, TILE_WINDOW_WIDTH, TILE_WINDOW_WIDTH_SCALED,
|
||||
memory::{
|
||||
mmio::gpu::{
|
||||
bits_to_mapped_colour, scale_buffer, Palette, TiledataArea, TILE_WINDOW_HEIGHT,
|
||||
TILE_WINDOW_HEIGHT_SCALED, TILE_WINDOW_WIDTH, TILE_WINDOW_WIDTH_SCALED,
|
||||
},
|
||||
Memory,
|
||||
},
|
||||
memory::Memory,
|
||||
},
|
||||
FACTOR,
|
||||
};
|
|
@ -1,6 +1,8 @@
|
|||
mod apu;
|
||||
pub(crate) mod gpu;
|
||||
mod joypad;
|
||||
mod serial;
|
||||
pub use apu::Apu;
|
||||
pub use gpu::Gpu;
|
||||
pub use joypad::Joypad;
|
||||
pub use serial::Serial;
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
use std::time::Instant;
|
||||
|
||||
use self::{gpu::Gpu, memory::Memory, timer::Timers};
|
||||
use self::{
|
||||
memory::{mmio::Gpu, Memory},
|
||||
timer::Timers,
|
||||
};
|
||||
use crate::{
|
||||
util::{clear_bit, get_bit},
|
||||
verbose_println,
|
||||
|
@ -8,7 +11,6 @@ use crate::{
|
|||
use gilrs::Gilrs;
|
||||
use minifb::Window;
|
||||
|
||||
pub mod gpu;
|
||||
mod instructions;
|
||||
pub mod memory;
|
||||
mod opcodes;
|
||||
|
|
Loading…
Reference in a new issue