2013-11-04 00:36:15 +00:00
|
|
|
|
using BizHawk.Common;
|
|
|
|
|
|
2013-11-14 13:15:41 +00:00
|
|
|
|
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
2012-07-17 23:52:55 +00:00
|
|
|
|
{
|
2013-08-25 01:08:17 +00:00
|
|
|
|
public sealed class Mapper60 : NES.NESBoardBase
|
2012-07-17 23:52:55 +00:00
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
Here are Disch's original notes:
|
|
|
|
|
========================
|
|
|
|
|
= Mapper 060 =
|
|
|
|
|
========================
|
|
|
|
|
|
|
|
|
|
Example Game:
|
|
|
|
|
--------------------------
|
|
|
|
|
Reset Based 4-in-1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Notes:
|
|
|
|
|
---------------------------
|
|
|
|
|
This mapper is very, very unique.
|
|
|
|
|
|
|
|
|
|
It's a multicart that consists of four NROM games, each with 16k PRG (put at $8000 and $C000) and 8k CHR.
|
|
|
|
|
The current block that is selected is determined by an internal register that can only be incremented by a
|
|
|
|
|
soft reset!
|
|
|
|
|
|
|
|
|
|
I would assume the register is 2 bits wide? Don't know for sure.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
int reg = 0;
|
|
|
|
|
public override bool Configure(NES.EDetectionOrigin origin)
|
|
|
|
|
{
|
|
|
|
|
switch (Cart.board_type)
|
|
|
|
|
{
|
|
|
|
|
case "MAPPER060":
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void SyncState(Serializer ser)
|
|
|
|
|
{
|
|
|
|
|
ser.Sync("reg", ref reg);
|
|
|
|
|
base.SyncState(ser);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void NESSoftReset()
|
|
|
|
|
{
|
|
|
|
|
if (reg >= 3)
|
|
|
|
|
{
|
|
|
|
|
reg = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
reg++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override byte ReadPRG(int addr)
|
|
|
|
|
{
|
2012-07-17 23:58:53 +00:00
|
|
|
|
addr &= 0x3FFF;
|
2012-07-17 23:52:55 +00:00
|
|
|
|
return ROM[addr + (reg * 0x4000)];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override byte ReadPPU(int addr)
|
|
|
|
|
{
|
|
|
|
|
if (addr < 0x2000)
|
|
|
|
|
{
|
|
|
|
|
return VROM[(reg * 0x2000) + addr];
|
|
|
|
|
}
|
|
|
|
|
return base.ReadPPU(addr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|