BizHawk/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper242.cs

64 lines
1.4 KiB
C#
Raw Normal View History

2011-04-18 02:26:42 +00:00
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
/*
PCB Class: Unknown
iNES Mapper #242
PRG-ROM: 32KB
PRG-RAM: None
CHR-ROM: 16KB
CHR-RAM: None
Battery is not available
mirroring - both
*
* Games:
* Wai Xing Zhan Shi (Ch)
*/
class Mapper242 : NES.NESBoardBase
{
2011-04-18 11:02:07 +00:00
int prg, mirror;
2011-04-18 02:26:42 +00:00
public override bool Configure(NES.EDetectionOrigin origin)
{
//configure
switch (Cart.board_type)
{
case "Mapper242":
break;
default:
return false;
}
return true;
}
public override byte ReadPPU(int addr)
{
2011-04-18 11:02:07 +00:00
//SetMirroring(mirror, mirror, 0, 0); //?? TODO
2011-04-18 02:26:42 +00:00
return base.ReadPPU(addr);
}
public override byte ReadPRG(int addr)
{
2011-04-18 11:02:07 +00:00
return VROM[addr + (prg * 0x8000)];
//return base.ReadPRG(addr);
2011-04-18 02:26:42 +00:00
}
public override void WriteWRAM(int addr, byte value)
{
2011-04-18 11:02:07 +00:00
mirror = (addr & 0x01);
prg = (addr & 0x7F) >> 3;
2011-04-18 02:26:42 +00:00
base.WriteWRAM(addr, value);
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
2011-04-18 11:02:07 +00:00
ser.Sync("prg", ref prg);
ser.Sync("mirror", ref mirror);
2011-04-18 02:26:42 +00:00
}
}
}