chore: convert select base 10 constants to base 16

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-04-08 20:32:32 -05:00
parent 770b081f98
commit 7425384fb1
5 changed files with 4 additions and 6 deletions

View File

@ -10,7 +10,7 @@ use super::timer::Timer;
use super::work_ram::{VariableWorkRam, WorkRam}; use super::work_ram::{VariableWorkRam, WorkRam};
use std::{fs::File, io::Read}; use std::{fs::File, io::Read};
const BOOT_ROM_SIZE: usize = 256; const BOOT_ROM_SIZE: usize = 0x100;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct Bus { pub struct Bus {

View File

@ -1,4 +1,4 @@
const HIGH_RAM_SIZE: usize = 127; const HIGH_RAM_SIZE: usize = 0x7F;
const HIGH_RAM_START_ADDRESS: usize = 0xFF80; const HIGH_RAM_START_ADDRESS: usize = 0xFF80;
#[derive(Debug, Clone)] #[derive(Debug, Clone)]

View File

@ -3,7 +3,7 @@ pub use instruction::Cycle;
pub const GB_WIDTH: usize = 160; pub const GB_WIDTH: usize = 160;
pub const GB_HEIGHT: usize = 144; 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 bus;
mod cartridge; mod cartridge;

View File

@ -1,8 +1,6 @@
use crate::Cycle; use crate::Cycle;
use bitfield::bitfield; use bitfield::bitfield;
// const DIVIDER_REGISTER_HZ: u32 = 16384;
#[derive(Debug, Clone, Copy)] #[derive(Debug, Clone, Copy)]
pub struct Timer { pub struct Timer {
pub control: TimerControl, pub control: TimerControl,

View File

@ -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 VARIABLE_WORK_RAM_SIZE: usize = WORK_RAM_SIZE;
const WORK_RAM_START_ADDRESS: usize = 0xC000; const WORK_RAM_START_ADDRESS: usize = 0xC000;
const VARIABLE_WORK_RAM_START_ADDRESS: usize = 0xD000; const VARIABLE_WORK_RAM_START_ADDRESS: usize = 0xD000;