all repos — mgba @ aaf1fef5ade790f1e57887e78ff92e5302c3d882

mGBA Game Boy Advance Emulator

GB Video: Fix clearing scanline buffer (fixes #1958)
Vicki Pfau vi@endrift.com
Tue, 01 Dec 2020 21:16:06 -0800
commit

aaf1fef5ade790f1e57887e78ff92e5302c3d882

parent

41a40acefc041c09f5c523a80a9a0a4a017fed24

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

jump to
M src/gb/renderers/software.csrc/gb/renderers/software.c

@@ -570,7 +570,7 @@ if (GBRegisterLCDCIsTileMap(softwareRenderer->lcdc)) {

maps += GB_SIZE_MAP; } if (softwareRenderer->d.disableBG) { - memset(&softwareRenderer->row[startX], 0, endX - startX); + memset(&softwareRenderer->row[startX], 0, (endX - startX) * sizeof(softwareRenderer->row[0])); } if (GBRegisterLCDCIsBgEnable(softwareRenderer->lcdc) || softwareRenderer->model >= GB_MODEL_CGB) { int wy = softwareRenderer->wy + softwareRenderer->currentWy;

@@ -592,7 +592,7 @@ } else if (!softwareRenderer->d.disableBG) {

GBVideoSoftwareRendererDrawBackground(softwareRenderer, maps, startX, endX, softwareRenderer->scx - softwareRenderer->offsetScx, softwareRenderer->scy + y - softwareRenderer->offsetScy, renderer->highlightBG); } } else if (!softwareRenderer->d.disableBG) { - memset(&softwareRenderer->row[startX], 0, endX - startX); + memset(&softwareRenderer->row[startX], 0, (endX - startX) * sizeof(softwareRenderer->row[0])); } if (GBRegisterLCDCIsObjEnable(softwareRenderer->lcdc) && !softwareRenderer->d.disableOBJ) {