nes-support mapper 241

This commit is contained in:
zeromus 2012-06-20 22:24:56 +00:00
parent a5df44f1a7
commit 8bf9b92949
6 changed files with 87 additions and 3 deletions

View File

@ -153,6 +153,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper193.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper227.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper240.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper241.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper242.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper078.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper046.cs" />

View File

@ -123,6 +123,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an
233 Multicart Junk
234 Misc Nothing
240 Misc (CN) Complete
241 Misc (CN) Complete
242 Misc (CN) Complete
243 Misc Nothing
245 Pirate Junk

View File

@ -369,6 +369,15 @@ namespace BizHawk.Emulation.Consoles.Nintendo
cart.pad_h = byte.Parse(dict["PAD_H"]);
if (dict.ContainsKey("PAD_V"))
cart.pad_v = byte.Parse(dict["PAD_V"]);
if(dict.ContainsKey("MIR"))
if (dict["MIR"] == "H")
{
cart.pad_v = 1; cart.pad_h = 0;
}
else if (dict["MIR"] == "V")
{
cart.pad_h = 1; cart.pad_v = 0;
}
if (dict.ContainsKey("BAD"))
cart.bad = true;
if (dict.ContainsKey("MMC3"))

View File

@ -22,7 +22,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
default:
return false;
}
prg_bank_mask_8k = (Cart.prg_size / 16) - 1;
prg_bank_mask_8k = (Cart.prg_size / 8) - 1;
prg_banks_8k[0] = 0;
prg_banks_8k[1] = 1;
@ -77,10 +77,10 @@ namespace BizHawk.Emulation.Consoles.Nintendo
prg_banks_8k[3] = (byte)((prg_high * 2 + 1) ^ prg_low_val);
break;
}
ApplyMemoryMapMask(prg_bank_mask_8k, prg_banks_8k);
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);

View File

@ -0,0 +1,70 @@
//163 is for nanjing games
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
class Mapper241 : NES.NESBoardBase
{
//configuration
int prg_bank_mask_32k;
//state
ByteBuffer prg_banks_32k = new ByteBuffer(1);
public override bool Configure(NES.EDetectionOrigin origin)
{
//configure
switch (Cart.board_type)
{
case "MAPPER241":
break;
default:
return false;
}
prg_bank_mask_32k = (Cart.prg_size / 32) - 1;
prg_banks_32k[0] = 0;
SetMirrorType(Cart.pad_h, Cart.pad_v);
return true;
}
public override byte ReadEXP(int addr)
{
//some kind of magic number..
return 0x50;
}
public override void WritePPU(int addr, byte value)
{
base.WritePPU(addr, value);
}
public override byte ReadPPU(int addr)
{
return base.ReadPPU(addr);
}
public override void WritePRG(int addr, byte value)
{
prg_banks_32k[0] = value;
ApplyMemoryMapMask(prg_bank_mask_32k, prg_banks_32k);
}
public override byte ReadPRG(int addr)
{
addr = ApplyMemoryMap(15, prg_banks_32k, addr);
return ROM[addr];
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("prg_banks_32k", ref prg_banks_32k);
}
}
}

View File

@ -125,6 +125,9 @@ sha1:977286FDC76C34A618E2A2D0270641BC36CFE89C Nintendo World Championships 1990
;these are from the 2002 konami collection and castlevania at least has a published TAS. presumably these are good, as they came from a PC game
sha1:EC652EE1660E527098102E26A36A8B9B7BB3943F Castlevania (Konami Collection 2002) NES board=NES-UNROM;PRG=128;WRAM=0;VRAM=8;PAD_H=1
sha1:B5C4E5E858113F5AA5E063BC79A12D7F6B856E6C Contra (Konami Collection 2002) NES board=NES-UNROM;PRG=128;WRAM=0;VRAM=8;PAD_H=1
;chinese shit
sha1:BFA31777E077E64AF0E274B5A22B57C6765D36E1 Fan Kong Jing Ying (Unl) (Ch) NES board=MAPPER241;MIR=H
;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------