From 8a67af227e2cea7010187840af9c1f26051e4f4f Mon Sep 17 00:00:00 2001 From: goyuken Date: Mon, 29 Oct 2012 17:11:19 +0000 Subject: [PATCH] NES: MMC5: add "ExRAM" as memory domain, for debugging purposes --- BizHawk.Emulation/Consoles/Nintendo/NES/Boards/ExROM.cs | 5 +++++ BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/ExROM.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/ExROM.cs index f491ebd844..24c2be1726 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/ExROM.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/ExROM.cs @@ -44,6 +44,11 @@ namespace BizHawk.Emulation.Consoles.Nintendo byte product_low, product_high; int last_nt_read; + public MemoryDomain GetExRAM() + { + return new MemoryDomain("ExRAM", EXRAM.Length, Endian.Little, (addr) => EXRAM[addr], (addr, val) => EXRAM[addr] = val); + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs index 465acdbc29..74fd17a715 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs @@ -427,10 +427,11 @@ namespace BizHawk.Emulation.Consoles.Nintendo domains.Add(WRAM); } + // if there were more boards with special ram sets, we'd want to do something more general if (board is FDS) - { domains.Add((board as FDS).GetDiskPeeker()); - } + else if (board is ExROM) + domains.Add((board as ExROM).GetExRAM()); memoryDomains = domains.AsReadOnly(); }