2014-01-24 03:05:41 +00:00
|
|
|
using System;
|
|
|
|
|
2013-11-14 13:15:41 +00:00
|
|
|
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
2011-02-27 09:45:50 +00:00
|
|
|
{
|
2012-10-17 00:25:46 +00:00
|
|
|
[NES.INESBoardImplPriority]
|
2013-08-25 01:08:17 +00:00
|
|
|
public sealed class NROM : NES.NESBoardBase
|
2011-02-27 09:45:50 +00:00
|
|
|
{
|
2011-03-01 09:32:12 +00:00
|
|
|
//configuration
|
2011-03-07 10:41:46 +00:00
|
|
|
int prg_byte_mask;
|
2011-03-01 09:32:12 +00:00
|
|
|
|
|
|
|
//state
|
|
|
|
//(none)
|
|
|
|
|
2011-03-20 02:12:10 +00:00
|
|
|
public override bool Configure(NES.EDetectionOrigin origin)
|
2011-02-28 06:16:20 +00:00
|
|
|
{
|
2011-03-20 02:12:10 +00:00
|
|
|
//configure.
|
|
|
|
//contrary to expectations, some NROM games may have WRAM if theyve been identified through iNES. lame.
|
2011-03-08 07:25:35 +00:00
|
|
|
switch (Cart.board_type)
|
2011-03-07 10:41:46 +00:00
|
|
|
{
|
2012-03-22 06:20:10 +00:00
|
|
|
case "MAPPER000":
|
2012-08-04 19:22:49 +00:00
|
|
|
case "MAPPER219": //adelikat: a version of 3D-Block tries to use this ROM, but plays fine as NROM and 219 is undocumented by Disch
|
2012-03-22 06:20:10 +00:00
|
|
|
break;
|
|
|
|
|
2014-01-22 16:31:33 +00:00
|
|
|
case "BANDAI-NROM-128":
|
2014-01-15 17:00:02 +00:00
|
|
|
case "BANDAI-NROM-256":
|
2014-01-22 16:31:33 +00:00
|
|
|
case "HVC-HROM": //Donkey Kong Jr. (J)
|
2011-03-07 10:41:46 +00:00
|
|
|
case "HVC-NROM-128":
|
2014-01-22 16:31:33 +00:00
|
|
|
case "HVC-NROM-256": //super mario bros.
|
|
|
|
case "HVC-RROM": //balloon fight
|
|
|
|
case "HVC-RTROM":
|
|
|
|
case "HVC-SROM":
|
|
|
|
case "HVC-STROM":
|
2011-03-07 10:41:46 +00:00
|
|
|
case "IREM-NROM-128":
|
2014-01-22 16:31:33 +00:00
|
|
|
case "IREM-NROM-256":
|
2011-06-13 09:55:25 +00:00
|
|
|
case "JALECO-JF-01": //Exerion (J)
|
2014-01-15 18:18:49 +00:00
|
|
|
case "JALECO-JF-02":
|
2014-01-15 23:27:02 +00:00
|
|
|
case "JALECO-JF-03":
|
2014-01-22 16:31:33 +00:00
|
|
|
case "JALECO-JF-04":
|
|
|
|
case "KONAMI-NROM-128":
|
|
|
|
case "NAMCOT-3301":
|
|
|
|
case "NAMCOT-3302":
|
2014-01-16 00:22:40 +00:00
|
|
|
case "NAMCOT-3303":
|
2014-01-23 23:08:56 +00:00
|
|
|
case "NAMCOT-3304":
|
2014-01-22 16:31:33 +00:00
|
|
|
case "NAMCOT-3305":
|
2014-01-16 00:22:40 +00:00
|
|
|
case "NAMCOT-3311":
|
2014-01-18 05:38:21 +00:00
|
|
|
case "NAMCOT-3312":
|
2014-01-22 16:31:33 +00:00
|
|
|
case "NES-NROM-128":
|
|
|
|
case "NES-NROM-256": //10 yard fight
|
|
|
|
case "NES-RROM-128":
|
|
|
|
case "SACHEN-NROM":
|
|
|
|
case "SETA-NROM-128":
|
|
|
|
case "SUNSOFT-NROM-128":
|
|
|
|
case "SUNSOFT-NROM-256":
|
|
|
|
case "TAITO-NROM-128":
|
|
|
|
case "TAITO-NROM-256":
|
|
|
|
case "TENGEN-800003": // ms pac man, others
|
|
|
|
case "UNIF_NES-NROM-128": // various
|
|
|
|
case "UNIF_NES-NROM-256": // Locksmith
|
2014-01-15 18:18:49 +00:00
|
|
|
AssertPrg(8, 16, 32);
|
|
|
|
AssertChr(8); AssertVram(0); AssertWram(0, 8);
|
2011-03-20 02:12:10 +00:00
|
|
|
break;
|
2014-01-15 23:27:02 +00:00
|
|
|
case "AVE-NINA-03":
|
2014-01-22 16:31:33 +00:00
|
|
|
// at least one game on this board has none of the mapper chips present,
|
|
|
|
// and emulates as simple NROM
|
2014-01-15 23:27:02 +00:00
|
|
|
if (Cart.chips.Count != 0)
|
|
|
|
return false;
|
|
|
|
AssertPrg(8, 16, 32);
|
|
|
|
AssertChr(8); AssertVram(0); AssertWram(0);
|
|
|
|
break;
|
2011-03-20 02:12:10 +00:00
|
|
|
|
2014-01-22 16:31:33 +00:00
|
|
|
case "HVC-FAMILYBASIC":
|
2014-01-24 03:05:41 +00:00
|
|
|
// we don't emulate the controller, so this won't work
|
|
|
|
AssertPrg(32); AssertChr(8); AssertWram(2, 4);
|
|
|
|
break;
|
2014-01-22 16:31:33 +00:00
|
|
|
|
2011-03-07 10:41:46 +00:00
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-03-08 07:25:35 +00:00
|
|
|
prg_byte_mask = (Cart.prg_size*1024) - 1;
|
|
|
|
SetMirrorType(Cart.pad_h, Cart.pad_v);
|
2011-03-07 10:41:46 +00:00
|
|
|
|
|
|
|
return true;
|
2011-02-28 06:16:20 +00:00
|
|
|
}
|
2011-03-07 10:41:46 +00:00
|
|
|
|
2011-02-27 09:45:50 +00:00
|
|
|
public override byte ReadPRG(int addr)
|
|
|
|
{
|
2011-03-07 10:41:46 +00:00
|
|
|
addr &= prg_byte_mask;
|
|
|
|
return ROM[addr];
|
2011-02-27 09:45:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|