finish main.c

This commit is contained in:
theo3
2021-01-31 11:23:42 -08:00
parent b9e07c1202
commit ced13c2c8d
26 changed files with 268 additions and 421 deletions
+2
View File
@@ -321,4 +321,6 @@ extern void sub_08008790(Entity*, u32);
extern u32 CheckIsDungeon();
extern void sub_0804ACF8();
extern void sub_08073904(Entity*);
extern u32 sub_08056134(void);
extern u32 sub_0807CF30(void*);
#endif
+6
View File
@@ -167,6 +167,12 @@
#define DmaClear16Defvars(dmaNum, dest, size) DmaClearDefvars(dmaNum, dest, size, 16)
#define DmaClear32Defvars(dmaNum, dest, size) DmaClearDefvars(dmaNum, dest, size, 32)
#define DmaWait(DmaNo) \
{ \
vu32 *(DmaCntp) = (vu32 *)REG_ADDR_DMA##DmaNo; \
while (DmaCntp[2] & (DMA_ENABLE << 16)) ; \
}
#define IntrEnable(flags) \
{ \
u16 imeTemp; \
+12
View File
@@ -11,6 +11,18 @@
#define RESET_REGS 0x80
#define RESET_ALL 0xFF
#define SystemCall(x) { asm("svc " #x); }
extern void SoundBiasReset();
extern void SoundBiasSet();
#define Stop() \
{ \
SoundBiasReset(); \
SystemCall(3); \
SoundBiasSet(); \
}
void SoftReset(u32 resetFlags);
void RegisterRamReset(u32 resetFlags);
+1
View File
@@ -47,6 +47,7 @@
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))
#define BOOLCAST(x) ((-x | x) >> 31)
#define static_assert(cond) extern char assertion[(cond) ? 1 : -1]
#if NON_MATCHING
+7
View File
@@ -23,6 +23,13 @@ enum {
SCREEN_DEBUG_TEXT,
};
#define GAME_LANGUAGE GAME_LANGUAGE_EN
#define SIGNATURE 'MCZ3'
#define GAME_LANGUAGE_EN 1
#define MAX_MSG_SPEED 3
#define MAX_SAVE_FILES 3
#define MAX_BRIGHTNESS 3
typedef struct {
u8 interruptFlag;
u8 field_0x1;
+5
View File
@@ -72,6 +72,11 @@ typedef struct {
/*0x08*/ BgSettings bg;
/*0x20*/ BgAffSettings affine;
/*0x38*/ BgControls controls;
/*0x6c*/ u8 _6c;
/*0x6d*/ u8 _6d;
/*0x70*/ u32 _70;
/*0x74*/ u32 _74;
/*0x78*/ u32 _78;
} Screen;
extern BgControls gBgControls;
+6 -5
View File
@@ -6,12 +6,16 @@
#include "player.h"
typedef struct {
char header[4];
int signature;
u8 saveFileId;
u8 messageSpeed;
u8 brightnessPref;
u8 gameLanguage;
u8 _8[6];
u8 _e;
} struct_02000000;
#define gUnk_02000000 ((struct_02000000*)(0x2000000))
// extern struct_02000000 gUnk_02000000;
typedef struct {
u8 unk_00;
@@ -30,11 +34,8 @@ typedef struct {
u16 field_0xa;
} struct_0807D1C4;
#define gUnk_02000000 ((struct_02000000*)(0x2000000))
// extern struct_02000000 gUnk_02000000;
typedef struct {
u8 filler0[0x4];
s32 signature;
u8 field_0x4;
u8 listenForKeyPresses;
} struct_02000010;