all repos — mgba @ cb0f95b07053e63e817bd05df0a36bf917667d09

mGBA Game Boy Advance Emulator

DS Video: Enable overflow bit on extended affine modes
Vicki Pfau vi@endrift.com
Wed, 12 Apr 2017 13:43:12 -0700
commit

cb0f95b07053e63e817bd05df0a36bf917667d09

parent

8b4df520e239a3ee674bc0c82bf730fb7736f368

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

jump to
M CHANGESCHANGES

@@ -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.csrc/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;