nes-"support" mapper 191 (no known test cases)

This commit is contained in:
zeromus 2012-03-09 04:57:46 +00:00
parent b65438d819
commit edebf0da14
5 changed files with 110 additions and 1 deletions

View File

@ -127,6 +127,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper115.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper182.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper189.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper191.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\Mapper206.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\MMC3_family.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\MMC3_family\NES-QJ.cs" />

View File

@ -99,7 +99,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an
184 Sunsoft-1 Complete
185 Misc (J) Complete
189 MMC3Variant Decent
191 Pirate Junk (mmc3 variant)
*191 Pirate Minimal (mmc3 variant) - No known game uses this (extant dumps of Sugoro Quest use mapper 4). So this isn't tested.
192 Pirate Junk (mmc3 variant)
193 Unlicensed Junk - Started
194 Pirate Junk

View File

@ -0,0 +1,53 @@
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
public class Mapper189 : MMC3Board_Base
{
public override bool Configure(NES.EDetectionOrigin origin)
{
//analyze board type
switch (Cart.board_type)
{
case "MAPPER189":
break;
default:
return false;
}
BaseSetup();
return true;
}
int prg;
protected override int Get_PRGBank_8K(int addr)
{
int block_8k = addr >> 13;
return (prg * 4) + block_8k;
}
public override void WriteWRAM(int addr, byte value)
{
base.WriteWRAM(addr, value);
int prg_a = value & 0xF;
int prg_b = (value>>4)&0xF;
prg = prg_a | prg_b;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("prg", ref prg);
}
public override void WriteEXP(int addr, byte value)
{
WriteWRAM(addr, value);
}
}
}

View File

@ -0,0 +1,54 @@
using System;
using System.IO;
using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo
{
public class Mapper191 : MMC3Board_Base
{
public override bool Configure(NES.EDetectionOrigin origin)
{
//analyze board type
switch (Cart.board_type)
{
case "MAPPER191":
break;
default:
return false;
}
throw new InvalidOperationException("THIS MAPPER ISNT TESTED! WHAT GAME USES IT? PLEASE REPORT!");
//this board has 2k of chr ram
Cart.vram_size = 2;
BaseSetup();
return true;
}
public override byte ReadPPU(int addr)
{
if (addr > 0x2000) return base.ReadPPU(addr);
int bank_1k = Get_CHRBank_1K(addr);
if (bank_1k.Bit(7))
{
//this is referencing chr ram
return VRAM[addr & 0x7FF];
}
else return base.ReadPPU(addr);
}
public override void WritePPU(int addr, byte value)
{
if (addr > 0x2000) base.WritePPU(addr,value);
int bank_1k = Get_CHRBank_1K(addr);
if (bank_1k.Bit(7))
{
//this is referencing chr ram
VRAM[addr & 0x7FF] = value;
}
else base.WritePPU(addr, value);
}
}
}

View File

@ -108,6 +108,7 @@ static string ClassifyTable = @"
115 -1 -1 -1 -1 MAPPER115
182 -1 -1 -1 -1 MAPPER182
189 -1 -1 -1 -1 MAPPER189
191 -1 -1 -1 -1 MAPPER191
232 -1 -1 -1 -1 CAMERICA-ALGQ; Quattro Adventure
240 -1 -1 -1 -1 MAPPER240
";