UNIF BMC-F-15 board support

This commit is contained in:
Souryo 2016-11-11 19:11:52 -05:00
parent 73c42f26ed
commit ce8ad8b625
6 changed files with 52 additions and 1 deletions

View File

@ -548,6 +548,7 @@
<ClInclude Include="MMC3_47.h" />
<ClInclude Include="MMC3_49.h" />
<ClInclude Include="MMC3_52.h" />
<ClInclude Include="MMC3_BmcF15.h" />
<ClInclude Include="MMC3_ChrRam.h" />
<ClInclude Include="MMC3_Coolboy.h" />
<ClInclude Include="MMC3_Kof97.h" />

View File

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

44
Core/MMC3_BmcF15.h Normal file
View File

@ -0,0 +1,44 @@
#pragma once
#include "stdafx.h"
#include "MMC3.h"
class MMC3_BmcF15 : public MMC3
{
private:
uint8_t _exReg;
protected:
void InitMapper() override
{
AddRegisterRange(0x6000, 0xFFFF, MemoryOperation::Write);
_exReg = 0;
MMC3::InitMapper();
}
void StreamState(bool saving) override
{
MMC3::StreamState(saving);
Stream(_exReg);
}
void UpdatePrgMapping() override
{
uint32_t bank = _exReg & 0x0F;
uint32_t mode = (_exReg & 0x08) >> 3;
uint32_t mask = ~mode;
SelectPrgPage2x(0, (bank & mask) << 1);
SelectPrgPage2x(1, ((bank & mask) | mode) << 1);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
if(addr < 0x8000) {
if(GetState().RegA001 & 0x80) {
_exReg = value & 0x0F;
UpdatePrgMapping();
}
} else {
MMC3::WriteRegister(addr, value);
}
}
};

View File

@ -148,6 +148,7 @@
#include "MMC3_249.h"
#include "MMC3_250.h"
#include "MMC3_254.h"
#include "MMC3_BmcF15.h"
#include "MMC3_ChrRam.h"
#include "MMC3_Coolboy.h"
#include "MMC3_Kof97.h"
@ -485,6 +486,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case UnifBoards::Bmc70in1B: return new Bmc70in1();
case UnifBoards::Bmc190in1: return new Bmc190in1();
case UnifBoards::Bmc810544CA1: return new Bmc810544CA1();
case UnifBoards::BmcF15: return new MMC3_BmcF15();
case UnifBoards::BmcG146: return new BmcG146();
case UnifBoards::BmdNtd03: return new BmcNtd03();
case UnifBoards::Bs5: return new Bs5();

View File

@ -38,5 +38,6 @@ namespace UnifBoards {
Bmc12in1,
Bmc64in1NoRepeat,
Bmc810544CA1,
BmcF15,
};
}

View File

@ -155,7 +155,7 @@ private:
{ "DRAGONFIGHTER", UnifBoards::UnknownBoard },
{ "EH8813A", UnifBoards::UnknownBoard },
{ "HP898F", UnifBoards::Hp898f },
{ "F-15", UnifBoards::UnknownBoard },
{ "F-15", UnifBoards::BmcF15 },
{ "RT-01", UnifBoards::Rt01 },
{ "81-01-31-C", UnifBoards::UnknownBoard },
{ "8-IN-1", UnifBoards::UnknownBoard },