GB Video: Fix more window edge cases (fixes #1346)

This commit is contained in:
Vicki Pfau 2019-03-09 14:11:55 -08:00
parent b25ed450a8
commit a3e1576f97
18 changed files with 11 additions and 9 deletions

View File

@ -3,6 +3,7 @@ Emulation fixes:
- GBA Video: Fix scanline cache with scale factor change edge cases
- GBA DMA: Fix DMA0-2 lengths (fixes mgba.io/i/1344)
- GB Video: Fix window y changing mid-window (fixes mgba.io/i/1345)
- GB Video: Fix more window edge cases (fixes mgba.io/i/1346)
Other fixes:
- Qt: More app metadata fixes
- Qt: Fix load recent from archive (fixes mgba.io/i/1325)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

View File

@ -222,22 +222,19 @@ static void GBVideoSoftwareRendererUpdateWindow(struct GBVideoSoftwareRenderer*
if (renderer->lastY >= GB_VIDEO_VERTICAL_PIXELS || !(after || before)) {
return;
}
if (renderer->lastY >= renderer->wy) {
if (renderer->lastY >= oldWy) {
if (!after) {
renderer->currentWy -= renderer->lastY;
renderer->hasWindow = true;
} else if (!before) {
if (!renderer->hasWindow) {
if (renderer->lastY > renderer->wy) {
renderer->currentWy = GB_VIDEO_VERTICAL_PIXELS;
} else {
renderer->currentWy = renderer->lastY - renderer->wy;
}
renderer->currentWy = renderer->lastY - renderer->wy;
} else {
renderer->currentWy += renderer->lastY;
}
} else if (renderer->wy != oldWy) {
renderer->currentWy += oldWy - renderer->wy;
renderer->hasWindow = true;
}
}
}
@ -501,9 +498,13 @@ static void GBVideoSoftwareRendererDrawRange(struct GBVideoRenderer* renderer, i
}
if (GBRegisterLCDCIsBgEnable(softwareRenderer->lcdc) || softwareRenderer->model >= GB_MODEL_CGB) {
int wy = softwareRenderer->wy + softwareRenderer->currentWy;
if (GBRegisterLCDCIsWindow(softwareRenderer->lcdc) && wy <= y && endX >= softwareRenderer->wx - 7) {
if (softwareRenderer->wx - 7 > 0 && !softwareRenderer->d.disableBG) {
GBVideoSoftwareRendererDrawBackground(softwareRenderer, maps, startX, softwareRenderer->wx - 7, softwareRenderer->scx - softwareRenderer->offsetScx, softwareRenderer->scy + y - softwareRenderer->offsetScy);
int wx = softwareRenderer->wx - 7;
if (GBRegisterLCDCIsWindow(softwareRenderer->lcdc) && wy == y && wx <= endX) {
softwareRenderer->hasWindow = true;
}
if (softwareRenderer->hasWindow && wx <= endX) {
if (wx > 0 && !softwareRenderer->d.disableBG) {
GBVideoSoftwareRendererDrawBackground(softwareRenderer, maps, startX, wx, softwareRenderer->scx - softwareRenderer->offsetScx, softwareRenderer->scy + y - softwareRenderer->offsetScy);
}
maps = &softwareRenderer->d.vram[GB_BASE_MAP];