From 8048495cbc27daa3c02f42ae96a8eff91e7e03bb Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 2 Jan 2021 23:58:49 -0600 Subject: [PATCH] chore: move ppu vram from stack to heap --- src/bus.rs | 2 -- src/ppu.rs | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bus.rs b/src/bus.rs index 970750b..18e3ad2 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -1,5 +1,3 @@ -use crate::ppu; - use super::cartridge::Cartridge; use super::ppu::PPU; #[derive(Debug, Clone)] diff --git a/src/ppu.rs b/src/ppu.rs index e1adaef..42c6c1e 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -1,14 +1,14 @@ #[derive(Debug, Clone)] pub struct PPU { lcdc: LCDControl, - pub vram: [u8; 8192], + pub vram: Box<[u8]>, } impl Default for PPU { fn default() -> Self { Self { lcdc: Default::default(), - vram: [0; 8192], + vram: vec![0; 8192].into_boxed_slice(), } } }