[nostaliga/core/gba] Cleanup

This commit is contained in:
Gary Talent 2020-07-14 01:18:49 -05:00
parent 745ea4a0ed
commit 0318ba92ce
2 changed files with 11 additions and 11 deletions

View File

@ -22,7 +22,7 @@ using interrupt_handler = void (*)(void);
/////////////////////////////////////////////////////////////////
// Display Registers
#define REG_DISPCNT *reinterpret_cast<volatile uint32_t*>(0x04000000)
#define REG_DISPCTL *reinterpret_cast<volatile uint32_t*>(0x04000000)
#define REG_DISPSTAT *reinterpret_cast<volatile uint32_t*>(0x04000004)
#define REG_VCOUNT *reinterpret_cast<volatile uint32_t*>(0x04000006)
@ -45,10 +45,10 @@ using interrupt_handler = void (*)(void);
// background registers
// background control registers
#define REG_BG0CNT *reinterpret_cast<volatile uint32_t*>(0x04000008)
#define REG_BG1CNT *reinterpret_cast<volatile uint32_t*>(0x0400000a)
#define REG_BG2CNT *reinterpret_cast<volatile uint32_t*>(0x0400000c)
#define REG_BG3CNT *reinterpret_cast<volatile uint32_t*>(0x0400000e)
#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)
// background horizontal scrolling registers
#define REG_BG0HOFS *reinterpret_cast<volatile uint32_t*>(0x04000010)

View File

@ -90,7 +90,7 @@ ox::Error initGfx(Context*) {
/* Background 0 -\|| */
/* Objects -----\||| */
/* |||| */
REG_DISPCNT = 0x1101;
REG_DISPCTL = 0x1101;
// tell display to trigger vblank interrupts
REG_DISPSTAT |= DispStat_irq_vblank;
// enable vblank interrupt
@ -105,16 +105,16 @@ ox::Error shutdownGfx(Context*) {
[[nodiscard]] constexpr volatile uint32_t &bgCtl(int bg) noexcept {
switch (bg) {
case 0:
return REG_BG0CNT;
return REG_BG0CTL;
case 1:
return REG_BG1CNT;
return REG_BG1CTL;
case 2:
return REG_BG2CNT;
return REG_BG2CTL;
case 3:
return REG_BG3CNT;
return REG_BG3CTL;
default:
oxPanic(OxError(1), "Looking up non-existent register");
return REG_BG0CNT;
return REG_BG0CTL;
}
}