UNIF GS-2004 board support

This commit is contained in:
Souryo 2016-11-06 13:34:22 -05:00
parent be953ab6b7
commit 8d85b69bfa
6 changed files with 35 additions and 1 deletions

View File

@ -434,6 +434,7 @@
<ClInclude Include="FrontFareast.h" />
<ClInclude Include="GameDatabase.h" />
<ClInclude Include="Bmc235.h" />
<ClInclude Include="Gs2004.h" />
<ClInclude Include="Gs2013.h" />
<ClInclude Include="HdVideoFilter.h" />
<ClInclude Include="Henggedianzi177.h" />

View File

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

26
Core/Gs2004.h Normal file
View File

@ -0,0 +1,26 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class Gs2004 : public BaseMapper
{
protected:
uint16_t GetPRGPageSize() { return 0x2000; }
uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper() override
{
SelectCHRPage(0, 0);
}
void Reset(bool softReset) override
{
SetCpuMemoryMapping(0x6000, 0x7FFF, 0x20, PrgMemoryType::PrgRom);
SelectPrgPage4x(0, 0x07 << 2);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
SelectPrgPage4x(0, (value & 0x07) << 2);
}
};

View File

@ -25,6 +25,7 @@
#include "Edu2000.h"
#include "FDS.h"
#include "FrontFareast.h"
#include "Gs2004.h"
#include "Gs2013.h"
#include "GxRom.h"
#include "Henggedianzi177.h"
@ -226,6 +227,7 @@ const uint16_t MapperFactory::UnknownBoard;
const uint16_t MapperFactory::UnifCoolboy;
const uint16_t MapperFactory::UnifDreamTech01;
const uint16_t MapperFactory::UnifEdu2000;
const uint16_t MapperFactory::UnifGs2004;
const uint16_t MapperFactory::UnifGs2013;
const uint16_t MapperFactory::UnifMalee;
const uint16_t MapperFactory::UnifStreetHeroes;
@ -460,6 +462,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case MapperFactory::UnifCoolboy: return new MMC3_Coolboy();
case MapperFactory::UnifDreamTech01: return new DreamTech01();
case MapperFactory::UnifEdu2000: return new Edu2000();
case MapperFactory::UnifGs2004: return new Gs2004();
case MapperFactory::UnifGs2013: return new Gs2013();
case MapperFactory::UnifMalee: return new Malee();
case MapperFactory::UnifSmb2j: return new Smb2j();

View File

@ -20,6 +20,7 @@ class MapperFactory
static const uint16_t UnifDreamTech01 = 65527;
static const uint16_t UnifEdu2000 = 65526;
static const uint16_t UnifGs2013 = 65525;
static const uint16_t UnifGs2004 = 65524;
static shared_ptr<BaseMapper> InitializeFromFile(string romFilename, stringstream *filestream, string ipsFilename, int32_t archiveFileIndex);
};

View File

@ -52,7 +52,7 @@ private:
{ "FS304", 162 },
{ "G-146", MapperFactory::UnknownBoard },
{ "GK-192", 58 },
{ "GS-2004", MapperFactory::UnknownBoard },
{ "GS-2004", MapperFactory::UnifGs2004 },
{ "GS-2013", MapperFactory::UnifGs2013 },
{ "Ghostbusters63in1", MapperFactory::UnknownBoard },
{ "H2288", 123 },