From ac4ae6d4e66b8a03751d634a8ef252ad3372e6f6 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 13 Aug 2016 17:46:57 -0700 Subject: [PATCH] GB: Fix palette I/O writeback when not incrementing --- src/gb/video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gb/video.c b/src/gb/video.c index 78ae8430f..14ddd2082 100644 --- a/src/gb/video.c +++ b/src/gb/video.c @@ -356,8 +356,8 @@ void GBVideoWritePalette(struct GBVideo* video, uint16_t address, uint8_t value) video->bcpIndex &= 0x3F; video->p->memory.io[REG_BCPS] &= 0x80; video->p->memory.io[REG_BCPS] |= video->bcpIndex; - video->p->memory.io[REG_BCPD] = video->palette[video->bcpIndex >> 1] >> (8 * (video->bcpIndex & 1)); } + video->p->memory.io[REG_BCPD] = video->palette[video->bcpIndex >> 1] >> (8 * (video->bcpIndex & 1)); break; case REG_OCPD: if (video->ocpIndex & 1) { @@ -373,8 +373,8 @@ void GBVideoWritePalette(struct GBVideo* video, uint16_t address, uint8_t value) video->ocpIndex &= 0x3F; video->p->memory.io[REG_OCPS] &= 0x80; video->p->memory.io[REG_OCPS] |= video->ocpIndex; - video->p->memory.io[REG_OCPD] = video->palette[8 * 4 + (video->ocpIndex >> 1)] >> (8 * (video->ocpIndex & 1)); } + video->p->memory.io[REG_OCPD] = video->palette[8 * 4 + (video->ocpIndex >> 1)] >> (8 * (video->ocpIndex & 1)); break; } }