mirror of
https://github.com/libretro/Mesen.git
synced 2025-03-03 22:07:10 +00:00
UNIF KS7037 board support
This commit is contained in:
parent
17bd157b56
commit
e3dfa2766b
@ -466,6 +466,7 @@
|
||||
<ClInclude Include="JyCompany.h" />
|
||||
<ClInclude Include="Kaiser202.h" />
|
||||
<ClInclude Include="Kaiser7022.h" />
|
||||
<ClInclude Include="Kaiser7037.h" />
|
||||
<ClInclude Include="Kaiser7058.h" />
|
||||
<ClInclude Include="Kaiser7016.h" />
|
||||
<ClInclude Include="Lh10.h" />
|
||||
|
@ -1063,6 +1063,9 @@
|
||||
<ClInclude Include="Lh10.h">
|
||||
<Filter>Nes\Mappers\Unif</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Kaiser7037.h">
|
||||
<Filter>Nes\Mappers\Unif</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
57
Core/Kaiser7037.h
Normal file
57
Core/Kaiser7037.h
Normal file
@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "BaseMapper.h"
|
||||
|
||||
class Kaiser7037 : public BaseMapper
|
||||
{
|
||||
private:
|
||||
uint8_t _currentRegister;
|
||||
uint8_t _regs[8];
|
||||
|
||||
protected:
|
||||
uint32_t GetWorkRamPageSize() { return 0x1000; }
|
||||
uint16_t GetPRGPageSize() { return 0x1000; }
|
||||
uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
|
||||
void InitMapper() override
|
||||
{
|
||||
memset(_regs, 0, sizeof(_regs));
|
||||
_currentRegister = 0;
|
||||
|
||||
SelectCHRPage(0, 0);
|
||||
RemoveRegisterRange(0xA000, 0xBFFF);
|
||||
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
ArrayInfo<uint8_t> regs{ _regs, 8 };
|
||||
Stream(_currentRegister, regs);
|
||||
|
||||
if(!saving) {
|
||||
UpdateState();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateState()
|
||||
{
|
||||
SetCpuMemoryMapping(0x6000, 0x6FFF, 0, PrgMemoryType::WorkRam);
|
||||
SetCpuMemoryMapping(0x7000, 0x7FFF, 15, PrgMemoryType::PrgRom);
|
||||
SelectPrgPage2x(0, _regs[6] << 1);
|
||||
SelectPRGPage(2, -4);
|
||||
SelectPRGPage(3, 1, PrgMemoryType::WorkRam);
|
||||
SelectPrgPage2x(2, _regs[7] << 1);
|
||||
SelectPrgPage2x(3, -2);
|
||||
SetNametables(_regs[2] & 1, _regs[4] & 1, _regs[3] & 1, _regs[5] & 1);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
switch(addr & 0xE001) {
|
||||
case 0x8000: _currentRegister = value & 0x07; break;
|
||||
case 0x8001: _regs[_currentRegister] = value; UpdateState(); break;
|
||||
}
|
||||
}
|
||||
};
|
@ -63,6 +63,7 @@
|
||||
#include "Kaiser7016.h"
|
||||
#include "Kaiser7022.h"
|
||||
#include "Kaiser7058.h"
|
||||
#include "Kaiser7037.h"
|
||||
#include "Lh10.h"
|
||||
#include "Malee.h"
|
||||
#include "Mapper15.h"
|
||||
@ -501,6 +502,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
||||
case UnifBoards::Hp898f: return new Hp898f();
|
||||
case UnifBoards::Kof97: return new MMC3_Kof97();
|
||||
case UnifBoards::Ks7016: return new Kaiser7016();
|
||||
case UnifBoards::Ks7037: return new Kaiser7037();
|
||||
case UnifBoards::Lh10: return new Lh10();
|
||||
case UnifBoards::Malee: return new Malee();
|
||||
case UnifBoards::NovelDiamond: return new NovelDiamond();
|
||||
|
@ -40,5 +40,6 @@ namespace UnifBoards {
|
||||
Bmc810544CA1,
|
||||
BmcF15,
|
||||
Lh10,
|
||||
Ks7037,
|
||||
};
|
||||
}
|
@ -68,7 +68,7 @@ private:
|
||||
{ "KS7030", UnifBoards::UnknownBoard },
|
||||
{ "KS7031", UnifBoards::UnknownBoard },
|
||||
{ "KS7032", 142 },
|
||||
{ "KS7037", UnifBoards::UnknownBoard },
|
||||
{ "KS7037", UnifBoards::Ks7037 },
|
||||
{ "KS7057", UnifBoards::UnknownBoard },
|
||||
{ "LE05", UnifBoards::UnknownBoard },
|
||||
{ "LH10", UnifBoards::Lh10 },
|
||||
|
Loading…
x
Reference in New Issue
Block a user