This commit is contained in:
Daniel Bauer
2020-01-04 23:19:17 +01:00
parent 6ed5f0339a
commit 47043b42a2
3 changed files with 26 additions and 18 deletions

View File

@@ -1,4 +1,3 @@
// Interface for devices that contain memory that can be accessed by CPU
use crate::nes::cartridge::Cartridge;
use crate::nes::types::*;
@@ -9,6 +8,7 @@ const PPU_ADDR_RANGE: [Addr; 2] = [0x2000, 0x3fff];
const PPU_PHYS_RANGE: [Addr; 2] = [0x2000, 0x2007];
const CART_ADDR_RANGE: [Addr; 2] = [0x4020, 0xffff];
// NES memory: Contains data from RAM, cartridge...
pub struct NESMemory {
ram: [Byte; RAM_SIZE], // 2kb
cartridge: Option<Cartridge>,