From 38ae11635634d33c95be05768706fd77c972b220 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 5 Dec 2019 23:36:49 -0600 Subject: [PATCH] [nostalgia/core/gba] Fix BPP setting in tile sheet loader --- src/nostalgia/core/gba/gfx.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nostalgia/core/gba/gfx.cpp b/src/nostalgia/core/gba/gfx.cpp index 795df8165..81678c855 100644 --- a/src/nostalgia/core/gba/gfx.cpp +++ b/src/nostalgia/core/gba/gfx.cpp @@ -54,9 +54,12 @@ ox::Error modelRead(T *io, GbaTileMapTarget *t) { uint8_t bpp; oxReturnError(io->field("bpp", &bpp)); constexpr auto Bpp8 = 1 << 7; - *t->bgCtl = (*t->bgCtl | Bpp8) ^ Bpp8; // set to use 4 bits per pixel - *t->bgCtl |= Bpp8; // set to use 8 bits per pixel *t->bgCtl = (28 << 8) | 1; + if (bpp == 4) { + *t->bgCtl |= (*t->bgCtl | Bpp8) ^ Bpp8; // set to use 4 bits per pixel + } else { + *t->bgCtl |= Bpp8; // set to use 8 bits per pixel + } oxReturnError(io->field("defaultPalette", &t->defaultPalette)); oxReturnError(io->field("pal", &t->pal));