mirror of
https://github.com/zeldaret/st
synced 2026-06-18 15:35:30 -04:00
Make hex number case more consistent (#83)
* consistent hex in vfunc names * consistent hex in code * Actor_c4 -> Actor_C4, Actor_9c -> Actor_9C
This commit is contained in:
@@ -12,12 +12,12 @@ extern "C" {
|
||||
#define CARD_BACKUP_TYPE_FRAM 3
|
||||
|
||||
#define CARD_BACKUP_TYPE_EEPROM_4KBITS (0x900 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_EEPROM_64KBITS (0xd00 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_EEPROM_64KBITS (0xD00 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_EEPROM_512KBITS (0x1000 | CARD_BACKUP_TYPE_EEPROM)
|
||||
#define CARD_BACKUP_TYPE_FLASH_2MBITS (0x1200 | CARD_BACKUP_TYPE_FLASH)
|
||||
#define CARD_BACKUP_TYPE_FLASH_4MBITS (0x1300 | CARD_BACKUP_TYPE_FLASH)
|
||||
#define CARD_BACKUP_TYPE_FLASH_8MBITS (0x1400 | CARD_BACKUP_TYPE_FLASH)
|
||||
#define CARD_BACKUP_TYPE_FRAM_256KBITS (0xf00 | CARD_BACKUP_TYPE_FRAM)
|
||||
#define CARD_BACKUP_TYPE_FRAM_256KBITS (0xF00 | CARD_BACKUP_TYPE_FRAM)
|
||||
|
||||
// TODO: Find values for these
|
||||
#define CARD_RESULT_SUCCESS 0
|
||||
@@ -36,9 +36,9 @@ void CARD_LockBackup(u16 cardId);
|
||||
void CARD_UnlockBackup(u16 cardId);
|
||||
BOOL CARD_IdentifyBackup(CARDBackupType type);
|
||||
CARDBackupType CARD_GetBackupType();
|
||||
#define CARD_IsBackupEeprom() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_EEPROM
|
||||
#define CARD_IsBackupFlash() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_FLASH
|
||||
#define CARD_IsBackupFram() (CARD_GetBackupType() & 0xff) == CARD_BACKUP_TYPE_FRAM
|
||||
#define CARD_IsBackupEeprom() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_EEPROM
|
||||
#define CARD_IsBackupFlash() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_FLASH
|
||||
#define CARD_IsBackupFram() (CARD_GetBackupType() & 0xFF) == CARD_BACKUP_TYPE_FRAM
|
||||
BOOL CARD_ReadWriteBackupAsync(u32 offset, void *buf, u32 size, void *, void *, u32, u32, u32, u32);
|
||||
void CARD_WaitBackupAsync(void);
|
||||
CARDResult CARD_GetResultCode(void);
|
||||
|
||||
@@ -51,103 +51,103 @@ inline void G2S_SetBG3Priority(u32 value) {
|
||||
}
|
||||
|
||||
inline void G2_SetBG0Offset(u32 x, u32 y) {
|
||||
REG_BG0OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG0OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG1Offset(u32 x, u32 y) {
|
||||
REG_BG1OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG1OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2Offset(u32 x, u32 y) {
|
||||
REG_BG2OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG2OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3Offset(u32 x, u32 y) {
|
||||
REG_BG3OFS = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG3OFS = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG0Offset(u32 x, u32 y) {
|
||||
REG_BG0OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG0OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG1Offset(u32 x, u32 y) {
|
||||
REG_BG1OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG1OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2Offset(u32 x, u32 y) {
|
||||
REG_BG2OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG2OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3Offset(u32 x, u32 y) {
|
||||
REG_BG3OFS_SUB = (x & 0x1ff) | ((y << 16) & 0x1ff0000);
|
||||
REG_BG3OFS_SUB = (x & 0x1FF) | ((y << 16) & 0x1FF0000);
|
||||
}
|
||||
|
||||
inline void G2_SetBG0Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG0CNT = (REG_BG0CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG0CNT = (REG_BG0CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG1Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG1CNT = (REG_BG1CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG1CNT = (REG_BG1CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase, u32) {
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG0Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG0CNT_SUB = (REG_BG0CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG0CNT_SUB = (REG_BG0CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG1Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG1CNT_SUB = (REG_BG1CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG1CNT_SUB = (REG_BG1CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3Control(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase,
|
||||
u32) {
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | (colMode << 0x7) | (scrBase << 0x8) | (charBase << 0x2);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3Control256Bmp(GXBGScrSize256Bmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | 0x80 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | 0x80 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT = (REG_BG2CNT & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG3ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT = (REG_BG3CNT & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG2ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG2CNT_SUB = (REG_BG2CNT_SUB & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2S_SetBG3ControlDCBmp(GXBGScrSizeDcBmp scrSize, GXBGAreaOver areaOver, GXBGBmpScrBase scrBase) {
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xe) | 0x84 | (scrBase << 0x8) | (areaOver << 0xd);
|
||||
REG_BG3CNT_SUB = (REG_BG3CNT_SUB & 0x43) | (scrSize << 0xE) | 0x84 | (scrBase << 0x8) | (areaOver << 0xD);
|
||||
}
|
||||
|
||||
inline void G2_SetBG2ControlText(GXBGScrSizeText scrSize, GXBGColorMode colMode, GXBGScrBase scrBase, GXBGCharBase charBase) {
|
||||
@@ -287,16 +287,16 @@ inline void G2S_SetBlendAlpha(u32 srcPlane, u32 dstPlane, u32 srcAlpha, u32 dstA
|
||||
}
|
||||
|
||||
inline void G2_GetOBJPosition(GXOamAttr *oam, u32 *x, u32 *y) {
|
||||
*x = (oam->attr01 & 0x1ff0000) >> 16;
|
||||
*y = oam->attr01 & 0xff;
|
||||
*x = (oam->attr01 & 0x1FF0000) >> 16;
|
||||
*y = oam->attr01 & 0xFF;
|
||||
}
|
||||
|
||||
inline void G2_SetOBJPosition(GXOamAttr *oam, u32 x, u32 y) {
|
||||
oam->attr01 = (oam->attr01 & 0xfe00ff00) | (y & 0xff) | (x << 0x17 >> 0x7);
|
||||
oam->attr01 = (oam->attr01 & 0xFE00FF00) | (y & 0xFF) | (x << 0x17 >> 0x7);
|
||||
}
|
||||
|
||||
inline u32 G2_GetOBJCharName(GXOamAttr *oam) {
|
||||
return oam->attr2 & 0x3ff;
|
||||
return oam->attr2 & 0x3FF;
|
||||
}
|
||||
|
||||
inline void G2_SetOBJCharName(volatile GXOamAttr *oam, u32 name) {
|
||||
@@ -304,18 +304,18 @@ inline void G2_SetOBJCharName(volatile GXOamAttr *oam, u32 name) {
|
||||
}
|
||||
|
||||
inline u32 G2_GetOBJColorParam(GXOamAttr *oam) {
|
||||
return (oam->attr2 & 0xf000) >> 0xc;
|
||||
return (oam->attr2 & 0xF000) >> 0xC;
|
||||
}
|
||||
|
||||
// Defined as macro as sometimes `oam` is volatile and other times not
|
||||
#define G2_GetOBJMode(oam) (GXOamMode)(((oam)->attr01 & 0xc00) >> 0xa)
|
||||
#define G2_GetOBJMode(oam) (GXOamMode)(((oam)->attr01 & 0xC00) >> 0xA)
|
||||
// inline GXOamMode G2_GetOBJMode(volatile GXOamAttr *oam) {
|
||||
// return ((oam)->attr01 & 0xc00) >> 0xa;
|
||||
// return ((oam)->attr01 & 0xC00) >> 0xA;
|
||||
// }
|
||||
|
||||
inline void G2_SetOBJMode(GXOamAttr *oam, GXOamMode mode, u32 color) {
|
||||
oam->attr01 = (oam->attr01 & ~0xc00) | (mode << 0xa);
|
||||
oam->attr2 = (oam->attr2 & ~0xf000) | (color << 0xc);
|
||||
oam->attr01 = (oam->attr01 & ~0xC00) | (mode << 0xA);
|
||||
oam->attr2 = (oam->attr2 & ~0xF000) | (color << 0xC);
|
||||
}
|
||||
|
||||
inline void G2_SetOBJPriority(GXOamAttr *oam, u32 prio) {
|
||||
@@ -328,12 +328,12 @@ inline void G2_SetOBJAttr(GXOamAttr *oam, u32 x, u32 y, u32 param4, GXOamMode mo
|
||||
|
||||
// c1ff0cff
|
||||
// 3 bits at 0x8
|
||||
// 4 bits at 0xc
|
||||
// 4 bits at 0xC
|
||||
// 5 bits at 0x19
|
||||
oam->attr01 = (y & 0xff) | (mode << 0xa) | (shape << 0x1e) | ((x << 0x17) >> 0x7);
|
||||
oam->attr01 = (y & 0xFF) | (mode << 0xA) | (shape << 0x1E) | ((x << 0x17) >> 0x7);
|
||||
// f3ff
|
||||
// 2 bits at 0xa
|
||||
oam->attr2 = param10 | (color << 0xc);
|
||||
// 2 bits at 0xA
|
||||
oam->attr2 = param10 | (color << 0xC);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -28,7 +28,7 @@ inline void G3_TexImageParam(GXTexFmt fmt, u32 gen, GXTexSizeS sizeS, GXTexSizeT
|
||||
// S: sizeS
|
||||
// A: addr
|
||||
REG_GFX_FIFO_TEXTURE_PARAM =
|
||||
(fmt << 0x1a) | (addr << 0x3) | (gen << 0x1e) | (sizeS << 0x14) | (sizeT << 0x17) | (color0 << 0x1d);
|
||||
(fmt << 0x1A) | (addr << 0x3) | (gen << 0x1E) | (sizeS << 0x14) | (sizeT << 0x17) | (color0 << 0x1D);
|
||||
}
|
||||
inline void G3_TexPlttBase(u32 addr, GXTexFmt fmt) {
|
||||
REG_GFX_FIFO_TEXTURE_PALETTE = addr >> (4 - (fmt == 2));
|
||||
@@ -54,7 +54,7 @@ inline void G3_Translate(fx32 x, fx32 y, fx32 z) {
|
||||
inline void G3_ViewPort(u32 left, u32 top, u32 right, u32 bottom) {
|
||||
// Unclear how to combine the arguments
|
||||
// left = 0, top = 0, right = 255, bottom = 191 => 0x8000
|
||||
REG_GFX_FIFO_VIEWPORT = 0xbfff0000;
|
||||
REG_GFX_FIFO_VIEWPORT = 0xBFFF0000;
|
||||
}
|
||||
void _G3_Ortho(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, fx32 param7, BOOL param8, void *param9);
|
||||
inline void G3_Ortho(fx32 top, fx32 bottom, fx32 left, fx32 right, fx32 near, fx32 far, void *param7) {
|
||||
|
||||
@@ -8,15 +8,15 @@ extern "C" {
|
||||
#include "nitro/reg.h"
|
||||
#include "nitro/types.h"
|
||||
|
||||
#define GX_POWER_ALL 0x20e
|
||||
#define GX_POWER_ALL 0x20E
|
||||
|
||||
#define GX_DISP_SELECT_MAIN_SUB 0x8000
|
||||
#define GX_DISP_SELECT_SUB_MAIN 0
|
||||
#define GX_DISPMODE_GRAPHICS 1
|
||||
#define GX_DISPMODE_VRAM_C 0xa
|
||||
#define GX_DISPMODE_VRAM_D 0xe
|
||||
#define GX_DISPMODE_VRAM_C 0xA
|
||||
#define GX_DISPMODE_VRAM_D 0xE
|
||||
|
||||
#define GX_VRAM_LCDC_ALL 0x1ff
|
||||
#define GX_VRAM_LCDC_ALL 0x1FF
|
||||
#define GX_VRAM_LCDC_C 0x4
|
||||
#define GX_VRAM_LCDC_D 0x8
|
||||
|
||||
@@ -27,8 +27,8 @@ extern "C" {
|
||||
#define GX_VRAM_BG_128_D ((GXVRamBG) 0x8)
|
||||
#define GX_VRAM_BG_256_AB ((GXVRamBG) 0x3)
|
||||
#define GX_VRAM_BG_384_ABC ((GXVRamBG) 0x7)
|
||||
#define GX_VRAM_BG_384_ABD ((GXVRamBG) 0xb)
|
||||
#define GX_VRAM_BG_512_ABCD ((GXVRamBG) 0xf)
|
||||
#define GX_VRAM_BG_384_ABD ((GXVRamBG) 0xB)
|
||||
#define GX_VRAM_BG_512_ABCD ((GXVRamBG) 0xF)
|
||||
|
||||
#define GX_VRAM_SUB_BG_NONE ((GXVRamBG) 0)
|
||||
#define GX_VRAM_SUB_BG_32_H ((GXVRamBG) 0x80)
|
||||
@@ -140,7 +140,7 @@ extern "C" {
|
||||
|
||||
#define GX_OAM_SHAPE_64x64 0x3
|
||||
|
||||
#define GX_OAM_COLOR_16 0xf
|
||||
#define GX_OAM_COLOR_16 0xF
|
||||
|
||||
#define GX_TEXSIZE_S8 0
|
||||
#define GX_TEXSIZE_S16 0x1
|
||||
@@ -183,7 +183,7 @@ extern "C" {
|
||||
|
||||
#define GX_BEGIN_QUADS 0x1
|
||||
|
||||
#define GX_RGB(r, g, b) ((r) | ((g) << 0x5) | ((b) << 0xa))
|
||||
#define GX_RGB(r, g, b) ((r) | ((g) << 0x5) | ((b) << 0xA))
|
||||
|
||||
#define GX_CAPTURE_SIZE_256x192 -1 // unknown value
|
||||
#define GX_CAPTURE_MODE_A -1 // unknown value
|
||||
@@ -376,11 +376,11 @@ inline u16 GX_GetVCount(void) {
|
||||
}
|
||||
|
||||
inline void GX_SetVisiblePlane(s32 plane) {
|
||||
REG_DISPCNT = (REG_DISPCNT & ~0x1f00) | (plane << 8);
|
||||
REG_DISPCNT = (REG_DISPCNT & ~0x1F00) | (plane << 8);
|
||||
}
|
||||
|
||||
inline void GXS_SetVisiblePlane(s32 plane) {
|
||||
REG_DISPCNT_SUB = (REG_DISPCNT_SUB & ~0x1f00) | (plane << 8);
|
||||
REG_DISPCNT_SUB = (REG_DISPCNT_SUB & ~0x1F00) | (plane << 8);
|
||||
}
|
||||
|
||||
inline void GX_SetBGCharOffset(u32 offset) {
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct MBGameRegistry {
|
||||
/* 10 */ const char *iconPaletteFile;
|
||||
/* 14 */ u32 ggid;
|
||||
/* 18 */ u8 numPlayers;
|
||||
/* 19 */ u8 unk_19[0x3c - 0x19];
|
||||
/* 19 */ u8 unk_19[0x3C - 0x19];
|
||||
/* 3c */
|
||||
} MBGameRegistry;
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ extern "C" {
|
||||
#define PAD_ALL (PAD_BUTTON_ALL | PAD_KEY_ALL)
|
||||
|
||||
inline BOOL PAD_DetectFold(void) {
|
||||
return (REG_PAD & 0x8000) >> 0xf;
|
||||
return (REG_PAD & 0x8000) >> 0xF;
|
||||
}
|
||||
|
||||
inline u16 PAD_Read(void) {
|
||||
return ((REG_KEYINPUT | REG_PAD) ^ 0x2fff) & 0x2fff;
|
||||
return ((REG_KEYINPUT | REG_PAD) ^ 0x2FFF) & 0x2FFF;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -16,10 +16,10 @@ extern "C" {
|
||||
#define REG_DISPCAPCNT (*(vu32 *) 0x04000064)
|
||||
#define REG_GFX_STATUS (*(vu32 *) 0x04000600)
|
||||
|
||||
#define REG_DMA ((OSDma *) 0x040000b0)
|
||||
#define REG_DMA0SAD (*(vu32 *) 0x040000b0)
|
||||
#define REG_DMA0DAD (*(vu32 *) 0x040000b4)
|
||||
#define REG_DMA0CNT (*(vu32 *) 0x040000b8)
|
||||
#define REG_DMA ((OSDma *) 0x040000B0)
|
||||
#define REG_DMA0SAD (*(vu32 *) 0x040000B0)
|
||||
#define REG_DMA0DAD (*(vu32 *) 0x040000B4)
|
||||
#define REG_DMA0CNT (*(vu32 *) 0x040000B8)
|
||||
|
||||
#define REG_VRAM_CNT_ABCD (*(vu32 *) 0x04000240)
|
||||
#define REG_VRAM_CNT_A (*(vu8 *) 0x04000240)
|
||||
@@ -60,16 +60,16 @@ extern "C" {
|
||||
#define REG_GFX_FIFO_MATRIX_MODE (*(vu32 *) 0x04000440)
|
||||
#define REG_GFX_FIFO_MATRIX_PUSH (*(vu32 *) 0x04000444)
|
||||
#define REG_GFX_FIFO_MATRIX_POP (*(vu32 *) 0x04000448)
|
||||
#define REG_GFX_FIFO_MATRIX_STORE (*(vu32 *) 0x0400044c)
|
||||
#define REG_GFX_FIFO_MATRIX_STORE (*(vu32 *) 0x0400044C)
|
||||
#define REG_GFX_FIFO_MATRIX_RESTORE (*(vu32 *) 0x04000450)
|
||||
#define REG_GFX_FIFO_MATRIX_IDENTITY (*(vu32 *) 0x04000454)
|
||||
#define REG_GFX_FIFO_MATRIX_TRANSLATE (*(vu32 *) 0x04000470)
|
||||
#define REG_GFX_FIFO_VERTEX_COLOR (*(vu32 *) 0x04000480)
|
||||
#define REG_GFX_FIFO_VERTEX_TEXCOORD (*(vu32 *) 0x04000488)
|
||||
#define REG_GFX_FIFO_VERTEX_16 (*(vu32 *) 0x0400048c)
|
||||
#define REG_GFX_FIFO_POLYGON_ATTR (*(vu32 *) 0x040004a4)
|
||||
#define REG_GFX_FIFO_TEXTURE_PARAM (*(vu32 *) 0x040004a8)
|
||||
#define REG_GFX_FIFO_TEXTURE_PALETTE (*(vu32 *) 0x040004ac)
|
||||
#define REG_GFX_FIFO_VERTEX_16 (*(vu32 *) 0x0400048C)
|
||||
#define REG_GFX_FIFO_POLYGON_ATTR (*(vu32 *) 0x040004A4)
|
||||
#define REG_GFX_FIFO_TEXTURE_PARAM (*(vu32 *) 0x040004A8)
|
||||
#define REG_GFX_FIFO_TEXTURE_PALETTE (*(vu32 *) 0x040004AC)
|
||||
#define REG_GFX_FIFO_POLYGONS_BEGIN (*(vu32 *) 0x04000500)
|
||||
#define REG_GFX_FIFO_POLYGONS_END (*(vu32 *) 0x04000504)
|
||||
#define REG_GFX_FIFO_SWAP_BUFFERS (*(vu32 *) 0x04000540)
|
||||
@@ -84,32 +84,32 @@ extern u32 __DTCM_LO;
|
||||
|
||||
#define _REG_DISPCNT(base) (*(u32 *) ((base) | 0x0))
|
||||
#define _REG_BG0CNT(base) (*(vu16 *) ((base) | 0x8))
|
||||
#define _REG_BG1CNT(base) (*(vu16 *) ((base) | 0xa))
|
||||
#define _REG_BG2CNT(base) (*(vu16 *) ((base) | 0xc))
|
||||
#define _REG_BG3CNT(base) (*(vu16 *) ((base) | 0xe))
|
||||
#define _REG_BG1CNT(base) (*(vu16 *) ((base) | 0xA))
|
||||
#define _REG_BG2CNT(base) (*(vu16 *) ((base) | 0xC))
|
||||
#define _REG_BG3CNT(base) (*(vu16 *) ((base) | 0xE))
|
||||
#define _REG_BG0OFS(base) (*(u32 *) ((base) | 0x10))
|
||||
#define _REG_BG1OFS(base) (*(u32 *) ((base) | 0x14))
|
||||
#define _REG_BG2OFS(base) (*(u32 *) ((base) | 0x18))
|
||||
#define _REG_BG3OFS(base) (*(u32 *) ((base) | 0x1c))
|
||||
#define _REG_BG3OFS(base) (*(u32 *) ((base) | 0x1C))
|
||||
#define _REG_BG2PA(base) (*(u16 *) ((base) | 0x20))
|
||||
#define _REG_BG2PB(base) (*(u16 *) ((base) | 0x22))
|
||||
#define _REG_BG2PC(base) (*(u16 *) ((base) | 0x24))
|
||||
#define _REG_BG2PD(base) (*(u16 *) ((base) | 0x26))
|
||||
#define _REG_BG2X(base) (*(u32 *) ((base) | 0x28))
|
||||
#define _REG_BG2Y(base) (*(u32 *) ((base) | 0x2c))
|
||||
#define _REG_BG2Y(base) (*(u32 *) ((base) | 0x2C))
|
||||
#define _REG_BG3PA(base) (*(u16 *) ((base) | 0x30))
|
||||
#define _REG_BG3PB(base) (*(u16 *) ((base) | 0x32))
|
||||
#define _REG_BG3PC(base) (*(u16 *) ((base) | 0x34))
|
||||
#define _REG_BG3PD(base) (*(u16 *) ((base) | 0x36))
|
||||
#define _REG_BG3X(base) (*(u32 *) ((base) | 0x38))
|
||||
#define _REG_BG3Y(base) (*(u32 *) ((base) | 0x3c))
|
||||
#define _REG_BG3Y(base) (*(u32 *) ((base) | 0x3C))
|
||||
#define _REG_WININ(base) (*(u16 *) ((base) | 0x48))
|
||||
#define _REG_WINOUT(base) (*(u16 *) ((base) | 0x4a))
|
||||
#define _REG_MOSAIC(base) (*(u8 *) ((base) | 0x4c))
|
||||
#define _REG_OBJMOSAIC(base) (*(u8 *) ((base) | 0x4d))
|
||||
#define _REG_WINOUT(base) (*(u16 *) ((base) | 0x4A))
|
||||
#define _REG_MOSAIC(base) (*(u8 *) ((base) | 0x4C))
|
||||
#define _REG_OBJMOSAIC(base) (*(u8 *) ((base) | 0x4D))
|
||||
#define _REG_BLDCNT(base) (*(u16 *) ((base) | 0x50))
|
||||
#define _REG_BLDALPHA(base) (*(u16 *) ((base) | 0x52))
|
||||
#define _REG_MASTER_BRIGHT(base) (*(u16 *) ((base) | 0x6c))
|
||||
#define _REG_MASTER_BRIGHT(base) (*(u16 *) ((base) | 0x6C))
|
||||
|
||||
#define REG_DISPCNT _REG_DISPCNT(_MAIN_REG_BASE)
|
||||
#define REG_BG0CNT _REG_BG0CNT(_MAIN_REG_BASE)
|
||||
@@ -169,7 +169,7 @@ extern u32 __DTCM_LO;
|
||||
#define REG_BLDALPHA_SUB _REG_BLDALPHA(_SUB_REG_BASE)
|
||||
#define REG_MASTER_BRIGHT_SUB _REG_MASTER_BRIGHT(_SUB_REG_BASE)
|
||||
|
||||
#define REG_04FFF200 (*(vu32 *) 0x04fff200)
|
||||
#define REG_04FFF200 (*(vu32 *) 0x04FFF200)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
||||
@@ -10,7 +10,7 @@ extern "C" {
|
||||
#define SND_COMMAND_NOBLOCK 0
|
||||
#define SND_COMMAND_BLOCK 1
|
||||
|
||||
#define SND_TIMER_CLOCK 0xffb0ff
|
||||
#define SND_TIMER_CLOCK 0xFFB0FF
|
||||
|
||||
#define SND_WAVE_FORMAT_PCM16 1
|
||||
|
||||
@@ -22,13 +22,13 @@ typedef void (*SNDAlarmCallback)(void *arg);
|
||||
|
||||
typedef u32 SNDCommandType;
|
||||
enum SNDCommandType_ {
|
||||
SNDCommandType_StartTimer = 0xc,
|
||||
SNDCommandType_SetupChannelPcm = 0xe,
|
||||
SNDCommandType_StartTimer = 0xC,
|
||||
SNDCommandType_SetupChannelPcm = 0xE,
|
||||
SNDCommandType_SetupAlarm = 0x12,
|
||||
SNDCommandType_SetChannelVolume = 0x14,
|
||||
SNDCommandType_SetChannelPan = 0x15,
|
||||
SNDCommandType_LockChannel = 0x1a,
|
||||
SNDCommandType_Unk_1d = 0x1d,
|
||||
SNDCommandType_LockChannel = 0x1A,
|
||||
SNDCommandType_Unk_1d = 0x1D,
|
||||
};
|
||||
|
||||
typedef struct SNDCommand {
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define WM_SYSTEM_BUF_SIZE 0xf00
|
||||
#define WM_SYSTEM_BUF_SIZE 0xF00
|
||||
|
||||
#define WM_ERRCODE_SUCCESS 0
|
||||
#define WM_ERRCODE_FAILED 0x1
|
||||
#define WM_ERRCODE_ILLEGAL_STATE 0x3
|
||||
#define WM_ERRCODE_OPERATING 0x2
|
||||
#define WM_ERRCODE_TIMEOUT 0x9
|
||||
#define WM_ERRCODE_NO_ENTRY 0xb // may swap value with WM_ERRCODE_OVER_MAX_ENTRY
|
||||
#define WM_ERRCODE_OVER_MAX_ENTRY 0xc
|
||||
#define WM_ERRCODE_SEND_FAILED 0xf
|
||||
#define WM_ERRCODE_NO_ENTRY 0xB // may swap value with WM_ERRCODE_OVER_MAX_ENTRY
|
||||
#define WM_ERRCODE_OVER_MAX_ENTRY 0xC
|
||||
#define WM_ERRCODE_SEND_FAILED 0xF
|
||||
|
||||
#define WM_STATECODE_PARENT_START 0x0
|
||||
#define WM_STATECODE_PARENT_FOUND 0x5
|
||||
#define WM_STATECODE_MP_START 0xa
|
||||
#define WM_STATECODE_MP_START 0xA
|
||||
#define WM_STATECODE_CONNECTED 0x7
|
||||
#define WM_STATECODE_BEACON_LOST 0x8
|
||||
#define WM_STATECODE_DISCONNECTED 0x9
|
||||
@@ -47,7 +47,7 @@ typedef struct WMParentParam {
|
||||
/* 14 */ u16 KS_Flag;
|
||||
/* 16 */ u16 CS_Flag;
|
||||
/* 18 */ u16 beaconPeriod;
|
||||
/* 1a */ u8 unk_1a[0x32 - 0x1a];
|
||||
/* 1a */ u8 unk_1a[0x32 - 0x1A];
|
||||
/* 32 */ u16 channel;
|
||||
/* 34 */ u16 parentMaxSize;
|
||||
/* 36 */ u16 childMaxSize;
|
||||
@@ -59,7 +59,7 @@ typedef struct WMScanParam {
|
||||
/* 04 */ u16 channel;
|
||||
/* 06 */ u16 maxChannelTime;
|
||||
/* 08 */ u8 bssid[WM_SIZE_BSSID];
|
||||
/* 0e */ u8 unk_0e[0x20 - 0x0e];
|
||||
/* 0e */ u8 unk_0e[0x20 - 0x0E];
|
||||
/* 20 */
|
||||
} WMScanParam;
|
||||
|
||||
@@ -101,7 +101,7 @@ typedef struct WMPortRecvCallback {
|
||||
/* 00 */ u8 unk_00[0x02 - 0x00];
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ WMStateCode state;
|
||||
/* 08 */ u8 unk_08[0x0c - 0x08];
|
||||
/* 08 */ u8 unk_08[0x0C - 0x08];
|
||||
/* 0c */ void *data;
|
||||
/* 10 */ u16 length;
|
||||
/* 14 */
|
||||
@@ -118,7 +118,7 @@ typedef struct WMStartParentCallback {
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ u8 unk_04[0x08 - 0x04];
|
||||
/* 08 */ WMStateCode state;
|
||||
/* 0a */ u8 unk_0a[0x10 - 0x0a];
|
||||
/* 0a */ u8 unk_0a[0x10 - 0x0A];
|
||||
/* 10 */ u16 aid;
|
||||
} WMStartParentCallback;
|
||||
|
||||
@@ -134,16 +134,16 @@ typedef struct WMStartScanCallback {
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ u8 unk_04[0x08 - 0x04];
|
||||
/* 08 */ WMStateCode state;
|
||||
/* 0a */ u8 unk_0a[0x3c - 0x0a];
|
||||
/* 0a */ u8 unk_0a[0x3C - 0x0A];
|
||||
/* 3c */ WMGameInfo gameInfo;
|
||||
} WMStartScanCallback;
|
||||
|
||||
typedef struct WMPortSendCallback {
|
||||
/* 00 */ u8 unk_00[0x02 - 0x00];
|
||||
/* 02 */ WMErrCode errcode;
|
||||
/* 04 */ u8 unk_04[0x0c - 0x04];
|
||||
/* 04 */ u8 unk_04[0x0C - 0x04];
|
||||
/* 0c */ u16 destBitmap;
|
||||
/* 0e */ u8 unk_0e[0x10 - 0x0e];
|
||||
/* 0e */ u8 unk_0e[0x10 - 0x0E];
|
||||
/* 10 */ u16 sentBitmap;
|
||||
/* 12 */ u8 unk_12[0x14 - 0x12];
|
||||
/* 14 */ void *data;
|
||||
@@ -160,7 +160,7 @@ typedef struct WMMeasureChannelCallback {
|
||||
|
||||
typedef struct WMStatus {
|
||||
WMStateCode state;
|
||||
u8 unk[0x7cc];
|
||||
u8 unk[0x7CC];
|
||||
} WMStatus;
|
||||
|
||||
WMErrCode WM_Initialize(void *buf, void (*callback)(void *arg), u32 param3);
|
||||
|
||||
Reference in New Issue
Block a user