summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authortheo3 <arisstephenson2@gmail.com>2022-01-01 18:26:25 -0800
committertheo3 <arisstephenson2@gmail.com>2022-01-01 18:26:25 -0800
commit1ca41b54a984af1da881cb9a01015069a570c195 (patch)
tree83946bfda0b34f854c05bfdecc7bc2352c416ee3 /include
parent0e72c3ee157adb058e6751ff3d1a7ba070b0eef7 (diff)
color.c, utils->common.c
Diffstat (limited to 'include')
-rw-r--r--include/asm.h2
-rw-r--r--include/color.h21
-rw-r--r--include/common.h (renamed from include/utils.h)22
-rw-r--r--include/enemy.h2
-rw-r--r--include/entity.h1
-rw-r--r--include/flags.h8
-rw-r--r--include/functions.h7
-rw-r--r--include/global.h3
-rw-r--r--include/kinstone.h28
-rw-r--r--include/main.h2
-rw-r--r--include/npc.h2
-rw-r--r--include/object.h2
-rw-r--r--include/room.h4
-rw-r--r--include/save.h8
-rw-r--r--include/screen.h2
-rw-r--r--include/structures.h1
16 files changed, 84 insertions, 31 deletions
diff --git a/include/asm.h b/include/asm.h
index fa0476ba..f250ebb1 100644
--- a/include/asm.h
+++ b/include/asm.h
@@ -3,8 +3,6 @@
#include "global.h"
-struct Entity_;
-
extern u32 Random(void);
extern void sub_08000152(u32, u32, u32);
extern u32 GetTileTypeByEntity(struct Entity_*);
diff --git a/include/color.h b/include/color.h
new file mode 100644
index 00000000..14ab24a9
--- /dev/null
+++ b/include/color.h
@@ -0,0 +1,21 @@
+#ifndef COLOR_H
+#define COLOR_H
+
+#include "global.h"
+
+typedef struct {
+ u8 _0;
+ u8 _1;
+ u16 _2;
+} Palette;
+extern Palette gPaletteList[];
+
+void sub_0801CFA8(u32 a1);
+void sub_0801D000(u32 a1);
+void LoadObjPalette(struct Entity_*, u32);
+void UnloadOBJPalette(struct Entity_* entity);
+void sub_0801D244(u32);
+void sub_0801D28C(struct Entity_* entity, u32 palette);
+void ChangeObjPalette(struct Entity_* entity, u32 palette);
+
+#endif // COLOR_H
diff --git a/include/utils.h b/include/common.h
index 8cb3e8d1..a971ed21 100644
--- a/include/utils.h
+++ b/include/common.h
@@ -1,5 +1,5 @@
-#ifndef UTILS_H
-#define UTILS_H
+#ifndef COMMON_H
+#define COMMON_H
#include "global.h"
@@ -13,6 +13,11 @@ typedef struct {
extern Input gInput;
+void LoadPalettes(const u8*, s32, s32);
+void LoadPaletteGroup(u32 group);
+void SetColor(u32 colorIndex, u32 color);
+void SetFillColor(u32 color, u32 arg1);
+
/**
* Fill memory with 16 bit value.
*/
@@ -38,11 +43,6 @@ void MemCopy(const void* src, void* dest, u32 size);
*/
void ReadKeyInput(void);
-void LoadPalettes(const u8*, s32, s32);
-void LoadPaletteGroup(u32 group);
-void SetColor(u32 colorIndex, u32 color);
-void SetFillColor(u32 color, u32 arg1);
-
/**
* Allocate memory on heap.
*
@@ -66,10 +66,12 @@ void zFree(void* ptr);
/**
* Reset All display hardware registers.
*
- * @param updateHUD bool32 Request refresh of HUD layer (bg 0)
+ * @param refresh bool32 Request refresh of HUD layer (bg 0)
*/
-void DispReset(bool32 updateHUD);
+void DispReset(bool32 refresh);
u32 CheckPlayerProximity(u32, u32, u32, u32);
-#endif
+void sub_0801E1EC(u32, u32, u32);
+
+#endif // COMMON_H
diff --git a/include/enemy.h b/include/enemy.h
index 5905ce5b..b2f4b628 100644
--- a/include/enemy.h
+++ b/include/enemy.h
@@ -7,7 +7,7 @@
#include "sound.h"
#include "effects.h"
#include "flags.h"
-#include "utils.h"
+#include "common.h"
#include "entity.h"
diff --git a/include/entity.h b/include/entity.h
index 4f163a72..7eb38aa2 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -3,6 +3,7 @@
#define ENTITY_H
#include "global.h"
+#include "color.h"
#include "sprite.h"
#define MAX_ENTITIES 71
diff --git a/include/flags.h b/include/flags.h
index 1d3080ae..10224374 100644
--- a/include/flags.h
+++ b/include/flags.h
@@ -25,10 +25,10 @@ void SetLocalFlag(u32);
void SetLocalFlagByBank(u32, u32);
void SetRoomFlag(u32);
-extern u32 ReadBit(u32*, u32);
-extern u32 CheckBits(u32*, u32, u32);
-extern void WriteBit(u32*, u32);
-extern void ClearBit(u32*, u32);
+extern u32 ReadBit(void*, u32);
+extern u32 CheckBits(void*, u32, u32);
+extern u32 WriteBit(void*, u32);
+extern u32 ClearBit(void*, u32);
extern u32 gGlobalFlags;
extern u32 gRoomFlags;
diff --git a/include/functions.h b/include/functions.h
index a271ad64..09cc5981 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -44,7 +44,6 @@ extern void sub_0805EC9C();
extern void sub_0805EC60(Entity*);
extern void sub_0806D0B0(Entity*);
extern void sub_0806D02C(Entity*);
-extern void ChangeObjPalette(Entity*, u32);
extern void sub_0806FD3C(Entity*);
extern void sub_0805ED14(u32*);
extern void sub_080A7C18(u32, u32, u32);
@@ -101,10 +100,8 @@ extern void sub_0804ED18();
extern void sub_080AF2E4(void);
extern void sub_0804F578(void);
extern void sub_08059994(void);
-extern s32 sub_0801CFA8(u32);
extern void sub_080ADA14(u32, u32); // trampoline to sub_080B27F4
extern void sub_0801E1B8(u32, u32);
-extern void sub_0801E1EC(s32, s32, s32);
extern void sub_080A3B74(void);
extern void sub_080A4054(void);
extern void sub_0801C1D4(void);
@@ -169,7 +166,7 @@ extern void sub_0806F62C(Entity*, u32, u32);
extern void sub_080A1ED0(u32, u32, u32);
extern u32 sub_0806F5B0(u32);
extern void sub_0801DFB4(Entity*, u32, u32, u32);
-extern void sub_0801E00C();
+extern u32 sub_0801E00C(void);
extern void sub_08078790(Entity*, u32);
extern void sub_080788E0(Entity*);
extern void sub_08078B48(void);
@@ -200,6 +197,4 @@ extern void sub_080042D0(Entity*, u32, u16);
extern u32 sub_080002A8(u32, u32, u32);
extern void sub_080806BC(u32, u32, u32, u32);
-extern void LoadObjPalette(Entity*, u32);
-
#endif
diff --git a/include/global.h b/include/global.h
index e7eddd31..512a903d 100644
--- a/include/global.h
+++ b/include/global.h
@@ -101,4 +101,7 @@ union SplitHWord {
#define FORCE_WORD_ALIGNED __attribute__((packed, aligned(2)))
+/* forward decls */
+struct Entity_;
+
#endif // GUARD_GLOBAL_H
diff --git a/include/kinstone.h b/include/kinstone.h
new file mode 100644
index 00000000..8760673d
--- /dev/null
+++ b/include/kinstone.h
@@ -0,0 +1,28 @@
+#ifndef KINSTONE_H
+#define KINSTONE_H
+
+#include "global.h"
+
+typedef struct {
+ u8 unk[4];
+ u32 unk2;
+ u32 unk4;
+} Unk_struct;
+extern Unk_struct gUnk_03003DF0[];
+
+typedef struct {
+ u8 _0;
+ u8 action;
+ u8 _2;
+ u8 _3;
+ u8 _4;
+ u8 _5;
+ u16 _6;
+ u16 _8;
+ u16 _a;
+ Entity* ent;
+} FuseInfo;
+static_assert(sizeof(FuseInfo) == 0x10);
+extern FuseInfo gFuseInfo;
+
+#endif // KINSTONE_H
diff --git a/include/main.h b/include/main.h
index d18e54c0..eda7676c 100644
--- a/include/main.h
+++ b/include/main.h
@@ -78,6 +78,8 @@ void InitScreen(u32 screen);
void InitDMA(void);
+void sub_0805622C(void* a1, u32 a2, u32 a3);
+
extern void sub_08056208(void);
extern void ResetPalettes(void);
diff --git a/include/npc.h b/include/npc.h
index 3e049fb0..3ad4beff 100644
--- a/include/npc.h
+++ b/include/npc.h
@@ -3,7 +3,7 @@
#include "global.h"
#include "asm.h"
-#include "utils.h"
+#include "common.h"
#include "sound.h"
#include "effects.h"
diff --git a/include/object.h b/include/object.h
index 84f9c02c..d4792ecf 100644
--- a/include/object.h
+++ b/include/object.h
@@ -3,7 +3,7 @@
#include "global.h"
#include "asm.h"
-#include "utils.h"
+#include "common.h"
#include "sound.h"
#include "flags.h"
diff --git a/include/room.h b/include/room.h
index 59c6e094..fb2e8398 100644
--- a/include/room.h
+++ b/include/room.h
@@ -124,8 +124,8 @@ typedef struct {
u8 dungeon_room;
s16 dungeon_x;
s16 dungeon_y;
- s16 dungeon_map_x;
- s16 dungeon_map_y;
+ u16 dungeon_map_x;
+ u16 dungeon_map_y;
s16 overworld_map_x;
s16 overworld_map_y;
u8 field_0x24[0x8];
diff --git a/include/save.h b/include/save.h
index 5df71806..9dbba7ff 100644
--- a/include/save.h
+++ b/include/save.h
@@ -41,9 +41,13 @@ typedef struct {
/*0x086*/ u8 filler86[0x2];
/*0x088*/ PlayerWorldStatus saved_status;
/*0x0A8*/ Stats stats;
- /*0x0D0*/ u8 fillerD0[0x71];
+ /*0x0D0*/ u8 fillerD0[0x48];
+ /*0x118*/ u8 unk118[0x13];
+ /*0x12B*/ u8 unk12B[0x16];
/*0x141*/ u8 unk141[128];
- /*0x1C1*/ u8 unk1C1[155];
+ /*0x1C1*/ u8 unk1C1[128];
+ /*0x241*/ u8 unk241[13];
+ /*0x24E*/ u8 unk24E[14];
/*0x25C*/ u8 flags[0x200];
/*0x45C*/ u8 unk45C[0x10];
/*0x46C*/ u8 unk46C[0x20];
diff --git a/include/screen.h b/include/screen.h
index f308f19d..95a2f5bf 100644
--- a/include/screen.h
+++ b/include/screen.h
@@ -65,7 +65,7 @@ typedef struct {
/*0x38*/ BgControls controls;
/*0x6c*/ u8 _6c;
/*0x6d*/ u8 _6d;
- /*0x70*/ u32 _70;
+ /*0x70*/ void* _70;
/*0x74*/ u32 _74;
/*0x78*/ u32 _78;
} Screen;
diff --git a/include/structures.h b/include/structures.h
index 014b0abe..1f368dcd 100644
--- a/include/structures.h
+++ b/include/structures.h
@@ -135,7 +135,6 @@ typedef struct {
} PriorityHandler;
extern PriorityHandler gPriorityHandler;
-extern u8 gUnk_02022740[];
extern u8 gUnk_02034490[];
typedef struct {