move constants in the display module

This commit is contained in:
Denis-Cosmin Nutiu 2024-12-08 23:17:48 +02:00
parent b447f0ccee
commit 717a5a85c6
2 changed files with 3 additions and 9 deletions

View file

@ -5,10 +5,10 @@ use ratatui::widgets::{Block, Borders};
use ratatui::DefaultTerminal; use ratatui::DefaultTerminal;
/// Represents the display's width in pixels. /// Represents the display's width in pixels.
const DISPLAY_WIDTH: usize = 64; pub const DISPLAY_WIDTH: usize = 64;
/// Represents the display's height pixels. /// Represents the display's height pixels.
const DISPLAY_HEIGHT: usize = 32; pub const DISPLAY_HEIGHT: usize = 32;
/// Display trait /// Display trait
pub trait Display { pub trait Display {

View file

@ -1,4 +1,5 @@
use crate::display::Display; use crate::display::Display;
use crate::display::{DISPLAY_HEIGHT, DISPLAY_WIDTH};
use crate::instruction::{Instruction, ProcessorInstruction}; use crate::instruction::{Instruction, ProcessorInstruction};
use crate::sound::SoundModule; use crate::sound::SoundModule;
use crate::stack::Stack; use crate::stack::Stack;
@ -11,12 +12,6 @@ use std::path::Path;
use std::thread::sleep; use std::thread::sleep;
use std::time::{Duration, Instant}; 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 MEMORY_SIZE: usize = 4096;
const NUMBER_OF_REGISTERS: usize = 16; const NUMBER_OF_REGISTERS: usize = 16;
const FONT_SPRITES: [u8; 80] = [ const FONT_SPRITES: [u8; 80] = [
@ -138,7 +133,6 @@ where
} }
tick_timer = Instant::now(); tick_timer = Instant::now();
} else { } else {
sleep(Duration::from_millis(1)); sleep(Duration::from_millis(1));
} }