all repos — mgba @ 187e099f255a46854bb0b23d8cb062e524ef09a0

mGBA Game Boy Advance Emulator

Fix sorting in _composite
Jeffrey Pfau jeffrey@endrift.com
Thu, 26 Sep 2013 10:35:26 -0700
commit

187e099f255a46854bb0b23d8cb062e524ef09a0

parent

a7182b8df9b399ad83e764bb400bdb4763f21d44

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -635,7 +635,7 @@ static void _composite(struct GBAVideoSoftwareRenderer* renderer, int offset, uint32_t color, uint32_t current) {

// We stash the priority on the top bits so we can do a one-operator comparison // The lower the number, the higher the priority, and sprites take precendence over backgrounds // We want to do special processing if the color pixel is target 1, however - if (color < current) { + if ((color & 0xF8000000) < (current & 0xF8000000)) { if (current & FLAG_UNWRITTEN) { renderer->row[offset] = color; } else if (!(color & FLAG_TARGET_1) || !(current & FLAG_TARGET_2)) {