NES - Implement boards JALECO_JF_05 and JALECO_JF_06 (iNES mapper 87)

This commit is contained in:
andres.delikat 2011-09-19 22:55:43 +00:00
parent 14f3172e42
commit 820d003544
4 changed files with 190 additions and 70 deletions

View File

@ -99,7 +99,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\Irem_G101.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Irem_H3001.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Jaleco-JF_11_14.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_JF_07.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\JALECO_JF_05_06_07.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper069.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper107.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper240.cs" />

View File

@ -71,7 +71,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an
082 Misc (J) Nothing
085 VRC7 Needed (lagrange point)
086 Misc (J) Nothing
087 Misc (J) Started but City Connection and Ninja Jajamaru Kun crash (possibly in need of a db entry)
087 Misc (J) Complete
088 Misc (J) Nothing
089 Misc (J) Nothing (easy)
090 Garbage Junk (+209)

View File

@ -0,0 +1,188 @@
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
/*
PRG-ROM - 32kb/16kb
CHR-ROM - 16kb
Mirroring - Vertical
ines Mapper 87
Example Games:
--------------------------
City Connection (J) - JF_05
Ninja Jajamaru Kun
Argus (J) - JF_07
*/
class JALECO_JF_05 : NES.NESBoardBase
{
bool hibit, lowbit;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "JALECO-JF-05":
AssertPrg(16); AssertChr(16); AssertVram(0); AssertWram(0);
break;
default:
return false;
}
SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("hibit", ref hibit);
ser.Sync("lowbit", ref lowbit);
}
public override void WriteWRAM(int addr, byte value)
{
hibit = value.Bit(0);
lowbit = value.Bit(1);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
{
if (lowbit)
{
if (hibit)
return VROM[addr + 0x6000];
return VROM[addr + 0x2000];
}
else
{
if (hibit)
return VROM[addr + 0x4000];
return VROM[addr];
}
}
return base.ReadPPU(addr);
}
public override byte ReadPRG(int addr)
{
if (addr > 0x4000) addr -= 0x4000;
return base.ReadPRG(addr);
}
}
class JALECO_JF_06 : NES.NESBoardBase
{
bool hibit, lowbit;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "JALECO-JF-06":
AssertPrg(16); AssertChr(16); AssertVram(0); AssertWram(0);
break;
default:
return false;
}
SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("hibit", ref hibit);
ser.Sync("lowbit", ref lowbit);
}
public override void WriteWRAM(int addr, byte value)
{
hibit = value.Bit(0);
lowbit = value.Bit(1);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
{
if (lowbit)
{
if (hibit)
return VROM[addr + 0x6000];
return VROM[addr + 0x2000];
}
else
{
if (hibit)
return VROM[addr + 0x4000];
return VROM[addr];
}
}
return base.ReadPPU(addr);
}
public override byte ReadPRG(int addr)
{
if (addr > 0x4000) addr -= 0x4000;
return base.ReadPRG(addr);
}
}
class JALECO_JF_07: NES.NESBoardBase
{
bool hibit, lowbit;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "JALECO-JF-07":
break;
default:
return false;
}
SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("hibit", ref hibit);
ser.Sync("lowbit", ref lowbit);
}
public override void WriteWRAM(int addr, byte value)
{
hibit = value.Bit(0);
lowbit = value.Bit(1);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
{
if (lowbit)
{
if (hibit)
return VROM[addr + 0x6000];
return VROM[addr + 0x2000];
}
else
{
if (hibit)
return VROM[addr + 0x4000];
return VROM[addr];
}
}
return base.ReadPPU(addr);
}
}
}

View File

@ -1,68 +0,0 @@
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
/*
PRG-ROM - 32kb
CHR-ROM - 16kb
Mirroring - Vertical
ines Mapper 87 (Board JALECO_JF_05 is also classified under mapper 87)
Example Games:
--------------------------
Argus (J)
*/
class JALECO_JF_07: NES.NESBoardBase
{
bool hibit, lowbit;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "JALECO-JF-07":
break;
default:
return false;
}
SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("hibit", ref hibit);
ser.Sync("lowbit", ref lowbit);
}
public override void WriteWRAM(int addr, byte value)
{
hibit = value.Bit(0);
lowbit = value.Bit(1);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
{
if (lowbit)
{
if (hibit)
return VROM[addr + 0x6000];
return VROM[addr + 0x2000];
}
else
{
if (hibit)
return VROM[addr + 0x4000];
return VROM[addr];
}
}
return base.ReadPPU(addr);
}
}
}