From 1787081fca6f18d4bef0bb358be1737dbe1ffa64 Mon Sep 17 00:00:00 2001 From: rogerman Date: Sat, 10 Dec 2016 21:26:30 -0800 Subject: [PATCH] GPU: Fix BG layer 3 when reading VRAM with a BMPAddress that maps exactly to the head of the VRAM blank region. Fixes a possible graphical glitch during the Arangoa Prelude in Golden Sun: Dark Dawn. --- desmume/src/GPU.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desmume/src/GPU.cpp b/desmume/src/GPU.cpp index 5db3656d4..fc9aef630 100644 --- a/desmume/src/GPU.cpp +++ b/desmume/src/GPU.cpp @@ -3062,7 +3062,7 @@ void GPUEngineBase::_RenderLine_BGExtended(GPUEngineCompositorInfo &compInfo, co { const size_t vramPixel = (size_t)((u8 *)MMU_gpu_map(compInfo.renderState.selectedBGLayer->BMPAddress) - MMU.ARM9_LCD) / sizeof(u16); - if (vramPixel > (GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_VRAM_BLOCK_LINES * 4)) + if (vramPixel >= (GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_VRAM_BLOCK_LINES * 4)) { outUseCustomVRAM = false; }