mirror of
https://github.com/libretro/Mesen.git
synced 2024-11-23 09:09:45 +00:00
Backport UNIF: Add BMC-L6IN1 board (Mapper 345)
This commit is contained in:
parent
61a4b6170e
commit
60046f9a17
62
Core/MMC3_BmcL6in1.h
Normal file
62
Core/MMC3_BmcL6in1.h
Normal file
@ -0,0 +1,62 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "MMC3.h"
|
||||
|
||||
class MMC3_BmcL6in1 : public MMC3
|
||||
{
|
||||
private:
|
||||
uint8_t _exReg;
|
||||
|
||||
protected:
|
||||
void InitMapper() override
|
||||
{
|
||||
AddRegisterRange(0x6000, 0x7FFF, MemoryOperation::Write);
|
||||
_exReg = 0;
|
||||
|
||||
MMC3::InitMapper();
|
||||
}
|
||||
|
||||
void Reset(bool softreset) override
|
||||
{
|
||||
_exReg = 0;
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
void StreamState(bool saving) override
|
||||
{
|
||||
MMC3::StreamState(saving);
|
||||
Stream(_exReg);
|
||||
}
|
||||
|
||||
void UpdateMirroring() override
|
||||
{
|
||||
if(_exReg & 0x20) {
|
||||
SetMirroringType((_exReg & 0x10) ? MirroringType::ScreenBOnly : MirroringType::ScreenAOnly);
|
||||
} else {
|
||||
MMC3::UpdateMirroring();
|
||||
}
|
||||
}
|
||||
|
||||
void SelectPRGPage(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom) override
|
||||
{
|
||||
if(_exReg & 0x0C) {
|
||||
MMC3::SelectPRGPage(slot, (page & 0x0F) | (_exReg & 0xC0) >> 2);
|
||||
} else {
|
||||
uint8_t bank = ((_exReg & 0xC0) >> 4) | (_exReg & 0x03);
|
||||
SelectPrgPage4x(0, bank << 2);
|
||||
}
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value) override
|
||||
{
|
||||
if(addr < 0x8000) {
|
||||
if(CanWriteToWorkRam()) {
|
||||
_exReg = value;
|
||||
UpdatePrgMapping();
|
||||
UpdateMirroring();
|
||||
}
|
||||
} else {
|
||||
MMC3::WriteRegister(addr, value);
|
||||
}
|
||||
}
|
||||
};
|
@ -193,6 +193,7 @@
|
||||
#include "MMC3_BmcGn26.h"
|
||||
#include "MMC3_BmcK3006.h"
|
||||
#include "MMC3_BmcK3033.h"
|
||||
#include "MMC3_BmcL6in1.h"
|
||||
#include "MMC3_ChrRam.h"
|
||||
#include "MMC3_Coolboy.h"
|
||||
#include "MMC3_Kof97.h"
|
||||
@ -622,7 +623,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
||||
case 342: break; //COOLGIRL
|
||||
//343
|
||||
case 344: return new MMC3_BmcGn26();
|
||||
case 345: break; //L6IN1
|
||||
case 345: return new MMC3_BmcL6in1();
|
||||
case 346: return new Kaiser7012();
|
||||
//347
|
||||
case 348: return new Bmc830118C();
|
||||
|
@ -180,4 +180,5 @@ std::unordered_map<string, int> UnifLoader::_boardMappings = std::unordered_map<
|
||||
{ "K-3006", 339 },
|
||||
{ "K-3033", 322 },
|
||||
{ "K-3036", 340 },
|
||||
{ "L6IN1", 345 },
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user