From f25e6f55327cb7f78974f2288dd36bbfefb2ebf5 Mon Sep 17 00:00:00 2001 From: Sour Date: Sun, 19 Aug 2018 20:25:15 -0400 Subject: [PATCH] VRC1: Allow oversized PRG --- Core/VRC1.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Core/VRC1.h b/Core/VRC1.h index f9cb2459..5e4af6eb 100644 --- a/Core/VRC1.h +++ b/Core/VRC1.h @@ -32,8 +32,12 @@ protected: void WriteRegister(uint16_t addr, uint8_t value) override { + //TODO: Create a setting to enable/disable oversized PRG + bool allowOversizedPrg = true; + uint8_t prgMask = allowOversizedPrg ? 0xFF : 0x0F; + switch(addr & 0xF000) { - case 0x8000: SelectPRGPage(0, value & 0x0F); break; + case 0x8000: SelectPRGPage(0, value & prgMask); break; case 0x9000: if(GetMirroringType() != MirroringType::FourScreens) { @@ -45,8 +49,8 @@ protected: UpdateChrBanks(); break; - case 0xA000: SelectPRGPage(1, value & 0x0F); break; - case 0xC000: SelectPRGPage(2, value & 0x0F); break; + case 0xA000: SelectPRGPage(1, value & prgMask); break; + case 0xC000: SelectPRGPage(2, value & prgMask); break; case 0xE000: _chrBanks[0] = (_chrBanks[0] & 0x10) | (value & 0x0F);