Fix bug where address 0xFFFF was not accessible

jsmoo
Nick Krichevsky 2023-04-21 16:41:21 -04:00
parent e42303d31a
commit 7554438c7a
1 changed files with 2 additions and 2 deletions

View File

@ -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],
}
}
}