Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@

#include "z64.h"

Actor* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, u32 params);
Actor* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s32 params);
void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params);
s32 func_800A8150(s32 index);
s32 func_800A817C(s32 index);
bool Item_CanDropBigFairy(PlayState* play, s32 index, s32 collectibleFlag);

// Ideally these two prototypes would be in z64actor.h, but they use PlayerItemAction which would require including z64player.h there.
s32 Actor_OfferTalkExchange(Actor* actor, struct PlayState* play, f32 xzRange, f32 yRange, PlayerItemAction exchangeItemAction);
s32 Actor_OfferTalkExchangeEquiCylinder(Actor* actor, struct PlayState* play, f32 radius, PlayerItemAction exchangeItemAction);

void GetItem_Draw(PlayState* play, s16 drawId);

void Room_Noop(PlayState* play, Room* room, Input* input, s32 arg3);
void Room_Init(PlayState* play, RoomContext* roomCtx);
size_t Room_SetupFirstRoom(PlayState* play, RoomContext* roomCtx);
Expand Down
82 changes: 3 additions & 79 deletions include/z64actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ typedef struct {
#define BGCHECKFLAG_GROUND_STRICT (1 << 7) // Similar to BGCHECKFLAG_GROUND but with no velocity check and is cleared every frame
#define BGCHECKFLAG_CRUSHED (1 << 8) // Crushed between a floor and ceiling (triggers a void for player)
#define BGCHECKFLAG_PLAYER_WALL_INTERACT (1 << 9) // Only set/used by player, related to interacting with walls
#define BGCHECKFLAG_PLAYER_400 (1 << 10) //
#define BGCHECKFLAG_PLAYER_800 (1 << 11) //
#define BGCHECKFLAG_PLAYER_1000 (1 << 12) //
#define BGCHECKFLAG_PLAYER_400 (1 << 10) //
#define BGCHECKFLAG_PLAYER_800 (1 << 11) //
#define BGCHECKFLAG_PLAYER_1000 (1 << 12) //

// Flags for Actor_UpdateBgCheckInfo
#define UPDBGCHECKINFO_FLAG_1 (1 << 0) // check wall
Expand Down Expand Up @@ -179,82 +179,6 @@ typedef struct DynaPolyActor {
/* 0x158 */ u8 interactFlags;
} DynaPolyActor; // size = 0x15C

typedef enum Item00Type {
/* 0x00 */ ITEM00_RUPEE_GREEN,
/* 0x01 */ ITEM00_RUPEE_BLUE,
/* 0x02 */ ITEM00_RUPEE_RED,
/* 0x03 */ ITEM00_RECOVERY_HEART,
/* 0x04 */ ITEM00_BOMBS_A,
/* 0x05 */ ITEM00_ARROWS_10,
/* 0x06 */ ITEM00_HEART_PIECE,
/* 0x07 */ ITEM00_HEART_CONTAINER,
/* 0x08 */ ITEM00_ARROWS_30,
/* 0x09 */ ITEM00_ARROWS_40,
/* 0x0A */ ITEM00_ARROWS_50,
/* 0x0B */ ITEM00_BOMBS_B,
/* 0x0C */ ITEM00_DEKU_NUTS_1,
/* 0x0D */ ITEM00_DEKU_STICK,
/* 0x0E */ ITEM00_MAGIC_JAR_BIG,
/* 0x0F */ ITEM00_MAGIC_JAR_SMALL,
/* 0x10 */ ITEM00_MASK,
/* 0x11 */ ITEM00_SMALL_KEY,
/* 0x12 */ ITEM00_FLEXIBLE,
/* 0x13 */ ITEM00_RUPEE_HUGE,
/* 0x14 */ ITEM00_RUPEE_PURPLE,
/* 0x15 */ ITEM00_3_HEARTS,
/* 0x16 */ ITEM00_SHIELD_HERO,
/* 0x17 */ ITEM00_DEKU_NUTS_10,
/* 0x18 */ ITEM00_NOTHING,
/* 0x19 */ ITEM00_BOMBS_0,
/* 0x1A */ ITEM00_BIG_FAIRY,
/* 0x1B */ ITEM00_MAP,
/* 0x1C */ ITEM00_COMPASS,
/* 0x1D */ ITEM00_MUSHROOM_CLOUD,

/* 0xFF */ ITEM00_NO_DROP = -1
} Item00Type;

struct EnItem00;

typedef void (*EnItem00ActionFunc)(struct EnItem00*, struct PlayState*);

#define ENITEM00_GET_8000(thisx) ((thisx)->params & 0x8000)
#define ENITEM00_GET_7F00(thisx) (((thisx)->params & 0x7F00) >> 8)

typedef struct EnItem00 {
/* 0x000 */ Actor actor;
/* 0x144 */ EnItem00ActionFunc actionFunc;
/* 0x148 */ s16 collectibleFlag;
/* 0x14A */ s16 getItemId;
/* 0x14C */ s16 unk14C;
/* 0x14E */ s16 unk14E;
/* 0x150 */ s16 unk150;
/* 0x152 */ s16 unk152;
/* 0x154 */ f32 unk154;
/* 0x158 */ ColliderCylinder collider;
/* 0x1A4 */ s8 unk1A4;
} EnItem00; // size = 0x1A8

struct EnAObj;

typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*);

