DS Video: Enable overflow bit on extended affine modes

This commit is contained in:
Vicki Pfau 2017-04-12 13:43:12 -07:00
parent 8b4df520e2
commit cb0f95b070
2 changed files with 17 additions and 2 deletions

View File

@ -13,6 +13,7 @@ Bugfixes:
- 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

View File

@ -743,6 +743,20 @@ void DSVideoSoftwareRendererDrawBackgroundExt0(struct GBAVideoSoftwareRenderer*
}
}
#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 @@ void DSVideoSoftwareRendererDrawBackgroundExt1(struct GBAVideoSoftwareRenderer*
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 @@ void DSVideoSoftwareRendererDrawBackgroundExt2(struct GBAVideoSoftwareRenderer*
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;