GBA Video: Fix Window on tall displays

This commit is contained in:
Vicki Pfau 2017-03-13 12:07:40 -07:00
parent 2c8068f418
commit 62b5ca0aa8
2 changed files with 11 additions and 11 deletions

View File

@ -168,7 +168,7 @@ struct GBAVideoSoftwareRenderer {
int start; int start;
int end; int end;
int masterEnd; int masterEnd;
int masterHeight; unsigned masterHeight;
int masterScanlines; int masterScanlines;
int masterBright; int masterBright;

View File

@ -310,26 +310,26 @@ static uint16_t GBAVideoSoftwareRendererWriteVideoRegister(struct GBAVideoRender
case REG_WIN0V: case REG_WIN0V:
softwareRenderer->winN[0].v.end = value; softwareRenderer->winN[0].v.end = value;
softwareRenderer->winN[0].v.start = value >> 8; softwareRenderer->winN[0].v.start = value >> 8;
if (softwareRenderer->winN[0].v.start > VIDEO_VERTICAL_PIXELS && softwareRenderer->winN[0].v.start > softwareRenderer->winN[0].v.end) { if (softwareRenderer->winN[0].v.start > softwareRenderer->masterHeight && softwareRenderer->winN[0].v.start > softwareRenderer->winN[0].v.end) {
softwareRenderer->winN[0].v.start = 0; softwareRenderer->winN[0].v.start = 0;
} }
if (softwareRenderer->winN[0].v.end > VIDEO_VERTICAL_PIXELS) { if (softwareRenderer->winN[0].v.end > softwareRenderer->masterHeight) {
softwareRenderer->winN[0].v.end = VIDEO_VERTICAL_PIXELS; softwareRenderer->winN[0].v.end = softwareRenderer->masterHeight;
if (softwareRenderer->winN[0].v.start > VIDEO_VERTICAL_PIXELS) { if (softwareRenderer->winN[0].v.start > softwareRenderer->masterHeight) {
softwareRenderer->winN[0].v.start = VIDEO_VERTICAL_PIXELS; softwareRenderer->winN[0].v.start = softwareRenderer->masterHeight;
} }
} }
break; break;
case REG_WIN1V: case REG_WIN1V:
softwareRenderer->winN[1].v.end = value; softwareRenderer->winN[1].v.end = value;
softwareRenderer->winN[1].v.start = value >> 8; softwareRenderer->winN[1].v.start = value >> 8;
if (softwareRenderer->winN[1].v.start > VIDEO_VERTICAL_PIXELS && softwareRenderer->winN[1].v.start > softwareRenderer->winN[1].v.end) { if (softwareRenderer->winN[1].v.start > softwareRenderer->masterHeight && softwareRenderer->winN[1].v.start > softwareRenderer->winN[1].v.end) {
softwareRenderer->winN[1].v.start = 0; softwareRenderer->winN[1].v.start = 0;
} }
if (softwareRenderer->winN[1].v.end > VIDEO_VERTICAL_PIXELS) { if (softwareRenderer->winN[1].v.end > softwareRenderer->masterHeight) {
softwareRenderer->winN[1].v.end = VIDEO_VERTICAL_PIXELS; softwareRenderer->winN[1].v.end = softwareRenderer->masterHeight;
if (softwareRenderer->winN[1].v.start > VIDEO_VERTICAL_PIXELS) { if (softwareRenderer->winN[1].v.start > softwareRenderer->masterHeight) {
softwareRenderer->winN[1].v.start = VIDEO_VERTICAL_PIXELS; softwareRenderer->winN[1].v.start = softwareRenderer->masterHeight;
} }
} }
break; break;