UNIF BMC-NTD-03 board support

This commit is contained in:
Souryo 2016-11-10 17:45:20 -05:00
parent baf74f230f
commit 55890015d0
6 changed files with 44 additions and 2 deletions

35
Core/BmcNtd03.h Normal file
View File

@ -0,0 +1,35 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class BmcNtd03 : public BaseMapper
{
protected:
uint16_t GetPRGPageSize() override { return 0x4000; }
uint16_t GetCHRPageSize() override { return 0x2000; }
void InitMapper() override
{
}
void Reset(bool softReset)
{
BaseMapper::Reset(softReset);
WriteRegister(0x8000, 0);
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
uint8_t prg = ((addr >> 10) & 0x1E);
uint8_t chr= ((addr & 0x0300) >> 5) | (addr & 0x07);
if(addr & 0x80) {
SelectPRGPage(0, prg | ((addr >> 6) & 1));
SelectPRGPage(1, prg | ((addr >> 6) & 1));
} else {
SelectPrgPage2x(0, prg & 0xFE);
}
SelectCHRPage(0, chr);
SetMirroringType(addr & 0x400 ? MirroringType::Horizontal : MirroringType::Vertical);
}
};

View File

@ -424,6 +424,7 @@
<ClInclude Include="A65AS.h" />
<ClInclude Include="Bmc70in1.h" />
<ClInclude Include="BmcG146.h" />
<ClInclude Include="BmcNtd03.h" />
<ClInclude Include="BnRom.h" />
<ClInclude Include="Bs5.h" />
<ClInclude Include="Caltron41.h" />

View File

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

View File

@ -23,6 +23,7 @@
#include "Bmc235.h"
#include "Bmc255.h"
#include "BmcG146.h"
#include "BmcNtd03.h"
#include "BnRom.h"
#include "Bs5.h"
#include "Caltron41.h"
@ -477,6 +478,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case UnifBoards::Bmc70in1B: return new Bmc70in1();
case UnifBoards::Bmc190in1: return new Bmc190in1();
case UnifBoards::BmcG146: return new BmcG146();
case UnifBoards::BmdNtd03: return new BmcNtd03();
case UnifBoards::Bs5: return new Bs5();
case UnifBoards::Cc21: return new Cc21();
case UnifBoards::Coolboy: return new MMC3_Coolboy();

View File

@ -32,6 +32,7 @@ namespace UnifBoards {
Hp898f,
Bb,
Ac08,
BmcG146
BmcG146,
BmdNtd03
};
}

View File

@ -82,7 +82,7 @@ private:
{ "NROM-128", 0 },
{ "NROM-256", 0 },
{ "NTBROM", 68 },
{ "NTD-03", UnifBoards::UnknownBoard },
{ "NTD-03", UnifBoards::BmdNtd03 },
{ "NovelDiamond9999999in1", UnifBoards::NovelDiamond },
{ "OneBus", UnifBoards::UnknownBoard },
{ "PEC-586", UnifBoards::UnknownBoard },