diff --git a/src/ds/renderers/software.c b/src/ds/renderers/software.c index 0f5be1e0e..d1399ff75 100644 --- a/src/ds/renderers/software.c +++ b/src/ds/renderers/software.c @@ -774,11 +774,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt1(struct GBAVideoSoftwareRenderer* if (!mosaicWait) { uint32_t address = (localX >> 8) + (localY >> 8) * width + screenBase; - uint8_t* vram = (uint8_t*) renderer->d.vramBG[address >> 17]; + uint8_t* vram = (uint8_t*) renderer->d.vramBG[address >> VRAM_BLOCK_OFFSET]; if (UNLIKELY(!vram)) { continue; } - color = vram[address]; + color = vram[address & VRAM_BLOCK_MASK]; mosaicWait = mosaicH; } else { --mosaicWait; @@ -831,11 +831,11 @@ void DSVideoSoftwareRendererDrawBackgroundExt2(struct GBAVideoSoftwareRenderer* if (!mosaicWait) { uint32_t address = ((localX >> 8) + (localY >> 8) * width + screenBase) << 1; - uint16_t* vram = renderer->d.vramBG[address >> 17]; + uint16_t* vram = renderer->d.vramBG[address >> VRAM_BLOCK_OFFSET]; if (UNLIKELY(!vram)) { continue; } - LOAD_16(color, address & 0x1FFFE, vram); + LOAD_16(color, address & VRAM_BLOCK_MASK, vram); #ifndef COLOR_16_BIT unsigned color32; color32 = 0;