Mapper 182 support

This commit is contained in:
Souryo 2016-07-17 09:58:51 -04:00
parent 696c344bdc
commit b7d4e21e20
4 changed files with 46 additions and 1 deletions

View File

@ -449,6 +449,7 @@
<ClInclude Include="Mapper50.h" />
<ClInclude Include="Mapper60.h" />
<ClInclude Include="MMC1_155.h" />
<ClInclude Include="MMC3_182.h" />
<ClInclude Include="MMC3_45.h" />
<ClInclude Include="Mapper57.h" />
<ClInclude Include="Mapper61.h" />

View File

@ -718,6 +718,9 @@
<ClInclude Include="Waixing164.h">
<Filter>Nes\Mappers\Waixing</Filter>
</ClInclude>
<ClInclude Include="MMC3_182.h">
<Filter>Nes\Mappers\MMC</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

39
Core/MMC3_182.h Normal file
View File

@ -0,0 +1,39 @@
#pragma once
#include "stdafx.h"
#include "MMC3.h"
class MMC3_182 : public MMC3
{
protected:
virtual void WriteRegister(uint16_t addr, uint8_t value)
{
switch(addr & 0xE001) {
case 0x8001: MMC3::WriteRegister(0xA000, value); break;
case 0xA000: {
uint8_t data = (value & 0xF8);
switch(value & 0x07) {
case 0: data |= 0; break;
case 1: data |= 3; break;
case 2: data |= 1; break;
case 3: data |= 5; break;
case 4: data |= 6; break;
case 5: data |= 7; break;
case 6: data |= 2; break;
case 7: data |= 4; break;
}
MMC3::WriteRegister(0x8000, data);
break;
}
case 0xC000: MMC3::WriteRegister(0x8001, value); break;
case 0xC001:
MMC3::WriteRegister(0xC000, value);
MMC3::WriteRegister(0xC001, value);
break;
case 0xE000: MMC3::WriteRegister(0xE000, value);
case 0xE001: MMC3::WriteRegister(0xE001, value);
}
}
};

View File

@ -65,6 +65,7 @@
#include "MMC3_49.h"
#include "MMC3_52.h"
#include "MMC3_115.h"
#include "MMC3_182.h"
#include "MMC3_189.h"
#include "MMC3_205.h"
#include "MMC3_ChrRam.h"
@ -131,7 +132,7 @@ Supported mappers: (... denotes bad mappers)
| | | | | | | | | |137|138|139|140|141| |143|
|144|145|146|147|148|149|150|151|152|153|154|155|156|157| |159|
| | | |163|164| | | | | | | | | | | |
|176| | | |180| | | |184|185| | | |189| |191|
|176| | | |180| |182| |184|185| | | |189| |191|
|192|193|194|195| | | | |200|201|202|203| |205|206|207|
| | |210| | | | | | | |218| | | | | |
| |225|226|227|228| |230|231|232| | | | | | | |
@ -265,6 +266,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 164: return new Waixing164();
case 176: return new Waixing176();
case 180: return new UnRom_180();
case 182: return new MMC3_182();
case 184: return new Sunsoft184();
case 185: return new CNROM(true);
case 189: return new MMC3_189();