UNIF KS7016 board support

This commit is contained in:
Souryo 2016-11-09 20:03:49 -05:00
parent 35338bd51a
commit 93f95be65c
6 changed files with 74 additions and 1 deletions

View File

@ -458,6 +458,7 @@
<ClInclude Include="Kaiser202.h" />
<ClInclude Include="Kaiser7022.h" />
<ClInclude Include="Kaiser7058.h" />
<ClInclude Include="Kaiser7016.h" />
<ClInclude Include="Malee.h" />
<ClInclude Include="Mapper103.h" />
<ClInclude Include="Mapper106.h" />

View File

@ -1021,6 +1021,9 @@
<ClInclude Include="Mapper43.h">
<Filter>Nes\Mappers\Unnamed</Filter>
</ClInclude>
<ClInclude Include="Kaiser7016.h">
<Filter>Nes\Mappers\Unif</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

65
Core/Kaiser7016.h Normal file
View File

@ -0,0 +1,65 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Kaiser7016 : public BaseMapper
{
uint8_t _prgReg;
protected:
uint16_t GetPRGPageSize() { return 0x2000; }
uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper() override
{
_prgReg = 8;
SelectPRGPage(0, 0x0C);
SelectPRGPage(1, 0x0D);
SelectPRGPage(2, 0x0E);
SelectPRGPage(3, 0x0F);
SelectCHRPage(0, 0 );
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
{
bool mode = (addr & 0x30) == 0x30;
switch(addr & 0xD943) {
case 0xD943: {
if(mode) {
_prgReg = 0x0B;
} else {
_prgReg = (addr >> 2) & 0x0F;
}
UpdateState();
break;
}
case 0xD903: {
if(mode) {
_prgReg = 0x08 | ((addr >> 2) & 0x03);
} else {
_prgReg = 0x0B;
}
UpdateState();
break;
}
}
}
};

View File

@ -49,6 +49,7 @@
#include "JalecoSs88006.h"
#include "JyCompany.h"
#include "Kaiser202.h"
#include "Kaiser7016.h"
#include "Kaiser7022.h"
#include "Kaiser7058.h"
#include "Malee.h"
@ -251,6 +252,7 @@ const uint16_t MapperFactory::UnifGhostbusters63in1;
const uint16_t MapperFactory::UnifGs2004;
const uint16_t MapperFactory::UnifGs2013;
const uint16_t MapperFactory::UnifKof97;
const uint16_t MapperFactory::UnifKs7016;
const uint16_t MapperFactory::UnifMalee;
const uint16_t MapperFactory::UnifNovelDiamond;
const uint16_t MapperFactory::UnifStreetHeroes;
@ -501,6 +503,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case MapperFactory::UnifGs2004: return new Gs2004();
case MapperFactory::UnifGs2013: return new Gs2013();
case MapperFactory::UnifKof97: return new MMC3_Kof97();
case MapperFactory::UnifKs7016: return new Kaiser7016();
case MapperFactory::UnifMalee: return new Malee();
case MapperFactory::UnifNovelDiamond: return new NovelDiamond();
case MapperFactory::UnifSmb2j: return new Smb2j();

View File

@ -34,6 +34,7 @@ class MapperFactory
static const uint16_t UnifSuper24in1Sc03 = 65513;
static const uint16_t UnifSuper40in1Ws = 65512;
static const uint16_t UnifCc21 = 65511;
static const uint16_t UnifKs7016 = 65510;
static shared_ptr<BaseMapper> InitializeFromFile(string romFilename, stringstream *filestream, string ipsFilename, int32_t archiveFileIndex);
};

View File

@ -62,7 +62,7 @@ private:
{ "KS7010", MapperFactory::UnknownBoard },
{ "KS7012", MapperFactory::UnknownBoard },
{ "KS7013B", MapperFactory::UnknownBoard },
{ "KS7016", MapperFactory::UnknownBoard },
{ "KS7016", MapperFactory::UnifKs7016 },
{ "KS7017", MapperFactory::UnknownBoard },
{ "KS7030", MapperFactory::UnknownBoard },
{ "KS7031", MapperFactory::UnknownBoard },