From c71af2b9d9255dbac8de266beafd1fa553d27b47 Mon Sep 17 00:00:00 2001 From: Souryo Date: Mon, 18 Jan 2016 18:03:42 -0500 Subject: [PATCH] Mapper 180 support --- Core/Core.vcxproj | 1 + Core/Core.vcxproj.filters | 3 +++ Core/MapperFactory.cpp | 2 ++ Core/UnRom_180.h | 23 +++++++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 Core/UnRom_180.h diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 556f657e..169d8006 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -285,6 +285,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index cbee8196..f6208ce8 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -344,6 +344,9 @@ Nes\APU + + Nes\Mappers + diff --git a/Core/MapperFactory.cpp b/Core/MapperFactory.cpp index 1941a0cf..e92e74f2 100644 --- a/Core/MapperFactory.cpp +++ b/Core/MapperFactory.cpp @@ -38,6 +38,7 @@ #include "TaitoX1005.h" #include "UnlPci556.h" #include "UNROM.h" +#include "UnRom_180.h" #include "VRC1.h" #include "VRC2_4.h" #include "BF909x.h" @@ -95,6 +96,7 @@ BaseMapper* MapperFactory::GetMapperFromID(ROMLoader &romLoader) case 152: return new Bandai74161_7432(true); case 154: return new Namco108_154(); case 163: return new Nanjing(); + case 180: return new UnRom_180(); case 184: return new Sunsoft184(); case 185: return new CNROM(true); case 189: return new MMC3_189(); diff --git a/Core/UnRom_180.h b/Core/UnRom_180.h new file mode 100644 index 00000000..e1a99f71 --- /dev/null +++ b/Core/UnRom_180.h @@ -0,0 +1,23 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class UnRom_180 : public BaseMapper +{ +protected: + virtual uint16_t GetPRGPageSize() { return 0x4000; } + virtual uint16_t GetCHRPageSize() { return 0x2000; } + + void InitMapper() + { + SelectPRGPage(0, 0); + SelectPRGPage(1, -1); + + SelectCHRPage(0, 0); + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + SelectPRGPage(1, value & 0x07); + } +}; \ No newline at end of file