From 4db6f1de6e22e6692dbeda1890144e148f79927e Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 21 Mar 2021 02:10:56 -0500 Subject: [PATCH] chore: move LR35902_CLOCK_SPEED to lib.rs --- src/lib.rs | 1 + src/main.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 863e773..352c319 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ pub use instruction::Cycles; pub const GB_WIDTH: usize = 160; pub const GB_HEIGHT: usize = 144; +pub const LR35902_CLOCK_SPEED: u32 = 4194304; // Hz | 4.194304Mhz mod bus; mod cartridge; diff --git a/src/main.rs b/src/main.rs index d73f016..26ad229 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use anyhow::{anyhow, Result}; +use gb::LR35902_CLOCK_SPEED; use gb::{Cycles, LR35902}; use pixels::{Pixels, SurfaceTexture}; use std::env::args; @@ -14,7 +15,6 @@ const GB_WIDTH: u32 = 160; const GB_HEIGHT: u32 = 144; 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 CYCLES_IN_FRAME: Cycles = Cycles::new(70224);