Added support for mapper 224

This commit is contained in:
Sour 2018-06-24 12:27:58 -04:00
parent cef7fa9eaa
commit ebf4e1f0c0
6 changed files with 71 additions and 2 deletions

View File

@ -541,6 +541,7 @@
<ClInclude Include="Mapper116.h" />
<ClInclude Include="MMC3_198.h" />
<ClInclude Include="MMC3_208.h" />
<ClInclude Include="MMC3_224.h" />
<ClInclude Include="MovieRecorder.h" />
<ClInclude Include="AsciiTurboFile.h" />
<ClInclude Include="RawVideoFilter.h" />

View File

@ -1438,6 +1438,9 @@
<ClInclude Include="UnlDripGameAudio.h">
<Filter>Nes\Mappers\Unif</Filter>
</ClInclude>
<ClInclude Include="MMC3_224.h">
<Filter>Nes\Mappers\MMC</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

55
Core/MMC3_224.h Normal file
View File

@ -0,0 +1,55 @@
#pragma once
#include "stdafx.h"
#include "MMC3.h"
//iNES Mapper 224 is used for the <20>»‰È× (Jncota) KT-008 PCB. It's an MMC3 clone that supports 1024 KiB of PRG-ROM
//through an additional outer bank register at $5000.
//http://wiki.nesdev.com/w/index.php/INES_Mapper_224
class MMC3_224 : public MMC3
{
private:
uint8_t _outerBank;
protected:
void InitMapper() override
{
_outerBank = 0;
AddRegisterRange(0x5000, 0x5003, MemoryOperation::Write);
MMC3::InitMapper();
}
void StreamState(bool saving) override
{
MMC3::StreamState(saving);
Stream(_outerBank);
}
void UpdatePrgMapping() override
{
uint8_t outerBank = _outerBank << 6;
if(_prgMode == 0) {
SelectPRGPage(0, (_registers[6] & 0x3F) | outerBank);
SelectPRGPage(1, (_registers[7] & 0x3F) | outerBank);
SelectPRGPage(2, 0x3E | outerBank);
SelectPRGPage(3, 0x3F | outerBank);
} else if(_prgMode == 1) {
SelectPRGPage(0, 0x3E | outerBank);
SelectPRGPage(1, (_registers[6] & 0x3F) | outerBank);
SelectPRGPage(2, (_registers[7] & 0x3F) | outerBank);
SelectPRGPage(3, 0x3F | outerBank);
}
}
void WriteRegister(uint16_t addr, uint8_t value) override
{
if(addr < 0x8000) {
if(addr == 0x5000) {
_outerBank = (value >> 2) & 0x01;
UpdatePrgMapping();
}
} else {
MMC3::WriteRegister(addr, value);
}
}
};

View File

@ -169,6 +169,7 @@
#include "MMC3_215.h"
#include "MMC3_217.h"
#include "MMC3_219.h"
#include "MMC3_224.h"
#include "MMC3_238.h"
#include "MMC3_245.h"
#include "MMC3_249.h"
@ -286,7 +287,7 @@ Supported mappers:
|176|177|178|179|180|---|182|183|184|185|186|187|188|189|190|191|
|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|
|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|???|
|???|225|226|227|228|229|230|231|232|233|234|235|236|===|238|===|
|224|225|226|227|228|229|230|231|232|233|234|235|236|===|238|===|
|240|241|242|243|244|245|246|===|===|249|250|===|252|253|254|255|
-----------------------------------------------------------------
*/
@ -504,6 +505,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData)
case 220: return new Mapper220();
case 221: return new Mapper221();
case 222: return new Mapper222();
case 224: return new MMC3_224();
case 225: return new Mapper225();
case 226: return new Mapper226();
case 227: return new Mapper227();

View File

