From c7ecf754da5382c9cb291c29477401ea3bc6b1ff Mon Sep 17 00:00:00 2001 From: Sour Date: Fri, 15 Mar 2019 21:09:39 -0400 Subject: [PATCH] PPU: Block 2118/2119 writes when outside vblank/fblank --- Core/Ppu.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Core/Ppu.cpp b/Core/Ppu.cpp index a432149..67f3aee 100644 --- a/Core/Ppu.cpp +++ b/Core/Ppu.cpp @@ -1439,6 +1439,11 @@ void Ppu::Write(uint32_t addr, uint8_t value) case 0x2118: //VMDATAL - VRAM Data Write low byte + if(!_forcedVblank && _scanline < (_overscanMode ? 240 : 225)) { + //Invalid VRAM access - can't write VRAM outside vblank/force blank + return; + } + _console->ProcessPpuWrite(GetVramAddress() << 1, value, SnesMemoryType::VideoRam); _vram[GetVramAddress() << 1] = value; @@ -1449,6 +1454,11 @@ void Ppu::Write(uint32_t addr, uint8_t value) case 0x2119: //VMDATAH - VRAM Data Write high byte + if(!_forcedVblank && _scanline < (_overscanMode ? 240 : 225)) { + //Invalid VRAM access - can't write VRAM outside vblank/force blank + return; + } + _console->ProcessPpuWrite((GetVramAddress() << 1) + 1, value, SnesMemoryType::VideoRam); _vram[(GetVramAddress() << 1) + 1] = value;