Merge remote-tracking branch 'upstream/master' into tilemap-docs

This commit is contained in:
octorock
2023-05-31 23:51:20 +02:00
254 changed files with 4013 additions and 4939 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ extern void LoadResourceAsync(const void* src, u32 dest, u32 size);
extern void GenericConfused(struct Entity_*);
extern void sub_08001290(struct Entity_*, u32);
extern void GenericKnockback(struct Entity_*);
extern u32 sub_08002632(struct Entity_*);
extern u32 GetFuserId(struct Entity_*);
extern u32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
extern u32 GravityUpdate(struct Entity_*, u32);
extern u32 CheckOnScreen(struct Entity_*);
+3 -2
View File
@@ -119,11 +119,12 @@ u32 CheckKinstoneFused(u32);
void sub_0801E1EC(u32, u32, u32);
void sub_0801DD58(u32, u32);
void sub_0801E1B8(u32, u32);
void sub_0801E738(u32);
void AddKinstoneToBag(u32);
void sub_0801DFB4(struct Entity_*, u32, u32, u32);
u32 sub_0801E00C(void);
bool32 sub_0801E810(u32);
bool32 CheckFusionMapMarkerDisabled(u32);
u32 sub_0801DB94(void);
u32 GetRandomSharedFusion(u8*);
typedef struct {
u8 numFloors;
+2 -2
View File
@@ -14,9 +14,9 @@ typedef union {
s16 bombs;
s16 arrows;
s16 mysteriousShells;
s16 kinstoneGreen;
s16 kinstoneBlue;
s16 kinstoneRed;
s16 kinstoneBlue;
s16 kinstoneGreen;
s16 none2;
s16 none3;
s16 none4;
-1
View File
@@ -69,6 +69,5 @@ extern void (*const gUnk_080FC908[])(void);
extern const u8 gGlobalGfxAndPalettes[];
extern u32 gUsedPalettes;
extern u8 gTextGfxBuffer[];
extern u8 gUnk_02022030;
#endif // FILESELECT_H
+1597 -1593
View File
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -90,32 +90,32 @@ void sub_08052878(void);
void ModDungeonKeys(s32 keys);
/**
* Check if the current dungeon has a map item.
* Check if the player has at least one small key for the current dungeon.
*
* @return True if the current dungeon has a map item.
* @return True if the player has a small key.
*/
bool32 HasDungeonMap(void);
bool32 HasDungeonSmallKey(void);
/**
* Check if the current dungeon has a compass item.
* Check if the player has the big key for the current dungeon.
*
* @return True if the current dungeon has a compass item.
*/
bool32 HasDungeonCompass(void);
/**
* Check if the current dungeon has a big key item.
*
* @return True if the current dungeon has a big key item.
* @return True if the player has the big key.
*/
bool32 HasDungeonBigKey(void);
/**
* Check if the current dungeon has a small key item.
* Check if the player has the compass for the current dungeon.
*
* @return True if the current dungeon has a small key item.
* @return True if the player has the compass.
*/
bool32 HasDungeonSmallKey(void);
bool32 HasDungeonCompass(void);
/**
* Check if the player has the map for the current dungeon.
*
* @return True if the player has the map.
*/
bool32 HasDungeonMap(void);
/**
* @brief Check if item is a sword.
+2 -2
View File
@@ -147,9 +147,9 @@ typedef enum {
ITEM_SKILL_LONG_SPIN,
// these are not actually item ids but special values used by item drops for example
ITEM_KINSTONE_GREEN = 0xfc,
ITEM_KINSTONE_RED = 0xfc,
ITEM_KINSTONE_BLUE,
ITEM_KINSTONE_RED,
ITEM_KINSTONE_GREEN,
ITEM_ENEMY_BEETLE
} Item;
+23 -13
View File
@@ -23,28 +23,28 @@ extern FuseInfo gFuseInfo;
typedef struct {
u8 objPalette;
u8 unk1;
u8 unk2;
u8 gfxOffsetPiece;
u8 gfxOffsetFull;
u8 subtask; // SUBTASK_WORLDEVENT or 0
u8 worldEventId;
u8 unk5;
u8 unk6;
u8 unk7; // TODO flag if it shows a map hint?
u8 shape;
u8 bubbleIcon;
u8 mapMarkerIcon; // 0 for no map marker
} KinstoneWorldEvent;
// Indexed by kinstoneId
extern const KinstoneWorldEvent gKinstoneWorldEvents[];
typedef enum {
KINSTONE_0,
KINSTONE_1,
KINSTONE_2,
KINSTONE_3,
KINSTONE_4,
KINSTONE_5,
KINSTONE_NONE,
KINSTONE_MYSTERIOUS_CLOUD_TOP_RIGHT,
KINSTONE_MYSTERIOUS_CLOUD_BOTTOM_LEFT,
KINSTONE_MYSTERIOUS_CLOUD_TOP_LEFT,
KINSTONE_MYSTERIOUS_CLOUD_MIDDLE,
KINSTONE_MYSTERIOUS_CLOUD_BOTTOM_RIGHT,
KINSTONE_CASTOR_WILDS_STATUE_LEFT,
KINSTONE_CASTOR_WILDS_STATUE_MIDDLE,
KINSTONE_CASTOR_WILDS_STATUE_RIGHT,
KINSTONE_9,
KINSTONE_SOURCE_FLOW,
KINSTONE_A,
KINSTONE_B,
KINSTONE_C,
@@ -131,6 +131,16 @@ typedef enum {
KINSTONE_5D,
KINSTONE_5E,
KINSTONE_5F,
KINSTONE_60,
KINSTONE_61,
KINSTONE_62,
KINSTONE_63,
KINSTONE_64,
/* some special values, mostly for fusers */
KINSTONE_NEEDS_REPLACEMENT = 0xF1,
KINSTONE_JUST_FUSED = 0xF2,
KINSTONE_FUSER_DONE = 0xF3,
KINSTONE_RANDOM = 0xFF,
} KinstoneId;
typedef struct {
@@ -209,7 +219,7 @@ typedef struct {
u16 y; /**< Y position of the actual event. */
u16 _c; // see GetOverworldLocation, related to _0 and _2 of gOverworldLocations
u16 _e; // see GetOverworldLocation, related to _1 and _3 of gOverworldLocations
u8 condition; // TODO some sort of flag determining what type the bank&flag are? see sub_0801E8D4
u8 condition; // TODO some sort of flag determining what type the bank&flag are? see UpdateVisibleFusionMapMarkers
u8 bank; /**< @see LocalBanks */
u16 flag;
} WorldEvent;
+5 -5
View File
@@ -74,7 +74,7 @@ void sub_0806EE04(Entity* ent, void* a2, u32 a3);
u32 sub_0806EE20(Entity* ent);
s32 sub_0806F078(Entity* ent, s32 a2);
void sub_0806F118(Entity* ent);
void sub_0806F188(Entity* ent);
void MarkFuserDone(Entity* ent);
void ShowNPCDialogue(Entity* ent, const Dialog* dia);
Entity* CreateNPC(u32 subtype, u32 form, u32 parameter);
@@ -84,12 +84,12 @@ void NPCInit(Entity* ent);
void CollideFollowers(void);
// TODO move?
void sub_08078784(Entity* ent, u32 arg1);
void AddInteractableWhenBigFuser(Entity* ent, u32 kinstoneId);
u32 sub_0806F5A4(u32);
u32 sub_0801E99C(Entity*);
void sub_08078778(Entity*);
u32 GetFusionToOffer(Entity*);
void AddInteractableWhenBigObject(Entity*);
void sub_0807000C(Entity*);
void sub_080787A8(Entity*, u32);
void AddInteractableAsMinishFuser(Entity* ent, u32 kinstoneId);
enum NPC {
/*0x00*/ NPC_NONE_0,
+2 -2
View File
@@ -14,8 +14,8 @@
#include "entity.h"
#include "player.h"
void sub_080787C0(Entity*);
void sub_080787B4(Entity*);
void AddInteractablePedestal(Entity*);
void AddInteractableCheckableObject(Entity*);
void sub_0808C650(Entity*, u32);
u32 sub_0808C67C(void);
void sub_0808C688(void);
+54 -19
View File
@@ -12,7 +12,7 @@ enum PlayerActions {
PLAYER_JUMP,
PLAYER_PUSH,
PLAYER_BOUNCE,
PLAYER_08070E9C, // sub_080782C0, only when PLAYER_INPUT_1000 is newInput
PLAYER_08070E9C, // sub_080782C0, only when pressing L to start a Kinstone Fusion
PLAYER_ITEMGET,
PLAYER_MINISH,
PLAYER_MINISHDIE,
@@ -254,12 +254,12 @@ typedef enum {
} PlayerInputState;
typedef struct {
/*0x90*/ u16 heldInput; /**< Input currently held @see PlayerInputState */
/*0x92*/ u16 newInput; /**< New input this frame @see PlayerInputState */
/*0x94*/ u32 field_0x94;
/*0x98*/ u16 playerMacroWaiting;
/*0x9a*/ u16 playerMacroHeldKeys;
/*0x9c*/ PlayerMacroEntry* playerMacro;
/*0x0*/ u16 heldInput; /**< Input currently held @see PlayerInputState */
/*0x2*/ u16 newInput; /**< New input this frame @see PlayerInputState */
/*0x4*/ u32 field_0x94;
/*0x8*/ u16 playerMacroWaiting;
/*0xa*/ u16 playerMacroHeldKeys;
/*0xc*/ PlayerMacroEntry* playerMacro;
} PlayerInput;
typedef enum {
@@ -276,7 +276,7 @@ typedef enum {
typedef struct {
/*0x00*/ u8 prevAnim;
/*0x00*/ u8 grab_status;
/*0x01*/ u8 grab_status;
/*0x02*/ u8 jump_status;
/*0x03*/ u8 shield_status;
/*0x04*/ u8 attack_status;
@@ -398,7 +398,11 @@ typedef struct {
extern void (*const gPlayerItemFunctions[])(Entity*);
extern const s16 gWalletSizes[];
typedef struct {
u16 size;
u16 iconStartTile;
} Wallet;
extern const Wallet gWalletSizes[];
extern const u8 gBombBagSizes[];
extern const u8 gQuiverSizes[];
extern Entity* gPlayerClones[];
@@ -433,6 +437,37 @@ s32 ModHealth(s32 delta);
void ModRupees(s32 delta);
void ModBombs(s32 delta);
typedef enum {
INTERACTION_NONE,
INTERACTION_TALK,
INTERACTION_FUSE,
INTERACTION_OPEN_CHEST,
INTERACTION_UNUSED,
INTERACTION_USE_SMALL_KEY,
INTERACTION_USE_BIG_KEY,
INTERACTION_TALK_MINISH,
INTERACTION_LIFT_SHOP_ITEM,
INTERACTION_CHECK,
INTERACTION_DROP_PEDESTAL,
INTERACTION_NULL = 0xFF,
} InteractionType;
typedef enum {
R_ACTION_NONE,
R_ACTION_CANCEL,
R_ACTION_DROP,
R_ACTION_THROW,
R_ACTION_READ,
R_ACTION_CHECK,
R_ACTION_OPEN,
R_ACTION_SPEAK,
R_ACTION_GRAB,
R_ACTION_LIFT,
R_ACTION_GROW,
R_ACTION_SHRINK,
R_ACTION_ROLL,
} ActionRButton;
// playerUtils.c
void DeleteClones(void);
void CreateItemEquippedAtSlot(/*EquipSlot*/ u32 equipSlot);
@@ -465,13 +500,13 @@ void UpdatePlayerSkills(void);
u32 sub_0807AC54(Entity*);
void sub_080792D8(void);
u32 sub_08078F74(Entity*);
void sub_0807879C(Entity*);
void AddInteractableAsMinishObject(Entity*);
void sub_08078D60(void);
void PlayerSetNormalAndCollide(void);
bool32 PlayerTryDropObject(ItemBehavior* arg0, u32 unk);
void InitItemGetSequence(u32, u32, u32);
void sub_0807B7D8(u32, u32, u32);
void sub_08078850(Entity*, u32, u32, const void*);
void SetInteractableObjectCollision(Entity*, u32, u32, const void*);
void sub_08079D84(void);
u32 sub_0807953C(void);
void sub_0807BB68(const s16*, u32, u32);
@@ -499,14 +534,14 @@ bool32 IsItemActive(ItemBehavior*);
bool32 IsItemActivatedThisFrame(ItemBehavior*);
bool32 IsItemActiveByInput(ItemBehavior*, PlayerInputState);
bool32 sub_08077FEC(u32);
void sub_08078180(void);
void sub_080784C8();
void sub_08078790(Entity*, u32);
void sub_080787CC(Entity*);
s32 sub_08078800(Entity*);
s32 sub_0807887C(Entity*, u32, u32);
void sub_080788E0(Entity*);
s32 sub_08078904();
void DetermineRButtonInteraction(void);
void ResetPossibleInteraction();
void AddInteractableFuser(Entity*, u32);
void AddInteractableSmallKeyLock(Entity*);
s32 AddInteractableBossDoor(Entity*);
s32 AddInteractableObject(Entity*, u32, u32);
void RemoveInteractableObject(Entity*);
s32 GetInteractableObjectIndex();
void sub_08078AC0(u32, u32, u32);
void sub_08078B48(void);
void sub_08078E84(Entity*, Entity*);
+9 -7
View File
@@ -34,7 +34,7 @@ extern SaveResult HandleSave(u32 idx);
*/
typedef struct {
/*0x000*/ u8 invalid; /**< File is invalid. */
/*0x000*/ u8 initialized; /**< File is initialized. */
/*0x001*/ u8 initialized; /**< File is initialized. */
/*0x002*/ u8 msg_speed; /**< Message speed. */
/*0x003*/ u8 brightness; /**< Brightness. */
/*0x004*/ u8 filler4[0x2];
@@ -58,16 +58,18 @@ typedef struct {
/*0x0F2*/ u8 inventory[36];
/*0x116*/ u8 didAllFusions;
/*0x117*/ u8 fusedKinstoneCount;
/*0x118*/ u8 unk118[0x13]; // TODO also related to kinstones
/*0x12B*/ u8 unk12B[0x16]; // TODO also related to kinstones
/*0x141*/ u8 unk141[128]; // TODO sub_08064F28 and also the goddesses, indexed by sub_08002632
/*0x1C1*/ u8 unk1C1[128]; // TODO also related to kinstones, see sub_0801E6C8 0x80 available kinstone fusions?
/*0x118*/ u8 kinstoneTypes[0x13]; // 0x65-0x75 for each kinstone type present in kinstone bag
/*0x12B*/ u8 kinstoneAmounts[0x13]; // amount of each kinstone type above
/*0x13E*/ u8 filler13E[3];
/*0x141*/ u8 fuserProgress[128]; // indexed by fuser id, incremented after fusion
/*0x1C1*/ u8 fuserOffers[128]; // available kinstone fusion for each fuser
/*0x241*/ u8 fusedKinstones[13]; /**< Bitfield for fused kinstones. @see CheckKinstoneFused */
/*0x24E*/ u8 unk24E[14]; // TODO something else with kinstones @see sub_0801E810
/*0x24E*/ u8 fusionUnmarked[13]; /**< Bitfield for disabled fusion map markers. @see CheckFusionMapMarkerDisabled */
/*0x25B*/ u8 filler25B;
/*0x25C*/ u8 flags[0x200]; /**< Flags. */
/*0x45C*/ u8 dungeonKeys[0x10]; // TODO Indexed by dungeon id, keys per dungeon
/*0x46C*/ u8 dungeonItems[0x10]; // TODO items in the dungeon. 4: compass, 2: big key, 1: small key
/*0x46C*/ u8 dungeonWarps[0x10]; // TODO indexed by dungeon id, EnableDungeonWarp, IsDungeonWarpActive
/*0x47C*/ u8 dungeonWarps[0x10]; // TODO indexed by dungeon id, EnableDungeonWarp, IsDungeonWarpActive
/*0x48C*/ u32 timers[7];
/*0x4A8*/ u32 demo_timer; /**< Demo timer. */
/*0x4AC*/ u8 filler4ac[0x8];
+31 -29
View File
@@ -131,12 +131,11 @@ typedef struct {
u8 filler22[0x2];
u8 ezloNagFuncIndex;
u8 filler25[7];
u8 unk_2c;
u8 unk_2d;
u8 unk_2e;
u8 unk_2f;
u8 unk_30[2];
u8 unk_32;
u8 rActionInteractObject; // used as R button UI frame index
u8 rActionInteractTile;
u8 rActionGrabbing;
u8 rActionPlayerState; // if not 0, overrides other R actions
u8 buttonText[3];
u8 unk_33;
UIElement elements[MAX_UI_ELEMENTS];
} HUD;
@@ -171,6 +170,7 @@ typedef struct {
/*0x06*/ u16 paletteIndex;
/*0x08*/ const void* palettePointer;
} GfxSlot;
typedef struct {
/*0x00*/ u8 unk0;
/*0x01*/ u8 unk_1;
@@ -273,26 +273,35 @@ typedef struct {
} struct_020227E8;
typedef struct {
/*0x00*/ u8 unk_0;
/*0x01*/ u8 unk_1;
/*0x02*/ u8 unk_2;
/*0x03*/ u8 unk_3;
/*0x04*/ const u8* unk_4;
/*0x08*/ Entity* entity;
} struct_03003DF8;
s8 x;
s8 y;
s8 width;
s8 height;
} Rect;
typedef struct {
/*0x00*/ u8 unk_0;
/*0x01*/ u8 unk_1;
/*0x02*/ u8 unk_2; // TODO kinstoneId, sub_0801DFB4
/*0x03*/ u8 unk_3;
/*0x04*/ u8* unk_4;
/*0x08*/ struct_03003DF8 array[0x20];
} struct_03003DF0;
/*0x00*/ u8 ignoreLayer; /* if bit 0 set, skip layer check for collision */
/*0x01*/ u8 type;
/*0x02*/ u8 interactDirections; /* lower 4 bits determine Link's allowed facing directions to interact, 0 to allow
(0000WSEN) */
/*0x03*/ u8 kinstoneId;
/*0x04*/ const Rect* customHitbox; /* optional custom rectangle */
/*0x08*/ Entity* entity;
} InteractableObject;
static_assert(sizeof(struct_03003DF0) == 0x188);
typedef struct {
/*0x00*/ u8 isUpdated;
/*0x01*/ u8 unused;
/*0x02*/ u8 kinstoneId;
/*0x03*/ u8 currentIndex; /* index of currentObject in candidate list, or 0xFF */
/*0x04*/ InteractableObject* currentObject;
/*0x08*/ InteractableObject
candidates[0x20]; /* contains the loaded NPCs, key doors, windcrests and other objects */
} PossibleInteraction;
extern struct_03003DF0 gUnk_03003DF0;
static_assert(sizeof(PossibleInteraction) == 0x188);
extern PossibleInteraction gPossibleInteraction;
typedef struct {
u8 numTiles;
@@ -366,13 +375,6 @@ typedef struct {
u8 frameIndex;
} PACKED FrameStruct;
typedef struct {
s8 x;
s8 y;
s8 width;
s8 height;
} Rect;
typedef struct {
/*0x0*/ u8 menuType;
/*0x1*/ u16 font;