typedef struct EnAObj {
/* 0x000 */ Actor actor;
/* 0x144 */ EnAObjActionFunc actionFunc;
/* 0x148 */ ColliderCylinder collision;
} EnAObj; // size = 0x194

typedef enum {
/* 0 */ AOBJ_SIGNPOST_OBLONG,
/* 1 */ AOBJ_SIGNPOST_ARROW
} AObjType;

#define AOBJ_GET_TEXTID(thisx) ((((thisx)->params >> 8) & 0xFF) | 0x300)
#define AOBJ_GET_TYPE(thisx) (((thisx)->params & 0xFF) - 9)

#define AOBJ_PARAMS(textId, type) ((((textId - 0x300) & 0xFF) << 8) | (type + 9))

typedef enum {
/* 0x00 */ ACTORCAT_SWITCH,
/* 0x01 */ ACTORCAT_BG,
Expand Down
8 changes: 8 additions & 0 deletions include/z64draw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef Z64_DRAW_H
#define Z64_DRAW_H

#include "ultra64.h"

void GetItem_Draw(struct PlayState* play, s16 drawId);

#endif
28 changes: 28 additions & 0 deletions include/z_en_a_keep.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#ifndef Z_EN_A_KEEP_H
#define Z_EN_A_KEEP_H

#include "z64actor.h"
#include "z64collision_check.h"

struct EnAObj;
struct PlayState;

typedef void (*EnAObjActionFunc)(struct EnAObj*, struct PlayState*);

typedef struct EnAObj {
/* 0x000 */ Actor actor;
/* 0x144 */ EnAObjActionFunc actionFunc;
/* 0x148 */ ColliderCylinder collision;
} EnAObj; // size = 0x194

typedef enum {
/* 0 */ AOBJ_SIGNPOST_OBLONG,
/* 1 */ AOBJ_SIGNPOST_ARROW
} AObjType;

#define AOBJ_GET_TEXTID(thisx) ((((thisx)->params >> 8) & 0xFF) | 0x300)
#define AOBJ_GET_TYPE(thisx) (((thisx)->params & 0xFF) - 9)

#define AOBJ_PARAMS(textId, type) ((((textId - 0x300) & 0xFF) << 8) | (type + 9))

#endif
70 changes: 70 additions & 0 deletions include/z_en_item00.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#ifndef Z_EN_ITEM00_H
#define Z_EN_ITEM00_H

#include "ultra64.h"
#include "z64actor.h"

typedef enum Item00Type {
/* 0x00 */ ITEM00_RUPEE_GREEN,
/* 0x01 */ ITEM00_RUPEE_BLUE,
/* 0x02 */ ITEM00_RUPEE_RED,
/* 0x03 */ ITEM00_RECOVERY_HEART,
/* 0x04 */ ITEM00_BOMBS_A,
/* 0x05 */ ITEM00_ARROWS_10,
/* 0x06 */ ITEM00_HEART_PIECE,
/* 0x07 */ ITEM00_HEART_CONTAINER,
/* 0x08 */ ITEM00_ARROWS_30,
/* 0x09 */ ITEM00_ARROWS_40,
/* 0x0A */ ITEM00_ARROWS_50,
/* 0x0B */ ITEM00_BOMBS_B,
/* 0x0C */ ITEM00_DEKU_NUTS_1,
/* 0x0D */ ITEM00_DEKU_STICK,
/* 0x0E */ ITEM00_MAGIC_JAR_BIG,
/* 0x0F */ ITEM00_MAGIC_JAR_SMALL,
/* 0x10 */ ITEM00_MASK,
/* 0x11 */ ITEM00_SMALL_KEY,
/* 0x12 */ ITEM00_FLEXIBLE,
/* 0x13 */ ITEM00_RUPEE_HUGE,
/* 0x14 */ ITEM00_RUPEE_PURPLE,
/* 0x15 */ ITEM00_3_HEARTS,
/* 0x16 */ ITEM00_SHIELD_HERO,
/* 0x17 */ ITEM00_DEKU_NUTS_10,
/* 0x18 */ ITEM00_NOTHING,
/* 0x19 */ ITEM00_BOMBS_0,
/* 0x1A */ ITEM00_BIG_FAIRY,
/* 0x1B */ ITEM00_MAP,
/* 0x1C */ ITEM00_COMPASS,
/* 0x1D */ ITEM00_MUSHROOM_CLOUD,

/* 0xFF */ ITEM00_NO_DROP = -1
} Item00Type;

struct EnItem00;

typedef void (*EnItem00ActionFunc)(struct EnItem00*, struct PlayState*);

#define ENITEM00_GET_8000(thisx) ((thisx)->params & 0x8000)
#define ENITEM00_GET_7F00(thisx) (((thisx)->params & 0x7F00) >> 8)

typedef struct EnItem00 {
/* 0x000 */ Actor actor;
/* 0x144 */ EnItem00ActionFunc actionFunc;
/* 0x148 */ s16 collectibleFlag;
/* 0x14A */ s16 getItemId;
/* 0x14C */ s16 unk14C;
/* 0x14E */ s16 unk14E;
/* 0x150 */ s16 unk150;
/* 0x152 */ s16 unk152;
/* 0x154 */ f32 unk154;
/* 0x158 */ ColliderCylinder collider;
/* 0x1A4 */ s8 unk1A4;
} EnItem00; // size = 0x1A8

Actor* Item_DropCollectible(struct PlayState* play, Vec3f* spawnPos, u32 params);
Actor* Item_DropCollectible2(struct PlayState* play, Vec3f* spawnPos, s32 params);
void Item_DropCollectibleRandom(struct PlayState* play, Actor* fromActor, Vec3f* spawnPos, s16 params);
s32 func_800A8150(s32 index);
s32 func_800A817C(s32 index);
bool Item_CanDropBigFairy(struct PlayState* play, s32 index, s32 collectibleFlag);

#endif
1 change: 1 addition & 0 deletions src/code/z_en_a_keep.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "global.h"
#include "z_en_a_keep.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY)
Expand Down
4 changes: 3 additions & 1 deletion src/code/z_en_item00.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "global.h"
#include "z_en_item00.h"
#include "attributes.h"
#include "z64draw.h"
#include "z64play.h"
#include "overlays/actors/ovl_En_Elforg/z_en_elforg.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_gi_hearts/object_gi_hearts.h"
Expand Down
1 change: 1 addition & 0 deletions src/code/z_player_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include "global.h"
#include "z64draw.h"

#include "assets/objects/gameplay_keep/gameplay_keep.h"

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_Bg_Icicle/z_bg_icicle.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_bg_icicle.h"
#include "z_en_item00.h"
#include "assets/objects/object_icicle/object_icicle.h"

#define FLAGS 0x00000000
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_Boss_01/z_boss_01.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/

#include "z_boss_01.h"
#include "z_en_item00.h"
#include "z64rumble.h"
#include "z64shrink_window.h"
#include "attributes.h"
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_Boss_05/z_boss_05.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "z_boss_05.h"
#include "attributes.h"
#include "z_en_item00.h"

#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE)

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_Demo_Getitem/z_demo_getitem.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_demo_getitem.h"
#include "z64draw.h"

#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_Dm_Char03/z_dm_char03.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_dm_char03.h"
#include "z64draw.h"
#include "assets/objects/object_osn/object_osn.h"

#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
Expand Down
2 changes: 2 additions & 0 deletions src/overlays/actors/ovl_Dm_Char05/z_dm_char05.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*/

#include "z_dm_char05.h"

#include "z64draw.h"
#include "assets/objects/object_dmask/object_dmask.h"

#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_Dm_Hina/z_dm_hina.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_dm_hina.h"
#include "z64draw.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Am/z_en_am.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_am.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/actors/ovl_En_Bombf/z_en_bombf.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Baguo/z_en_baguo.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_baguo.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Bb/z_en_bb.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_bb.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Bbfall/z_en_bbfall.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_bbfall.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Bigpamet/z_en_bigpamet.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_bigpamet.h"
#include "z_en_item00.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.h"
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Bigslime/z_en_bigslime.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_bigslime.h"
#include "z_en_item00.h"
#include "z64quake.h"
#include "z64rumble.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Boom/z_en_boom.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_boom.h"
#include "z_en_item00.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"

#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Bubble/z_en_bubble.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_bubble.h"
#include "z_en_item00.h"

#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED)

Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Crow/z_en_crow.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_crow.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"

#define FLAGS \
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Dekubaba/z_en_dekubaba.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_dekubaba.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
Expand Down
1 change: 1 addition & 0 deletions src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include "z_en_dekunuts.h"
#include "z_en_item00.h"
#include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h"
#include "overlays/actors/ovl_Obj_Etcetera/z_obj_etcetera.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
Expand Down
Loading