UNIF: Added support for KS7031 boards

This commit is contained in:
Sour 2018-06-17 13:09:21 -04:00
parent 80a6981ad2
commit 24ff779124
6 changed files with 59 additions and 5 deletions

View File

@ -533,6 +533,7 @@
<ClInclude Include="IInputProvider.h" />
<ClInclude Include="IInputRecorder.h" />
<ClInclude Include="Kaiser7017.h" />
<ClInclude Include="Kaiser7031.h" />
<ClInclude Include="KeyManager.h" />
<ClInclude Include="MMC3_198.h" />
<ClInclude Include="MovieRecorder.h" />

View File

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

47
Core/Kaiser7031.h Normal file
View File

@ -0,0 +1,47 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Kaiser7031 : public BaseMapper
{
private:
uint8_t _regs[4];
protected:
uint16_t GetPRGPageSize() override { return 0x800; }
uint16_t GetCHRPageSize() override { return 0x2000; }
void InitMapper() override
{
SetMirroringType(MirroringType::Vertical);
memset(_regs, 0, sizeof(_regs));
for(int i = 0; i < 16; i++) {
SelectPRGPage(i, 15 - i);
}
SelectCHRPage(0, 0);
UpdateState();
}
void StreamState(bool saving) override
{
BaseMapper::StreamState(saving);
Stream(_regs[0], _regs[1], _regs[2], _regs[3]);
if(!saving) {
UpdateState();
}
}
void UpdateState()
{
for(int i = 0; i < 4; i++) {
SetCpuMemoryMapping(0x6000 + i * 0x800, 0x67FF + i * 0x800, _regs[i], PrgMemoryType::PrgRom);
}
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
_regs[(addr >> 11) & 0x03] = value;
UpdateState();
}
};

View File

@ -74,6 +74,7 @@
#include "Kaiser7016.h"
#include "Kaiser7017.h"
#include "Kaiser7022.h"
#include "Kaiser7031.h"
#include "Kaiser7037.h"
#include "Kaiser7057.h"
#include "Kaiser7058.h"
@ -556,6 +557,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case UnifBoards::Ks7013B: return new Kaiser7013B();
case UnifBoards::Ks7016: return new Kaiser7016();
case UnifBoards::Ks7017: return new Kaiser7017();
case UnifBoards::Ks7031: return new Kaiser7031();
case UnifBoards::Ks7037: return new Kaiser7037();
case UnifBoards::Ks7057: return new Kaiser7057();
case UnifBoards::Lh10: return new Lh10();

View File

@ -43,12 +43,13 @@ namespace UnifBoards {
Bmc8in1,
BmcF15,
Lh10,
Ks7012,
Ks7013B,
Ks7016,
Ks7017,
Ks7031,
Ks7037,
Ks7057,
Ks7017,
Ks7016,
Ks7013B,
Ks7012,
MaliSB,
Unl43272,
Bmc411120C,

View File

@ -60,7 +60,7 @@ std::unordered_map<string, int> UnifLoader::_boardMappings = std::unordered_map<
{ "KS7016", UnifBoards::Ks7016 },
{ "KS7017", UnifBoards::Ks7017 },
{ "KS7030", UnifBoards::UnknownBoard },
{ "KS7031", UnifBoards::UnknownBoard },
{ "KS7031", UnifBoards::Ks7031 },
{ "KS7032", 142 },
{ "KS7037", UnifBoards::Ks7037 },
{ "KS7057", UnifBoards::Ks7057 },