diff options
Diffstat (limited to 'arm9/lib/include/GX_g2.h')
-rw-r--r-- | arm9/lib/include/GX_g2.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arm9/lib/include/GX_g2.h b/arm9/lib/include/GX_g2.h index d1d1c82c..372be12b 100644 --- a/arm9/lib/include/GX_g2.h +++ b/arm9/lib/include/GX_g2.h @@ -2,6 +2,7 @@ #define GUARD_GX_G2_H #include "fx.h" +#include "registers.h" void G2x_SetBGyAffine_(u32 *ptr, struct Mtx22 *mtx, fx32 a, fx32 b, fx32 c, fx32 d); void G2x_SetBlendAlpha_(u32 *ptr, fx32 a, fx32 b, fx32 c, fx32 d); @@ -9,6 +10,39 @@ void G2x_SetBlendBrightness_(u16 *ptr, fx32 a, fx32 brightness); void G2x_SetBlendBrightnessExt_(u16 *ptr, fx32 a, fx32 b, fx32 c, fx32 d, fx32 brightness); void G2x_ChangeBlendBrightness_(u16 *ptr, fx32 brightness); +typedef struct +{ + u8 planeMask:5; + u8 effect:1; + u8 _reserve:2; +} + GXWndPlane; + +typedef enum +{ + GX_WND_PLANEMASK_NONE = 0x0000, + GX_WND_PLANEMASK_BG0 = 0x0001, + GX_WND_PLANEMASK_BG1 = 0x0002, + GX_WND_PLANEMASK_BG2 = 0x0004, + GX_WND_PLANEMASK_BG3 = 0x0008, + GX_WND_PLANEMASK_OBJ = 0x0010 +} + GXWndPlaneMask; + +static inline void G2_SetWndOutsidePlane(int wnd, BOOL effect) +{ + u32 tmp; + + tmp = ((reg_G2_WINOUT & ~REG_G2_WINOUT_WINOUT_MASK) | ((u32)wnd << REG_G2_WINOUT_WINOUT_SHIFT)); + + if (effect) + { + tmp |= (0x20 << REG_G2_WINOUT_WINOUT_SHIFT); // EFCT + } + + reg_G2_WINOUT = (u16)tmp; +} + //The g2 and g2_oam headers contain a lot of inline functions and enums that may want to be ported over at some point #endif //GUARD_GX_G2_H |