Mapper 46 (ColorDreams multicart) support

This commit is contained in:
Souryo 2016-07-16 22:27:55 -04:00
parent 0f3921f346
commit 9a45c642f1
4 changed files with 50 additions and 1 deletions

43
Core/ColorDreams46.h Normal file
View File

@ -0,0 +1,43 @@
#pragma once
#include "stdafx.h"
#include "BaseMapper.h"
class ColorDreams46 : public BaseMapper
{
private:
uint8_t _regs[2];
protected:
virtual uint16_t RegisterStartAddress() { return 0x6000; }
virtual uint16_t RegisterEndAddress() { return 0xFFFF; }
virtual uint16_t GetPRGPageSize() { return 0x8000; }
virtual uint16_t GetCHRPageSize() { return 0x2000; }
void InitMapper()
{
WriteRegister(0x6000, 0);
WriteRegister(0x8000, 0);
}
virtual void Reset(bool softReset)
{
WriteRegister(0x6000, 0);
WriteRegister(0x8000, 0);
}
void UpdateState()
{
SelectPRGPage(0, ((_regs[0] & 0x0F) << 1) | (_regs[1] & 0x01));
SelectCHRPage(0, ((_regs[0] & 0xF0) >> 1) | ((_regs[1] & 0x70) >> 4));
}
void WriteRegister(uint16_t addr, uint8_t value)
{
if(addr < 0x8000) {
_regs[0] = value;
} else {
_regs[1] = value;
}
UpdateState();
}
};

View File

@ -411,6 +411,7 @@
<ClInclude Include="BF9096.h" />
<ClInclude Include="BF909x.h" />
<ClInclude Include="BnRom.h" />
<ClInclude Include="ColorDreams46.h" />
<ClInclude Include="DaouInfosys.h" />
<ClInclude Include="DebugState.h" />
<ClInclude Include="DefaultVideoFilter.h" />

View File

@ -706,6 +706,9 @@
<ClInclude Include="Mapper42.h">
<Filter>Nes\Mappers\Unnamed</Filter>
</ClInclude>
<ClInclude Include="ColorDreams46.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

View File

@ -12,6 +12,7 @@
#include "CNROM.h"
#include "CpRom.h"
#include "ColorDreams.h"
#include "ColorDreams46.h"
#include "DaouInfosys.h"
#include "FDS.h"
#include "FrontFareast.h"
@ -119,7 +120,7 @@ Supported mappers: (... denotes 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| | | | 31|
| 32| 33| 34| | | 37| 38| | 40| | 42| | 44| 45| | 47|
| 32| 33| 34| | | 37| 38| | 40| | 42| | 44| 45| 46| 47|
| | 49| 50| | 52| | | | | 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|
@ -187,6 +188,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 42: return new Mapper42();
case 44: return new MMC3_44();
case 45: return new MMC3_45();
case 46: return new ColorDreams46();
case 47: return new MMC3_47();
case 49: return new MMC3_49();
case 50: return new Mapper50();