NES - add Mapper 120 (not documented by Disch docs), used by Tobidase Daisakusen (FDS Conversion). Mapper implementation based on FCEUX but game freezes before gameplay starts (plays fine in FCEUX)

This commit is contained in:
adelikat 2012-08-04 19:02:51 +00:00
parent 087947273c
commit c0706ed0ac
2 changed files with 52 additions and 0 deletions

View File

@ -158,6 +158,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper090.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper107.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper116.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper120.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper164.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper176.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper178.cs" />

View File

@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.Nintendo
{
class Mapper120 : NES.NESBoardBase
{
//Used by Tobidase Daisakusen (FDS Conversion). Undocumented by Disch docs, this implementation is based on FCEUX
byte prg_reg;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "MAPPER120":
break;
default:
return false;
}
SetMirrorType(EMirrorType.Vertical);
return true;
}
public override void SyncState(Serializer ser)
{
ser.Sync("prg_reg", ref prg_reg);
base.SyncState(ser);
}
public override void WriteEXP(int addr, byte value)
{
if (addr == 0x01FF)
{
prg_reg = (byte)(value & 0x07);
}
}
public override byte ReadWRAM(int addr)
{
return ROM[((prg_reg & 7) * 0x2000) + (addr & 0x1FFF)];
}
public override byte ReadPRG(int addr)
{
return ROM[0x10000 + addr];
}
}
}