From f8ecd1be5e0c8cc1a49d023ba400a45a59733b4d Mon Sep 17 00:00:00 2001 From: Souryo Date: Sat, 28 Jun 2014 21:10:50 -0400 Subject: [PATCH] Mapper 11 support --- Core/ColorDreams.h | 23 +++++++++++++++++++++++ Core/Core.vcxproj | 1 + Core/Core.vcxproj.filters | 3 +++ Core/MapperFactory.h | 5 +++++ 4 files changed, 32 insertions(+) create mode 100644 Core/ColorDreams.h diff --git a/Core/ColorDreams.h b/Core/ColorDreams.h new file mode 100644 index 00000000..195d8a8d --- /dev/null +++ b/Core/ColorDreams.h @@ -0,0 +1,23 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class ColorDreams : public BaseMapper +{ + protected: + virtual uint32_t GetPRGPageSize() { return 0x8000; } + virtual uint32_t GetCHRPageSize() { return 0x2000; } + + void InitMapper() + { + SelectPRGPage(0, 0); + SelectCHRPage(0, 0); + } + + public: + void WriteRAM(uint16_t addr, uint8_t value) + { + SelectPRGPage(0, value & 0x03); + SelectCHRPage(0, (value >> 4) & 0x0F); + } +}; \ No newline at end of file diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index a257f737..42cc4593 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -91,6 +91,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 31762e00..dc9b46c6 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -126,6 +126,9 @@ Header Files\Mappers + + Header Files\Mappers + diff --git a/Core/MapperFactory.h b/Core/MapperFactory.h index d2c7afbd..d71bb108 100644 --- a/Core/MapperFactory.h +++ b/Core/MapperFactory.h @@ -2,6 +2,7 @@ #include "ROMLoader.h" #include "AXROM.h" #include "CNROM.h" +#include "ColorDreams.h" #include "MMC1.h" #include "MMC2.h" #include "MMC3.h" @@ -19,8 +20,12 @@ class MapperFactory case 2: return new UNROM(); case 3: return new CNROM(); case 4: return new MMC3(); + case 5: break; //11 games case 7: return new AXROM(); case 9: return new MMC2(); + case 11: return new ColorDreams(); break; + case 16: break; //18 games + case 19: break; //16 games case 71: return new UNROM(); //TODO: "It's largely a clone of UNROM, and Camerica games were initially emulated under iNES Mapper 002 before 071 was assigned." }