From fefbf7a2963b17bf9ae8198bc194e375b44ee8e1 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 25 Apr 2013 01:55:47 -0700 Subject: [PATCH] Flip sprites vertically after applying boundary operations --- src/gba/renderers/video-software.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index d82f552ae..b82b08230 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -402,12 +402,12 @@ static void _drawSprite(struct GBAVideoSoftwareRenderer* renderer, struct GBAObj }; int x = sprite->x; int inY = y - sprite->y; - if (sprite->vflip) { - inY = height - inY - 1; - } if (sprite->y + height - 256 >= 0) { inY += 256; } + if (sprite->vflip) { + inY = height - inY - 1; + } unsigned charBase = BASE_TILE + sprite->tile * 0x20; unsigned yBase = (inY & ~0x7) * 0x80 + (inY & 0x7) * 4; for (int outX = x >= 0 ? x : 0; outX < x + width && outX < VIDEO_HORIZONTAL_PIXELS; ++outX) {