diff --git a/CHANGES b/CHANGES index 8974a0317..9cc50fabc 100644 --- a/CHANGES +++ b/CHANGES @@ -49,6 +49,7 @@ Emulation fixes: - GBA Video: Emulate sprite cycle limits in OpenGL renderer (fixes mgba.io/i/1635) - GBA Video: Do not affect OBJ pixel priority when writing OBJWIN (fixes mgba.io/i/1890) - GBA Video: Fix deferred blending when OBJWIN matches window (fixes mgba.io/i/1905) + - GBA Video: Fix mode 4 transparency in OpenGL (fixes mgba.io/i/1907) - SM83: Emulate HALT bug Other fixes: - 3DS: Redo video sync to be more precise diff --git a/src/gba/renderers/gl.c b/src/gba/renderers/gl.c index 8856ec4ef..31c16f5cd 100644 --- a/src/gba/renderers/gl.c +++ b/src/gba/renderers/gl.c @@ -391,7 +391,11 @@ static const char* const _renderMode4 = " }\n" " int address = charBase + (coord.x >> 8) + (coord.y >> 8) * size.x;\n" " int twoEntries = texelFetch(vram, ivec2((address >> 1) & 255, address >> 9), 0).r;\n" - " int paletteEntry = palette[(twoEntries >> (8 * (address & 1)) & 255)];\n" + " int entry = (twoEntries >> (8 * (address & 1))) & 255;\n" + " if (entry == 0) {\n" + " discard;\n" + " }\n" + " int paletteEntry = palette[entry];\n" " color = vec4(PALETTE_ENTRY(paletteEntry), 1.);\n" "}";