all repos — mgba @ 6cdfa43e970b42cfd383765272482c9110798900

mGBA Game Boy Advance Emulator

hflip in fast path
Jeffrey Pfau jeffrey@endrift.com
Mon, 29 Apr 2013 22:05:32 -0700
commit

6cdfa43e970b42cfd383765272482c9110798900

parent

87e5973039cbb6d6bdcd8261445c9455a0df461d

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

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

@@ -424,22 +424,42 @@ BACKGROUND_TEXT_SELECT_CHARACTER;

charBase = ((background->charBase + (mapData.tile << 5)) >> 2) + localY; uint32_t tileData = ((uint32_t*)renderer->d.vram)[charBase]; if (tileData) { - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; - BACKGROUND_DRAW_PIXEL_16; - ++outX; + if (!mapData.hflip) { + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + BACKGROUND_DRAW_PIXEL_16; + ++outX; + } else { + outX += 7; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + --outX; + BACKGROUND_DRAW_PIXEL_16; + outX += 8; + } } else { outX += 8; }