2011-05-28 09:52:32 +00:00
|
|
|
using System;
|
|
|
|
using System.IO;
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
namespace BizHawk.Emulation.Consoles.Nintendo
|
|
|
|
{
|
2012-10-17 00:25:46 +00:00
|
|
|
[NES.INESBoardImplPriority]
|
2011-05-28 09:52:32 +00:00
|
|
|
public class TVROM : MMC3Board_Base
|
|
|
|
{
|
|
|
|
public override bool Configure(NES.EDetectionOrigin origin)
|
|
|
|
{
|
|
|
|
//analyze board type
|
|
|
|
switch (Cart.board_type)
|
|
|
|
{
|
|
|
|
case "NES-TVROM": //rad racer II (U)
|
|
|
|
AssertPrg(64); AssertChr(64); AssertVram(8); AssertWram(0);
|
|
|
|
AssertBattery(false);
|
|
|
|
break;
|
2012-10-15 21:34:39 +00:00
|
|
|
case "NES-TR1ROM": // Gauntlet variant (untested!)
|
|
|
|
break;
|
2011-05-28 09:52:32 +00:00
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
BaseSetup();
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//nesdev wiki says that the nes CIRAM doesnt get used at all.
|
|
|
|
//and that even though 8KB is really here, only 4KB gets used.
|
|
|
|
//still, purists could validate it.
|
|
|
|
|
|
|
|
public override byte ReadPPU(int addr)
|
|
|
|
{
|
|
|
|
if (addr < 0x2000)
|
|
|
|
{
|
|
|
|
//read patterns from mapper controlled area
|
|
|
|
return base.ReadPPU(addr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return VRAM[addr & 0xFFF];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void WritePPU(int addr, byte value)
|
|
|
|
{
|
|
|
|
if (addr < 0x2000)
|
|
|
|
{
|
|
|
|
//nothing wired here
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
VRAM[addr & 0xFFF] = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|