diff options
| author | Sirius902 <10891979+Sirius902@users.noreply.github.com> | 2020-07-12 16:03:38 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-12 19:03:38 -0400 |
| commit | 8c72e1dea69eeb4a27ff5de0a29728146ecde8c7 (patch) | |
| tree | 7bfc00413a821ea0da6a9850349dca36accc23af /src/code | |
| parent | a00015a1ac08c058511f3083b755f5838672f8dd (diff) | |
Decompiled ovl_Shot_Sun (#236)
* match ShotSun_Init
* match ShotSun_Destroy
* match func_80BADDCC
* break up unk_19C to add spawnTimer
* ShotSun_Update
* func_80BADE74
* work on func_80BAE05C
* make func_80BAE05C closer
* use proper macros for osSyncPrintf
* format if statement better and add temp player pointer func_80BAE05C
* Reorder spawnPos to match stack args later
* match func_80BAE05C
* almost match func_80BADF0C
* Remove temporary and add parenthesis
* change part of comment and move last unk_1A4 assignment to be similar to decompiler
* Change do while(false) to if (1)
* func_80BADF0C
* change comment
* update spec
* fix vt macro
* cleanup and name
* remove asm
* remove data
* remove extern
Co-authored-by: Random <28494085+Random06457@users.noreply.github.com>
* remove & for function pointers
* rename and retype D_02007020
* format
* remove tiny whitespace
* reorder if statement
* finish renaming
* replace cast with bitwise operation
* move globally used functions to functions.h
* reorder description
* move headers for EnItem00 and EnAObj to z64actor.h
* retype Item_DropCollectible and Item_DropCollectible2 to return EnItem00*
* rename ShotSun_StartFairyCountdown to ShotSun_TriggerFairy
* rename ShotSun_FairyCountdown to ShotSun_SpawnFairy
* add unk_E3EC field to MessageContext
* rename to ShotSun_UpdateHyliaSun for now
* remove != 0 on flag check
* remove unsigned suffix and use enum constant for Item_DropCollectible call
* add unk_95C field to Player
* add ub comment
* retype unk_1A4 and remove explicit struct padding
* Update src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
Co-authored-by: Random <28494085+Random06457@users.noreply.github.com>
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_en_a_keep.c | 32 | ||||
| -rw-r--r-- | src/code/z_en_item00.c | 54 |
2 files changed, 4 insertions, 82 deletions
diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index ed2ab16b6..a48378b8c 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -1,38 +1,6 @@ #include <ultra64.h> #include <global.h> -typedef enum { - /* 0x00 */ A_OBJ_BLOCK_SMALL, - /* 0x01 */ A_OBJ_BLOCK_LARGE, - /* 0x02 */ A_OBJ_BLOCK_HUGE, - /* 0x03 */ A_OBJ_BLOCK_SMALL_ROT, - /* 0x04 */ A_OBJ_BLOCK_LARGE_ROT, - /* 0x05 */ A_OBJ_CUBE_SMALL, - /* 0x06 */ A_OBJ_UNKNOWN_6, - /* 0x07 */ A_OBJ_GRASS_CLUMP, - /* 0x08 */ A_OBJ_TREE_STUMP, - /* 0x09 */ A_OBJ_SIGNPOST_OBLONG, - /* 0x0A */ A_OBJ_SIGNPOST_ARROW, - /* 0x0B */ A_OBJ_KNOB -} AObjType; - -struct EnAObj; - -typedef void (*EnAObjActionFunc)(struct EnAObj*, GlobalContext*); - -typedef struct EnAObj { - /* 0x000 */ DynaPolyActor dyna; - /* 0x164 */ EnAObjActionFunc actionFunc; - /* 0x168 */ s32 unk_168; - /* 0x16C */ s16 textId; - /* 0x16E */ s16 unk_16E; - /* 0x170 */ s16 unk_170; - /* 0x172 */ s16 unk_172; - /* 0x174 */ s16 unk_174; - /* 0x178 */ f32 unk_178; - /* 0x17C */ ColliderCylinder collider; -} EnAObj; // size = 0x1C8 - #define FLAGS 0x00000010 #define THIS ((EnAObj*)thisx) diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 7e9606d40..728cb11b9 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1,52 +1,6 @@ #include <ultra64.h> #include <global.h> -typedef enum { - /* 0x00 */ ITEM00_RUPEE_GREEN, - /* 0x01 */ ITEM00_RUPEE_BLUE, - /* 0x02 */ ITEM00_RUPEE_RED, - /* 0x03 */ ITEM00_HEART, - /* 0x04 */ ITEM00_BOMBS_A, - /* 0x05 */ ITEM00_ARROWS_SINGLE, - /* 0x06 */ ITEM00_HEART_PIECE, - /* 0x07 */ ITEM00_HEART_CONTAINER, - /* 0x08 */ ITEM00_ARROWS_SMALL, - /* 0x09 */ ITEM00_ARROWS_MEDIUM, - /* 0x0A */ ITEM00_ARROWS_LARGE, - /* 0x0B */ ITEM00_BOMBS_B, - /* 0x0C */ ITEM00_NUTS, - /* 0x0D */ ITEM00_STICK, - /* 0x0E */ ITEM00_MAGIC_LARGE, - /* 0x0F */ ITEM00_MAGIC_SMALL, - /* 0x10 */ ITEM00_SEEDS, - /* 0x11 */ ITEM00_SMALL_KEY, - /* 0x12 */ ITEM00_FLEXIBLE, - /* 0x13 */ ITEM00_RUPEE_ORANGE, - /* 0x14 */ ITEM00_RUPEE_PURPLE, - /* 0x15 */ ITEM00_SHIELD_DEKU, - /* 0x16 */ ITEM00_SHIELD_HYLIAN, - /* 0x17 */ ITEM00_TUNIC_ZORA, - /* 0x18 */ ITEM00_TUNIC_GORON, - /* 0x19 */ ITEM00_BOMBS_SPECIAL -} Item00Type; - -struct EnItem00; - -typedef void (*EnItem00ActionFunc)(struct EnItem00*, GlobalContext*); - -typedef struct EnItem00 { - /* 0x000 */ Actor actor; - /* 0x14C */ EnItem00ActionFunc actionFunc; - /* 0x150 */ s16 collectibleFlag; - /* 0x152 */ s16 unk_152; - /* 0x154 */ s16 unk_154; - /* 0x156 */ s16 unk_156; - /* 0x158 */ s16 unk_158; - /* 0x15A */ s16 unk_15A; - /* 0x15C */ f32 unk_15C; - /* 0x160 */ ColliderCylinder collider; -} EnItem00; // size = 0x1AC - #define FLAGS 0x00000000 #define THIS ((EnItem00*)thisx) @@ -915,7 +869,7 @@ s16 func_8001F404(s16 dropId) { // External functions used by other actors to drop collectibles, which usually results in spawning an En_Item00 actor. -Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) { +EnItem00* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) { s32 pad[2]; EnItem00* spawnedActor = NULL; s16 param4000 = params & 0x4000; @@ -955,10 +909,10 @@ Actor* Item_DropCollectible(GlobalContext* globalCtx, Vec3f* spawnPos, s16 param } } - return (Actor*)spawnedActor; + return spawnedActor; } -Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) { +EnItem00* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 params) { EnItem00* spawnedActor = NULL; s32 pad; s16 param4000 = params & 0x4000; @@ -987,7 +941,7 @@ Actor* Item_DropCollectible2(GlobalContext* globalCtx, Vec3f* spawnPos, s16 para } } - return (Actor*)spawnedActor; + return spawnedActor; } void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3f* spawnPos, s16 params) { |
