[NES] clean up AxROM

This commit is contained in:
zeromus 2011-03-02 03:05:28 +00:00
parent e9622b1f60
commit a296742d5f
2 changed files with 23 additions and 18 deletions
BizHawk.Emulation/Consoles/Nintendo/NES/Boards
BizHawk.MultiClient/output

View File

@ -4,8 +4,6 @@ using System.Diagnostics;
namespace BizHawk.Emulation.Consoles.Nintendo.Boards
{
//TODO - hardcode CRAM size and assert
//generally mapper7
//Battletoads
@ -37,36 +35,43 @@ namespace BizHawk.Emulation.Consoles.Nintendo.Boards
{
base.Initialize(romInfo, nes);
//guess CRAM size (this is a very confident guess!)
if (RomInfo.CRAM_Size == -1) RomInfo.CRAM_Size = 8;
Debug.Assert(RomInfo.PRG_Size == 8 || RomInfo.PRG_Size == 16);
Debug.Assert(RomInfo.CRAM_Size == -1, "don't specify in gamedb, it is redundant");
cram = new byte[RomInfo.CRAM_Size * 1024];
cram_mask = cram.Length - 1;
if (type == "ANROM")
{
Debug.Assert(RomInfo.PRG_Size == 8, "not sure how to handle this; please report");
prg_mask = 3;
Debug.Assert(RomInfo.PRG_Size == 8);
prg_mask = 7;
}
if (type == "AOROM")
{
Debug.Assert(RomInfo.PRG_Size == 16 || RomInfo.PRG_Size == 8, "not sure how to handle this; please report");
prg_mask = RomInfo.PRG_Size-1;
Debug.Assert(RomInfo.PRG_Size == 8 || RomInfo.PRG_Size == 16);
prg_mask = 15;
}
//regardless of what the board is equipped to handle, reduce the mask to how much ROM is actually present
int rom_prg_mask = (RomInfo.PRG_Size - 1);
if (rom_prg_mask < prg_mask) prg_mask = rom_prg_mask;
//these boards always have 8KB of CRAM
RomInfo.CRAM_Size = 8;
cram = new byte[RomInfo.CRAM_Size * 1024];
cram_mask = cram.Length - 1;
//it is necessary to write during initialization to set the mirroring
WritePRG(0, 0);
}
public override byte ReadPRG(int addr)
{
return RomInfo.ROM[addr + (prg << 15)];
return RomInfo.ROM[addr + (prg << 14)];
}
public override void WritePRG(int addr, byte value)
{
if (bus_conflict) value = HandleNormalPRGConflict(addr,value);
prg = value & prg_mask;
prg = (value*2) & prg_mask;
if ((value & 0x10) == 0)
SetMirrorType(NES.EMirrorType.OneScreenA);
else

View File

@ -2284,8 +2284,8 @@ C4AE6CC4E981A8316429572409018DC8 Pac-Man (U) NES board=NROM;mirror=H;PRG=1;CHR
1A860B28AD960DFD700B066924341EDB Pac-Man (Unlicensed) (U) NES board=NROM;mirror=H;PRG=1;CHR=1
AD809323FE92D0E083BF77CCECAE462E Pinball (JU) NES board=NROM;mirror=H;PRG=1;CHR=1
170ADB71CBBAA754008345D623EB804C Popeye (JU) NES board=NROM;mirror=H;PRG=1;CHR=1
472E4F023B0DCCEDD343A046679710FE Pyramid (U) NES board=NROM;mirror=H;PRG=1;CHR=1;bug=1
B0F0B0CC14958D30E89D06AF182E7CD5 Raid on Bungeling Bay (U) NES board=NROM;mirror=V;PRG=1;CHR=1;bug=1
472E4F023B0DCCEDD343A046679710FE Pyramid (U) NES board=NROM;mirror=H;PRG=1;CHR=1;bug
B0F0B0CC14958D30E89D06AF182E7CD5 Raid on Bungeling Bay (U) NES board=NROM;mirror=V;PRG=1;CHR=1;bug
32A5E44B320AE588F560196E49BA13C6 Tennis (JU) NES board=NROM;mirror=H;PRG=1;CHR=1;
CB7F1463C90CDCDF5EF315C125F12FE2 Urban Champion (JU) NES board=NROM;mirror=V;PRG=1;CHR=1
4635D8D82A86E8B99390A0586C96D536 Wild Gunman (JUE) NES board=NROM;mirror=V;PRG=1;CHR=1
@ -2296,7 +2296,7 @@ BD2C15391B0641D43A35E83F5FCE073A 10-Yard Fight (U) NES board=NROM;mirror=H;PRG
B6A80DF3985843B31B55F7AF6D1D4546 4 Nin Uchi Mahjong (J) (PRG1) NES board=NROM;mirror=V;PRG=1;CHR=1
0B66FDF88964235C434DAFF62837AF60 1942 (JU) NES board=NROM;mirror=H;PRG=2;CHR=1
4B3B120FA98DCAE25FA88B29818572F8 Chubby Cherub (U) NES board=NROM;mirror=V;PRG=2;CHR=1
328B2C34D156E1C310495AEBB7BF987C Dig Dug 2 (U) NES board=NROM;mirror=V;PRG=2;CHR=1;bug=1
328B2C34D156E1C310495AEBB7BF987C Dig Dug 2 (U) NES board=NROM;mirror=V;PRG=2;CHR=1;bug
370F5862746B67637087B3B4CD64B163 Elevator Action (U) NES board=NROM;mirror=H;PRG=2;CHR=1
52485AD0D6AACA08BE2C1BD4C855A080 Galaga (U) NES board=NROM;mirror=H;PRG=2;CHR=1
5195D1381E082D307FE62AA4D73C488B Gyromite (JUE) NES board=NROM;mirror=V;PRG=2;CHR=1
@ -2308,7 +2308,7 @@ B6A80DF3985843B31B55F7AF6D1D4546 4 Nin Uchi Mahjong (J) (PRG1) NES board=NROM;
BCFC31B4F72A94946580AC3E68CE9F97 Magmax (U) NES board=NROM;mirror=H;PRG=2;CHR=1
B7F24E66A7DF5D102023977AB887D97E Ms Pac-Man (Namco) (U) NES board=NROM;mirror=H;PRG=2;CHR=1
05A599D5E76C5820F6C18D10E67448E5 Ms Pac-Man (U) NES board=NROM;mirror=H;PRG=2;CHR=1
1601FE20AE57415C9CE76481F2FA2389 Othello (U) NES board=NROM;mirror=H;PRG=2;CHR=1;bug=1
1601FE20AE57415C9CE76481F2FA2389 Othello (U) NES board=NROM;mirror=H;PRG=2;CHR=1;bug
1E24273E31739910AFE602515FB22AD8 Seicross (U) NES board=NROM;mirror=V;PRG=2;CHR=1
4D9A6662FD870A684B327046D0F13C60 Slalom (U) NES board=NROM;mirror=V;PRG=2;CHR=1
01E5E40688BDD0E4073F366D4ECA9E40 Soccer (JU) NES board=NROM;mirror=V;PRG=2;CHR=1
@ -2353,7 +2353,7 @@ B480855FFF883B20BA403A2009A7F13C Duck Tales (U) NES board=UNROM;mirror=V;PRG=8
C0C74CC78E6CD34775A83CC21A0C75B5 Paperboy 2 (U) NES board=UOROM;mirror=H;PRG=16;CRAM=8
;mapper66? mhrom? wtf??
;27100B746D50E6AE6FBAE2C794173240 Metal Gear (U) NES board=UXROM;mirror=H;PRG=8;CHR=0;CRAM=8;bug=1
;27100B746D50E6AE6FBAE2C794173240 Metal Gear (U) NES board=UXROM;mirror=H;PRG=8;CHR=0;CRAM=8;bug
;CNROM 2,2
646ADDFCC3F43330681482061BEF9493 Arkanoid (J) NES board=CNROM;mirror=H;PRG=2;CHR=2
@ -2381,7 +2381,7 @@ C6809FA829814A356446CE0B36F60EBF Time Lord (E) NES board=AOROM;PRG=8
;AOROM 16,0
DBF8909B943AB0F7ED0F210CE85FAFAF Battletoads (E) NES board=AOROM;PRG=16
318D9C03FB183F6F8CD2FC89FDD0DBB2 Battletoads (J) NES board=AOROM;PRG=16
EEFAC97AC3B85048F3685E1623210EFB Battletoads (U) NES board=AOROM;PRG=16
EEFAC97AC3B85048F3685E1623210EFB Battletoads (U) NES board=AOROM;PRG=16,bug
;COLORDREAMS 2,4 (mapper 11)
2956B171112843033E608A152DE6297B Metal Fighter (U) NES board=Discrete_74x377;mirror=V;PRG=2;CHR=4