Added support for GN-45 boards
This commit is contained in:
parent
b7bd2add69
commit
5e6578a4a0
8 changed files with 80 additions and 6 deletions
64
Core/BmcGn45.h
Normal file
64
Core/BmcGn45.h
Normal file
|
@ -0,0 +1,64 @@
|
|||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "MMC3.h"
|
||||
|
||||
class BmcGn45 : public MMC3
|
||||
{
|
||||
private:
|
||||
uint8_t _selectedBlock = 0;
|
||||
bool _wramEnabled = false;
|
||||
|
||||
protected:
|
||||
uint16_t RegisterStartAddress() override { return 0x6000; }
|
||||
uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_selectedBlock, _wramEnabled);
|
||||
}
|
||||
|
||||
void Reset(bool softReset) override
|
||||
{
|
||||
MMC3::Reset(softReset);
|
||||
|
||||
if(softReset) {
|
||||
_selectedBlock = 0;
|
||||
_wramEnabled = false;
|
||||
ResetMmc3();
|
||||
UpdateState();
|
||||
}
|
||||
}
|
||||
|
||||
void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType = ChrMemoryType::Default) override
|
||||
{
|
||||
MMC3::SelectCHRPage(slot, (page & 0x7F) | (_selectedBlock << 3), memoryType);
|
||||
}
|
||||
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
|
||||
{
|
||||
MMC3::SelectPRGPage(slot, (page & 0x0F) | _selectedBlock, memoryType);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x7000) {
|
||||
if(!_wramEnabled) {
|
||||
_selectedBlock = addr & 0x30;
|
||||
_wramEnabled = (addr & 0x80) != 0;
|
||||
UpdateState();
|
||||
} else {
|
||||
WritePrgRam(addr, value);
|
||||
}
|
||||
} else if(addr < 0x8000) {
|
||||
if(!_wramEnabled) {
|
||||
_selectedBlock = value & 0x30;
|
||||
UpdateState();
|
||||
} else {
|
||||
WritePrgRam(addr, value);
|
||||
}
|
||||
} else {
|
||||
MMC3::WriteRegister(addr, value);
|
||||
}
|
||||
}
|
||||
};
|
|
@ -522,6 +522,7 @@
|
|||
<ClInclude Include="Bmc8157.h" />
|
||||
<ClInclude Include="Bmc830118C.h" />
|
||||
<ClInclude Include="Bmc8in1.h" />
|
||||
<ClInclude Include="BmcGn45.h" />
|
||||
<ClInclude Include="BmcHpxx.h" />
|
||||
<ClInclude Include="CityFighter.h" />
|
||||
<ClInclude Include="ControlDeviceState.h" />
|
||||
|
|
|
@ -1429,6 +1429,9 @@
|
|||
<ClInclude Include="DragonFighter.h">
|
||||
<Filter>Nes\Mappers\Unif</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BmcGn45.h">
|
||||
<Filter>Nes\Mappers\Unif</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "Bmc830118C.h"
|
||||
#include "Bmc8in1.h"
|
||||
#include "BmcG146.h"
|
||||
#include "BmcGn45.h"
|
||||
#include "BmcNtd03.h"
|
||||
#include "BnRom.h"
|
||||
#include "Bs5.h"
|
||||
|
@ -547,6 +548,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
|||
case UnifBoards::Bmc8in1: return new Bmc8in1();
|
||||
case UnifBoards::BmcF15: return new MMC3_BmcF15();
|
||||
case UnifBoards::BmcG146: return new BmcG146();
|
||||
case UnifBoards::BmcGn45: return new BmcGn45();
|
||||
case UnifBoards::BmcHpxx: return new BmcHpxx();
|
||||
case UnifBoards::BmcNtd03: return new BmcNtd03();
|
||||
case UnifBoards::Bs5: return new Bs5();
|
||||
|
|
|
@ -69,5 +69,6 @@ namespace UnifBoards {
|
|||
Unl8237A,
|
||||
BmcHpxx,
|
||||
DragonFighter,
|
||||
BmcGn45,
|
||||
};
|
||||
}
|
|
@ -159,4 +159,5 @@ std::unordered_map<string, int> UnifLoader::_boardMappings = std::unordered_map<
|
|||
{ "WAIXING-FW01", 227 },
|
||||
{ "WAIXING-FS005", UnifBoards::UnknownBoard },
|
||||
{ "HPxx", UnifBoards::BmcHpxx },
|
||||
{ "GN-45", UnifBoards::BmcGn45 }, //Doesn't actually exist as a UNIF file (used to assign a mapper to GN-45 boards)
|
||||
};
|
|
@ -4,7 +4,7 @@
|
|||
#
|
||||
# Automatically generated database based on Nestopia's DB and NesCartDB
|
||||
#
|
||||
# Generated on 2018-04-16 using:
|
||||
# Generated on 2018-06-22 using:
|
||||
# -NesCartDB (dated 2017-08-21)
|
||||
# -Nestopia UE's latest DB (dated 2015-10-22)
|
||||
#
|
||||
|
@ -4893,7 +4893,7 @@
|
|||
5033AF84,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,
|
||||
5034B399,NesNtsc,UNK,,,0,16,8,,0,0,0,h,,,
|
||||
5034F443,NesNtsc,UNK,,,2,128,,,0,0,0,v,,,
|
||||
503566B2,NesNtsc,UNK,,,205,512,512,,0,0,0,h,,,
|
||||
503566B2,NesNtsc,BMC-GN-45,,,65000,512,512,,0,0,0,h,,,
|
||||
503D9FA7,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,
|
||||
5047CDB4,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,
|
||||
504BDFB8,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,
|
||||
|
@ -5514,6 +5514,7 @@
|
|||
5A9664D0,Famicom,,,,4,128,256,,0,0,0,,,,
|
||||
5A9D96D3,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,
|
||||
5A9EA721,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,
|
||||
5AA23A15,NesNtsc,BMC-GN-45,,,65000,512,512,,0,0,0,h,,,
|
||||
5AAA3239,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,
|
||||
5AAC2B09,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,
|
||||
5AAFFF2A,NesNtsc,UNK,,,4,128,160,,0,0,0,h,,,
|
||||
|
@ -14977,7 +14978,7 @@ F6AB12A2,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,
|
|||
F6AF241B,NesNtsc,UNK,,,4,256,256,,0,8,1,h,,,
|
||||
F6B68541,NesNtsc,UNK,,,3,32,32,,0,0,0,v,,,
|
||||
F6B9799C,NesNtsc,NES-SNROM,NES-SNROM-05,MMC1B2,1,256,,8,0,8,1,,,,
|
||||
F6B9D088,NesNtsc,UNK,,,205,512,512,,0,0,0,h,,,
|
||||
F6B9D088,NesNtsc,BMC-GN-45,,,65000,512,512,,0,0,0,h,,,
|
||||
F6BB3AC2,NesNtsc,UNK,,,4,128,128,,0,0,0,v,,,
|
||||
F6BCA10F,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,
|
||||
F6BD8E31,NesNtsc,UNK,,,90,512,512,,0,0,0,h,,,
|
||||
|
|
|
@ -4880,7 +4880,7 @@
|
|||
"5033AF84,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,",
|
||||
"5034B399,NesNtsc,UNK,,,0,16,8,,0,0,0,h,,,",
|
||||
"5034F443,NesNtsc,UNK,,,2,128,,,0,0,0,v,,,",
|
||||
"503566B2,NesNtsc,UNK,,,205,512,512,,0,0,0,h,,,",
|
||||
"503566B2,NesNtsc,BMC-GN-45,,,65000,512,512,,0,0,0,h,,,",
|
||||
"503D9FA7,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,",
|
||||
"5047CDB4,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,",
|
||||
"504BDFB8,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,",
|
||||
|
@ -5501,6 +5501,7 @@
|
|||
"5A9664D0,Famicom,,,,4,128,256,,0,0,0,,,,",
|
||||
"5A9D96D3,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,",
|
||||
"5A9EA721,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,",
|
||||
"5AA23A15,NesNtsc,BMC-GN-45,,,65000,512,512,,0,0,0,h,,,",
|
||||
"5AAA3239,NesNtsc,UNK,,,1,128,128,,0,0,0,h,,,",
|
||||
"5AAC2B09,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,",
|
||||
"5AAFFF2A,NesNtsc,UNK,,,4,128,160,,0,0,0,h,,,",
|
||||
|
@ -14964,7 +14965,7 @@
|
|||
"F6AF241B,NesNtsc,UNK,,,4,256,256,,0,8,1,h,,,",
|
||||
"F6B68541,NesNtsc,UNK,,,3,32,32,,0,0,0,v,,,",
|
||||
"F6B9799C,NesNtsc,NES-SNROM,NES-SNROM-05,MMC1B2,1,256,,8,0,8,1,,,,",
|
||||
"F6B9D088,NesNtsc,UNK,,,205,512,512,,0,0,0,h,,,",
|
||||
"F6B9D088,NesNtsc,BMC-GN-45,,,65000,512,512,,0,0,0,h,,,",
|
||||
"F6BB3AC2,NesNtsc,UNK,,,4,128,128,,0,0,0,v,,,",
|
||||
"F6BCA10F,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,",
|
||||
"F6BD8E31,NesNtsc,UNK,,,90,512,512,,0,0,0,h,,,",
|
||||
|
|
Loading…
Add table
Reference in a new issue