UNIF: Added support for UNL-8237A boards
This commit is contained in:
parent
e18fab0557
commit
66dae9189d
7 changed files with 64 additions and 4 deletions
|
@ -624,6 +624,7 @@
|
|||
<ClInclude Include="SuborMouse.h" />
|
||||
<ClInclude Include="T230.h" />
|
||||
<ClInclude Include="Unl158B.h" />
|
||||
<ClInclude Include="Unl8237A.h" />
|
||||
<ClInclude Include="UnlD1038.h" />
|
||||
<ClInclude Include="DaouInfosys.h" />
|
||||
<ClInclude Include="DebugBreakHelper.h" />
|
||||
|
|
|
@ -1420,6 +1420,9 @@
|
|||
<ClInclude Include="T230.h">
|
||||
<Filter>Nes\Mappers\Unif</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Unl8237A.h">
|
||||
<Filter>Nes\Mappers\Unif</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
#include "stdafx.h"
|
||||
#include "MMC3.h"
|
||||
|
||||
//Unif: UNL-8237
|
||||
class MMC3_215 : public MMC3
|
||||
{
|
||||
private:
|
||||
protected:
|
||||
const uint8_t _lutReg[8][8] = {
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7 },
|
||||
{ 0, 2, 6, 1, 7, 3, 4, 5 },
|
||||
|
@ -30,7 +31,6 @@ private:
|
|||
|
||||
uint8_t _exRegs[3];
|
||||
|
||||
protected:
|
||||
uint16_t RegisterStartAddress() override { return 0x5000; }
|
||||
uint16_t RegisterEndAddress() override { return 0xFFFF; }
|
||||
|
||||
|
|
|
@ -239,6 +239,7 @@
|
|||
#include "Unl158B.h"
|
||||
#include "Unl255in1.h"
|
||||
#include "Unl43272.h"
|
||||
#include "Unl8237A.h"
|
||||
#include "UnlD1038.h"
|
||||
#include "UnlPci556.h"
|
||||
#include "UnlPuzzle.h"
|
||||
|
@ -583,6 +584,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
|||
case UnifBoards::Unl158B: return new Unl158B();
|
||||
case UnifBoards::Unl255in1: return new Unl255in1();
|
||||
case UnifBoards::Unl43272: return new Unl43272();
|
||||
case UnifBoards::Unl8237A: return new Unl8237A();
|
||||
case UnifBoards::UnlD1038: return new UnlD1038();
|
||||
case UnifBoards::UnlPuzzle: return new UnlPuzzle();
|
||||
case UnifBoards::UnlVrc7: return new UnlVrc7();
|
||||
|
|
|
@ -65,6 +65,7 @@ namespace UnifBoards {
|
|||
Dance2000,
|
||||
CityFighter,
|
||||
UnlVrc7,
|
||||
Yoko
|
||||
Yoko,
|
||||
Unl8237A
|
||||
};
|
||||
}
|
|
@ -19,7 +19,7 @@ std::unordered_map<string, int> UnifLoader::_boardMappings = std::unordered_map<
|
|||
{ "810544-C-A1", UnifBoards::Bmc810544CA1 },
|
||||
{ "8157", UnifBoards::Bmc8157 },
|
||||
{ "8237", 215 },
|
||||
{ "8237A", UnifBoards::UnknownBoard },
|
||||
{ "8237A", UnifBoards::Unl8237A },
|
||||
{ "830118C", UnifBoards::Bmc830118C },
|
||||
{ "A65AS", UnifBoards::A65AS },
|
||||
{ "AC08", UnifBoards::Ac08 },
|
||||
|
|
53
Core/Unl8237A.h
Normal file
53
Core/Unl8237A.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "MMC3_215.h"
|
||||
|
||||
class Unl8237A : public MMC3_215
|
||||
{
|
||||
void SelectCHRPage(uint16_t slot, uint16_t page, ChrMemoryType memoryType) override
|
||||
{
|
||||
if(_exRegs[0] & 0x40) {
|
||||
MMC3::SelectCHRPage(slot, ((_exRegs[1] & 0x0E) << 7) | (page & 0x7F) | ((_exRegs[1] & 0x20) << 2), memoryType);
|
||||
} else {
|
||||
MMC3::SelectCHRPage(slot, ((_exRegs[1] & 0x0E) << 7) | page, memoryType);
|
||||
}
|
||||
}
|
||||
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
|
||||
{
|
||||
uint8_t sbank = 0;
|
||||
uint8_t bank = 0;
|
||||
uint8_t mask = 0;
|
||||
|
||||
if(_exRegs[0] & 0x40) {
|
||||
mask = 0x0F;
|
||||
sbank = (_exRegs[1] & 0x10);
|
||||
if(_exRegs[0] & 0x80) {
|
||||
bank = ((_exRegs[1] & 0x03) << 4) | ((_exRegs[1] & 0x08) << 3) | (_exRegs[0] & 0x07) | (sbank >> 1);
|
||||
}
|
||||
} else {
|
||||
mask = 0x1F;
|
||||
if(_exRegs[0] & 0x80) {
|
||||
bank = ((_exRegs[1] & 0x03) << 4) | ((_exRegs[1] & 0x08) << 3) | (_exRegs[0] & 0x0F);
|
||||
}
|
||||
}
|
||||
|
||||
if(_exRegs[0] & 0x80) {
|
||||
bank <<= 1;
|
||||
if(_exRegs[0] & 0x20) {
|
||||
bank &= 0xFC;
|
||||
MMC3::SelectPRGPage(0, bank);
|
||||
MMC3::SelectPRGPage(1, bank + 1);
|
||||
MMC3::SelectPRGPage(2, bank + 2);
|
||||
MMC3::SelectPRGPage(3, bank + 3);
|
||||
} else {
|
||||
MMC3::SelectPRGPage(0, bank);
|
||||
MMC3::SelectPRGPage(1, bank + 1);
|
||||
MMC3::SelectPRGPage(2, bank);
|
||||
MMC3::SelectPRGPage(3, bank + 1);
|
||||
}
|
||||
} else {
|
||||
MMC3::SelectPRGPage(slot, ((_exRegs[1] & 0x03) << 5) | ((_exRegs[1] & 0x08) << 4) | (page & mask) | sbank);
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue