diff --git a/src/nostalgia/modules/gfx/src/gfx-gba.cpp b/src/nostalgia/modules/gfx/src/gfx-gba.cpp index 766f74b4..e7db12d8 100644 --- a/src/nostalgia/modules/gfx/src/gfx-gba.cpp +++ b/src/nostalgia/modules/gfx/src/gfx-gba.cpp @@ -321,23 +321,23 @@ void showSprite(Context&, unsigned const idx) noexcept { }); } -void setSprite(Context&, uint_t const idx, Sprite const &s) noexcept { +void setSprite(Context&, uint_t const idx, Sprite const &sprite) noexcept { //oxAssert(g_spriteUpdates < config::GbaSpriteBufferLen, "Sprite update buffer overflow"); - uint16_t const eightBpp = s.bpp == 8; + uint16_t const eightBpp = sprite.bpp == 8; teagba::addSpriteUpdate({ .attr0 = static_cast( - (static_cast(s.y & ox::onMask(0b111'1111))) + (static_cast(sprite.y & ox::onMask(0b111'1111))) | (static_cast(1) << 10) // enable alpha | (static_cast(eightBpp) << 13) - | (static_cast(s.spriteShape) << 14)), + | (static_cast(sprite.spriteShape) << 14)), .attr1 = static_cast( - (static_cast(s.x) & ox::onMask(8)) - | (static_cast(s.flipX) << 12) - | (static_cast(s.spriteSize) << 14)), + (static_cast(sprite.x) & ox::onMask(8)) + | (static_cast(sprite.flipX) << 12) + | (static_cast(sprite.spriteSize) << 14)), .attr2 = static_cast( // double tileIdx if 8 bpp - (static_cast((s.tileIdx * (1 + eightBpp)) & ox::onMask(8))) - | (static_cast(s.priority & 0b11) << 10)), + (static_cast((sprite.tileIdx * (1 + eightBpp)) & ox::onMask(8))) + | (static_cast(sprite.priority & 0b11) << 10)), .idx = static_cast(idx), }); } @@ -350,7 +350,7 @@ uint_t spriteCount(Context const &) noexcept { namespace ox { -void panic(char const *file, int line, char const *panicMsg, ox::Error const &err) noexcept { +void panic(char const*panicMsg, Error const&err, std::source_location const &src) noexcept { using namespace nostalgia::gfx; // reset heap to make sure we have enough memory to allocate context data OX_ALLOW_UNSAFE_BUFFERS_BEGIN @@ -374,7 +374,7 @@ void panic(char const *file, int line, char const *panicMsg, ox::Error const &er } consoleWrite(*ctx, 32 + 1, 15, "PLEASE RESTART THE SYSTEM"); // print to terminal if in mGBA - oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", file, line, panicMsg); + oxErrf("\033[31;1;1mPANIC:\033[0m [{}:{}]: {}\n", src.file_name(), src.line(), panicMsg); if (err.msg) { oxErrf("\tError Message:\t{}\n", err.msg); }