all repos — mgba @ 24f0be2862fe39219c4e2dcc615b0c76cbb700b6

mGBA Game Boy Advance Emulator

GBA Video: Slight optimizations
Jeffrey Pfau jeffrey@endrift.com
Sat, 27 Feb 2016 02:38:44 -0800
commit

24f0be2862fe39219c4e2dcc615b0c76cbb700b6

parent

be97f04971666b64dc55ebbcb945c3190e790594

2 files changed, 11 insertions(+), 3 deletions(-)

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

@@ -41,10 +41,12 @@ for (outX = renderer->start, pixel = &renderer->row[outX]; outX < renderer->end; ++outX, ++pixel) { \

x += background->dx; \ y += background->dy; \ \ - MOSAIC(COORD) \ - \ uint32_t current = *pixel; \ - if (pixelData && IS_WRITABLE(current)) { \ + if (!IS_WRITABLE(current)) { \ + continue; \ + } \ + MOSAIC(COORD) \ + if (pixelData) { \ COMPOSITE_256_ ## OBJWIN (BLEND); \ } \ }
M src/gba/renderers/video-software.csrc/gba/renderers/video-software.c

@@ -517,6 +517,12 @@ } else {

backdrop |= softwareRenderer->variantPalette[0]; } int end = softwareRenderer->windows[w].endX; + for (; x < end - 3; x += 4) { + softwareRenderer->row[x] = backdrop; + softwareRenderer->row[x + 1] = backdrop; + softwareRenderer->row[x + 2] = backdrop; + softwareRenderer->row[x + 3] = backdrop; + } for (; x < end; ++x) { softwareRenderer->row[x] = backdrop; }