From 7554438c7a41ef03de0fa81c45f939321120b1f2 Mon Sep 17 00:00:00 2001 From: Nick Krichevsky Date: Fri, 21 Apr 2023 16:41:21 -0400 Subject: [PATCH] Fix bug where address 0xFFFF was not accessible --- src/memory.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/memory.rs b/src/memory.rs index 8665c6e..78500b8 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -18,7 +18,7 @@ pub enum Error { /// of the Gameboy's memory, and should not be relied upon for anything other than development #[derive(Debug, Clone)] pub struct Memory { - data: [u8; MAX_MEMORY_ADDRESS], + data: [u8; MAX_MEMORY_ADDRESS + 1], } impl Memory { @@ -67,7 +67,7 @@ impl Memory { impl Default for Memory { fn default() -> Self { Self { - data: [0_u8; MAX_MEMORY_ADDRESS], + data: [0_u8; MAX_MEMORY_ADDRESS + 1], } } }