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