diff --git a/src/bus.rs b/src/bus.rs index bf792b2..a9f20f8 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -10,7 +10,7 @@ use super::timer::Timer; use super::work_ram::{VariableWorkRam, WorkRam}; use std::{fs::File, io::Read}; -const BOOT_ROM_SIZE: usize = 256; +const BOOT_ROM_SIZE: usize = 0x100; #[derive(Debug, Clone)] pub struct Bus { diff --git a/src/high_ram.rs b/src/high_ram.rs index de6847d..b10e9f9 100644 --- a/src/high_ram.rs +++ b/src/high_ram.rs @@ -1,4 +1,4 @@ -const HIGH_RAM_SIZE: usize = 127; +const HIGH_RAM_SIZE: usize = 0x7F; const HIGH_RAM_START_ADDRESS: usize = 0xFF80; #[derive(Debug, Clone)] diff --git a/src/lib.rs b/src/lib.rs index 4f86712..e31cba8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ pub use instruction::Cycle; pub const GB_WIDTH: usize = 160; pub const GB_HEIGHT: usize = 144; -pub const LR35902_CLOCK_SPEED: u32 = 4194304; // Hz | 4.194304Mhz +pub const LR35902_CLOCK_SPEED: u32 = 0x400000; // Hz | 4.194304Mhz mod bus; mod cartridge; diff --git a/src/timer.rs b/src/timer.rs index 5d3e298..dac1972 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -1,8 +1,6 @@ use crate::Cycle; use bitfield::bitfield; -// const DIVIDER_REGISTER_HZ: u32 = 16384; - #[derive(Debug, Clone, Copy)] pub struct Timer { pub control: TimerControl, diff --git a/src/work_ram.rs b/src/work_ram.rs index e4307fb..852bbbc 100644 --- a/src/work_ram.rs +++ b/src/work_ram.rs @@ -1,4 +1,4 @@ -const WORK_RAM_SIZE: usize = 4096; +const WORK_RAM_SIZE: usize = 0x1000; const VARIABLE_WORK_RAM_SIZE: usize = WORK_RAM_SIZE; const WORK_RAM_START_ADDRESS: usize = 0xC000; const VARIABLE_WORK_RAM_START_ADDRESS: usize = 0xD000;