all repos — mgba @ 9923a1314e899a4e9f34b3cafb595e56795f8707

mGBA Game Boy Advance Emulator

GBA Video: Fix double-size OBJ wrapping in GL renderer (fixes #1712)
Vicki Pfau vi@endrift.com
Wed, 27 May 2020 15:19:17 -0700
commit

9923a1314e899a4e9f34b3cafb595e56795f8707

parent

863343b466007c6478ed702c449ae5772fc37cc8

2 files changed, 5 insertions(+), 4 deletions(-)

jump to
M CHANGESCHANGES

@@ -12,6 +12,7 @@ - GBA Timers: Fix deserializing count-up timers

- GBA Video: Fix mosaic objects drawing past the end (fixes mgba.io/i/1702) - GBA Video: Fix disabling OBJWIN in GL renderer (fixes mgba.io/i/1759) - GBA Video: Add missing parts of 256-color mode 0 mosaic (fixes mgba.io/1701) + - GBA Video: Fix double-size OBJ wrapping in GL renderer (fixes mgba.io/1712) Other fixes: - ARM Debugger: Clear low bit on breakpoint addresses (fixes mgba.io/i/1764) - CMake: Always use devkitPro toolchain when applicable (fixes mgba.io/i/1755)
M src/gba/renderers/gl.csrc/gba/renderers/gl.c

@@ -1651,15 +1651,15 @@ int align = GBAObjAttributesAIs256Color(sprite->a) && !GBARegisterDISPCNTIsObjCharacterMapping(renderer->dispcnt);

unsigned charBase = (BASE_TILE >> 1) + (GBAObjAttributesCGetTile(sprite->c) & ~align) * 0x10; int stride = GBARegisterDISPCNTIsObjCharacterMapping(renderer->dispcnt) ? (width >> 3) : (0x20 >> GBAObjAttributesAGet256Color(sprite->a)); - if (spriteY + height >= 256) { - spriteY -= 256; - } - int totalWidth = width; int totalHeight = height; if (GBAObjAttributesAIsTransformed(sprite->a) && GBAObjAttributesAIsDoubleSize(sprite->a)) { totalWidth <<= 1; totalHeight <<= 1; + } + + if (spriteY + totalHeight >= 256) { + spriteY -= 256; } const struct GBAVideoGLShader* shader = &renderer->objShader[GBAObjAttributesAGet256Color(sprite->a)];