cleanup structures.h

This commit is contained in:
Henny022p 2025-03-09 12:01:00 +00:00
parent 3b9b1a388b
commit 46506530fc
99 changed files with 363 additions and 383 deletions

View File

@ -45,4 +45,19 @@ typedef struct {
*/
extern void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer);
typedef struct {
u8 unk_0;
u8 unk_1;
u8 unk_2[2];
u16 unk_4;
u8 filler[12];
struct Entity_* unk_14;
u8 unk_18;
u8 unk_19;
u8 unk_1a;
u8 unk_1b;
} struct_02018EB0;
extern struct_02018EB0 gUnk_02018EB0;
#endif // BEANSTALKSUBTASK_H

View File

@ -23,7 +23,7 @@ typedef struct {
u16 unk_02;
union SplitWord unk_04;
union SplitWord unk_08;
u32 unk_0C;
void* unk_0C;
} struct_gUnk_020000C0_1;
typedef struct {

View File

@ -537,6 +537,16 @@ typedef struct {
} CarriedEntity;
extern CarriedEntity gCarriedEntity;
typedef struct {
u8 event_priority; /**< system requested priority @see Priority */
u8 ent_priority; /**< entity requested priority @see Priority */
u8 queued_priority; /**< @see Priority */
u8 queued_priority_reset; /**< @see Priority */
Entity* requester;
u16 priority_timer;
} PriorityHandler;
extern PriorityHandler gPriorityHandler;
/**
* Current number of entities.
* @see Entity

View File

@ -100,4 +100,7 @@ void FadeVBlank(void);
*/
void ResetFadeMask(void);
extern u32 gUsedPalettes;
#define USE_PALETTE(i) do { gUsedPalettes |= 1 << (i); } while(0)
#endif // FADE_H

8
include/gfx.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef GFX_H
#define GFX_H
#include "global.h"
extern const u8 gGlobalGfxAndPalettes[];
#endif //GFX_H

20
include/itemDefinitions.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef ITEMDEFINITIONS_H
#define ITEMDEFINITIONS_H
#include "global.h"
typedef struct {
/*0x00*/ bool8 isOnlyActiveFirstFrame; /**< Is the behavior for this item only created on the first frame */
/*0x01*/ u8 priority;
/*0x02*/ u8 createFunc;
/*0x03*/ u8 playerItemId; /**< Id for the corresponsing PlayerItem. */
/*0x04*/ u16 frameIndex;
/*0x06*/ u8 animPriority;
/*0x07*/ bool8 isChangingAttackStatus;
/*0x08*/ bool8 isUseableAsMinish;
/*0x09*/ u8 pad[3];
} ItemDefinition;
static_assert(sizeof(ItemDefinition) == 0xc);
#endif //ITEMDEFINITIONS_H

View File

@ -101,6 +101,18 @@ static_assert(sizeof(UI) == 0x3b4);
extern Main gMain; /**< Main instance. */
extern UI gUI; /**< UI instance. */
typedef struct {
s32 signature;
u8 field_0x4;
u8 listenForKeyPresses;
u8 field_0x6;
u8 field_0x7;
u8 pad[24];
} struct_02000010;
static_assert(sizeof(struct_02000010) == 0x20);
extern struct_02000010 gUnk_02000010;
/**
* Program entry point.
*/

View File

@ -127,6 +127,14 @@ typedef struct {
extern TextRender gTextRender;
static_assert(sizeof(TextRender) == 0xa8);
typedef struct {
u8 unk_00;
u8 unk_01;
u8 unk_02[0xE];
} struct_02000040;
extern struct_02000040 gUnk_02000040;
/**
* @brief Initialize the message system.
*/

View File

@ -40,4 +40,20 @@ typedef enum {
PauseMenuScreen_19,
} PauseMenuScreen;
typedef struct {
u8 disabled;
u8 screen;
u8 unk2[0xf]; // cursor positions on the different screens
u8 unk11;
u8 unk12;
u8 unk13;
s8 screen2;
u8 unk15;
s8 unk16;
u8 unk17;
} PauseMenuOptions;
extern PauseMenuOptions gPauseMenuOptions;
static_assert(sizeof(PauseMenuOptions) == 0x18);
#endif // PAUSEMENU_H

View File

@ -676,6 +676,37 @@ typedef enum {
INTERACTION_NULL = 0xFF,
} InteractionType;
typedef struct {
s8 x;
s8 y;
s8 width;
s8 height;
} Rect;
typedef struct {
/*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;
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;
static_assert(sizeof(PossibleInteraction) == 0x188);
extern PossibleInteraction gPossibleInteraction;
typedef enum {
R_ACTION_NONE,
R_ACTION_CANCEL,

View File

@ -4,6 +4,12 @@
#include "global.h"
#include "transitions.h"
typedef struct {
u16 unk_00;
u8 unk_02[0xE];
} struct_02034480;
extern struct_02034480 gUnk_02034480;
extern bool32 DoApplicableTransition(u32, u32, u32, u32);
extern void DoExitTransitionWithType(const Transition* screenTransition, u32 transitionType);

View File

@ -2,223 +2,6 @@
#define STRUCTURES_H
#include "global.h"
#include "entity.h"
typedef struct {
u8 unk_00;
u8 unk_01;
u8 unk_02[0xE];
} struct_02000040;
extern struct_02000040 gUnk_02000040;
typedef struct {
s32 signature;
u8 field_0x4;
u8 listenForKeyPresses;
u8 field_0x6;
u8 field_0x7;
u8 pad[24];
} struct_02000010;
static_assert(sizeof(struct_02000010) == 0x20);
extern struct_02000010 gUnk_02000010;
typedef struct {
u8 unk0;
u8 unk1;
u16 unk2;
} struct_020354C0;
extern struct_020354C0 gUnk_020354C0[0x20];
#define MAX_UI_ELEMENTS 24
typedef enum {
UI_ELEMENT_BUTTON_A,
UI_ELEMENT_BUTTON_B,
UI_ELEMENT_BUTTON_R,
UI_ELEMENT_ITEM_A,
UI_ELEMENT_ITEM_B,
UI_ELEMENT_TEXT_R,
UI_ELEMENT_HEART,
UI_ELEMENT_EZLONAGSTART,
UI_ELEMENT_EZLONAGACTIVE,
UI_ELEMENT_TEXT_A,
UI_ELEMENT_TEXT_B
} UIElementType;
/**
* @brief Floating UI element
*/
typedef struct {
u8 used : 1;
u8 unk_0_1 : 1;
u8 unk_0_2 : 2; // Load data into VRAM? 0: do not load, 1: ready to load 2: loaded
u8 unk_0_4 : 4;
u8 type; /**< @see UIElementType */
u8 type2; // Subtype
u8 buttonElementId; /**< Id of the button UI element this text is attached to */
u8 action;
u8 unk_5;
u8 unk_6;
u8 unk_7;
u8 unk_8;
u8 unk_9[3];
u16 x;
u16 y;
u8 frameIndex;
u8 duration;
u8 spriteSettings;
u8 frameSettings;
Frame* framePtr;
u8 unk_18;
u8 numTiles;
u16 unk_1a; // TODO oam id? VRAM target (element->unk_1a * 0x20 + 0x6010000)
u32* firstTile;
} UIElement;
typedef enum {
HUD_HIDE_NONE,
HUD_HIDE_1 = 0x1, // A
HUD_HIDE_2 = 0x2, // B
HUD_HIDE_4 = 0x4, // R
HUD_HIDE_8 = 0x8,
HUD_HIDE_HEARTS = 0x10,
HUD_HIDE_CHARGE_BAR = 0x20,
HUD_HIDE_RUPEES = 0x40,
HUD_HIDE_KEYS = 0x80,
HUD_HIDE_ALL = 0xff
} HUDHideFlags;
typedef struct {
u8 unk_0;
u8 hideFlags;
u8 unk_2;
u8 health;
u8 maxHealth;
u8 unk_5;
u8 unk_6;
u8 unk_7;
u8 unk_8;
u8 unk_9;
u8 unk_a;
u8 unk_b;
u8 unk_c;
u8 unk_d;
u16 rupees;
u8 unk_10; // TODO drawing keys dirty flag or something?
u8 unk_11;
u8 dungeonKeys;
s8 unk_13;
s8 unk_14;
u8 unk_15;
u16 buttonX[3]; /**< X coordinates for the button UI elements */
u16 buttonY[3]; /**< Y coordinates for the button UI elements */
u8 filler22[0x2];
u8 ezloNagFuncIndex;
u8 filler25[7];
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;
extern HUD gHUD;
typedef struct {
u16 unk_00;
u8 unk_02[0xE];
} struct_02034480;
extern struct_02034480 gUnk_02034480;
extern u16 gBG0Buffer[0x400];
extern u16 gBG1Buffer[0x400];
extern u16 gBG2Buffer[0x400];
extern u16 gBG3Buffer[0x800];
typedef struct {
u8 event_priority; // system requested priority
u8 ent_priority; // entity requested priority
u8 queued_priority;
u8 queued_priority_reset;
Entity* requester;
u16 priority_timer;
} PriorityHandler;
extern PriorityHandler gPriorityHandler;
typedef struct {
u8 disabled;
u8 screen;
u8 unk2[0xf]; // cursor positions on the different screens
u8 unk11;
u8 unk12;
u8 unk13;
s8 screen2;
u8 unk15;
s8 unk16;
u8 unk17;
} PauseMenuOptions;
extern PauseMenuOptions gPauseMenuOptions;
static_assert(sizeof(PauseMenuOptions) == 0x18);
typedef struct {
u8 unk0;
u8 unk1;
u16 unk2;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
} OAMObj;
typedef struct {
u8 field_0x0;
u8 field_0x1;
u8 spritesOffset;
u8 updated;
u16 _4;
u16 _6;
u8 _0[0x18];
struct OamData oam[0x80];
OAMObj unk[0xA0]; /* todo: affine */
} OAMControls;
extern OAMControls gOAMControls;
typedef struct {
s8 x;
s8 y;
s8 width;
s8 height;
} Rect;
typedef struct {
/*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;
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;
static_assert(sizeof(PossibleInteraction) == 0x188);
extern PossibleInteraction gPossibleInteraction;
typedef struct {
u8 numTiles;
@ -233,60 +16,11 @@ typedef struct {
u32 pad;
} SpritePtr;
extern SpritePtr gSpritePtrs[];
typedef struct {
u8 unk_0;
u8 unk_1;
u8 unk_2[2];
u16 unk_4;
u8 filler[12];
Entity* unk_14;
u8 unk_18;
u8 unk_19;
u8 unk_1a;
u8 unk_1b;
} struct_02018EB0;
extern struct_02018EB0 gUnk_02018EB0;
typedef struct {
/*0x00*/ bool8 isOnlyActiveFirstFrame; /**< Is the behavior for this item only created on the first frame */
/*0x01*/ u8 priority;
/*0x02*/ u8 createFunc;
/*0x03*/ u8 playerItemId; /**< Id for the corresponsing PlayerItem. */
/*0x04*/ u16 frameIndex;
/*0x06*/ u8 animPriority;
/*0x07*/ bool8 isChangingAttackStatus;
/*0x08*/ bool8 isUseableAsMinish;
/*0x09*/ u8 pad[3];
} ItemDefinition;
static_assert(sizeof(ItemDefinition) == 0xc);
extern const SpritePtr gSpritePtrs[];
typedef struct {
u8 frame;
u8 frameIndex;
} PACKED FrameStruct;
typedef struct {
/*0x0*/ u8 menuType;
/*0x1*/ u16 font;
/*0x3*/ u8 unk_3; // TODO padding?
/*0x4*/ u16 transitionTimer;
/*0x6*/ u16 gfxEntry;
/*0x8*/ u16 bg2XOffset;
/*0xa*/ u16 sm_unk_14;
} PACKED StaffrollEntry;
static_assert(sizeof(StaffrollEntry) == 0xc);
typedef struct {
u8 paletteGroup;
u8 gfxGroup;
} PACKED StaffrollGfxEntry;
extern const u8 gGlobalGfxAndPalettes[];
extern u32 gUsedPalettes;
#endif // STRUCTURES_H

View File

@ -2,6 +2,104 @@
#define UI_H
#include "global.h"
#include "sprite.h"
#define MAX_UI_ELEMENTS 24
typedef enum {
UI_ELEMENT_BUTTON_A,
UI_ELEMENT_BUTTON_B,
UI_ELEMENT_BUTTON_R,
UI_ELEMENT_ITEM_A,
UI_ELEMENT_ITEM_B,
UI_ELEMENT_TEXT_R,
UI_ELEMENT_HEART,
UI_ELEMENT_EZLONAGSTART,
UI_ELEMENT_EZLONAGACTIVE,
UI_ELEMENT_TEXT_A,
UI_ELEMENT_TEXT_B
} UIElementType;
/**
* @brief Floating UI element
*/
typedef struct {
u8 used : 1;
u8 unk_0_1 : 1;
u8 unk_0_2 : 2; // Load data into VRAM? 0: do not load, 1: ready to load 2: loaded
u8 unk_0_4 : 4;
u8 type; /**< @see UIElementType */
u8 type2; // Subtype
u8 buttonElementId; /**< Id of the button UI element this text is attached to */
u8 action;
u8 unk_5;
u8 unk_6;
u8 unk_7;
u8 unk_8;
u8 unk_9[3];
u16 x;
u16 y;
u8 frameIndex;
u8 duration;
u8 spriteSettings;
u8 frameSettings;
Frame* framePtr;
u8 unk_18;
u8 numTiles;
u16 unk_1a; // TODO oam id? VRAM target (element->unk_1a * 0x20 + 0x6010000)
u32* firstTile;
} UIElement;
typedef enum {
HUD_HIDE_NONE,
HUD_HIDE_1 = 0x1, // A
HUD_HIDE_2 = 0x2, // B
HUD_HIDE_4 = 0x4, // R
HUD_HIDE_8 = 0x8,
HUD_HIDE_HEARTS = 0x10,
HUD_HIDE_CHARGE_BAR = 0x20,
HUD_HIDE_RUPEES = 0x40,
HUD_HIDE_KEYS = 0x80,
HUD_HIDE_ALL = 0xff
} HUDHideFlags;
typedef struct {
u8 unk_0;
u8 hideFlags;
u8 unk_2;
u8 health;
u8 maxHealth;
u8 unk_5;
u8 unk_6;
u8 unk_7;
u8 unk_8;
u8 unk_9;
u8 unk_a;
u8 unk_b;
u8 unk_c;
u8 unk_d;
u16 rupees;
u8 unk_10; // TODO drawing keys dirty flag or something?
u8 unk_11;
u8 dungeonKeys;
s8 unk_13;
s8 unk_14;
u8 unk_15;
u16 buttonX[3]; /**< X coordinates for the button UI elements */
u16 buttonY[3]; /**< Y coordinates for the button UI elements */
u8 filler22[0x2];
u8 ezloNagFuncIndex;
u8 filler25[7];
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;
extern HUD gHUD;
extern void DrawUIElements(void);
extern void UpdateUIElements(void);

View File

@ -50,4 +50,32 @@ extern bool32 LoadSwapGFX(Entity*, u32, u32);
extern void UnloadGFXSlots(Entity*);
extern void sub_080ADD70(void);
extern u16 gBG0Buffer[0x400];
extern u16 gBG1Buffer[0x400];
extern u16 gBG2Buffer[0x400];
extern u16 gBG3Buffer[0x800];
typedef struct {
u8 unk0;
u8 unk1;
u16 unk2;
u8 unk4;
u8 unk5;
u8 unk6;
u8 unk7;
} OAMObj;
typedef struct {
u8 field_0x0;
u8 field_0x1;
u8 spritesOffset;
u8 updated;
u16 _4;
u16 _6;
u8 _0[0x18];
struct OamData oam[0x80];
OAMObj unk[0xA0]; /* todo: affine */
} OAMControls;
extern OAMControls gOAMControls;
#endif //VRAM_H

View File

@ -1,6 +1,5 @@
#include "affine.h"
#include "global.h"
#include "structures.h"
#include "main.h"
#include "room.h"
#include "screen.h"

View File

@ -8,7 +8,7 @@
#include "asm.h"
#include "assets/gfx_offsets.h"
#include "common.h"
#include "structures.h"
#include "gfx.h"
#include "room.h"
void LoadBgAnimationGfx(const BgAnimationGfx*);

View File

@ -17,10 +17,10 @@
#include "player.h"
#include "screen.h"
#include "scroll.h"
#include "structures.h"
#include "tiles.h"
#include "affine.h"
#include "subtask.h"
#include "ui.h"
extern void sub_0807C898(void);
extern void sub_0805BB74(s32);

View File

@ -2,7 +2,7 @@
#include "entity.h"
#include "player.h"
#include "room.h"
#include "structures.h"
#include "vram.h"
const u8 gUnk_08109202[] = {
255, 8, 24, 255, 0, 4, 28, 255, 16, 12, 20, 255, 255, 255, 255, 255, 0, 0,

View File

@ -3,7 +3,6 @@
#include "common.h"
#include "enemy.h"
#include "entity.h"
#include "structures.h"
#include "global.h"
#include "item.h"
#include "object.h"

View File

@ -3,15 +3,12 @@
#include "common.h"
#include "color.h"
#include "room.h"
#include "global.h"
#include "fileselect.h"
#include "main.h"
#include "physics.h"
#include "structures.h"
#include "gfx.h"
extern Palette gUnk_02001A3C;
void LoadObjPaletteAtIndex(u32 a1, u32 a2);
void LoadObjPaletteAtIndex(u32 a1, u32 paletteIndex);
void CleanUpObjPalettes();
u32 FindFreeObjPalette(u32);
void SetEntityObjPalette(Entity*, s32);
@ -238,21 +235,21 @@ void ChangeObjPalette(Entity* entity, u32 objPaletteId) {
LoadObjPalette(entity, objPaletteId);
}
void LoadObjPaletteAtIndex(u32 objPaletteId, u32 a2) {
void LoadObjPaletteAtIndex(u32 objPaletteId, u32 paletteIndex) {
u16* buffer;
gUsedPalettes |= 1 << (a2 + 16);
USE_PALETTE(paletteIndex + 16);
if (objPaletteId > 5) {
if (objPaletteId == 0x15) {
buffer = gPaletteBuffer;
MemFill16(buffer[0x3C], buffer + (a2 + 16) * 16, 0x20);
MemFill16(buffer[0x3C], buffer + (paletteIndex + 16) * 16, 0x20);
} else if (objPaletteId < 0x15) {
LoadPalettes((u8*)(gPaletteBuffer + (objPaletteId - 6) * 16), a2 + 16, 1);
LoadPalettes((u8*)(gPaletteBuffer + (objPaletteId - 6) * 16), paletteIndex + 16, 1);
} else {
u32 offset = gUnk_08133368[(objPaletteId - 0x16)].WORD_U;
u32 numPalettes = (offset >> 0x18) & 0xf;
offset &= 0xffffff;
LoadPalettes(gGlobalGfxAndPalettes + offset, a2 + 16, numPalettes);
LoadPalettes(&gGlobalGfxAndPalettes[offset], paletteIndex + 16, numPalettes);
}
}
}

View File

@ -16,7 +16,6 @@
#include "screen.h"
#include "sound.h"
#include "subtask.h"
#include "structures.h"
extern u8 gUnk_03003DE0;
extern u8 gzHeap[0x1000];
@ -244,7 +243,7 @@ void LoadPalettes(const u8* src, s32 destPaletteNum, s32 numPalettes) {
u32 size = numPalettes * 32;
u32 usedPalettesMask = 1 << destPaletteNum;
while (--numPalettes > 0) {
usedPalettesMask |= (usedPalettesMask << 1);
usedPalettesMask |= usedPalettesMask << 1;
}
gUsedPalettes |= usedPalettesMask;
dest = &gPaletteBuffer[destPaletteNum * 16];
@ -253,7 +252,7 @@ void LoadPalettes(const u8* src, s32 destPaletteNum, s32 numPalettes) {
void SetColor(u32 colorIndex, u32 color) {
gPaletteBuffer[colorIndex] = color;
gUsedPalettes |= 1 << (colorIndex / 16);
USE_PALETTE(colorIndex / 16);
}
void SetFillColor(u32 color, u32 disable_layers) {

View File

@ -8,7 +8,6 @@
#include "enemy.h"
#include "fade.h"
#include "fileselect.h"
#include "structures.h"
#include "game.h"
#include "main.h"
#include "menu.h"

View File

@ -13,7 +13,6 @@
#include "screen.h"
#include "sound.h"
#include "save.h"
#include "structures.h"
void sub_0805FA04(void);
void sub_0805FA98(void);

View File

@ -16,7 +16,6 @@
#include "menu.h"
#include "sound.h"
#include "affine.h"
#include "structures.h"
void sub_080A30AC(void);
void sub_080A2E40(void);

View File

@ -14,7 +14,7 @@
#include "physics.h"
#include "player.h"
#include "tiles.h"
#include "structures.h"
#include "pauseMenu.h"
#ifndef EU
#include "vram.h"
#endif

View File

@ -16,7 +16,7 @@
#include "physics.h"
#include "player.h"
#include "screen.h"
#include "structures.h"
#include "pauseMenu.h"
typedef struct {
union SplitHWord unk0;

View File

@ -7,7 +7,6 @@
#include "enemy.h"
#include "screenTransitions.h"
#include "script.h"
#include "structures.h"
#include "tiles.h"
#include "player.h"
#include "physics.h"

View File

@ -6,7 +6,7 @@
*/
#include "enemy/octorokBoss.h"
#include "collision.h"
#include "structures.h"
#include "pauseMenu.h"
#include "game.h"
#include "object.h"
#include "asm.h"

View File

@ -12,7 +12,7 @@
#include "physics.h"
#include "player.h"
#include "screen.h"
#include "structures.h"
#include "vram.h"
void sub_0802A39C(Entity*);
void sub_0802A334(Entity*);

View File

@ -9,7 +9,7 @@
#include "area.h"
#include "common.h"
#include "entity.h"
#include "structures.h"
#include "beanstalkSubtask.h"
#include "game.h"
#include "main.h"
#include "object.h"
@ -188,7 +188,7 @@ void Subtask_PortalCutscene_0(void) {
LoadPaletteGroup(ptr->paletteGroup);
LoadGfxGroup(ptr->gfxGroup);
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
gUsedPalettes |= 1 << 21;
USE_PALETTE(21);
EraseAllEntities();
LoadRoomEntityList(gUnk_080D4110[portalId]);
ClearEventPriority();

View File

@ -6,7 +6,6 @@
#include "npc.h"
#include "vram.h"
#include "script.h"
#include "structures.h"
#include "room.h"
#include "player.h"
#include "physics.h"

View File

@ -1,6 +1,6 @@
#include "global.h"
#include "save.h"
#include "structures.h"
#include "vram.h"
#include "screen.h"
#include "common.h"
@ -8,7 +8,13 @@ static u32 sub_080501C0(FadeControl* ctl);
static u32 sub_08050230(FadeControl* ctl);
static u32 sub_080502A4(FadeControl* ctl);
extern u32 gUsedPalettes;
typedef struct {
u8 unk0;
u8 unk1;
u16 unk2;
} struct_020354C0;
extern struct_020354C0 gUnk_020354C0[0x20];
extern u16 gPaletteBuffer[];
extern u16 gUnk_080FC3C4[];

View File

@ -24,7 +24,7 @@
#include "subtask.h"
#include "ui.h"
#include "affine.h"
#include "structures.h"
#include "gfx.h"
// copy, erase, start
#define NUM_FILE_OPERATIONS 3

View File

@ -12,7 +12,6 @@
#include "common.h"
#include "entity.h"
#include "fileselect.h"
#include "structures.h"
#include "main.h"
#include "manager/diggingCaveEntranceManager.h"
#include "message.h"
@ -23,6 +22,7 @@
#include "sound.h"
#include "ui.h"
#include "beanstalkSubtask.h"
#include "pauseMenu.h"
// Game task

View File

@ -23,7 +23,7 @@
#include "ui.h"
#include "subtask.h"
#include "beanstalkSubtask.h"
#include "structures.h"
#include "pauseMenu.h"
u32 StairsAreValid(void);
void ClearFlagArray(const u16*);
@ -828,7 +828,7 @@ void sub_080533CC(void) {
*p2++ = *p1++;
*p2++ = *p1++;
*p2++ = *p1++;
gUsedPalettes |= 1 << 3;
USE_PALETTE(3);
}
void UpdateTimerCallbacks(void) {

View File

@ -10,7 +10,6 @@
#include "save.h"
#include "screen.h"
#include "sound.h"
#include "structures.h"
#include "ui.h"
#include "asm.h"

View File

@ -1,4 +1,4 @@
#include "structures.h"
#include "pauseMenu.h"
#include "item.h"
#include "sound.h"

View File

@ -2,7 +2,7 @@
#include "item.h"
#include "playeritem.h"
#include "sound.h"
#include "structures.h"
#include "ui.h"
#include "room.h"
u32 sub_08077F64(ItemBehavior* arg0, u32 index);

View File

@ -1,6 +1,6 @@
#include "itemDefinitions.h"
#include "item.h"
#include "playeritem.h"
#include "structures.h"
const ItemDefinition gItemDefinitions[] = {
[ITEM_NONE] = { TRUE, 1, CREATE_ITEM_0, PLAYER_ITEM_NONE, 0, 0, FALSE, FALSE },

View File

@ -16,7 +16,7 @@
#include "player.h"
#include "enemy.h"
#include "message.h"
#include "structures.h"
#include "ui.h"
const Wallet gWalletSizes[] = {
{ 100, 0xf060 },

View File

@ -12,7 +12,6 @@
#include "save.h"
#include "screen.h"
#include "sound.h"
#include "structures.h"
extern u32 gRand;

View File

@ -12,7 +12,6 @@
#include "scroll.h"
#include "tiles.h"
#ifndef EU
#include "structures.h"
#endif
void DiggingCaveEntranceManager_Main(DiggingCaveEntranceManager*);

View File

@ -11,7 +11,7 @@
#include "game.h"
#include "message.h"
#include "screen.h"
#include "structures.h"
#include "vram.h"
const u16 gUnk_08108DE8[] = { 0, 0x70b, 0x70c, 0x70d, 0x70e, 0x70f, 0x710, 0x711, 0x712, 0x713, 0x714,
0x715, 0x716, 0x717, 0x718, 0x719, 0x71a, 0x71b, 0x71c, 0x71d, 0x71e, 0x71f,

View File

@ -15,7 +15,7 @@
#include "game.h"
#include "manager/lightManager.h"
#include "assets/gfx_offsets.h"
#include "structures.h"
#include "gfx.h"
typedef enum {
HOLE_TRANSITION_ABSOLUTE,

View File

@ -8,7 +8,7 @@
#include "common.h"
#include "screen.h"
#include "game.h"
#include "structures.h"
#include "vram.h"
#include "room.h"
void sub_08057F20(HorizontalMinishPathBackgroundManager*);

View File

@ -12,7 +12,6 @@
#include "main.h"
#include "screen.h"
#include "game.h"
#include "structures.h"
#include "player.h"
#include "physics.h"

View File

@ -8,7 +8,7 @@
#include "common.h"
#include "room.h"
#include "game.h"
#include "structures.h"
#include "vram.h"
void MinishRaftersBackgroundManager_OnEnterRoom(MinishRaftersBackgroundManager*);
void sub_08058210(MinishRaftersBackgroundManager*);

View File

@ -10,7 +10,8 @@
#include "main.h"
#include "game.h"
#include "assets/gfx_offsets.h"
#include "structures.h"
#include "pauseMenu.h"
#include "gfx.h"
void MinishVillageTileSetManager_OnEnterRoom(void*);
bool32 MinishVillageTileSetManager_UpdateRoomGfxGroup(MinishVillageTileSetManager*);

View File

@ -261,7 +261,7 @@ void RollingBarrelManager_OnEnterRoom(void) {
u32 tmp2;
LoadPaletteGroup(0x28);
MemCopy(gPaletteBuffer + 3 * 16, gPaletteBuffer + 21 * 16, 16 * 2);
gUsedPalettes |= 1 << 21;
USE_PALETTE(21);
LoadGfxGroup(0x16);
tmp = gScreen.lcd.displayControl;
tmp2 = 0;

View File

@ -10,7 +10,6 @@
#include "entity.h"
#include "flags.h"
#include "sound.h"
#include "structures.h"
void SecretManager_Type0_Action2(SecretManager*);
void SecretManager_Type0(SecretManager*);

View File

@ -14,7 +14,8 @@
#include "screen.h"
#include "sound.h"
#include "game.h"
#include "structures.h"
#include "vram.h"
#include "pauseMenu.h"
static const u16 gUnk_081085B8[] = { 0x1008, 0x1007, 0x1006, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009,
0x1008, 0x1007, 0x1006, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009 };

View File

@ -7,7 +7,6 @@
#include "manager/vaati3InsideArmManager.h"
#include "screenTransitions.h"
#include "sound.h"
#include "structures.h"
void sub_0805DBF0(Vaati3InsideArmManager*);
void Vaati3InsideArmManager_Init(Vaati3InsideArmManager*);

View File

@ -15,7 +15,6 @@
#include "game.h"
#include "manager/staticBackgroundManager.h"
#include "player.h"
#include "structures.h"
void WeatherChangeManager_OnEnterRoom(WeatherChangeManager*);
void sub_08059608(WeatherChangeManager*);

View File

@ -8,7 +8,6 @@
#include "common.h"
#include "flags.h"
#include "structures.h"
#include "game.h"
#include "main.h"
#include "menu.h"
@ -23,6 +22,7 @@
#include "subtask.h"
#include "ui.h"
#include "affine.h"
#include "pauseMenu.h"
void sub_080A4DA8(u32);
void sub_080A4B44(void);

View File

@ -8,7 +8,6 @@
#include "common.h"
#include "enemy.h"
#include "flags.h"
#include "structures.h"
#include "kinstone.h"
#include "main.h"
#include "menu.h"

View File

@ -17,7 +17,6 @@
#include "save.h"
#include "screen.h"
#include "sound.h"
#include "structures.h"
#include "subtask.h"
#include "ui.h"
#include "affine.h"
@ -1074,7 +1073,7 @@ void PauseMenu_Screen_5(void) {
paletteColor = *gUnk_02017830;
MemCopy(gUnk_02017830 + 1, gUnk_02017830, 7 * 2);
gUnk_02017830[7] = paletteColor;
gUsedPalettes |= 1 << 12;
USE_PALETTE(12);
}
}

View File

@ -13,7 +13,6 @@
#include "save.h"
#include "screen.h"
#include "affine.h"
#include "structures.h"
typedef struct {
u8 unk0;

View File

@ -6,7 +6,7 @@
#include "message.h"
#include "save.h"
#include "ui.h"
#include "structures.h"
#include "vram.h"
#define MESSAGE_ADVANCE_KEYS (A_BUTTON | B_BUTTON | DPAD_ANY | R_BUTTON)
#define MESSAGE_PRESS_ANY_ADVANCE_KEYS ((gInput.newKeys & MESSAGE_ADVANCE_KEYS) != 0)

View File

@ -11,7 +11,6 @@
#include "npc.h"
#include "room.h"
#include "script.h"
#include "structures.h"
typedef struct {
Rect customHitbox;

View File

@ -12,7 +12,6 @@
#include "save.h"
#include "script.h"
#include "asm.h"
#include "structures.h"
void sub_0806BFD8(Entity* this);

View File

@ -10,7 +10,7 @@
#include "save.h"
#include "script.h"
#include "screen.h"
#include "structures.h"
#include "beanstalkSubtask.h"
#include "physics.h"
typedef struct {

View File

@ -13,7 +13,6 @@
#include "save.h"
#include "script.h"
#include "physics.h"
#include "structures.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -8,7 +8,7 @@
#include "message.h"
#include "npc.h"
#include "player.h"
#include "structures.h"
#include "pauseMenu.h"
#include "room.h"
#include "physics.h"

View File

@ -6,7 +6,6 @@
*/
#include "entity.h"
#include "flags.h"
#include "structures.h"
#include "game.h"
#include "hitbox.h"
#include "item.h"

View File

@ -13,7 +13,6 @@
#include "asm.h"
#include "message.h"
#include "physics.h"
#include "structures.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -12,7 +12,6 @@
#include "message.h"
#include "script.h"
#include "asm.h"
#include "structures.h"
#include "room.h"
typedef struct {

View File

@ -11,7 +11,6 @@
#include "player.h"
#include "save.h"
#include "script.h"
#include "structures.h"
void SmallTownMinish(Entity* this) {
static const Hitbox gUnk_081142FC = { -2, 1, { 0, 0, 0, 0 }, 6, 6 };

View File

@ -13,7 +13,6 @@
#include "message.h"
#include "script.h"
#include "asm.h"
#include "structures.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -18,7 +18,6 @@
#include "save.h"
#include "subtask.h"
#ifndef EU
#include "structures.h"
#endif
#ifndef EU

View File

@ -14,7 +14,6 @@
#include "message.h"
#include "save.h"
#include "script.h"
#include "structures.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -19,7 +19,7 @@
#include "object/cutsceneOrchestrator.h"
#include "save.h"
#include "subtask.h"
#include "structures.h"
#include "pauseMenu.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -10,7 +10,6 @@
#include "kinstone.h"
#include "message.h"
#include "vram.h"
#include "structures.h"
// typedef struct {
// Entity base;

View File

@ -15,7 +15,7 @@
#include "screen.h"
#include "tiles.h"
#include "manager/lightManager.h"
#include "structures.h"
#include "pauseMenu.h"
#include "beanstalkSubtask.h"
typedef struct {

View File

@ -11,7 +11,7 @@
#include "room.h"
#include "physics.h"
#include "player.h"
#include "structures.h"
#include "pauseMenu.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -14,7 +14,7 @@
#include "physics.h"
#include "player.h"
#include "tiles.h"
#include "structures.h"
#include "ui.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -13,7 +13,7 @@
#include "flags.h"
#include "physics.h"
#include "player.h"
#include "structures.h"
#include "gfx.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -10,7 +10,7 @@
#include "message.h"
#include "scroll.h"
#include "asm.h"
#include "structures.h"
#include "ui.h"
#include "room.h"
#include "player.h"

View File

@ -11,7 +11,7 @@
#include "player.h"
#include "object/linkAnimation.h"
#include "item.h"
#include "structures.h"
#include "pauseMenu.h"
typedef enum {
ITEMGET_INIT,

View File

@ -9,7 +9,7 @@
#include "object.h"
#include "room.h"
#include "sound.h"
#include "structures.h"
#include "beanstalkSubtask.h"
void MacroMushroomStalk_Init(Entity*);
void MacroMushroomStalk_Action1(Entity*);

View File

@ -11,7 +11,7 @@
#include "asm.h"
#include "physics.h"
#include "player.h"
#include "structures.h"
#include "beanstalkSubtask.h"
typedef struct {
Entity base;

View File

@ -10,7 +10,6 @@
#include "common.h"
#include "room.h"
#include "screen.h"
#include "structures.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -14,7 +14,7 @@
#include "beanstalkSubtask.h"
#include "manager/lightManager.h"
#include "effects.h"
#include "structures.h"
#include "pauseMenu.h"
typedef struct {
/*0x00*/ Entity base;

View File

@ -6,7 +6,6 @@
*/
#include "effects.h"
#include "entity.h"
#include "structures.h"
#include "save.h"
#include "script.h"
#include "sound.h"

View File

@ -5,7 +5,7 @@
#include "asm.h"
#include "effects.h"
#include "player.h"
#include "structures.h"
#include "pauseMenu.h"
#include "definitions.h"
#include "vram.h"
#include "object/linkAnimation.h"

View File

@ -557,7 +557,7 @@ void sub_0806FEBC(Entity* ent, u32 param_2, Entity* param_3) {
*((u32*)ptr) = 0;
ptr->unk_04.WORD = 0;
ptr->unk_08.WORD = 0;
ptr->unk_0C = (u32)param_3;
ptr->unk_0C = param_3;
ptr->unk_00.unk0 = 1;
ptr->unk_00.unk1 = 1;
}
@ -647,9 +647,9 @@ void sub_0807000C(Entity* this) {
}
static bool32 sub_0807007C(struct_gUnk_020000C0* this, u32 param_2) {
u8* ptr2;
u8* ptr3;
u32* spritePtr;
SpriteFrame* frames;
SpriteFrame* frame;
const SpritePtr* spritePtr;
struct_gUnk_020000C0_1* ptr1 = &this->unk_00[param_2];
if ((ptr1->unk_00.unk3) == 0)
return 0;
@ -658,14 +658,14 @@ static bool32 sub_0807007C(struct_gUnk_020000C0* this, u32 param_2) {
if (ptr1->unk_01 == 0xff)
return 0;
spritePtr = &((u32*)gSpritePtrs)[ptr1->unk_02 * 4];
ptr2 = (u8*)(spritePtr[1]);
if (ptr2 == 0)
spritePtr = &gSpritePtrs[ptr1->unk_02];
frames = spritePtr->frames;
if (frames == 0)
return 0;
ptr3 = &ptr2[ptr1->unk_01 * 4];
ptr1->unk_08.BYTES.byte1 = *ptr3;
ptr1->unk_0C = spritePtr[2] + ((*(u16*)&ptr3[2]) << 5);
frame = &frames[ptr1->unk_01];
ptr1->unk_08.BYTES.byte1 = frame->numTiles;
ptr1->unk_0C = spritePtr->ptr + (frame->firstTileIndex << 5);
return 1;
}

View File

@ -29,7 +29,8 @@
#include "scroll.h"
#include "sound.h"
#include "tiles.h"
#include "structures.h"
#include "ui.h"
#include "pauseMenu.h"
#define kGravityRate Q_8_8(32)
#define kWalkSpeedSlopeSubtractor Q_8_8(0.3125)

View File

@ -8,7 +8,7 @@
#include "entity.h"
#include "save.h"
#include "sound.h"
#include "structures.h"
#include "pauseMenu.h"
#include "vram.h"
#include "asm.h"

View File

@ -26,6 +26,8 @@
#include "tileMap.h"
#include "tiles.h"
#include "backgroundAnimations.h"
#include "itemDefinitions.h"
#include "ui.h"
static void sub_08077E54(ItemBehavior* this);
@ -3817,18 +3819,18 @@ void LoadRoomTileSet(void) {
MemFill16(0xffff, gMapTop.tileTypes, 0x1000);
gMapTop.tileTypes[0] = 0;
if ((void*)gRoomControls.tileSet != (gArea.pCurrentRoomInfo)->tileSet) {
gRoomControls.tileSet = (u32)(gArea.pCurrentRoomInfo)->tileSet;
LoadMapData((gArea.pCurrentRoomInfo)->tileSet);
if ((void*)gRoomControls.tileSet != gArea.pCurrentRoomInfo->tileSet) {
gRoomControls.tileSet = (u32)gArea.pCurrentRoomInfo->tileSet;
LoadMapData(gArea.pCurrentRoomInfo->tileSet);
}
LoadMapData((gArea.pCurrentRoomInfo)->tiles);
LoadMapData(gArea.pCurrentRoomInfo->tiles);
paletteBuffer = gPaletteBuffer;
MemCopy(&paletteBuffer[0x30], &paletteBuffer[0x150], 0x20);
gUsedPalettes |= 0x200000;
USE_PALETTE(21);
if ((gArea.pCurrentRoomInfo)->bg_anim != NULL) {
LoadBgAnimations((gArea.pCurrentRoomInfo)->bg_anim);
if (gArea.pCurrentRoomInfo->bg_anim != NULL) {
LoadBgAnimations(gArea.pCurrentRoomInfo->bg_anim);
}
tileTypes = gMapBottom.tileTypes;

View File

@ -19,7 +19,7 @@
#include "ui.h"
#include "save.h"
#include "subtask.h"
#include "structures.h"
#include "pauseMenu.h"
void InitScriptExecutionContext(ScriptExecutionContext* context, Script* script);
void sub_0807DE80(Entity*);

View File

@ -16,7 +16,6 @@
#include "physics.h"
#include "player.h"
#include "screen.h"
#include "structures.h"
#include "tileMap.h"
#include "tiles.h"

View File

@ -15,7 +15,6 @@
#include "screen.h"
#include "subtask.h"
#include "sound.h"
#include "structures.h"
typedef struct {
/*0x00*/ Menu base;
@ -32,6 +31,23 @@ typedef struct {
} StaffrollMenu;
#define gStaffrollMenu (*(StaffrollMenu*)&gMenu)
typedef struct {
/*0x0*/ u8 menuType;
/*0x1*/ u16 font;
/*0x3*/ u8 unk_3; // TODO padding?
/*0x4*/ u16 transitionTimer;
/*0x6*/ u16 gfxEntry;
/*0x8*/ u16 bg2XOffset;
/*0xa*/ u16 sm_unk_14;
} PACKED StaffrollEntry;
static_assert(sizeof(StaffrollEntry) == 0xc);
typedef struct {
u8 paletteGroup;
u8 gfxGroup;
} PACKED StaffrollGfxEntry;
const Font gUnk_08127280 = {
&gBG1Buffer[0x21], BG_TILE_ADDR(0x188), gTextGfxBuffer, 0, 61472, 240, 0, 0, 0, 0, 0, 5, 0, 1, 0
};

View File

@ -10,7 +10,7 @@
#include "ui.h"
#include "windcrest.h"
#include "affine.h"
#include "structures.h"
#include "beanstalkSubtask.h"
extern Screen gUnk_03001020;
extern u8 gPaletteBufferBackup[];

View File

@ -6,7 +6,6 @@
#include "area.h"
#include "asm.h"
#include "common.h"
#include "structures.h"
#include "game.h"
#include "main.h"
#include "menu.h"

View File

@ -12,7 +12,7 @@
#include "save.h"
#include "affine.h"
#include "asm.h"
#include "structures.h"
#include "pauseMenu.h"
extern void (*const Subtask_FastTravel_Functions[])(void);
void sub_080A6E70(void);

View File

@ -12,7 +12,7 @@
#include "sound.h"
#include "common.h"
#include "affine.h"
#include "structures.h"
#include "vram.h"
void Subtask_LocalMapHint() {
extern void (*const gUnk_08128F1C[])(void);

View File

@ -1,6 +1,5 @@
#include "global.h"
#include "common.h"
#include "structures.h"
#include "asm.h"
#include "enemy.h"
#include "message.h"

View File

@ -14,7 +14,6 @@
#include "room.h"
#include "player.h"
#include "message.h"
#include "structures.h"
#include "save.h"
#include "game.h"
#include "affine.h"

View File

@ -1,3 +1,4 @@
#include "ui.h"
#include "area.h"
#include "common.h"
#include "game.h"
@ -9,6 +10,7 @@
#include "screen.h"
#include "sound.h"
#include "affine.h"
#include "vram.h"
#include "structures.h"
extern void sub_0805ECEC(u32, u32, u32, u32);
@ -609,7 +611,7 @@ void sub_0801CAFC(UIElement* element, u32 frameIndex) {
void sub_0801CB20(UIElement* element, UIElementDefinition* definition) {
if (definition->unk_e == 0) {
SpritePtr* ptr = &gSpritePtrs[definition->spriteIndex];
const SpritePtr* ptr = &gSpritePtrs[definition->spriteIndex];
SpriteFrame* frame = &ptr->frames[element->frameIndex];
u32* firstTile = (u32*)(ptr->ptr + frame->firstTileIndex * 0x20);
u8 numTiles = frame->numTiles;

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "fileselect.h"
#include "vram.h"
#include "structures.h"
#include "gfx.h"
extern u32 gFixedTypeGfxData[];