Mapper 104 support (GoldenFive)

This commit is contained in:
Souryo 2017-04-12 21:40:30 -04:00
parent 7b5ed2a46d
commit bfa68554b0
4 changed files with 46 additions and 1 deletions

View File

@ -443,6 +443,7 @@
<ClInclude Include="CodeRunner.h" />
<ClInclude Include="ColorDreams46.h" />
<ClInclude Include="CrossFeedFilter.h" />
<ClInclude Include="GoldenFive.h" />
<ClInclude Include="UnlD1038.h" />
<ClInclude Include="DaouInfosys.h" />
<ClInclude Include="DebugBreakHelper.h" />

View File

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

39
Core/GoldenFive.h Normal file
View File

@ -0,0 +1,39 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class GoldenFive : public BaseMapper
{
private:
uint8_t _prgReg;
protected:
uint16_t GetPRGPageSize() override { return 0x4000; }
uint16_t GetCHRPageSize() override { return 0x2000; }
void InitMapper() override
{
_prgReg = 0;
SelectPRGPage(1, 0x0F);
}
void StreamState(bool saving) override
{
BaseMapper::StreamState(saving);
Stream(_prgReg);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
if(addr >= 0xC000) {
_prgReg = (_prgReg & 0xF0) | (value & 0x0F);
SelectPRGPage(0, _prgReg);
} else if(addr <= 0x9FFF) {
if(value & 0x08) {
_prgReg = (_prgReg & 0x0F) | ((value << 4) & 0x70);
SelectPRGPage(0, _prgReg);
SelectPRGPage(1, ((value << 4) & 0x70) | 0x0F);
}
}
}
};

View File

@ -43,6 +43,7 @@
#include "FDS.h"
#include "FrontFareast.h"
#include "Ghostbusters63in1.h"
#include "GoldenFive.h"
#include "Gs2004.h"
#include "Gs2013.h"
#include "GxRom.h"
@ -250,7 +251,7 @@ Supported mappers:
| 48| 49| 50| 51| 52| 53| 54|???| 56| 57| 58|===| 60| 61| 62| 63|
| 64| 65| 66| 67| 68| 69| 70| 71| 72| 73| 74| 75| 76| 77| 78| 79|
| 80|===| 82| 83|===| 85| 86| 87| 88| 89| 90| 91| 92| 93| 94| 95|
| 96| 97|===| 99|...|101|===|103|???|105|106|107|108|===|===|===|
| 96| 97|===| 99|...|101|===|103|104|105|106|107|108|===|===|===|
|112|113|114|115| |117|118|119|120|121|===|123|===|125|126|===|
|===|===|===|===|132|133|134|===|136|137|138|139|140|141|142|143|
|144|145|146|147|148|149|150|151|152|153|154|155|156|157|???|159|
@ -368,6 +369,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 99: return new VsSystem();
case 101: return new JalecoJfxx(true);
case 103: return new Mapper103();
case 104: return new GoldenFive();
case 105: return new MMC1_105(); break;
case 106: return new Mapper106();
case 107: return new Mapper107();