Add Board IREM-74*161/161/21/138 (Mapper 77), Napoleon Senki now works

This commit is contained in:
andres.delikat 2011-09-24 21:21:27 +00:00
parent 3ba330cef6
commit 4d9fe23e5d
4 changed files with 65 additions and 3 deletions

View File

@ -100,6 +100,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\IC_74x377.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Consoles\Nintendo\NES\Boards\IREM-74_161_161_21_138.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Irem_G101.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Irem_H3001.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\IREM_TAM_S1.cs" />

View File

@ -64,7 +64,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an
074 Pirate (CN) Junk
075 VRC1 Nothing
076 Misc (J) Nothing
077 Misc (J) Nothing
077 Misc (J) Complete
078 Misc Complete
079 NINA-06 Complete
080 Misc (J) Nothing

View File

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.Emulation.Consoles.Nintendo
{
//Mapper 77
//Napoleon Senki
class IREM_74_161_161_21_138 : NES.NESBoardBase
{
int chr, prg;
public override bool Configure(NES.EDetectionOrigin origin)
{
//configure
switch (Cart.board_type)
{
case "IREM-74*161/161/21/138":
break;
default:
return false;
}
SetMirrorType(Cart.pad_h, Cart.pad_v);
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("chr", ref chr);
ser.Sync("prg", ref prg);
}
public override void WritePRG(int addr, byte value)
{
chr = (value >> 4) & 0x0F;
prg = value & 0x0F;
}
public override byte ReadPPU(int addr)
{
if (addr < 0x0800)
{
return VROM[addr + (chr * 0x0800)];
}
else if (addr < 0x2000)
return VRAM[addr];
else return base.ReadPPU(addr);
}
public override byte ReadPRG(int addr)
{
if (addr < 0x8000)
return ROM[addr + (prg * 0x8000)];
else
return base.ReadPRG(addr);
}
}
}

View File

@ -40,7 +40,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
}
public override byte ReadPPU(int addr)
{
{
if (addr < 0x2000)
{
int ofs = addr & ((1 << 13) - 1);
@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
return VROM[addr];
}
else return base.ReadPPU(addr);
}
}
public override byte ReadPRG(int addr)
{