nes-fix mapper 242
This commit is contained in:
parent
fd6a1a88da
commit
a1cdd5dbfd
|
@ -4,8 +4,6 @@ using System.Diagnostics;
|
||||||
|
|
||||||
namespace BizHawk.Emulation.Consoles.Nintendo
|
namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
{
|
{
|
||||||
//(doesnt work in neshawk; works in fceux)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
PCB Class: Unknown
|
PCB Class: Unknown
|
||||||
iNES Mapper 242
|
iNES Mapper 242
|
||||||
|
@ -22,7 +20,7 @@ mirroring - both
|
||||||
|
|
||||||
class Mapper242 : NES.NESBoardBase
|
class Mapper242 : NES.NESBoardBase
|
||||||
{
|
{
|
||||||
int prg, mirror;
|
int prg;
|
||||||
|
|
||||||
public override bool Configure(NES.EDetectionOrigin origin)
|
public override bool Configure(NES.EDetectionOrigin origin)
|
||||||
{
|
{
|
||||||
|
@ -34,6 +32,7 @@ mirroring - both
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,22 +43,20 @@ mirroring - both
|
||||||
|
|
||||||
public override void WritePRG(int addr, byte value)
|
public override void WritePRG(int addr, byte value)
|
||||||
{
|
{
|
||||||
mirror = (value & 0x03);
|
|
||||||
prg = (addr >> 3) & 15;
|
prg = (addr >> 3) & 15;
|
||||||
switch (mirror)
|
//fceux had different logic here for the mirroring, but that didnt match with experiments on dragon quest 8 nor disch's docs
|
||||||
{
|
//i changed it at the same time
|
||||||
case 0: SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); break;
|
bool mirror = addr.Bit(1);
|
||||||
case 1: SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal); break;
|
if (mirror)
|
||||||
case 2: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); break;
|
SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal);
|
||||||
case 3: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenB); break;
|
else
|
||||||
}
|
SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SyncState(Serializer ser)
|
public override void SyncState(Serializer ser)
|
||||||
{
|
{
|
||||||
base.SyncState(ser);
|
base.SyncState(ser);
|
||||||
ser.Sync("prg", ref prg);
|
ser.Sync("prg", ref prg);
|
||||||
ser.Sync("mirror", ref mirror);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue