Mapper 196 support

This commit is contained in:
Souryo 2016-08-26 19:09:34 -04:00
parent fe53dbd35c
commit e2faa48a8f
4 changed files with 56 additions and 2 deletions

View File

@ -475,6 +475,7 @@
<ClInclude Include="Mapper234.h" />
<ClInclude Include="Mapper183.h" />
<ClInclude Include="Mapper253.h" />
<ClInclude Include="MMC3_196.h" />
<ClInclude Include="MMC3_238.h" />
<ClInclude Include="Mapper241.h" />
<ClInclude Include="Mapper244.h" />

View File

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

48
Core/MMC3_196.h Normal file
View File

@ -0,0 +1,48 @@
#pragma once
#include "MMC3.h"
class MMC3_196 : public MMC3
{
private:
uint8_t _exRegs[2];
protected:
void InitMapper()
{
MMC3::InitMapper();
_exRegs[0] = _exRegs[1] = 0;
AddRegisterRange(0x6000, 0x6FFF, MemoryOperation::Write);
}
void StreamState(bool saving) override
{
MMC3::StreamState(saving);
Stream(_exRegs[0], _exRegs[1]);
}
void UpdatePrgMapping() override
{
if(_exRegs[0]) {
//Used by Master Fighter II (Unl) (UT1374 PCB)
SelectPrgPage4x(0, _exRegs[1] << 2);
} else {
MMC3::UpdatePrgMapping();
}
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
if(addr < 0x8000) {
_exRegs[0] = 1;
_exRegs[1] = (value & 0x0F) | (value >> 4);
UpdatePrgMapping();
} else {
if(addr >= 0xC000) {
addr = (addr & 0xFFFE) | ((addr >> 2) & 0x01) | ((addr >> 3) & 0x01);
} else {
addr = (addr & 0xFFFE) | ((addr >> 2) & 0x01) | ((addr >> 3) & 0x01) | ((addr >> 1) & 0x01);
}
MMC3::WriteRegister(addr, value);
}
}
};

View File

@ -105,6 +105,7 @@
#include "MMC3_182.h"
#include "MMC3_187.h"
#include "MMC3_189.h"
#include "MMC3_196.h"
#include "MMC3_197.h"
#include "MMC3_205.h"
#include "MMC3_238.h"
@ -194,7 +195,7 @@ Supported mappers:
|144|145|146|147|148|149|150|151|152|153|154|155|156|157| |159|
|---|===|162|163|164|165|166|167|168|===|170|171|172|173|===|175|
|176|177|178|179|180|---|182|183|184|185|186|187|188|189|===|191|
|192|193|194|195| |197| | |200|201|202|203|204|205|206|207|
|192|193|194|195|196|197| | |200|201|202|203|204|205|206|207|
| |209|210|211|212|213|214| | | |218| | |221|222| |
| |225|226|227|228|229|230|231|232|233|234|235| |===|238|===|
|240|241|242|243|244|245|246|===|===|249|250|===|252|253|254|255|
@ -376,7 +377,8 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 193: return new NtdecTc112();
case 194: return new MMC3_ChrRam(0x00, 0x01, 2);
case 195: return new MMC3_ChrRam(0x00, 0x03, 4);
case 197: return new MMC3_197();
case 196: return new MMC3_196();
case 197: return new MMC3_197();
case 200: return new Mapper200();
case 201: return new Mapper201();
case 202: return new Mapper202();