From 2ce017b555088fc84fa5e37f81762c5c2a6e5d92 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sun, 22 Sep 2013 03:00:43 -0700 Subject: [PATCH] Fix WIN0H writing with overlapping values --- src/gba/renderers/video-software.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 82648bae6..29d28afdd 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -248,7 +248,7 @@ static uint16_t GBAVideoSoftwareRendererWriteVideoRegister(struct GBAVideoRender break; case REG_WIN0H: softwareRenderer->win0H.packed = value; - if (softwareRenderer->win0H.start >= softwareRenderer->win0H.end || softwareRenderer->win0H.end > VIDEO_HORIZONTAL_PIXELS) { + if (softwareRenderer->win0H.start > softwareRenderer->win0H.end || softwareRenderer->win0H.end > VIDEO_HORIZONTAL_PIXELS) { softwareRenderer->win0H.end = VIDEO_HORIZONTAL_PIXELS; } if (softwareRenderer->win0H.start >= VIDEO_HORIZONTAL_PIXELS) {