[nostaliga/core/gba] Cleanup
This commit is contained in:
parent
745ea4a0ed
commit
0318ba92ce
@ -22,7 +22,7 @@ using interrupt_handler = void (*)(void);
|
|||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
// Display Registers
|
// 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_DISPSTAT *reinterpret_cast<volatile uint32_t*>(0x04000004)
|
||||||
#define REG_VCOUNT *reinterpret_cast<volatile uint32_t*>(0x04000006)
|
#define REG_VCOUNT *reinterpret_cast<volatile uint32_t*>(0x04000006)
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ using interrupt_handler = void (*)(void);
|
|||||||
// background registers
|
// background registers
|
||||||
|
|
||||||
// background control registers
|
// background control registers
|
||||||
#define REG_BG0CNT *reinterpret_cast<volatile uint32_t*>(0x04000008)
|
#define REG_BG0CTL *reinterpret_cast<volatile uint32_t*>(0x04000008)
|
||||||
#define REG_BG1CNT *reinterpret_cast<volatile uint32_t*>(0x0400000a)
|
#define REG_BG1CTL *reinterpret_cast<volatile uint32_t*>(0x0400000a)
|
||||||
#define REG_BG2CNT *reinterpret_cast<volatile uint32_t*>(0x0400000c)
|
#define REG_BG2CTL *reinterpret_cast<volatile uint32_t*>(0x0400000c)
|
||||||
#define REG_BG3CNT *reinterpret_cast<volatile uint32_t*>(0x0400000e)
|
#define REG_BG3CTL *reinterpret_cast<volatile uint32_t*>(0x0400000e)
|
||||||
|
|
||||||
// background horizontal scrolling registers
|
// background horizontal scrolling registers
|
||||||
#define REG_BG0HOFS *reinterpret_cast<volatile uint32_t*>(0x04000010)
|
#define REG_BG0HOFS *reinterpret_cast<volatile uint32_t*>(0x04000010)
|
||||||
|
@ -90,7 +90,7 @@ ox::Error initGfx(Context*) {
|
|||||||
/* Background 0 -\|| */
|
/* Background 0 -\|| */
|
||||||
/* Objects -----\||| */
|
/* Objects -----\||| */
|
||||||
/* |||| */
|
/* |||| */
|
||||||
REG_DISPCNT = 0x1101;
|
REG_DISPCTL = 0x1101;
|
||||||
// tell display to trigger vblank interrupts
|
// tell display to trigger vblank interrupts
|
||||||
REG_DISPSTAT |= DispStat_irq_vblank;
|
REG_DISPSTAT |= DispStat_irq_vblank;
|
||||||
// enable vblank interrupt
|
// enable vblank interrupt
|
||||||
@ -105,16 +105,16 @@ ox::Error shutdownGfx(Context*) {
|
|||||||
[[nodiscard]] constexpr volatile uint32_t &bgCtl(int bg) noexcept {
|
[[nodiscard]] constexpr volatile uint32_t &bgCtl(int bg) noexcept {
|
||||||
switch (bg) {
|
switch (bg) {
|
||||||
case 0:
|
case 0:
|
||||||
return REG_BG0CNT;
|
return REG_BG0CTL;
|
||||||
case 1:
|
case 1:
|
||||||
return REG_BG1CNT;
|
return REG_BG1CTL;
|
||||||
case 2:
|
case 2:
|
||||||
return REG_BG2CNT;
|
return REG_BG2CTL;
|
||||||
case 3:
|
case 3:
|
||||||
return REG_BG3CNT;
|
return REG_BG3CTL;
|
||||||
default:
|
default:
|
||||||
oxPanic(OxError(1), "Looking up non-existent register");
|
oxPanic(OxError(1), "Looking up non-existent register");
|
||||||
return REG_BG0CNT;
|
return REG_BG0CTL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user