diff --git a/src/display.rs b/src/display.rs index f13e952..4d6cdeb 100644 --- a/src/display.rs +++ b/src/display.rs @@ -5,10 +5,10 @@ use ratatui::widgets::{Block, Borders}; use ratatui::DefaultTerminal; /// Represents the display's width in pixels. -const DISPLAY_WIDTH: usize = 64; +pub const DISPLAY_WIDTH: usize = 64; /// Represents the display's height pixels. -const DISPLAY_HEIGHT: usize = 32; +pub const DISPLAY_HEIGHT: usize = 32; /// Display trait pub trait Display { diff --git a/src/emulator.rs b/src/emulator.rs index 48d453d..6a91e26 100644 --- a/src/emulator.rs +++ b/src/emulator.rs @@ -1,4 +1,5 @@ use crate::display::Display; +use crate::display::{DISPLAY_HEIGHT, DISPLAY_WIDTH}; use crate::instruction::{Instruction, ProcessorInstruction}; use crate::sound::SoundModule; use crate::stack::Stack; @@ -11,12 +12,6 @@ use std::path::Path; use std::thread::sleep; use std::time::{Duration, Instant}; -/// Represents the display's width in pixels. -const DISPLAY_WIDTH: usize = 64; - -/// Represents the display's height pixels. -const DISPLAY_HEIGHT: usize = 32; - const MEMORY_SIZE: usize = 4096; const NUMBER_OF_REGISTERS: usize = 16; const FONT_SPRITES: [u8; 80] = [ @@ -138,7 +133,6 @@ where } tick_timer = Instant::now(); - } else { sleep(Duration::from_millis(1)); }