UNIF LH32 board support (Defined as mapper 125 in FCEUX)

This commit is contained in:
Souryo 2016-11-12 10:54:18 -05:00
parent ab5ef9947f
commit 8e7663e96c
4 changed files with 55 additions and 0 deletions

View file

@ -473,6 +473,7 @@
<ClInclude Include="Kaiser7058.h" />
<ClInclude Include="Kaiser7016.h" />
<ClInclude Include="Lh10.h" />
<ClInclude Include="Lh32.h" />
<ClInclude Include="Malee.h" />
<ClInclude Include="Mapper103.h" />
<ClInclude Include="Mapper106.h" />

View file

@ -1075,6 +1075,9 @@
<ClInclude Include="Kaiser7012.h">
<Filter>Nes\Mappers\Unif</Filter>
</ClInclude>
<ClInclude Include="Lh32.h">
<Filter>Nes\Mappers\Unif</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

49
Core/Lh32.h Normal file
View file

@ -0,0 +1,49 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Lh32 : public BaseMapper
{
private:
uint8_t _prgReg;
protected:
uint16_t GetPRGPageSize() { return 0x2000; }
uint16_t GetCHRPageSize() { return 0x2000; }
uint16_t RegisterStartAddress() { return 0x6000; }
uint16_t RegisterEndAddress() { return 0x6000; }
void InitMapper() override
{
_prgReg = 0;
SelectCHRPage(0, 0);
SelectPRGPage(0, -4);
SelectPRGPage(1, -3);
SelectPRGPage(2, 0, PrgMemoryType::WorkRam);
SelectPRGPage(3, -1);
UpdateState();
}
void StreamState(bool saving)
{
BaseMapper::StreamState(saving);
Stream(_prgReg);
if(!saving) {
UpdateState();
}
}
void UpdateState()
{
SetCpuMemoryMapping(0x6000, 0x7FFF, _prgReg, PrgMemoryType::PrgRom);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
_prgReg = value;
UpdateState();
}
};

View file

@ -68,6 +68,7 @@
#include "Kaiser7057.h"
#include "Kaiser7058.h"
#include "Lh10.h"
#include "Lh32.h"
#include "Malee.h"
#include "Mapper15.h"
#include "Mapper35.h"
@ -371,6 +372,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 120: return new Mapper120();
case 121: return new MMC3_121();
case 123: return new MMC3_123();
case 125: return new Lh32();
case 126: return new MMC3_126();
case 132: return new Txc22211A();
case 133: return new Sachen_133();