chore: move LR35902_CLOCK_SPEED to lib.rs

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-03-21 02:10:56 -05:00
parent b548610fdb
commit 4db6f1de6e
2 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ pub use instruction::Cycles;
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
mod bus; mod bus;
mod cartridge; mod cartridge;

View File

@ -1,4 +1,5 @@
use anyhow::{anyhow, Result}; use anyhow::{anyhow, Result};
use gb::LR35902_CLOCK_SPEED;
use gb::{Cycles, LR35902}; use gb::{Cycles, LR35902};
use pixels::{Pixels, SurfaceTexture}; use pixels::{Pixels, SurfaceTexture};
use std::env::args; use std::env::args;
@ -14,7 +15,6 @@ const GB_WIDTH: u32 = 160;
const GB_HEIGHT: u32 = 144; const GB_HEIGHT: u32 = 144;
const SCALE: f64 = 5.0; const SCALE: f64 = 5.0;
const LR35902_CLOCK_SPEED: u32 = 4194304; // Hz | 4.194304Mhz
const LR35902_CYCLE_TIME: f64 = 1.0f64 / LR35902_CLOCK_SPEED as f64; const LR35902_CYCLE_TIME: f64 = 1.0f64 / LR35902_CLOCK_SPEED as f64;
const CYCLES_IN_FRAME: Cycles = Cycles::new(70224); const CYCLES_IN_FRAME: Cycles = Cycles::new(70224);