From e29c9e21ba9b64c86ac677b2bf4a69e92e8ac34b Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Fri, 4 Jun 2021 18:37:08 -0400 Subject: Port more inlines from gx lib --- arm9/lib/include/gx.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'arm9/lib/include/gx.h') diff --git a/arm9/lib/include/gx.h b/arm9/lib/include/gx.h index acd23b39..7ba8d1f3 100644 --- a/arm9/lib/include/gx.h +++ b/arm9/lib/include/gx.h @@ -186,4 +186,34 @@ static inline void GX_SetMasterBrightness(int brightness) GXx_SetMasterBrightness_(®_GX_MASTER_BRIGHT, brightness); } +static inline void GX_SetVisiblePlane(int plane) +{ + reg_GX_DISPCNT = (u32)((reg_GX_DISPCNT & ~REG_GX_DISPCNT_DISPLAY_MASK) | (plane << REG_GX_DISPCNT_DISPLAY_SHIFT)); +} + +static inline void GXS_SetVisiblePlane(int plane) +{ + reg_GXS_DB_DISPCNT = (u32)((reg_GXS_DB_DISPCNT & ~REG_GXS_DB_DISPCNT_DISPLAY_MASK) | (plane << REG_GXS_DB_DISPCNT_DISPLAY_SHIFT)); +} + +static inline void GXS_DispOn(void) +{ + reg_GXS_DB_DISPCNT |= REG_GXS_DB_DISPCNT_MODE_MASK; +} + +static inline void GX_SetDispSelect(GXDispSelect sel) +{ + reg_GX_POWCNT = (u16)((reg_GX_POWCNT & ~REG_GX_POWCNT_DSEL_MASK) | (sel << REG_GX_POWCNT_DSEL_SHIFT)); +} + +static inline void GX_SetBGScrOffset(GXBGScrOffset offset) +{ + reg_GX_DISPCNT = (u32)((reg_GX_DISPCNT & ~REG_GX_DISPCNT_BGSCREENOFFSET_MASK) | (offset << REG_GX_DISPCNT_BGSCREENOFFSET_SHIFT)); +} + +static inline void GX_SetBGCharOffset(GXBGCharOffset offset) +{ + reg_GX_DISPCNT = (u32)((reg_GX_DISPCNT & ~REG_GX_DISPCNT_BGCHAROFFSET_MASK) | (offset << REG_GX_DISPCNT_BGCHAROFFSET_SHIFT)); +} + #endif //GUARD_GX_H -- cgit v1.2.3 From c87b617058767519480ef2d19e233fe0e99ca01d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 5 Jun 2021 16:55:46 -0400 Subject: Fix GX_vramcnt symbol names --- arm9/lib/include/gx.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arm9/lib/include/gx.h') diff --git a/arm9/lib/include/gx.h b/arm9/lib/include/gx.h index 7ba8d1f3..cce14e57 100644 --- a/arm9/lib/include/gx.h +++ b/arm9/lib/include/gx.h @@ -216,4 +216,14 @@ static inline void GX_SetBGCharOffset(GXBGCharOffset offset) reg_GX_DISPCNT = (u32)((reg_GX_DISPCNT & ~REG_GX_DISPCNT_BGCHAROFFSET_MASK) | (offset << REG_GX_DISPCNT_BGCHAROFFSET_SHIFT)); } +static inline void GX_SetVisibleWnd(int window) +{ + reg_GX_DISPCNT = (u32)((reg_GX_DISPCNT & ~(REG_GX_DISPCNT_W0_MASK | REG_GX_DISPCNT_W1_MASK | REG_GX_DISPCNT_OW_MASK)) | (window << REG_GX_DISPCNT_W0_SHIFT)); +} + +static inline void GXS_SetVisibleWnd(int window) +{ + reg_GXS_DB_DISPCNT = (u32)((reg_GXS_DB_DISPCNT & ~(REG_GXS_DB_DISPCNT_W0_MASK | REG_GXS_DB_DISPCNT_W1_MASK | REG_GXS_DB_DISPCNT_OW_MASK)) | (window << REG_GXS_DB_DISPCNT_W0_SHIFT)); +} + #endif //GUARD_GX_H -- cgit v1.2.3