Mapper 228 support (Action 52, Cheetahmen 2)

This commit is contained in:
Souryo 2016-06-19 08:28:13 -04:00
parent 115ccc0705
commit a28ef85549
4 changed files with 49 additions and 0 deletions

43
Core/ActionEnterprises.h Normal file
View File

@ -0,0 +1,43 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class ActionEnterprises : public BaseMapper
{
protected:
virtual uint16_t GetPRGPageSize() { return 0x4000; }
virtual uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper()
{
WriteRegister(0x8000, 0);
}
virtual void Reset(bool softReset)
{
WriteRegister(0x8000, 0);
}
void WriteRegister(uint16_t addr, uint8_t value)
{
uint8_t chipSelect = (addr >> 11) & 0x03;
if(chipSelect == 3) {
chipSelect = 2;
}
uint8_t prgPage = ((addr >> 6) & 0x1F) | (chipSelect << 5);
if(addr & 0x20) {
SelectPRGPage(0, prgPage);
SelectPRGPage(1, prgPage);
} else {
SelectPRGPage(0, prgPage & 0xFE);
SelectPRGPage(1, (prgPage & 0xFE) + 1);
}
SelectCHRPage(0, ((addr & 0x0F) << 2) | (value & 0x03));
SetMirroringType(addr & 0x2000 ? MirroringType::Horizontal : MirroringType::Vertical);
}
};

View File

@ -382,6 +382,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="ActionEnterprises.h" />
<ClInclude Include="APU.h" />
<ClInclude Include="ArkanoidController.h" />
<ClInclude Include="AutoRomTest.h" />

View File

@ -649,6 +649,9 @@
<ClInclude Include="Sachen_143.h">
<Filter>Nes\Mappers\Sachen</Filter>
</ClInclude>
<ClInclude Include="ActionEnterprises.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

View File

@ -2,6 +2,7 @@
#include "MessageManager.h"
#include "MapperFactory.h"
#include "RomLoader.h"
#include "ActionEnterprises.h"
#include "AXROM.h"
#include "Bandai74161_7432.h"
#include "BandaiFcg.h"
@ -236,6 +237,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 218: return new Mapper218();
case 225: return new Mapper225();
case 226: return new Mapper226();
case 228: return new ActionEnterprises();
case 230: return new Mapper230();
case 231: return new Mapper231();
case 232: return new BF9096();