[nostalgia/core/gba] Make BG CTLs uint16
This commit is contained in:
parent
56269004d7
commit
b36cd1694b
@ -45,10 +45,10 @@ using interrupt_handler = void (*)();
|
||||
// background registers
|
||||
|
||||
// background control registers
|
||||
#define REG_BG0CTL *reinterpret_cast<volatile uint32_t*>(0x04000008)
|
||||
#define REG_BG1CTL *reinterpret_cast<volatile uint32_t*>(0x0400000a)
|
||||
#define REG_BG2CTL *reinterpret_cast<volatile uint32_t*>(0x0400000c)
|
||||
#define REG_BG3CTL *reinterpret_cast<volatile uint32_t*>(0x0400000e)
|
||||
#define REG_BG0CTL *reinterpret_cast<volatile uint16_t*>(0x04000008)
|
||||
#define REG_BG1CTL *reinterpret_cast<volatile uint16_t*>(0x0400000a)
|
||||
#define REG_BG2CTL *reinterpret_cast<volatile uint16_t*>(0x0400000c)
|
||||
#define REG_BG3CTL *reinterpret_cast<volatile uint16_t*>(0x0400000e)
|
||||
|
||||
// background horizontal scrolling registers
|
||||
#define REG_BG0HOFS *reinterpret_cast<volatile uint32_t*>(0x04000010)
|
||||
|
@ -37,7 +37,7 @@ struct GbaTileMapTarget {
|
||||
static constexpr auto TypeName = NostalgiaGraphic::TypeName;
|
||||
static constexpr auto Fields = NostalgiaGraphic::Fields;
|
||||
static constexpr auto TypeVersion = NostalgiaGraphic::TypeVersion;
|
||||
volatile uint32_t *bgCtl = nullptr;
|
||||
volatile uint16_t *bgCtl = nullptr;
|
||||
ox::FileAddress defaultPalette;
|
||||
GbaPaletteTarget pal;
|
||||
volatile uint16_t *tileMap = nullptr;
|
||||
@ -132,7 +132,7 @@ void setBgStatus(Context*, unsigned bg, bool status) noexcept {
|
||||
}
|
||||
|
||||
[[nodiscard]]
|
||||
constexpr volatile uint32_t &bgCtl(int bg) noexcept {
|
||||
constexpr volatile uint16_t &bgCtl(int bg) noexcept {
|
||||
switch (bg) {
|
||||
case 0:
|
||||
return REG_BG0CTL;
|
||||
@ -244,7 +244,7 @@ void hideSprite(Context*, unsigned idx) noexcept {
|
||||
oa.attr0 = 2 << 8;
|
||||
oa.idx = idx;
|
||||
// block until g_spriteUpdates is less than buffer len
|
||||
if (g_spriteUpdates >= config::GbaSpriteBufferLen) {
|
||||
if (g_spriteUpdates >= config::GbaSpriteBufferLen) [[unlikely]] {
|
||||
nostalgia_core_vblankintrwait();
|
||||
}
|
||||
if constexpr(config::GbaEventLoopTimerBased) {
|
||||
@ -279,7 +279,7 @@ void setSprite(Context*,
|
||||
oa.attr2 = static_cast<uint16_t>(tileIdx & ox::onMask<uint16_t>(8));
|
||||
oa.idx = idx;
|
||||
// block until g_spriteUpdates is less than buffer len
|
||||
if (g_spriteUpdates >= config::GbaSpriteBufferLen) {
|
||||
if (g_spriteUpdates >= config::GbaSpriteBufferLen) [[unlikely]] {
|
||||
nostalgia_core_vblankintrwait();
|
||||
}
|
||||
if constexpr(config::GbaEventLoopTimerBased) {
|
||||
|
Loading…
Reference in New Issue
Block a user