2011-02-27 09:45:50 +00:00
|
|
|
using System;
|
2011-02-28 06:16:20 +00:00
|
|
|
using System.Diagnostics;
|
2011-02-27 09:45:50 +00:00
|
|
|
|
2011-03-08 07:25:35 +00:00
|
|
|
namespace BizHawk.Emulation.Consoles.Nintendo
|
2011-02-27 09:45:50 +00:00
|
|
|
{
|
2012-10-17 00:25:46 +00:00
|
|
|
[NES.INESBoardImplPriority]
|
2011-02-27 09:45:50 +00:00
|
|
|
public class NROM : NES.NESBoardBase
|
|
|
|
{
|
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;
|
|
|
|
|
2011-03-08 07:25:35 +00:00
|
|
|
case "HVC-NROM-256": //super mario bros.
|
2011-03-19 20:12:06 +00:00
|
|
|
case "NES-NROM-256": //10 yard fight
|
2011-03-08 07:25:35 +00:00
|
|
|
case "HVC-RROM": //balloon fight
|
2011-03-07 10:41:46 +00:00
|
|
|
case "HVC-NROM-128":
|
|
|
|
case "IREM-NROM-128":
|
|
|
|
case "KONAMI-NROM-128":
|
|
|
|
case "NES-NROM-128":
|
|
|
|
case "NAMCOT-3301":
|
2011-06-13 09:55:25 +00:00
|
|
|
case "HVC-HROM": //Donkey Kong Jr. (J)
|
|
|
|
case "JALECO-JF-01": //Exerion (J)
|
2012-03-06 07:51:41 +00:00
|
|
|
AssertPrg(8, 16, 32); AssertChr(8); AssertVram(0); AssertWram(0, 8);
|
2011-03-20 02:12:10 +00:00
|
|
|
break;
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|