From 5d3c51d7bedec16829f3a8379a0c1c69855f7d21 Mon Sep 17 00:00:00 2001 From: Souryo Date: Tue, 29 Dec 2015 21:18:37 -0500 Subject: [PATCH] GxRom (Mapper 66) support --- Core/Core.vcxproj | 1 + Core/Core.vcxproj.filters | 3 +++ Core/GxRom.h | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 Core/GxRom.h diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 7b391d13..e4f24242 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -293,6 +293,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 0f8d97ce..7b825e3d 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -260,6 +260,9 @@ Header Files\Mappers + + Header Files\Mappers + diff --git a/Core/GxRom.h b/Core/GxRom.h new file mode 100644 index 00000000..ddc6ac74 --- /dev/null +++ b/Core/GxRom.h @@ -0,0 +1,23 @@ +#pragma once +#include "stdafx.h" +#include "BaseMapper.h" + +class GxRom : public BaseMapper +{ + protected: + virtual uint16_t GetPRGPageSize() { return 0x8000; } + virtual uint16_t GetCHRPageSize() { return 0x2000; } + virtual uint32_t GetChrRamSize() { return 0x4000; } + + void InitMapper() + { + SelectPRGPage(0, 0); + SelectCHRPage(0, 0); + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + SelectPRGPage(0, (value >> 4) & 0x03); + SelectCHRPage(0, value & 0x03); + } +}; \ No newline at end of file