2020-07-18 02:47:33 +02:00
|
|
|
#ifndef _FUNCTIONS_H_
|
|
|
|
#define _FUNCTIONS_H_
|
|
|
|
|
|
|
|
#include "ultra64.h"
|
|
|
|
#include "common_structs.h"
|
2020-08-15 02:49:33 +02:00
|
|
|
#include "enums.h"
|
2020-07-18 02:47:33 +02:00
|
|
|
|
2020-12-25 00:39:47 +01:00
|
|
|
|
|
|
|
void nuBoot(void);
|
|
|
|
void boot_idle(void);
|
|
|
|
void boot_main(void);
|
|
|
|
|
2020-07-29 05:35:42 +02:00
|
|
|
void osCleanupThread(void);
|
|
|
|
|
2021-01-03 10:34:04 +01:00
|
|
|
void func_80070A90(s32, f32, f32, f32);
|
|
|
|
void func_80070AF0(s32, f32, f32, f32);
|
|
|
|
|
2020-08-27 00:54:55 +02:00
|
|
|
s32 heap_malloc(s32 size);
|
2021-01-19 17:31:43 +01:00
|
|
|
HeapNode* _heap_create(s32* addr, u32 size);
|
2020-11-06 01:30:17 +01:00
|
|
|
s32 dma_copy(s32 romStart, s32 romEnd, void* vramDest);
|
2020-08-27 00:54:55 +02:00
|
|
|
|
2020-09-22 05:10:53 +02:00
|
|
|
s32 get_global_byte(s32 index);
|
2020-09-19 17:16:02 +02:00
|
|
|
s32 get_global_flag(s32 index);
|
2020-09-22 05:10:53 +02:00
|
|
|
s32 get_area_byte(s32 index);
|
2020-09-19 17:16:02 +02:00
|
|
|
s32 get_area_flag(s32 index);
|
|
|
|
|
2020-09-25 23:18:09 +02:00
|
|
|
Shadow* get_shadow_by_index(s32 index);
|
|
|
|
|
|
|
|
void render_player_model();
|
|
|
|
|
2020-10-03 22:04:49 +02:00
|
|
|
f32 integrate_gravity(void);
|
2020-12-20 04:47:09 +01:00
|
|
|
f32 get_clamped_angle_diff(f32, f32);
|
2020-10-03 22:04:49 +02:00
|
|
|
|
2020-11-08 01:30:14 +01:00
|
|
|
u32 get_entity_type(s32 arg0);
|
2020-11-18 06:32:18 +01:00
|
|
|
Entity* get_entity_by_index(s32 index);
|
2020-11-21 08:40:54 +01:00
|
|
|
s32 create_entity(StaticEntityData*, s32, s32, s32, s32, s32);
|
2020-11-23 08:52:10 +01:00
|
|
|
void func_80070550(s32, f32, f32, f32, f32, f32, s32, s32);
|
2021-01-16 15:37:13 +01:00
|
|
|
void func_802E263C(Entity* entity);
|
2020-11-18 06:32:18 +01:00
|
|
|
|
2021-02-08 16:53:44 +01:00
|
|
|
void step_game_loop(void);
|
2021-02-08 19:02:14 +01:00
|
|
|
s32 resume_all_group(s32 groupFlags);
|
2021-02-08 16:53:44 +01:00
|
|
|
|
2021-01-16 21:08:08 +01:00
|
|
|
void create_shadow_callback(Shadow* entity);
|
|
|
|
void func_802E10F4(Entity* entity);
|
|
|
|
void func_802E114C(void);
|
|
|
|
void func_802E117C(void);
|
|
|
|
void save_game_at_player_position(void);
|
|
|
|
void func_802E1204(Entity* entity);
|
|
|
|
void func_802E1270(Entity* entity);
|
|
|
|
void func_802E1298(void);
|
|
|
|
void func_802E12F8(void);
|
|
|
|
void func_802E1328(Entity* entity);
|
|
|
|
void func_802E1350(Entity* entity);
|
|
|
|
void func_802E13B8(Entity* entity);
|
|
|
|
void func_802E1400(Entity* entity);
|
|
|
|
void func_802E1460(Entity* entity);
|
|
|
|
void func_802E14D8(Entity* entity);
|
|
|
|
void func_802E1614(Entity* entity);
|
|
|
|
void func_802E1660(Entity* entity);
|
|
|
|
void func_802E1740(Entity* entity);
|
|
|
|
void func_802E176C(Entity* entity);
|
|
|
|
s32 func_802E17A8(Entity* entity);
|
|
|
|
void func_802E1EA8(Entity* entity);
|
|
|
|
void func_802E1EDC(Entity* entity);
|
|
|
|
void func_802E234C(Entity* entity);
|
|
|
|
f32 func_802E31EC(Entity* entity);
|
|
|
|
void func_802E328C(Entity* entity);
|
|
|
|
s32 func_802E3BA4(Entity* entity);
|
|
|
|
void entity_init_BlueSwitch(Entity* entity);
|
|
|
|
void entity_init_HugeBlueSwitch(Entity* entity);
|
|
|
|
|
2020-11-19 09:31:22 +01:00
|
|
|
UNK_TYPE func_80072230(s32, f32, f32, f32, f32, s32);
|
2020-11-08 01:30:14 +01:00
|
|
|
|
2020-10-17 05:47:10 +02:00
|
|
|
// Text
|
|
|
|
PrintContext* load_string(s32 stringID, s32* a1);
|
|
|
|
void get_screen_coords(Cam camID, f32 x, f32 y, f32 z, f32* outX, f32* outY, f32* outZ);
|
|
|
|
|
2020-09-25 23:18:09 +02:00
|
|
|
void parent_collider_to_model(s32 colliderID, s16 modelIndex);
|
2020-08-10 09:42:50 +02:00
|
|
|
void clone_model(u16 srcModelID, u16 newModelID);
|
2020-09-18 03:28:34 +02:00
|
|
|
Model* get_model_from_list_index(s32 listIndex);
|
2020-09-25 23:18:09 +02:00
|
|
|
s32 get_model_list_index_from_tree_index(s32 treeIndex);
|
2020-09-19 17:17:53 +02:00
|
|
|
void get_model_center_and_size(s32 modelID, f32* centerX, f32* centerY, f32* centerZ, f32* sizeX, f32* sizeY,
|
|
|
|
f32* sizeZ);
|
2020-09-18 03:28:34 +02:00
|
|
|
|
2020-11-23 19:48:34 +01:00
|
|
|
void func_80027088(s32);
|
|
|
|
|
2021-01-17 15:40:02 +01:00
|
|
|
void func_8006F8F0(f32, f32, f32);
|
2020-11-02 20:53:06 +01:00
|
|
|
void func_8006FEF0(s32, f32, f32, f32, f32);
|
2021-01-17 15:40:02 +01:00
|
|
|
void func_80070190(s32, f32, f32, f32, s32, f32, s32, s32);
|
|
|
|
|
2020-11-23 19:48:34 +01:00
|
|
|
void func_80071090(s32, f32, f32, f32, s32);
|
2020-11-02 20:53:06 +01:00
|
|
|
void func_80071750(s32, f32, f32, f32, f32, s32);
|
2020-12-03 16:36:01 +01:00
|
|
|
void func_800720B0(s32, f32, f32, f32, f32, s32);
|
2020-10-20 01:48:16 +02:00
|
|
|
void func_80072950(s32, f32, f32, f32, f32, s32 time);
|
|
|
|
|
2020-08-10 09:42:50 +02:00
|
|
|
void update_collider_transform(s16 colliderID);
|
2020-08-27 00:54:55 +02:00
|
|
|
void get_collider_center(s32 colliderID, f32* x, f32* y, f32* z);
|
|
|
|
|
2020-10-08 21:03:58 +02:00
|
|
|
s32 is_trigger_bound(Trigger*, Bytecode* script);
|
2020-09-06 17:53:48 +02:00
|
|
|
Trigger* create_trigger(TriggerDefinition* def);
|
|
|
|
s32 _bound_script_trigger_handler(Trigger* trigger);
|
2020-11-23 20:19:13 +01:00
|
|
|
Trigger* get_trigger_by_id(s32 triggerID);
|
2020-09-06 17:53:48 +02:00
|
|
|
|
2020-11-27 20:38:52 +01:00
|
|
|
Actor* get_actor(ActorID actorID);
|
2020-10-17 05:47:10 +02:00
|
|
|
ActorPart* get_actor_part(Actor* actor, s32 partIndex);
|
2021-02-04 12:28:01 +01:00
|
|
|
s32 add_coins(s32 amt);
|
2020-10-08 21:03:58 +02:00
|
|
|
|
|
|
|
s32 func_800494C0(Npc* npc, s32 arg1, s32 arg2);
|
|
|
|
|
2020-08-16 07:13:03 +02:00
|
|
|
s32 get_variable(ScriptInstance* script, Bytecode var);
|
|
|
|
s32 set_variable(ScriptInstance* script, Bytecode var, s32 value);
|
|
|
|
f32 get_float_variable(ScriptInstance* script, Bytecode var);
|
|
|
|
f32 set_float_variable(ScriptInstance* script, Bytecode var, f32 value);
|
|
|
|
void set_script_timescale(ScriptInstance* script, f32 timescale);
|
2020-07-18 02:47:33 +02:00
|
|
|
f32 sin_deg(f32 x);
|
|
|
|
f32 cos_deg(f32 x);
|
2020-10-26 02:12:01 +01:00
|
|
|
f32 sin_rad(f32 x);
|
2021-01-20 16:42:05 +01:00
|
|
|
f32 cos_rad(f32 x);
|
|
|
|
s32 round(f32);
|
2020-08-15 06:27:01 +02:00
|
|
|
f32 atan2(f32 startX, f32 startZ, f32 endX, f32 endZ);
|
2020-08-15 16:26:43 +02:00
|
|
|
f32 clamp_angle(f32 theta);
|
2020-11-10 17:27:02 +01:00
|
|
|
s32 sign(s32 value);
|
2020-08-12 03:01:33 +02:00
|
|
|
s32 func_80055448(s32);
|
|
|
|
s32 func_80055464(s32, s32);
|
2020-12-02 01:13:24 +01:00
|
|
|
void func_800561A4(s32);
|
2020-09-18 03:28:34 +02:00
|
|
|
s32 osGetId();
|
2020-09-27 03:02:29 +02:00
|
|
|
|
2021-02-04 12:28:01 +01:00
|
|
|
s32* create_icon(s32 iconIndex);
|
|
|
|
void set_icon_render_pos(s32 iconIndex, s32 posX, s32 posY);
|
|
|
|
|
2020-10-28 07:42:14 +01:00
|
|
|
void set_curtain_scale_goal(f32 scale);
|
|
|
|
void set_curtain_fade(f32 scale);
|
|
|
|
|
2020-10-26 03:37:22 +01:00
|
|
|
void fx_walk_normal(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5);
|
2020-12-22 14:24:49 +01:00
|
|
|
void fx_emote(s32, Npc*, f32, f32, f32, f32, f32, s32, s32*);
|
2020-10-26 03:37:22 +01:00
|
|
|
|
2020-10-31 00:11:46 +01:00
|
|
|
f32 func_800E0088(f32, f32);
|
2020-12-22 15:58:31 +01:00
|
|
|
void func_800E06C0(s32);
|
2021-02-06 16:20:35 +01:00
|
|
|
void close_status_menu(void);
|
2020-10-30 05:32:25 +01:00
|
|
|
s32 func_800EB168(s32);
|
2020-10-30 04:56:54 +01:00
|
|
|
|
2020-12-23 07:56:34 +01:00
|
|
|
Shadow* create_shadow_type(s32 type, f32 x, f32 y, f32 z);
|
2020-12-04 23:36:25 +01:00
|
|
|
|
2020-11-02 20:53:06 +01:00
|
|
|
PlayerData* get_player_data(void);
|
|
|
|
|
2020-11-12 06:18:35 +01:00
|
|
|
// Pause
|
|
|
|
s32 pause_interp_vertical_scroll(s32 deltaBefore);
|
|
|
|
void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy);
|
|
|
|
|
2020-12-22 14:24:49 +01:00
|
|
|
s32 func_800DCB7C(s32, f32*, f32*, f32*, f32*);
|
2021-01-02 08:51:14 +01:00
|
|
|
s32 func_800DDC44(s32, f32*, f32*, f32*, f32, f32, f32, f32);
|
2020-12-22 14:24:49 +01:00
|
|
|
|
2021-01-03 10:02:50 +01:00
|
|
|
Npc* get_npc_by_index(s32 listIndex);
|
|
|
|
|
2020-10-19 01:27:14 +02:00
|
|
|
// Partner
|
2020-10-19 02:04:18 +02:00
|
|
|
void func_800EBA3C(Npc* partner);
|
|
|
|
void func_800EBB40(Npc* partner);
|
2020-11-09 00:26:29 +01:00
|
|
|
void enable_partner_ai(void);
|
2020-10-19 02:04:18 +02:00
|
|
|
void enable_partner_walking(Npc* partner, s32 val);
|
|
|
|
void enable_partner_flying(Npc* partner, s32 val);
|
2020-10-19 01:27:14 +02:00
|
|
|
void update_player_move_history(Npc* partner);
|
2020-11-07 20:44:44 +01:00
|
|
|
s32 is_current_partner_flying(void);
|
2020-10-19 01:27:14 +02:00
|
|
|
void func_800ED5D0(Npc* partner);
|
2020-11-23 20:19:13 +01:00
|
|
|
void clear_partner_move_history(Npc* partner);
|
2020-10-19 01:27:14 +02:00
|
|
|
|
2021-02-06 16:20:35 +01:00
|
|
|
s32 set_parter_tether_distance(f32);
|
2020-09-27 19:57:40 +02:00
|
|
|
s32 does_script_exist(s32 id);
|
2020-11-16 04:04:33 +01:00
|
|
|
s32 does_script_exist_by_ref(ScriptInstance* script);
|
2020-10-13 05:18:02 +02:00
|
|
|
ScriptInstance* start_script(Bytecode* initialLine, s32 priority, s32 initialState);
|
2020-10-28 20:06:49 +01:00
|
|
|
ScriptInstance* start_script_in_group(Bytecode* initialLine, u8 priority, u8 initialState, u8 groupFlags);
|
2020-09-27 03:02:29 +02:00
|
|
|
|
2020-11-27 20:38:52 +01:00
|
|
|
void set_animation_rate(ActorID actorID, s32 partIndex, f32 rate);
|
2020-08-22 05:04:10 +02:00
|
|
|
void func_8011B7C0(u16, s32, s32);
|
2020-11-08 22:05:39 +01:00
|
|
|
AnimatedMesh* get_anim_mesh(s32 arg0);
|
2021-02-06 16:20:35 +01:00
|
|
|
void set_transition_stencil_zoom_0(s32, f32);
|
|
|
|
void set_transition_stencil_zoom_1(s32, f32);
|
2020-11-26 22:41:01 +01:00
|
|
|
void func_80137DC0(s32, f32*, f32*);
|
2021-02-06 16:20:35 +01:00
|
|
|
s32 set_transition_stencil_color(s32, u8, u8, u8);
|
|
|
|
void set_transition_stencil_center(s32, s32, s32, s32);
|
2020-08-14 06:20:11 +02:00
|
|
|
s32 rand_int(s32);
|
2020-08-15 04:24:08 +02:00
|
|
|
void sort_items(void);
|
|
|
|
s32 is_ability_active(s32 arg0);
|
2020-08-16 06:24:20 +02:00
|
|
|
f32 update_lerp(Easing easing, f32 start, f32 end, s32 elapsed, s32 duration);
|
2020-07-18 02:47:33 +02:00
|
|
|
|
2021-01-15 21:35:39 +01:00
|
|
|
s32 make_item_entity(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 facingAngleSign,
|
|
|
|
s32 pickupVar);
|
2021-01-06 15:19:41 +01:00
|
|
|
s32 make_item_entity_delayed(s32 itemID, f32 x, f32 y, f32 z, s32 itemSpawnMode, s32 pickupDelay, s32 pickupVar);
|
2020-10-22 03:39:50 +02:00
|
|
|
void set_item_entity_position(s32 itemEntityIndex, f32 x, f32 y, f32 z);
|
2020-10-27 00:10:32 +01:00
|
|
|
ItemEntity* get_item_entity(s32 itemEntityIndex);
|
|
|
|
s32 make_item_entity_nodelay(s32 itemID, f32 x, f32 y, f32 z, ItemSpawnMode itemSpawnMode, s32 pickupVar);
|
2020-10-30 03:15:51 +01:00
|
|
|
void set_item_entity_flags(s32 itemEntityIndex, s32 flag);
|
2020-09-06 17:53:48 +02:00
|
|
|
|
2020-08-21 17:04:57 +02:00
|
|
|
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height);
|
|
|
|
|
2020-09-22 02:56:17 +02:00
|
|
|
void disable_player_shadow(void);
|
2020-10-29 17:08:00 +01:00
|
|
|
void move_player(s32 duration, f32 heading, f32 speed);
|
2020-09-22 02:56:17 +02:00
|
|
|
|
2020-08-16 06:24:20 +02:00
|
|
|
Npc* get_npc_safe(NpcId npcId);
|
|
|
|
Npc* get_npc_unsafe(NpcId npcId);
|
2020-08-16 07:13:03 +02:00
|
|
|
Npc* resolve_npc(ScriptInstance* script, NpcId npcIdOrPtr);
|
2020-08-19 02:31:39 +02:00
|
|
|
void set_npc_yaw(Npc* npcPtr, f32 angle);
|
2020-11-22 21:47:15 +01:00
|
|
|
void npc_move_heading(Npc* npc, f32 speed, f32 yaw);
|
2020-11-23 20:19:13 +01:00
|
|
|
void disable_npc_blur(Npc* npc);
|
2020-08-15 07:00:29 +02:00
|
|
|
|
2020-08-15 07:55:16 +02:00
|
|
|
f32 dist2D(f32 ax, f32 ay, f32 bx, f32 by);
|
|
|
|
f32 dist3D(f32 ax, f32 ay, f32 az, f32 bx, f32 by, f32 bz);
|
2020-08-15 16:26:43 +02:00
|
|
|
void add_vec2D_polar(f32* x, f32* y, f32 r, f32 theta);
|
2020-08-15 07:55:16 +02:00
|
|
|
|
2020-11-07 20:44:44 +01:00
|
|
|
s32 func_801499EC(s32 soundID, s32 arg1, f32 arg2, f32 arg3, f32 arg4);
|
2020-08-12 03:59:46 +02:00
|
|
|
s32 play_sound_at_position(s32 soundID, s32 value2, f32 posX, f32 posY, f32 posZ);
|
2020-10-29 02:38:25 +01:00
|
|
|
s32 set_music_track(s32 playerIndex, s32 songID, s32 variation, s32 fadeOutTime, s16 volume);
|
2020-11-20 15:44:08 +01:00
|
|
|
s32 func_8014AA54(s32 playerIndex, s32 arg1, s16 arg2);
|
2020-09-25 23:18:09 +02:00
|
|
|
|
2020-12-30 09:18:27 +01:00
|
|
|
void player_create_target_list(Actor* actor);
|
|
|
|
void enemy_create_target_list(Actor* actor);
|
|
|
|
|
|
|
|
void set_actor_yaw(ActorID actorID, s32 yaw);
|
|
|
|
void set_part_yaw(ActorID actorID, s32 partIndex, s32 value);
|
|
|
|
|
|
|
|
ActorPart* get_actor_part(Actor* actor, s32 partIndex);
|
|
|
|
|
|
|
|
void add_part_decoration(ActorPart* part, s32 decorationIndex, DecorationId decorationType);
|
|
|
|
void add_actor_decoration(Actor* actor, s32 decorationIndex, DecorationId decorationType);
|
|
|
|
void remove_part_decoration(ActorPart* part, s32 decorationIndex);
|
|
|
|
void remove_actor_decoration(Actor* actor, s32 decorationIndex);
|
|
|
|
|
|
|
|
s32 heroes_is_ability_active(Actor* actor, Ability ability);
|
|
|
|
|
|
|
|
void create_part_shadow(ActorID actorID, s32 partIndex);
|
|
|
|
void remove_part_shadow(ActorID actorID, s32 partIndex);
|
|
|
|
void create_part_shadow_by_ref(UNK_TYPE arg0, ActorPart* part); // arg0 unused
|
2020-09-25 23:18:09 +02:00
|
|
|
|
|
|
|
ScriptInstance* get_script_by_index(s32 index);
|
|
|
|
|
2020-10-13 03:28:01 +02:00
|
|
|
void suspend_all_group(s32 groupFlags);
|
|
|
|
void kill_script(ScriptInstance* instanceToKill);
|
2021-01-20 16:42:05 +01:00
|
|
|
void exec_entity_updatecmd(Entity* entity);
|
2020-10-13 03:28:01 +02:00
|
|
|
|
2020-12-30 08:03:05 +01:00
|
|
|
void func_802D7460(f32 x, f32 y, f32 z, s32 arg3);
|
|
|
|
void func_802D74C0(f32 x, f32 y, f32 z, s32 arg3);
|
|
|
|
|
2020-07-18 02:47:33 +02:00
|
|
|
#endif
|