Mapper 231 support

This commit is contained in:
Souryo 2016-01-18 22:26:54 -05:00
parent 1437cede86
commit f72b88def8
4 changed files with 37 additions and 0 deletions

View File

@ -198,6 +198,7 @@
<ClInclude Include="ExpressionEvaluator.h" />
<ClInclude Include="HdVideoFilter.h" />
<ClInclude Include="IremTamS1.h" />
<ClInclude Include="Mapper231.h" />
<ClInclude Include="Mapper240.h" />
<ClInclude Include="Mapper242.h" />
<ClInclude Include="Mapper246.h" />

View File

@ -368,6 +368,9 @@
<ClInclude Include="Mapper246.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
<ClInclude Include="Mapper231.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

31
Core/Mapper231.h Normal file
View File

@ -0,0 +1,31 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Mapper231 : public BaseMapper
{
protected:
virtual uint16_t GetPRGPageSize() { return 0x4000; }
virtual uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper()
{
SelectPRGPage(0, 0);
SelectPRGPage(1, 0);
SelectCHRPage(0, 0);
}
virtual void Reset(bool softReset)
{
SelectPRGPage(0, 0);
SelectPRGPage(1, 0);
}
void WriteRegister(uint16_t addr, uint8_t value)
{
uint8_t prgBank = ((addr >> 5) & 0x01) | (addr & 0x1E);
SelectPRGPage(0, prgBank & 0x1E);
SelectPRGPage(1, prgBank);
SetMirroringType(addr & 0x80 ? MirroringType::Horizontal : MirroringType::Vertical);
}
};

View File

@ -15,6 +15,7 @@
#include "IremTamS1.h"
#include "JalecoJfxx.h"
#include "JalecoSs88006.h"
#include "Mapper231.h"
#include "Mapper240.h"
#include "Mapper242.h"
#include "Mapper246.h"
@ -111,6 +112,7 @@ BaseMapper* MapperFactory::GetMapperFromID(ROMLoader &romLoader)
case 185: return new CNROM(true);
case 189: return new MMC3_189();
case 206: return new Namco108();
case 231: return new Mapper231();
case 232: return new BF9096();
case 240: return new Mapper240();
case 242: return new Mapper242();