all repos — mgba @ 5aec67a0f7c874189217efb8b771f1fccf0f8b24

mGBA Game Boy Advance Emulator

GBA Video: Optimize compositing cases slightly
Jeffrey Pfau jeffrey@endrift.com
Mon, 22 Aug 2016 12:35:48 -0700
commit

5aec67a0f7c874189217efb8b771f1fccf0f8b24

parent

c207675dfb0ae3e39f9cb0745fe0cca79a697ae2

3 files changed, 10 insertions(+), 3 deletions(-)

jump to
M CHANGESCHANGES

@@ -71,6 +71,7 @@ - GBA Memory: Optimize Load-/StoreMultiple

- 3DS: Adjustable filering - PSP2: Screenshots are now saved into the Photo Gallery - Qt: Make reseting when pasued frame-accurate + - GBA Video: Optimize compositing cases slightly 0.4.1: (2016-07-11) Bugfixes:
M src/gba/renderers/software-bg.csrc/gba/renderers/software-bg.c

@@ -40,9 +40,6 @@ x += background->dx; \

y += background->dy; \ \ uint32_t current = *pixel; \ - if (!IS_WRITABLE(current)) { \ - continue; \ - } \ MOSAIC(COORD) \ if (pixelData) { \ COMPOSITE_256_ ## OBJWIN (BLEND, 0); \
M src/gba/renderers/software-private.hsrc/gba/renderers/software-private.h

@@ -51,6 +51,9 @@ *pixel = color;

} static inline void _compositeBlendNoObjwin(struct GBAVideoSoftwareRenderer* renderer, uint32_t* pixel, uint32_t color, uint32_t current) { + if (!IS_WRITABLE(current)) { \ + return; \ + } \ if (color >= current) { if (current & FLAG_TARGET_1 && color & FLAG_TARGET_2) { color = _mix(renderer->blda, current, renderer->bldb, color);

@@ -84,6 +87,9 @@ *pixel = color;

} #define COMPOSITE_16_OBJWIN(BLEND, IDX) \ + if (!IS_WRITABLE(current)) { \ + continue; \ + } \ if (objwinForceEnable || (!(current & FLAG_OBJWIN)) == objwinOnly) { \ unsigned color = (current & FLAG_OBJWIN) ? objwinPalette[paletteData | pixelData] : palette[pixelData]; \ unsigned mergedFlags = flags; \

@@ -97,6 +103,9 @@ #define COMPOSITE_16_NO_OBJWIN(BLEND, IDX) \

_composite ## BLEND ## NoObjwin(renderer, &pixel[IDX], palette[pixelData] | flags, current); #define COMPOSITE_256_OBJWIN(BLEND, IDX) \ + if (!IS_WRITABLE(current)) { \ + continue; \ + } \ if (objwinForceEnable || (!(current & FLAG_OBJWIN)) == objwinOnly) { \ unsigned color = (current & FLAG_OBJWIN) ? objwinPalette[pixelData] : palette[pixelData]; \ unsigned mergedFlags = flags; \