From dfadccd68c514948f453217d4c5ca1131cff4bb0 Mon Sep 17 00:00:00 2001 From: Ry Date: Sun, 24 Jul 2022 17:08:45 -0700 Subject: [PATCH] Use a const for the framebuffer address --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index fbcd6f6..860a6de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,6 +36,8 @@ use winit_input_helper::WinitInputHelper; const WIDTH: usize = 640; const HEIGHT: usize = 480; +const FRAMEBUFFER_ADDRESS: usize = 0x02000000; + pub struct Display { background: Vec, overlays: Arc>>, @@ -283,7 +285,7 @@ impl Display { let overlay_lock = self.overlays.lock().unwrap(); for i in 0..(HEIGHT*WIDTH*4) as usize { - self.background[i] = ram[0x02000000 + i]; + self.background[i] = ram[FRAMEBUFFER_ADDRESS + i]; } for index in 0..=31 {