From 1d39da242786e53c12b5eeda7d02a5de5c4360c3 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 13 Mar 2011 02:58:29 +0000 Subject: [PATCH] [NES] decided how to implement EXP bus infrastructure, even though nothing uses it yet --- BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs | 4 ++++ BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs index 7038ceb52f..edd47b0d48 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/BoardSystem.cs @@ -16,9 +16,11 @@ namespace BizHawk.Emulation.Consoles.Nintendo byte ReadPRG(int addr); byte ReadPPU(int addr); byte PeekPPU(int addr); byte ReadPRAM(int addr); + byte ReadEXP(int addr); void WritePRG(int addr, byte value); void WritePPU(int addr, byte value); void WritePRAM(int addr, byte value); + void WriteEXP(int addr, byte value); byte[] SaveRam { get; } byte[] WRAM { get; set; } byte[] VRAM { get; set; } @@ -109,6 +111,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo public virtual void WritePRAM(int addr, byte value) { } public virtual byte ReadPRAM(int addr) { return 0xFF; } + public virtual void WriteEXP(int addr, byte value) { } + public virtual byte ReadEXP(int addr) { return 0xFF; } public virtual void WritePPU(int addr, byte value) { diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs index ce63714596..73e7e73ff3 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Core.cs @@ -202,7 +202,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo else if (addr < 0x2000) return ram[addr - 0x1800]; else if (addr < 0x4000) return ReadPPUReg(addr & 7); else if (addr < 0x4020) return ReadReg(addr); //we're not rebasing the register just to keep register names canonical - else if (addr < 0x6000) return 0xFF; //exp rom + else if (addr < 0x6000) return board.ReadEXP(addr); else if (addr < 0x8000) return board.ReadPRAM(addr); else return board.ReadPRG(addr - 0x8000); } @@ -215,7 +215,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo else if (addr < 0x2000) ram[addr - 0x1800] = value; else if (addr < 0x4000) WritePPUReg(addr & 7, value); else if (addr < 0x4020) WriteReg(addr, value); //we're not rebasing the register just to keep register names canonical - else if (addr < 0x6000) { } //exp rom + else if (addr < 0x6000) board.WriteEXP(addr, value); else if (addr < 0x8000) board.WritePRAM(addr, value); else board.WritePRG(addr - 0x8000, value); }