all repos — mgba @ dd67bf979767f11557852fb4e3522adbb915a623

mGBA Game Boy Advance Emulator

GBA Video: Fix another merge casualty
Vicki Pfau vi@endrift.com
Fri, 17 Jul 2020 00:22:59 -0700
commit

dd67bf979767f11557852fb4e3522adbb915a623

parent

c7f85f7b7e36e8241b48dd13800201a1380a2958

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

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

@@ -14,7 +14,11 @@ xBase += (localX & 0x100) << 5; \

} \ screenBase = background->screenBase + yBase + (xBase >> 2); \ uint16_t* screenBlock = renderer->d.vramBG[screenBase >> VRAM_BLOCK_OFFSET]; \ - LOAD_16(mapData, screenBase & VRAM_BLOCK_MASK, screenBlock); \ + if (LIKELY(screenBlock)) { \ + LOAD_16(mapData, screenBase & VRAM_BLOCK_MASK, screenBlock); \ + } else { \ + mapData = 0; \ + } #define DRAW_BACKGROUND_MODE_0_TILE_SUFFIX_16(BLEND, OBJWIN) \ paletteData = GBA_TEXT_MAP_PALETTE(mapData) << 4; \