diff --git a/CHANGES b/CHANGES index 20c0cbeef..d0b981ffc 100644 --- a/CHANGES +++ b/CHANGES @@ -63,6 +63,7 @@ Emulation fixes: - GBA Video: Implement green swap (fixes mgba.io/i/1609) - GBA Video: Emulate sprite cycle limits in OpenGL renderer (fixes mgba.io/i/1635) - GBA Video: Fix OBJWIN erratic rendering in OpenGL renderer + - GBA Video: Fix x offset in 256-color BG mosaic (fixes mgba.io/i/1684) - SM83: Emulate HALT bug - SM83: Improve mid-M-cycle interrupts - SM83: HALT should not consume an extra T-state diff --git a/src/gba/renderers/software-mode0.c b/src/gba/renderers/software-mode0.c index 6196e1e74..fef8f9bd5 100644 --- a/src/gba/renderers/software-mode0.c +++ b/src/gba/renderers/software-mode0.c @@ -387,7 +387,7 @@ } \ charBase = (background->charBase + (GBA_TEXT_MAP_TILE(mapData) << 6)) + (localY << 3); \ tileData = carryData; \ - for (x = 0; x < 8 && length; ++x, --length) { \ + for (; x < 8 && length; ++x, --length) { \ if (!mosaicWait) { \ if (UNLIKELY(charBase >= 0x10000)) { \ carryData = 0; \ @@ -419,6 +419,7 @@ BACKGROUND_DRAW_PIXEL_256(BLEND, OBJWIN, 0); \ ++pixel; \ } \ + x = 0; \ } #define DRAW_BACKGROUND_MODE_0(BPP, BLEND, OBJWIN) \