Atari - start DPC mapper (Pitfall 2) - only does the basic bankswitching right now, still needs the 2k display bank and DPC sound chip

This commit is contained in:
adelikat 2012-10-30 01:33:56 +00:00
parent f9c027ddad
commit ca86a8dff3
3 changed files with 7 additions and 5 deletions

View File

@ -83,6 +83,7 @@
<Compile Include="Consoles\Atari\2600\Mappers\m3E.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m3F.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\m4A50.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mDPC.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mE0.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mE7.cs" />
<Compile Include="Consoles\Atari\2600\Mappers\mEF.cs" />

View File

@ -143,6 +143,7 @@ namespace BizHawk
case "EF": mapper = new mEF(); break;
case "X07": mapper = new mX07(); break;
case "4A50": mapper = new m4A50(); break;
case "DPC": mapper = new mDPC(); break;
default: throw new InvalidOperationException("mapper not supported: " + game.GetOptionsDict()["m"]);
}

View File

@ -27,13 +27,13 @@ namespace BizHawk
class mF8 : MapperBase
{
int toggle = 0;
int bank_4k = 0;
public override byte ReadMemory(ushort addr)
{
Address(addr);
if (addr < 0x1000) return base.ReadMemory(addr);
return core.rom[toggle*4*1024 + (addr&0xFFF)];
return core.rom[(bank_4k << 12) + (addr&0xFFF)];
}
public override void WriteMemory(ushort addr, byte value)
{
@ -44,13 +44,13 @@ namespace BizHawk
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("toggle", ref toggle);
ser.Sync("toggle", ref bank_4k);
}
void Address(ushort addr)
{
if (addr == 0x1FF8) toggle = 0;
else if (addr == 0x1FF9) toggle = 1;
if (addr == 0x1FF8) bank_4k = 0;
else if (addr == 0x1FF9) bank_4k = 1;
}
}
}