NES - implement freeze system on PPU bus
This commit is contained in:
parent
8601a863d8
commit
bfae7804f2
|
@ -259,6 +259,9 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
RAM.GetFreeze = addr => sysbus_freeze[addr & 0x07FF];
|
RAM.GetFreeze = addr => sysbus_freeze[addr & 0x07FF];
|
||||||
RAM.SetFreeze = (addr, value) => sysbus_freeze[addr & 0x07FF] = value;
|
RAM.SetFreeze = (addr, value) => sysbus_freeze[addr & 0x07FF] = value;
|
||||||
|
|
||||||
|
PPUBus.GetFreeze = addr => ppu.ppubus_freeze[addr];
|
||||||
|
PPUBus.SetFreeze = (addr, value) => ppu.ppubus_freeze[addr] = value;
|
||||||
|
|
||||||
//demo a game genie code
|
//demo a game genie code
|
||||||
GetWatch(NESWatch.EDomain.Sysbus, 0xB424).SetGameGenie(-1, 0x10);
|
GetWatch(NESWatch.EDomain.Sysbus, 0xB424).SetGameGenie(-1, 0x10);
|
||||||
GetWatch(NESWatch.EDomain.Sysbus, 0xB424).RemoveGameGenie();
|
GetWatch(NESWatch.EDomain.Sysbus, 0xB424).RemoveGameGenie();
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
{
|
{
|
||||||
public partial class PPU
|
public partial class PPU
|
||||||
{
|
{
|
||||||
|
public MemoryDomain.FreezeData[] ppubus_freeze = new MemoryDomain.FreezeData[16384];
|
||||||
|
|
||||||
//when the ppu issues a write it goes through here and into the game board
|
//when the ppu issues a write it goes through here and into the game board
|
||||||
public void ppubus_write(int addr, byte value)
|
public void ppubus_write(int addr, byte value)
|
||||||
{
|
{
|
||||||
|
@ -22,6 +24,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
//when the ppu issues a read it goes through here and into the game board
|
//when the ppu issues a read it goes through here and into the game board
|
||||||
public byte ppubus_read(int addr)
|
public byte ppubus_read(int addr)
|
||||||
{
|
{
|
||||||
|
//apply freeze
|
||||||
|
if (ppubus_freeze[addr].IsFrozen)
|
||||||
|
return ppubus_freeze[addr].value;
|
||||||
|
else
|
||||||
return nes.board.ReadPPU(addr);
|
return nes.board.ReadPPU(addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue