diff --git a/.gitmodules b/.gitmodules index 797e101808..5475a55a4c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "n64splitter"] path = tools/n64splitter url = https://github.com/ethteck/sm64tools.git +[submodule "tools/star-rod"] + path = tools/star-rod + url = https://github.com/nanaian/star-rod.git diff --git a/Makefile b/Makefile index ed44935c57..412373b776 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ BUILD_DIR = build SRC_DIRS := src src/os ASM_DIRS := asm asm/os +INCLUDE_DIRS := include include/PR DATA_DIRS := bin COMPRESSED_DIRS := yay0 MAP_DIRS := Map_Assets.FS @@ -17,6 +18,9 @@ BGM_DIRS := bgm # Source code files C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c)) S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s)) +ifdef PM_HEADER_REBUILD + H_FILES := $(foreach dir,$(INCLUDE_DIRS),$(wildcard $(dir)/*.h)) +endif DATA_FILES := $(foreach dir,$(DATA_DIRS),$(wildcard $(dir)/*.bin)) COMPRESSED_FILES := $(foreach dir,$(COMPRESSED_DIRS),$(wildcard $(dir)/*.yay0)) MAP_FILES := $(foreach dir,$(MAP_DIRS),$(wildcard $(dir)/*.FS)) @@ -91,7 +95,7 @@ $(BUILD_DIR)/$(TARGET).elf: $(O_FILES) $(LD_SCRIPT) $(BUILD_DIR)/%.o: %.s $(AS) $(ASFLAGS) -o $@ $< -$(BUILD_DIR)/%.o: %.c +$(BUILD_DIR)/%.o: %.c $(H_FILES) cpp $(CPPFLAGS) $< | $(CC) $(CFLAGS) -o - | $(OLD_AS) $(OLDASFLAGS) - -o $@ $(BUILD_DIR)/%.o: %.bin diff --git a/Readme.md b/Readme.md index bcd4306137..7d55b42f3e 100644 --- a/Readme.md +++ b/Readme.md @@ -30,6 +30,7 @@ run `make setup` to set up tools and extract the rom ### Make run `make` to rebuild the rom. Get `OK`? If so, you're all set! Otherwise, please feel free to reach out to us in the discord. +Use `PM_HEADER_REBUILD=1 make` to rebuild C sources when any header files change. ## FAQ * If you received the following error when running `make setup`: diff --git a/include/common.h b/include/common.h index 612c44b7f7..014f24c267 100644 --- a/include/common.h +++ b/include/common.h @@ -7,6 +7,6 @@ #include "functions.h" #include "variables.h" #include "macros.h" -#include "items.h" +#include "enums.h" #endif diff --git a/include/common_structs.h b/include/common_structs.h index 793916d0c7..d52cbefe49 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -4,208 +4,72 @@ #include "ultra64.h" #include "types.h" -typedef struct { - /* 0x000 */ u32 currentButtons; - /* 0x004 */ u32 altCurrentButtons; /* used for battle when flag 80000 set */ - /* 0x008 */ char unk_08[0x8]; - /* 0x010 */ u32 pressedButtons; /* 1 for the frame button begins to be held */ - /* 0x014 */ u32 altPressedButtons; /* used for battle when flag 80000 set */ - /* 0x018 */ char unk_18[0x8]; - /* 0x020 */ u32 heldButtons; /* 1 every 4th frame during hold */ - /* 0x024 */ u32 altHeldButtons; /* used for battle when flag 80000 set */ - /* 0x028 */ char unk_28[0x8]; - /* 0x030 */ u32 prevButtons; /* from previous frame */ - /* 0x034 */ char unk_34[0xC]; - /* 0x040 */ u8 stickX; /* with deadzone */ - /* 0x041 */ u8 altStickX; /* used for battle when flag 80000 set */ - /* 0x042 */ char unk_42[0x2]; - /* 0x044 */ u8 stickY; /* with deadzone */ - /* 0x045 */ u8 altStickY; /* used for battle when flag 80000 set */ - /* 0x046 */ char unk_46[0x2]; - /* 0x048 */ u16 unk_48[4]; - /* 0x050 */ u16 unk_50[4]; - /* 0x058 */ char unk_58[0x10]; - /* 0x068 */ u16 demoButtonInput; - /* 0x06A */ s8 demoStickX; - /* 0x06B */ s8 demoStickY; - /* 0x06C */ u32* mainScriptID; - /* 0x070 */ s8 isBattle; - /* 0x071 */ s8 demoState; /* 0 = not demo, 1 = map demo, 2 = demo transition */ - /* 0x072 */ u8 nextDemoScene; - /* 0x073 */ char unk_73[0x2]; - /* 0x075 */ s8 unk_75; - /* 0x076 */ char unk_76[0x3]; - /* 0x079 */ s8 unk_79; - /* 0x07A */ s8 musicEnabled; - /* 0x07B */ char unk_7B; - /* 0x07C */ s8 unk_7C; - /* 0x07D */ char unk_7D; - /* 0x07E */ u8 peachFlags; /* 1 = peach, 2 = transformed, 4 = has umbrella */ - /* 0x07F */ u8 peachDisguise; /* 1 = koopatrol, 2 = hammer bros, 3 = clubba */ - /* 0x080 */ char unk_80; - /* 0x081 */ s8 unk_81; - /* 0x082 */ s8 unk_82; - /* 0x083 */ s8 unk_83; - /* 0x084 */ char unk_84[0x2]; - /* 0x086 */ s16 areaID; - /* 0x088 */ s16 prevArea; - /* 0x08A */ s16 changedArea; - /* 0x08C */ s16 mapID; - /* 0x08E */ s16 entryID; - /* 0x090 */ char unk_90[0x3]; - /* 0x094 */ f32 exitAngle; - /* 0x098 */ f32 playerPos[3]; - /* 0x0A4 */ f32 playerYaw; - /* 0x0A8 */ s8 unk_A8; - /* 0x0A9 */ char unk_A9; - /* 0x0AA */ s8 unk_AA; - /* 0x0AB */ char unk_AB[0x1]; - /* 0x0AC */ s8 loadMenuState; - /* 0x0AD */ u8 menuCounter; - /* 0x0AE */ char unk_AE[0x08]; - /* 0x0B6 */ s16 boot_alpha; - /* 0x0B8 */ s16 boot_blue; - /* 0x0BA */ s16 boot_green; - /* 0x0BC */ s16 boot_red; - /* 0x0BE */ char unk_BE[0x6A]; - /* 0x128 */ f32 playerTraceNormal[3]; - /* 0x134 */ u16 frameCounter; - /* 0x138 */ s32 nextRNG; - /* 0x13A */ char unk_13A[0x4]; - /* 0x140 */ UNK_PTR shopItemData; - /* 0x144 */ UNK_PTR mapShop; - /* 0x148 */ s16 backgroundFlags; - /* 0x14A */ s16 backgroundMinW; - /* 0x14C */ s16 backgroundMinH; - /* 0x14E */ s16 backgroundMaxW; - /* 0x150 */ s16 backgroundMaxH; - /* 0x152 */ u16 backgroundXOffset; - /* 0x154 */ UNK_PTR backgroundRaster; - /* 0x158 */ UNK_PTR backgroundPalette; - /* 0x15C */ s16 unk_15C; - /* 0x15E */ char unk_15E[0x2]; - /* 0x160 */ s16 savedPos[3]; - /* 0x166 */ s8 saveSlot; - /* 0x167 */ u8 loadType; /* 0 = from map, 1 = from main menu */ - /* 0x168 */ s32 saveCount; - /* 0x16C */ char unk_16C[0x10]; -} game_status; // size = 0x178 +typedef struct matrix4f { + /* 0x00 */ f32 mtx[4][4]; +} matrix4f; // size = 0x40 -typedef enum eItemEntityState { - CollisionWithPlayer=3, - FellBelowWorld=2, - Init=0, - Initialized=1 -} eItemEntityState; +typedef struct matrix4s { + /* 0x00 */ s16 whole[4][4]; + /* 0x20 */ s16 frac[4][4]; +} matrix4s; // size = 0x40 -typedef struct { - /* 0x00 */ f32 verticalVelocity; - /* 0x04 */ f32 gravity; /* 2 = normal, 1 = low gravity, higher values never 'settle' */ - /* 0x08 */ f32 unk_8; - /* 0x0C */ f32 constVelocity; /* ? */ - /* 0x10 */ f32 velx; - /* 0x14 */ f32 velz; - /* 0x18 */ f32 moveAngle; - /* 0x1C */ f32 unk_1C; - /* 0x20 */ f32 unk_20; -} item_entity_physics_data; +typedef struct cam_pos_settings { + /* 0x00 */ f32 boomYaw; + /* 0x04 */ f32 boomLength; + /* 0x08 */ f32 boomPitch; + /* 0x0C */ f32 viewPitch; + /* 0x10 */ f32 position[3]; +} cam_pos_settings; // size = 0x1C -typedef struct { - /* 0x00 */ s32 flags; - /* 0x04 */ s16 boundVar; /* see make_item_entity */ - /* 0x06 */ s16 unk_6; - /* 0x08 */ f32 position[3]; - /* 0x14 */ struct item_entity_physics_data* physicsData; - /* 0x24 */ s16 itemID; /* into item table, also worldIconID */ - /* 0x1A */ eItemEntityState state; - /* 0x1B */ s8 type; - /* 0x1C */ s8 pickupDelay; /* num frames before item can be picked up */ - /* 0x1D */ s8 unk_1D; - /* 0x1E */ s16 wsFaceAngle; /* < 0 means none */ - /* 0x20 */ s16 shadowIndex; - /* 0x22 */ char unk_22[2]; - /* 0x24 */ u32* readPos; - /* 0x28 */ u32 savedReadPos; - /* 0x2C */ s8 unk_2C; - /* 0x2D */ s8 unk_2D; - /* 0x2E */ s8 unkCounter; - /* 0x2F */ s8 unk_2F; - /* 0x30 */ f32 scale; - /* 0x34 */ s16 unk_34; - /* 0x36 */ s16 unk_36; - /* 0x38 */ s16 unk_38; - /* 0x3A */ char unk_3A[2]; - /* 0x3C */ s32 unk_3C; /* coin related? timer? state? */ - /* 0x40 */ s32 unk_40; /* coin sound related? */ - /* 0x44 */ char unk_44[4]; - /* 0x48 */ s32 unk_48; /* coin sound related? */ - /* 0x4C */ s32 unk_4C; - /* 0x50 */ s32 unk_50; - /* 0x54 */ char unk_54[2]; - /* 0x56 */ s16 unk_56; - /* 0x58 */ char unk_58[2]; - /* 0x5A */ s16 unk_5A; -} item_entity; +typedef struct partner_data { + /* 0x00 */ u8 enabled; + /* 0x01 */ u8 level; + /* 0x02 */ s16 unk_02[3]; +} partner_data; // size = 0x08 -typedef struct { - /* 0x00 */ s32 nameString; - /* 0x04 */ s16 iconID; - /* 0x06 */ s16 badgeSortPriority; - /* 0x08 */ s32 targetFlags; - /* 0x0C */ s16 sellValue; - /* 0x10 */ s32 menuString; - /* 0x14 */ s32 itemString; - /* 0x18 */ s16 typeFlags; - /* 0x1A */ s8 moveID; - /* 0x1B */ s8 potencyA; - /* 0x1C */ s8 potencyB; - /* 0x1D */ char unk_1D[3]; -} item_table_entry; +typedef struct heap_node { + /* 0x00 */ UNK_PTR next; + /* 0x04 */ s32 length; + /* 0x08 */ s16 allocated; + /* 0x0A */ s16 entryID; + /* 0x0C */ s32 capacity; +} heap_node; // size = 0x10 -typedef struct { - /* 0x0 */ s8 enabled; - /* 0x1 */ s8 level; - /* 0x2 */ s16 unk_2; - /* 0x4 */ s16 unk_4; - /* 0x6 */ s16 unk_6; -} partner_data; // size = 0x8 - -typedef struct { - /* 0x000 */ s8 bootsLevel; +typedef struct player_data { + /* 0x000 */ u8 bootsLevel; /* 0x001 */ s8 hammerLevel; /* 0x002 */ s8 curHP; /* 0x003 */ s8 curMaxHP; - /* 0x004 */ s8 hardMaxHP; + /* 0x004 */ u8 hardMaxHP; /* 0x005 */ s8 curFP; /* 0x006 */ s8 curMaxFP; - /* 0x007 */ s8 hardMaxFP; - /* 0x008 */ s8 maxBP; - /* 0x009 */ s8 level; - /* 0x00A */ s8 hasActionCommands; + /* 0x007 */ u8 hardMaxFP; + /* 0x008 */ u8 maxBP; + /* 0x009 */ u8 level; + /* 0x00A */ u8 hasActionCommands; /* 0x00B */ char unk_0B; /* 0x00C */ s16 coins; /* 0x00E */ s8 fortressKeyCount; /* 0x00F */ u8 starPieces; /* 0x010 */ s8 starPoints; /* 0x011 */ char unk_11; - /* 0x012 */ s8 currentPartner; + /* 0x012 */ u8 currentPartner; /* 0x013 */ char unk_13; - /* 0x014 */ partner_data partners[12]; + /* 0x014 */ struct partner_data partners[12]; /* 0x074 */ s16 keyItems[32]; /* 0x0B4 */ s16 badges[128]; /* 0x1B4 */ s16 invItems[10]; /* 0x1C8 */ s16 storedItems[32]; /* 0x208 */ s16 equippedBadges[64]; - /* 0x288 */ s8 unk_288; - /* 0x289 */ s8 merleeSpellType; - /* 0x28A */ s8 merleeCastsLeft; + /* 0x288 */ char unk_288; + /* 0x289 */ u8 merleeSpellType; + /* 0x28A */ u8 merleeCastsLeft; /* 0x28B */ char unk_28B; /* 0x28C */ s16 merleeTurnCount; /* 0x28E */ s8 maxStarPower; /* 0x28F */ char unk_28F; /* 0x290 */ s16 specialBarsFilled; - /* 0x292 */ s8 unk_292; - /* 0x293 */ char unk_293; + /* 0x292 */ char unk_292[2]; /* 0x294 */ s16 otherHitsTaken; /* 0x296 */ s16 unk_296; /* 0x298 */ s16 hitsTaken; @@ -214,228 +78,60 @@ typedef struct { /* 0x29E */ s16 enemyFirstStrikes; /* 0x2A0 */ s16 powerBounces; /* 0x2A2 */ s16 battlesCount; - /* 0x2A4 */ s16 unk_2A4; - /* 0x2A6 */ s16 unk_2A6; - /* 0x2A8 */ s16 unk_2A8; - /* 0x2AA */ s16 unk_2AA; + /* 0x2A4 */ s16 unk_2A4[4]; /* 0x2AC */ s32 unk_2AC; /* 0x2B0 */ s32 unk_2B0; /* 0x2B4 */ u32 totalCoinsEarned; /* 0x2B8 */ s16 idleFrameCounter; /* frames with no inputs, overflows ever ~36 minutes of idling */ - /* 0x2BA */ char unk_2BA[0x2]; + /* 0x2BA */ char unk_2BA[2]; /* 0x2BC */ s32 frameCounter; /* increases by 2 per frame */ /* 0x2C0 */ s16 quizzesAnswered; /* 0x2C2 */ s16 quizzesCorrect; /* 0x2C4 */ s32 unk_2C4[12]; /* 0x2F4 */ s32 unk_2F4[12]; - /* 0x2F8 */ char unk_324[4]; + /* 0x324 */ char unk_324; /* 0x328 */ s32 unk_328; /* 0x32C */ s16 starPiecesCollected; /* 0x32E */ s16 jumpGamePlays; - /* 0x330 */ s32 jumpGameTotal; + /* 0x330 */ s32 jumpGameTotal; /* all-time winnings, max = 99999 */ /* 0x334 */ s16 jumpGameRecord; /* 0x336 */ s16 smashGamePlays; - /* 0x338 */ s32 smashGameTotal; + /* 0x338 */ s32 smashGameTotal; /* all-time winnings, max = 99999 */ /* 0x33C */ s16 smashGameRecord; - /* 0x33E */ char unk_33E[0x2]; + /* 0x33E */ char unk_33E[2]; } player_data; // size = 0x340 -typedef enum eActionState { - actionBounce=4, - actionConversation=12, - actionEnemyFirstStrike=27, - actionFalling=8, - actionGroundPound=14, - actionHammer=18, - actionIdle=0, - actionJump=3, - actionLand=10, - actionLaunch=6, - actionRide=33, - actionRun=2, - actionSpin=26, - actionSpinJump=13, - actionSpinningFlower=29, - actionStepDown=9, - actionStepUp=34, - actionUltraJump=15, - actionUltraPound=16, - actionUseSpring=38, - actionWalk=1 -} eActionState; +typedef struct trigger { + /* 0x00 */ s16 genericFlagIndex; + /* 0x02 */ char unk_02[2]; + /* 0x04 */ s16 crateFlagIndex; + /* 0x06 */ s16 panelFlagIndex; + /* 0x08 */ s32 colliderID; + /* 0x0C */ UNK_FUN_PTR(functionHandler); + /* 0x10 */ bytecode* scriptStart; + /* 0x14 */ struct script_context* runningScript; + /* 0x18 */ s32 priority; + /* 0x1C */ s32 scriptVars[3]; + /* 0x28 */ char unk_28[12]; + /* 0x34 */ s32 runningScriptID; +} trigger; // size = 0x38 -typedef enum eFallState { - Falling=1, - Rising=0 -} eFallState; - -typedef struct { - /* 0x000 */ s32 flags; - /* 0x004 */ u32 animFlags; - /* 0x008 */ s16 framesOnGround; /* Number of frames since last jump landed */ - /* 0x00A */ char unk_0A[2]; - /* 0x00C */ s8 peachDisguise; - /* 0x00D */ char unk_0D[3]; - /* 0x010 */ s16 unk_10; - /* 0x012 */ s16 moveFrames; - /* 0x014 */ s8 enableCollisionOverlapsCheck; - /* 0x015 */ s8 statusMenuCounter; /* whether the C-up menu can appear */ - /* 0x016 */ s16 lastGoodPosition[3]; // TODO: Vec3s? - /* 0x01C */ f32 extraVelocity[3]; // TODO: Vec3f? - /* 0x028 */ f32 position[3]; //TODO: Vec3f? - /* 0x034 */ f32 unk_34; - /* 0x038 */ f32 unk_38; - /* 0x03C */ char unk_3C[8]; - /* 0x044 */ f32 decorationPos[2]; - /* 0x04C */ char unk_4C[4]; - /* 0x050 */ f32 jumpApexHeight; - /* 0x054 */ s32 currentSpeed; - /* 0x058 */ f32 walkSpeed; - /* 0x05C */ f32 runSpeed; - /* 0x060 */ char unk_60[4]; - /* 0x064 */ s32 unk_64; - /* 0x068 */ f32 normalPitch; - /* 0x06C */ f32 unk_6C; - /* 0x070 */ f32 gravityIntegrator[4]; - /* 0x080 */ f32 targetYaw; - /* 0x084 */ f32 currentYaw; - /* 0x088 */ s32 unk_88; - /* 0x08C */ char unk_8C[4]; - /* 0x090 */ s32 unk_90; - /* 0x094 */ s32 unk_94; - /* 0x098 */ s32 unk_98; - /* 0x09C */ s32 unk_9C; - /* 0x0A0 */ f32 heading; - /* 0x0A4 */ char unk_A4[4]; - /* 0x0A8 */ f32 spriteFacingAngle; /* angle of sprite, relative to camera, from 0 to 180 */ - /* 0x0AC */ char unk_AC[4]; - /* 0x0B0 */ s16 colliderHeight; - /* 0x0B2 */ s16 colliderDiameter; - /* 0x0B4 */ eActionState actionState; - /* 0x0B5 */ eActionState prevActionState; - /* 0x0B6 */ eFallState fallState; - /* 0x0B7 */ char unk_B7; - /* 0x0B8 */ s32 anim; - /* 0x0BC */ char unk_BC[2]; - /* 0x0BE */ s8 renderMode; - /* 0x0BF */ s8 unk_BF; - /* 0x0C0 */ u32* decorationList; - /* 0x0C4 */ char unk_C4; - /* 0x0C5 */ s8 unk_C5; - /* 0x0C6 */ char unk_C6[6]; - /* 0x0CC */ s32 shadowID; - /* 0x0D0 */ char unk_D0[8]; - /* 0x0D8 */ s32 unk_D8; - /* 0x0DC */ s32 currentButtons; - /* 0x0E0 */ s32 pressedButtons; - /* 0x0E4 */ s32 heldButtons; - /* 0x0E8 */ f32 stickAxis[2]; - /* 0x0F0 */ s32 currentButtonsBuffer[10]; - /* 0x118 */ s32 pressedButtonsBuffer[10]; - /* 0x140 */ s32 heldButtonsBuffer[10]; - /* 0x168 */ f32 stickXBuffer[10]; - /* 0x190 */ f32 stickYBuffer[10]; - /* 0x1B8 */ s32 inputBufPos; - /* 0x1BC */ char unk_1BC[0xCC]; -} player_status; // size = 0x288 - -typedef struct { - /* 0x00 */ s32 hpIconIndexes[2]; /* hpIconIndex, heartIconIndex */ - /* 0x08 */ s32 fpIconIndexes[2]; /* fpIconIndex, flowerIconIndex */ - /* 0x10 */ s32 coinIconIndex; - /* 0x14 */ s32 coinIconIndex2; - /* 0x18 */ s32 starpointsIconIndex; - /* 0x1C */ s32 starpointsIconIndex2; - /* 0x20 */ s32 iconIndex8; - /* 0x24 */ s32 iconIndex9; - /* 0x28 */ s32 iconIndexA; - /* 0x2C */ s32 iconIndexB; - /* 0x30 */ s32 iconIndexC; - /* 0x34 */ s16 drawPosX; /* overall x-offset for whole UI */ - /* 0x36 */ s16 drawPosY; /* modulated as it appears, goes away */ - /* 0x38 */ s16 showTimer; - /* 0x3A */ s8 hidden; - /* 0x3B */ s8 unk_3B; - /* 0x3C */ s8 unk_3C; - /* 0x3D */ s8 displayHP; - /* 0x3E */ s8 displayFP; - /* 0x3F */ char unk_3F; - /* 0x40 */ s16 displayCoins; - /* 0x42 */ s16 displayStarpoints; - /* 0x44 */ s8 ignoreChanges; /* set != 0 to prevent automatic opening from HP/FP changes */ - /* 0x45 */ s8 unk_45; - /* 0x46 */ s8 unk_46; - /* 0x47 */ s8 disabled; /* set != 0 for menu to be disabled completely */ - /* 0x48 */ s16 displaySP; - /* 0x4A */ s8 hpBlinking; - /* 0x4B */ s8 hpBlinkCounter; - /* 0x4C */ s8 hpBlinkTimer; - /* 0x4D */ s8 fpBlinking; - /* 0x4E */ s8 fpBlinkCounter; - /* 0x4F */ s8 fpBlinkTimer; - /* 0x50 */ s8 spBlinking; - /* 0x51 */ s8 spBlinkCounter; - /* 0x52 */ s8 starpointsBlinking; - /* 0x53 */ s8 starpointsBlinkCounter; - /* 0x54 */ s8 coinsBlinking; - /* 0x55 */ s8 coinsBlinkCounter; - /* 0x56 */ s8 coinsBlinkTimer; - /* 0x57 */ s8 unk_57; - /* 0x58 */ s8 unk_58; - /* 0x59 */ s8 unk_59; - /* 0x5A */ s8 spBarsToBlink; /* how many sp bars to blink */ - /* 0x5B */ char unk_5B; - /* 0x5C */ s32 iconIndex10; - /* 0x60 */ s32 iconIndex11; - /* 0x64 */ s32 iconIndex12; - /* 0x68 */ s32 iconIndex13; - /* 0x6C */ s8 unk_6C; - /* 0x6D */ s8 unk_6D; - /* 0x6E */ s8 unk_6E; - /* 0x6F */ char unk_6F; -} ui_status; // size = 0x70 - -typedef struct { - /* 0x00 */ char unk_00[0x4]; - /* 0x04 */ s16 height; - /* 0x06 */ s16 radius; - /* 0x08 */ void* otherAI; //? - /* 0x0C */ s32* interactScript; - /* 0x10 */ s32* aiScript; - /* 0x14 */ s32* hitScript; - /* 0x18 */ s32* auxScript; - /* 0x1C */ s32* defeatScript; - /* 0x20 */ s32 flags; - /* 0x24 */ char unk_24[0x4]; - /* 0x28 */ s16 level; - /* 0x2A */ s16 unkFlags; -} StaticNpcSettings; // size = 0x2C - -typedef enum { - triggerHammer=4, - triggerJump=2, - triggerNormal=1, - triggerPartner=6, - triggerSpin=3, -} eEncounterTrigger; - -typedef struct { +typedef struct enemy { /* 0x00 */ s32 flags; - /* 0x04 */ s8 encounterIndex; - /* 0x05 */ s8 encountered; // eEncounterTrigger - /* 0x06 */ s8 scriptGroup; /* scripts launched for this npc controller will be assigned this group */ - /* 0x07 */ s8 unk_07; + /* 0x04 */ u8 encounterIndex; + /* 0x05 */ s8 encountered; + /* 0x06 */ u8 scriptGroup; /* scripts launched for this npc controller will be assigned this group */ + /* 0x07 */ char unk_07; /* 0x08 */ s16 npcID; /* 0x0A */ s16 spawnPos[3]; - /* 0x10 */ s16 unk_10[3]; - /* 0x16 */ char unk_16[0x2]; - /* 0x18 */ struct StaticNpcSettings* npcSettings; - /* 0x1C */ s32* initBytecode; - /* 0x20 */ s32* interactBytecode; - /* 0x24 */ s32* aiBytecode; - /* 0x28 */ s32* hitBytecode; - /* 0x2C */ s32* auxBytecode; - /* 0x30 */ s32* defeatBytecode; + /* 0x10 */ char unk_10[8]; + /* 0x18 */ struct static_npc_settings* npcSettings; + /* 0x1C */ bytecode* initBytecode; + /* 0x20 */ bytecode* interactBytecode; + /* 0x24 */ bytecode* aiBytecode; + /* 0x28 */ bytecode* hitBytecode; + /* 0x2C */ bytecode* auxBytecode; + /* 0x30 */ bytecode* defeatBytecode; /* 0x34 */ struct script_context* initScript; /* 0x38 */ struct script_context* interactScript; /* 0x3C */ struct script_context* aiScript; @@ -448,48 +144,53 @@ typedef struct { /* 0x58 */ s32 hitScriptID; /* 0x5C */ s32 auxScriptID; /* 0x60 */ s32 defeatScriptID; - /* 0x64 */ void* unk_64; - /* 0x68 */ char unk_68[0x4]; + /* 0x64 */ char unk_64[8]; /* 0x6C */ s32 varTable[16]; - /* 0xAC */ s8 unk_AC; - /* 0xAD */ char unk_AD[0x3]; - /* 0xB0 */ s32* unk_B0; /* might be flags of some sort */ - /* 0xB4 */ s8 unk_B4; - /* 0xB5 */ s8 unk_B5; - /* 0xB6 */ char unk_B6[0x2]; + /* 0xAC */ char unk_AC[12]; /* 0xB8 */ s32 unkSettings24; - /* 0xBC */ s32 unk_BC; - /* 0xC0 */ s32 unk_C0; - /* 0xC4 */ s32 unk_C4; - /* 0xC8 */ char unk_C8[0x4]; - /* 0xCC */ s32* animList; - /* 0xD0 */ s32* territoryData; - /* 0xD4 */ s32* dropTables; + /* 0xBC */ char unk_BC[16]; + /* 0xCC */ UNK_PTR animList; + /* 0xD0 */ UNK_PTR territoryData; + /* 0xD4 */ UNK_PTR dropTables; /* 0xD8 */ u32 tattleString; - /* 0xDC */ s32 unk_DC; - /* 0xE0 */ s16 unk_E0; - /* 0xE2 */ char unk_E2[0xE]; + /* 0xDC */ char unk_DC[20]; } enemy; // size = 0xF0 -typedef struct { - /* 0x000 */ s8 state; - /* 0x001 */ s8 currentArgc; - /* 0x002 */ s8 currentOpcode; - /* 0x003 */ s8 priority; - /* 0x004 */ s8 groupFlags; - /* 0x005 */ s8 blocked; /* 1 = blocking */ +typedef struct static_npc_settings { + /* 0x00 */ char unk_00[4]; + /* 0x04 */ s16 height; + /* 0x06 */ s16 radius; + /* 0x08 */ UNK_PTR otherAI; + /* 0x0C */ bytecode* interactScript; + /* 0x10 */ bytecode* aiScript; + /* 0x14 */ bytecode* hitScript; + /* 0x18 */ bytecode* auxScript; + /* 0x1C */ bytecode* defeatScript; + /* 0x20 */ s32 flags; + /* 0x24 */ char unk_24[4]; + /* 0x28 */ s16 level; + /* 0x2A */ s16 unkFlags; +} static_npc_settings; // size = 0x2C + +typedef struct script_context { + /* 0x000 */ u8 state; + /* 0x001 */ u8 currentArgc; + /* 0x002 */ u8 currentOpcode; + /* 0x003 */ u8 priority; + /* 0x004 */ u8 groupFlags; + /* 0x005 */ u8 blocked; /* 1 = blocking */ /* 0x006 */ s8 loopDepth; /* how many nested loops we are in, >= 8 hangs forever */ /* 0x007 */ s8 switchDepth; /* how many nested switches we are in, max = 8 */ - /* 0x008 */ s32* ptrNextLine; - /* 0x00C */ s32* ptrReadPos; - /* 0x010 */ s8 labelIndices[16]; - /* 0x020 */ s32* labelPositions[16]; + /* 0x008 */ bytecode* ptrNextLine; + /* 0x00C */ bytecode* ptrReadPos; + /* 0x010 */ u8 labelIndices[16]; + /* 0x020 */ UNK_PTR labelPositions[16]; /* 0x060 */ s32 deleted; /* set to zero in KillScript when malloc'd */ /* 0x064 */ struct script_context* blockingParent; /* parent? */ /* 0x068 */ struct script_context* childScript; /* 0x06C */ struct script_context* parentScript; /* brother? */ /* 0x070 */ s32 functionTemp[4]; - /* 0x080 */ void* callFunction; + /* 0x080 */ UNK_PTR callFunction; /* 0x084 */ u32 varTable[16]; /* 0x0C4 */ s32 varFlags[3]; /* 0x0D0 */ s32 loopStartTable[8]; @@ -497,18 +198,1051 @@ typedef struct { /* 0x110 */ u8 switchBlockState[8]; /* 0x118 */ s32 switchBlockValue[8]; /* 0x138 */ s32* buffer; - /* 0x13C */ void* array; - /* 0x140 */ void* flagArray; + /* 0x13C */ UNK_PTR array; + /* 0x140 */ UNK_PTR flagArray; /* 0x144 */ s32 uniqueID; - /* 0x148 */ enemy* ownerActorID; /* controller*, battle ID, trigger* */ + /* 0x148 */ struct enemy* ownerActorID; /* controller*, battle ID, trigger* */ /* 0x14C */ u32 ownerID; /* can be an npcID, a triggerID, a trigger ptr */ /* 0x150 */ f32 timeScale; /* 0x154 */ f32 frameCounter; - /* 0x158 */ s32 unk_158; - /* 0x15C */ s32* ptrFirstLine; - /* 0x160 */ s32* ptrSavedPosition; - /* 0x164 */ s32* ptrCurrentLine; -} script_context; // size = 0x168; + /* 0x158 */ char unk_158[4]; + /* 0x15C */ bytecode* ptrFirstLine; + /* 0x160 */ bytecode* ptrSavedPosition; + /* 0x164 */ bytecode* ptrCurrentLine; +} script_context; // size = 0x168 + +typedef struct entity { + /* 0x00 */ s32 flags; + /* 0x04 */ char unk_04[7]; + /* 0x0B */ u8 alpha; /* reported by rain */ + /* 0x0C */ s16 aabb[3]; + /* 0x12 */ char unk_12[4]; + /* 0x16 */ s16 shadowIndex; + /* 0x18 */ char unk_18[16]; + /* 0x28 */ bytecode* boundScript; + /* 0x2C */ char unk_2C[12]; + /* 0x38 */ struct static_entity_data* static_data; + /* 0x3C */ char unk_3C[4]; + /* 0x40 */ struct trigger* trigger; + /* 0x44 */ s32* vertexData; + /* 0x48 */ f32 position[3]; + /* 0x54 */ f32 scale[3]; + /* 0x60 */ f32 rotation[3]; + /* 0x6C */ char unk_6C[4]; + /* 0x70 */ struct matrix4f* inverseTransformMatrix; /* world-to-local */ + /* 0x74 */ char unk_74[60]; + /* 0xB0 */ u8 radius; /* Created by retype action */ + /* 0xB1 */ char unk_B1[71]; +} entity; // size = 0xF8 + +typedef struct static_entity_data { + /* 0x00 */ s16 flags; + /* 0x02 */ s16 argSize; + /* 0x04 */ char unk_04[8]; + /* 0x0C */ UNK_FUN_PTR(unk_data_func); + /* 0x10 */ UNK_PTR unk_data_ptr1; + /* 0x14 */ UNK_PTR unk_data_ptr2; + /* 0x18 */ s32 dmaStart; + /* 0x1C */ s32 dmaEnd; + /* 0x20 */ char unk_20[4]; +} static_entity_data; // size = 0x24 + +typedef struct music_player { + /* 0x00 */ s16 unkFlags; + /* 0x02 */ char unk_02[2]; + /* 0x04 */ s32 fadeOutTime; + /* 0x08 */ s32 fadeInTime; + /* 0x0C */ char unk_0C[4]; + /* 0x10 */ s32 songID; + /* 0x14 */ s32 variation; + /* 0x18 */ char unk_18[24]; +} music_player; // size = 0x30 + +typedef struct StaticNPC { + /* 0x000 */ s32 ID; + /* 0x004 */ struct StaticNpcSettings* npcSettings; + /* 0x008 */ s32 spawnPos[3]; + /* 0x014 */ s32 flags; + /* 0x018 */ bytecode* initScript; + /* 0x01C */ char unk_1C[8]; + /* 0x024 */ s32 spawnYaw; + /* 0x028 */ s16 itemDrops[25]; + /* 0x05A */ s16 heartDrops[32]; + /* 0x09A */ s16 flowerDrops[32]; + /* 0x0DA */ s16 minCoinBonus; + /* 0x0DC */ s16 maxCoinBonus; + /* 0x0DE */ char unk_DE[2]; + /* 0x0E0 */ s32 movementData[48]; + /* 0x1A0 */ s32 animations[16]; + /* 0x1E0 */ char unk_1E0[8]; + /* 0x1E8 */ UNK_PTR extraAnimations; + /* 0x1EC */ s32 tattle; +} StaticNPC; // size = 0x1F0 + +typedef struct MenuIcon { + /* 0x00 */ u32 flags; + /* 0x04 */ u32* readPos; + /* 0x08 */ u32* startReadPos; + /* 0x0C */ u32* ptrPropertyList; + /* 0x10 */ u32* imageAddr; + /* 0x14 */ u32* paletteAddr; + /* 0x18 */ u32 memOffset; + /* 0x1C */ char unk_1C[24]; + /* 0x34 */ f32 widthScaleF; /* X.10 fmt (divide by 1024.0 to get float) */ + /* 0x38 */ f32 heightScaleF; /* X.10 fmt (divide by 1024.0 to get float) */ + /* 0x3C */ s16 renderPosX; + /* 0x3E */ s16 renderPosY; + /* 0x40 */ u8 screenPosOffset[2]; + /* 0x42 */ u8 worldPosOffset[3]; + /* 0x45 */ char unk_45[2]; + /* 0x47 */ u8 updateTimer; + /* 0x48 */ u8 sizeX; /* screen size? */ + /* 0x49 */ u8 sizeY; /* screen size? */ + /* 0x4A */ char unk_4A[10]; +} MenuIcon; // size = 0x54 + +typedef struct ui_status { + /* 0x00 */ s32 hpIconIndexes[2]; + /* 0x08 */ s32 fpIconIndexes[2]; + /* 0x10 */ s32 coinIconIndex; + /* 0x14 */ s32 coinIconIndex2; /* purpose? */ + /* 0x18 */ s32 starpointsIconIndex; + /* 0x1C */ s32 starpointsIconIndex2; /* purpose? */ + /* 0x20 */ s32 iconIndex8; + /* 0x24 */ s32 iconIndex9; + /* 0x28 */ s32 iconIndexA; + /* 0x2C */ s32 iconIndexB; + /* 0x30 */ s32 iconIndexC; + /* 0x34 */ s16 drawPosX; /* overall x-offset for whole UI */ + /* 0x36 */ s16 drawPosY; /* modulated as it appears, goes away */ + /* 0x38 */ s16 showTimer; + /* 0x3A */ s8 hidden; + /* 0x3B */ s8 unk_3B[2]; + /* 0x3D */ u8 displayHP; + /* 0x3E */ u8 displayFP; + /* 0x3F */ char unk_3F; + /* 0x40 */ s16 displayCoins; + /* 0x42 */ s16 displayStarpoints; + /* 0x44 */ s8 ignoreChanges; /* set != 0 to prevent automatic opening from HP/FP changes */ + /* 0x45 */ s8 unk_45[2]; + /* 0x47 */ s8 disabled; /* set != 0 for menu to be disabled completely */ + /* 0x48 */ s16 displaySP; + /* 0x4A */ s8 hpBlinking; /* bool */ + /* 0x4B */ u8 hpBlinkCounter; + /* 0x4C */ u8 hpBlinkTimer; /* until stop */ + /* 0x4D */ s8 fpBlinking; /* bool */ + /* 0x4E */ u8 fpBlinkCounter; + /* 0x4F */ u8 fpBlinkTimer; /* until stop */ + /* 0x50 */ s8 spBlinking; + /* 0x51 */ u8 spBlinkCounter; + /* 0x52 */ s8 starpointsBlinking; /* bool */ + /* 0x53 */ u8 starpointsBlinkCounter; + /* 0x54 */ s8 coinsBlinking; /* bool */ + /* 0x55 */ u8 coinsBlinkCounter; + /* 0x56 */ u8 coinsBlinkTimer; /* until stop */ + /* 0x57 */ char unk_57[3]; + /* 0x5A */ u8 spBarsToBlink; /* how many sp bars to blink */ + /* 0x5B */ char unk_5B; + /* 0x5C */ s32 iconIndex10; + /* 0x60 */ s32 iconIndex11; + /* 0x64 */ s32 iconIndex12; + /* 0x68 */ s32 iconIndex13; + /* 0x6C */ s8 unk_6C[4]; +} ui_status; // size = 0x70 + +typedef struct collider { + /* 0x00 */ s32 flags; + /* 0x04 */ s16 nextSibling; + /* 0x06 */ s16 firstChild; + /* 0x08 */ s16 parentModelIndex; + /* 0x0A */ s16 numTriangles; + /* 0x0C */ struct collider_triangle* triangleTable; + /* 0x10 */ struct collider_aabb* aabb; + /* 0x14 */ char unk_14[4]; + /* 0x18 */ f32* vertexTable[3]; +} collider; // size = 0x1C + +typedef struct camera { + /* 0x000 */ s16 flags; + /* 0x002 */ s16 moveFlags; + /* 0x004 */ s16 mode; + /* 0x006 */ char unk_06[4]; + /* 0x00A */ s16 viewportW; + /* 0x00C */ s16 viewportH; + /* 0x00E */ s16 viewportStartX; + /* 0x010 */ s16 viewportStartY; + /* 0x012 */ s16 nearClip; + /* 0x014 */ s16 farClip; + /* 0x016 */ char unk_16[2]; + /* 0x018 */ f32 vfov; + /* 0x01C */ char unk_1C[14]; + /* 0x02A */ s16 zoomPercent; + /* 0x02C */ s16 backgroundColor[3]; + /* 0x032 */ s16 targetScreenCoords[3]; + /* 0x038 */ s16 perspNorm; + /* 0x03A */ char unk_3A[2]; + /* 0x03C */ f32 lookAt_eye[3]; + /* 0x048 */ f32 lookAt_obj[3]; + /* 0x054 */ char unk_54[12]; + /* 0x060 */ f32 targetPos[3]; + /* 0x06C */ f32 currentYaw; + /* 0x070 */ char unk_70[4]; + /* 0x074 */ f32 currentBoomYaw; + /* 0x078 */ f32 currentBoomLength; + /* 0x07C */ f32 currentYOffset; + /* 0x080 */ char unk_80[4]; + /* 0x084 */ f32 trueRotation[3]; + /* 0x090 */ f32 currentBlendedYawNegated; + /* 0x094 */ f32 currentPitch; + /* 0x098 */ char unk_98[60]; + /* 0x0D4 */ struct matrix4f perspectiveMatrix; + /* 0x114 */ struct matrix4f viewMtxPlayer; /* centers on player */ + /* 0x154 */ struct matrix4f viewMtxLeading; /* leads player slightly */ + /* 0x194 */ struct matrix4f viewMtxShaking; /* used while ShakeCam is active */ + /* 0x1D4 */ char unk_1D4[48]; + /* 0x204 */ struct matrix4s* unkMatrix; + /* 0x208 */ char unk_208[572]; + /* 0x444 */ struct zone* prevZone; + /* 0x448 */ struct zone* currentZone; + /* 0x44C */ struct cam_pos_settings initialSettings; /* for start of blend between zones */ + /* 0x468 */ struct cam_pos_settings targetSettings; /* goal for blend between zones */ + /* 0x484 */ f32 sinInterpAlpha; + /* 0x488 */ f32 linearInterp; + /* 0x48C */ f32 linearInterpScale; /* 3.0? */ + /* 0x490 */ f32 moveSpeed; + /* 0x494 */ char unk_494[28]; + /* 0x4B0 */ f32 movePos[3]; + /* 0x4BC */ char unk_4BC[28]; + /* 0x4D8 */ s32 controllerType; + /* 0x4DC */ f32 controllerBoomLen; + /* 0x4E0 */ f32 controllerBoomPitch; + /* 0x4E4 */ f32 posA[3]; + /* 0x4F0 */ f32 posB[3]; + /* 0x4FC */ f32 controllerViewPitch; + /* 0x500 */ char unk_500[4]; + /* 0x504 */ s16 boolTargetPlayer; + /* 0x506 */ char unk_506[2]; + /* 0x508 */ s32 panPhase; + /* 0x50C */ f32 leadAmount; + /* 0x510 */ char unk_510[36]; + /* 0x534 */ struct collider_aabb* aabbForZoneBelow; + /* 0x538 */ char unk_538[32]; +} camera; // size = 0x558 + +typedef struct battle_status { + /* 0x000 */ s32 flags1; + /* 0x004 */ s32 flags2; + /* 0x008 */ s32 varTable[16]; + /* 0x048 */ u8 currentSubmenu; + /* 0x049 */ char unk_49[10]; + /* 0x053 */ u8 stratsLastCursorPos; + /* 0x054 */ char unk_54[36]; + /* 0x078 */ u8 totalStarPoints; + /* 0x079 */ u8 pendingStarPoints; /* how many to add */ + /* 0x07A */ u8 incrementStarPointDelay; /* related to star points, set to 0x28 when they are dropped */ + /* 0x07B */ u8 damageTaken; + /* 0x07C */ u8 changePartnerAllowed; + /* 0x07D */ char unk_7D[10]; + /* 0x087 */ u8 blockResult; /* 0 = fail, 1 = success, -1 = mashed */ + /* 0x088 */ u8 itemUsesLeft; /* set to 2 for doublke dip, 3 for triple */ + /* 0x089 */ u8 hpDrainCount; + /* 0x08A */ char unk_8A; + /* 0x08B */ u8 hustleTurns; /* numTurns from hustle drink, normally 0 */ + /* 0x08C */ char unk_8C[2]; + /* 0x08E */ u8 initialEnemyCount; /* used for SP award bonus */ + /* 0x08F */ char unk_8F[7]; + /* 0x096 */ u8 hammerCharge; + /* 0x097 */ u8 jumpCharge; + /* 0x098 */ char unk_98; + /* 0x099 */ u8 dangerFlags; /* 1 = danger, 2 = peril */ + /* 0x09A */ u8 outtaSightActive; + /* 0x09B */ u8 turboChargeTurnsLeft; + /* 0x09C */ u8 turboChargeAmount; /* unused? */ + /* 0x09D */ u8 waterBlockTurnsLeft; + /* 0x09E */ u8 waterBlockAmount; /* unused? */ + /* 0x09F */ char unk_9F[5]; + /* 0x0A4 */ u8 cloudNineTurnsLeft; + /* 0x0A5 */ u8 cloudNineDodgeChance; /* = 50% */ + /* 0x0A6 */ char unk_A6[2]; + /* 0x0A8 */ s32 cloudNineEffect; + /* 0x0AC */ char unk_AC[2]; + /* 0x0AE */ u8 hammerLossTurns; + /* 0x0AF */ u8 jumpLossTurns; + /* 0x0B0 */ u8 itemLossTurns; + /* 0x0B1 */ char unk_B1[3]; + /* 0x0B4 */ UNK_FUN_PTR(preUpdateCallback); + /* 0x0B8 */ char unk_B8[4]; + /* 0x0BC */ struct script_context* controlScript; /* control handed over to this when changing partners, maybe general? */ + /* 0x0C0 */ s32 controlScriptID; + /* 0x0C4 */ struct script_context* camMovementScript; + /* 0x0C8 */ s32 camMovementScriptID; + /* 0x0CC */ char unk_CC[12]; + /* 0x0D8 */ struct Actor* playerActor; + /* 0x0DC */ struct Actor* partnerActor; + /* 0x0E0 */ struct Actor* enemyActors[24]; + /* 0x0E4 */ char unk_E4[92]; + /* 0x140 */ s16 enemyIDs[24]; + /* 0x170 */ char unk_170; + /* 0x171 */ u8 numEnemyActors; + /* 0x172 */ char unk_172[6]; + /* 0x178 */ u8 moveCategory; + /* 0x179 */ char unk_179; + /* 0x17A */ s16 selectedItemID; + /* 0x17C */ s16 selectedMoveID; + /* 0x17E */ s16 currentAttackDamage; + /* 0x180 */ s16 lastAttackDamage; + /* 0x182 */ char unk_182[2]; + /* 0x184 */ s32 currentTargetListFlags; /* set when creating a target list, also obtain from the flags field of moves */ + /* 0x188 */ s32 currentAttackElement; + /* 0x18C */ s32 currentAttackEventSuppression; + /* 0x190 */ s32 currentAttackStatus; + /* 0x194 */ u8 statusChance; + /* 0x195 */ u8 statusDuration; + /* 0x196 */ char unk_196; + /* 0x197 */ u8 targetHomeIndex; /* some sort of home idnex used for target list construction */ + /* 0x198 */ u8 powerBounceCounter; + /* 0x199 */ u8 wasStatusInflicted; /* during last attack */ + /* 0x19A */ char unk_19A[6]; + /* 0x1A0 */ s16 currentTargetID; /* selected? */ + /* 0x1A2 */ u8 currentTargetPart; /* selected? */ + /* 0x1A3 */ char unk_1A3; + /* 0x1A4 */ s16 currentTargetID2; + /* 0x1A6 */ u8 currentTargetPart2; + /* 0x1A7 */ u8 battlePhase; + /* 0x1A8 */ s16 attackerActorID; + /* 0x1AA */ char unk_1AA[4]; + /* 0x1AE */ s16 submenuIcons[24]; /* icon IDs */ + /* 0x1DE */ u8 submenuMoves[24]; /* move IDs */ + /* 0x1F6 */ u8 submenuEnabled[24]; + /* 0x20E */ u8 submenuMoveCount; + /* 0x20F */ char unk_20F; + /* 0x210 */ s32 currentButtonsDown; + /* 0x214 */ s32 currentButtonsPressed; + /* 0x218 */ s32 currentButtonsHeld; + /* 0x21C */ f32 stickX; + /* 0x220 */ f32 stickY; + /* 0x224 */ s32 inputBitmask; + /* 0x228 */ s32 dpadX; /* 0-360 */ + /* 0x22C */ s32 dpadY; /* 0-60 */ + /* 0x230 */ s32 holdInputBuffer[64]; + /* 0x330 */ s32 pushInputBuffer[64]; + /* 0x430 */ u8 holdInputBufferPos; + /* 0x431 */ u8 inputBufferPos; + /* 0x432 */ char unk_432[6]; + /* 0x438 */ s32* foregroundModelList; + /* 0x43C */ UNK_PTR turboChargeCounter; + /* 0x440 */ u8 tattleFlags[27]; + /* 0x45B */ char unk_45B[17]; + /* 0x46C */ s32 battleState; /* 0 = load assets, 1 = create actors, 4 = start scripts, 7 & 8 = unk */ + /* 0x470 */ char unk_470[10]; + /* 0x47A */ u8 currentBattleSection; + /* 0x47B */ char unk_47B[21]; +} battle_status; // size = 0x490 + +typedef struct texture_header { + /* 0x00 */ s8 name[32]; + /* 0x20 */ s16 auxW; + /* 0x22 */ s16 mainW; + /* 0x24 */ s16 auxH; + /* 0x26 */ s16 mainH; + /* 0x28 */ char unk_28; + /* 0x29 */ u8 extraTiles; + /* 0x2A */ u8 colorCombine; + /* 0x2B */ u8 fmt; + /* 0x2C */ u8 bitDepth; + /* 0x2D */ u8 wrapH; + /* 0x2E */ u8 wrapV; + /* 0x2F */ u8 filtering; +} texture_header; // size = 0x30 + +typedef struct StaticActorData { + /* 0x00 */ s32 flags; + /* 0x04 */ char unk_04; + /* 0x05 */ u8 type; + /* 0x06 */ u8 level; + /* 0x07 */ u8 maxHP; + /* 0x08 */ s16 partCount; + /* 0x0A */ char unk_0A[2]; + /* 0x0C */ struct StaticActorPart** partsData; + /* 0x10 */ UNK_PTR script; + /* 0x14 */ UNK_PTR statusTable; + /* 0x18 */ u8 escapeChance; + /* 0x19 */ u8 airLiftChance; + /* 0x1A */ u8 spookChance; + /* 0x1B */ u8 baseStatusChance; + /* 0x1C */ u8 upAndAwayChance; + /* 0x1D */ u8 spinSmashReq; + /* 0x1E */ u8 powerBounceChance; + /* 0x1F */ u8 coinReward; + /* 0x20 */ u8 size[2]; + /* 0x22 */ u8 hpBarOffset[2]; + /* 0x24 */ u8 statusIconOffset[2]; + /* 0x26 */ u8 statusMessageOffset[2]; +} StaticActorData; // size = 0x28 + +typedef struct move_table_entry { + /* 0x00 */ s32 moveNameID; + /* 0x04 */ s32 flags; + /* 0x08 */ s32 worldDescID; + /* 0x0C */ s32 menuDescID; + /* 0x10 */ u8 battleSubmenu; + /* 0x11 */ u8 costFP; + /* 0x12 */ u8 costBP; + /* 0x13 */ u8 actionCommandID; +} move_table_entry; // size = 0x14 + +typedef struct collision_data { + /* 0x00 */ f32* vertices[3]; + /* 0x04 */ struct collider* collider_list; + /* 0x08 */ struct collider_aabb** aabbs; + /* 0x0C */ s16 numColliders; + /* 0x0E */ char unk_0E[2]; +} collision_data; // size = 0x10 + +typedef struct StaticNpcSettings { + /* 0x00 */ char unk_00[4]; + /* 0x04 */ s16 height; + /* 0x06 */ s16 radius; + /* 0x08 */ UNK_PTR otherAI; + /* 0x0C */ bytecode* interactScript; + /* 0x10 */ bytecode* aiScript; + /* 0x14 */ bytecode* hitScript; + /* 0x18 */ bytecode* auxScript; + /* 0x1C */ bytecode* defeatScript; + /* 0x20 */ s32 flags; + /* 0x24 */ char unk_24[4]; + /* 0x28 */ s16 level; + /* 0x2A */ s16 unkFlags; +} StaticNpcSettings; // size = 0x2C + +typedef struct model { + /* 0x00 */ s16 flags; + /* 0x02 */ s16 modelID; + /* 0x04 */ char unk_04[4]; + /* 0x08 */ s32* modelNode; + /* 0x0C */ struct model_group_data* groupData; + /* 0x10 */ s32* currentSpecialMatrix; + /* 0x14 */ char unk_14[4]; + /* 0x18 */ struct matrix4s specialMatrix; + /* 0x58 */ struct matrix4f transformMatrix; + /* 0x98 */ f32 center[3]; /* Created by retype action */ + /* 0xA4 */ u8 texPannerID; + /* 0xA5 */ u8 specialDisplayListID; + /* 0xA6 */ u8 renderMode; /* Created by retype action */ + /* 0xA7 */ char unk_A7; + /* 0xA8 */ u8 textureID; + /* 0xA9 */ char unk_A9[7]; +} model; // size = 0xB0 + +typedef struct animated_mesh { + /* 0x000 */ s32 flags; + /* 0x004 */ u8 renderMode; + /* 0x005 */ char unk_05[3]; + /* 0x008 */ u32* animation1; + /* 0x00C */ u32* animation2; + /* 0x010 */ char unk_10[136]; + /* 0x098 */ struct matrix4s mtx; + /* 0x0D8 */ char unk_D8[500]; + /* 0x2CC */ s32 time; + /* 0x2D0 */ char unk_2D0[16]; +} animated_mesh; // size = 0x2E0 + +typedef struct print_handle { + /* 0x000 */ char unk_00[16]; + /* 0x010 */ s8* printbuf; /* Created by retype action */ + /* 0x014 */ char unk_14[1344]; +} print_handle; // size = 0x554 + +typedef struct other_print { + /* 0x00 */ char unk_00[16]; + /* 0x10 */ f32 stringScaleH; + /* 0x14 */ f32 stringScaleW; + /* 0x18 */ f32 characterScaleH; + /* 0x1C */ f32 characterScaleW; + /* 0x20 */ char unk_20[32]; + /* 0x40 */ s32 currentPosX; + /* 0x44 */ char unk_44[16]; +} other_print; // size = 0x54 + +typedef struct npc_blur_data { + /* 0x00 */ char unk_00[4]; + /* 0x04 */ f32 xpos[20]; + /* 0x54 */ f32 ypos[20]; + /* 0xA4 */ f32 zpos[20]; +} npc_blur_data; // size = 0xF4 + +typedef struct collider_aabb { + /* 0x00 */ f32 min[3]; + /* 0x0C */ f32 max[3]; + /* 0x18 */ s32 flagsForCollider; +} collider_aabb; // size = 0x1C + +typedef struct item_table_entry { + /* 0x00 */ s32 nameString; + /* 0x04 */ s16 iconID; + /* 0x06 */ s16 badgeSortPriority; + /* 0x08 */ s32 targetFlags; + /* 0x0C */ s16 sellValue; + /* 0x0E */ char unk_0E[2]; + /* 0x10 */ s32 menuString; + /* 0x14 */ s32 itemString; + /* 0x18 */ s16 typeFlags; + /* 0x1A */ u8 moveID; + /* 0x1B */ u8 potencyA; + /* 0x1C */ u8 potencyB; + /* 0x1D */ char unk_1D[3]; +} item_table_entry; // size = 0x20 + +typedef struct effect { + /* 0x00 */ char unk_00[32]; +} effect; // size = 0x20 + +typedef struct item_entity { + /* 0x00 */ s32 flags; + /* 0x04 */ s16 boundVar; /* see make_item_entity */ + /* 0x06 */ char unk_06[2]; + /* 0x08 */ f32 position[3]; + /* 0x14 */ struct item_entity_physics_data* physicsData; + /* 0x18 */ s16 itemID; /* into item table, also worldIconID */ + /* 0x1A */ u8 state; + /* 0x1B */ u8 type; + /* 0x1C */ u8 pickupDelay; /* num frames before item can be picked up */ + /* 0x1D */ char unk_1D; + /* 0x1E */ s16 wsFaceAngle; /* < 0 means none */ + /* 0x20 */ s16 shadowIndex; + /* 0x22 */ char unk_22[2]; + /* 0x24 */ u32* readPos; + /* 0x28 */ u32* savedReadPos; + /* 0x2C */ char unk_2C[2]; + /* 0x2E */ u8 unkCounter; + /* 0x2F */ char unk_2F; + /* 0x30 */ f32 scale; + /* 0x34 */ char unk_34[40]; +} item_entity; // size = 0x5C + +typedef struct model_node { + /* 0x00 */ s32 type; /* 2 = model */ + /* 0x04 */ UNK_PTR displayList; + /* 0x08 */ s32 numProperties; + /* 0x0C */ UNK_PTR propertyList; + /* 0x10 */ struct model_group_data* groupData; +} model_node; // size = 0x14 + +typedef struct static_shadow_data { + /* 0x00 */ s16 flags; + /* 0x02 */ char unk_02[34]; +} static_shadow_data; // size = 0x24 + +typedef struct sprite_component { + /* 0x00 */ char unk_00[8]; + /* 0x08 */ s16** readPos; + /* 0x0C */ f32 waitTime; + /* 0x10 */ s32 loopCounter; + /* 0x14 */ s32 currentRaster; + /* 0x18 */ s32 currentPalette; + /* 0x1C */ f32 posOffset[3]; + /* 0x28 */ f32 compPos[3]; + /* 0x34 */ f32 rotation[3]; + /* 0x40 */ f32 scale[3]; + /* 0x4C */ char unk_4C[4]; +} sprite_component; // size = 0x50 + +typedef struct print_context { + /* 0x000 */ s8* string; + /* 0x004 */ s16 bufPos; + /* 0x006 */ char unk_06[2]; + /* 0x008 */ s32 stringID; + /* 0x00C */ char unk_0C[4]; + /* 0x010 */ u8 buffer[1024]; + /* 0x410 */ char unk_410[68]; + /* 0x454 */ u8 font; + /* 0x455 */ char unk_455; + /* 0x456 */ s16 startPosX; + /* 0x458 */ s16 startPosY; + /* 0x45A */ char unk_45A[45]; + /* 0x487 */ u8 unkArraySize; + /* 0x488 */ s16 unkArrayunkLength[4]; + /* 0x490 */ char unk_490[108]; + /* 0x4FC */ s32 stateFlags; + /* 0x500 */ char unk_500[9]; + /* 0x509 */ u8 lerpElpasedTime; + /* 0x50A */ s16 startX; + /* 0x50C */ s16 startY; + /* 0x50E */ char unk_50E[6]; + /* 0x514 */ s16 sizeY; + /* 0x516 */ s16 sizeX; + /* 0x518 */ char unk_518[19]; + /* 0x52B */ u8 currentImageIndex; + /* 0x52C */ char unk_52C[10]; + /* 0x536 */ s16 height; + /* 0x538 */ s16 width; + /* 0x53A */ char unk_53A[30]; +} print_context; // size = 0x558 + +typedef struct game_status { + /* 0x000 */ u32 currentButtons; + /* 0x004 */ u32 altCurrentButtons; /* input used for batte when flag 80000 set */ + /* 0x008 */ char unk_08[8]; + /* 0x010 */ u32 pressedButtons; /* bits = 1 for frame of button press */ + /* 0x014 */ u32 altPressedButtons; /* input used for batte when flag 80000 set */ + /* 0x018 */ char unk_18[8]; + /* 0x020 */ u32 heldButtons; /* bits = 1 every 4th frame during hold */ + /* 0x024 */ u32 altHeldButtons; /* input used for batte when flag 80000 set */ + /* 0x028 */ char unk_28[8]; + /* 0x030 */ u32 prevButtons; /* from previous frame */ + /* 0x034 */ char unk_34[12]; + /* 0x040 */ u8 stickX; /* with deadzone */ + /* 0x041 */ u8 altStickX; /* input used for batte when flag 80000 set */ + /* 0x042 */ char unk_42[2]; + /* 0x044 */ u8 stickY; /* with deadzone */ + /* 0x045 */ u8 altStickY; /* input used for batte when flag 80000 set */ + /* 0x046 */ char unk_46[34]; + /* 0x068 */ s16 demoButtonInput; + /* 0x06A */ s8 demoStickX; + /* 0x06B */ s8 demoStickY; + /* 0x06C */ s32 mainScriptID; + /* 0x070 */ s8 isBattle; + /* 0x071 */ s8 demoState; /* (0 = not demo, 1 = map demo, 2 = demo map changing) */ + /* 0x072 */ u8 nextDemoScene; /* which part of the demo to play next */ + /* 0x073 */ u8 contBitPattern; + /* 0x074 */ char unk_74[4]; + /* 0x078 */ u8 disableScripts; + /* 0x079 */ char unk_79; + /* 0x07A */ s8 musicEnabled; + /* 0x07B */ char unk_7B[3]; + /* 0x07E */ u8 peachFlags; /* (1 = isPeach, 2 = isTransformed, 4 = hasUmbrella) */ + /* 0x07F */ u8 peachDisguise; /* (1 = koopatrol, 2 = hammer bros, 3 = clubba) */ + /* 0x080 */ char unk_80[6]; + /* 0x086 */ s16 areaID; /* Created by retype action */ + /* 0x088 */ s16 prevArea; + /* 0x08A */ s16 changedArea; /* (1 = yes) */ + /* 0x08C */ s16 mapID; + /* 0x08E */ s16 entryID; + /* 0x090 */ char unk_90[4]; + /* 0x094 */ f32 exitAngle; + /* 0x098 */ f32 playerPos[3]; + /* 0x0A4 */ f32 playerYaw; + /* 0x0A8 */ char unk_A8[4]; + /* 0x0AC */ s8 loadMenuState; + /* 0x0AD */ u8 menuCounter; + /* 0x0AE */ char unk_AE[8]; + /* 0x0B6 */ s16 bootAlpha; + /* 0x0B8 */ s16 bootBlue; + /* 0x0BA */ s16 bootGreen; + /* 0x0BC */ s16 bootRed; + /* 0x0BE */ char unk_BE[106]; + /* 0x128 */ f32 playerTraceNormal[3]; + /* 0x134 */ u16 frameCounter; + /* 0x136 */ char unk_136[2]; + /* 0x138 */ s32 nextRNG; + /* 0x13C */ char unk_13C[4]; + /* 0x140 */ UNK_PTR shopItemData; + /* 0x144 */ struct shop* mapShop; + /* 0x148 */ s16 enableBackground; /* (bit 2 is also used for something) */ + /* 0x14A */ s16 backgroundMinW; + /* 0x14C */ s16 backgroundMinH; + /* 0x14E */ s16 backgroundMaxW; + /* 0x150 */ s16 backgroundMaxH; + /* 0x152 */ s16 backgroundXOffset; /* (used for parallax scroll) */ + /* 0x154 */ UNK_PTR backgroundRaster; + /* 0x158 */ UNK_PTR backgroundPalette; + /* 0x15C */ s16 unk_15C; + /* 0x15E */ char unk_15E[0x2]; + /* 0x160 */ s16 savedPos[3]; + /* 0x166 */ s8 saveSlot; + /* 0x167 */ u8 loadType; /* (0 = from map, 1 = from main menu) */ + /* 0x168 */ s32 saveCount; + /* 0x16C */ char unk_16C[12]; +} game_status; // size = 0x178 + +typedef struct partner_anim_set { + /* 0x00 */ char unk_00[36]; +} partner_anim_set; // size = 0x24 + +typedef struct shadow { + /* 0x00 */ s32 flags; + /* 0x04 */ char unk_04[12]; + /* 0x10 */ f32 position[3]; + /* 0x1C */ f32 scale[3]; + /* 0x28 */ char unk_28[80]; +} shadow; // size = 0x78 + +typedef struct push_block_grid { + /* 0x00 */ s8* cells; + /* 0x04 */ u8 numCellsX; + /* 0x05 */ u8 numCellsZ; + /* 0x06 */ char unk_06[2]; + /* 0x08 */ s32 centerPos[3]; + /* 0x14 */ UNK_FUN_PTR(dropCallback); + /* 0x18 */ char unk_18[4]; +} push_block_grid; // size = 0x1C + +typedef struct item_entity_physics_data { + /* 0x00 */ f32 verticalVelocity; + /* 0x04 */ f32 gravity; /* 2 = normal, 1 = low gravity, higher values never 'settle' */ + /* 0x08 */ char unk_08[4]; + /* 0x0C */ f32 constVelocity; + /* 0x10 */ f32 velx; + /* 0x14 */ f32 velz; + /* 0x18 */ f32 moveAngle; + /* 0x1C */ char unk_1C[8]; +} item_entity_physics_data; // size = 0x24 + +typedef struct render_task { + /* 0x00 */ s32 renderMode; + /* 0x04 */ s32 dist; /* value between 0 and -10k */ + /* 0x08 */ struct model* model; + /* 0x0C */ UNK_FUN_PTR(fpBuildDL); /* function for making display list for model */ +} render_task; // size = 0x10 + +typedef struct selectable_target { + /* 0x00 */ s16 actorID; + /* 0x02 */ s16 partID; /* sometimes loaded as byte from 0x3 */ + /* 0x04 */ s16 pos[3]; + /* 0x0A */ char unk_0A[7]; + /* 0x11 */ u8 homeCol; /* from xpos --> 0-3 */ + /* 0x12 */ u8 homeRow; /* from ypos --> 0-3 */ + /* 0x13 */ u8 layer; /* from zpos? --> 0-1 */ +} selectable_target; // size = 0x14 + +typedef struct actor_part_movement { + /* 0x00 */ char unk_00[12]; + /* 0x0C */ f32 goalPos[3]; + /* 0x18 */ char unk_18[12]; + /* 0x24 */ f32 jumpScale; + /* 0x28 */ f32 moveSpeed; + /* 0x2C */ char unk_2C[32]; + /* 0x4C */ s32 varTable[16]; +} actor_part_movement; // size = 0x8C + +typedef struct ActorPart { + /* 0x00 */ s32 flags; + /* 0x04 */ s32 targetFlags; /* initialized to 0 */ + /* 0x08 */ struct StaticActorPart* staticData; + /* 0x0C */ struct ActorPart* nextPart; + /* 0x10 */ struct actor_part_movement* movement; + /* 0x14 */ s16 partOffset[3]; + /* 0x1A */ s16 visualOffset[3]; + /* 0x20 */ f32 partOffsetFloat[3]; + /* 0x2C */ f32 absolutePosition[3]; + /* 0x38 */ f32 rotation[3]; + /* 0x44 */ s16 rotationPivotOffset[3]; + /* 0x4A */ char unk_4A[2]; + /* 0x4C */ f32 scale[3]; + /* 0x58 */ f32 currentPos[3]; + /* 0x64 */ f32 yaw; + /* 0x68 */ s16 unkOffset[2]; + /* 0x6C */ s16 targetOffset[2]; + /* 0x70 */ s16 unk; + /* 0x72 */ u8 size[2]; + /* 0x74 */ u8 verticalStretch; + /* 0x75 */ char unk_75[3]; + /* 0x78 */ u32* defenseTable; + /* 0x7C */ s32 eventFlags; + /* 0x80 */ s32 partFlags3; + /* 0x84 */ char unk_84[4]; + /* 0x88 */ s32 currentAnimation; + /* 0x8C */ char unk_8C[4]; + /* 0x90 */ f32 animationRate; + /* 0x94 */ u32* idleAnimations; + /* 0x98 */ s16 opacity; + /* 0x9A */ char unk_9A[2]; + /* 0x9C */ struct shadow* shadow; + /* 0xA0 */ f32 shadowScale; + /* 0xA4 */ s32 partTypeData[6]; + /* 0xBC */ s16 actorTypeData2b[2]; + /* 0xC0 */ struct decoration_table* decorationTable; /* initialized to 0 */ +} ActorPart; // size = 0xC4 + +typedef struct collider_triangle { + /* 0x00 */ f32* v1[3]; /* note: the order of v1,2,3 is reversed from the ijk in the hit file */ + /* 0x04 */ f32* v2[3]; + /* 0x08 */ f32* v3[3]; + /* 0x0C */ f32 e13[3]; /* = v3 - v1 */ + /* 0x18 */ f32 e21[3]; /* = v1 - v2 */ + /* 0x24 */ f32 e32[3]; /* = v2 - v3 */ + /* 0x30 */ f32 normal[3]; + /* 0x3C */ s16 oneSided; /* 1 = yes, 0 = no */ + /* 0x3E */ char unk_3E[2]; +} collider_triangle; // size = 0x40 + +typedef struct partner_table_entry { + /* 0x00 */ s32 dmaStart; + /* 0x04 */ s32 dmaEnd; + /* 0x08 */ s32 dmaDest; + /* 0x0C */ s32 isFlying; + /* 0x10 */ UNK_FUN_PTR(fpInit); + /* 0x14 */ bytecode* spScriptA; + /* 0x18 */ bytecode* spScriptB; + /* 0x1C */ bytecode* spScriptC; + /* 0x20 */ bytecode* spScriptD; + /* 0x24 */ s32 idleAnim; + /* 0x28 */ UNK_FUN_PTR(fpFuncA); + /* 0x2C */ UNK_FUN_PTR(fpFuncB); + /* 0x30 */ UNK_FUN_PTR(fpFuncC); + /* 0x34 */ UNK_FUN_PTR(fpFuncD); + /* 0x38 */ UNK_FUN_PTR(fpFuncE); + /* 0x3C */ bytecode* spScriptX; +} partner_table_entry; // size = 0x40 + +typedef struct font_raster_set { + /* 0x00 */ u8 sizeX; + /* 0x01 */ u8 sizeY; + /* 0x02 */ char unk_02[10]; +} font_raster_set; // size = 0x0C + +typedef struct trigger_bp { + /* 0x00 */ s32 flags; + /* 0x04 */ s16 colliderIndex; + /* 0x06 */ char unk_06[2]; + /* 0x08 */ s32 flagIndex; + /* 0x0C */ UNK_FUN_PTR(function); + /* 0x10 */ char unk_10[8]; + /* 0x18 */ s32 inputArg3; + /* 0x1C */ char unk_1C[4]; +} trigger_bp; // size = 0x20 + +typedef struct collision_status { + /* 0x00 */ s16 pushingAgainstWall; /* FFFF = none for all below VVV */ + /* 0x02 */ s16 currentFloor; /* valid on touch */ + /* 0x04 */ s16 lastTouchedFloor; /* valid after jump */ + /* 0x06 */ s16 floorBelow; + /* 0x08 */ s16 currentCeiling; /* valid on touching with head */ + /* 0x0A */ char unk_0A[8]; + /* 0x12 */ s16 currentWall; + /* 0x14 */ s16 lastWallHammered; /* valid when smashing */ + /* 0x16 */ s16 touchingWallTrigger; /* 0/1 */ + /* 0x18 */ s16 bombetteExploded; /* 0 = yes, FFFF = no */ + /* 0x1A */ char unk_1A[2]; + /* 0x1C */ f32 bombetteExplositionPos[3]; +} collision_status; // size = 0x28 + +typedef struct decoration_table { + /* 0x000 */ char unk_00[2012]; + /* 0x7DC */ s16 scale[16]; + /* 0x7FC */ s16 posX[16]; + /* 0x81C */ s16 posY[16]; + /* 0x83C */ s16 posZ[16]; + /* 0x85C */ u8 rotationPivotOffsetX[16]; + /* 0x86C */ u8 rotationPivotOffsetY[16]; + /* 0x87C */ u8 rotX[16]; + /* 0x88C */ u8 rotY[16]; + /* 0x89C */ u8 rotZ[16]; + /* 0x8AC */ u8 effectType; /* 0 = blur, 14 = none? */ + /* 0x8AD */ char unk_8AD[11]; + /* 0x8B8 */ u8 decorationType[2]; + /* 0x8BA */ char unk_8BA[46]; +} decoration_table; // size = 0x8E8 + +typedef struct render_task_entry { + /* 0x00 */ char unk_00[16]; +} render_task_entry; // size = 0x10 + +typedef struct shop { + /* 0x000 */ char unk_00[20]; + /* 0x014 */ UNK_PTR staticItemPositions; + /* 0x018 */ UNK_PTR staticInventory; + /* 0x01C */ UNK_PTR staticPriceList; + /* 0x020 */ char unk_20[828]; +} shop; // size = 0x35C + +typedef struct encounter { + /* 0x00 */ s32 count; + /* 0x04 */ struct enemy* enemy[16]; + /* 0x08 */ char unk_08[60]; + /* 0x44 */ s16 battle; + /* 0x46 */ s16 stage; + /* 0x48 */ s16 encounterID; + /* 0x4A */ char unk_4A[2]; +} encounter; // size = 0x4C + +typedef struct player_path_element { + /* 0x00 */ char unk_00[4]; + /* 0x04 */ f32 pos[3]; +} player_path_element; // size = 0x10 + +typedef struct animated_model { + /* 0x00 */ s32 animModelID; + /* 0x04 */ f32 pos[3]; /* Created by retype action */ + /* 0x10 */ f32 rot[3]; + /* 0x1C */ f32 scale[3]; + /* 0x28 */ struct matrix4s* mtx; + /* 0x2C */ char unk_2C[60]; + /* 0x68 */ u32 currentAnimData; + /* 0x6C */ char unk_6C[4]; +} animated_model; // size = 0x70 + +typedef struct collision_header { + /* 0x00 */ s16 numColliders; + /* 0x02 */ char unk_02[2]; + /* 0x04 */ s32 treeOffset; + /* 0x08 */ s16 numVerts; + /* 0x0A */ char unk_0A[2]; + /* 0x0C */ s32 triangleTableOffset; + /* 0x10 */ s16 bbTableSize; + /* 0x12 */ char unk_12[2]; + /* 0x14 */ s32 bbTableOffset; + /* 0x18 */ char unk_18[8]; +} collision_header; // size = 0x20 + +typedef struct zone { + /* 0x00 */ s32 type; + /* 0x04 */ f32 boomLength; + /* 0x08 */ f32 boomPitch; + /* 0x0C */ f32 pos[6]; + /* 0x24 */ f32 viewPitch; + /* 0x28 */ s32 flag; +} zone; // size = 0x2C + +typedef struct Actor { + /* 0x000 */ s32 flags; + /* 0x004 */ char unk_04[4]; + /* 0x008 */ struct StaticActorData* staticActorData; + /* 0x00C */ f32 moveCurrentPos[3]; + /* 0x018 */ f32 moveGoalPos[3]; + /* 0x024 */ f32 moveEndPos[3]; /* where other actors should target this one at. saved before partner switching */ + /* 0x030 */ char unk_30[24]; + /* 0x048 */ f32 jumpAccel; + /* 0x04C */ f32 moveSpeed; + /* 0x050 */ f32 jumpVelocity; + /* 0x054 */ f32 moveAngle; + /* 0x058 */ f32 moveDistance; /* 2D projection, used for jump */ + /* 0x05C */ f32 bounceDivisor; + /* 0x060 */ char unk_60[4]; + /* 0x064 */ s32 animJumpRise; + /* 0x068 */ s32 animJumpFall; + /* 0x06C */ s32 animJumpLand; + /* 0x070 */ s16 moveTime; + /* 0x072 */ s16 moveArcAmplitude; + /* 0x074 */ char unk_74[3]; + /* 0x077 */ u8 jumpPartIndex; + /* 0x078 */ char unk_78[16]; + /* 0x088 */ s32 varTable[16]; + /* 0x0C8 */ f32 flyCurrentPos[3]; + /* 0x0D4 */ f32 flyGoalPos[3]; + /* 0x0E0 */ f32 flyTempPos[3]; /* used for start in fly functions, end in flyrun functions */ + /* 0x0EC */ char unk_EC[24]; + /* 0x104 */ f32 flyJumpAccel; + /* 0x108 */ f32 flySpeed; + /* 0x10C */ f32 flyJumpVelocity; + /* 0x110 */ f32 flyAngleYaw; + /* 0x114 */ f32 flyDistance; + /* 0x118 */ f32 flyElapsed; + /* 0x11C */ char unk_11C[4]; + /* 0x120 */ s16 flyTime; + /* 0x122 */ s16 flyArcAmplitude; + /* 0x124 */ char unk_124[17]; + /* 0x135 */ u8 footStepCounter; + /* 0x136 */ u8 actorType; + /* 0x137 */ char unk_137; + /* 0x138 */ f32 homePos[3]; + /* 0x144 */ f32 currentPos[3]; + /* 0x150 */ s16 otherPosheadOffset[3]; + /* 0x156 */ s16 healthBarPosition[3]; + /* 0x15C */ f32 rotation[3]; + /* 0x168 */ s16 rotationPivotOffset[3]; + /* 0x16E */ char unk_16E[2]; + /* 0x170 */ f32 scale[3]; + /* 0x17C */ f32 scaleModifier[3]; /* multiplies normal scale factors componentwise */ + /* 0x188 */ f32 scalingFactor; + /* 0x18C */ f32 yaw; + /* 0x190 */ u8 size[2]; + /* 0x192 */ s16 actorID; + /* 0x194 */ char unk_194[8]; + /* 0x19C */ s32 actorTypeData1[6]; /* 4 = jump sound */ + /* 0x1B4 */ s16 actorTypeData1b[2]; + /* 0x1B8 */ u8 currentHP; + /* 0x1B9 */ u8 maxHP; + /* 0x1BA */ char unk_1BA[2]; + /* 0x1BC */ u8 hpFraction; /* used to render HP bar */ + /* 0x1BD */ char unk_1BD[3]; + /* 0x1C0 */ bytecode* idleCode; + /* 0x1C4 */ bytecode* takeTurnCode; + /* 0x1C8 */ bytecode* onHitCode; + /* 0x1CC */ bytecode* onTurnChangeCode; + /* 0x1D0 */ struct script_context* idleScript; + /* 0x1D4 */ struct script_context* takeTurnScript; + /* 0x1D8 */ struct script_context* onHitScript; + /* 0x1DC */ struct script_context* onTurnChangeScript; + /* 0x1E0 */ s32 idleScriptID; + /* 0x1E4 */ s32 takeTurnID; + /* 0x1E8 */ s32 onHitID; + /* 0x1EC */ s32 onTurnChangeID; + /* 0x1F0 */ u8 lastEventType; + /* 0x1F1 */ u8 turnPriority; + /* 0x1F2 */ u8 enemyIndex; /* actorID = this | 200 */ + /* 0x1F3 */ u8 numParts; + /* 0x1F4 */ struct ActorPart* partsTable; + /* 0x1F8 */ s16 lastDamageTaken; + /* 0x1FA */ s16 hpChangeCounter; + /* 0x1FC */ s16 damageCounter; + /* 0x1FE */ char unk_1FE[9]; + /* 0x207 */ u8 extraCoinBonus; + /* 0x208 */ char unk_208[4]; + /* 0x20C */ u32* statusTable; + /* 0x210 */ u8 debuff; + /* 0x211 */ u8 debuffDuration; + /* 0x212 */ u8 staticStatus; /* 0B = yes */ + /* 0x213 */ u8 staticDuration; + /* 0x214 */ u8 stoneStatus; /* 0C = yes */ + /* 0x215 */ u8 stoneDuration; + /* 0x216 */ u8 koStatus; /* 0D = yes */ + /* 0x217 */ u8 koDuration; + /* 0x218 */ u8 transStatus; /* 0E = yes */ + /* 0x219 */ u8 transDuration; + /* 0x21A */ char unk_21A[2]; + /* 0x21C */ u8 status; + /* 0x21D */ char unk_21D[3]; + /* 0x220 */ u8 bGlowing; + /* 0x221 */ u8 attackBoost; + /* 0x222 */ u8 defenseBoost; + /* 0x223 */ u8 chillOutAmount; /* attack reduction */ + /* 0x224 */ u8 chillOutTurns; + /* 0x225 */ char unk_225[7]; + /* 0x22C */ struct selectable_target targetData[24]; + /* 0x40C */ u8 targetListLength; + /* 0x40D */ u8 targetIndexList[24]; /* into targetData */ + /* 0x425 */ u8 selectedTargetIndex; /* into target index list */ + /* 0x426 */ u8 targetPartIndex; + /* 0x427 */ char unk_427; + /* 0x428 */ s16 targetActorID; + /* 0x42A */ char unk_42A[2]; + /* 0x42C */ struct shadow* shadow; /* might be shadow ID */ + /* 0x430 */ f32 shadowScale; /* = actor size / 24.0 */ + /* 0x434 */ s16 renderMode; /* initially 0xD, set to 0x22 if any part is transparent */ + /* 0x436 */ char unk_436[2]; + /* 0x438 */ s32 x[2]; /* ??? see FUN_80253974 */ + /* 0x440 */ struct MenuIcon* ptrDefuffIcon; +} Actor; // size = 0x444 + +typedef struct StaticActorPart { + /* 0x00 */ s32 flags; + /* 0x04 */ u8 index; + /* 0x05 */ u8 posOffset[3]; + /* 0x08 */ u8 targetOffset[2]; + /* 0x0A */ s16 opacity; + /* 0x0C */ u32* idleAnimations; + /* 0x10 */ u32* defenseTable; + /* 0x14 */ s32 eventFlags; + /* 0x18 */ s32 flags3; + /* 0x1C */ char unk_1C[8]; +} StaticActorPart; // size = 0x24 + +typedef struct tile_descriptor { + /* 0x00 */ s8 name[32]; + /* 0x20 */ s16 auxW; + /* 0x22 */ s16 mainW; + /* 0x24 */ s16 auxH; + /* 0x26 */ s16 mainH; + /* 0x28 */ char unk_28; + /* 0x29 */ u8 extraTiles; + /* 0x2A */ u8 colorCombine; + /* 0x2B */ u8 fmt; + /* 0x2C */ u8 bitDepth; + /* 0x2D */ u8 wrapH; + /* 0x2E */ u8 wrapV; + /* 0x2F */ u8 filtering; +} tile_descriptor; // size = 0x30 typedef struct { /* 0x00 */ u32 raster; @@ -519,21 +1253,134 @@ typedef struct { /* 0x0E */ u16 height; } bg_header; // size = 0x10 -typedef struct { - /* 0x00 */ s32 genericFlagIndex; - /* 0x04 */ s16 crateFlagIndex; - /* 0x06 */ s16 panelFlagIndex; - /* 0x08 */ s32 colliderID; - /* 0x0C */ UNK_FUN_PTR(functionHandler); - /* 0x10 */ UNK_PTR scriptStart; - /* 0x14 */ script_context* runningScript; - /* 0x18 */ s32 priority; - /* 0x1C */ s32 scriptVars[3]; - /* 0x28 */ s32 unk_28; - /* 0x2C */ s32 unk_2C; - /* 0x30 */ u8 unk_30; - /* 0x31 */ char unk_31[3]; - /* 0x34 */ s32 runningScriptID; -} trigger; // size = 0x38 +typedef struct model_group_data { + /* 0x00 */ UNK_PTR transformMatrix; + /* 0x04 */ UNK_PTR lightingGroup; + /* 0x08 */ s32 numLights; + /* 0x0C */ s32 numChildren; + /* 0x10 */ struct model_node** childList; +} model_group_data; // size = 0x14 + +typedef struct font_data { + /* 0x00 */ char unk_00[24]; +} font_data; // size = 0x18 + +typedef struct crash { + /* 0x000 */ char unk_00[20]; + /* 0x014 */ s32 threadID; + /* 0x018 */ char unk_18[12]; + /* 0x024 */ s64 AT; /* Created by retype action */ + /* 0x02C */ s64 V0; /* Created by retype action */ + /* 0x034 */ s64 V1; /* Created by retype action */ + /* 0x03C */ s64 A0; /* Created by retype action */ + /* 0x044 */ s64 A1; /* Created by retype action */ + /* 0x04C */ s64 A2; /* Created by retype action */ + /* 0x054 */ s64 A3; + /* 0x05C */ char unk_5C[16]; + /* 0x06C */ s32 T2; + /* 0x070 */ char unk_70[168]; + /* 0x118 */ s32 SR; /* Created by retype action */ + /* 0x11C */ s32 PC; + /* 0x120 */ s32 interrupt; + /* 0x124 */ s32 VA; /* Created by retype action */ + /* 0x128 */ char unk_128[208]; +} crash; // size = 0x1F8 + +typedef struct player_status { + /* 0x000 */ s32 flags; + /* 0x004 */ u32 animFlags; + /* 0x008 */ s16 framesOnGround; /* Number of frames since last jump landed */ + /* 0x00A */ char unk_0A[2]; + /* 0x00C */ u8 peachDisguise; + /* 0x00D */ char unk_0D[5]; + /* 0x012 */ s16 moveFrames; + /* 0x014 */ u8 enableCollisionOverlapsCheck; + /* 0x015 */ u8 statusMenuCounterinputEnabledCounter; /* whether the C-up menu can appear */ + /* 0x016 */ s16 lastGoodPosition[3]; + /* 0x01C */ f32 extraVelocity[3]; + /* 0x028 */ f32 position[3]; + /* 0x034 */ char unk_34[16]; + /* 0x044 */ f32 decorationPos[2]; + /* 0x04C */ char unk_4C[4]; + /* 0x050 */ f32 jumpApexHeight; + /* 0x054 */ s32 currentSpeed; + /* 0x058 */ f32 walkSpeed; + /* 0x05C */ f32 runSpeed; + /* 0x060 */ char unk_60[8]; + /* 0x068 */ f32 normalPitch; + /* 0x06C */ char unk_6C[4]; + /* 0x070 */ f32 gravityIntegrator[4]; + /* 0x080 */ f32 targetYaw; + /* 0x084 */ f32 currentYaw; + /* 0x088 */ char unk_88[24]; + /* 0x0A0 */ f32 heading; + /* 0x0A4 */ char unk_A4[4]; + /* 0x0A8 */ f32 spriteFacingAngle; /* angle of sprite, relative to camera, from 0 to 180 */ + /* 0x0AC */ char unk_AC[4]; + /* 0x0B0 */ s16 colliderHeight; + /* 0x0B2 */ s16 colliderDiameter; + /* 0x0B4 */ u8 actionState; + /* 0x0B5 */ u8 prevActionState; + /* 0x0B6 */ u8 fallState; + /* 0x0B7 */ char unk_B7; + /* 0x0B8 */ s32 anim; + /* 0x0BC */ char unk_BC[2]; + /* 0x0BE */ u8 renderMode; + /* 0x0BF */ char unk_BF; + /* 0x0C0 */ u32* decorationList; + /* 0x0C4 */ char unk_C4[8]; + /* 0x0CC */ s32 shadowID; + /* 0x0D0 */ char unk_D0[12]; + /* 0x0DC */ s32 currentButtons; + /* 0x0E0 */ s32 pressedButtons; + /* 0x0E4 */ s32 heldButtons; + /* 0x0E8 */ f32 stickAxis[2]; + /* 0x0F0 */ s32 currentButtonsBuffer[10]; + /* 0x118 */ s32 pressedButtonsBuffer[10]; + /* 0x140 */ s32 heldButtonsBuffer[10]; + /* 0x168 */ f32 stickXBuffer[10]; + /* 0x190 */ f32 stickYBuffer[10]; + /* 0x1B8 */ s32 inputBufPos; + /* 0x1BC */ char unk_1BC[204]; +} player_status; // size = 0x288 + +typedef struct character_set { +} character_set; // size = 0x00 + +typedef struct anim_model_node { + /* 0x00 */ u32* displayList; + /* 0x04 */ s16 rot[3]; /* range = -180,180 */ + /* 0x0A */ char unk_0A[34]; +} anim_model_node; // size = 0x2C + +typedef struct encounter_status { + /* 0x00 */ s32 flags; + /* 0x04 */ u8 eFirstStrike; /* 0 = none, 1 = player, 2 = enemy */ + /* 0x05 */ u8 hitType; /* 1 = none/enemy, 2 = jump */ + /* 0x06 */ u8 hitTier; /* 0 = normal, 1 = super, 2 = ultra */ + /* 0x07 */ char unk_07[2]; + /* 0x09 */ u8 battleOutcome; /* 0 = won, 1 = lost */ + /* 0x0A */ char unk_0A; + /* 0x0B */ u8 merleeCoinBonus; /* triple coins when != 0 */ + /* 0x0C */ u8 damageTaken; /* valid after battle */ + /* 0x0D */ char unk_0D; + /* 0x0E */ s16 coinsEarned; /* valid after battle */ + /* 0x10 */ char unk_10; + /* 0x11 */ u8 allowFleeing; + /* 0x12 */ char unk_12; + /* 0x13 */ u8 dropWhackaBump; + /* 0x14 */ s32 songID; + /* 0x18 */ char unk_18[4]; + /* 0x1C */ u8 numEncounters; /* number of encounters for current map (in list) */ + /* 0x1D */ char unk_1D[3]; + /* 0x20 */ u8 mapID; + /* 0x21 */ char unk_21[3]; + /* 0x24 */ s32* npcGroupList; + /* 0x28 */ struct encounter* enounterList[24]; + /* 0x2C */ char unk_2C[92]; + /* 0x88 */ struct encounter* currentEncounter; + /* 0x8C */ struct enemy* currentEnemy; + /* 0x90 */ char unk_90[4]; +} encounter_status; // size = 0x94 #endif diff --git a/include/enums.h b/include/enums.h new file mode 100644 index 0000000000..1809b1bd01 --- /dev/null +++ b/include/enums.h @@ -0,0 +1,1431 @@ +#ifndef _ENUMS_H_ +#define _ENUMS_H_ + +#include "ultra64.h" +#include "types.h" + +typedef UNK_TYPE ENCOUNTER_TRIGGER; +#define ENCOUNTER_TRIGGER_NONE 0x00000001 +#define ENCOUNTER_TRIGGER_JUMP 0x00000002 +#define ENCOUNTER_TRIGGER_SPIN 0x00000003 +#define ENCOUNTER_TRIGGER_HAMMER 0x00000004 +#define ENCOUNTER_TRIGGER_PARTNER 0x00000006 + +typedef UNK_TYPE PARTNER; +#define PARTNER_NONE 0x00000000 +#define PARTNER_GOOMBARIO 0x00000001 +#define PARTNER_KOOPER 0x00000002 +#define PARTNER_BOMBETTE 0x00000003 +#define PARTNER_PARAKARRY 0x00000004 +#define PARTNER_GOOMPA 0x00000005 +#define PARTNER_WATT 0x00000006 +#define PARTNER_SUSHIE 0x00000007 +#define PARTNER_LAKILESTER 0x00000008 +#define PARTNER_BOW 0x00000009 +#define PARTNER_GOOMBARIA 0x0000000A +#define PARTNER_TWINK 0x0000000B + +typedef UNK_TYPE SPRITE; +#define SPRITE_WORLD_GOOMBARIO 0x00000001 +#define SPRITE_WORLD_KOOPER 0x00000002 +#define SPRITE_WORLD_BOMBETTE 0x00000003 +#define SPRITE_WORLD_PARAKARRY 0x00000004 +#define SPRITE_WORLD_BOW 0x00000005 +#define SPRITE_WORLD_WATT 0x00000006 +#define SPRITE_WORLD_SUSHI 0x00000007 +#define SPRITE_WORLD_LAKILESTER 0x00000008 +#define SPRITE_BATTLE_GOOMBARIO 0x00000009 +#define SPRITE_BATTLE_KOOPER 0x0000000A +#define SPRITE_BATTLE_BOMBETTE 0x0000000B +#define SPRITE_BATTLE_PARAKARRY 0x0000000C +#define SPRITE_BATTLE_BOW 0x0000000D +#define SPRITE_BATTLE_WATT 0x0000000E +#define SPRITE_BATTLE_SUSHI 0x0000000F +#define SPRITE_BATTLE_LAKILESTER 0x00000010 +#define SPRITE_KOOPER_WITHOUT_SHELL 0x00000011 +#define SPRITE_WORLD_ELDSTAR 0x00000012 +#define SPRITE_WORLD_MAMAR 0x00000013 +#define SPRITE_WORLD_SKOLAR 0x00000014 +#define SPRITE_WORLD_MUSKULAR 0x00000015 +#define SPRITE_WORLD_MISSTAR 0x00000016 +#define SPRITE_WORLD_KLEVAR 0x00000017 +#define SPRITE_WORLD_KALMAR 0x00000018 +#define SPRITE_BATTLE_ELDSTAR 0x00000019 +#define SPRITE_BATTLE_MAMAR 0x0000001A +#define SPRITE_BATTLE_SKOLAR 0x0000001B +#define SPRITE_BATTLE_MUSKULAR 0x0000001C +#define SPRITE_BATTLE_MISSTAR 0x0000001D +#define SPRITE_BATTLE_KLEVAR 0x0000001E +#define SPRITE_BATTLE_KALMAR 0x0000001F +#define SPRITE_TWINK 0x00000020 +#define SPRITE_JR_TROOPA 0x00000021 +#define SPRITE_SPIKED_JR_TROOPA 0x00000022 +#define SPRITE_SPIKED_PARA_JR_TROOPA 0x00000023 +#define SPRITE_MAGE_JR_TROOPA 0x00000024 +#define SPRITE_PARA_JR_TROOPA 0x00000025 +#define SPRITE_GOOMBA 0x00000026 +#define SPRITE_SPIKED_GOOMBA 0x00000027 +#define SPRITE_PARAGOOMBA 0x00000028 +#define SPRITE_KOOPA_TROOPA 0x00000029 +#define SPRITE_PARA_TROOPA 0x0000002A +#define SPRITE_FUZZY 0x0000002B +#define SPRITE_BOMBOMB 0x0000002C +#define SPRITE_BULLET_BILL 0x0000002D +#define SPRITE_BILL_BLASTER 0x0000002E +#define SPRITE_MONTY_MOLE 0x0000002F +#define SPRITE_CLEFT 0x00000030 +#define SPRITE_POKEY 0x00000031 +#define SPRITE_BANDIT 0x00000032 +#define SPRITE_BUZZY_BEETLE 0x00000033 +#define SPRITE_SWOOPER 0x00000034 +#define SPRITE_STONE_CHOMP 0x00000035 +#define SPRITE_PUTRID_PIRANHA 0x00000036 +#define SPRITE_PIRANHA_PLANT 0x00000037 +#define SPRITE_SENTINEL 0x00000038 +#define SPRITE_WORLD_CLUBBA 0x00000039 +#define SPRITE_BATTLE_CLUBBA 0x0000003A +#define SPRITE_SHY_GUY 0x0000003B +#define SPRITE_GROOVE_GUY 0x0000003C +#define SPRITE_SKY_GUY 0x0000003D +#define SPRITE_PYRO_GUY 0x0000003E +#define SPRITE_SPY_GUY 0x0000003F +#define SPRITE_MEDI_GUY 0x00000040 +#define SPRITE_FUZZIPEDE 0x00000041 +#define SPRITE_JUNGLE_GUY 0x00000042 +#define SPRITE_HEART_PLANT 0x00000043 +#define SPRITE_HURT_PLANT 0x00000044 +#define SPRITE_M_BUSH 0x00000045 +#define SPRITE_BUBBLE 0x00000046 +#define SPRITE_KENT_C_KOOPA 0x00000047 +#define SPRITE_DAYZEE 0x00000048 +#define SPRITE_LAKITU 0x00000049 +#define SPRITE_SPINY 0x0000004A +#define SPRITE_BZZAP 0x0000004B +#define SPRITE_RUFF_PUFF 0x0000004C +#define SPRITE_SPIKE_TOP 0x0000004D +#define SPRITE_DUPLIGHOST 0x0000004E +#define SPRITE_ALBINO_DINO 0x0000004F +#define SPRITE_BLOOPER 0x00000050 +#define SPRITE_BABY_BLOOPER 0x00000051 +#define SPRITE_GULPIT 0x00000052 +#define SPRITE_DRY_BONES 0x00000053 +#define SPRITE_THROWN_BONE 0x00000054 +#define SPRITE_BONY_BEETLE 0x00000055 +#define SPRITE_MAGIKOOPA 0x00000056 +#define SPRITE_FLYING_MAGIKOOPA 0x00000057 +#define SPRITE_WORLD_KOOPATROL 0x00000058 +#define SPRITE_KOOPATROL 0x00000059 +#define SPRITE_HAMMER_BROS 0x0000005A +#define SPRITE_BUSH_BASIC 0x0000005B +#define SPRITE_BUSH_BLOCKY 0x0000005C +#define SPRITE_BUSH_DRY 0x0000005D +#define SPRITE_BUSH_LEAFY 0x0000005E +#define SPRITE_BUSH_MATTED 0x0000005F +#define SPRITE_WORLD_KAMMY 0x00000060 +#define SPRITE_BATTLE_KAMMY 0x00000061 +#define SPRITE_GOOMBA_BROS 0x00000062 +#define SPRITE_GOOMBA_KING 0x00000063 +#define SPRITE_SPIKY_GOOMNUT 0x00000064 +#define SPRITE_DARK_TOAD 0x00000065 +#define SPRITE_KOOPA_BROS 0x00000066 +#define SPRITE_BUZZAR 0x00000067 +#define SPRITE_TUTANKOOPA 0x00000068 +#define SPRITE_CHAIN_CHOMP 0x00000069 +#define SPRITE_WORLD_TUBBA 0x0000006A +#define SPRITE_BATTLE_TUBBA 0x0000006B +#define SPRITE_TUBBAS_HEART 0x0000006C +#define SPRITE_BIG_LANTERN_GHOST 0x0000006D +#define SPRITE_SHY_SQUAD_GUY 0x0000006E +#define SPRITE_MARSHAL_GUY 0x0000006F +#define SPRITE_STILT_GUY 0x00000070 +#define SPRITE_STILT_GUY_UNFOLD 0x00000071 +#define SPRITE_SHY_STACK_GUY 0x00000072 +#define SPRITE_SHY_STACK_UNFOLD 0x00000073 +#define SPRITE_SHY_STACK_DAMAGE 0x00000074 +#define SPRITE_SHY_STACK_ROCK 0x00000075 +#define SPRITE_GENERAL_GUY 0x00000076 +#define SPRITE_GENERAL_GUY_BOMB 0x00000077 +#define SPRITE_TANK_GUY 0x00000078 +#define SPRITE_LAVA_PIRANHA_HEAD 0x00000079 +#define SPRITE_PETIT_PIRANHA 0x0000007A +#define SPRITE_LAVA_BUD 0x0000007B +#define SPRITE_HUFF_N_PUFF 0x0000007C +#define SPRITE_TUFF_PUFF 0x0000007D +#define SPRITE_MONSTAR 0x0000007E +#define SPRITE_CRYSTAL_KING 0x0000007F +#define SPRITE_WORLD_BOWSER 0x00000080 +#define SPRITE_BATTLE_BOWSER 0x00000081 +#define SPRITE_LUIGI 0x00000082 +#define SPRITE_TOAD 0x00000083 +#define SPRITE_THREE_SISTERS 0x00000084 +#define SPRITE_VANNA_T 0x00000085 +#define SPRITE_TOAD_KID 0x00000086 +#define SPRITE_TOAD_GUARD 0x00000087 +#define SPRITE_HARRY_T 0x00000088 +#define SPRITE_TOAD_MINISTER 0x00000089 +#define SPRITE_POSTMASTER 0x0000008A +#define SPRITE_CONDUCTOR_TOAD 0x0000008B +#define SPRITE_TRAIN_STATION_TOAD 0x0000008C +#define SPRITE_FISHMAEL 0x0000008D +#define SPRITE_ARTIST_TOAD 0x0000008E +#define SPRITE_KOOPA 0x0000008F +#define SPRITE_KOOPA_WITHOUT_SHELL 0x00000090 +#define SPRITE_WORLD_BOMBOMB 0x00000091 +#define SPRITE_WHACKA 0x00000092 +#define SPRITE_DRYITE 0x00000093 +#define SPRITE_MOUSER 0x00000094 +#define SPRITE_BOO 0x00000095 +#define SPRITE_YOSHI 0x00000096 +#define SPRITE_YOSHI_KID 0x00000097 +#define SPRITE_RAVEN 0x00000098 +#define SPRITE_BUBULB 0x00000099 +#define SPRITE_PENGUIN 0x0000009A +#define SPRITE_SHIVER_TOAD 0x0000009B +#define SPRITE_ALT_BANDIT 0x0000009C +#define SPRITE_GOOMPAPA 0x0000009D +#define SPRITE_GOOMBARIA 0x0000009E +#define SPRITE_GOOMAMA 0x0000009F +#define SPRITE_GOOMPA 0x000000A0 +#define SPRITE_GOOMMA 0x000000A1 +#define SPRITE_THE_MASTER 0x000000A2 +#define SPRITE_CHAN 0x000000A3 +#define SPRITE_LEE 0x000000A4 +#define SPRITE_MERLON 0x000000A5 +#define SPRITE_CHET_RIPPO 0x000000A6 +#define SPRITE_ROWF 0x000000A7 +#define SPRITE_MINH_T 0x000000A8 +#define SPRITE_RUSS_T 0x000000A9 +#define SPRITE_TAYCE_T 0x000000AA +#define SPRITE_FICE_T 0x000000AB +#define SPRITE_BARTENDER 0x000000AC +#define SPRITE_CHANTERELLE 0x000000AD +#define SPRITE_RIP_CHEATO 0x000000AE +#define SPRITE_CHUCK_QUIZMO 0x000000AF +#define SPRITE_MERLUVLEE 0x000000B0 +#define SPRITE_MERLAR 0x000000B1 +#define SPRITE_MERLOW 0x000000B2 +#define SPRITE_STAR_KID 0x000000B3 +#define SPRITE_KOLORADO_WIFE 0x000000B4 +#define SPRITE_KOOPA_KOOT 0x000000B5 +#define SPRITE_KOLORADO 0x000000B6 +#define SPRITE_BATTLE_KOLORADO 0x000000B7 +#define SPRITE_ARCHEOLOGIST 0x000000B8 +#define SPRITE_NOMADIMOUSE 0x000000B9 +#define SPRITE_WORLD_MERLEE 0x000000BA +#define SPRITE_BATTLE_MERLEE 0x000000BB +#define SPRITE_DISGUISED_MOUSTAFA 0x000000BC +#define SPRITE_MOUSTAFA 0x000000BD +#define SPRITE_OAKLIE 0x000000BE +#define SPRITE_BOOTLER 0x000000BF +#define SPRITE_YAKKEY 0x000000C0 +#define SPRITE_GOURMET_GUY 0x000000C1 +#define SPRITE_VILLAGE_LEADER 0x000000C2 +#define SPRITE_LEADERS_FRIEND 0x000000C3 +#define SPRITE_RAFAEL_RAVEN 0x000000C4 +#define SPRITE_TOLIELUP 0x000000C5 +#define SPRITE_GATE_FLOWER 0x000000C6 +#define SPRITE_PETUNIA 0x000000C7 +#define SPRITE_POSIE 0x000000C8 +#define SPRITE_LILY 0x000000C9 +#define SPRITE_ROSIE 0x000000CA +#define SPRITE_SUN 0x000000CB +#define SPRITE_LAKILULU 0x000000CC +#define SPRITE_NINJI 0x000000CD +#define SPRITE_MAYOR_PENGUIN 0x000000CE +#define SPRITE_MAYOR_PENGUIN_WIFE 0x000000CF +#define SPRITE_PENGUIN_PATROL 0x000000D0 +#define SPRITE_HERRINGWAY 0x000000D1 +#define SPRITE_MERLE 0x000000D2 +#define SPRITE_STAR_ROD 0x000000D3 +#define SPRITE_FIRE 0x000000D4 +#define SPRITE_COIN 0x000000D5 +#define SPRITE_PARADE_PEACH 0x000000D6 +#define SPRITE_PARADE_KOOPAS 0x000000D7 +#define SPRITE_PARADE_BURNT_BOWSER 0x000000D8 +#define SPRITE_PARADE_LUIGI 0x000000D9 +#define SPRITE_PARADE_PARTNERS 0x000000DA +#define SPRITE_PARADE_YOSHIS 0x000000DB +#define SPRITE_PARADA_KOLORADOS 0x000000DC +#define SPRITE_PARADE_CHICKS 0x000000DD +#define SPRITE_PARADE_ICE_SHOW 0x000000DE +#define SPRITE_PARADE_TOADS 0x000000DF +#define SPRITE_PARADE_BATONS 0x000000E0 +#define SPRITE_PARADE_DRUMS 0x000000E1 +#define SPRITE_PARADE_FLAGS 0x000000E2 +#define SPRITE_PARADE_HORNS 0x000000E3 +#define SPRITE_PARADE_TUBBA_BALLOON 0x000000E4 +#define SPRITE_PARADE_WIZARDS 0x000000E5 +#define SPRITE_PARADE_MARIO 0x000000E6 +#define SPRITE_PARADE_SHY_GUYS 0x000000E7 +#define SPRITE_PARADE_TWINK 0x000000E8 +#define SPRITE_LEAF 0x000000E9 + +typedef UNK_TYPE SONG; +#define SONG_TOAD_TOWN 0x00000000 +#define SONG_NORMAL_BATTLE 0x00000002 +#define SONG_SPECIAL_BATTLE 0x00000003 +#define SONG_JR_TROOPA_BATTLE 0x00000004 +#define SONG_FINAL_BOWSER_BATTLE 0x00000005 +#define SONG_GOOMBA_KING_BATTLE 0x00000007 +#define SONG_KOOPA_BROS_BATTLE 0x00000008 +#define SONG_FAKE_BOWSER_BATTLE 0x00000009 +#define SONG_TUTANKOOPA_BATTLE 0x0000000A +#define SONG_TUBBA_BLUBBA_BATTLE 0x0000000B +#define SONG_GENERAL_GUY_BATTLE 0x0000000C +#define SONG_LAVA_PIRANHA_BATTLE 0x0000000D +#define SONG_HUFF_N_PUFF_BATTLE 0x0000000E +#define SONG_CRYSTAL_KING_BATTLE 0x0000000F +#define SONG_GOOMBA_VILLAGE 0x00000010 +#define SONG_PLEASANT_PATH 0x00000011 +#define SONG_FUZZY_ATTACK 0x00000012 +#define SONG_KOOPA_VILLAGE 0x00000013 +#define SONG_KOOPA_FORTRESS 0x00000014 +#define SONG_DRY_DRY_OUTPOST 0x00000015 +#define SONG_MT_RUGGED 0x00000016 +#define SONG_DRY_DRY_DESERT 0x00000017 +#define SONG_DRY_DRY_RUINS 0x00000018 +#define SONG_RUINS_BASEMENT 0x00000019 +#define SONG_FOREVER_FOREST 0x0000001A +#define SONG_BOOS_MANSION 0x0000001B +#define SONG_CHEERFUL_BOOS_MANSION 0x0000001C +#define SONG_GUSTY_GULCH 0x0000001D +#define SONG_TUBBAS_MANOR 0x0000001E +#define SONG_TUBBA_ESCAPE 0x0000001F +#define SONG_SHY_GUY_TOYBOX 0x00000020 +#define SONG_TOYBOX_TRAIN 0x00000021 +#define SONG_CREEPY_TOYBOX 0x00000022 +#define SONG_JADE_JUNGLE 0x00000024 +#define SONG_DEEP_JUNGLE 0x00000025 +#define SONG_YOSHIS_VILLAGE 0x00000026 +#define SONG_YOSHIS_PANIC 0x00000027 +#define SONG_RAPHAEL_RAVEN 0x00000028 +#define SONG_MT_LAVALAVA 0x00000029 +#define SONG_VOLCANO_ESCAPE 0x0000002A +#define SONG_STAR_WAY_OPENS 0x0000002B +#define SONG_MASTER_BATTLE 0x0000002C +#define SONG_RADIO_ISLAND_SOUNDS 0x0000002D +#define SONG_RADIO_HOT_HITS 0x0000002E +#define SONG_RADIO_GOLDEN_OLDIES 0x0000002F +#define SONG_FLOWER_FIELDS_CLOUDY 0x00000030 +#define SONG_FLOWER_FIELDS_SUNNY 0x00000031 +#define SONG_CLOUDY_CLIMB 0x00000032 +#define SONG_PUFF_PUFF_MACHINE 0x00000033 +#define SONG_SUN_TOWER_CLOUDY 0x00000034 +#define SONG_SUN_TOWER_SUNNY 0x00000035 +#define SONG_CRYSTAL_PALACE 0x00000037 +#define SONG_SHIVER_CITY 0x00000038 +#define SONG_PENGUIN_MYSTERY 0x00000039 +#define SONG_SHIVER_SNOWFIELD 0x0000003A +#define SONG_SHIVER_MOUNTAIN 0x0000003B +#define SONG_STARBORN_VALLEY 0x0000003C +#define SONG_MERLAR_THEME 0x0000003D +#define SONG_MAIL_CALL 0x0000003E +#define SONG_PEACHS_CASTLE_PARTY 0x0000003F +#define SONG_CHAPTER_END 0x00000040 +#define SONG_CHAPTER_START 0x00000041 +#define SONG_ITEM_UPGRADE 0x00000042 +#define SONG_PHONOGRAPH_MUSIC 0x00000044 +#define SONG_TUTANKOOPA_THEME 0x00000045 +#define SONG_KAMMY_KOOPA_THEME 0x00000046 +#define SONG_JR_TROOPA_THEME 0x00000047 +#define SONG_BULLET_BILL_ASSAULT 0x00000048 +#define SONG_MONTY_MOLE_ASSAULT 0x00000049 +#define SONG_SHY_GUY_INVASION 0x0000004A +#define SONG_TOAD_TOWN_TUNNELS 0x0000004B +#define SONG_WHALE_THEME 0x0000004C +#define SONG_FOREVER_FOREST_WARNING 0x0000004D +#define SONG_YOSHI_KIDS_FOUND 0x0000004E +#define SONG_UNUSED_FANFARE 0x0000004F +#define SONG_GOOMBA_KING_THEME 0x00000050 +#define SONG_KOOPA_BROS_INTERLUDE 0x00000051 +#define SONG_KOOPA_BROS_THEME 0x00000052 +#define SONG_TUTANKOOPA_WARNING 0x00000053 +#define SONG_TUTANKOOPA_REVEALED 0x00000054 +#define SONG_TUBBA_BLUBBA_THEME 0x00000055 +#define SONG_GENERAL_GUY_THEME 0x00000056 +#define SONG_LAVA_PIRANHA_THEME 0x00000057 +#define SONG_HUFF_N_PUFF_THEME 0x00000058 +#define SONG_CRYSTAL_KING_THEME 0x00000059 +#define SONG_BLOOPER_THEME 0x0000005A +#define SONG_MINIBOSS_BATTLE 0x0000005B +#define SONG_MONSTAR_THEME 0x0000005C +#define SONG_CLUB64 0x0000005D +#define SONG_UNUSED_OPENING 0x0000005E +#define SONG_BOWSERS_CASTLE_FALLS 0x0000005F +#define SONG_STAR_HAVEN 0x00000060 +#define SONG_SHOOTING_STAR_SUMMIT 0x00000061 +#define SONG_STARSHIP_THEME 0x00000062 +#define SONG_STAR_SANCTUARY 0x00000063 +#define SONG_BOWSERS_CASTLE 0x00000064 +#define SONG_BOWSERS_CASTLE_CAVES 0x00000065 +#define SONG_BOWSER_THEME 0x00000066 +#define SONG_BOWSER_BATTLE 0x00000067 +#define SONG_PEACH_WISHES 0x00000068 +#define SONG_FILE_SELECT 0x00000069 +#define SONG_MAIN_THEME 0x0000006A +#define SONG_BOWSER_ATTACKS 0x0000006B +#define SONG_MARIO_FALLS 0x0000006C +#define SONG_PEACH_APPEARS 0x0000006D +#define SONG_THE_END 0x0000006E +#define SONG_RECOVERED_STAR_ROD 0x0000006F +#define SONG_TWINK_THEME 0x00000070 +#define SONG_STIRRING_CAKE 0x00000071 +#define SONG_GOURMET_GUY_FREAKOUT 0x00000072 +#define SONG_PRISONER_PEACH_THEME 0x00000073 +#define SONG_PEACH_MISSION 0x00000074 +#define SONG_PEACH_SNEAKING 0x00000075 +#define SONG_PEACH_CAUGHT 0x00000076 +#define SONG_PEACH_QUIZ_INTRO 0x00000077 +#define SONG_STAR_SPIRIT_THEME 0x00000078 +#define SONG_PENGUIN_WHODUNIT 0x00000079 +#define SONG_PENGUIN_WAKES_UP 0x0000007A +#define SONG_MAGIC_BEANSTALK 0x0000007B +#define SONG_MERLEE_SPELL 0x0000007C +#define SONG_LAKILESTER_THEME 0x0000007D +#define SONG_GOOMBA_BROS_RETREAT 0x0000007E +#define SONG_SUNSHINE_RETURNS 0x0000007F +#define SONG_RIDING_THE_RAILS 0x00000080 +#define SONG_RIDING_THE_WHALE 0x00000081 +#define SONG_NEW_PARTNER 0x00000082 +#define SONG_DRY_DRY_RUINS_APPEAR 0x00000083 +#define SONG_CANDY_CANES 0x00000084 +#define SONG_PLAYROOM 0x00000085 +#define SONG_MOUSTAFA_THEME 0x00000086 +#define SONG_GAME_OVER 0x00000087 +#define SONG_TAKING_REST 0x00000088 +#define SONG_FLOWER_N_P_C_THEME 0x00000089 +#define SONG_FLOWER_GATE_APPEARS 0x0000008A +#define SONG_BATTLE_END 0x0000008B +#define SONG_POP_DIVA_SONG 0x0000008C +#define SONG_BOO_MINIGAME 0x0000008D +#define SONG_LEVEL_UP 0x0000008E +#define SONG_PARADE_DAY 0x00000090 +#define SONG_PARADE_NIGHT 0x00000091 +#define SONG_MARIO_BROS_HOUSE 0x00000094 +#define SONG_INTRO_STORY 0x00000095 +#define SONG_NEW_PARTNER_J_P 0x00000096 + +typedef UNK_TYPE ABILITY; +#define ABILITY_DODGE_MASTER 0x00000000 +#define ABILITY_UNUSED 0x00000001 +#define ABILITY_SPIKE_SHIELD 0x00000002 +#define ABILITY_FIRST_ATTACK 0x00000003 +#define ABILITY_H_P_PLUS 0x00000004 +#define ABILITY_DOUBLE_DIP 0x00000005 +#define ABILITY_MYSTERY_SCROLL 0x00000006 +#define ABILITY_FIRE_SHIELD 0x00000007 +#define ABILITY_PRETTY_LUCKY 0x00000008 +#define ABILITY_H_P_DRAIN 0x00000009 +#define ABILITY_ALL_OR_NOTHING 0x0000000A +#define ABILITY_SLOW_GO 0x0000000B +#define ABILITY_F_P_PLUS 0x0000000C +#define ABILITY_ICE_POWER 0x0000000D +#define ABILITY_FEELING_FINE 0x0000000E +#define ABILITY_ATTACK_F_X 0x0000000F +#define ABILITY_MONEY_MONEY 0x00000010 +#define ABILITY_CHILL_OUT 0x00000011 +#define ABILITY_HAPPY_HEART 0x00000012 +#define ABILITY_ZAP_TAP 0x00000013 +#define ABILITY_MEGA_RUSH 0x00000014 +#define ABILITY_BERSERKER 0x00000015 +#define ABILITY_RIGHT_ON 0x00000016 +#define ABILITY_RUNAWAY_PAY 0x00000017 +#define ABILITY_FLOWER_SAVER 0x00000018 +#define ABILITY_PAY_OFF 0x00000019 +#define ABILITY_QUICK_CHANGE 0x0000001A +#define ABILITY_DEFEND_PLUS 0x0000001B +#define ABILITY_POWER_PLUS 0x0000001C +#define ABILITY_REFUND 0x0000001D +#define ABILITY_POWER_RUSH 0x0000001E +#define ABILITY_CRAZY_HEART 0x0000001F +#define ABILITY_LAST_STAND 0x00000020 +#define ABILITY_CLOSE_CALL 0x00000021 +#define ABILITY_P_UP_D_DOWN 0x00000022 +#define ABILITY_LUCKY_DAY 0x00000023 +#define ABILITY_MEGA_H_P_DRAIN 0x00000024 +#define ABILITY_P_DOWN_D_UP 0x00000025 +#define ABILITY_FLOWER_FANATIC 0x00000026 +#define ABILITY_SPEEDY_SPIN 0x00000027 +#define ABILITY_SPIN_ATTACK 0x00000028 +#define ABILITY_I_SPY 0x00000029 +#define ABILITY_BUMP_ATTACK 0x0000002A +#define ABILITY_HEART_FINDER 0x0000002B +#define ABILITY_FLOWER_FINDER 0x0000002C +#define ABILITY_DIZZY_ATTACK 0x0000002D +#define ABILITY_FINAL_GOOMPA 0x0000002E +#define ABILITY_FINAL_BOMBOMB 0x0000002F +#define ABILITY_DEEP_FOCUS 0x00000030 +#define ABILITY_SUPER_FOCUS 0x00000031 +#define ABILITY_KAIDEN 0x00000032 +#define ABILITY_DAMAGE_DODGE 0x00000033 +#define ABILITY_HAPPY_FLOWER 0x00000034 +#define ABILITY_GROUP_FOCUS 0x00000035 +#define ABILITY_PEEKABOO 0x00000036 +#define ABILITY_HEALTHY_HEALTHY 0x00000037 + +typedef UNK_TYPE EMOTE; +#define EMOTE_EXCLAMATION 0x00000000 +#define EMOTE_SHOCK 0x00000001 +#define EMOTE_QUESTION 0x00000002 +#define EMOTE_FRUSTRATION 0x00000003 +#define EMOTE_ELLIPSIS 0x00000004 +#define EMOTE_INVALID 0x00000005 + +typedef UNK_TYPE ANIM; +#define ANIM_WHITE_BOO__STOP 0x00950000 +#define ANIM_WHITE_BOO__IDLE 0x00950001 +#define ANIM_WHITE_BOO__WALK 0x00950002 +#define ANIM_WHITE_BOO__RUN 0x00950003 +#define ANIM_WHITE_BOO__TALK 0x00950004 +#define ANIM_WHITE_BOO__WAVE 0x00950005 +#define ANIM_WHITE_BOO__PAIN 0x00950006 +#define ANIM_WHITE_BOO__HIDE 0x00950007 +#define ANIM_WHITE_BOO__SPOOK 0x00950008 +#define ANIM_WHITE_BOO__DENYING 0x00950009 +#define ANIM_WHITE_BOO__SKEPTICAL 0x0095000A +#define ANIM_WHITE_BOO__THROW 0x0095000B +#define ANIM_WHITE_BOO__CARRYING_STOP 0x0095000C +#define ANIM_WHITE_BOO__CARRYING_IDLE 0x0095000D +#define ANIM_WHITE_BOO__CARRYING_WALK 0x0095000E +#define ANIM_WHITE_BOO__CARRYING_RUN 0x0095000F +#define ANIM_WHITE_BOO__CARRYING_SHAKE 0x00950010 +#define ANIM_DUSTY_BOO__STOP 0x00950100 +#define ANIM_DUSTY_BOO__IDLE 0x00950101 +#define ANIM_DUSTY_BOO__WALK 0x00950102 +#define ANIM_DUSTY_BOO__RUN 0x00950103 +#define ANIM_DUSTY_BOO__TALK 0x00950104 +#define ANIM_DUSTY_BOO__WAVE 0x00950105 +#define ANIM_DUSTY_BOO__PAIN 0x00950106 +#define ANIM_DUSTY_BOO__HIDE 0x00950107 +#define ANIM_DUSTY_BOO__SPOOK 0x00950108 +#define ANIM_DUSTY_BOO__DENYING 0x00950109 +#define ANIM_DUSTY_BOO__SKEPTICAL 0x0095010A +#define ANIM_DUSTY_BOO__THROW 0x0095010B +#define ANIM_DUSTY_BOO__CARRYING_STOP 0x0095010C +#define ANIM_DUSTY_BOO__CARRYING_IDLE 0x0095010D +#define ANIM_DUSTY_BOO__CARRYING_WALK 0x0095010E +#define ANIM_DUSTY_BOO__CARRYING_RUN 0x0095010F +#define ANIM_DUSTY_BOO__CARRYING_SHAKE 0x00950110 + +typedef UNK_TYPE EASING; +#define EASING_LINEAR 0x00000000 +#define EASING_QUADRATIC_IN 0x00000001 +#define EASING_CUBIC_IN 0x00000002 +#define EASING_QUARTIC_IN 0x00000003 +#define EASING_QUADRATIC_OUT 0x00000004 +#define EASING_CUBIC_OUT 0x00000005 +#define EASING_QUARTIC_OUT 0x00000006 +#define EASING_COS_SLOW_OVERSHOOT 0x00000007 +#define EASING_COS_FAST_OVERSHOOT 0x00000008 +#define EASING_COS_BOUNCE 0x00000009 +#define EASING_COS_IN_OUT 0x0000000A +#define EASING_SIN_OUT 0x0000000B +#define EASING_COS_IN 0x0000000C + +typedef UNK_TYPE SOUND; +#define SOUND_JR_TROOPA_SPLASH 0x00000045 +#define SOUND_JR_TROOPA_SWIM 0x00000046 +#define SOUND_BOO_SPOOK 0x00000047 +#define SOUND_BOO_VANISH 0x000000C1 +#define SOUND_BOO_APPEAR 0x000000C3 +#define SOUND_MENU_OPEN 0x000000C5 +#define SOUND_MENU_CLOSE 0x000000C6 +#define SOUND_MENU_CHANGE_SELECTION 0x000000C7 +#define SOUND_MENU_CHANGE_TAB 0x000000C8 +#define SOUND_MENU_NEXT 0x000000C9 +#define SOUND_MENU_BACK 0x000000CA +#define SOUND_STEP1 0x00000141 +#define SOUND_STEP2 0x00000142 +#define SOUND_TORNADO_JUMP 0x00000147 +#define SOUND_SOFT_LAND 0x00000148 +#define SOUND_LAND 0x0000014B +#define SOUND_HIT_BLOCK 0x0000014E +#define SOUND_SEARCH_BUSH 0x00000153 +#define SOUND_BASIC_DOOR_OPEN 0x000001C1 +#define SOUND_BASIC_DOOR_CLOSE 0x000001C2 +#define SOUND_METAL_DOOR_OPEN 0x000001C3 +#define SOUND_METAL_DOOR_CLOSE 0x000001C4 +#define SOUND_LARGE_DOOR_OPEN 0x000001C5 +#define SOUND_LARGE_DOOR_CLOSE 0x000001C6 +#define SOUND_CREAKY_DOOR_OPEN 0x000001C7 +#define SOUND_CREAKY_DOOR_CLOSE 0x000001C8 +#define SOUND_METAL_GATE_OPEN 0x000001C9 +#define SOUND_METAL_GATE_CLOSE 0x000001CA +#define SOUND_BOW_SPOOK 0x00000291 +#define SOUND_SMOKE_BURST 0x000002CD +#define SOUND_DAYZEE_SONG 0x000002D7 +#define SOUND_POWER_UP 0x000002D8 +#define SOUND_SHY_GUY_SCREAMS1 0x0000030C +#define SOUND_SHY_GUY_SCREAMS2 0x0000030D +#define SOUND_SHY_GUY_SCREAMS3 0x0000030E +#define SOUND_TOY_TANK_MOVE1 0x0000030F +#define SOUND_TOY_TANK_MOVE2 0x00000310 +#define SOUND_GENERAL_WHISTLE 0x00000395 +#define SOUND_MOLE_SURFACE 0x00000321 +#define SOUND_MOLE_DIG 0x00000322 +#define SOUND_MOLE_POP 0x00000323 +#define SOUND_JUMP 0x000003E2 +#define SOUND_MISS_JUMP 0x000003E3 +#define SOUND_DEATH 0x000003E5 +#define SOUND_BIG_POWER_UP 0x000003E6 +#define SOUND_MOLE_THROW 0x000003E8 +#define SOUND_CLOSE_SHELL 0x000002FF +#define SOUND_OPEN_SHELL 0x000003D4 +#define SOUND_BOW_VANISH 0x0000200E +#define SOUND_BOW_APPEAR 0x0000200F +#define SOUND_CANNON1 0x00002016 +#define SOUND_CANNON2 0x00002017 +#define SOUND_CANNON3 0x00002018 +#define SOUND_JUMP_COPY 0x00002081 +#define SOUND_BOMB_BLAST 0x00002076 +#define SOUND_SPELL_CAST1 0x000020D4 +#define SOUND_SPELL_CAST2 0x000020D5 +#define SOUND_SPELL_CAST3 0x000020D6 +#define SOUND_SPELL_CAST4 0x000020D7 +#define SOUND_SPELL_CAST5 0x000020D8 + +typedef UNK_TYPE CAM; +#define CAM_DEFAULT 0x00000000 +#define CAM_BATTLE 0x00000001 +#define CAM_TATTLE 0x00000002 +#define CAM_CAM3 0x00000003 + +typedef UNK_TYPE ITEM; +#define ITEM_JUMP 0x00000001 +#define ITEM_SPIN_JUMP 0x00000002 +#define ITEM_TORNADO_JUMP 0x00000003 +#define ITEM_HAMMER 0x00000004 +#define ITEM_SUPER_HAMMER 0x00000005 +#define ITEM_ULTRA_HAMMER 0x00000006 +#define ITEM_LUCKY_STAR 0x00000007 +#define ITEM_MAP 0x00000008 +#define ITEM_BIG_MAP 0x00000009 +#define ITEM_FIRST_DEGREE_CARD 0x0000000A +#define ITEM_SECOND_DEGREE_CARD 0x0000000B +#define ITEM_THIRD_DEGREE_CARD 0x0000000C +#define ITEM_FOURTH_DEGREE_CARD 0x0000000D +#define ITEM_DIPLOMA 0x0000000E +#define ITEM_ULTRA_STONE 0x0000000F +#define ITEM_FORTRESS_KEY 0x00000010 +#define ITEM_RUINS_KEY 0x00000011 +#define ITEM_PULSE_STONE 0x00000012 +#define ITEM_CASTLE_KEY1 0x00000013 +#define ITEM_PALACE_KEY 0x00000014 +#define ITEM_LUNAR_STONE 0x00000015 +#define ITEM_PYRAMID_STONE 0x00000016 +#define ITEM_DIAMOND_STONE 0x00000017 +#define ITEM_GOLDEN_VASE 0x00000018 +#define ITEM_KOOPERS_SHELL 0x00000019 +#define ITEM_CASTLE_KEY2 0x0000001A +#define ITEM_FOREST_PASS 0x0000001B +#define ITEM_WEIGHT 0x0000001C +#define ITEM_BOOS_PORTRAIT 0x0000001D +#define ITEM_CRYSTAL_BERRY 0x0000001E +#define ITEM_MYSTICAL_KEY 0x0000001F +#define ITEM_STOREROOM_KEY 0x00000020 +#define ITEM_TOY_TRAIN 0x00000021 +#define ITEM_RECORD 0x00000022 +#define ITEM_FRYING_PAN 0x00000023 +#define ITEM_DICTIONARY 0x00000024 +#define ITEM_MYSTERY_NOTE 0x00000025 +#define ITEM_SUSPICIOUS_NOTE 0x00000026 +#define ITEM_CRYSTAL_BALL 0x00000027 +#define ITEM_SCREWDRIVER 0x00000028 +#define ITEM_COOKBOOK 0x00000029 +#define ITEM_JADE_RAVEN 0x0000002A +#define ITEM_MAGICAL_SEED1 0x0000002B +#define ITEM_MAGICAL_SEED2 0x0000002C +#define ITEM_MAGICAL_SEED3 0x0000002D +#define ITEM_MAGICAL_SEED4 0x0000002E +#define ITEM_TOAD_DOLL 0x0000002F +#define ITEM_CALCULATOR 0x00000030 +#define ITEM_BUCKET 0x00000031 +#define ITEM_SCARF 0x00000032 +#define ITEM_RED_KEY 0x00000033 +#define ITEM_BLUE_KEY 0x00000034 +#define ITEM_LETTER01 0x00000036 +#define ITEM_LETTER02 0x00000037 +#define ITEM_LETTER03 0x00000038 +#define ITEM_LETTER04 0x00000039 +#define ITEM_LETTER05 0x0000003A +#define ITEM_LETTER06 0x0000003B +#define ITEM_LETTER07 0x0000003C +#define ITEM_LETTER08 0x0000003D +#define ITEM_LETTER09 0x0000003E +#define ITEM_LETTER10 0x00000040 +#define ITEM_LETTER11 0x00000041 +#define ITEM_LETTER12 0x00000045 +#define ITEM_LETTER13 0x00000046 +#define ITEM_LETTER14 0x00000047 +#define ITEM_LETTER15 0x00000048 +#define ITEM_LETTER16 0x00000049 +#define ITEM_LETTER17 0x0000004A +#define ITEM_LETTER18 0x0000004B +#define ITEM_LETTER19 0x0000004C +#define ITEM_LETTER20 0x0000004E +#define ITEM_LETTER21 0x0000004F +#define ITEM_LETTER22 0x00000050 +#define ITEM_LETTER23 0x00000051 +#define ITEM_LETTER24 0x00000052 +#define ITEM_ARTIFACT 0x00000053 +#define ITEM_LETTER25 0x00000054 +#define ITEM_DOLLY 0x00000056 +#define ITEM_WATER_STONE 0x00000057 +#define ITEM_MAGICAL_BEAN 0x00000058 +#define ITEM_FERTILE_SOIL 0x00000059 +#define ITEM_MIRACLE_WATER 0x0000005A +#define ITEM_VOLCANO_VASE 0x0000005B +#define ITEM_TAPE 0x0000005C +#define ITEM_SUGAR 0x0000005D +#define ITEM_SALT 0x0000005E +#define ITEM_EGG1 0x0000005F +#define ITEM_CREAM 0x00000060 +#define ITEM_STRAWBERRY 0x00000061 +#define ITEM_BUTTER 0x00000062 +#define ITEM_CLEANSER 0x00000063 +#define ITEM_WATER 0x00000064 +#define ITEM_FLOUR 0x00000065 +#define ITEM_MILK 0x00000066 +#define ITEM_LYRICS 0x00000067 +#define ITEM_MELODY 0x00000068 +#define ITEM_MAILBAG 0x00000069 +#define ITEM_CASTLE_KEY3 0x0000006A +#define ITEM_ODD_KEY 0x0000006B +#define ITEM_STAR_STONE 0x0000006C +#define ITEM_SNEAKY_PARASOL 0x0000006D +#define ITEM_KOOPA_LEGENDS 0x0000006E +#define ITEM_AUTOGRAPH1 0x0000006F +#define ITEM_EMPTY_WALLET 0x00000070 +#define ITEM_AUTOGRAPH2 0x00000071 +#define ITEM_KOOPA_SHELL 0x00000072 +#define ITEM_OLD_PHOTO 0x00000073 +#define ITEM_GLASSES 0x00000074 +#define ITEM_PHOTOGRAPH 0x00000075 +#define ITEM_PACKAGE 0x00000076 +#define ITEM_RED_JAR 0x00000077 +#define ITEM_CASTLE_KEY4 0x00000078 +#define ITEM_WAREHOUSE_KEY 0x00000079 +#define ITEM_PRISON_KEY1 0x0000007A +#define ITEM_SILVER_CREDIT 0x0000007B +#define ITEM_GOLD_CREDIT 0x0000007C +#define ITEM_PRISON_KEY2 0x0000007D +#define ITEM_PRISON_KEY3 0x0000007E +#define ITEM_PRISON_KEY4 0x0000007F +#define ITEM_FIRE_FLOWER 0x00000080 +#define ITEM_SNOWMAN_DOLL 0x00000081 +#define ITEM_THUNDER_RAGE 0x00000082 +#define ITEM_SHOOTING_STAR 0x00000083 +#define ITEM_THUNDER_BOLT 0x00000084 +#define ITEM_PEBBLE 0x00000085 +#define ITEM_DUSTY_HAMMER 0x00000086 +#define ITEM_INSECTICIDE_HERB 0x00000087 +#define ITEM_STONE_CAP 0x00000088 +#define ITEM_TASTY_TONIC 0x00000089 +#define ITEM_MUSHROOM 0x0000008A +#define ITEM_VOLT_SHROOM 0x0000008B +#define ITEM_SUPER_SHROOM 0x0000008C +#define ITEM_DRIED_SHROOM 0x0000008D +#define ITEM_ULTRA_SHROOM 0x0000008E +#define ITEM_SLEEPY_SHEEP 0x0000008F +#define ITEM_P_O_W_BLOCK 0x00000090 +#define ITEM_HUSTLE_DRINK 0x00000091 +#define ITEM_STOP_WATCH 0x00000092 +#define ITEM_WHACKAS_BUMP 0x00000093 +#define ITEM_APPLE 0x00000094 +#define ITEM_LIFE_SHROOM 0x00000095 +#define ITEM_MYSTERY 0x00000096 +#define ITEM_REPEL_GEL 0x00000097 +#define ITEM_FRIGHT_JAR 0x00000098 +#define ITEM_PLEASE_COME_BACK 0x00000099 +#define ITEM_DIZZY_DIAL 0x0000009A +#define ITEM_SUPER_SODA 0x0000009B +#define ITEM_LEMON 0x0000009C +#define ITEM_LIME 0x0000009D +#define ITEM_BLUE_BERRY 0x0000009E +#define ITEM_RED_BERRY 0x0000009F +#define ITEM_YELLOW_BERRY 0x000000A0 +#define ITEM_BUBBLE_BERRY 0x000000A1 +#define ITEM_JAMMIN_JELLY 0x000000A2 +#define ITEM_MAPLE_SYRUP 0x000000A3 +#define ITEM_HONEY_SYRUP 0x000000A4 +#define ITEM_GOOMNUT 0x000000A5 +#define ITEM_KOOPA_LEAF 0x000000A6 +#define ITEM_DRIED_PASTA 0x000000A7 +#define ITEM_DRIED_FRUIT 0x000000A8 +#define ITEM_STRANGE_LEAF 0x000000A9 +#define ITEM_CAKE_MIX 0x000000AA +#define ITEM_EGG2 0x000000AB +#define ITEM_COCONUT 0x000000AC +#define ITEM_MELON 0x000000AD +#define ITEM_STINKY_HERB 0x000000AE +#define ITEM_ICED_POTATO 0x000000AF +#define ITEM_SPICY_SOUP 0x000000B0 +#define ITEM_APPLE_PIE 0x000000B1 +#define ITEM_HONEY_ULTRA 0x000000B2 +#define ITEM_MAPLE_ULTRA 0x000000B3 +#define ITEM_JELLY_ULTRA 0x000000B4 +#define ITEM_KOOPASTA 0x000000B5 +#define ITEM_FRIED_SHROOM 0x000000B6 +#define ITEM_SHROOM_CAKE 0x000000B7 +#define ITEM_SHROOM_STEAK 0x000000B8 +#define ITEM_HOT_SHROOM 0x000000B9 +#define ITEM_SWEET_SHROOM 0x000000BA +#define ITEM_YUMMY_MEAL 0x000000BB +#define ITEM_HEALTHY_JUICE 0x000000BC +#define ITEM_BLAND_MEAL 0x000000BD +#define ITEM_DELUXE_FEAST 0x000000BE +#define ITEM_SPECIAL_SHAKE 0x000000BF +#define ITEM_BIG_COOKIE 0x000000C0 +#define ITEM_CAKE 0x000000C1 +#define ITEM_MISTAKE 0x000000C2 +#define ITEM_KOOPA_TEA 0x000000C3 +#define ITEM_HONEY_SUPER 0x000000C4 +#define ITEM_MAPLE_SUPER 0x000000C5 +#define ITEM_JELLY_SUPER 0x000000C6 +#define ITEM_SPAGHETTI 0x000000C7 +#define ITEM_EGG_MISSILE 0x000000C8 +#define ITEM_FRIED_EGG 0x000000C9 +#define ITEM_HONEY_SHROOM 0x000000CA +#define ITEM_HONEY_CANDY 0x000000CB +#define ITEM_ELECTRO_POP 0x000000CC +#define ITEM_FIRE_POP 0x000000CD +#define ITEM_LIME_CANDY 0x000000CE +#define ITEM_COCO_POP 0x000000CF +#define ITEM_LEMON_CANDY 0x000000D0 +#define ITEM_JELLY_POP 0x000000D1 +#define ITEM_STRANGE_CAKE 0x000000D2 +#define ITEM_KOOKY_COOKIE 0x000000D3 +#define ITEM_FROZEN_FRIES 0x000000D4 +#define ITEM_POTATO_SALAD 0x000000D5 +#define ITEM_NUTTY_CAKE 0x000000D6 +#define ITEM_MAPLE_SHROOM 0x000000D7 +#define ITEM_BOILED_EGG 0x000000D8 +#define ITEM_YOSHI_COOKIE 0x000000D9 +#define ITEM_JELLY_SHROOM1 0x000000DA +#define ITEM_JELLY_SHROOM2 0x000000DB +#define ITEM_JELLY_SHROOM3 0x000000DC +#define ITEM_JELLY_SHROOM4 0x000000DD +#define ITEM_JELLY_SHROOM5 0x000000DE +#define ITEM_JELLY_SHROOM6 0x000000DF +#define ITEM_SPIN_SMASH 0x000000E0 +#define ITEM_MULTIBOUNCE 0x000000E1 +#define ITEM_POWER_PLUS_A 0x000000E2 +#define ITEM_DODGE_MASTER 0x000000E3 +#define ITEM_POWER_BOUNCE 0x000000E4 +#define ITEM_SPIKE_SHIELD 0x000000E5 +#define ITEM_FIRST_ATTACK 0x000000E6 +#define ITEM_H_P_PLUS_A 0x000000E7 +#define ITEM_QUAKE_HAMMER 0x000000E8 +#define ITEM_DOUBLE_DIP 0x000000E9 +#define ITEM_MYSTERY_SCROLL 0x000000EA +#define ITEM_SLEEP_STOMP 0x000000EB +#define ITEM_FIRE_SHIELD 0x000000EC +#define ITEM_QUICK_CHANGE 0x000000ED +#define ITEM_D_DOWN_POUND 0x000000EE +#define ITEM_DIZZY_STOMP 0x000000EF +#define ITEM_SMASH_CHARGE0 0x000000F0 +#define ITEM_PRETTY_LUCKY 0x000000F1 +#define ITEM_FEELING_FINE 0x000000F2 +#define ITEM_ATTACK_F_X_A 0x000000F3 +#define ITEM_ALLOR_NOTHING 0x000000F4 +#define ITEM_H_P_DRAIN 0x000000F5 +#define ITEM_JUMP_CHARGE0 0x000000F6 +#define ITEM_SLOW_GO 0x000000F7 +#define ITEM_F_P_PLUS_A 0x000000F8 +#define ITEM_MEGA_RUSH 0x000000F9 +#define ITEM_ICE_POWER 0x000000FA +#define ITEM_DEFEND_PLUS_A 0x000000FB +#define ITEM_PAY_OFF 0x000000FC +#define ITEM_MONEY_MONEY 0x000000FD +#define ITEM_CHILL_OUT 0x000000FE +#define ITEM_HAPPY_HEART_A 0x000000FF +#define ITEM_ZAP_TAP 0x00000100 +#define ITEM_BERSERKER 0x00000101 +#define ITEM_RIGHT_ON 0x00000102 +#define ITEM_RUNAWAY_PAY 0x00000103 +#define ITEM_REFUND 0x00000104 +#define ITEM_FLOWER_SAVER_A 0x00000105 +#define ITEM_TRIPLE_DIP 0x00000106 +#define ITEM_HAMMER_THROW 0x00000107 +#define ITEM_MEGA_QUAKE 0x00000108 +#define ITEM_SMASH_CHARGE 0x00000109 +#define ITEM_JUMP_CHARGE 0x0000010A +#define ITEM_S_SMASH_CHG 0x0000010B +#define ITEM_S_JUMP_CHG 0x0000010C +#define ITEM_POWER_RUSH 0x0000010D +#define ITEM_AUTO_JUMP 0x0000010E +#define ITEM_AUTO_SMASH 0x0000010F +#define ITEM_CRAZY_HEART 0x00000110 +#define ITEM_LAST_STAND 0x00000111 +#define ITEM_CLOSE_CALL 0x00000112 +#define ITEM_P_UP_D_DOWN 0x00000113 +#define ITEM_LUCKY_DAY 0x00000114 +#define ITEM_MEGA_H_P_DRAIN 0x00000115 +#define ITEM_P_DOWN_D_UP 0x00000116 +#define ITEM_POWER_QUAKE 0x00000117 +#define ITEM_AUTO_MULTIBOUNCE 0x00000118 +#define ITEM_FLOWER_FANATIC 0x00000119 +#define ITEM_HEART_FINDER 0x0000011A +#define ITEM_FLOWER_FINDER 0x0000011B +#define ITEM_SPIN_ATTACK 0x0000011C +#define ITEM_DIZZY_ATTACK 0x0000011D +#define ITEM_I_SPY 0x0000011E +#define ITEM_SPEEDY_SPIN 0x0000011F +#define ITEM_BUMP_ATTACK 0x00000120 +#define ITEM_POWER_JUMP 0x00000121 +#define ITEM_SUPER_JUMP 0x00000122 +#define ITEM_MEGA_JUMP 0x00000123 +#define ITEM_POWER_SMASH1 0x00000124 +#define ITEM_SUPER_SMASH 0x00000125 +#define ITEM_MEGA_SMASH 0x00000126 +#define ITEM_POWER_SMASH2 0x00000127 +#define ITEM_POWER_SMASH3 0x00000128 +#define ITEM_DEEP_FOCUS1 0x00000129 +#define ITEM_SUPER_FOCUS 0x0000012A +#define ITEM_SHRINK_SMASH 0x0000012B +#define ITEM_SHELL_CRACK 0x0000012C +#define ITEM_KAIDEN 0x0000012D +#define ITEM_D_DOWN_JUMP 0x0000012E +#define ITEM_SHRINK_STOMP 0x0000012F +#define ITEM_DAMAGE_DODGE_A 0x00000130 +#define ITEM_EARTHQUAKE_JUMP 0x00000131 +#define ITEM_DEEP_FOCUS2 0x00000132 +#define ITEM_DEEP_FOCUS3 0x00000133 +#define ITEM_H_P_PLUS_B 0x00000134 +#define ITEM_F_P_PLUS_B 0x00000135 +#define ITEM_HAPPY_HEART_B 0x00000136 +#define ITEM_HAPPY_HEART_X 0x00000137 +#define ITEM_FLOWER_SAVER_B 0x00000138 +#define ITEM_FLOWER_SAVER_X 0x00000139 +#define ITEM_DAMAGE_DODGE_B 0x0000013A +#define ITEM_DAMAGE_DODGE_X 0x0000013B +#define ITEM_POWER_PLUS_B 0x0000013C +#define ITEM_POWER_PLUS_X 0x0000013D +#define ITEM_DEFEND_PLUS_X 0x0000013E +#define ITEM_DEFEND_PLUS_Y 0x0000013F +#define ITEM_HAPPY_FLOWER_A 0x00000140 +#define ITEM_HAPPY_FLOWER_B 0x00000141 +#define ITEM_HAPPY_FLOWER_X 0x00000142 +#define ITEM_GROUP_FOCUS 0x00000143 +#define ITEM_PEEKABOO 0x00000144 +#define ITEM_ATTACK_F_X_D 0x00000145 +#define ITEM_ATTACK_F_X_B 0x00000146 +#define ITEM_ATTACK_F_X_E 0x00000147 +#define ITEM_ATTACK_F_X_C 0x00000148 +#define ITEM_ATTACK_F_X_F 0x00000149 +#define ITEM_H_P_PLUS_C 0x0000014A +#define ITEM_H_P_PLUS_X 0x0000014B +#define ITEM_H_P_PLUS_Y 0x0000014C +#define ITEM_F_P_PLUS_C 0x0000014D +#define ITEM_F_P_PLUS_X 0x0000014E +#define ITEM_F_P_PLUS_Y 0x0000014F +#define ITEM_HEALTHY_HEALTHY 0x00000150 +#define ITEM_ATTACK_F_X_F2 0x00000151 +#define ITEM_ATTACK_F_X_F3 0x00000152 +#define ITEM_ATTACK_F_X_F4 0x00000153 +#define ITEM_ATTACK_F_X_F5 0x00000154 +#define ITEM_PARTNER_ATTACK 0x00000155 +#define ITEM_HEART 0x00000156 +#define ITEM_COIN 0x00000157 +#define ITEM_HEART_PIECE 0x00000158 +#define ITEM_STAR_POINT 0x00000159 +#define ITEM_FULL_HEAL 0x0000015A +#define ITEM_FLOWER 0x0000015B +#define ITEM_STAR_PIECE 0x0000015C +#define ITEM_PRESENT 0x0000015D +#define ITEM_COMPLETE_CAKE 0x0000015E +#define ITEM_BARE_CAKE 0x0000015F +#define ITEM_EMPTY_CAKE_PAN 0x00000160 +#define ITEM_FULL_CAKE_PAN 0x00000161 +#define ITEM_EMPTY_MIXING_BOWL 0x00000162 +#define ITEM_FULL_MIXING_BOWL 0x00000163 +#define ITEM_CAKE_WITH_ICING 0x00000164 +#define ITEM_CAKE_WITH_BERRIES 0x00000165 +#define ITEM_HAMMER1_ICON 0x00000166 +#define ITEM_HAMMER2_ICON 0x00000167 +#define ITEM_HAMMER3_ICON 0x00000168 +#define ITEM_BOOTS1_ICON 0x00000169 +#define ITEM_BOOTS2_ICON 0x0000016A +#define ITEM_BOOTS3_ICON 0x0000016B +#define ITEM_ITEMS_ICON 0x0000016C + +typedef UNK_TYPE PLAYER_ANIM; +#define PLAYER_ANIM_STAND_STILL 0x00010000 +#define PLAYER_ANIM_CROUCH_STILL 0x00010001 +#define PLAYER_ANIM_PANTING 0x00010003 +#define PLAYER_ANIM_WALKING 0x00010004 +#define PLAYER_ANIM_RUNNING 0x00010005 +#define PLAYER_ANIM_BEFORE_JUMP 0x00010006 +#define PLAYER_ANIM_MIDAIR_STILL 0x00010007 +#define PLAYER_ANIM_MIDAIR 0x00010008 +#define PLAYER_ANIM_STUNNED_STILL 0x0001000E +#define PLAYER_ANIM_DEAD_STILL 0x0001000F +#define PLAYER_ANIM_SPINNING 0x00010011 +#define PLAYER_ANIM_FLAILING 0x00010012 +#define PLAYER_ANIM_SIT_STILL 0x00010013 +#define PLAYER_ANIM_CROUCH 0x00010014 +#define PLAYER_ANIM_STONE_STILL 0x00010015 +#define PLAYER_ANIM_THROW 0x00010016 +#define PLAYER_ANIM_FALL_BACK 0x00010017 +#define PLAYER_ANIM_FALL_DOWN 0x00010018 +#define PLAYER_ANIM_SCARED 0x00010019 +#define PLAYER_ANIM_HURT_FOOT 0x0001001A +#define PLAYER_ANIM_RUN_PANIC 0x0001001B +#define PLAYER_ANIM_EAT 0x0001001C +#define PLAYER_ANIM_STICK_OUT_TONGUE 0x0001001D +#define PLAYER_ANIM_PLANT 0x0001001E +#define PLAYER_ANIM_GOT_ITEM 0x0001001F +#define PLAYER_ANIM_READY_JUMP 0x00010020 +#define PLAYER_ANIM_THINKING 0x00010021 +#define PLAYER_ANIM_LOST_BALANCE 0x00010022 +#define PLAYER_ANIM_SHOCK_STILL 0x00010023 +#define PLAYER_ANIM_DRINK 0x00010025 +#define PLAYER_ANIM_SQUISH 0x00010026 +#define PLAYER_ANIM_RUN_THINKING 0x00010027 +#define PLAYER_ANIM_QUESTION 0x00010028 +#define PLAYER_ANIM_NOD_YES 0x00010029 +#define PLAYER_ANIM_PRAY 0x0001002C +#define PLAYER_ANIM_CHARRED 0x0001002F +#define PLAYER_ANIM_GET_UP 0x00010030 +#define PLAYER_ANIM_DUST_OFF 0x00010031 +#define PLAYER_ANIM_THUMBS_UP 0x00010032 + +typedef UNK_TYPE AMBIENT_SOUNDS; +#define AMBIENT_SOUNDS_SPOOKY 0x00000000 +#define AMBIENT_SOUNDS_WIND 0x00000001 +#define AMBIENT_SOUNDS_BEACH 0x00000002 +#define AMBIENT_SOUNDS_JUNGLE 0x00000003 +#define AMBIENT_SOUNDS_UNDER_SEA1 0x00000004 +#define AMBIENT_SOUNDS_UNDER_SEA2 0x00000005 +#define AMBIENT_SOUNDS_SILENCE 0x00000006 +#define AMBIENT_SOUNDS_UNDER_SEA3 0x00000007 +#define AMBIENT_SOUNDS_UNDER_SEA4 0x00000008 +#define AMBIENT_SOUNDS_EXIT_SEA 0x00000009 +#define AMBIENT_SOUNDS_UNDER_SEA5 0x0000000A +#define AMBIENT_SOUNDS_UNDER_SEA6 0x0000000B +#define AMBIENT_SOUNDS_BIRDS 0x0000000C +#define AMBIENT_SOUNDS_SEA 0x0000000D +#define AMBIENT_SOUNDS_MUSIC 0x00000010 + +typedef UNK_TYPE OUTCOME; +#define OUTCOME_PLAYER_WON 0x00000000 +#define OUTCOME_PLAYER_LOST 0x00000001 +#define OUTCOME_PLAYER_FLED 0x00000002 +#define OUTCOME_ENEMY_FLED 0x00000003 + +typedef UNK_TYPE DECORATION; +#define DECORATION_GOLDEN_FLAMES 0x00000001 +#define DECORATION_SWEAT 0x00000002 +#define DECORATION_SEEING_STARS 0x00000003 +#define DECORATION_RED_FLAMES 0x00000004 +#define DECORATION_GREY_SMOKE_TRAIL 0x00000005 +#define DECORATION_FIRE_SMOKE_TRAIL 0x00000006 +#define DECORATION_WHIRLWIND 0x00000007 +#define DECORATION_STEAM_EMITTER 0x00000008 +#define DECORATION_RADIAL_STAR_EMITTER 0x0000000B + +typedef UNK_TYPE HIT_RESULT; +#define HIT_RESULT_HIT 0x00000000 +#define HIT_RESULT_LANDED_ON_SPIKE 0x00000004 +#define HIT_RESULT_LUCKY 0x00000005 +#define HIT_RESULT_MISS 0x00000006 +#define HIT_RESULT_HIT_STATIC 0x00000007 +#define HIT_RESULT_IMMUNE 0x00000008 +#define HIT_RESULT_TRIGGERED_EXPLODE -1 + +typedef UNK_TYPE ITER; +#define ITER_FIRST 0xFFFFFFFF +#define ITER_LAST 0x0000000A +#define ITER_NEXT 0x00000000 +#define ITER_PREV 0x00000001 + +typedef UNK_TYPE ACTOR_SOUND; +#define ACTOR_SOUND_WALK 0x00000000 +#define ACTOR_SOUND_FLY 0x00000001 +#define ACTOR_SOUND_JUMP 0x00000002 +#define ACTOR_SOUND_HURT 0x00000003 +#define ACTOR_SOUND_WALK_INCREMENT 0x00000004 +#define ACTOR_SOUND_FLY_INCREMENT 0x00000005 + +typedef UNK_TYPE PHASE; +#define PHASE_EXECUTE_ACTION 0x00000000 +#define PHASE_FIRST_STRIKE 0x00000001 +#define PHASE_RUN_AWAY_START 0x00000003 +#define PHASE_RUN_AWAY_RESET 0x00000004 +#define PHASE_RUN_AWAY_FAIL 0x00000007 +#define PHASE_USE_DEFEND 0x00000006 +#define PHASE_USE_LIFE_SHROOM 0x00000008 +#define PHASE_PLAYER_BEGIN 0x0000000A +#define PHASE_PLAYER_END 0x0000000D +#define PHASE_ENEMY_BEGIN 0x0000000C +#define PHASE_ENEMY_END 0x0000000B +#define PHASE_MERLEE_ATTACK_BONUS 0x00000014 +#define PHASE_MERLEE_DEFENSE_BONUS 0x00000015 +#define PHASE_MERLEE_EXP_BONUS 0x00000016 +#define PHASE_PLAYER_HAPPY 0x0000001E + +typedef UNK_TYPE ACTOR; +#define ACTOR_SELF 0xFFFFFF81 +#define ACTOR_PLAYER 0x00000000 +#define ACTOR_PARTNER 0x00000100 +#define ACTOR_ENEMY0 0x00000200 +#define ACTOR_ENEMY1 0x00000201 +#define ACTOR_ENEMY2 0x00000202 +#define ACTOR_ENEMY3 0x00000203 +#define ACTOR_ENEMY4 0x00000204 +#define ACTOR_ENEMY5 0x00000205 +#define ACTOR_ENEMY6 0x00000206 +#define ACTOR_ENEMY7 0x00000207 +#define ACTOR_ENEMY8 0x00000208 +#define ACTOR_ENEMY9 0x00000209 +#define ACTOR_ENEMY10 0x0000020A +#define ACTOR_ENEMY11 0x0000020B +#define ACTOR_ENEMY12 0x0000020C +#define ACTOR_ENEMY13 0x0000020D +#define ACTOR_ENEMY14 0x0000020E +#define ACTOR_ENEMY15 0x0000020F +#define ACTOR_ENEMY16 0x00000210 +#define ACTOR_ENEMY17 0x00000211 +#define ACTOR_ENEMY18 0x00000212 +#define ACTOR_ENEMY19 0x00000213 +#define ACTOR_ENEMY20 0x00000214 +#define ACTOR_ENEMY21 0x00000215 +#define ACTOR_ENEMY22 0x00000216 +#define ACTOR_ENEMY23 0x00000217 + +typedef UNK_TYPE ELEMENT; +#define ELEMENT_NORMAL 0x00000001 +#define ELEMENT_FIRE 0x00000002 +#define ELEMENT_WATER 0x00000003 +#define ELEMENT_ICE 0x00000004 +#define ELEMENT_MYSTERY 0x00000005 +#define ELEMENT_MAGIC 0x00000007 +#define ELEMENT_HAMMER 0x00000008 +#define ELEMENT_JUMP 0x00000009 +#define ELEMENT_COSMIC 0x0000000A +#define ELEMENT_BLAST 0x0000000B +#define ELEMENT_SHOCK 0x0000000C +#define ELEMENT_QUAKE 0x0000000D +#define ELEMENT_THROW 0x0000000F +#define ELEMENT_END 0x00000000 + +typedef UNK_TYPE EVENT; +#define EVENT_IMMUNE 0x00000019 +#define EVENT_HIT_COMBO 0x00000009 +#define EVENT_HIT 0x0000000A +#define EVENT_DEATH 0x00000020 +#define EVENT_FALL_TRIGGER 0x0000000C +#define EVENT_FLIP_TRIGGER 0x0000000D +#define EVENT_EXPLODE_TRIGGER 0x00000022 +#define EVENT_SPIN_SMASH_HIT 0x0000000B +#define EVENT_SPIN_SMASH_DEATH 0x00000021 +#define EVENT_SPIN_SMASH_LAUNCH_HIT 0x00000011 +#define EVENT_SPIN_SMASH_LAUNCH_DEATH 0x00000015 +#define EVENT_POWER_BOUNCE_HIT 0x00000015 +#define EVENT_POWER_BOUNCE_DEATH 0x00000028 +#define EVENT_BURN_HIT 0x0000000E +#define EVENT_BURN_DEATH 0x00000024 +#define EVENT_SHOCK_HIT 0x0000002F +#define EVENT_SHOCK_DEATH 0x00000026 +#define EVENT_BEGIN_AIR_LIFT 0x0000003A +#define EVENT_AIR_LIFT_FAILED 0x0000001F +#define EVENT_BLOW_AWAY 0x00000016 +#define EVENT_SCARE_AWAY 0x00000039 +#define EVENT_UP_AND_AWAY 0x0000003D +#define EVENT_STAR_BEAM 0x00000013 +#define EVENT_RECOVER_STATUS 0x00000031 +#define EVENT_SWAP_PARTNER 0x0000003F +#define EVENT_BLOCK 0x0000001A +#define EVENT_SPIKE_CONTACT 0x0000002A +#define EVENT_SPIKE_DEATH 0x00000027 +#define EVENT_SPIKE_TAUNT 0x0000001B +#define EVENT_BURN_CONTACT 0x0000002C +#define EVENT_BURN_TAUNT 0x0000001C +#define EVENT_BEGIN_FIRST_STRIKE 0x00000038 +#define EVENT_END_FIRST_STRIKE 0x00000035 +#define EVENT_LIFE_SHROOM_PROC 0x00000040 +#define EVENT_REVIVE 0x00000041 +#define EVENT_LUCKY 0x00000037 + +typedef UNK_TYPE HIT_SOUND; +#define HIT_SOUND_MISS 0x00000000 +#define HIT_SOUND_BONES 0x00000001 +#define HIT_SOUND_NORMAL 0x00000002 +#define HIT_SOUND_FIRE 0x00000003 +#define HIT_SOUND_ICE 0x00000004 +#define HIT_SOUND_SHOCK 0x00000005 + +typedef UNK_TYPE STATUS; +#define STATUS_NORMAL 0x00000001 +#define STATUS_DEFAULT 0x00000002 +#define STATUS_DEFAULT_TURN_MOD 0x0000001F +#define STATUS_SLEEP 0x00000006 +#define STATUS_SLEEP_TURN_MOD 0x00000020 +#define STATUS_POISON 0x00000009 +#define STATUS_POISON_TURN_MOD 0x00000025 +#define STATUS_FROZEN 0x00000007 +#define STATUS_FROZEN_TURN_MOD 0x00000022 +#define STATUS_DIZZY 0x00000004 +#define STATUS_DIZZY_TURN_MOD 0x00000024 +#define STATUS_FEAR 0x00000003 +#define STATUS_FEAR_TURN_MOD 0x00000023 +#define STATUS_STATIC 0x0000000B +#define STATUS_STATIC_TURN_MOD 0x00000021 +#define STATUS_PARALYZE 0x00000005 +#define STATUS_PARALYZE_TURN_MOD 0x00000026 +#define STATUS_SHRINK 0x0000000A +#define STATUS_SHRINK_TURN_MOD 0x00000027 +#define STATUS_STOP 0x00000008 +#define STATUS_STOP_TURN_MOD 0x00000029 +#define STATUS_STONE 0x0000000C +#define STATUS_DAZE 0x0000000D +#define STATUS_END 0x00000000 +#define STATUS_BERSERK 0x00000010 +#define STATUS_TURN_DONE 0x00000012 +#define STATUS_HUSTLE 0x00000019 +#define STATUS_DANGER 0x0000001A +#define STATUS_THINKING 0x0000001C +#define STATUS_WEARY 0x0000001D + +typedef UNK_TYPE DOOR_SWING; +#define DOOR_SWING_IN 0x00000001 +#define DOOR_SWING_OUT -1 + +typedef UNK_TYPE ITEM_SPAWN_MODE; +#define ITEM_SPAWN_MODE_DECORATION 0x00000001 +#define ITEM_SPAWN_MODE_TOSS__SPAWN_ALWAYS 0x00000003 +#define ITEM_SPAWN_MODE_BATTLE_REWARD 0x00000004 +#define ITEM_SPAWN_MODE_TOSS__NEVER_VANISH 0x00000005 +#define ITEM_SPAWN_MODE_TOSS 0x00000006 +#define ITEM_SPAWN_MODE_TOSS__SPAWN_ONCE 0x00000007 +#define ITEM_SPAWN_MODE_TOSS__SPAWN_ONCE__NEVER_VANISH 0x00000008 +#define ITEM_SPAWN_MODE_TOSS__SPAWN_ALWAYS__NEVER_VANISH 0x00000009 +#define ITEM_SPAWN_MODE_ITEM_BLOCK__ITEM 0x0000000A +#define ITEM_SPAWN_MODE_ITEM_BLOCK__BADGE 0x0000000B +#define ITEM_SPAWN_MODE_FALL__SPAWN_ALWAYS 0x0000000C +#define ITEM_SPAWN_MODE_FALL__NEVER_VANISH 0x0000000D +#define ITEM_SPAWN_MODE_FALL 0x0000000E +#define ITEM_SPAWN_MODE_FALL__SPAWN_ONCE 0x0000000F +#define ITEM_SPAWN_MODE_FIXED__SPAWN_ALWAYS 0x00000010 +#define ITEM_SPAWN_MODE_FIXED__NEVER_VANISH 0x00000011 +#define ITEM_SPAWN_MODE_FIXED 0x00000012 +#define ITEM_SPAWN_MODE_FIXED__SPAWN_ALWAYS__NEVER_VANISH 0x00000013 +#define ITEM_SPAWN_MODE_ITEM_BLOCK__SPAWN_ALWAYS 0x00000014 +#define ITEM_SPAWN_MODE_ITEM_BLOCK__COIN 0x00000015 +#define ITEM_SPAWN_MODE_TOSS__HIGHER__NEVER_VANISH 0x00000016 +#define ITEM_SPAWN_MODE_TOSS__SPAWN_ALWAYS__SMALL 0x0000001A + +typedef UNK_TYPE LOCATION; +#define LOCATION_NONE 0x00000018 +#define LOCATION_TESTING 0x00000017 +#define LOCATION_TOAD_TOWN 0x00000001 +#define LOCATION_PEACH_CASTLE_GROUNDS 0x00000019 +#define LOCATION_SHOOTING_STAR_SUMMIT 0x0000001B +#define LOCATION_TOAD_TOWN_TUNNELS 0x00000002 +#define LOCATION_GOOMBA_VILLAGE 0x0000001E +#define LOCATION_GOOMBA_ROAD 0x0000001F +#define LOCATION_PLEASANT_PATH 0x00000020 +#define LOCATION_KOOPA_VILLAGE 0x00000021 +#define LOCATION_KOOPA_BROS_FORTRESS 0x00000007 +#define LOCATION_MT_RUGGED 0x00000008 +#define LOCATION_DRY_DRY_DESERT 0x0000000A +#define LOCATION_DRY_DRY_OUTPOST 0x00000009 +#define LOCATION_DRY_DRY_RUINS 0x0000000B +#define LOCATION_FOREVER_FOREST 0x0000000C +#define LOCATION_BOOS_MANSION 0x0000000D +#define LOCATION_GUSTY_GULCH 0x00000022 +#define LOCATION_TUBBAS_MANOR 0x0000000F +#define LOCATION_WINDY_MILL 0x00000023 +#define LOCATION_SHY_GUYS_TOYBOX 0x00000010 +#define LOCATION_JADE_JUNGLE 0x00000024 +#define LOCATION_YOSHIS_VILLAGE 0x00000025 +#define LOCATION_MT_LAVALAVA 0x00000012 +#define LOCATION_FLOWER_FIELDS 0x00000026 +#define LOCATION_CLOUDY_CLIMB 0x00000027 +#define LOCATION_SHIVER_CITY 0x00000028 +#define LOCATION_SHIVER_SNOWFIELD 0x00000029 +#define LOCATION_STARBORN_VALLEY 0x0000002A +#define LOCATION_SHIVER_MOUNTAIN 0x0000002B +#define LOCATION_CRYSTAL_PALACE 0x00000015 +#define LOCATION_STAR_WAY 0x0000001C +#define LOCATION_STAR_HAVEN 0x0000001D +#define LOCATION_BOWSERS_CASTLE 0x00000016 +#define LOCATION_PEACHS_CASTLE 0x0000001A +#define LOCATION_MARIOS_HOUSE 0x0000002C + +typedef UNK_TYPE ENTITY; +#define ENTITY_SAVE_POINT 0x802E9A18 +#define ENTITY_RED_SWITCH 0x802E9BB0 +#define ENTITY_BLUE_SWITCH 0x802E9BD4 +#define ENTITY_HUGE_BLUE_SWITCH 0x802E9BF8 +#define ENTITY_GREEN_STOMP_SWITCH 0x802E9C1C +#define ENTITY_MULTI_TRIGGER_BLOCK 0x802EA07C +#define ENTITY_BRICK_BLOCK 0x802EA0C4 +#define ENTITY_MULTI_COIN_BRICK 0x802EA0E8 +#define ENTITY_HAMMER1_BLOCK 0x802EA10C +#define ENTITY_HAMMER1_BLOCK_WIDE 0x802EA130 +#define ENTITY_HAMMER1_BLOCK_THICK 0x802EA154 +#define ENTITY_HAMMER1_BLOCK_TINY 0x802EA178 +#define ENTITY_HAMMER2_BLOCK 0x802EA19C +#define ENTITY_HAMMER2_BLOCK_WIDE 0x802EA1C0 +#define ENTITY_HAMMER2_BLOCK_THICK 0x802EA1E4 +#define ENTITY_HAMMER2_BLOCK_TINY 0x802EA208 +#define ENTITY_HAMMER3_BLOCK 0x802EA22C +#define ENTITY_HAMMER3_BLOCK_WIDE 0x802EA250 +#define ENTITY_HAMMER3_BLOCK_THICK 0x802EA274 +#define ENTITY_HAMMER3_BLOCK_TINY 0x802EA298 +#define ENTITY_POW_BLOCK 0x802EA2E0 +#define ENTITY_YELLOW_BLOCK 0x802EA564 +#define ENTITY_HIDDEN_YELLOW_BLOCK 0x802EA588 +#define ENTITY_RED_BLOCK 0x802EA5AC +#define ENTITY_HIDDEN_RED_BLOCK 0x802EA5D0 +#define ENTITY_SINGLE_TRIGGER_BLOCK 0x802EA5F4 +#define ENTITY_HEALING_BLOCK 0x802EA7E0 +#define ENTITY_SUPER_BLOCK 0x802EA910 +#define ENTITY_SCRIPT_SPRING 0x802EAA30 +#define ENTITY_SIMPLE_SPRING 0x802EAA54 +#define ENTITY_HIDDEN_PANEL 0x802EAB04 +#define ENTITY_GIANT_CHEST 0x802EAE0C +#define ENTITY_CHEST 0x802EAE30 +#define ENTITY_BLUE_WARP_PIPE 0x802EAF80 +#define ENTITY_WOODEN_CRATE 0x802EAED4 +#define ENTITY_SIGNPOST 0x802EAFDC +#define ENTITY_PADLOCK 0x802BCD68 +#define ENTITY_PADLOCK_RED_FRAME 0x802BCD8C +#define ENTITY_PADLOCK_RED_FACE 0x802BCDB0 +#define ENTITY_PADLOCK_BLUE_FACE 0x802BCDD4 +#define ENTITY_BOARDED_FLOOR 0x802BCE84 +#define ENTITY_BOMBABLE_ROCK1 0x802BCF00 +#define ENTITY_BOMBABLE_ROCK2 0x802BCF24 +#define ENTITY_CYMBAL_PLANT 0x802BC788 +#define ENTITY_PINK_FLOWER 0x802BC7AC +#define ENTITY_SPINNING_FLOWER 0x802BC7F4 +#define ENTITY_BELLBELL_PLANT 0x802BCBD8 +#define ENTITY_TRUMPET_PLANT 0x802BCBFC +#define ENTITY_SPONGY_FLOWER 0x802BCC20 +#define ENTITY_RED_ARROW_SIGNS 0x802BCD9C +#define ENTITY_TWEESTER 0x802BCA74 +#define ENTITY_STAR_BOX_LAUCHER 0x802BCB44 + +typedef UNK_TYPE DOOR_SOUNDS; +#define DOOR_SOUNDS_BASIC 0x00000000 +#define DOOR_SOUNDS_METAL 0x00000001 +#define DOOR_SOUNDS_LARGE 0x00000002 +#define DOOR_SOUNDS_CREAKY 0x00000003 +#define DOOR_SOUNDS_GATE 0x00000004 + +typedef UNK_TYPE ACTION_STATE; +#define ACTION_STATE_IDLE 0x00000000 +#define ACTION_STATE_WALK 0x00000001 +#define ACTION_STATE_RUN 0x00000002 +#define ACTION_STATE_JUMP 0x00000003 +#define ACTION_STATE_BOUNCE 0x00000004 +#define ACTION_STATE_ABORTED_JUMP 0x00000005 +#define ACTION_STATE_LAUNCH 0x00000006 +#define ACTION_STATE_FALLING 0x00000008 +#define ACTION_STATE_STEP_DOWN 0x00000009 +#define ACTION_STATE_LAND 0x0000000A +#define ACTION_STATE_STEP_DOWN_LAND 0x0000000B +#define ACTION_STATE_CONVERSATION 0x0000000C +#define ACTION_STATE_SPIN_JUMP 0x0000000D +#define ACTION_STATE_GROUND_POUND 0x0000000E +#define ACTION_STATE_ULTRA_JUMP 0x0000000F +#define ACTION_STATE_ULTRA_POUND 0x00000010 +#define ACTION_STATE_SLIDING 0x00000011 +#define ACTION_STATE_HAMMER 0x00000012 +#define ACTION_STATE_HIT_HAZARD 0x00000015 +#define ACTION_STATE_HIT_LAVA 0x00000017 +#define ACTION_STATE_SPIN 0x0000001A +#define ACTION_STATE_ENEMY_FIRST_STRIKE 0x0000001B +#define ACTION_STATE_SPINNING_FLOWER 0x0000001D +#define ACTION_STATE_USE_TWEESTER 0x0000001F +#define ACTION_STATE_RIDE 0x00000021 +#define ACTION_STATE_STEP_UP 0x00000022 +#define ACTION_STATE_USE_SPRING 0x00000026 + +typedef UNK_TYPE NPC; +#define NPC_SELF 0xFFFFFFFF +#define NPC_PLAYER 0xFFFFFFFE +#define NPC_PARTNER 0xFFFFFFFC + +typedef UNK_TYPE TRIGGER; +#define TRIGGER_FLOOR_TOUCH 0x00000080 +#define TRIGGER_FLOOR_ABOVE 0x00080000 +#define TRIGGER_FLOOR_PRESS_A 0x00000800 +#define TRIGGER_FLOOR_JUMP 0x00000200 +#define TRIGGER_WALL_TOUCH 0x00000400 +#define TRIGGER_WALL_PUSH 0x00000040 +#define TRIGGER_WALL_PRESS_A 0x00000100 +#define TRIGGER_WALL_HAMMER 0x00001000 +#define TRIGGER_CEILING_TOUCH 0x00040000 +#define TRIGGER_POINT_BOMB 0x00100000 +#define TRIGGER_GAME_FLAG_SET 0x00010000 +#define TRIGGER_AREA_FLAG_SET 0x00020000 + +typedef UNK_TYPE BUTTONS; +#define BUTTONS_A 0x00008000 +#define BUTTONS_B 0x00004000 +#define BUTTONS_Z 0x00002000 +#define BUTTONS_START 0x00001000 +#define BUTTONS_D_UP 0x00000800 +#define BUTTONS_D_DOWN 0x00000400 +#define BUTTONS_D_LEFT 0x00000200 +#define BUTTONS_D_RIGHT 0x00000100 +#define BUTTONS_L 0x00000020 +#define BUTTONS_R 0x00000010 +#define BUTTONS_C_UP 0x00000008 +#define BUTTONS_C_DOWN 0x00000004 +#define BUTTONS_C_LEFT 0x00000002 +#define BUTTONS_C_RIGHT 0x00000001 + +typedef UNK_TYPE PLAYER_BUFF; +#define PLAYER_BUFF_ALL 0x0FFFFFFF +#define PLAYER_BUFF_JUMP_CHARGE 0x00000001 +#define PLAYER_BUFF_HAMMER_CHARGE 0x00000002 +#define PLAYER_BUFF_STONE 0x00000008 +#define PLAYER_BUFF_HUSTLE 0x00000010 +#define PLAYER_BUFF_STATIC 0x00000020 +#define PLAYER_BUFF_TRANSPARENT 0x00000040 +#define PLAYER_BUFF_CLOUD_NINE 0x00000080 +#define PLAYER_BUFF_TURBO_CHARGE 0x00000100 +#define PLAYER_BUFF_WATER_BLOCK 0x00000200 +#define PLAYER_BUFF_PARTNER_GLOWING 0x00010000 + +typedef UNK_TYPE STATUS_FLAGS; +#define STATUS_FLAGS_SLEEP 0x00001000 +#define STATUS_FLAGS_STATIC 0x00002000 +#define STATUS_FLAGS_FROZEN 0x00004000 +#define STATUS_FLAGS_UNKNOWN_STATUS3 0x00008000 +#define STATUS_FLAGS_PARALYZE 0x00010000 +#define STATUS_FLAGS_POISON 0x00020000 +#define STATUS_FLAGS_DIZZY 0x00040000 +#define STATUS_FLAGS_SHRINK 0x00080000 +#define STATUS_FLAGS_STONE 0x00100000 +#define STATUS_FLAGS_STOP 0x00200000 +#define STATUS_FLAGS_K_O 0x01000000 +#define STATUS_FLAGS_GLOWING 0x02000000 +#define STATUS_FLAGS_TRANSPARENT 0x04000000 +#define STATUS_FLAGS_ATTACK_BOOST 0x08000000 +#define STATUS_FLAGS_DEFENSE_BOOST 0x10000000 +#define STATUS_FLAGS_CHILL_OUT 0x20000000 +#define STATUS_FLAGS_RIGHT_ON 0x40000000 + +typedef UNK_TYPE DAMAGE_TYPE; +#define DAMAGE_TYPE_IGNORE_DEFENSE 0x08000000 +#define DAMAGE_TYPE_NO_CONTACT 0x10000000 +#define DAMAGE_TYPE_UNBLOCKABLE 0x20000000 +#define DAMAGE_TYPE_TRIGGER_LUCKY 0x80000000 +#define DAMAGE_TYPE_FIRE 0x00000002 +#define DAMAGE_TYPE_WATER 0x00000004 +#define DAMAGE_TYPE_ICE 0x00000008 +#define DAMAGE_TYPE_MAGIC 0x00000010 +#define DAMAGE_TYPE_ELECTRIC 0x00000020 +#define DAMAGE_TYPE_SMASH 0x00000040 +#define DAMAGE_TYPE_JUMP 0x00000080 +#define DAMAGE_TYPE_COSMIC 0x00000100 +#define DAMAGE_TYPE_BLAST 0x00000200 +#define DAMAGE_TYPE_P_O_W 0x00000400 +#define DAMAGE_TYPE_QUAKE 0x00000800 +#define DAMAGE_TYPE_THROW 0x00040000 + +#endif diff --git a/include/items.h b/include/items.h deleted file mode 100644 index b22fd81369..0000000000 --- a/include/items.h +++ /dev/null @@ -1,367 +0,0 @@ -#ifndef _ITEMS_H_ -#define _ITEMS_H_ - -#include "ultra64.h" -#include "types.h" - -typedef enum eItem { - JUMP = 0x0001, - SPIN_JUMP = 0x0002, - TORNADO_JUMP = 0x0003, - HAMMER = 0x0004, - SUPER_HAMMER = 0x0005, - ULTRA_HAMMER = 0x0006, - LUCKY_STAR = 0x0007, - MAP = 0x0008, // unused - BIG_MAP = 0x0009, // unused - FIRST_DEGREE_CARD = 0x000A, - SECOND_DEGREE_CARD = 0x000B, - THIRD_DEGREE_CARD = 0x000C, - FOURTH_DEGREE_CARD = 0x000D, - DIPLOMA = 0x000E, - ULTRA_STONE = 0x000F, - FORTRESS_KEY = 0x0010, - RUINS_KEY = 0x0011, - PULSE_STONE = 0x0012, - CASTLE_KEY1 = 0x0013, - PALACE_KEY = 0x0014, - LUNAR_STONE = 0x0015, - PYRAMID_STONE = 0x0016, - DIAMOND_STONE = 0x0017, - GOLDEN_VASE = 0x0018, // unused - KOOPERS_SHELL = 0x0019, - CASTLE_KEY2 = 0x001A, - FOREST_PASS = 0x001B, // unused - WEIGHT = 0x001C, - BOOS_PORTRAIT = 0x001D, - CRYSTAL_BERRY = 0x001E, - MYSTICAL_KEY = 0x001F, - STOREROOM_KEY = 0x0020, - TOY_TRAIN = 0x0021, - RECORD = 0x0022, - FRYING_PAN = 0x0023, - DICTIONARY = 0x0024, - MYSTERY_NOTE = 0x0025, - SUSPICIOUS_NOTE = 0x0026, // unused - CRYSTAL_BALL = 0x0027, - SCREWDRIVER = 0x0028, // unused - COOKBOOK = 0x0029, - JADE_RAVEN = 0x002A, - MAGICAL_SEED1 = 0x002B, - MAGICAL_SEED2 = 0x002C, - MAGICAL_SEED3 = 0x002D, - MAGICAL_SEED4 = 0x002E, - TOAD_DOLL = 0x002F, // unused - CALCULATOR = 0x0030, - BUCKET = 0x0031, - SCARF = 0x0032, - RED_KEY = 0x0033, - BLUE_KEY = 0x0034, - LETTER01 = 0x0036, - LETTER02 = 0x0037, - LETTER03 = 0x0038, - LETTER04 = 0x0039, - LETTER05 = 0x003A, - LETTER06 = 0x003B, - LETTER07 = 0x003C, - LETTER08 = 0x003D, - LETTER09 = 0x003E, - LETTER10 = 0x0040, - LETTER11 = 0x0041, - LETTER12 = 0x0045, - LETTER13 = 0x0046, - LETTER14 = 0x0047, - LETTER15 = 0x0048, - LETTER16 = 0x0049, - LETTER17 = 0x004A, - LETTER18 = 0x004B, - LETTER19 = 0x004C, - LETTER20 = 0x004E, - LETTER21 = 0x004F, - LETTER22 = 0x0050, - LETTER23 = 0x0051, - LETTER24 = 0x0052, - ARTIFACT = 0x0053, - LETTER25 = 0x0054, - DOLLY = 0x0056, - WATER_STONE = 0x0057, - MAGICAL_BEAN = 0x0058, - FERTILE_SOIL = 0x0059, - MIRACLE_WATER = 0x005A, - VOLCANO_VASE = 0x005B, - TAPE = 0x005C, - SUGAR = 0x005D, - SALT = 0x005E, - EGG1 = 0x005F, - CREAM = 0x0060, - STRAWBERRY = 0x0061, - BUTTER = 0x0062, - CLEANSER = 0x0063, - WATER = 0x0064, - FLOUR = 0x0065, - MILK = 0x0066, - LYRICS = 0x0067, - MELODY = 0x0068, - MAILBAG = 0x0069, - CASTLE_KEY3 = 0x006A, - ODD_KEY = 0x006B, - STAR_STONE = 0x006C, - SNEAKY_PARASOL = 0x006D, - KOOPA_LEGENDS = 0x006E, - AUTOGRAPH1 = 0x006F, - EMPTY_WALLET = 0x0070, - AUTOGRAPH2 = 0x0071, - KOOPA_SHELL = 0x0072, // unused - OLD_PHOTO = 0x0073, - GLASSES = 0x0074, - PHOTOGRAPH = 0x0075, // unused - PACKAGE = 0x0076, - RED_JAR = 0x0077, - CASTLE_KEY4 = 0x0078, - WAREHOUSE_KEY = 0x0079, - PRISON_KEY1 = 0x007A, - SILVER_CREDIT = 0x007B, - GOLD_CREDIT = 0x007C, - PRISON_KEY2 = 0x007D, // unused - PRISON_KEY3 = 0x007E, // unused - PRISON_KEY4 = 0x007F, // unused - FIRE_FLOWER = 0x0080, - SNOWMAN_DOLL = 0x0081, - THUNDER_RAGE = 0x0082, - SHOOTING_STAR = 0x0083, - THUNDER_BOLT = 0x0084, - PEBBLE = 0x0085, - DUSTY_HAMMER = 0x0086, - INSECTICIDE_HERB = 0x0087, - STONE_CAP = 0x0088, - TASTY_TONIC = 0x0089, - MUSHROOM = 0x008A, - VOLT_SHROOM = 0x008B, - SUPER_SHROOM = 0x008C, - DRIED_SHROOM = 0x008D, - ULTRA_SHROOM = 0x008E, - SLEEPY_SHEEP = 0x008F, - POW_BLOCK = 0x0090, - HUSTLE_DRINK = 0x0091, - STOP_WATCH = 0x0092, - WHACKAS_BUMP = 0x0093, - APPLE = 0x0094, - LIFE_SHROOM = 0x0095, - MYSTERY = 0x0096, - REPEL_GEL = 0x0097, - FRIGHT_JAR = 0x0098, - PLEASE_COME_BACK = 0x0099, - DIZZY_DIAL = 0x009A, - SUPER_SODA = 0x009B, - LEMON = 0x009C, - LIME = 0x009D, - BLUE_BERRY = 0x009E, - RED_BERRY = 0x009F, - YELLOW_BERRY = 0x00A0, - BUBBLE_BERRY = 0x00A1, - JAMMIN_JELLY = 0x00A2, - MAPLE_SYRUP = 0x00A3, - HONEY_SYRUP = 0x00A4, - GOOMNUT = 0x00A5, - KOOPA_LEAF = 0x00A6, - DRIED_PASTA = 0x00A7, - DRIED_FRUIT = 0x00A8, - STRANGE_LEAF = 0x00A9, - CAKE_MIX = 0x00AA, - EGG2 = 0x00AB, - COCONUT = 0x00AC, - MELON = 0x00AD, - STINKY_HERB = 0x00AE, - ICED_POTATO = 0x00AF, - SPICY_SOUP = 0x00B0, - APPLE_PIE = 0x00B1, - HONEY_ULTRA = 0x00B2, - MAPLE_ULTRA = 0x00B3, - JELLY_ULTRA = 0x00B4, - KOOPASTA = 0x00B5, - FRIED_SHROOM = 0x00B6, - SHROOM_CAKE = 0x00B7, - SHROOM_STEAK = 0x00B8, - HOT_SHROOM = 0x00B9, - SWEET_SHROOM = 0x00BA, - YUMMY_MEAL = 0x00BB, - HEALTHY_JUICE = 0x00BC, - BLAND_MEAL = 0x00BD, - DELUXE_FEAST = 0x00BE, - SPECIAL_SHAKE = 0x00BF, - BIG_COOKIE = 0x00C0, - CAKE = 0x00C1, - MISTAKE = 0x00C2, - KOOPA_TEA = 0x00C3, - HONEY_SUPER = 0x00C4, - MAPLE_SUPER = 0x00C5, - JELLY_SUPER = 0x00C6, - SPAGHETTI = 0x00C7, - EGG_MISSILE = 0x00C8, - FRIED_EGG = 0x00C9, - HONEY_SHROOM = 0x00CA, - HONEY_CANDY = 0x00CB, - ELECTRO_POP = 0x00CC, - FIRE_POP = 0x00CD, - LIME_CANDY = 0x00CE, - COCO_POP = 0x00CF, - LEMON_CANDY = 0x00D0, - JELLY_POP = 0x00D1, - STRANGE_CAKE = 0x00D2, - KOOKY_COOKIE = 0x00D3, - FROZEN_FRIES = 0x00D4, - POTATO_SALAD = 0x00D5, - NUTTY_CAKE = 0x00D6, - MAPLE_SHROOM = 0x00D7, - BOILED_EGG = 0x00D8, - YOSHI_COOKIE = 0x00D9, - JELLY_SHROOM1 = 0x00DA, - JELLY_SHROOM2 = 0x00DB, - JELLY_SHROOM3 = 0x00DC, - JELLY_SHROOM4 = 0x00DD, - JELLY_SHROOM5 = 0x00DE, - JELLY_SHROOM6 = 0x00DF, - SPIN_SMASH = 0x00E0, - MULTIBOUNCE = 0x00E1, - POWER_PLUS_A = 0x00E2, - DODGE_MASTER = 0x00E3, - POWER_BOUNCE = 0x00E4, - SPIKE_SHIELD = 0x00E5, - FIRST_ATTACK = 0x00E6, - HP_PLUS_A = 0x00E7, - QUAKE_HAMMER = 0x00E8, - DOUBLE_DIP = 0x00E9, - MYSTERY_SCROLL = 0x00EA, // unused - SLEEP_STOMP = 0x00EB, - FIRE_SHIELD = 0x00EC, - QUICK_CHANGE = 0x00ED, - D_DOWN_POUND = 0x00EE, - DIZZY_STOMP = 0x00EF, - SMASH_CHARGE0 = 0x00F0, // unused - PRETTY_LUCKY = 0x00F1, - FEELING_FINE = 0x00F2, - ATTACK_FX_A = 0x00F3, - ALLOR_NOTHING = 0x00F4, - HP_DRAIN = 0x00F5, - JUMP_CHARGE0 = 0x00F6, // unused - SLOW_GO = 0x00F7, - FP_PLUS_A = 0x00F8, - MEGA_RUSH = 0x00F9, - ICE_POWER = 0x00FA, - DEFEND_PLUS_A = 0x00FB, - PAY_OFF = 0x00FC, - MONEY_MONEY = 0x00FD, - CHILL_OUT = 0x00FE, - HAPPY_HEART_A = 0x00FF, - ZAP_TAP = 0x0100, - BERSERKER = 0x0101, // unused - RIGHT_ON = 0x0102, // unused - RUNAWAY_PAY = 0x0103, - REFUND = 0x0104, - FLOWER_SAVER_A = 0x0105, - TRIPLE_DIP = 0x0106, - HAMMER_THROW = 0x0107, - MEGA_QUAKE = 0x0108, - SMASH_CHARGE = 0x0109, - JUMP_CHARGE = 0x010A, - S_SMASH_CHG = 0x010B, - S_JUMP_CHG = 0x010C, - POWER_RUSH = 0x010D, - AUTO_JUMP = 0x010E, // unused - AUTO_SMASH = 0x010F, // unused - CRAZY_HEART = 0x0110, // unused - LAST_STAND = 0x0111, - CLOSE_CALL = 0x0112, - P_UP_D_DOWN = 0x0113, - LUCKY_DAY = 0x0114, - MEGA_HP_DRAIN = 0x0115, // unused - P_DOWN_D_UP = 0x0116, - POWER_QUAKE = 0x0117, - AUTO_MULTIBOUNCE = 0x0118, // unused - FLOWER_FANATIC = 0x0119, // unused - HEART_FINDER = 0x011A, - FLOWER_FINDER = 0x011B, - SPIN_ATTACK = 0x011C, - DIZZY_ATTACK = 0x011D, - I_SPY = 0x011E, - SPEEDY_SPIN = 0x011F, - BUMP_ATTACK = 0x0120, - POWER_JUMP = 0x0121, - SUPER_JUMP = 0x0122, // unused - MEGA_JUMP = 0x0123, - POWER_SMASH1 = 0x0124, - SUPER_SMASH = 0x0125, // unused - MEGA_SMASH = 0x0126, - POWER_SMASH2 = 0x0127, - POWER_SMASH3 = 0x0128, - DEEP_FOCUS1 = 0x0129, - SUPER_FOCUS = 0x012A, // unused - SHRINK_SMASH = 0x012B, - SHELL_CRACK = 0x012C, // unused - KAIDEN = 0x012D, // unused - D_DOWN_JUMP = 0x012E, - SHRINK_STOMP = 0x012F, - DAMAGE_DODGE_A = 0x0130, - EARTHQUAKE_JUMP = 0x0131, - DEEP_FOCUS2 = 0x0132, - DEEP_FOCUS3 = 0x0133, - HP_PLUS_B = 0x0134, - FP_PLUS_B = 0x0135, - HAPPY_HEART_B = 0x0136, - HAPPY_HEART_X = 0x0137, - FLOWER_SAVER_B = 0x0138, - FLOWER_SAVER_X = 0x0139, - DAMAGE_DODGE_B = 0x013A, - DAMAGE_DODGE_X = 0x013B, - POWER_PLUS_B = 0x013C, - POWER_PLUS_X = 0x013D, - DEFEND_PLUS_X = 0x013E, - DEFEND_PLUS_Y = 0x013F, - HAPPY_FLOWER_A = 0x0140, - HAPPY_FLOWER_B = 0x0141, - HAPPY_FLOWER_X = 0x0142, - GROUP_FOCUS = 0x0143, - PEEKABOO = 0x0144, - ATTACK_FX_D = 0x0145, - ATTACK_FX_B = 0x0146, - ATTACK_FX_E = 0x0147, - ATTACK_FX_C = 0x0148, - ATTACK_FX_F = 0x0149, - HP_PLUS_C = 0x014A, - HP_PLUS_X = 0x014B, - HP_PLUS_Y = 0x014C, - FP_PLUS_C = 0x014D, - FP_PLUS_X = 0x014E, - FP_PLUS_Y = 0x014F, - HEALTHY_HEALTHY = 0x0150, - ATTACK_FX_F2 = 0x0151, - ATTACK_FX_F3 = 0x0152, - ATTACK_FX_F4 = 0x0153, - ATTACK_FX_F5 = 0x0154, - PARTNER_ATTACK = 0x0155, // placeholder with partner attack icon - HEART = 0x0156, - COIN = 0x0157, - HEART_PIECE = 0x0158, // unused, NOT functional - STAR_POINT = 0x0159, // unused, functional, makes coin sound - FULL_HEAL = 0x015A, // unused, functional, item inside healing block - FLOWER = 0x015B, - STAR_PIECE = 0x015C, - PRESENT = 0x015D, - COMPLETE_CAKE = 0x015E, - BARE_CAKE = 0x015F, - EMPTY_CAKE_PAN = 0x0160, - FULL_CAKE_PAN = 0x0161, - EMPTY_MIXING_BOWL = 0x0162, - FULL_MIXING_BOWL = 0x0163, - CAKE_WITH_ICING = 0x0164, - CAKE_WITH_BERRIES = 0x0165, - HAMMER1_ICON = 0x0166, - HAMMER2_ICON = 0x0167, - HAMMER3_ICON = 0x0168, - BOOTS1_ICON = 0x0169, - BOOTS2_ICON = 0x016A, - BOOTS3_ICON = 0x016B, - ITEMS_ICON = 0x016C -} eItem; - -#endif diff --git a/include/types.h b/include/types.h index 35e0c1ac19..d5f6931f74 100644 --- a/include/types.h +++ b/include/types.h @@ -8,4 +8,6 @@ #define UNK_FUN_PTR(name) void(*name)(void) #define UNK_ARGS +typedef s32* bytecode; + #endif \ No newline at end of file diff --git a/src/code_6000.c b/src/code_6000.c index 9f465f8d06..2c9e2d3851 100644 --- a/src/code_6000.c +++ b/src/code_6000.c @@ -56,7 +56,7 @@ INCLUDE_ASM(code_6000, collision_heap_malloc); INCLUDE_ASM(code_6000, collision_heap_free); /*s32 collision_heap_free(s32 size) { - s32 unk_70 = (*gGameStatusPtr)->unk_70; + s32 isBattle = (*gGameStatusPtr)->isBattle; - return _heap_free((unk_70 == 0) ? (&D_80268000) : (&D_803DA800), size); + return _heap_free((isBattle == 0) ? (&D_80268000) : (&D_803DA800), size); }*/ diff --git a/src/code_80850_len_3060.c b/src/code_80850_len_3060.c index 83fb6317b8..62db0db036 100644 --- a/src/code_80850_len_3060.c +++ b/src/code_80850_len_3060.c @@ -31,15 +31,15 @@ void clear_player_data(void) { playerData->merleeTurnCount = -1; playerData->maxStarPower = 0; playerData->specialBarsFilled = 0; - playerData->unk_292 = 0; + playerData->unk_292[0] = 0; playerData->currentPartner = 0; for (i = 0; i < ARRAY_COUNT(playerData->partners); i++) { playerData->partners[i].enabled = 0; playerData->partners[i].level = 0; - playerData->partners[i].unk_2 = 0; - playerData->partners[i].unk_4 = 0; - playerData->partners[i].unk_6 = 0; + playerData->partners[i].unk_02[0] = 0; + playerData->partners[i].unk_02[1] = 0; + playerData->partners[i].unk_02[2] = 0; } for (i = ARRAY_COUNT(playerData->keyItems) - 1; i >= 0; i--) { @@ -70,10 +70,10 @@ void clear_player_data(void) { playerData->enemyFirstStrikes = 0; playerData->powerBounces = 0; playerData->battlesCount = 0; - playerData->unk_2A4 = 0; - playerData->unk_2A6 = 0; - playerData->unk_2A8 = 0; - playerData->unk_2AA = 0; + playerData->unk_2A4[0] = 0; + playerData->unk_2A4[1] = 0; + playerData->unk_2A4[2] = 0; + playerData->unk_2A4[3] = 0; playerData->unk_2AC = 0; playerData->unk_2B0 = 0; playerData->idleFrameCounter = 0; @@ -304,9 +304,9 @@ void update_coin_counter(void) { do {} while(0); // Needed to match - if (uiStatus->unk_6D != 0) { - uiStatus->unk_6D -= 1; - if (((uiStatus->unk_6D << 24) == 0) && (uiStatus->iconIndex12 >= 0)) { + if (uiStatus->unk_6C[1] != 0) { + uiStatus->unk_6C[1] -= 1; + if (((uiStatus->unk_6C[1] << 24) == 0) && (uiStatus->iconIndex12 >= 0)) { free_icon(uiStatus->iconIndex12); free_icon(uiStatus->iconIndex13); uiStatus->iconIndex12 = -1; @@ -314,24 +314,24 @@ void update_coin_counter(void) { D_8010CD12 = 0; } - if (uiStatus->unk_6C != 0) { - if ((uiStatus->displayCoins == playerData->coins) && (uiStatus->unk_6C > 30)) { - uiStatus->unk_6C = 30; + if (uiStatus->unk_6C[0] != 0) { + if ((uiStatus->displayCoins == playerData->coins) && (uiStatus->unk_6C[0] > 30)) { + uiStatus->unk_6C[0] = 30; } - if ((uiStatus->displayCoins == playerData->coins) || (uiStatus->unk_6C <= 30)) { - uiStatus->unk_6C -= 1; - if (uiStatus->unk_6C == 0) { + if ((uiStatus->displayCoins == playerData->coins) || (uiStatus->unk_6C[0] <= 30)) { + uiStatus->unk_6C[0] -= 1; + if (uiStatus->unk_6C[0] == 0) { func_80147E7C(20, &D_80147574); - uiStatus->unk_6D = 15; + uiStatus->unk_6C[1] = 15; D_8010CD10 = 0; D_8010CD12 = 1; uiStatus->iconIndex12 = uiStatus->iconIndex10; uiStatus->iconIndex13 = uiStatus->iconIndex11; uiStatus->displayCoins = playerData->coins; - if (uiStatus->unk_6E > -1) { - uiStatus->ignoreChanges = uiStatus->unk_6E; - uiStatus->unk_6E = -1; + if (uiStatus->unk_6C[2] > -1) { + uiStatus->ignoreChanges = uiStatus->unk_6C[2]; + uiStatus->unk_6C[2] = -1; } } } @@ -350,13 +350,13 @@ void show_coin_counter(void) { free_icon(uiStatus->iconIndex11); uiStatus->iconIndex12 = -1; } - uiStatus->unk_6C = 0; - uiStatus->unk_6D = 0; + uiStatus->unk_6C[0] = 0; + uiStatus->unk_6C[1] = 0; *coinCounterUnk = 0; D_8010CD12 = 0; } - if (uiStatus->unk_6C == 0) { + if (uiStatus->unk_6C[0]== 0) { func_80147CC8(0x14, 0x20, 0xa4, 0x40, 0x14, 0x15, &D_800E92D8, 0, -1); func_80147E7C(0x14, &D_80147474); index = create_icon(&D_80109270); @@ -367,10 +367,10 @@ void show_coin_counter(void) { uiStatus->iconIndex11 = index; set_icon_flags(index, 0x80); func_80144EFC(index, 0xff, 0xff, 0xff); - uiStatus->unk_6C = 0; + uiStatus->unk_6C[0] = 0; - if (uiStatus->unk_6E < 0) { - uiStatus->unk_6E = uiStatus->ignoreChanges; + if (uiStatus->unk_6C[2] < 0) { + uiStatus->unk_6C[2] = uiStatus->ignoreChanges; } uiStatus->ignoreChanges = 1; @@ -382,16 +382,16 @@ void show_coin_counter(void) { void hide_coin_counter(void) { ui_status* uiStatus = &gUIStatus; - if ((D_8010CD10 != 0) && (uiStatus->unk_6C == 0)) { - uiStatus->unk_6C = 60; + if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) { + uiStatus->unk_6C[0] = 60; } } void func_800E96C8(void) { ui_status* uiStatus = &gUIStatus; - if ((D_8010CD10 != 0) && (uiStatus->unk_6C == 0)) { - uiStatus->unk_6C = 1; + if ((D_8010CD10 != 0) && (uiStatus->unk_6C[0]== 0)) { + uiStatus->unk_6C[0]= 1; } } @@ -415,7 +415,7 @@ void open_status_menu_long(void) { if (uiStatus->hidden) { uiStatus->showTimer = 210; uiStatus->hidden = 0; - uiStatus->unk_3B = 1; + uiStatus->unk_3B[0] = 1; } } @@ -425,7 +425,7 @@ void open_status_menu_short(void) { if (uiStatus->hidden) { uiStatus->showTimer = 105; uiStatus->hidden = 0; - uiStatus->unk_3B = 1; + uiStatus->unk_3B[0] = 1; } } @@ -435,7 +435,7 @@ void func_800E97B8(void) { if (uiStatus->hidden != 1) { uiStatus->hidden = 1; uiStatus->showTimer = 0; - uiStatus->unk_3B = 1; + uiStatus->unk_3B[0] = 1; } } @@ -446,8 +446,8 @@ void func_800E97E4(void) { uiStatus->ignoreChanges = 0; uiStatus->showTimer = 0; uiStatus->hidden = 1; - uiStatus->unk_3B = 0; - uiStatus->unk_3C = 0; + uiStatus->unk_3B[0] = 0; + uiStatus->unk_3B[1] = 0; } void func_800E9810(void) { @@ -457,24 +457,24 @@ void func_800E9810(void) { uiStatus->drawPosY = 0; uiStatus->ignoreChanges = 0; uiStatus->hidden = 0; - uiStatus->unk_3B = 1; - uiStatus->unk_3C = 0; + uiStatus->unk_3B[0] = 1; + uiStatus->unk_3B[1] = 0; } void func_800E983C(void) { - gUIStatus.unk_45 = 0; + gUIStatus.unk_45[0] = 0; } void func_800E984C(void) { - gUIStatus.unk_45 = 1; + gUIStatus.unk_45[0] = 1; } s32 func_800E9860(void) { ui_status* uiStatus = &gUIStatus; ui_status* uiStatus2 = &gUIStatus; - s32 ret = 1 - uiStatus->unk_45; + s32 ret = 1 - uiStatus->unk_45[0]; - if (uiStatus->unk_46 != 0) { + if (uiStatus->unk_45[1] != 0) { ret = 0; } if (uiStatus2->ignoreChanges) { @@ -501,15 +501,15 @@ void status_menu_disable_ignore_changes(void) { s32 func_800E98D4(void) { ui_status* uiStatus = &gUIStatus; - return uiStatus->unk_46 + uiStatus->ignoreChanges; + return uiStatus->unk_45[1] + uiStatus->ignoreChanges; } void func_800E98EC(void) { - gUIStatus.unk_46 = 1; + gUIStatus.unk_45[1] = 1; } void func_800E9900(void) { - gUIStatus.unk_46 = 0; + gUIStatus.unk_45[1] = 0; } s32 is_status_menu_visible(void) { @@ -672,10 +672,10 @@ void reset_status_menu(void) { uiStatus->drawPosY = -100; uiStatus->hidden = 0; uiStatus->showTimer = 210; - uiStatus->unk_3B = 0; + uiStatus->unk_3B[0] = 0; uiStatus->ignoreChanges = 0; - uiStatus->unk_45 = 0; - uiStatus->unk_46 = 0; + uiStatus->unk_45[0] = 0; + uiStatus->unk_45[1] = 0; uiStatus->hpBlinking = 0; uiStatus->hpBlinkCounter = 0; uiStatus->hpBlinkTimer = 0; @@ -690,13 +690,13 @@ void reset_status_menu(void) { uiStatus->disabled = 0; uiStatus->starpointsBlinking = 0; uiStatus->starpointsBlinkCounter = 0; - uiStatus->unk_6E = -1; + uiStatus->unk_6C[2] = -1; uiStatus->displayHP = playerData->curHP; uiStatus->displayFP = playerData->curFP; uiStatus->displayCoins = playerData->coins; uiStatus->displayStarpoints = playerData->starPoints; uiStatus->displaySP = playerData->specialBarsFilled; - uiStatus->unk_3C = 0; + uiStatus->unk_3B[1] = 0; for (i = 0; i < 2; i++) { func_801452B4(uiStatus->hpIconIndexes[i], uiStatus->hpIconIndexes[i]); @@ -705,7 +705,7 @@ void reset_status_menu(void) { for (i = 0; i < 2; i++) { func_801452B4(uiStatus->fpIconIndexes[i], uiStatus->fpIconIndexes[i]); } - + func_801452B4(uiStatus->coinIconIndex, uiStatus->coinIconIndex); func_801452B4(uiStatus->coinIconIndex2, uiStatus->coinIconIndex2); func_801452B4(uiStatus->starpointsIconIndex, uiStatus->starpointsIconIndex); @@ -807,14 +807,14 @@ void add_SP(s32 amt) { s32 phi_v1; s32 blah; - uiStatus->unk_57 = 1; - uiStatus->unk_58 = 60; + uiStatus->unk_57[0] = 1; + uiStatus->unk_57[1] = 60; phi_v1 = playerData->specialBarsFilled; if (phi_v1 < 0) { phi_v1 = playerData->specialBarsFilled + 31; } - uiStatus->unk_59 = phi_v1 >> 5; + uiStatus->unk_57[2] = phi_v1 >> 5; playerData->specialBarsFilled += amt; diff --git a/src/code_dc470_len_14c0.c b/src/code_dc470_len_14c0.c index e5eaff1306..d1c4fe95de 100644 --- a/src/code_dc470_len_14c0.c +++ b/src/code_dc470_len_14c0.c @@ -28,7 +28,7 @@ void func_80145DF8(void) { D_8014F12F = 0; gameStatus->unk_15C = 0xB4; - gameStatus->backgroundFlags &= 0xF0; + gameStatus->enableBackground &= 0xF0; } void read_background_size(bg_header *bg) { @@ -40,13 +40,13 @@ void read_background_size(bg_header *bg) { gameStatus->backgroundMinH = bg->startY; gameStatus->backgroundRaster = bg->raster; gameStatus->backgroundPalette = bg->palette; - gameStatus->backgroundFlags |= 1; + gameStatus->enableBackground |= 1; } void set_background_size(s16 startX, s16 startY, s16 sizeX, s16 sizeY) { game_status* gameStatus = *gGameStatusPtr; - gameStatus->backgroundFlags &= ~1; + gameStatus->enableBackground &= ~1; gameStatus->backgroundMaxW = startX; gameStatus->backgroundMaxH = startY; gameStatus->backgroundMinW = sizeX; diff --git a/src/code_ebd0_len_6a0.c b/src/code_ebd0_len_6a0.c index 3623c77424..2de74dc149 100644 --- a/src/code_ebd0_len_6a0.c +++ b/src/code_ebd0_len_6a0.c @@ -3,24 +3,24 @@ void func_800337D0(s16 new_alpha) { game_status* gameStatus = *gGameStatusPtr; - gameStatus->boot_alpha = new_alpha; + gameStatus->bootAlpha = new_alpha; } void func_800337E0(s16 arg0) { game_status* gameStatus = *gGameStatusPtr; - gameStatus->boot_red = arg0; - gameStatus->boot_green = arg0; - gameStatus->boot_blue = arg0; + gameStatus->bootRed = arg0; + gameStatus->bootGreen = arg0; + gameStatus->bootBlue = arg0; } s16 func_800337F8(subtract_val) { game_status* gameStatus = *gGameStatusPtr; - if (gameStatus->boot_alpha != 0) { - gameStatus->boot_alpha -= subtract_val; - if (gameStatus->boot_alpha << 16 < 0) { - gameStatus->boot_alpha = 0; + if (gameStatus->bootAlpha != 0) { + gameStatus->bootAlpha -= subtract_val; + if (gameStatus->bootAlpha << 16 < 0) { + gameStatus->bootAlpha = 0; } } else { return 1; @@ -31,10 +31,10 @@ s16 func_800337F8(subtract_val) { s16 func_80033830(add_val) { game_status* gameStatus = *gGameStatusPtr; - if (gameStatus->boot_alpha != 0xFF) { - gameStatus->boot_alpha += add_val; - if ((gameStatus->boot_alpha > 0xFF)) { - gameStatus->boot_alpha = 0xFF; + if (gameStatus->bootAlpha != 0xFF) { + gameStatus->bootAlpha += add_val; + if ((gameStatus->bootAlpha > 0xFF)) { + gameStatus->bootAlpha = 0xFF; } } else { return 1; @@ -44,8 +44,8 @@ s16 func_80033830(add_val) { void func_80033874(void) { - func_80137D88(0, (*gGameStatusPtr)->boot_alpha); - func_80137E10(0, (*gGameStatusPtr)->boot_blue, (*gGameStatusPtr)->boot_green, (*gGameStatusPtr)->boot_red); + func_80137D88(0, (*gGameStatusPtr)->bootAlpha); + func_80137E10(0, (*gGameStatusPtr)->bootBlue, (*gGameStatusPtr)->bootGreen, (*gGameStatusPtr)->bootRed); } void start_battle_countdown(void) { diff --git a/src/code_fa4c0_len_3bf0.c b/src/code_fa4c0_len_3bf0.c index 4eaec6d58e..f66a4cbda5 100644 --- a/src/code_fa4c0_len_3bf0.c +++ b/src/code_fa4c0_len_3bf0.c @@ -114,7 +114,7 @@ s32 AddKeyItem(script_context* script, s32 initialCall) { s32 itemID = get_variable(script, value); s32 i; - if (itemID == FORTRESS_KEY) { + if (itemID == ITEM_FORTRESS_KEY) { playerData->fortressKeyCount++; return 2; } diff --git a/tools/star-rod b/tools/star-rod new file mode 160000 index 0000000000..3a32d3d6dd --- /dev/null +++ b/tools/star-rod @@ -0,0 +1 @@ +Subproject commit 3a32d3d6dda7374e4f32ae86530444e45956d803 diff --git a/tools/starrod_enums_to_h.py b/tools/starrod_enums_to_h.py new file mode 100755 index 0000000000..85bd38195d --- /dev/null +++ b/tools/starrod_enums_to_h.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python3 + +import os +import re +from glob import glob +from stringcase import constcase # pip install stringcase + +DIR = os.path.dirname(__file__) +SR_DATABASE = os.path.join(DIR, "star-rod/database") +FILES = ( + glob(os.path.join(SR_DATABASE, "types/*.enum")) + + glob(os.path.join(SR_DATABASE, "types/**/*.enum")) + + glob(os.path.join(SR_DATABASE, "types/*.flags")) + + glob(os.path.join(SR_DATABASE, "types/**/*.flags")) +) + +with open(os.path.join(DIR, "../include/enums.h"), "w") as h: + h.write("""#ifndef _ENUMS_H_ +#define _ENUMS_H_ + +#include "ultra64.h" +#include "types.h" + +""") + + for filename in FILES: + with open(filename, "r") as file: + lines = file.readlines() + + # Get enum attributes + namespace = constcase(re.match(r"[^ \t]*", lines[0]).group(0)) + library_name = re.match(r"[^ \t]*", lines[1]).group(0) + reverse = True if re.match(r"[^ \t]*", lines[2]).group(0) == "true" else False + + # Get a list of tuples containing (name, value) + items = [] + name_max_len = 0 + comment = False + for line in lines[4:]: + line = line.rstrip("\n") + if not comment and not line.startswith("%") and "=" in line: + m = re.match(r"[ \t]*?([^ \t]*)[ \t]*=[ \t]*([^ \t]*)", line) + if m: + if reverse: + name = m.group(1) + value = int(m.group(2), 16) + else: + name = m.group(2) + value = int(m.group(1), 16) + if value < 0: + str_value = f"{value}" + else: + str_value = "0x" + f"{value:08x}".upper() + + name = constcase(name) + items.append((name, str_value)) + name_max_len = max(len(name), name_max_len) + elif "/%" in line: + comment = True + elif "%/" in line: + comment = False + + # Write a section to the header file for this enum + h.write(f"typedef UNK_TYPE {namespace};\n") + for (name, value) in items: + h.write(f"#define {namespace}_{name.ljust(name_max_len)} {value}\n") + h.write("\n") + + h.write("#endif\n") \ No newline at end of file diff --git a/tools/starrod_structs_to_h.py b/tools/starrod_structs_to_h.py new file mode 100755 index 0000000000..48902e47cc --- /dev/null +++ b/tools/starrod_structs_to_h.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 + +from os import path +from glob import glob +import re + +DIR = path.dirname(__file__) +SR_DATABASE = path.join(DIR, "star-rod/database") + +# SR currently defines a struct with the "name" struct. This causes +# problems, so we'll call it the following instead. +STRUCT_STRUCT_ALIAS = "texture_header" + +STRUCT_FILES = ( + # structs which need to be forward declared (because they're used + # without indirection in other structs) + glob(path.join(SR_DATABASE, f"structs/**/matrix4f.struct")) + + glob(path.join(SR_DATABASE, f"structs/**/matrix4s.struct")) + + glob(path.join(SR_DATABASE, f"structs/**/cam_pos_settings.struct")) + + glob(path.join(SR_DATABASE, f"structs/**/partner_data.struct")) + + + # other structs + glob(path.join(SR_DATABASE, f"structs/**/*.struct")) +) + +def convert_type(type, structs): + size = 1 + suffix = "" + + # replace basic types + basic_types = [ + ("ubyte", "u8", 1), + ("byte", "s8", 1), + ("uchar", "u8", 1), + ("char", "s8", 1), + + ("ushort", "u16", 2), + ("short", "s16", 2), + + ("uint", "u32", 4), + ("int", "s32", 4), + + ("ulong", "u64", 8), + ("long", "s64", 8), + + ("float", "f32", 4), + ("double", "f64", 8), + + ("ptr", "UNK_PTR", 4), + + ("struct", f"struct {STRUCT_STRUCT_ALIAS}", 0x30), + ] + for name, size in structs: + basic_types.append((name, f"struct {name}", size)) + for sr_name, decomp_name, basic_size in basic_types: + match = re.search(f"(\\b|^)({sr_name})(\\b|$)", type) + if match: + size = basic_size + start, end = match.span(2) + type = type[:start] + decomp_name + type[end:] + break + + # array + while array_match := re.search(r"\[(([0-9]+)`|([a-fA-F0-9]+))\]", type): + bin_len_str = array_match.group(2) + hex_len_str = array_match.group(3) + + array_len = int(bin_len_str) if bin_len_str else int(hex_len_str, 16) + size *= array_len + suffix += f"[{array_len}]" + + # strip match from type + start, end = array_match.span() + type = type[:start] + type[end:] + + # pointer + if "*" in type: + size = 4 + + return type, size, suffix + +# read struct names and their sizes in advance +structs = [] +for filename in STRUCT_FILES: + struct_name = path.splitext(path.basename(filename))[0] + if struct_name == "struct": + struct_name = STRUCT_STRUCT_ALIAS + + with open(filename) as file: + for line in file.readlines(): + if line.startswith("%"): + continue + + parts = [x.strip() for x in line.split(":")] + if len(parts) == 0: + continue + + if parts[0] == "size": + struct_size = int(parts[1], 16) + structs.append((struct_name, struct_size)) + continue + +with open(path.join(DIR, f"../include/common_structs.h"), "w") as h: + h.write(f"""#ifndef _COMMON_STRUCTS_H_ +#define _COMMON_STRUCTS_H_ + +#include "ultra64.h" +#include "types.h" + +""") + # write all structs out to common_structs.h + struct_names_seen = [] + for filename in STRUCT_FILES: + struct_name = path.splitext(path.basename(filename))[0] + struct_size = None + offset_len = 2 # string length for hex offsets + + if struct_name == "struct": + struct_name = STRUCT_STRUCT_ALIAS + + # avoid repeat declarations + if struct_name.startswith("_") or struct_name.startswith("OS") or "." in struct_name or struct_name == "sprite": + continue + if struct_name in struct_names_seen: + continue + struct_names_seen.append(struct_name) + + h.write(f"typedef struct {struct_name} {{\n") + + with open(filename) as file: + in_fields = False + + cur_offset = 0 + def update_offset(offset): + global cur_offset + delta = offset - cur_offset + + ofs_str = ("%X" % cur_offset).zfill(2) + ofs_str_z = ofs_str.zfill(offset_len) + + # insert unknown char array + if delta == 1: + h.write(f" /* 0x{ofs_str_z} */ char unk_{ofs_str};\n") + elif delta > 0: + h.write(f" /* 0x{ofs_str_z} */ char unk_{ofs_str}[{delta}];\n") + + cur_offset += delta + + for line in file.readlines(): + # read and strip line comment + comment = re.search(r"%(.*)$", line) + if comment: + pos = comment.span()[0] + line = line[0:pos] + comment = comment.group(1).strip() + + parts = [x.strip() for x in line.split(":")] + if len(parts) == 0: + continue + + if in_fields: + if parts[0] == "}": + in_fields = False + else: + offset, name, type = parts + + # clean name + name = re.sub(r"[^a-zA-Z0-9_]", "", name) + + offset = int(offset, 16) + ofs_str = ("%X" % offset).zfill(offset_len) + update_offset(offset) + + if type == "code": + h.write(f" /* 0x{ofs_str} */ UNK_FUN_PTR({name});") + cur_offset += 4 + else: + type, size, suffix = convert_type(type, structs) + + h.write(f" /* 0x{ofs_str} */ {type} {name}{suffix};") + cur_offset += size + + if comment: + h.write(f" /* {comment} */") + h.write("\n") + else: + if parts[0] == "size": + struct_size = int(parts[1], 16) + structs.append((struct_name, struct_size)) + offset_len = max(2, len(parts[1])) + elif parts[0] == "{": + in_fields = True + + update_offset(struct_size) + h.write(f"}} {struct_name}; // size = 0x{('%X' % struct_size).zfill(offset_len)}\n\n") + + h.write("#endif\n") \ No newline at end of file diff --git a/tools/starrod_to_c.py b/tools/starrod_to_c.py deleted file mode 100644 index c24a48962e..0000000000 --- a/tools/starrod_to_c.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python3 - -import os -import re -import stringcase - - -files = [filename for filename in os.listdir("./sr_enums") if filename.endswith(".enum")] -for filename in files: - with open(f"./sr_enums/{filename}", "r") as file: - lines = file.readlines() - - # Get enum attributes - namespace = re.match(r"[^ \t]*", lines[0]).group(0) - library_name = re.match(r"[^ \t]*", lines[1]).group(0) - reverse = True if re.match(r"[^ \t]*", lines[2]).group(0) == "true" else False - - # Get a list of tuples containing (name, value) - items = [] - comment = False - for line in lines[4:]: - line = line.rstrip("\n") - if not comment and not line.startswith("%") and "=" in line: - m = re.match(r"[ \t]*?([^ \t]*)[ \t]*=[ \t]*([^ \t]*)", line) - if m: - if reverse: - name = m.group(1) - value = int(m.group(2), 16) - else: - name = m.group(2) - value = int(m.group(1), 16) - if value < 0: - str_value = "-0x" + f"{value*-1:08x}".upper() - else: - str_value = "0x" + f"{value:08x}".upper() - items.append((name, str_value)) - elif "/%" in line: - comment = True - elif "%/" in line: - comment = False - - # Create a header file for this enum - with open(f"./c_enums/{namespace}.h", "w") as file: - header = f"_{stringcase.constcase(namespace)}_" - file.write(f"#ifndef {header}\n#define {header}\n") - file.write("\n") - file.write("#include \"ultra64.h\"\n#include \"types.h\"\n") - file.write("\n") - file.write(f"typedef enum {namespace} {'{'}\n") - for i,(name,value) in enumerate(items): - name_const = stringcase.constcase(name) - if i < len(items) - 1: - file.write(f"\t{name_const} = {value},\n") - else: - file.write(f"\t{name_const} = {value}\n") - file.write(f"{'}'} {namespace};\n\n") - file.write("#endif") - - - \ No newline at end of file