Implement mapper 60
This commit is contained in:
parent
8aea375f9f
commit
2174e9938f
|
@ -167,6 +167,7 @@
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper078.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper078.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper046.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper046.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper246.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper246.cs" />
|
||||||
|
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper60.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\HKROM.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\HKROM.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper012.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper012.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper044.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper044.cs" />
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
|
{
|
||||||
|
class Mapper60 : NES.NESBoardBase
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
if (addr >= 0x4000)
|
||||||
|
{
|
||||||
|
addr -= 0x4000;
|
||||||
|
}
|
||||||
|
return ROM[addr + (reg * 0x4000)];
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte ReadPPU(int addr)
|
||||||
|
{
|
||||||
|
if (addr < 0x2000)
|
||||||
|
{
|
||||||
|
return VROM[(reg * 0x2000) + addr];
|
||||||
|
}
|
||||||
|
return base.ReadPPU(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue