DS Video: Enable overflow bit on extended affine modes
Vicki Pfau vi@endrift.com
Wed, 12 Apr 2017 13:43:12 -0700
2 files changed,
17 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -13,6 +13,7 @@ - DS GX: Fix 4-color texture coordinates
- DS GX: Reset polygon attributes between buffer swaps - DS Video: Fix blend bit on windows for 3D layer (fixes mgba.io/i/611) - DS GX: Hack around writing to a full FIFO that has a swap pending (fixes mgba.io/i/608) + - DS Video: Enable overflow bit on extended affine modes Misc: - DS: Set boot complete bit in RAM on boot (fixes mgba.io/i/576, mgba.io/i/580, mgba.io/i/586) - DS Memory: Ensure DS9 I/O is 8-byte aligned
M
src/ds/renderers/software.c
→
src/ds/renderers/software.c
@@ -743,6 +743,20 @@ }
} } +#define DS_BACKGROUND_BITMAP_ITERATE(W, H) \ + x += background->dx; \ + y += background->dy; \ + \ + if (background->overflow) { \ + localX = x & ((W << 8) - 1); \ + localY = y & ((H << 8) - 1); \ + } else if (x < 0 || y < 0 || (x >> 8) >= W || (y >> 8) >= H) { \ + continue; \ + } else { \ + localX = x; \ + localY = y; \ + } + void DSVideoSoftwareRendererDrawBackgroundExt1(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int inY) { BACKGROUND_BITMAP_INIT;@@ -770,7 +784,7 @@ }
int outX; for (outX = renderer->start; outX < renderer->end; ++outX) { - BACKGROUND_BITMAP_ITERATE(width, height); + DS_BACKGROUND_BITMAP_ITERATE(width, height); if (!mosaicWait) { uint32_t address = (localX >> 8) + (localY >> 8) * width + screenBase;@@ -827,7 +841,7 @@ }
int outX; for (outX = renderer->start; outX < renderer->end; ++outX) { - BACKGROUND_BITMAP_ITERATE(width, height); + DS_BACKGROUND_BITMAP_ITERATE(width, height); if (!mosaicWait) { uint32_t address = ((localX >> 8) + (localY >> 8) * width + screenBase) << 1;