@ -4,7 +4,7 @@
#
# Automatically generated database based on Nestopia's DB and NesCartDB
#
# Generated on 2018-06-22 using:
# Generated on 2018-06-24 using:
# -NesCartDB (dated 2017-08-21)
# -Nestopia UE's latest DB (dated 2015-10-22)
#
@ -4706,6 +4706,7 @@
4D68CFB1,NesNtsc,UNL-PCI556,PCI556,,38,128,32,,0,0,0,v,Zapper,,
4D69E157,NesNtsc,UNK,,,4,256,128,,0,0,0,v,,,
4D732AC4,NesNtsc,UNK,,,4,128,128,,0,0,0,v,,,
4D735CB1,NesNtsc,,,,224,1024,,8,0,8,1,h,,,
4D772D57,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,
4D7859A9,Famicom,SUNSOFT-5A,BAT-E301,SUNSOFT-5A,69,128,128,,0,0,0,,,,
4D7D896C,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,
@ -4831,6 +4832,7 @@
4F33DF4D,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,
4F383D0C,NesNtsc,UNK,,,0,16,8,,0,0,0,h,,,
4F3B2E57,NesPal,NES-GNROM,NES-GNROM-05,,66,128,32,,0,0,0,v,,,
4F427110,NesNtsc,,,,224,1024,,8,0,8,1,h,,,
4F42D622,NesNtsc,UNK,,,3,32,32,,0,0,0,v,,,
4F42DB87,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,
4F467410,NesNtsc,NES-SGROM,NES-SGROM-02,MMC1A,1,256,,8,0,0,0,,,,
@ -5956,6 +5958,7 @@
61EAA86B,NesNtsc,UNK,,,2,128,,,0,0,0,v,,,
61F33D8F,NesNtsc,UNK,,,4,32,16,,0,8,1,v,,,
61F87D23,NesNtsc,UNK,,,4,256,128,,0,0,0,v,,,
61FC4D20,NesNtsc,,,,224,1024,,8,0,8,1,h,,,
61FF696E,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,
6200C69D,NesNtsc,UNK,,,0,32,8,,0,0,0,h,,,
62030A24,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,
@ -13588,6 +13591,7 @@ DFF7EABC,NesNtsc,UNK,,,4,256,128,,0,0,0,h,,,
E000DD39,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,
E00155CE,NesNtsc,UNK,,,0,16,8,,0,0,0,v,,,
E001C2C6,NesNtsc,UNK,,,25,256,256,,0,0,0,h,,,
E001DE16,NesNtsc,,,,224,1024,,8,0,8,1,h,,,
E0077F78,NesNtsc,UNK,,,0,16,8,,0,0,0,h,,,
E0088490,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,
E00E8E47,NesNtsc,UNK,,,16,256,256,,0,0,0,v,,,

View File

@ -4693,6 +4693,7 @@
"4D68CFB1,NesNtsc,UNL-PCI556,PCI556,,38,128,32,,0,0,0,v,Zapper,,",
"4D69E157,NesNtsc,UNK,,,4,256,128,,0,0,0,v,,,",
"4D732AC4,NesNtsc,UNK,,,4,128,128,,0,0,0,v,,,",
"4D735CB1,NesNtsc,,,,224,1024,,8,0,8,1,h,,,",
"4D772D57,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,",
"4D7859A9,Famicom,SUNSOFT-5A,BAT-E301,SUNSOFT-5A,69,128,128,,0,0,0,,,,",
"4D7D896C,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,",
@ -4818,6 +4819,7 @@
"4F33DF4D,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,",
"4F383D0C,NesNtsc,UNK,,,0,16,8,,0,0,0,h,,,",
"4F3B2E57,NesPal,NES-GNROM,NES-GNROM-05,,66,128,32,,0,0,0,v,,,",
"4F427110,NesNtsc,,,,224,1024,,8,0,8,1,h,,,",
"4F42D622,NesNtsc,UNK,,,3,32,32,,0,0,0,v,,,",
"4F42DB87,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,",
"4F467410,NesNtsc,NES-SGROM,NES-SGROM-02,MMC1A,1,256,,8,0,0,0,,,,",
@ -5943,6 +5945,7 @@
"61EAA86B,NesNtsc,UNK,,,2,128,,,0,0,0,v,,,",
"61F33D8F,NesNtsc,UNK,,,4,32,16,,0,8,1,v,,,",
"61F87D23,NesNtsc,UNK,,,4,256,128,,0,0,0,v,,,",
"61FC4D20,NesNtsc,,,,224,1024,,8,0,8,1,h,,,",
"61FF696E,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,",
"6200C69D,NesNtsc,UNK,,,0,32,8,,0,0,0,h,,,",
"62030A24,NesNtsc,UNK,,,4,256,128,,0,8,1,h,,,",
@ -13575,6 +13578,7 @@
"E000DD39,NesNtsc,UNK,,,0,32,8,,0,0,0,v,,,",
"E00155CE,NesNtsc,UNK,,,0,16,8,,0,0,0,v,,,",
"E001C2C6,NesNtsc,UNK,,,25,256,256,,0,0,0,h,,,",
"E001DE16,NesNtsc,,,,224,1024,,8,0,8,1,h,,,",
"E0077F78,NesNtsc,UNK,,,0,16,8,,0,0,0,h,,,",
"E0088490,NesNtsc,UNK,,,4,128,128,,0,0,0,h,,,",
"E00E8E47,NesNtsc,UNK,,,16,256,256,,0,0,0,v,,,",