Mapper 225 support

This commit is contained in:
Souryo 2016-01-23 14:58:19 -05:00
parent dd4f7d8131
commit 4311e7ab4e
4 changed files with 49 additions and 0 deletions

View File

@ -376,6 +376,7 @@
<ClInclude Include="Mapper201.h" />
<ClInclude Include="Mapper202.h" />
<ClInclude Include="Mapper203.h" />
<ClInclude Include="Mapper225.h" />
<ClInclude Include="Mapper57.h" />
<ClInclude Include="Mapper61.h" />
<ClInclude Include="Mapper62.h" />

View File

@ -446,6 +446,9 @@
<ClInclude Include="Mapper112.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
<ClInclude Include="Mapper225.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

43
Core/Mapper225.h Normal file
View File

@ -0,0 +1,43 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Mapper225 : public BaseMapper
{
protected:
virtual uint16_t GetPRGPageSize() { return 0x4000; }
virtual uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper()
{
SelectPRGPage(0, 0);
SelectPRGPage(1, 1);
SelectCHRPage(0, 0);
}
virtual void Reset(bool softReset)
{
if(softReset) {
SelectPRGPage(0, 0);
SelectPRGPage(1, 1);
SelectCHRPage(0, 0);
}
}
void WriteRegister(uint16_t addr, uint8_t value)
{
uint8_t highBit = (addr >> 8) & 0x40;
uint8_t prgPage = ((addr >> 6) & 0x3F) | highBit;
if(addr & 0x0100) {
SelectPRGPage(0, prgPage);
SelectPRGPage(1, prgPage);
} else {
SelectPRGPage(0, prgPage & 0xFE);
SelectPRGPage(1, (prgPage & 0xFE) + 1);
}
SelectCHRPage(0, addr & 0x3F | highBit);
SetMirroringType(addr & 0x2000 ? MirroringType::Horizontal : MirroringType::Vertical);
}
};

View File

@ -28,6 +28,7 @@
#include "Mapper201.h"
#include "Mapper202.h"
#include "Mapper203.h"
#include "Mapper225.h"
#include "Mapper231.h"
#include "Mapper240.h"
#include "Mapper242.h"
@ -167,6 +168,7 @@ BaseMapper* MapperFactory::GetMapperFromID(ROMLoader &romLoader)
case 203: return new Mapper203();
case 205: return new MMC3_205();
case 206: return new Namco108();
case 225: return new Mapper225();
case 231: return new Mapper231();
case 232: return new BF9096();
case 240: return new Mapper240();