Merge pull request #238 from notyourav/clr

color.c, utils->common.c
This commit is contained in:
notyourav
2022-01-01 18:29:08 -08:00
committed by GitHub
95 changed files with 3196 additions and 3867 deletions
-2
View File
@@ -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_*);
+21
View File
@@ -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
+12 -10
View File
@@ -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
+1 -1
View File
@@ -7,7 +7,7 @@
#include "sound.h"
#include "effects.h"
#include "flags.h"
#include "utils.h"
#include "common.h"
#include "entity.h"
+1
View File
@@ -3,6 +3,7 @@
#define ENTITY_H
#include "global.h"
#include "color.h"
#include "sprite.h"
#define MAX_ENTITIES 71
+4 -4
View File
@@ -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;
+1 -6
View File
@@ -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
+3
View File
@@ -101,4 +101,7 @@ union SplitHWord {
#define FORCE_WORD_ALIGNED __attribute__((packed, aligned(2)))
/* forward decls */
struct Entity_;
#endif // GUARD_GLOBAL_H
+28
View File
@@ -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
+2
View File
@@ -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);
+1 -1
View File
@@ -3,7 +3,7 @@
#include "global.h"
#include "asm.h"
#include "utils.h"
#include "common.h"
#include "sound.h"
#include "effects.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include "global.h"
#include "asm.h"
#include "utils.h"
#include "common.h"
#include "sound.h"
#include "flags.h"
+2 -2
View File
@@ -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];
+6 -2
View File
@@ -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];
+1 -1
View File
@@ -62,7 +62,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;
-1
View File
@@ -135,7 +135,6 @@ typedef struct {
} PriorityHandler;
extern PriorityHandler gPriorityHandler;
extern u8 gUnk_02022740[];
extern u8 gUnk_02034490[];
typedef struct {