From d44c8f78088e80495626dbac921b4f388ae42b89 Mon Sep 17 00:00:00 2001 From: Souryo Date: Sat, 18 Feb 2017 12:48:06 -0500 Subject: [PATCH] Mapper 190 support (Magic Kid GooGoo) --- Core/Core.vcxproj | 1 + Core/Core.vcxproj.filters | 3 +++ Core/MagicKidGooGoo.h | 29 +++++++++++++++++++++++++++++ Core/MapperFactory.cpp | 2 ++ 4 files changed, 35 insertions(+) create mode 100644 Core/MagicKidGooGoo.h diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 59eb2e4e..dde6b3fd 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -440,6 +440,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 9bbb920a..ada49cfa 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -1111,6 +1111,9 @@ Misc + + Nes\Mappers + diff --git a/Core/MagicKidGooGoo.h b/Core/MagicKidGooGoo.h new file mode 100644 index 00000000..c005723a --- /dev/null +++ b/Core/MagicKidGooGoo.h @@ -0,0 +1,29 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class MagicKidGooGoo : public BaseMapper +{ +protected: + virtual uint16_t GetPRGPageSize() override { return 0x4000; } + virtual uint16_t GetCHRPageSize() override { return 0x800; } + + void InitMapper() override + { + SelectPRGPage(0, 0); + SelectPRGPage(1, 0); + SelectChrPage4x(0, 0); + SetMirroringType(MirroringType::Vertical); + } + + void WriteRegister(uint16_t addr, uint8_t value) override + { + if(addr >= 0x8000 && addr <= 0x9FFF) { + SelectPRGPage(0, value & 0x07); + } else if(addr >= 0xC000 && addr <= 0xDFFF) { + SelectPRGPage(0, (value & 0x07) | 0x08); + } else if((addr & 0xA000) == 0xA000) { + SelectCHRPage(addr & 0x03, value); + } + } +}; \ No newline at end of file diff --git a/Core/MapperFactory.cpp b/Core/MapperFactory.cpp index b93d2e10..d7fa8679 100644 --- a/Core/MapperFactory.cpp +++ b/Core/MapperFactory.cpp @@ -70,6 +70,7 @@ #include "Lh10.h" #include "Lh32.h" #include "Malee.h" +#include "MagicKidGooGoo.h" #include "Mapper15.h" #include "Mapper35.h" #include "Mapper40.h" @@ -429,6 +430,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData) case 187: return new MMC3_187(); case 188: return new BandaiKaraoke(); case 189: return new MMC3_189(); + case 190: return new MagicKidGooGoo(); case 191: return new MMC3_ChrRam(0x80, 0xFF, 2); case 192: return new MMC3_ChrRam(0x08, 0x0B, 4); case 193: return new NtdecTc112();