[NES] mapper 240 support

This commit is contained in:
zeromus 2011-06-22 04:43:05 +00:00
parent 316720baf4
commit e9fa5eae96
4 changed files with 74 additions and 2 deletions

View File

@ -82,6 +82,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\Jaleco-JF_11_14.cs" /> <Compile Include="Consoles\Nintendo\NES\Boards\Jaleco-JF_11_14.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper069.cs" /> <Compile Include="Consoles\Nintendo\NES\Boards\Mapper069.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper107.cs" /> <Compile Include="Consoles\Nintendo\NES\Boards\Mapper107.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper240.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper242.cs" /> <Compile Include="Consoles\Nintendo\NES\Boards\Mapper242.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\DRROM.cs" /> <Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\DRROM.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper095.cs" /> <Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper095.cs" />

View File

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

View File

@ -0,0 +1,71 @@
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
class Mapper240 : NES.NESBoardBase
{
//MHROM (mapper60) -like but wider regs (4 prg, 4 chr instead of 2 prg, 2 chr) and on EXP bus
//configuration
int prg_bank_mask_32k, chr_bank_mask_8k;
//state
int prg_bank_32k, chr_bank_8k;
public override bool Configure(NES.EDetectionOrigin origin)
{
//configure
switch (Cart.board_type)
{
case "MAPPER240":
break;
default:
return false;
}
prg_bank_mask_32k = Cart.prg_size / 32 - 1;
chr_bank_mask_8k = Cart.chr_size / 8 - 1;
SetMirrorType(Cart.pad_h, Cart.pad_v);
prg_bank_32k = 0;
chr_bank_8k = 0;
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("prg_bank_32k", ref prg_bank_32k);
ser.Sync("chr_bank_8k", ref chr_bank_8k);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
{
return VROM[addr + (chr_bank_8k * 0x2000)];
}
else return base.ReadPPU(addr);
}
public override byte ReadPRG(int addr)
{
return ROM[addr + (prg_bank_32k * 0x8000)];
}
public override void WriteEXP(int addr, byte value)
{
//if (ROM != null && bus_conflict) value = HandleNormalPRGConflict(addr, value);
Console.WriteLine("{0:x4} = {1:x2}", addr + 0x4000, value);
prg_bank_32k = (value >> 4) & 0xF;
chr_bank_8k = (value) & 0xF;
prg_bank_32k &= prg_bank_mask_32k;
chr_bank_mask_8k &= chr_bank_mask_8k;
}
}
}

View File

@ -102,9 +102,9 @@ static string ClassifyTable = @"
79 -1 -1 -1 -1 AVE-NINA-06; Blackjack (U) 79 -1 -1 -1 -1 AVE-NINA-06; Blackjack (U)
113 -1 -1 -1 -1 AVE-NINA-06; ??? 113 -1 -1 -1 -1 AVE-NINA-06; ???
232 -1 -1 -1 -1 CAMERICA-ALGQ; Quattro Adventure 232 -1 -1 -1 -1 CAMERICA-ALGQ; Quattro Adventure
240 -1 -1 -1 -1 MAPPER240
"; ";
} }
//;232 -1 -1 -1 -1 Camerica_BF9096-FLEX; Quattro Adventure
unsafe struct iNES_HEADER unsafe struct iNES_HEADER
{ {