Mapper 242 support

This commit is contained in:
Souryo 2016-01-18 21:46:53 -05:00
parent ce2236943a
commit 3f0972be23
6 changed files with 40 additions and 0 deletions

View File

@ -413,6 +413,10 @@ class BaseMapper : public IMemoryHandler, public Snapshotable, public INotificat
}
}
virtual void Reset(bool softReset)
{
}
void ApplyCheats()
{
RestoreOriginalPrgRam();

View File

@ -198,6 +198,7 @@
<ClInclude Include="ExpressionEvaluator.h" />
<ClInclude Include="HdVideoFilter.h" />
<ClInclude Include="IremTamS1.h" />
<ClInclude Include="Mapper242.h" />
<ClInclude Include="MMC3_115.h" />
<ClInclude Include="SoundMixer.h" />
<ClInclude Include="Namco108.h" />

View File

@ -359,6 +359,9 @@
<ClInclude Include="BF9096.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
<ClInclude Include="Mapper242.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

28
Core/Mapper242.h Normal file
View File

@ -0,0 +1,28 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Mapper242 : public BaseMapper
{
protected:
virtual uint16_t GetPRGPageSize() { return 0x8000; }
virtual uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper()
{
Reset(false);
SelectCHRPage(0, 0);
}
virtual void Reset(bool softReset)
{
SelectPRGPage(0, 0);
SetMirroringType(MirroringType::Vertical);
}
void WriteRegister(uint16_t addr, uint8_t value)
{
SetMirroringType(addr & 0x02 ? MirroringType::Horizontal : MirroringType::Vertical);
SelectPRGPage(0, (addr >> 3) & 0x0F);
}
};

View File

@ -15,6 +15,7 @@
#include "IremTamS1.h"
#include "JalecoJfxx.h"
#include "JalecoSs88006.h"
#include "Mapper242.h"
#include "MMC1.h"
#include "MMC2.h"
#include "MMC3.h"
@ -109,6 +110,7 @@ BaseMapper* MapperFactory::GetMapperFromID(ROMLoader &romLoader)
case 189: return new MMC3_189();
case 206: return new Namco108();
case 232: return new BF9096();
case 242: return new Mapper242();
}
MessageManager::DisplayMessage("Error", "Unsupported mapper, cannot load game.");

View File

@ -40,6 +40,8 @@ void MemoryManager::Reset(bool softReset)
if(!softReset) {
memset(_internalRAM, 0, InternalRAMSize);
}
_mapper->Reset(softReset);
}
uint8_t MemoryManager::ReadRegister(uint16_t addr)