Mapper 255 support

This commit is contained in:
Souryo 2016-08-13 09:58:25 -04:00
parent c1e55fc268
commit 3aea7f47f8
4 changed files with 33 additions and 1 deletions

26
Core/Bmc255.h Normal file
View File

@ -0,0 +1,26 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Bmc255 : public BaseMapper
{
protected:
virtual uint16_t GetPRGPageSize() { return 0x4000; }
virtual uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper()
{
WriteRegister(0x8000, 0);
}
void WriteRegister(uint16_t addr, uint8_t value)
{
uint8_t prgBit = (addr & 0x1000) ? 0 : 1;
uint8_t bank = ((addr >> 8) & 0x40) | ((addr >> 6) & 0x3F);
SelectPRGPage(0, bank & ~prgBit);
SelectPRGPage(1, bank | prgBit);
SelectCHRPage(0, ((addr >> 8) & 0x40) | (addr & 0x3F));
SetMirroringType(addr & 0x2000 ? MirroringType::Horizontal : MirroringType::Vertical);
}
};

View File

@ -412,6 +412,7 @@
<ClInclude Include="BaseSoundFilter.h" />
<ClInclude Include="BF9096.h" />
<ClInclude Include="BF909x.h" />
<ClInclude Include="Bmc255.h" />
<ClInclude Include="Bmc51.h" />
<ClInclude Include="Bmc63.h" />
<ClInclude Include="BnRom.h" />

View File

@ -880,6 +880,9 @@
<ClInclude Include="Mapper204.h">
<Filter>Nes\Mappers\Unnamed</Filter>
</ClInclude>
<ClInclude Include="Bmc255.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

View File

@ -11,6 +11,7 @@
#include "Bmc51.h"
#include "Bmc63.h"
#include "Bmc235.h"
#include "Bmc255.h"
#include "BnRom.h"
#include "BF909x.h"
#include "BF9096.h"
@ -187,7 +188,7 @@ Supported mappers:
|192|193|194|195| |197| | |200|201|202|203|204|205|206|207|
| |209|210|211|212|213|214| | | |218| | |221|222| |
| |225|226|227|228|229|230|231|232|233|234|235| |===|238|===|
|240|241|242|243|244|245|246|===|===|249|250|===|252| |254| |
|240|241|242|243|244|245|246|===|===|249|250|===|252| |254|255|
-----------------------------------------------------------------
*/
@ -399,6 +400,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 250: return new MMC3_250();
case 252: return new Waixing252();
case 254: return new MMC3_254();
case 255: return new Bmc255();
case MapperFactory::NsfMapperID: return new NsfMapper();
case MapperFactory::FdsMapperID: return new FDS();