From f3aae71da61e58f088b602014562ce7877423592 Mon Sep 17 00:00:00 2001 From: James Groom Date: Wed, 31 Jan 2024 09:31:22 +0000 Subject: [PATCH] Expose PALRAM domain from NesHawk (resolves #3854) --- .../Consoles/Nintendo/NES/NES.IMemoryDomains.cs | 1 + src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs index faf3f19f46..2319b530ff 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.IMemoryDomains.cs @@ -27,6 +27,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES domains.Add(SystemBus); domains.Add(PPUBus); domains.Add(CIRAMdomain); + domains.Add(new MemoryDomainByteArray("PALRAM", MemoryDomain.Endian.Little, ppu.PALRAM, writable: true, wordSize: 1)); domains.Add(OAMdoman); if (Board is not FDS && Board.SaveRam != null) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs index d70f517d6b..b65481aab1 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/PPU.cs @@ -199,16 +199,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES this.nes = nes; OAM = new byte[0x100]; - PALRAM = new byte[0x20]; //power-up palette verified by blargg's power_up_palette test. //he speculates that these may differ depending on the system tested.. //and I don't see why the ppu would waste any effort setting these.. //but for the sake of uniformity, we'll do it. - Array.Copy(new byte[] { + PALRAM = new byte[] { 0x09,0x01,0x00,0x01,0x00,0x02,0x02,0x0D,0x08,0x10,0x08,0x24,0x00,0x00,0x04,0x2C, 0x09,0x01,0x34,0x03,0x00,0x04,0x00,0x14,0x08,0x3A,0x00,0x02,0x00,0x20,0x2C,0x08 - }, PALRAM, 0x20); + }; Reset(); }