NES: support CAMERICA-GAMEGENIE (partially). you can't actually use it; it's mostly for documentation purposes.
This commit is contained in:
parent
65accb7c94
commit
f346b604d4
|
@ -243,6 +243,7 @@
|
|||
<Compile Include="Consoles\Nintendo\NES\Boards\BxROM.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Camerica.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\FS304.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\GameGenie.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper028.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\CNROM.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\CPROM.cs">
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using BizHawk.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
{
|
||||
// this is an internal testing thing, not really for using
|
||||
|
||||
public class GameGenie : NES.NESBoardBase
|
||||
{
|
||||
static byte[] NameTables = new byte[256];
|
||||
|
||||
static GameGenie()
|
||||
{
|
||||
for (int addr = 0; addr < 256; addr++)
|
||||
{
|
||||
byte d = 0;
|
||||
if (addr.Bit(2))
|
||||
{
|
||||
if (addr.Bit(4)) d |= 16;
|
||||
if (addr.Bit(5)) d |= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (addr.Bit(6)) d |= 16;
|
||||
if (addr.Bit(7)) d |= 1;
|
||||
}
|
||||
d |= (byte)(d << 1);
|
||||
d |= (byte)(d << 2);
|
||||
NameTables[addr] = d;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
switch (Cart.board_type)
|
||||
{
|
||||
case "CAMERICA-GAMEGENIE":
|
||||
break;
|
||||
case "UNIF_CAMERICA-GAMEGENIE":
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
AssertChr(0); AssertPrg(4);
|
||||
Cart.wram_size = 0;
|
||||
Cart.vram_size = 0;
|
||||
|
||||
SetMirroring(0, 0, 0, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override byte ReadPRG(int addr)
|
||||
{
|
||||
if (addr < 0x4000)
|
||||
return NES.DB;
|
||||
else
|
||||
return ROM[addr & 0xfff];
|
||||
}
|
||||
|
||||
public override byte ReadPPU(int addr)
|
||||
{
|
||||
if (addr >= 0x2000)
|
||||
return base.ReadPPU(addr);
|
||||
else
|
||||
return NameTables[addr & 0xff];
|
||||
}
|
||||
|
||||
public override void WritePRG(int addr, byte value)
|
||||
{
|
||||
NES.LogLine("{0:x4}<={1:x2}", addr + 0x8000, value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -68,10 +68,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
AssertChr(8); AssertVram(0); AssertWram(0);
|
||||
break;
|
||||
|
||||
case "CAMERICA-GAMEGENIE":
|
||||
// if you really want to emulate a game genie, it isn't NROM
|
||||
throw new Exception("Game Genie Support NYI");
|
||||
|
||||
case "HVC-FAMILYBASIC":
|
||||
// we don't emulate the controller, so this won't work
|
||||
AssertPrg(32); AssertChr(8); AssertWram(2, 4);
|
||||
|
|
Loading…
Reference in New Issue