mirror of
https://github.com/libretro/Mesen.git
synced 2025-02-01 22:33:37 +00:00
Mapper 41 (Caltron multicart) support
This commit is contained in:
parent
0210fd92b6
commit
6d56e48c77
52
Core/Caltron41.h
Normal file
52
Core/Caltron41.h
Normal file
@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
#include "stdafx.h"
|
||||
#include "BaseMapper.h"
|
||||
|
||||
class Caltron41 : public BaseMapper
|
||||
{
|
||||
private:
|
||||
uint8_t _prgBank;
|
||||
uint8_t _chrBank;
|
||||
|
||||
protected:
|
||||
virtual uint16_t GetPRGPageSize() { return 0x8000; }
|
||||
virtual uint16_t GetCHRPageSize() { return 0x2000; }
|
||||
virtual uint16_t RegisterStartAddress() { return 0x8000; }
|
||||
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
|
||||
|
||||
void InitMapper()
|
||||
{
|
||||
AddRegisterRange(0x6000, 0x67FF, MemoryOperation::Write);
|
||||
}
|
||||
|
||||
void Reset(bool softReset)
|
||||
{
|
||||
_chrBank = 0;
|
||||
_prgBank = 0;
|
||||
WriteRegister(0x6000, 0);
|
||||
WriteRegister(0x8000, 0);
|
||||
}
|
||||
|
||||
void StreamState(bool saving)
|
||||
{
|
||||
BaseMapper::StreamState(saving);
|
||||
Stream(_prgBank, _chrBank);
|
||||
}
|
||||
|
||||
void WriteRegister(uint16_t addr, uint8_t value)
|
||||
{
|
||||
if(addr <= 0x67FF) {
|
||||
_prgBank = addr & 0x07;
|
||||
_chrBank = (_chrBank & 0x03) | ((addr >> 1) & 0x0C);
|
||||
SelectPRGPage(0, _prgBank);
|
||||
SelectCHRPage(0, _chrBank);
|
||||
SetMirroringType(addr & 0x20 ? MirroringType::Horizontal : MirroringType::Vertical);
|
||||
} else {
|
||||
//"Note that the Inner CHR Bank Select only can be written while the PRG ROM bank is 4, 5, 6, or 7"
|
||||
if(_prgBank >= 4) {
|
||||
_chrBank = (_chrBank & 0x0C) | (value & 0x03);
|
||||
SelectCHRPage(0, _chrBank);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
@ -412,6 +412,7 @@
|
||||
<ClInclude Include="BF9096.h" />
|
||||
<ClInclude Include="BF909x.h" />
|
||||
<ClInclude Include="BnRom.h" />
|
||||
<ClInclude Include="Caltron41.h" />
|
||||
<ClInclude Include="ColorDreams46.h" />
|
||||
<ClInclude Include="DaouInfosys.h" />
|
||||
<ClInclude Include="DebugState.h" />
|
||||
|
@ -766,6 +766,9 @@
|
||||
<ClInclude Include="Txc22000.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Caltron41.h">
|
||||
<Filter>Nes\Mappers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "BnRom.h"
|
||||
#include "BF909x.h"
|
||||
#include "BF9096.h"
|
||||
#include "Caltron41.h"
|
||||
#include "CNROM.h"
|
||||
#include "CpRom.h"
|
||||
#include "ColorDreams.h"
|
||||
@ -131,11 +132,11 @@
|
||||
#include "Waixing252.h"
|
||||
|
||||
/*
|
||||
Supported mappers: (... denotes bad mappers)
|
||||
Supported mappers: (... denotes bad mappers, --- denotes potentially bad mappers)
|
||||
-----------------------------------------------------------------
|
||||
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| | 15|
|
||||
| 16| 17| 18| 19|...| 21| 22| 23| 24| 25| 26| 27| 28| | | 31|
|
||||
| 32| 33| 34| | 36| 37| 38| | 40| | 42| | 44| 45| 46| 47|
|
||||
| 32| 33| 34| | 36| 37| 38|---| 40| 41| 42| | 44| 45| 46| 47|
|
||||
| 48| 49| 50| | 52| | | | 56| 57| 58| | 60| 61| 62| |
|
||||
| 64| 65| 66| 67| 68| 69| 70| 71| 72| 73| 74| 75| 76| 77| 78| 79|
|
||||
| 80| | 82| | | 85| 86| 87| 88| 89| | 91| 92| 93| 94| 95|
|
||||
@ -202,6 +203,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
|
||||
case 37: return new MMC3_37();
|
||||
case 38: return new UnlPci556();
|
||||
case 40: return new Mapper40();
|
||||
case 41: return new Caltron41();
|
||||
case 42: return new Mapper42();
|
||||
case 44: return new MMC3_44();
|
||||
case 45: return new MMC3_45();
|
||||
|
Loading…
x
Reference in New Issue
Block a user