From c5f76ff558c3408389842f552481dfe01347100b Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 23 Dec 2023 21:33:52 -0600 Subject: [PATCH] [nostalgia/core] Add setBgBpp function --- src/nostalgia/modules/core/src/gba/gfx.cpp | 5 +++++ src/nostalgia/modules/core/src/opengl/gfx.cpp | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/nostalgia/modules/core/src/gba/gfx.cpp b/src/nostalgia/modules/core/src/gba/gfx.cpp index aade7c37..39530f60 100644 --- a/src/nostalgia/modules/core/src/gba/gfx.cpp +++ b/src/nostalgia/modules/core/src/gba/gfx.cpp @@ -311,6 +311,11 @@ void setBgStatus(Context&, unsigned bg, bool status) noexcept { REG_DISPCTL = REG_DISPCTL | ((REG_DISPCTL & ~mask) | mask); } +void setBgBpp(Context&, unsigned bgIdx, unsigned bpp) noexcept { + auto &bgCtl = regBgCtl(bgIdx); + teagba::bgSetBpp(bgCtl, bpp); +} + void setBgCbb(Context &ctx, unsigned bgIdx, unsigned cbb) noexcept { auto &bgCtl = regBgCtl(bgIdx); const auto &cbbData = ctx.cbbData[cbb]; diff --git a/src/nostalgia/modules/core/src/opengl/gfx.cpp b/src/nostalgia/modules/core/src/opengl/gfx.cpp index 57d9100e..188251a3 100644 --- a/src/nostalgia/modules/core/src/opengl/gfx.cpp +++ b/src/nostalgia/modules/core/src/opengl/gfx.cpp @@ -628,10 +628,12 @@ bool bgStatus(Context &ctx, uint_t bg) noexcept { return ctx.backgrounds[bg].enabled; } -void setBgStatus(Context &ctx, uint_t bg, bool status) noexcept { +void setBgStatus(Context&ctx, uint_t bg, bool status) noexcept { ctx.backgrounds[bg].enabled = status; } +void setBgBpp(Context&, unsigned, unsigned) noexcept {} + void setBgCbb(Context &ctx, uint_t bgIdx, uint_t cbbIdx) noexcept { auto &bg = ctx.backgrounds[bgIdx]; bg.cbbIdx = cbbIdx;