all repos — mgba @ 6376a1ff7f41da9ddd6bb8bcc2f4925e20aeeb0e

mGBA Game Boy Advance Emulator

Support OBJWIN in mode 4
Jeffrey Pfau jeffrey@endrift.com
Sat, 26 Oct 2013 02:26:08 -0700
commit

6376a1ff7f41da9ddd6bb8bcc2f4925e20aeeb0e

parent

38116f0ead8b1e0da0c3064c3415cace8eaee167

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

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

@@ -1103,11 +1103,12 @@

color = ((uint8_t*)renderer->d.vram)[offset + (localX >> 8) + (localY >> 8) * VIDEO_HORIZONTAL_PIXELS]; uint32_t current = renderer->row[outX]; - if (color && !(current & FLAG_FINALIZED) && (!objwinSlowPath || !(current & FLAG_OBJWIN) != objwinOnly)) { - if (!variant) { - _composite(renderer, outX, renderer->normalPalette[color] | flags, current); - } else { - _composite(renderer, outX, renderer->variantPalette[color] | flags, current); + if (color && !(current & FLAG_FINALIZED)) { + if (!objwinSlowPath) { + _composite(renderer, outX, palette[color] | flags, current); + } else if (objwinForceEnable || !(current & FLAG_OBJWIN) == objwinOnly) { + color_t* currentPalette = (current & FLAG_OBJWIN) ? objwinPalette : palette; + _composite(renderer, outX, currentPalette[color] | flags, current); } } }