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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 6 additions & 6 deletions include/common_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ typedef void (*AuCallback)(void);
#define IMG_BIN u8
#define PAL_BIN u16

typedef s32 b32;
typedef s16 b16;
typedef s8 b8;

Expand Down Expand Up @@ -436,6 +435,7 @@ typedef struct Evt {
/* */ s32 functionTemp[4];
/* */ f32 functionTempF[4];
/* */ void* functionTempPtr[4];
/* */ bool functionTempBool[4];
/* */ };
/* 0x080 */ ApiFunc callFunction;
/* 0x084 */ union {
Expand Down Expand Up @@ -754,7 +754,7 @@ typedef struct CameraControlSettings {
} three;
} points;
/* 0x24 */ f32 viewPitch;
/* 0x28 */ b32 flag;
/* 0x28 */ bool flag;
} CameraControlSettings; // size = 0x2C

typedef struct Camera {
Expand Down Expand Up @@ -881,7 +881,7 @@ typedef struct Camera {
/* 0x524 */ f32 prevLeadPosX;
/* 0x528 */ f32 prevLeadPosZ;
/* 0x52C */ s32 leadConstrainDir;
/* 0x530 */ b32 needsInitialConstrainDir;
/* 0x530 */ bool needsInitialConstrainDir;
/* 0x534 */ CameraControlSettings* prevLeadSettings;
/* 0x538 */ char unk_538[0x18];
/* 0x550 */ f32 unusedLeadAmt;
Expand Down Expand Up @@ -1264,7 +1264,7 @@ typedef struct MessagePrintState {
/* 0x4FC */ s32 stateFlags;
/* 0x500 */ s16 delayFlags; // ?
/* 0x502 */ char unk_502[0x2];
/* 0x504 */ s32* closedWritebackBool; // if not null, writes 1 here when message closes
/* 0x504 */ bool* closedWritebackBool; // if not null, writes 1 here when message closes
/* 0x508 */ u8 style;
/* 0x509 */ u8 fadeInCounter;
/* 0x50A */ Vec2s initOpenPos; // where the message originates from, in screen-space coords
Expand Down Expand Up @@ -1536,7 +1536,7 @@ typedef struct ItemEntityPhysicsData {
/* 0x14 */ f32 velZ;
/* 0x18 */ f32 moveAngle;
/* 0x1C */ s32 timeLeft;
/* 0x20 */ b32 useSimplePhysics;
/* 0x20 */ bool useSimplePhysics;
} ItemEntityPhysicsData; // size = 0x24

typedef struct RenderTask {
Expand Down Expand Up @@ -2351,7 +2351,7 @@ typedef struct VirtualEntity {
typedef VirtualEntity* VirtualEntityList[0x40];

typedef struct Message {
/* 0x00 */ b32 unk_00;
/* 0x00 */ bool unk_00;
/* 0x04 */ s32 entityModelIndex;
/* 0x08 */ Vec3f accel;
/* 0x14 */ Vec3f vel;
Expand Down
4 changes: 2 additions & 2 deletions include/effect_shims.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ f32 shim_clamp_angle(f32 theta);
f32 shim_sin_deg(f32 x);
f32 shim_cos_deg(f32 x);
f32 shim_atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
b32 shim_npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*);
bool shim_npc_raycast_down_sides(s32, f32*, f32*, f32*, f32*);
s32 shim_load_effect(s32 effectIndex);
float shim_sqrtf(float value);
void shim_mdl_draw_hidden_panel_surface(Gfx**, u16 treeIndex);
b32 shim_is_point_visible(f32, f32, f32, s32, f32*, f32*);
bool shim_is_point_visible(f32, f32, f32, s32, f32*, f32*);
void shim_guPerspectiveF(f32 mf[4][4], u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 far, f32 scale);
void shim_transform_point(Matrix4f mtx, f32 inX, f32 inY, f32 inZ, f32 inS, f32* outX, f32* outY, f32* outZ, f32* outW);
void shim_guPositionF(float mf[4][4], float r, float p, float h, float s, float x, float y, float z);
Expand Down
6 changes: 3 additions & 3 deletions include/effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ enum StarFXTypes {
};

typedef struct StarFXData {
/* 0x000 */ b32 canBounce;
/* 0x000 */ bool canBounce;
/* 0x004 */ Vec3f pos;
/* 0x010 */ Vec3f vel;
/* 0x01C */ f32 bounceTime;
Expand Down Expand Up @@ -249,7 +249,7 @@ enum SparkesFXTypes {
};

typedef struct ShapeSpellFXData {
/* 0x00 */ b32 isChild;
/* 0x00 */ bool isChild;
/* 0x04 */ Vec3f pos;
/* 0x10 */ f32 unk_10;
/* 0x14 */ f32 unk_14;
Expand Down Expand Up @@ -1251,7 +1251,7 @@ typedef struct AttackResultTextFXData {
/* 0x18 */ s32 timeLeft;
/* 0x1C */ s32 lifetime;
/* 0x20 */ s32 unk_20;
/* 0x24 */ b32 isVisible;
/* 0x24 */ bool isVisible;
/* 0x28 */ f32 scale;
/* 0x2C */ char unk_2C[0x4];
/* 0x30 */ Vec2f vel;
Expand Down
2 changes: 1 addition & 1 deletion include/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ typedef struct ChestData {
typedef struct BlueWarpPipeData {
/* 0x00 */ s32 unk_00; // proably flags
/* 0x04 */ s32 timer;
/* 0x08 */ b32 isRaised;
/* 0x08 */ bool isRaised;
/* 0x0C */ s32 entryID;
/* 0x10 */ EvtScript* onEnterPipeEvt;
/* 0x14 */ s32 flagIndex;
Expand Down
4 changes: 2 additions & 2 deletions include/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -4774,9 +4774,9 @@ enum CameraUpdateMode {
CAM_UPDATE_FROM_ZONE = 3,

// this camera uses a set of control parameters to calculate its lookAt_obj and lookAt_eye positions,
// which are only updated if skipRecalc = FALSE
// which are only updated if skipRecalc = false
// the ultimate target is given by lookAt_obj_target, with an offset given by targetPos (?!)
// in practice, this is used for CAM_BATTLE and CAM_TATTLE, with skipRecalc almost always set to FALSE
// in practice, this is used for CAM_BATTLE and CAM_TATTLE, with skipRecalc almost always set to false
CAM_UPDATE_NO_INTERP = 6,

// this camera tracks lookAt_obj_target in a circular region centered on targetPos. the camera does not update
Expand Down
56 changes: 28 additions & 28 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ Shadow* get_shadow_by_index(s32 index);
s32 get_time_freeze_mode(void);
void render_player_model(void);
s16 get_game_mode(void);
s32 is_picking_up_item(void);
bool is_picking_up_item(void);

f32 integrate_gravity(void);
void gravity_use_fall_parms(void);
f32 get_clamped_angle_diff(f32, f32);
b32 startup_fade_screen_in(s16 subtractAlpha);
b32 startup_fade_screen_out(s16 addAlpha);
bool startup_fade_screen_in(s16 subtractAlpha);
bool startup_fade_screen_out(s16 addAlpha);
void startup_fade_screen_update(void);

u32 get_entity_type(s32 arg0);
Expand Down Expand Up @@ -142,10 +142,10 @@ void player_handle_floor_collider_type(s32 colliderID);
f32 player_fall_distance(void);
void func_800E4AD8(s32 arg0);
f32 player_check_collision_below(f32, s32* colliderID);
b32 can_trigger_loading_zone(void);
bool can_trigger_loading_zone(void);
void update_damage_popups(void);
void show_action_rating(s32, Actor*, f32, f32, f32);
s32 render_with_adjusted_palettes(s32, ActorPart*, s32, Matrix4f, s32);
s32 render_with_adjusted_palettes(bool isNpcSprite, ActorPart* part, s32 yaw, Matrix4f mtx, bool skipAnimation);

HeapNode* general_heap_create(void);
void* general_heap_malloc(s32 size);
Expand Down Expand Up @@ -188,7 +188,7 @@ void entity_HugeBlueSwitch_init(Entity* entity);
s32 dispatch_damage_event_actor_0(Actor* actor, s32 damageAmount, s32 event);

// Text
MessagePrintState* msg_get_printer_for_msg(s32 msgID, s32* a1);
MessagePrintState* msg_get_printer_for_msg(s32 msgID, bool* donePrintingWriteback);
s32 msg_printer_load_msg(s32 msgID, MessagePrintState* printer);
void msg_printer_set_origin_pos(MessagePrintState* msgPrintState, s32 x, s32 y);

Expand Down Expand Up @@ -233,7 +233,7 @@ void phys_main_collision_below(void);
void phys_peach_update(void);
void check_input_spin(void);

b32 npc_test_move_simple_without_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);
bool npc_test_move_simple_without_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);

void update_collider_transform(s16 colliderID);
void get_collider_center(s32 colliderID, f32* x, f32* y, f32* z);
Expand Down Expand Up @@ -271,7 +271,7 @@ f32 atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
f32 clamp_angle(f32 theta);
s32 sign(s32 value);

b32 check_player_action_debug(void);
bool check_player_action_debug(void);

s32 battle_heap_create(void);

Expand Down Expand Up @@ -419,18 +419,18 @@ s32 suspend_all_script(s32 id);
s32 resume_all_script(s32 id);

s32 create_shadow_type(s32 type, f32 x, f32 y, f32 z);
b32 is_point_outside_territory(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ);
bool is_point_outside_territory(s32 shape, f32 pointX, f32 pointY, f32 centerX, f32 centerY, f32 sizeX, f32 sizeZ);
PlayerData* get_player_data(void);

b32 npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32);
b32 npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth);
b32 npc_raycast_up(s32, f32*, f32*, f32*, f32*);
bool npc_raycast_down_around(s32, f32*, f32*, f32*, f32*, f32, f32);
bool npc_raycast_down_sides(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth);
bool npc_raycast_up(s32, f32*, f32*, f32*, f32*);
HitID npc_raycast_up_corners(s32 ignoreFlags, f32* posX, f32* posY, f32* posZ, f32* hitDepth, f32 yaw, f32 radius);
HitID player_raycast_up_corners(PlayerStatus*, f32*, f32*, f32*, f32*, f32);
HitID player_raycast_below_cam_relative(PlayerStatus* playerStatus, f32* outX, f32* outY, f32* outZ, f32* outLength,
f32* hitRx, f32* hitRz, f32* hitDirX, f32* hitDirZ);
b32 npc_test_move_taller_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);
b32 npc_test_move_simple_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);
bool npc_test_move_taller_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);
bool npc_test_move_simple_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);
s32 npc_test_move_complex_with_slipping(s32, f32*, f32*, f32*, f32, f32, f32, f32);

// Partner
Expand Down Expand Up @@ -525,8 +525,8 @@ void disable_player_shadow(void);
void move_player(s32 duration, f32 heading, f32 speed);
s32 enable_player_input(void);
s32 enable_player_static_collisions(void);
b32 check_input_jump(void);
b32 check_input_hammer(void);
bool check_input_jump(void);
bool check_input_hammer(void);

Npc* resolve_npc(Evt* script, s32 npcIdOrPtr);
void enable_npc_blur(Npc* npc);
Expand Down Expand Up @@ -629,7 +629,7 @@ void exec_entity_commandlist(Entity* entity);
void show_start_recovery_shimmer(f32 x, f32 y, f32 z, s32 arg3);
void show_recovery_shimmer(f32 x, f32 y, f32 z, s32 arg3);

void show_next_damage_popup(f32 x, f32 y, f32 z, s32 damageAmount, s32);
void show_next_damage_popup(f32 x, f32 y, f32 z, s32 damageAmount, s32 angle);
void add_xz_vec3f(Vec3f* vector, f32 speed, f32 angleDeg);
void add_xz_vec3f_copy1(Vec3f* vector, f32 speed, f32 angleDeg);
void add_xz_vec3f_copy2(Vec3f* vector, f32 speed, f32 angleDeg);
Expand Down Expand Up @@ -784,7 +784,7 @@ void imgfx_update_cache(void);
s32 imgfx_get_free_instances(s32);
void free_worker(s32);

b32 ai_check_fwd_collisions(Npc* npc, f32 time, f32* outYaw, f32* outDistFwd, f32* outDistCW, f32* outDistCCW);
bool ai_check_fwd_collisions(Npc* npc, f32 time, f32* outYaw, f32* outDistFwd, f32* outDistCW, f32* outDistCCW);
void basic_ai_loiter_init(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory);
void PatrolAI_LoiterInit(Evt* script, MobileAISettings* aiSettings, EnemyDetectVolume* territory);

Expand All @@ -809,7 +809,7 @@ void* load_asset_by_name(const char* assetName, u32* decompressedSize);
Gfx* mdl_get_copied_gfx(s32 copyIndex);
void mdl_get_copied_vertices(s32 copyIndex, Vtx** firstVertex, Vtx** copiedVertices, s32* numCopied);
void mdl_draw_hidden_panel_surface(Gfx** arg0, u16 treeIndex);
b32 is_point_visible(f32 x, f32 y, f32 z, s32 depthQueryID, f32* screenX, f32* screenY);
bool is_point_visible(f32 x, f32 y, f32 z, s32 depthQueryID, f32* screenX, f32* screenY);
void set_screen_overlay_center_worldpos(s32 idx, s32 posIdx, s32 x, s32 y, s32 z);
void* mdl_get_next_texture_address(s32);
s32 cancel_current_message(void);
Expand All @@ -831,7 +831,7 @@ void partner_init_after_battle(s32 arg0);
void load_map_script_lib(void);
void remove_item_entity_by_index(s32 index);
void set_entity_commandlist(Entity* entity, s32* entityScript);
s32 is_player_dismounted(void);
bool is_player_dismounted(void);
void func_800EF300(void);
void func_800EF314(void);
void func_800EF43C(void);
Expand Down Expand Up @@ -927,7 +927,7 @@ void clear_world_menus(void);
void setup_status_bar_for_battle(void);
void enable_status_bar_input(void);
void disable_status_bar_input(void);
b32 can_control_status_bar(void);
bool can_control_status_bar(void);
void status_bar_respond_to_changes(void);
void status_bar_always_show_on(void);
void status_bar_always_show_off(void);
Expand All @@ -947,15 +947,15 @@ void set_message_int_var(s32 value, s32 index);
s32 store_item(s32 itemID);
void open_status_bar_quickly(void);
void show_immune_bonk(f32 x, f32 y, f32 z, s32, s32, s32);
void show_primary_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 a);
void show_primary_damage_popup(f32 x, f32 y, f32 z, s32 attack, s32 angle);
s32 dispatch_damage_event_partner(s32 damageAmount, s32 event, s32 stopMotion);
void disable_actor_blur(Actor*);
void reset_actor_blur(Actor*);
void enable_actor_blur(Actor*);
void apply_shock_effect(Actor*);
void part_glow_off(s32, ActorPart*, s32 yaw, b32 arg3);
void part_flash_off(b32 isNpcSprite, ActorPart* part, s32 yaw, b32 isReflection);
void part_flash_on(b32 isNpcSprite, ActorPart* part, s32 yaw, b32 isReflection);
void part_glow_off(bool isNpcSprite, ActorPart* part, s32 yaw, bool isReflection);
void part_flash_off(bool isNpcSprite, ActorPart* part, s32 yaw, bool isReflection);
void part_flash_on(bool isNpcSprite, ActorPart* part, s32 yaw, bool isReflection);
void _add_part_decoration(ActorPart*);
void _remove_part_decoration(ActorPart* part, s32 decorationIndex);
void remove_part_decor_none(ActorPart*, s32);
Expand Down Expand Up @@ -1051,7 +1051,7 @@ s32 lookup_defense(s32*, s32);
s32 lookup_status_chance(s32*, s32);
void peach_check_for_parasol_input(void);
void peach_sync_disguise_npc(void);
b32 check_conversation_trigger(void);
bool check_conversation_trigger(void);

void clear_player_status(void);
void clear_entity_models(void);
Expand All @@ -1063,7 +1063,7 @@ void clear_sprite_shading_data(void);
void clear_character_set(void);
void clear_trigger_data(void);
void clear_script_list(void);
void clear_entity_data(b32);
void clear_entity_data(bool);
void clear_effect_data(void);

void clear_saved_variables(void);
Expand All @@ -1074,7 +1074,7 @@ void partner_kill_ability_script(void);
void func_800EF3D4(s32);

void mdl_update_transform_matrices(void);
void mdl_group_set_custom_gfx(u16, s32, s32, b32);
void mdl_group_set_custom_gfx(u16, s32, s32, bool);

void backup_map_collision_data(void);
void reset_status_bar(void);
Expand Down
11 changes: 9 additions & 2 deletions include/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

#define PTR_LIST_END ((void*) -1)

#define API_CALLABLE(name) ApiStatus name(Evt* script, b32 isInitialCall)
#define API_CALLABLE(name) ApiStatus name(Evt* script, bool isInitialCall)

// standardized padding macros for map overlays
#define MAP_RODATA_PAD(n,name) const s32 N(rodata_pad_##name)[n] = {};
Expand All @@ -68,7 +68,7 @@
#ifdef DEBUG
#define IS_DEBUG_PANIC(statement, file, line) is_debug_panic(statement, file, line)
#else
#define IS_DEBUG_PANIC(statement, file, line) do {} while(TRUE)
#define IS_DEBUG_PANIC(statement, file, line) do {} while(true)
#endif

#define PANIC() IS_DEBUG_PANIC("Panic", __FILE__, __LINE__)
Expand Down Expand Up @@ -538,4 +538,11 @@ typedef s32 Difficulty2D[AC_DIFFICULTY_LEN][2];

#define DMA_COPY_SEGMENT(segment) dma_copy(segment##_ROM_START, segment##_ROM_END, segment##_VRAM)

#if __STDC_VERSION__ < 202311L
typedef enum {
false,
true
} bool;
#endif

#endif
2 changes: 1 addition & 1 deletion include/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ typedef struct MapConfig {
/* 0x0C */ void* dmaEnd;
/* 0x10 */ void* dmaDest;
/* 0x14 */ char* bgName;
/* 0x18 */ MapInit init; ///< Return TRUE to skip normal asset (shape/hit/bg/tex) loading.
/* 0x18 */ MapInit init; ///< Return true to skip normal asset (shape/hit/bg/tex) loading.
/* 0x1C */ char unk_1C[0x2];
/* 0x1E */ s8 songVariation; ///< 0 or 1. @see bgm_get_map_default_variation
/* 0x1F */ s8 sfxReverb;
Expand Down
Loading