From aa6e1872df8fd1e84ea7568af0b6da72a38f1290 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 13 Mar 2011 19:35:50 +0000 Subject: [PATCH] [NES] setup a tiny bit of infrastructure for peeking the ppu instead of reading it, but really it isnt necessary until some of the more sophisticated mappers are made --- BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs | 2 +- BizHawk.Emulation/Consoles/Nintendo/NES/PPU.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs index 788de4efa5..c92c7b1c4b 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/NES.cs @@ -176,7 +176,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo var SystemBus = new MemoryDomain("System Bus", 0x10000, Endian.Little, addr => ReadMemory((ushort)addr), (addr, value) => WriteMemory((ushort)addr, value)); var PPUBus = new MemoryDomain("PPU Bus", 0x4000, Endian.Little, - addr => ppu.ppubus_read(addr), (addr, value) => ppu.ppubus_write(addr, value)); + addr => ppu.ppubus_peek(addr), (addr, value) => ppu.ppubus_write(addr, value)); var dCIRAM = new MemoryDomain("CIRAM (nametables)", 0x800, Endian.Little, addr => CIRAM[addr & 0x07FF], (addr, value) => CIRAM[addr & 0x07FF] = value); diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/PPU.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/PPU.cs index f094d62086..185c03850d 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/PPU.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/PPU.cs @@ -25,6 +25,12 @@ namespace BizHawk.Emulation.Consoles.Nintendo return nes.board.ReadPPU(addr); } + //debug tools peek into the ppu through this + public byte ppubus_peek(int addr) + { + return nes.board.PeekPPU(addr); + } + enum PPUPHASE { VBL, BG, OBJ };