From 82834a17533c6dcd8008d459e6eee44ffec674f6 Mon Sep 17 00:00:00 2001 From: Sour Date: Sun, 10 Mar 2019 23:18:47 -0400 Subject: [PATCH] PPU: MSB of CGRAM entries is 7 bits only --- Core/Ppu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/Ppu.cpp b/Core/Ppu.cpp index 2309119..95cc9c3 100644 --- a/Core/Ppu.cpp +++ b/Core/Ppu.cpp @@ -1479,7 +1479,12 @@ void Ppu::Write(uint32_t addr, uint8_t value) //CGRAM Data write (CGDATA) _console->ProcessPpuWrite(_cgramAddress, value, SnesMemoryType::CGRam); - _cgram[_cgramAddress] = value; + if(_cgramAddress & 0x01) { + //MSB ignores the 7th bit (colors are 15-bit only) + _cgram[_cgramAddress] = value & 0x7F; + } else { + _cgram[_cgramAddress] = value; + } _cgramAddress = (_cgramAddress + 1) & (Ppu::CgRamSize - 1); break;