From fa39dcbc805353654d15c9f47b820c059b935e0e Mon Sep 17 00:00:00 2001 From: Souryo Date: Fri, 21 Apr 2017 12:43:09 -0400 Subject: [PATCH] Mapper 29 support --- Core/Core.vcxproj | 1 + Core/Core.vcxproj.filters | 3 +++ Core/MapperFactory.cpp | 4 +++- Core/SealieComputing.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 Core/SealieComputing.h diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 0aa42607..04c0b73f 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -446,6 +446,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 37686575..22787dfb 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -1150,6 +1150,9 @@ Nes\Mappers + + Nes\Mappers + diff --git a/Core/MapperFactory.cpp b/Core/MapperFactory.cpp index abed0582..203942b8 100644 --- a/Core/MapperFactory.cpp +++ b/Core/MapperFactory.cpp @@ -197,6 +197,7 @@ #include "Sachen74LS374N.h" #include "Sachen74LS374NB.h" #include "Sachen8259.h" +#include "SealieComputing.h" #include "Smb2j.h" #include "StudyBox.h" #include "Subor166.h" @@ -248,7 +249,7 @@ Supported mappers: ??? : No known roms ----------------------------------------------------------------- | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10| 11| 12| 13| 14| 15| -| 16| 17| 18| 19|...| 21| 22| 23| 24| 25| 26| 27| 28| | 30| 31| +| 16| 17| 18| 19|...| 21| 22| 23| 24| 25| 26| 27| 28| 29| 30| 31| | 32| 33| 34| 35| 36| 37| 38|---| 40| 41| 42| 43| 44| 45| 46| 47| | 48| 49| 50| 51| 52| 53| 54|???| 56| 57| 58|===| 60| 61| 62| 63| | 64| 65| 66| 67| 68| 69| 70| 71| 72| 73| 74| 75| 76| 77| 78| 79| @@ -301,6 +302,7 @@ BaseMapper* MapperFactory::GetMapperFromID(RomData &romData) case 26: return new VRC6(VRCVariant::VRC6b); case 27: return new VRC2_4(); case 28: return new Action53(); + case 29: return new SealieComputing(); case 30: return new UnRom512(); case 31: return new NsfCart31(); case 32: return new IremG101(); diff --git a/Core/SealieComputing.h b/Core/SealieComputing.h new file mode 100644 index 00000000..bbeaa709 --- /dev/null +++ b/Core/SealieComputing.h @@ -0,0 +1,31 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class SealieComputing : public BaseMapper +{ +protected: + uint16_t GetPRGPageSize() override { return 0x4000; } + uint16_t GetCHRPageSize() override { return 0x2000; } + uint32_t GetWorkRamSize() override { return 0x2000; } + uint32_t GetChrRamSize() override { return 0x8000; } + uint16_t RegisterStartAddress() override { return 0x8000; } + uint16_t RegisterEndAddress() override { return 0xFFFF; } + + void InitMapper() override + { + SelectPRGPage(1, -1); + + //"It is hard-wired for vertical mirroring", but no need to enforce this, just need proper iNES headers. + //SetMirroringType(MirroringType::Vertical); + + //"contains 8KB of WRAM mounted in the usual place" + SetCpuMemoryMapping(0x6000, 0x7FFF, 0, PrgMemoryType::WorkRam, MemoryAccessType::ReadWrite); + } + + void WriteRegister(uint16_t addr, uint8_t value) override + { + SelectCHRPage(0, value & 0x03); + SelectPRGPage(0, (value >> 2) & 0x07); + } +}; \ No newline at end of file