[teagba] Add set and scroll background offset functions
All checks were successful
Build / build (push) Successful in 1m15s

This commit is contained in:
2025-07-29 00:33:51 -05:00
parent fd610454d6
commit e27eee50f0
3 changed files with 45 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ namespace teagba {
static ox::Array<GbaSpriteAttrUpdate, 128> g_spriteBuffer;
GbaSpriteAttrUpdate &spriteAttr(size_t i) noexcept {
GbaSpriteAttrUpdate &spriteAttr(size_t const i) noexcept {
return g_spriteBuffer[i];
}
@@ -29,4 +29,16 @@ void applySpriteUpdates() noexcept {
}
}
void setBgOffset(uint16_t const bg, int16_t const x, int16_t const y) noexcept {
auto &o = regBgOfs(bg);
o.x = x;
o.y = y;
}
void scrollBgOffset(uint16_t const bg, int16_t const x, int16_t const y) noexcept {
auto &o = regBgOfs(bg);
o.x = o.x + x;
o.y = o.y + y;
}
}