Overlay 2 bss reorg (#733)

* cleanup + almost done with _use_partner_ability

* _use_partner_ability and bss bonanza

* gCameras fix

* cleanup

* cleanup
This commit is contained in:
Ethan Roseman 2022-06-13 12:34:22 -04:00 committed by GitHub
parent d65d58af35
commit e39f5874f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
66 changed files with 947 additions and 1655 deletions

View File

@ -108,6 +108,13 @@ typedef struct DmaTable {
/* 0x08 */ s32 dmaDest; /* 0x08 */ s32 dmaDest;
} DmaTable; } DmaTable;
typedef struct UseItemStruct {
/* 0x00 */ u8* dmaStart;
/* 0x04 */ u8* dmaEnd;
/* 0x08 */ EvtScript* script;
/* 0x0C */ s32 unk_0C;
} UseItemStruct;
typedef struct PartnerData { typedef struct PartnerData {
/* 0x00 */ u8 enabled; /* 0x00 */ u8 enabled;
/* 0x01 */ s8 level; /* 0x01 */ s8 level;
@ -1436,22 +1443,17 @@ typedef struct ShopSellPriceData {
} ShopSellPriceData; // size = 0xC } ShopSellPriceData; // size = 0xC
typedef struct GameStatus { typedef struct GameStatus {
/* 0x000 */ u32 currentButtons; /* 0x000 */ u32 currentButtons[2];
/* 0x004 */ u32 altCurrentButtons; /* input used for batte when flag 80000 set */
/* 0x008 */ char unk_08[8]; /* 0x008 */ char unk_08[8];
/* 0x010 */ u32 pressedButtons; /* bits = 1 for frame of button press */ /* 0x010 */ u32 pressedButtons[2]; /* bits = 1 for frame of button press */
/* 0x014 */ u32 altPressedButtons; /* input used for batte when flag 80000 set */
/* 0x018 */ char unk_18[8]; /* 0x018 */ char unk_18[8];
/* 0x020 */ u32 heldButtons; /* bits = 1 every 4th frame during hold */ /* 0x020 */ u32 heldButtons[2]; /* bits = 1 every 4th frame during hold */
/* 0x024 */ u32 altHeldButtons; /* input used for batte when flag 80000 set */
/* 0x028 */ char unk_28[8]; /* 0x028 */ char unk_28[8];
/* 0x030 */ u32 prevButtons; /* from previous frame */ /* 0x030 */ u32 prevButtons; /* from previous frame */
/* 0x034 */ char unk_34[12]; /* 0x034 */ char unk_34[12];
/* 0x040 */ s8 stickX; /* with deadzone */ /* 0x040 */ s8 stickX[2]; /* with deadzone */
/* 0x041 */ s8 altStickX; /* input used for batte when flag 80000 set */
/* 0x042 */ char unk_42[2]; /* 0x042 */ char unk_42[2];
/* 0x044 */ s8 stickY; /* with deadzone */ /* 0x044 */ s8 stickY[2]; /* with deadzone */
/* 0x045 */ s8 altStickY; /* input used for batte when flag 80000 set */
/* 0x046 */ char unk_46[2]; /* 0x046 */ char unk_46[2];
/* 0x048 */ s16 unk_48[4]; /* 0x048 */ s16 unk_48[4];
/* 0x050 */ s16 unk_50[4]; /* 0x050 */ s16 unk_50[4];

View File

@ -189,6 +189,7 @@ void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32* screenX, s32* screen
void parent_collider_to_model(s16 colliderID, s16 modelIndex); void parent_collider_to_model(s16 colliderID, s16 modelIndex);
void clone_model(u16 srcModelID, u16 newModelID); void clone_model(u16 srcModelID, u16 newModelID);
struct Model* get_model_from_list_index(s32 listIndex); struct Model* get_model_from_list_index(s32 listIndex);
s32 create_model_animator(s16* animPos);
s32 get_model_list_index_from_tree_index(s32 treeIndex); s32 get_model_list_index_from_tree_index(s32 treeIndex);
s32 get_transform_group_index(s32); s32 get_transform_group_index(s32);
void get_model_center_and_size(u16 modelID, f32* centerX, f32* centerY, f32* centerZ, f32* sizeX, f32* sizeY, void get_model_center_and_size(u16 modelID, f32* centerX, f32* centerY, f32* centerZ, f32* sizeX, f32* sizeY,
@ -532,7 +533,7 @@ char* int_to_string(s32, char*, s32);
Evt* get_script_by_index(s32 index); Evt* get_script_by_index(s32 index);
Evt* get_script_by_id(s32 id); Evt* get_script_by_id(s32 id);
s32 partner_test_enemy_collision(s32 arg0); s32 partner_test_enemy_collision(Npc* enemy);
s32 get_lava_reset_pos(f32* x, f32* y, f32* z); s32 get_lava_reset_pos(f32* x, f32* y, f32* z);
void start_rumble(s32, s32); void start_rumble(s32, s32);

View File

@ -1,226 +0,0 @@
#ifndef _EVT_FUNCS_H_
#define _EVT_FUNCS_H_
f32 evt_fixed_var_to_float(Bytecode scriptVar);
Bytecode evt_float_to_fixed_var(f32 value);
ApiStatus evt_handle_return(Evt* script);
ApiStatus evt_handle_label(Evt* script);
ApiStatus evt_handle_goto(Evt* script);
ApiStatus evt_handle_loop(Evt* script);
ApiStatus evt_handle_end_loop(Evt* script);
ApiStatus evt_handle_break_loop(Evt* script);
ApiStatus evt_handle_wait(Evt* script);
ApiStatus evt_handle_wait_seconds(Evt* script);
ApiStatus evt_handle_if_equal(Evt* script);
ApiStatus evt_handle_if_not_equal(Evt* script);
ApiStatus evt_handle_if_less(Evt* script);
ApiStatus evt_handle_if_greater(Evt* script);
ApiStatus evt_handle_if_less_equal(Evt* script);
ApiStatus evt_handle_if_greater_equal(Evt* script);
ApiStatus evt_handle_if_AND(Evt* script);
ApiStatus evt_handle_if_not_AND(Evt* script);
ApiStatus evt_handle_else(Evt* script);
ApiStatus evt_handle_end_if(Evt* script);
ApiStatus evt_handle_switch(Evt* script);
ApiStatus evt_handle_switch_const(Evt* script);
ApiStatus evt_handle_case_equal(Evt* script);
ApiStatus evt_handle_case_not_equal(Evt* script);
ApiStatus evt_handle_case_less(Evt* script);
ApiStatus evt_handle_case_less_equal(Evt* script);
ApiStatus evt_handle_case_greater(Evt* script);
ApiStatus evt_handle_case_greater_equal(Evt* script);
ApiStatus evt_handle_case_range(Evt* script);
ApiStatus evt_handle_case_default(Evt* script);
ApiStatus evt_handle_case_AND(Evt* script);
ApiStatus evt_handle_case_equal_OR(Evt* script);
ApiStatus evt_handle_case_equal_AND(Evt* script);
ApiStatus evt_handle_end_case_group(Evt* script);
ApiStatus evt_handle_break_case(Evt* script);
ApiStatus evt_handle_end_switch(Evt* script);
ApiStatus evt_handle_set_var(Evt* script);
ApiStatus evt_handle_set_const(Evt* script);
ApiStatus evt_handle_set_float(Evt* script);
ApiStatus evt_handle_add(Evt* script);
ApiStatus evt_handle_subtract(Evt* script);
ApiStatus evt_handle_multiply(Evt* script);
ApiStatus evt_handle_divide(Evt* script);
ApiStatus evt_handle_mod(Evt* script);
ApiStatus evt_handle_addF(Evt* script);
ApiStatus evt_handle_subtractF(Evt* script);
ApiStatus evt_handle_multiplyF(Evt* script);
ApiStatus evt_handle_divideF(Evt* script);
ApiStatus evt_handle_set_int_buffer_ptr(Evt* script);
ApiStatus evt_handle_set_float_buffer_ptr(Evt* script);
ApiStatus evt_handle_get_1_word(Evt* script);
ApiStatus evt_handle_get_2_word(Evt* script);
ApiStatus evt_handle_get_3_word(Evt* script);
ApiStatus evt_handle_get_4_word(Evt* script);
ApiStatus evt_handle_get_Nth_word(Evt* script);
ApiStatus evt_handle_get_1_float(Evt* script);
ApiStatus evt_handle_get_2_float(Evt* script);
ApiStatus evt_handle_get_3_float(Evt* script);
ApiStatus evt_handle_get_4_float(Evt* script);
ApiStatus evt_handle_get_Nth_float(Evt* script);
ApiStatus evt_handle_set_array(Evt* script);
ApiStatus evt_handle_set_flag_array(Evt* script);
ApiStatus evt_handle_allocate_array(Evt* script);
ApiStatus evt_handle_AND(Evt* script);
ApiStatus evt_handle_AND_const(Evt* script);
ApiStatus evt_handle_OR(Evt* script);
ApiStatus evt_handle_OR_const(Evt* script);
ApiStatus evt_handle_call(Evt* script);
ApiStatus evt_handle_exec1(Evt* script);
ApiStatus evt_handle_exec1_get_id(Evt* script);
ApiStatus evt_handle_exec_wait(Evt* script);
ApiStatus evt_handle_jump(Evt* script);
s32 evt_trigger_on_activate_exec_script(Trigger* trigger);
ApiStatus evt_handle_bind(Evt* script);
ApiStatus DeleteTrigger(Evt* script, s32 isInitialCall);
ApiStatus evt_handle_unbind(Evt* script);
ApiStatus evt_handle_kill(Evt* script);
ApiStatus evt_handle_set_priority(Evt* script);
ApiStatus evt_handle_set_timescale(Evt* script);
ApiStatus evt_handle_set_group(Evt* script);
ApiStatus evt_handle_suspend_all(Evt* script);
ApiStatus evt_handle_resume_all(Evt* script);
ApiStatus evt_handle_suspend_others(Evt* script);
ApiStatus evt_handle_resume_others(Evt* script);
ApiStatus evt_handle_suspend(Evt* script);
ApiStatus evt_handle_resume(Evt* script);
ApiStatus evt_handle_does_script_exist(Evt* script);
void evt_trigger_on_activate_lock(Trigger* trigger);
ApiStatus evt_handle_bind_lock(Evt* script);
ApiStatus evt_handle_thread(Evt* script);
ApiStatus evt_handle_end_thread(Evt* script);
ApiStatus evt_handle_child_thread(Evt* script);
ApiStatus evt_handle_end_child_thread(Evt* script);
ApiStatus func_802C6E14(Evt* script);
ApiStatus evt_handle_print_debug_var(Evt* script);
ApiStatus func_802C739C(Evt* script);
ApiStatus func_802C73B0(Evt* script);
s32 func_802C73B8(Evt* script);
s32 evt_execute_next_command(Evt *script);
s32 evt_get_variable(Evt* script, Bytecode var);
s32 evt_get_variable_index(Evt* script, s32 var);
s32 evt_get_variable_index_alt(s32 var);
s32 evt_set_variable(Evt* script, Bytecode var, s32 value);
f32 evt_get_float_variable(Evt* script, Bytecode var);
f32 evt_set_float_variable(Evt* script, Bytecode var, s32 value);
Bytecode* evt_find_label(Evt* script, s32 arg1);
Bytecode* evt_skip_if(Evt* script);
Bytecode* evt_skip_else(Evt* script);
Bytecode* evt_goto_end_case(Evt* script);
Bytecode* evt_goto_next_case(Evt* script);
Bytecode* evt_goto_end_loop(Evt* script);
#endif

View File

@ -7,11 +7,6 @@
#include "macros.h" #include "macros.h"
#include "enums.h" #include "enums.h"
extern UiStatus gUIStatus;
extern PlayerData gPlayerData;
extern s8 gPlayerActionState;
extern s32 gPlayerAnimation;
extern PlayerStatus gPlayerStatus;
extern PlayerStatus* gPlayerStatusPtr; extern PlayerStatus* gPlayerStatusPtr;
extern CollisionStatus gCollisionStatus; extern CollisionStatus gCollisionStatus;
extern GameStatus gGameStatus; extern GameStatus gGameStatus;
@ -211,8 +206,6 @@ extern f32 D_8010C990;
extern s32 D_8010C978; extern s32 D_8010C978;
extern Vec3s btl_actorHomePositions[]; extern Vec3s btl_actorHomePositions[];
extern PartnerActionStatus gPartnerActionStatus; // something with partners
extern PlayerSpinState gPlayerSpinState; // sfx_play_sound state struct?
extern SaveData gCurrentSaveFile; extern SaveData gCurrentSaveFile;
@ -379,4 +372,10 @@ extern s32 D_802EC390[];
extern s32 D_802EC3B0[]; extern s32 D_802EC3B0[];
extern s32 D_802EC3D0[]; extern s32 D_802EC3D0[];
extern PartnerActionStatus gPartnerActionStatus; // something with partners
extern UiStatus gUIStatus;
extern PlayerStatus gPlayerStatus;
extern PlayerSpinState gPlayerSpinState;
extern PlayerData gPlayerData;
#endif #endif

View File

@ -217,8 +217,8 @@ void filemenu_update(void) {
} }
if (i >= ARRAY_COUNT(gWindows)) { if (i >= ARRAY_COUNT(gWindows)) {
filemenu_heldButtons = gGameStatusPtr->heldButtons; filemenu_heldButtons = gGameStatusPtr->heldButtons[0];
filemenu_pressedButtons = gGameStatusPtr->pressedButtons; filemenu_pressedButtons = gGameStatusPtr->pressedButtons[0];
} else { } else {
filemenu_heldButtons = 0; filemenu_heldButtons = 0;
filemenu_pressedButtons = 0; filemenu_pressedButtons = 0;

View File

@ -254,19 +254,19 @@ void btl_update(void) {
if (battleStatus->flags1 & BS_FLAGS1_80000 && gGameStatusPtr->unk_81 != 0) { if (battleStatus->flags1 & BS_FLAGS1_80000 && gGameStatusPtr->unk_81 != 0) {
s32 inputBitmask = battleStatus->inputBitmask; s32 inputBitmask = battleStatus->inputBitmask;
battleStatus->currentButtonsDown = gGameStatusPtr->altCurrentButtons & inputBitmask; battleStatus->currentButtonsDown = gGameStatusPtr->currentButtons[1] & inputBitmask;
battleStatus->currentButtonsPressed = gGameStatusPtr->altPressedButtons & inputBitmask; battleStatus->currentButtonsPressed = gGameStatusPtr->pressedButtons[1] & inputBitmask;
battleStatus->currentButtonsHeld = gGameStatusPtr->altHeldButtons & inputBitmask; battleStatus->currentButtonsHeld = gGameStatusPtr->heldButtons[1] & inputBitmask;
battleStatus->stickX = gGameStatusPtr->altStickX; battleStatus->stickX = gGameStatusPtr->stickX[1];
battleStatus->stickY = gGameStatusPtr->altStickY; battleStatus->stickY = gGameStatusPtr->stickY[1];
} else { } else {
s32 inputBitmask2 = battleStatus->inputBitmask; s32 inputBitmask2 = battleStatus->inputBitmask;
battleStatus->currentButtonsDown = gGameStatusPtr->currentButtons & inputBitmask2; battleStatus->currentButtonsDown = gGameStatusPtr->currentButtons[0] & inputBitmask2;
battleStatus->currentButtonsPressed = gGameStatusPtr->pressedButtons & inputBitmask2; battleStatus->currentButtonsPressed = gGameStatusPtr->pressedButtons[0] & inputBitmask2;
battleStatus->currentButtonsHeld = gGameStatusPtr->heldButtons & inputBitmask2; battleStatus->currentButtonsHeld = gGameStatusPtr->heldButtons[0] & inputBitmask2;
battleStatus->stickX = gGameStatusPtr->stickX; battleStatus->stickX = gGameStatusPtr->stickX[0];
battleStatus->stickY = gGameStatusPtr->stickY; battleStatus->stickY = gGameStatusPtr->stickY[0];
} }
} }

View File

@ -775,7 +775,7 @@ void btl_state_update_celebration(void) {
gBattleState2 = BATTLE_STATE2_UNK_10; gBattleState2 = BATTLE_STATE2_UNK_10;
break; break;
case BATTLE_STATE2_UNK_10: case BATTLE_STATE2_UNK_10:
if (gGameStatusPtr->pressedButtons & (BUTTON_A | BUTTON_B)) { if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B)) {
D_8029FB4C = 0; D_8029FB4C = 0;
} }
if (D_8029FB4C != 0) { if (D_8029FB4C != 0) {

View File

@ -735,9 +735,9 @@ void phys_update_standard(void) {
} }
if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW)) { if (!(playerStatus->flags & PLAYER_STATUS_FLAGS_CAMERA_DOESNT_FOLLOW)) {
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
} }
} }
@ -966,7 +966,7 @@ s32 func_800E0208(void) {
s32 ret = FALSE; s32 ret = FALSE;
if (gGameStatusPtr->disableScripts && if (gGameStatusPtr->disableScripts &&
(gGameStatusPtr->currentButtons & PLAYER_STATUS_FLAGS_10)) (gGameStatusPtr->currentButtons[0] & PLAYER_STATUS_FLAGS_10))
{ {
if (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE) { if (gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE) {
set_action_state(ACTION_STATE_IDLE); set_action_state(ACTION_STATE_IDLE);

View File

@ -4,11 +4,11 @@ void update_player_input(void) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
s32 inputBufPos = playerStatus->inputBufPos; s32 inputBufPos = playerStatus->inputBufPos;
playerStatus->stickAxis[0] = gGameStatusPtr->stickX; playerStatus->stickAxis[0] = gGameStatusPtr->stickX[0];
playerStatus->stickAxis[1] = gGameStatusPtr->stickY; playerStatus->stickAxis[1] = gGameStatusPtr->stickY[0];
playerStatus->currentButtons = gGameStatusPtr->currentButtons; playerStatus->currentButtons = gGameStatusPtr->currentButtons[0];
playerStatus->pressedButtons = gGameStatusPtr->pressedButtons; playerStatus->pressedButtons = gGameStatusPtr->pressedButtons[0];
playerStatus->heldButtons = gGameStatusPtr->heldButtons; playerStatus->heldButtons = gGameStatusPtr->heldButtons[0];
inputBufPos++; inputBufPos++;
if (inputBufPos >= 10) { if (inputBufPos >= 10) {
@ -22,7 +22,7 @@ void update_player_input(void) {
playerStatus->heldButtonsBuffer[inputBufPos] = playerStatus->heldButtons; playerStatus->heldButtonsBuffer[inputBufPos] = playerStatus->heldButtons;
playerStatus->inputBufPos = inputBufPos; playerStatus->inputBufPos = inputBufPos;
if (playerStatus->flags & 0x3000) { if (playerStatus->flags & (PLAYER_STATUS_FLAGS_INPUT_DISABLED | PLAYER_STATUS_FLAGS_1000)) {
playerStatus->stickAxis[0] = 0; playerStatus->stickAxis[0] = 0;
playerStatus->stickAxis[1] = 0; playerStatus->stickAxis[1] = 0;
playerStatus->currentButtons = 0; playerStatus->currentButtons = 0;
@ -31,7 +31,7 @@ void update_player_input(void) {
} }
if (playerStatus->animFlags & 8) { if (playerStatus->animFlags & 8) {
playerStatus->animFlags |= 0x200000; playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_200000;
playerStatus->pressedButtons |= 4; playerStatus->pressedButtons |= 4;
} }
} }
@ -114,9 +114,9 @@ void reset_player_status(void) {
} }
} }
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
phys_reset_spin_history(mapConfig); phys_reset_spin_history(mapConfig);
mem_clear(&gPlayerSpinState, sizeof(gPlayerSpinState)); mem_clear(&gPlayerSpinState, sizeof(gPlayerSpinState));
@ -158,8 +158,8 @@ void player_input_to_move_vector(f32* angle, f32* magnitude) {
void game_input_to_move_vector(f32* outAngle, f32* outMagnitude) { void game_input_to_move_vector(f32* outAngle, f32* outMagnitude) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
f32 stickX = gGameStatusPtr->stickX; f32 stickX = gGameStatusPtr->stickX[0];
f32 stickY = -gGameStatusPtr->stickY; f32 stickY = -gGameStatusPtr->stickY[0];
f32 maxRadius = 70.0f; f32 maxRadius = 70.0f;
f32 magnitude; f32 magnitude;
f32 angle; f32 angle;

View File

@ -540,9 +540,9 @@ void collision_main_lateral(void) {
playerStatus->extraVelocity.y != 0.0f || playerStatus->extraVelocity.y != 0.0f ||
playerStatus->extraVelocity.z != 0.0f) playerStatus->extraVelocity.z != 0.0f)
{ {
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
if (playerStatus->alpha1 != 128) { if (playerStatus->alpha1 != 128) {
collision_check_player_intersecting_world(0, 0, collision_check_player_intersecting_world(0, 0,
atan2(0.0f, 0.0f, playerStatus->extraVelocity.x, playerStatus->extraVelocity.z)); atan2(0.0f, 0.0f, playerStatus->extraVelocity.x, playerStatus->extraVelocity.z));
@ -559,9 +559,9 @@ void collision_main_lateral(void) {
playerStatus->extraVelocity.y != 0.0f || playerStatus->extraVelocity.y != 0.0f ||
playerStatus->extraVelocity.z != 0.0f) playerStatus->extraVelocity.z != 0.0f)
{ {
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
} }
if (playerStatus->extraVelocity.x != 0.0f || if (playerStatus->extraVelocity.x != 0.0f ||
playerStatus->extraVelocity.y != 0.0f || playerStatus->extraVelocity.y != 0.0f ||
@ -579,9 +579,9 @@ void collision_main_lateral(void) {
playerStatus->extraVelocity.y != 0.0f || playerStatus->extraVelocity.y != 0.0f ||
playerStatus->extraVelocity.z != 0.0f) playerStatus->extraVelocity.z != 0.0f)
{ {
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
} }
playerX = playerStatus->position.x; playerX = playerStatus->position.x;
@ -668,9 +668,9 @@ void collision_main_lateral(void) {
playerStatus->extraVelocity.y != 0.0f || playerStatus->extraVelocity.y != 0.0f ||
playerStatus->extraVelocity.z != 0.0f) playerStatus->extraVelocity.z != 0.0f)
{ {
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
} }
playerX = playerStatus->position.x; playerX = playerStatus->position.x;

View File

@ -175,7 +175,7 @@ void check_input_status_menu(void) {
if (playerStatus->actionState != ACTION_STATE_RIDE) { if (playerStatus->actionState != ACTION_STATE_RIDE) {
pressedButtons = playerStatus->pressedButtons; pressedButtons = playerStatus->pressedButtons;
} else { } else {
pressedButtons = gGameStatusPtr->pressedButtons; pressedButtons = gGameStatusPtr->pressedButtons[0];
} }
if (!is_status_menu_visible()) { if (!is_status_menu_visible()) {

View File

@ -437,16 +437,16 @@ s32 popup_menu_update(void) {
} else { } else {
D_8010D64C = D_8010D648; D_8010D64C = D_8010D648;
if (gGameStatusPtr->heldButtons & (BUTTON_STICK_UP | BUTTON_Z) && if (gGameStatusPtr->heldButtons[0] & (BUTTON_STICK_UP | BUTTON_Z) &&
(D_8010D648 > 0 || (gGameStatusPtr->pressedButtons & 0x12000))) (D_8010D648 > 0 || (gGameStatusPtr->pressedButtons[0] & 0x12000)))
{ {
do { do {
D_8010D648--; D_8010D648--;
} while (0); // required to match } while (0); // required to match
} }
if (gGameStatusPtr->heldButtons & (BUTTON_STICK_DOWN | BUTTON_R) && if (gGameStatusPtr->heldButtons[0] & (BUTTON_STICK_DOWN | BUTTON_R) &&
((D_8010D648 < gPopupMenu->numEntries - 1) || (gGameStatusPtr->pressedButtons & (BUTTON_STICK_DOWN | BUTTON_R)))) ((D_8010D648 < gPopupMenu->numEntries - 1) || (gGameStatusPtr->pressedButtons[0] & (BUTTON_STICK_DOWN | BUTTON_R))))
{ {
do { do {
D_8010D648++; D_8010D648++;
@ -486,7 +486,7 @@ s32 popup_menu_update(void) {
D_8010D655 = D_8010D654 + D_8010D68F; D_8010D655 = D_8010D654 + D_8010D68F;
} }
if (gGameStatusPtr->pressedButtons & 0x8000) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
switch (gPopupMenu->popupType) { switch (gPopupMenu->popupType) {
case 8: case 8:
sfx_play_sound(SOUND_MENU_NEXT); sfx_play_sound(SOUND_MENU_NEXT);
@ -559,7 +559,7 @@ s32 popup_menu_update(void) {
break; break;
} }
if (gGameStatusPtr->pressedButtons & buttons) { if (gGameStatusPtr->pressedButtons[0] & buttons) {
sfx_play_sound(SOUND_MENU_BACK); sfx_play_sound(SOUND_MENU_BACK);
if (D_8010D698 != 0) { if (D_8010D698 != 0) {
if (D_8010D68E == 0) { if (D_8010D68E == 0) {
@ -589,7 +589,7 @@ s32 popup_menu_update(void) {
break; break;
} }
if (D_8010D68E != 0 && (gGameStatusPtr->pressedButtons & buttons)) { if (D_8010D68E != 0 && (gGameStatusPtr->pressedButtons[0] & buttons)) {
sfx_play_sound(SOUND_MENU_BACK); sfx_play_sound(SOUND_MENU_BACK);
D_8010D640 = -6; D_8010D640 = -6;
break; break;
@ -700,7 +700,7 @@ s32 popup_menu_update(void) {
D_8010D640 = 0x20; D_8010D640 = 0x20;
return 0; return 0;
case 32: case 32:
if (gGameStatusPtr->pressedButtons & (BUTTON_A | BUTTON_B | BUTTON_C_RIGHT)) { if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B | BUTTON_C_RIGHT)) {
D_8010D644 = 0; D_8010D644 = 0;
} }
if (D_8010D644 != 0) { if (D_8010D644 != 0) {

View File

@ -2,7 +2,7 @@
s32 func_802B7000_2(void) { s32 func_802B7000_2(void) {
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus; PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
s8 actionState = gPlayerActionState; s8 actionState = gPlayerStatus.actionState;
if (actionState != ACTION_STATE_USE_TWEESTER) { if (actionState != ACTION_STATE_USE_TWEESTER) {
if (partnerActionStatus->partnerActionState != PARTNER_ACTION_USE || if (partnerActionStatus->partnerActionState != PARTNER_ACTION_USE ||

View File

@ -9,9 +9,9 @@
ApiStatus func_802429A0_EEFAA0(Evt* script, s32 isInitialCall) { ApiStatus func_802429A0_EEFAA0(Evt* script, s32 isInitialCall) {
script->varTable[0] = 0; script->varTable[0] = 0;
do {} while (0); do {} while (0);
if (gPlayerActionState == ACTION_STATE_GROUND_POUND) { if (gPlayerStatus.actionState == ACTION_STATE_GROUND_POUND) {
script->varTable[0] = 1; script->varTable[0] = 1;
} else if (gPlayerActionState == ACTION_STATE_ULTRA_POUND) { } else if (gPlayerStatus.actionState == ACTION_STATE_ULTRA_POUND) {
script->varTable[0] = 1; script->varTable[0] = 1;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;

View File

@ -1029,6 +1029,7 @@ void update_entity_inverse_rotation_matrix(Entity* entity);
void delete_entity(s32 entityIndex); void delete_entity(s32 entityIndex);
void delete_entity_and_unload_data(s32 entityIndex); void delete_entity_and_unload_data(s32 entityIndex);
void _delete_shadow(s32 shadowIndex); void _delete_shadow(s32 shadowIndex);
void func_80110F10(void);
s32 entity_get_collision_flags(Entity* entity); s32 entity_get_collision_flags(Entity* entity);
void entity_free_static_data(EntityBlueprint* data); void entity_free_static_data(EntityBlueprint* data);
void update_entity_shadow_position(Entity* entity); void update_entity_shadow_position(Entity* entity);
@ -1280,7 +1281,7 @@ void exec_entity_commandlist(Entity* entity) {
while (step_entity_commandlist(entity)); while (step_entity_commandlist(entity));
} }
void func_8010FD98(s32 arg0, s32 alpha) { void func_8010FD98(void* arg0, s32 alpha) {
if (alpha >= 255) { if (alpha >= 255) {
gDPSetRenderMode(gMasterGfxPos++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2); gDPSetRenderMode(gMasterGfxPos++, G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2);
gDPSetCombineMode(gMasterGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA); gDPSetCombineMode(gMasterGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
@ -1290,7 +1291,7 @@ void func_8010FD98(s32 arg0, s32 alpha) {
} }
} }
void func_8010FE44(s32 arg0) { void func_8010FE44(void* arg0) {
func_8010FD98(arg0, D_8014AFB0); func_8010FD98(arg0, D_8014AFB0);
} }
@ -1621,7 +1622,7 @@ s32 entity_get_collision_flags(Entity* entity) {
} }
flag = gCollisionStatus.currentWall; flag = gCollisionStatus.currentWall;
if (flag != -1 && (flag & COLLISION_WITH_ENTITY_BIT) && listIndex == (u8)flag && gPlayerStatusPtr->pressedButtons & 0x8000) { if (flag != -1 && (flag & COLLISION_WITH_ENTITY_BIT) && listIndex == (u8)flag && gPlayerStatusPtr->pressedButtons & BUTTON_A) {
entityFlags |= ENTITY_COLLISION_PLAYER_TOUCH_WALL; entityFlags |= ENTITY_COLLISION_PLAYER_TOUCH_WALL;
} }
@ -1654,7 +1655,7 @@ s32 test_player_entity_aabb(Entity* entity) {
} }
s32 is_player_action_state(s8 actionState) { s32 is_player_action_state(s8 actionState) {
return actionState == gPlayerActionState; return actionState == gPlayerStatus.actionState;
} }
void entity_set_render_script(Entity* entity, u32* commandList) { void entity_set_render_script(Entity* entity, u32* commandList) {
@ -1677,11 +1678,11 @@ void func_80110BF8(Entity* entity) {
void load_area_specific_entity_data(void) { void load_area_specific_entity_data(void) {
if (D_8015132C == 0) { if (D_8015132C == 0) {
if (gGameStatusPtr->areaID == AREA_JAN || gGameStatusPtr->areaID == AREA_IWA) { if (gGameStatusPtr->areaID == AREA_JAN || gGameStatusPtr->areaID == AREA_IWA) {
dma_copy(entity_jan_iwa_ROM_START, entity_jan_iwa_ROM_END, AREA_SPECIFIC_ENTITY_VRAM); dma_copy(entity_jan_iwa_ROM_START, entity_jan_iwa_ROM_END, (void*)AREA_SPECIFIC_ENTITY_VRAM);
} else if (gGameStatusPtr->areaID == AREA_SBK || gGameStatusPtr->areaID == AREA_OMO) { } else if (gGameStatusPtr->areaID == AREA_SBK || gGameStatusPtr->areaID == AREA_OMO) {
dma_copy(entity_sbk_omo_ROM_START, entity_sbk_omo_ROM_END, AREA_SPECIFIC_ENTITY_VRAM); dma_copy(entity_sbk_omo_ROM_START, entity_sbk_omo_ROM_END, (void*)AREA_SPECIFIC_ENTITY_VRAM);
} else { } else {
dma_copy(entity_default_ROM_START, entity_default_ROM_END, AREA_SPECIFIC_ENTITY_VRAM); dma_copy(entity_default_ROM_START, entity_default_ROM_END, (void*)AREA_SPECIFIC_ENTITY_VRAM);
} }
D_8015132C = 1; D_8015132C = 1;
@ -2399,7 +2400,7 @@ void state_render_frontUI(void) {
} }
// re-initialization needed - evidence of inlining? or just copy/pasting? // re-initialization needed - evidence of inlining? or just copy/pasting?
gameMode = &gMainGameState; gameMode = &gMainGameState[0];
for (i = 0; i < ARRAY_COUNT(gMainGameState); i++, gameMode++) { for (i = 0; i < ARRAY_COUNT(gMainGameState); i++, gameMode++) {
if (gameMode->flags != 0) { if (gameMode->flags != 0) {
if (!(gameMode->flags & 4)) { if (!(gameMode->flags & 4)) {

View File

@ -125,7 +125,7 @@ void func_802A928C_427CFC(void) {
} }
} }
if (battleStatus->currentButtonsPressed & 0x8000) { if (battleStatus->currentButtonsPressed & BUTTON_A) {
switch(actionCommandStatus->unk_64) { switch(actionCommandStatus->unk_64) {
case 0: { case 0: {
s32 fillOffset = battleStatus->unk_434[actionCommandStatus->unk_50] * 235 * 4; s32 fillOffset = battleStatus->unk_434[actionCommandStatus->unk_50] * 235 * 4;

View File

@ -147,7 +147,7 @@ void func_802A9378_422E48(void) {
actionCommandStatus->state = 11; actionCommandStatus->state = 11;
actionCommandStatus->unk_54 = actionCommandStatus->unk_52; actionCommandStatus->unk_54 = actionCommandStatus->unk_52;
case 11: case 11:
if ((battleStatus->unk_83 != 0) && ((battleStatus->currentButtonsPressed & 0x8000) != 0)) { if ((battleStatus->unk_83 != 0) && (battleStatus->currentButtonsPressed & BUTTON_A)) {
actionCommandStatus->barFillLevel += (battleStatus->unk_434[actionCommandStatus->unk_50] * 180 / 100); actionCommandStatus->barFillLevel += (battleStatus->unk_434[actionCommandStatus->unk_50] * 180 / 100);
} }
if (actionCommandStatus->barFillLevel >= 10000) { if (actionCommandStatus->barFillLevel >= 10000) {

View File

@ -128,7 +128,7 @@ void N(update)(void) {
if (((actionCommandStatus->unk_4E - temp_s0_3) - 2) <= 0) { if (((actionCommandStatus->unk_4E - temp_s0_3) - 2) <= 0) {
hud_element_set_script(actionCommandStatus->hudElements[0], &HES_AButtonDown); hud_element_set_script(actionCommandStatus->hudElements[0], &HES_AButtonDown);
} }
if (((battleStatus->currentButtonsPressed & 0x8000) != 0) && (actionCommandStatus->autoSucceed == 0)) { if ((battleStatus->currentButtonsPressed & BUTTON_A) && (actionCommandStatus->autoSucceed == 0)) {
actionCommandStatus->unk_60 = 1; actionCommandStatus->unk_60 = 1;
battleStatus->unk_86 = -1; battleStatus->unk_86 = -1;
} }
@ -158,7 +158,7 @@ void N(update)(void) {
} }
if (battleStatus->actionSuccess < 0) { if (battleStatus->actionSuccess < 0) {
if ((((battleStatus->currentButtonsPressed & 0x8000) != 0) && if (((battleStatus->currentButtonsPressed & BUTTON_A)&&
(actionCommandStatus->unk_60 == 0)) || (actionCommandStatus->unk_60 == 0)) ||
(actionCommandStatus->autoSucceed != 0)) { (actionCommandStatus->autoSucceed != 0)) {
battleStatus->actionSuccess = 1; battleStatus->actionSuccess = 1;

View File

@ -113,7 +113,7 @@ void func_802A91F8_425788(void) {
case 11: case 11:
btl_set_popup_duration(99); btl_set_popup_duration(99);
if (actionCommandStatus->unk_6A == 0) { if (actionCommandStatus->unk_6A == 0) {
if ((battleStatus->currentButtonsPressed & 0x8000) != 0) { if (battleStatus->currentButtonsPressed & BUTTON_A) {
actionCommandStatus->barFillLevel += battleStatus->unk_434[actionCommandStatus->unk_50]; actionCommandStatus->barFillLevel += battleStatus->unk_434[actionCommandStatus->unk_50];
} }
} else { } else {

View File

@ -58,88 +58,88 @@ BSS s16 D_8010CD12;
BSS char D_8010CD14[0xC]; BSS char D_8010CD14[0xC];
BSS s32 D_8010CD20; BSS s32 D_8010CD20;
BSS char D_8010CD24[0xC]; BSS char D_8010CD24[0xC];
BSS s32 D_8010CD30;
BSS s32 D_8010CD34; // Moved to partners.c
BSS s32 gPlayerMoveHistory; // BSS s32 D_8010CD30;
BSS char D_8010CD3C[0x27C]; // BSS s32 D_8010CD34;
BSS s32 gPlayerMoveHistoryIndex; // BSS s32 gPlayerMoveHistory;
BSS s32 D_8010CFBC; // BSS char D_8010CD3C[0x27C];
BSS s32 wPartnerTetherDistance; // BSS s32 gPlayerMoveHistoryIndex;
BSS s32 D_8010CFC4; // BSS s32 D_8010CFBC;
BSS s16 D_8010CFC8; // BSS s32 wPartnerTetherDistance;
BSS s16 D_8010CFCA; // BSS s32 D_8010CFC4;
BSS s16 D_8010CFCC; // BSS s16 D_8010CFC8;
BSS s16 D_8010CFCE; // BSS s16 D_8010CFCA;
BSS s32 D_8010CFD0; // BSS s16 D_8010CFCC;
BSS s32 wPartnerCurrentScript; // BSS s16 D_8010CFCE;
BSS s32 D_8010CFD8; // BSS s32 D_8010CFD0;
BSS s32 wPartnerCurrentScriptID; // BSS s32 wPartnerCurrentScript;
BSS s32 D_8010CFE0; // BSS s32 D_8010CFD8;
BSS s32 D_8010CFE4; // BSS s32 wPartnerCurrentScriptID;
BSS s32 D_8010CFE8; // BSS s32 D_8010CFE0;
BSS s32 wPartner; // BSS s32 D_8010CFE4;
BSS s32 D_8010CFF0; // BSS s32 D_8010CFE8;
BSS s32 D_8010CFF4; // BSS s32 wPartner;
BSS char D_8010CFF8[0x8]; // BSS s32 D_8010CFF0;
BSS s32 D_8010D000; // BSS s32 D_8010CFF4;
BSS char D_8010D004[0x63C]; // BSS char D_8010CFF8[0x8];
BSS s32 D_8010D640; // BSS s32 D_8010D000;
BSS s32 D_8010D644; // BSS char D_8010D004[0x63C];
BSS s32 D_8010D648; // BSS s32 D_8010D640;
BSS s32 D_8010D64C; // BSS s32 D_8010D644;
BSS s32 D_8010D650; // BSS s32 D_8010D648;
BSS s8 D_8010D654; // BSS s32 D_8010D64C;
BSS s8 D_8010D655; // BSS s32 D_8010D650;
BSS s16 D_8010D656; // BSS s8 D_8010D654;
BSS s16 D_8010D658; // BSS s8 D_8010D655;
BSS s16 D_8010D65A; // BSS s16 D_8010D656;
BSS s32 D_8010D65C; // BSS s16 D_8010D658;
BSS s32 D_8010D660; // BSS s16 D_8010D65A;
BSS s32 D_8010D664; // BSS s32 D_8010D65C;
BSS s32 D_8010D668; // BSS s32 D_8010D660;
BSS s32 D_8010D66C; // BSS s32 D_8010D664;
BSS s32 D_8010D670; // BSS s32 D_8010D668;
BSS s32 D_8010D674; // BSS s32 D_8010D66C;
BSS s32 D_8010D678; // BSS s32 D_8010D670;
BSS s16 D_8010D67C; // BSS s32 D_8010D674;
BSS s16 D_8010D67E; // BSS s32 D_8010D678;
BSS s16 D_8010D680; // BSS s16 D_8010D67C;
BSS s16 D_8010D682; // BSS s16 D_8010D67E;
BSS s16 D_8010D684; // BSS s16 D_8010D680;
BSS s16 D_8010D686; // BSS s16 D_8010D682;
BSS s16 D_8010D688; // BSS s16 D_8010D684;
BSS s16 D_8010D68A; // BSS s16 D_8010D686;
BSS s16 D_8010D68C; // BSS s16 D_8010D688;
BSS s8 D_8010D68E; // BSS s16 D_8010D68A;
BSS s8 D_8010D68F; // BSS s16 D_8010D68C;
BSS s8 D_8010D690; // BSS s8 D_8010D68E;
BSS s8 D_8010D691; // BSS s8 D_8010D68F;
BSS s8 D_8010D692; // BSS s8 D_8010D690;
BSS s8 D_8010D693; // BSS s8 D_8010D691;
BSS s32 D_8010D694; // BSS s8 D_8010D692;
BSS s8 D_8010D698; // BSS s8 D_8010D693;
BSS s8 D_8010D699; // BSS s32 D_8010D694;
BSS s16 D_8010D69A; // BSS s8 D_8010D698;
BSS s32 gPopupMenu; // BSS s8 D_8010D699;
BSS s32 D_8010D6A0; // BSS s16 D_8010D69A;
BSS s32 D_8010D6A4; // BSS s32 gPopupMenu;
BSS char D_8010D6A8[0x8]; // BSS s32 D_8010D6A0;
BSS char D_8010D6B0[0x1500]; // BSS s32 D_8010D6A4;
BSS char gPartnerActionStatus[0x360]; // BSS char D_8010D6A8[0x8];
BSS char gSpinHistoryPosY[0x18]; // BSS char D_8010D6B0[0x1500];
BSS char gSpinHistoryPosX[0x18]; // BSS char gPartnerActionStatus[0x360];
BSS char gSpinHistoryPosZ[0x18]; // BSS char gSpinHistoryPosY[0x18];
BSS char gUIStatus[0x3A]; // BSS char gSpinHistoryPosX[0x18];
BSS s16 D_8010EF92; // BSS char gSpinHistoryPosZ[0x18];
BSS char D_8010EF94[0x8]; // BSS char gUIStatus[0x3A];
BSS s8 D_8010EF9C; // BSS s16 D_8010EF92;
BSS s8 D_8010EF9D; // BSS char D_8010EF94[0x8];
BSS s8 D_8010EF9E; // BSS s8 D_8010EF9C;
BSS char D_8010EF9F; // BSS s8 D_8010EF9D;
BSS char D_8010EFA0[0x28]; // BSS s8 D_8010EF9E;
BSS s8 gPlayerStatus[0xB4]; // BSS char D_8010EF9F;
BSS s32 gPlayerActionState; // BSS char D_8010EFA0[0x28];
BSS s8 gPlayerAnimation[0x1D0]; // BSS s8 gPlayerStatus[0x288];
BSS s8 gPlayerSpinState[0x40]; // BSS s8 gPlayerSpinState[0x40];
BSS s8 gPlayerData[0x428]; // BSS s8 gPlayerData[0x428];
BSS s8 gSpinHistoryPosAngle[0x18]; // BSS s8 gSpinHistoryPosAngle[0x18];

View File

@ -2,10 +2,10 @@
ApiStatus N(IsAOrBPressed)(Evt* script, s32 isInitialCall) { ApiStatus N(IsAOrBPressed)(Evt* script, s32 isInitialCall) {
script->varTable[0] = FALSE; script->varTable[0] = FALSE;
if (gGameStatusPtr->pressedButtons & BUTTON_A) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
script->varTable[0] = TRUE; script->varTable[0] = TRUE;
} }
if (gGameStatusPtr->pressedButtons & BUTTON_B) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_B) {
script->varTable[0] = TRUE; script->varTable[0] = TRUE;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;

View File

@ -75,7 +75,7 @@ void cloud_trail_update(EffectInstance* effect) {
part->unk_1C = part->unk_28 + shim_sin_deg(part->unk_30) * 0.1; part->unk_1C = part->unk_28 + shim_sin_deg(part->unk_30) * 0.1;
part->unk_20 = part->unk_2C + shim_cos_deg(part->unk_30) * 0.1; part->unk_20 = part->unk_2C + shim_cos_deg(part->unk_30) * 0.1;
if (part->unk_04 == 0 && (part->lifetime == 5 && gPlayerActionState == ACTION_STATE_IDLE)) { if (part->unk_04 == 0 && (part->lifetime == 5 && gPlayerStatus.actionState == ACTION_STATE_IDLE)) {
part->lifetime++; part->lifetime++;
return; return;
} }

View File

@ -26,7 +26,7 @@ void func_E0012000(FlowerFXData* effect) {
} }
void func_E0012104(FlowerFXData* effect) { void func_E0012104(FlowerFXData* effect) {
if (effect->unk_04 == 0 && effect->unk_78 != 0.0f && gPlayerActionState == ACTION_STATE_IDLE) { if (effect->unk_04 == 0 && effect->unk_78 != 0.0f && gPlayerStatus.actionState == ACTION_STATE_IDLE) {
effect->unk_06++; effect->unk_06++;
return; return;
} }

View File

@ -201,8 +201,8 @@ void entity_GiantChest_open(Entity* entity) {
chest->state++; chest->state++;
if (chest->itemID != 0) { if (chest->itemID != 0) {
suggest_player_anim_setUnkFlag(0x6000C); suggest_player_anim_setUnkFlag(0x6000C);
sin_cos_rad((90.0f - gCameras->currentYaw) * TAU / 360.0f, &sinRight, &cosRight); sin_cos_rad((90.0f - gCameras[CAM_DEFAULT].currentYaw) * TAU / 360.0f, &sinRight, &cosRight);
sin_cos_rad((180.0f - gCameras->currentYaw) * TAU / 360.0f, &sinFwd, &cosFwd); sin_cos_rad((180.0f - gCameras[CAM_DEFAULT].currentYaw) * TAU / 360.0f, &sinFwd, &cosFwd);
horizontalOffset = 0.0f; horizontalOffset = 0.0f;
depthOffset = 4.0f; depthOffset = 4.0f;
//RadialFlowOut //RadialFlowOut

View File

@ -144,9 +144,9 @@ void func_802BB8D4_E2E204(Entity* entity) {
void func_802BB98C_E2E2BC(Entity* entity) { void func_802BB98C_E2E2BC(Entity* entity) {
structE2D730* data = (structE2D730*)entity->dataBuf.unk; structE2D730* data = (structE2D730*)entity->dataBuf.unk;
gCameras->targetPos.x = gPlayerStatus.position.x; gCameras[CAM_DEFAULT].targetPos.x = gPlayerStatus.position.x;
gCameras->targetPos.y = gPlayerStatus.position.y; gCameras[CAM_DEFAULT].targetPos.y = gPlayerStatus.position.y;
gCameras->targetPos.z = gPlayerStatus.position.z; gCameras[CAM_DEFAULT].targetPos.z = gPlayerStatus.position.z;
add_vec2D_polar(&gPlayerStatus.position.x, &gPlayerStatus.position.z, data->unk_08, data->unk_04.f); add_vec2D_polar(&gPlayerStatus.position.x, &gPlayerStatus.position.z, data->unk_08, data->unk_04.f);
} }

View File

@ -112,9 +112,9 @@ ApiStatus SetPlayerAnimation(Evt* script, s32 isInitialCall) {
do { } while (0); // Needed to match for some reason do { } while (0); // Needed to match for some reason
gPlayerAnimation = playerNpc->currentAnim.w; gPlayerStatus.anim = playerNpc->currentAnim.w;
if (gPlayerAnimation == shakeAnim) { if (gPlayerStatus.anim == shakeAnim) {
exec_ShakeCam1(0, 0, 2); exec_ShakeCam1(0, 0, 2);
} }
@ -453,7 +453,7 @@ ApiStatus SetPlayerFlagBits(Evt* script, s32 isInitialCall) {
ApiStatus GetPlayerActionState(Evt* script, s32 isInitialCall) { ApiStatus GetPlayerActionState(Evt* script, s32 isInitialCall) {
Bytecode outVar = *script->ptrReadPos; Bytecode outVar = *script->ptrReadPos;
evt_set_variable(script, outVar, gPlayerActionState); evt_set_variable(script, outVar, gPlayerStatus.actionState);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -473,7 +473,7 @@ ApiStatus GetPlayerPos(Evt* script, s32 isInitialCall) {
ApiStatus GetPlayerAnimation(Evt* script, s32 isInitialCall) { ApiStatus GetPlayerAnimation(Evt* script, s32 isInitialCall) {
Bytecode outVar = *script->ptrReadPos; Bytecode outVar = *script->ptrReadPos;
evt_set_variable(script, outVar, gPlayerAnimation); evt_set_variable(script, outVar, gPlayerStatus.anim);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
@ -579,10 +579,10 @@ ApiStatus UseExitHeading(Evt* script, s32 isInitialCall) {
} }
s32 func_802D23F8(void) { s32 func_802D23F8(void) {
if (gPlayerActionState == ACTION_STATE_IDLE || gPlayerActionState == ACTION_STATE_WALK || if (gPlayerStatus.actionState == ACTION_STATE_IDLE || gPlayerStatus.actionState == ACTION_STATE_WALK ||
gPlayerActionState == ACTION_STATE_RUN || gPlayerActionState == ACTION_STATE_LAND || gPlayerStatus.actionState == ACTION_STATE_RUN || gPlayerStatus.actionState == ACTION_STATE_LAND ||
gPlayerActionState == ACTION_STATE_STEP_DOWN_LAND || gPlayerActionState == ACTION_STATE_GROUND_POUND || gPlayerStatus.actionState == ACTION_STATE_STEP_DOWN_LAND || gPlayerStatus.actionState == ACTION_STATE_GROUND_POUND ||
gPlayerActionState == ACTION_STATE_ULTRA_POUND || gPlayerActionState == ACTION_STATE_SPIN) { gPlayerStatus.actionState == ACTION_STATE_ULTRA_POUND || gPlayerStatus.actionState == ACTION_STATE_SPIN) {
return TRUE; return TRUE;
} }
return FALSE; return FALSE;

View File

@ -4,11 +4,11 @@
extern OSContPad D_8009A5B8; extern OSContPad D_8009A5B8;
void func_800287F0(void) { void func_800287F0(void) {
gGameStatusPtr->currentButtons = 0; gGameStatusPtr->currentButtons[0] = 0;
gGameStatusPtr->pressedButtons = 0; gGameStatusPtr->pressedButtons[0] = 0;
gGameStatusPtr->heldButtons = 0; gGameStatusPtr->heldButtons[0] = 0;
gGameStatusPtr->stickX = 0; gGameStatusPtr->stickX[0] = 0;
gGameStatusPtr->stickY = 0; gGameStatusPtr->stickY[0] = 0;
gGameStatusPtr->prevButtons = 0; gGameStatusPtr->prevButtons = 0;
gGameStatusPtr->unk_50[0] = 4; gGameStatusPtr->unk_50[0] = 4;
gGameStatusPtr->unk_48[0] = 15; gGameStatusPtr->unk_48[0] = 15;

View File

@ -293,11 +293,11 @@ s32 _update_message(MessagePrintState* printer) {
if (printer->stateFlags & MSG_STATE_FLAG_80000) { if (printer->stateFlags & MSG_STATE_FLAG_80000) {
buttons = BUTTON_A | BUTTON_C_DOWN; buttons = BUTTON_A | BUTTON_C_DOWN;
} }
if ((buttons & gGameStatusPtr->pressedButtons) || (gGameStatusPtr->currentButtons & BUTTON_B)) { if ((buttons & gGameStatusPtr->pressedButtons[0]) || (gGameStatusPtr->currentButtons[0] & BUTTON_B)) {
printer->windowState = MSG_WINDOW_STATE_PRINTING; printer->windowState = MSG_WINDOW_STATE_PRINTING;
printer->currentPrintDelay = 0; printer->currentPrintDelay = 0;
printer->stateFlags |= 4; printer->stateFlags |= 4;
if (gGameStatusPtr->pressedButtons & (BUTTON_A | BUTTON_C_DOWN)) { if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_C_DOWN)) {
cond = TRUE; cond = TRUE;
sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0); sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0);
} else if (printer->srcBuffer[printer->srcBufferPos] != 0xFD) { } else if (printer->srcBuffer[printer->srcBufferPos] != 0xFD) {
@ -313,7 +313,7 @@ s32 _update_message(MessagePrintState* printer) {
{ {
sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0); sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0);
} }
} else if ((gGameStatusPtr->pressedButtons & BUTTON_Z) && } else if ((gGameStatusPtr->pressedButtons[0] & BUTTON_Z) &&
!(printer->stateFlags & MSG_STATE_FLAG_40000) && !(printer->stateFlags & MSG_STATE_FLAG_40000) &&
(printer->currentLine != 0)) (printer->currentLine != 0))
{ {
@ -325,13 +325,13 @@ s32 _update_message(MessagePrintState* printer) {
} }
break; break;
case MSG_WINDOW_STATE_C: case MSG_WINDOW_STATE_C:
if (gGameStatusPtr->pressedButtons & BUTTON_B) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_B) {
printer->windowState = MSG_WINDOW_STATE_B; printer->windowState = MSG_WINDOW_STATE_B;
printer->unk_4CC = 0; printer->unk_4CC = 0;
printer->unkArraySize = printer->currentLine; printer->unkArraySize = printer->currentLine;
printer->unk_4C8 = abs(printer->curLinePos - printer->lineEndPos[printer->unkArraySize]); printer->unk_4C8 = abs(printer->curLinePos - printer->lineEndPos[printer->unkArraySize]);
sfx_play_sound_with_params(SOUND_CC, 0, 0, 0); sfx_play_sound_with_params(SOUND_CC, 0, 0, 0);
} else if (gGameStatusPtr->pressedButtons & BUTTON_Z) { } else if (gGameStatusPtr->pressedButtons[0] & BUTTON_Z) {
if (printer->unkArraySize > 0) { if (printer->unkArraySize > 0) {
printer->windowState = MSG_WINDOW_STATE_B; printer->windowState = MSG_WINDOW_STATE_B;
printer->unk_4CC = 0; printer->unk_4CC = 0;
@ -340,7 +340,7 @@ s32 _update_message(MessagePrintState* printer) {
sfx_play_sound_with_params(SOUND_CD, 0, 0, 0); sfx_play_sound_with_params(SOUND_CD, 0, 0, 0);
} }
} else { } else {
if (gGameStatusPtr->pressedButtons & BUTTON_A) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
printer->windowState = MSG_WINDOW_STATE_B; printer->windowState = MSG_WINDOW_STATE_B;
printer->unk_4CC = 0; printer->unk_4CC = 0;
printer->unkArraySize++; printer->unkArraySize++;
@ -350,13 +350,13 @@ s32 _update_message(MessagePrintState* printer) {
} }
break; break;
case MSG_WINDOW_STATE_WAITING_FOR_CHOICE: case MSG_WINDOW_STATE_WAITING_FOR_CHOICE:
if (gGameStatusPtr->pressedButtons & BUTTON_A) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
printer->madeChoice = 1; printer->madeChoice = 1;
printer->windowState = MSG_WINDOW_STATE_PRINTING; printer->windowState = MSG_WINDOW_STATE_PRINTING;
printer->unkCounter = 0; printer->unkCounter = 0;
printer->stateFlags |= MSG_STATE_FLAG_20000; printer->stateFlags |= MSG_STATE_FLAG_20000;
sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0); sfx_play_sound_with_params(SOUND_MENU_NEXT, 0, 0, 0);
} else if (printer->cancelOption != 0xFF && (gGameStatusPtr->pressedButtons & BUTTON_B)) { } else if (printer->cancelOption != 0xFF && (gGameStatusPtr->pressedButtons[0] & BUTTON_B)) {
if (printer->cancelOption >= printer->maxOption) { if (printer->cancelOption >= printer->maxOption) {
printer->selectedOption = printer->currentOption; printer->selectedOption = printer->currentOption;
} else { } else {
@ -368,14 +368,14 @@ s32 _update_message(MessagePrintState* printer) {
printer->currentOption = printer->cancelOption; printer->currentOption = printer->cancelOption;
printer->stateFlags |= MSG_STATE_FLAG_20000; printer->stateFlags |= MSG_STATE_FLAG_20000;
sfx_play_sound_with_params(SOUND_MENU_BACK, 0, 0, 0); sfx_play_sound_with_params(SOUND_MENU_BACK, 0, 0, 0);
} else if (gGameStatusPtr->heldButtons & BUTTON_STICK_DOWN) { } else if (gGameStatusPtr->heldButtons[0] & BUTTON_STICK_DOWN) {
if (printer->currentOption != printer->maxOption - 1) { if (printer->currentOption != printer->maxOption - 1) {
printer->targetOption = printer->currentOption + 1; printer->targetOption = printer->currentOption + 1;
printer->windowState = MSG_WINDOW_STATE_SCROLLING_BACK; printer->windowState = MSG_WINDOW_STATE_SCROLLING_BACK;
printer->unkCounter = 1; printer->unkCounter = 1;
sfx_play_sound_with_params(SOUND_MENU_CHANGE_SELECTION, 0, 0, 0); sfx_play_sound_with_params(SOUND_MENU_CHANGE_SELECTION, 0, 0, 0);
} }
} else if (gGameStatusPtr->heldButtons & BUTTON_STICK_UP) { } else if (gGameStatusPtr->heldButtons[0] & BUTTON_STICK_UP) {
if (printer->currentOption != 0) { if (printer->currentOption != 0) {
printer->targetOption = printer->currentOption - 1; printer->targetOption = printer->currentOption - 1;
printer->windowState = MSG_WINDOW_STATE_SCROLLING_BACK; printer->windowState = MSG_WINDOW_STATE_SCROLLING_BACK;
@ -398,14 +398,14 @@ s32 _update_message(MessagePrintState* printer) {
} }
} else if (!(printer->stateFlags & MSG_STATE_FLAG_20) && } else if (!(printer->stateFlags & MSG_STATE_FLAG_20) &&
printer->windowState == 5 && printer->windowState == 5 &&
(gGameStatusPtr->pressedButtons & BUTTON_A)) (gGameStatusPtr->pressedButtons[0] & BUTTON_A))
{ {
printer->windowState = MSG_WINDOW_STATE_PRINTING; printer->windowState = MSG_WINDOW_STATE_PRINTING;
printer->currentPrintDelay = 0; printer->currentPrintDelay = 0;
printer->stateFlags |= MSG_STATE_FLAG_4; printer->stateFlags |= MSG_STATE_FLAG_4;
} }
if (printer->stateFlags & MSG_STATE_FLAG_4 && !(gGameStatusPtr->currentButtons & BUTTON_A)) { if (printer->stateFlags & MSG_STATE_FLAG_4 && !(gGameStatusPtr->currentButtons[0] & BUTTON_A)) {
printer->stateFlags &= ~MSG_STATE_FLAG_4; printer->stateFlags &= ~MSG_STATE_FLAG_4;
} }
@ -417,7 +417,7 @@ s32 _update_message(MessagePrintState* printer) {
switch (printer->windowState) { switch (printer->windowState) {
case MSG_WINDOW_STATE_PRINTING: case MSG_WINDOW_STATE_PRINTING:
if ((gGameStatusPtr->pressedButtons & BUTTON_A) | (gGameStatusPtr->currentButtons & BUTTON_B)) { if ((gGameStatusPtr->pressedButtons[0] & BUTTON_A) | (gGameStatusPtr->currentButtons[0] & BUTTON_B)) {
if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10)) && !cond) { if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10)) && !cond) {
printer->stateFlags |= MSG_STATE_FLAG_100; printer->stateFlags |= MSG_STATE_FLAG_100;
@ -434,7 +434,7 @@ s32 _update_message(MessagePrintState* printer) {
printer->currentPrintDelay = 0; printer->currentPrintDelay = 0;
} else if (!(printer->stateFlags & MSG_STATE_FLAG_4)) { } else if (!(printer->stateFlags & MSG_STATE_FLAG_4)) {
if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10)) && if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10)) &&
(gGameStatusPtr->currentButtons & BUTTON_A)) (gGameStatusPtr->currentButtons[0] & BUTTON_A))
{ {
phi_a1_3 = 6; phi_a1_3 = 6;
printer->currentPrintDelay = 0; printer->currentPrintDelay = 0;
@ -445,7 +445,7 @@ s32 _update_message(MessagePrintState* printer) {
} }
break; break;
case MSG_WINDOW_STATE_SCROLLING: case MSG_WINDOW_STATE_SCROLLING:
if (gGameStatusPtr->pressedButtons & (BUTTON_A | BUTTON_B)) { if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B)) {
if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10))) { if (!(printer->stateFlags & (MSG_STATE_FLAG_20 | MSG_STATE_FLAG_10))) {
printer->stateFlags |= MSG_STATE_FLAG_100; printer->stateFlags |= MSG_STATE_FLAG_100;
} }
@ -453,7 +453,7 @@ s32 _update_message(MessagePrintState* printer) {
printer->curLinePos += printer->unk_464; printer->curLinePos += printer->unk_464;
if ((printer->stateFlags & MSG_STATE_FLAG_100) || if ((printer->stateFlags & MSG_STATE_FLAG_100) ||
(!(printer->stateFlags & (MSG_STATE_FLAG_10 | MSG_STATE_FLAG_4)) && (!(printer->stateFlags & (MSG_STATE_FLAG_10 | MSG_STATE_FLAG_4)) &&
(gGameStatusPtr->currentButtons & BUTTON_A))) (gGameStatusPtr->currentButtons[0] & BUTTON_A)))
{ {
printer->curLinePos += 6; printer->curLinePos += 6;
} }

View File

@ -474,7 +474,7 @@ s32 func_800397E8(Npc* npc, f32 arg1) {
if (npc->flags & NPC_FLAG_JUMPING) { if (npc->flags & NPC_FLAG_JUMPING) {
npc->flags &= ~NPC_FLAG_1000; npc->flags &= ~NPC_FLAG_1000;
return 0; return FALSE;
} }
length = oldLength = fabsf(arg1) + 16; length = oldLength = fabsf(arg1) + 16;
@ -492,14 +492,14 @@ s32 func_800397E8(Npc* npc, f32 arg1) {
npc->pos.y = y; npc->pos.y = y;
npc->currentFloor = D_8010C97A; npc->currentFloor = D_8010C97A;
npc->flags |= NPC_FLAG_1000; npc->flags |= NPC_FLAG_1000;
return 1; return TRUE;
} }
} else { } else {
return 0; return FALSE;
} }
npc->flags &= ~NPC_FLAG_1000; npc->flags &= ~NPC_FLAG_1000;
return 0; return FALSE;
} }
void update_npcs(void) { void update_npcs(void) {

View File

@ -438,8 +438,8 @@ void pause_map_init(MenuPanel* tab) {
} }
void pause_map_handle_input(MenuPanel* tab) { void pause_map_handle_input(MenuPanel* tab) {
f32 xMovement = gGameStatusPtr->stickX * 0.05f; f32 xMovement = gGameStatusPtr->stickX[0] * 0.05f;
f32 yMovement = -gGameStatusPtr->stickY * 0.05f; f32 yMovement = -gGameStatusPtr->stickY[0] * 0.05f;
f32 gPauseMapTargetYPosTemp = gPauseMapTargetY; f32 gPauseMapTargetYPosTemp = gPauseMapTargetY;
f32 gPauseMapTargetXPosTemp = gPauseMapTargetX; f32 gPauseMapTargetXPosTemp = gPauseMapTargetX;
s32 xTemp; s32 xTemp;

View File

@ -31,8 +31,8 @@ void start_rumble(s32 freq, s32 nframes) {
} }
void update_max_rumble_duration(void) { void update_max_rumble_duration(void) {
if (rumbleButtons != gGameStatusPtr->currentButtons) { if (rumbleButtons != gGameStatusPtr->currentButtons[0]) {
rumbleButtons = gGameStatusPtr->currentButtons; rumbleButtons = gGameStatusPtr->currentButtons[0];
reset_max_rumble_duration(); reset_max_rumble_duration();
} }

View File

@ -74,7 +74,7 @@ void state_init_intro(void) {
void state_step_intro(void) { void state_step_intro(void) {
PlayerData* playerData = &gPlayerData; PlayerData* playerData = &gPlayerData;
u32 pressedButtons = gGameStatusPtr->pressedButtons; u32 pressedButtons = gGameStatusPtr->pressedButtons[0];
s32 i; s32 i;
if (gGameStatusPtr->creditsViewportMode != -1) { if (gGameStatusPtr->creditsViewportMode != -1) {
@ -198,7 +198,7 @@ void state_step_intro(void) {
} }
D_800A0954 = 255 - D_800A0958; D_800A0954 = 255 - D_800A0958;
gOverrideFlags &= ~GLOBAL_OVERRIDES_8; gOverrideFlags &= ~GLOBAL_OVERRIDES_8;
gCameras->flags &= ~0x2; gCameras[CAM_DEFAULT].flags &= ~0x2;
gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD; gOverrideFlags &= ~GLOBAL_OVERRIDES_DISABLE_RENDER_WORLD;
update_player(); update_player();
update_encounters(); update_encounters();

View File

@ -94,7 +94,7 @@ void state_step_pause(void) {
pause_handle_input(0, 0); pause_handle_input(0, 0);
D_800A0920--; D_800A0920--;
} else { } else {
pause_handle_input(gGameStatusPtr->pressedButtons, gGameStatusPtr->heldButtons); pause_handle_input(gGameStatusPtr->pressedButtons[0], gGameStatusPtr->heldButtons[0]);
} }
D_800A0922 = 0; D_800A0922 = 0;
break; break;

View File

@ -143,7 +143,7 @@ void state_init_title_screen(void) {
void state_step_title_screen(void) { void state_step_title_screen(void) {
s16* temp; s16* temp;
u32 pressedButtons = gGameStatusPtr->pressedButtons; u32 pressedButtons = gGameStatusPtr->pressedButtons[0];
set_curtain_scale(1.0f); set_curtain_scale(1.0f);
set_curtain_fade(0.0f); set_curtain_fade(0.0f);

View File

@ -224,7 +224,7 @@ void update_merlee_message(PopupMessage* popup) {
popup->unk_16 = 2; popup->unk_16 = 2;
break; break;
case 2: case 2:
if (gGameStatusPtr->pressedButtons & 0xC000) { if (gGameStatusPtr->pressedButtons[0] & 0xC000) {
popup->duration = 0; popup->duration = 0;
} }
if (popup->duration != 0) { if (popup->duration != 0) {

View File

@ -149,7 +149,7 @@ void update_triggers(void) {
if (listTrigger->flags.flags & TRIGGER_FLOOR_PRESS_A) { if (listTrigger->flags.flags & TRIGGER_FLOOR_PRESS_A) {
if ((listTrigger->location.colliderID != collisionStatus->currentFloor) || if ((listTrigger->location.colliderID != collisionStatus->currentFloor) ||
!(gGameStatusPtr->pressedButtons & BUTTON_A) || (gPlayerStatus.flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED)) { !(gGameStatusPtr->pressedButtons[0] & BUTTON_A) || (gPlayerStatus.flags & PLAYER_STATUS_FLAGS_INPUT_DISABLED)) {
continue; continue;
} }
} }

View File

@ -18,7 +18,7 @@ void func_802B6000_E27C90(void) {
playerStatus->gravityIntegrator[1] = -3.738f; playerStatus->gravityIntegrator[1] = -3.738f;
playerStatus->gravityIntegrator[2] = 0.8059f; playerStatus->gravityIntegrator[2] = 0.8059f;
playerStatus->gravityIntegrator[3] = -0.0987f; playerStatus->gravityIntegrator[3] = -0.0987f;
gCameras->moveFlags |= CAMERA_MOVE_FLAGS_1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_MOVE_FLAGS_1;
D_802B62B0 = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z); D_802B62B0 = atan2(playerStatus->position.x, playerStatus->position.z, playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z);
playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f; playerStatus->currentSpeed = get_xz_dist_to_player(playerStatus->lastGoodPosition.x, playerStatus->lastGoodPosition.z) / 18.0f;
subtract_hp(1); subtract_hp(1);

View File

@ -110,9 +110,9 @@ void func_802B60A4_E29514(void) {
playerStatus->position.x += sp10 * sp1C; playerStatus->position.x += sp10 * sp1C;
playerStatus->position.z -= sp14 * sp1C; playerStatus->position.z -= sp14 * sp1C;
} }
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
sp20 = func_802B6000_E29470(); sp20 = func_802B6000_E29470();
if (sp20 < 0 || !(sp20 & COLLISION_WITH_ENTITY_BIT)) { if (sp20 < 0 || !(sp20 & COLLISION_WITH_ENTITY_BIT)) {
playerStatus->currentStateTime = 20; playerStatus->currentStateTime = 20;
@ -122,7 +122,7 @@ void func_802B60A4_E29514(void) {
D_802B6EF0 = 1.6f; D_802B6EF0 = 1.6f;
playerStatus->flags |= 0x800000; playerStatus->flags |= 0x800000;
} }
if (gGameStatusPtr->pressedButtons & BUTTON_Z && !(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_Z && !(playerStatus->animFlags & (PLAYER_STATUS_ANIM_FLAGS_HOLDING_WATT | PLAYER_STATUS_ANIM_FLAGS_2))) {
suggest_player_anim_setUnkFlag(0x10007); suggest_player_anim_setUnkFlag(0x10007);
playerStatus->fallState = 3; playerStatus->fallState = 3;
playerStatus->currentStateTime = 30; playerStatus->currentStateTime = 30;
@ -147,9 +147,9 @@ void func_802B60A4_E29514(void) {
playerStatus->position.z += D_802B6ED8; playerStatus->position.z += D_802B6ED8;
collision_lava_reset_check_additional_overlaps(); collision_lava_reset_check_additional_overlaps();
playerStatus->position.y = player_check_collision_below(D_802B6EF0, &sp20); playerStatus->position.y = player_check_collision_below(D_802B6EF0, &sp20);
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
if (sp20 >= 0) { if (sp20 >= 0) {
playerStatus->flags &= ~0x100000; playerStatus->flags &= ~0x100000;
enable_player_input(); enable_player_input();
@ -181,9 +181,9 @@ void func_802B60A4_E29514(void) {
D_802B6EE8 += 8.0f; D_802B6EE8 += 8.0f;
playerStatus->position.y = D_802B6EF4 + sin_rad(clamp_angle(D_802B6EE8) * TAU / 360.0f) * 4.0f; playerStatus->position.y = D_802B6EF4 + sin_rad(clamp_angle(D_802B6EE8) * TAU / 360.0f) * 4.0f;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
if (playerStatus->currentStateTime != 0) { if (playerStatus->currentStateTime != 0) {
playerStatus->currentStateTime--; playerStatus->currentStateTime--;
D_802B6EE4 += 2.0f; D_802B6EE4 += 2.0f;
@ -210,9 +210,9 @@ void func_802B60A4_E29514(void) {
tempY = sin_rad(D_802B6EE0 * TAU / 360.0f) * 4.0f; tempY = sin_rad(D_802B6EE0 * TAU / 360.0f) * 4.0f;
playerStatus->position.y += tempY; playerStatus->position.y += tempY;
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
tempDistance = fabsf(dist2D(D_802BCE34, D_802BCE32, playerStatus->position.x, playerStatus->position.z)); tempDistance = fabsf(dist2D(D_802BCE34, D_802BCE32, playerStatus->position.x, playerStatus->position.z));
if (tempDistance > 40.0f) { if (tempDistance > 40.0f) {
if (D_802BCE30 + 30 < playerStatus->position.y) { if (D_802BCE30 + 30 < playerStatus->position.y) {
@ -247,9 +247,9 @@ void func_802B60A4_E29514(void) {
} else { } else {
playerStatus->fallState = 0xB; playerStatus->fallState = 0xB;
} }
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
break; break;
case 7: case 7:
if (++D_802B6EE4 >= 45.0f) { if (++D_802B6EE4 >= 45.0f) {

View File

@ -1113,7 +1113,7 @@ ApiStatus N(func_8024113C_BE8D1C)(Evt* script, s32 isInitialCall) {
} }
ApiStatus N(func_802412B0_BE8E90)(Evt* script, s32 isInitialCall) { ApiStatus N(func_802412B0_BE8E90)(Evt* script, s32 isInitialCall) {
return (gGameStatusPtr->pressedButtons >> 1) & ApiStatus_DONE2; return (gGameStatusPtr->pressedButtons[0] >> 1) & ApiStatus_DONE2;
} }
#include "world/common/SwitchToPartner.inc.c" #include "world/common/SwitchToPartner.inc.c"

View File

@ -3,7 +3,7 @@
ApiStatus N(func_80242940_CD4770)(Evt* script, s32 isInitialCall) { ApiStatus N(func_80242940_CD4770)(Evt* script, s32 isInitialCall) {
script->varTable[0] = 0; script->varTable[0] = 0;
do {} while (0); do {} while (0);
if (gPlayerActionState == ACTION_STATE_GROUND_POUND || gPlayerActionState == ACTION_STATE_ULTRA_POUND) { if (gPlayerStatus.actionState == ACTION_STATE_GROUND_POUND || gPlayerStatus.actionState == ACTION_STATE_ULTRA_POUND) {
script->varTable[0] = 1; script->varTable[0] = 1;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;

View File

@ -22,7 +22,7 @@ ApiStatus func_80240000_91B8E0(Evt* script, s32 isInitialCall) {
#include "world/common/enemy/CleftAI.inc.c" #include "world/common/enemy/CleftAI.inc.c"
ApiStatus func_80241060_91C940(Evt* script, s32 isInitialCall) { ApiStatus func_80241060_91C940(Evt* script, s32 isInitialCall) {
gCameras->unk_498 = 1.0f; gCameras[CAM_DEFAULT].unk_498 = 1.0f;
return ApiStatus_BLOCK; return ApiStatus_BLOCK;
} }

View File

@ -8,7 +8,7 @@ static char* N(exit_str_4) = "kmr_22";
static char* N(exit_str_5) = ""; static char* N(exit_str_5) = "";
ApiStatus func_80240000_9269F0(Evt* script, s32 isInitialCall) { ApiStatus func_80240000_9269F0(Evt* script, s32 isInitialCall) {
if (gGameStatusPtr->pressedButtons & (BUTTON_A | BUTTON_B)) { if (gGameStatusPtr->pressedButtons[0] & (BUTTON_A | BUTTON_B)) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} else { } else {
return ApiStatus_BLOCK; return ApiStatus_BLOCK;

View File

@ -38,7 +38,7 @@ ApiStatus func_802412E0_B85460(Evt* script, s32 isInitialCall) {
script->varTable[8] = -1; script->varTable[8] = -1;
if (((gPlayerStatus.position.x < ax1) || (ax2 < gPlayerStatus.position.x)) if (((gPlayerStatus.position.x < ax1) || (ax2 < gPlayerStatus.position.x))
&& ((gPlayerStatus.position.x < bx1) || (bx2 < gPlayerStatus.position.x))) { && ((gPlayerStatus.position.x < bx1) || (bx2 < gPlayerStatus.position.x))) {
script->varTable[8] = gGameStatusPtr->pressedButtons & BUTTON_A; script->varTable[8] = gGameStatusPtr->pressedButtons[0] & BUTTON_A;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -33,6 +33,6 @@ ApiStatus func_80242E54_C63B64(Evt* script, s32 isInitialCall) {
INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C63A10", func_80242EF8_C63C08); INCLUDE_ASM(s32, "world/area_kzn/kzn_03/C63A10", func_80242EF8_C63C08);
ApiStatus func_80243070_C63D80(Evt* script, s32 isInitialCall) { ApiStatus func_80243070_C63D80(Evt* script, s32 isInitialCall) {
script->varTable[8] = gGameStatusPtr->pressedButtons & BUTTON_A; script->varTable[8] = gGameStatusPtr->pressedButtons[0] & BUTTON_A;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -27,6 +27,6 @@ ApiStatus func_80240DE4_C77AC4(Evt* script, s32 isInitialCall) {
INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77A20", func_80240E88_C77B68); INCLUDE_ASM(s32, "world/area_kzn/kzn_09/C77A20", func_80240E88_C77B68);
ApiStatus func_80241000_C77CE0(Evt* script, s32 isInitialCall) { ApiStatus func_80241000_C77CE0(Evt* script, s32 isInitialCall) {
script->varTable[8] = gGameStatusPtr->pressedButtons & BUTTON_A; script->varTable[8] = gGameStatusPtr->pressedButtons[0] & BUTTON_A;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -81,7 +81,7 @@ void N(animate_and_draw_record)(void* renderData) {
case RECORD_STATE_VISIBLE: case RECORD_STATE_VISIBLE:
data->alpha = 255; data->alpha = 255;
data->curAlpha = 255; data->curAlpha = 255;
if (gGameStatusPtr->currentButtons & (BUTTON_A | BUTTON_B)) { if (gGameStatusPtr->currentButtons[0] & (BUTTON_A | BUTTON_B)) {
data->state = RECORD_START_HIDE; data->state = RECORD_START_HIDE;
} }
if (data->state != RECORD_START_HIDE) { if (data->state != RECORD_START_HIDE) {

View File

@ -523,7 +523,7 @@ ApiStatus N(RunMinigame)(Evt* script, s32 isInitialCall) {
break; break;
case BOX_STATE_FUZZY_GRAB: case BOX_STATE_FUZZY_GRAB:
gPlayerStatusPtr->anim = ANIM_RUN_PANIC; gPlayerStatusPtr->anim = ANIM_RUN_PANIC;
if (gGameStatusPtr->pressedButtons & BUTTON_A) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
data->mashProgress++; data->mashProgress++;
} }
if (data->mashProgress >= 12) { if (data->mashProgress >= 12) {

View File

@ -9,9 +9,9 @@ ApiStatus func_80240000_9A4650(Evt* script, s32 isInitialCall) {
stickX = 0; stickX = 0;
if (gCollisionStatus.pushingAgainstWall == COLLIDER_o84) { if (gCollisionStatus.pushingAgainstWall == COLLIDER_o84) {
stickX = gGameStatusPtr->stickX < 0; stickX = gGameStatusPtr->stickX[0] < 0;
} }
if ((gCollisionStatus.pushingAgainstWall == COLLIDER_o85) && (gGameStatusPtr->stickX > 0)) { if ((gCollisionStatus.pushingAgainstWall == COLLIDER_o85) && (gGameStatusPtr->stickX[0] > 0)) {
stickX = 2; stickX = 2;
} }

View File

@ -12,10 +12,10 @@ ApiStatus func_80242600_9B8F80(Evt* script, s32 isInitialCall) {
f32 posZ = evt_get_float_variable(script, *args++); f32 posZ = evt_get_float_variable(script, *args++);
f32 angle = evt_get_float_variable(script, *args++); f32 angle = evt_get_float_variable(script, *args++);
script->varTable[0] = ((posX + (sin_deg(clamp_angle(gCameras->currentYaw + angle + 270.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f; script->varTable[0] = ((posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 270.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f;
script->varTable[1] = ((posZ - (cos_deg(clamp_angle(gCameras->currentYaw + angle + 270.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f; script->varTable[1] = ((posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 270.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f;
script->varTable[2] = ((posX + (sin_deg(clamp_angle(gCameras->currentYaw + angle + 90.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f; script->varTable[2] = ((posX + (sin_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 90.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f;
script->varTable[3] = ((posZ - (cos_deg(clamp_angle(gCameras->currentYaw + angle + 90.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f; script->varTable[3] = ((posZ - (cos_deg(clamp_angle(gCameras[CAM_DEFAULT].currentYaw + angle + 90.0f)) * 1000.0f)) * 1024.0f) + -2.3e8f;
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -4,9 +4,9 @@
ApiStatus N(UnkFunc44)(Evt* script, s32 isInitialCall) { ApiStatus N(UnkFunc44)(Evt* script, s32 isInitialCall) {
script->varTable[0] = 0; script->varTable[0] = 0;
do {} while (0); do {} while (0);
if (gPlayerActionState == ACTION_STATE_GROUND_POUND) { if (gPlayerStatus.actionState == ACTION_STATE_GROUND_POUND) {
script->varTable[0] = 1; script->varTable[0] = 1;
} else if (gPlayerActionState == ACTION_STATE_ULTRA_POUND) { } else if (gPlayerStatus.actionState == ACTION_STATE_ULTRA_POUND) {
script->varTable[0] = 1; script->varTable[0] = 1;
} }
return ApiStatus_DONE2; return ApiStatus_DONE2;

View File

@ -20,8 +20,8 @@ ApiStatus N(Pipe_AwaitDownInput)(Evt* script, s32 isInitialCall) {
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }
stickX = abs(gGameStatusPtr->stickX); stickX = abs(gGameStatusPtr->stickX[0]);
stickY = gGameStatusPtr->stickY; stickY = gGameStatusPtr->stickY[0];
if (stickX != 0 || stickY != 0) { if (stickX != 0 || stickY != 0) {
if (atan2(0.0f, 0.0f, stickX, stickY) < 60.0f) { if (atan2(0.0f, 0.0f, stickX, stickY) < 60.0f) {

View File

@ -180,7 +180,7 @@ void func_802BD6DC_31842C(Npc* npc) {
} }
} }
s32 world_bombette_can_use_ability(void) { s32 world_bombette_can_use_ability(Npc* npc) {
if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) { if (gPartnerActionStatus.partnerActionState != PARTNER_ACTION_NONE) {
D_802BE934 = 1; D_802BE934 = 1;
return FALSE; return FALSE;
@ -188,7 +188,7 @@ s32 world_bombette_can_use_ability(void) {
return TRUE; return TRUE;
} }
s32 world_bombette_can_player_pause(void) { s32 world_bombette_can_player_pause(Npc* npc) {
return gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE; return gPartnerActionStatus.partnerActionState == PARTNER_ACTION_NONE;
} }

View File

@ -5,9 +5,9 @@
#include "script_api/map.h" #include "script_api/map.h"
void world_bombette_init(Npc*); void world_bombette_init(Npc*);
void world_bombette_test_first_strike(Npc*); s32 world_bombette_test_first_strike(Npc*, Npc*);
void world_bombette_can_use_ability(void); s32 world_bombette_can_use_ability(Npc* npc);
s32 world_bombette_can_player_pause(void); s32 world_bombette_can_player_pause(Npc* );
void world_bombette_pre_battle(Npc*); void world_bombette_pre_battle(Npc*);
extern EvtScript world_bombette_take_out; extern EvtScript world_bombette_take_out;

View File

@ -295,7 +295,7 @@ ApiStatus func_802BD638_31B658(Evt* script, s32 isInitialCall) {
kooper->moveToPos.y = playerStatus->position.y; kooper->moveToPos.y = playerStatus->position.y;
kooper->moveToPos.z = playerStatus->position.y + playerStatus->colliderHeight / 3; kooper->moveToPos.z = playerStatus->position.y + playerStatus->colliderHeight / 3;
playerStatus->flags |= PLAYER_STATUS_FLAGS_JUMPING; playerStatus->flags |= PLAYER_STATUS_FLAGS_JUMPING;
gCameras->moveFlags |= CAMERA_FLAGS_1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_FLAGS_1;
suggest_player_anim_clearUnkFlag(0x10007); suggest_player_anim_clearUnkFlag(0x10007);
D_802BEC60 = 0; D_802BEC60 = 0;
@ -352,7 +352,7 @@ ApiStatus func_802BD638_31B658(Evt* script, s32 isInitialCall) {
script->functionTemp[0] = 3; script->functionTemp[0] = 3;
D_802BEC60 = 0; D_802BEC60 = 0;
gCameras->moveFlags |= CAMERA_FLAGS_1; gCameras[CAM_DEFAULT].moveFlags |= CAMERA_FLAGS_1;
sfx_play_sound_at_npc(SOUND_283, 0, -4); sfx_play_sound_at_npc(SOUND_283, 0, -4);
sfx_play_sound_at_npc(SOUND_284, 0, -4); sfx_play_sound_at_npc(SOUND_284, 0, -4);
} }

View File

@ -5,7 +5,7 @@
#include "script_api/map.h" #include "script_api/map.h"
void world_kooper_init(Npc*); void world_kooper_init(Npc*);
void world_kooper_test_first_strike(Npc*); s32 world_kooper_test_first_strike(Npc*, Npc*);
void world_kooper_pre_battle(Npc*); void world_kooper_pre_battle(Npc*);
void world_kooper_post_battle(Npc*); void world_kooper_post_battle(Npc*);

View File

@ -181,7 +181,7 @@ void func_802BD6BC_32120C(f32* outAngle, f32* outMagnitude) {
PartnerActionStatus* lakilesterActionStatus = &gPartnerActionStatus; PartnerActionStatus* lakilesterActionStatus = &gPartnerActionStatus;
f32 stickX = lakilesterActionStatus->stickX; f32 stickX = lakilesterActionStatus->stickX;
f32 stickY = lakilesterActionStatus->stickY; f32 stickY = lakilesterActionStatus->stickY;
f32 angle = clamp_angle(atan2(0.0f, 0.0f, stickX, -stickY) + gCameras->currentYaw); f32 angle = clamp_angle(atan2(0.0f, 0.0f, stickX, -stickY) + gCameras[CAM_DEFAULT].currentYaw);
f32 magnitude = 0.0f; f32 magnitude = 0.0f;
if (dist2D(0.0f, 0.0f, stickX, -stickY) >= 1.0) { if (dist2D(0.0f, 0.0f, stickX, -stickY) >= 1.0) {
@ -389,7 +389,7 @@ void func_802BDDD8_321928(Npc* npc) {
if (npc_test_move_taller_with_slipping(npc->collisionChannel, &x, &y, &z, npc->collisionRadius, npc->yaw, if (npc_test_move_taller_with_slipping(npc->collisionChannel, &x, &y, &z, npc->collisionRadius, npc->yaw,
npc->collisionHeight, npc->collisionRadius) != 0) { npc->collisionHeight, npc->collisionRadius) != 0) {
collisionStatus->currentInspect = (partnerActionStatus->pressedButtons & 0x8000) ? D_8010C97A : -1; collisionStatus->currentInspect = (partnerActionStatus->pressedButtons & BUTTON_A) ? D_8010C97A : -1;
} }
if (moveSpeed != 0.0f) { if (moveSpeed != 0.0f) {
@ -993,9 +993,9 @@ ApiStatus func_802BF4F0_323040(Evt* script, s32 isInitialCall) {
break; break;
} }
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
switch (D_802BFF00) { switch (D_802BFF00) {
case 3: case 3:

View File

@ -384,9 +384,9 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) {
parakarry->pos.y = playerStatus->position.y + 32.0f; parakarry->pos.y = playerStatus->position.y + 32.0f;
} }
if (!(parakarry->flags & NPC_FLAG_4000)) { if (!(parakarry->flags & NPC_FLAG_4000)) {
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
if (D_802BEBC4 != 0) { if (D_802BEBC4 != 0) {
D_802BEBC4--; D_802BEBC4--;
} else { } else {
@ -491,9 +491,9 @@ ApiStatus func_802BD660_319BD0(Evt* evt, s32 isInitialCall) {
if (!phys_adjust_cam_on_landing()) { if (!phys_adjust_cam_on_landing()) {
gCameras[0].moveFlags &= ~CAMERA_MOVE_FLAGS_2; gCameras[0].moveFlags &= ~CAMERA_MOVE_FLAGS_2;
} }
gCameras->targetPos.x = playerStatus->position.x; gCameras[CAM_DEFAULT].targetPos.x = playerStatus->position.x;
gCameras->targetPos.y = playerStatus->position.y; gCameras[CAM_DEFAULT].targetPos.y = playerStatus->position.y;
gCameras->targetPos.z = playerStatus->position.z; gCameras[CAM_DEFAULT].targetPos.z = playerStatus->position.z;
if (!(parakarry->flags & NPC_FLAG_4000)) { if (!(parakarry->flags & NPC_FLAG_4000)) {
parakarry->duration++; parakarry->duration++;
if (!(parakarry->planarFlyDist < 100.0f)) { if (!(parakarry->planarFlyDist < 100.0f)) {

View File

@ -57,7 +57,7 @@ void func_802BD20C_31DF7C(f32* arg0, f32* arg1) {
D_802BFDB0_320B20 = temp_f0; D_802BFDB0_320B20 = temp_f0;
D_802BFDB4_320B24 = temp_f2; D_802BFDB4_320B24 = temp_f2;
temp_f22 = clamp_angle(atan2(0.0f, 0.0f, temp_f0, -temp_f2) + gCameras->currentYaw); temp_f22 = clamp_angle(atan2(0.0f, 0.0f, temp_f0, -temp_f2) + gCameras[CAM_DEFAULT].currentYaw);
phi_f20 = 0.0f; phi_f20 = 0.0f;
if (dist2D(0.0f, 0.0f, D_802BFDB0_320B20, -D_802BFDB4_320B24) >= 1.0) { if (dist2D(0.0f, 0.0f, D_802BFDB0_320B20, -D_802BFDB4_320B24) >= 1.0) {

View File

@ -1,6 +1,85 @@
#include "common.h" #include "common_structs.h"
#include "ld_addrs.h"
#include "partners.h" #include "partners.h"
#include "macros.h"
// BSS
BSS s32 D_8010CD34;
BSS PlayerPathElement gPlayerMoveHistory[40];
BSS s32 gPlayerMoveHistoryIndex;
BSS s32 D_8010CFBC;
BSS f32 wPartnerTetherDistance;
BSS s32 D_8010CFC4;
BSS s16 D_8010CFC8;
BSS s16 D_8010CFCA;
BSS s16 D_8010CFCC;
BSS s16 D_8010CFCE;
BSS s32 D_8010CFD0;
BSS Evt* wPartnerCurrentScript;
BSS s32 D_8010CFD8;
BSS s32 wPartnerCurrentScriptID;
BSS s32 D_8010CFE0;
BSS s32 D_8010CFE4;
BSS s32 D_8010CFE8;
BSS WorldPartner* wPartner;
BSS s32 D_8010CFF0;
BSS s32 D_8010CFF4;
BSS char D_8010CFF8[0x8];
BSS s32 D_8010D000;
BSS char D_8010D004[0x63C];
BSS s32 D_8010D640;
BSS s32 D_8010D644;
BSS s32 D_8010D648;
BSS s32 D_8010D64C;
BSS s32 D_8010D650;
BSS s8 D_8010D654;
BSS s8 D_8010D655;
BSS s16 D_8010D656;
BSS s16 D_8010D658;
BSS s16 D_8010D65A;
BSS s32 D_8010D65C;
BSS s32 D_8010D660;
BSS s32 D_8010D664;
BSS s32 D_8010D668;
BSS s32 D_8010D66C;
BSS s32 D_8010D670;
BSS s32 D_8010D674;
BSS s32 D_8010D678;
BSS s16 D_8010D67C;
BSS s16 D_8010D67E;
BSS s16 D_8010D680;
BSS s16 D_8010D682;
BSS s16 D_8010D684;
BSS s16 D_8010D686;
BSS s16 D_8010D688;
BSS s16 D_8010D68A;
BSS s16 D_8010D68C;
BSS s8 D_8010D68E;
BSS s8 D_8010D68F;
BSS s8 D_8010D690;
BSS s8 D_8010D691;
BSS s8 D_8010D692;
BSS s8 D_8010D693;
BSS s32 D_8010D694;
BSS s8 D_8010D698;
BSS s8 D_8010D699;
BSS s16 D_8010D69A;
BSS s32 gPopupMenu;
BSS s32 D_8010D6A0;
BSS s32 D_8010D6A4;
BSS char D_8010D6A8[0x8];
BSS char D_8010D6B0[0x1500];
BSS PartnerActionStatus gPartnerActionStatus;
BSS char gSpinHistoryPosY[0x18];
BSS char gSpinHistoryPosX[0x18];
BSS char gSpinHistoryPosZ[0x18];
BSS UiStatus gUIStatus;
BSS PlayerStatus gPlayerStatus;
BSS PlayerSpinState gPlayerSpinState;
BSS s8 D_8010F284[0xC];
BSS PlayerData gPlayerData;
BSS s8 gSpinHistoryPosAngle[0x18];
#include "ld_addrs.h"
#include "npc.h" #include "npc.h"
#include "hud_element.h" #include "hud_element.h"
@ -87,21 +166,14 @@ extern HudScript HES_StatusSPIncrement5;
extern HudScript HES_StatusSPIncrement6; extern HudScript HES_StatusSPIncrement6;
extern HudScript HES_StatusSPIncrement7; extern HudScript HES_StatusSPIncrement7;
extern f32 wPartnerTetherDistance;
extern s16 D_8010CFC8;
extern s16 D_8010CFCA;
extern s16 D_8010CFCE;
extern s32 D_802C0000; extern s32 D_802C0000;
extern s32 gPlayerMoveHistoryIndex;
extern s32 D_8010CFBC;
extern s16 D_8010CFCC;
extern PlayerPathElement gPlayerMoveHistory[40];
extern EvtScript D_802C05CC_32579C; extern EvtScript D_802C05CC_32579C;
s32 partner_is_idle(Npc* partner); s32 partner_is_idle(Npc* partner);
s32 world_partner_can_player_pause_default(Npc* partner); s32 world_partner_can_player_pause_default(Npc* partner);
void _use_partner_ability(void); void _use_partner_ability(void);
void partner_flying_follow_player(Npc*);
void partner_move_to_goal(Npc*, s32);
// Partner icons // Partner icons
HudScript* wPartnerHudScripts[] = { HudScript* wPartnerHudScripts[] = {
@ -134,7 +206,12 @@ s32 D_800F7FF4 = 4;
s32 D_800F7FF8 = 5; s32 D_800F7FF8 = 5;
s32 D_800F7FFC = 7; s32 D_800F7FFC = 7;
s32 D_800F8000[] = { 8, 0, 0, 0 }; s32 D_800F8000[] = { 8, 0, 0, 0 };
s32 UseItemDmaArgs[] = { _3251D0_ROM_START, _3251D0_ROM_END, (s32) D_802C05CC_32579C, 0x00000000 }; UseItemStruct UseItemDmaArgs = {
_3251D0_ROM_START,
_3251D0_ROM_END,
&D_802C05CC_32579C,
0
};
s32 D_800F8020 = 0; s32 D_800F8020 = 0;
s32 wPartnerMoveGoalX = 0; s32 wPartnerMoveGoalX = 0;
s32 wPartnerMoveGoalZ = 0; s32 wPartnerMoveGoalZ = 0;
@ -152,10 +229,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_goombario_VRAM, .dmaDest = &world_partner_goombario_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_goombario_init, .init = world_goombario_init,
.takeOut = world_goombario_take_out, .takeOut = &world_goombario_take_out,
.update = world_goombario_update, .update = &world_goombario_update,
.useAbility = world_goombario_use_ability, .useAbility = &world_goombario_use_ability,
.putAway = world_goombario_put_away, .putAway = &world_goombario_put_away,
.idle = NPC_ANIM_world_goombario_normal_idle, .idle = NPC_ANIM_world_goombario_normal_idle,
.canUseAbility = world_goombario_can_pause, .canUseAbility = world_goombario_can_pause,
.canPlayerPause = world_goombario_can_pause, .canPlayerPause = world_goombario_can_pause,
@ -168,10 +245,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_kooper_VRAM, .dmaDest = &world_partner_kooper_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_kooper_init, .init = world_kooper_init,
.takeOut = world_kooper_take_out, .takeOut = &world_kooper_take_out,
.update = world_kooper_update, .update = &world_kooper_update,
.useAbility = world_kooper_use_ability, .useAbility = &world_kooper_use_ability,
.putAway = world_kooper_put_away, .putAway = &world_kooper_put_away,
.idle = NPC_ANIM_world_kooper_normal_idle, .idle = NPC_ANIM_world_kooper_normal_idle,
.testFirstStrike = world_kooper_test_first_strike, .testFirstStrike = world_kooper_test_first_strike,
.canUseAbility = partner_is_idle, .canUseAbility = partner_is_idle,
@ -186,10 +263,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_bombette_VRAM, .dmaDest = &world_partner_bombette_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_bombette_init, .init = world_bombette_init,
.takeOut = world_bombette_take_out, .takeOut = &world_bombette_take_out,
.update = world_bombette_update, .update = &world_bombette_update,
.useAbility = world_bombette_use_ability, .useAbility = &world_bombette_use_ability,
.putAway = world_bombette_put_away, .putAway = &world_bombette_put_away,
.idle = NPC_ANIM_world_bombette_normal_idle, .idle = NPC_ANIM_world_bombette_normal_idle,
.testFirstStrike = world_bombette_test_first_strike, .testFirstStrike = world_bombette_test_first_strike,
.canUseAbility = world_bombette_can_use_ability, .canUseAbility = world_bombette_can_use_ability,
@ -203,10 +280,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_parakarry_VRAM, .dmaDest = &world_partner_parakarry_VRAM,
.isFlying = TRUE, .isFlying = TRUE,
.init = world_parakarry_init, .init = world_parakarry_init,
.takeOut = world_parakarry_take_out, .takeOut = &world_parakarry_take_out,
.update = world_parakarry_update, .update = &world_parakarry_update,
.useAbility = world_parakarry_use_ability, .useAbility = &world_parakarry_use_ability,
.putAway = world_parakarry_put_away, .putAway = &world_parakarry_put_away,
.idle = NPC_ANIM_world_parakarry_Palette_00_Anim_1, .idle = NPC_ANIM_world_parakarry_Palette_00_Anim_1,
.canPlayerPause = partner_is_idle, .canPlayerPause = partner_is_idle,
.preBattle = world_parakarry_pre_battle, .preBattle = world_parakarry_pre_battle,
@ -219,10 +296,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_goompa_VRAM, .dmaDest = &world_partner_goompa_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_goompa_init, .init = world_goompa_init,
.takeOut = world_goompa_take_out, .takeOut = &world_goompa_take_out,
.update = world_goompa_update, .update = &world_goompa_update,
.useAbility = world_goompa_use_ability, .useAbility = &world_goompa_use_ability,
.putAway = world_goompa_put_away, .putAway = &world_goompa_put_away,
.idle = NPC_ANIM_goompa_Palette_00_Anim_1, .idle = NPC_ANIM_goompa_Palette_00_Anim_1,
}, },
{ {
@ -232,15 +309,15 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_watt_VRAM, .dmaDest = &world_partner_watt_VRAM,
.isFlying = TRUE, .isFlying = TRUE,
.init = world_watt_init, .init = world_watt_init,
.takeOut = world_watt_take_out, .takeOut = &world_watt_take_out,
.update = world_watt_update, .update = &world_watt_update,
.useAbility = world_watt_use_ability, .useAbility = &world_watt_use_ability,
.putAway = world_watt_put_away, .putAway = &world_watt_put_away,
.idle = NPC_ANIM_world_watt_Palette_00_Anim_1, .idle = NPC_ANIM_world_watt_Palette_00_Anim_1,
.canPlayerPause = world_partner_can_player_pause_default, .canPlayerPause = world_partner_can_player_pause_default,
.preBattle = world_watt_pre_battle, .preBattle = world_watt_pre_battle,
.postBattle = world_watt_post_battle, .postBattle = world_watt_post_battle,
.whileRiding = world_watt_while_riding, .whileRiding = &world_watt_while_riding,
}, },
{ {
// Sushie // Sushie
@ -249,15 +326,15 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_sushie_VRAM, .dmaDest = &world_partner_sushie_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_sushie_init, .init = world_sushie_init,
.takeOut = world_sushie_take_out, .takeOut = &world_sushie_take_out,
.update = world_sushie_update, .update = &world_sushie_update,
.useAbility = world_sushie_use_ability, .useAbility = &world_sushie_use_ability,
.putAway = world_sushie_put_away, .putAway = &world_sushie_put_away,
.idle = NPC_ANIM_world_sushie_Palette_00_Anim_1, .idle = NPC_ANIM_world_sushie_Palette_00_Anim_1,
.canPlayerPause = world_partner_can_player_pause_default, .canPlayerPause = world_partner_can_player_pause_default,
.preBattle = world_sushie_pre_battle, .preBattle = world_sushie_pre_battle,
.postBattle = world_sushie_post_battle, .postBattle = world_sushie_post_battle,
.whileRiding = world_sushie_while_riding, .whileRiding = &world_sushie_while_riding,
}, },
{ {
// Lakilester // Lakilester
@ -266,15 +343,15 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_lakilester_VRAM, .dmaDest = &world_partner_lakilester_VRAM,
.isFlying = TRUE, .isFlying = TRUE,
.init = world_lakilester_init, .init = world_lakilester_init,
.takeOut = world_lakilester_take_out, .takeOut = &world_lakilester_take_out,
.update = world_lakilester_update, .update = &world_lakilester_update,
.useAbility = world_lakilester_use_ability, .useAbility = &world_lakilester_use_ability,
.putAway = world_lakilester_put_away, .putAway = &world_lakilester_put_away,
.idle = NPC_ANIM_world_lakilester_Palette_00_Anim_1, .idle = NPC_ANIM_world_lakilester_Palette_00_Anim_1,
.canPlayerPause = world_partner_can_player_pause_default, .canPlayerPause = world_partner_can_player_pause_default,
.preBattle = world_lakilester_pre_battle, .preBattle = world_lakilester_pre_battle,
.postBattle = world_lakilester_post_battle, .postBattle = world_lakilester_post_battle,
.whileRiding = world_lakilester_while_riding, .whileRiding = &world_lakilester_while_riding,
}, },
{ {
// Bow // Bow
@ -283,10 +360,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_bow_VRAM, .dmaDest = &world_partner_bow_VRAM,
.isFlying = TRUE, .isFlying = TRUE,
.init = world_bow_init, .init = world_bow_init,
.takeOut = world_bow_take_out, .takeOut = &world_bow_take_out,
.update = world_bow_update, .update = &world_bow_update,
.useAbility = world_bow_use_ability, .useAbility = &world_bow_use_ability,
.putAway = world_bow_put_away, .putAway = &world_bow_put_away,
.idle = NPC_ANIM_world_bow_Palette_00_Anim_1, .idle = NPC_ANIM_world_bow_Palette_00_Anim_1,
.canUseAbility = partner_is_idle, .canUseAbility = partner_is_idle,
.canPlayerPause = world_partner_can_player_pause_default, .canPlayerPause = world_partner_can_player_pause_default,
@ -299,10 +376,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_goombaria_VRAM, .dmaDest = &world_partner_goombaria_VRAM,
.isFlying = FALSE, .isFlying = FALSE,
.init = world_goombaria_init, .init = world_goombaria_init,
.takeOut = world_goombaria_take_out, .takeOut = &world_goombaria_take_out,
.update = world_goombaria_update, .update = &world_goombaria_update,
.useAbility = world_goombaria_use_ability, .useAbility = &world_goombaria_use_ability,
.putAway = world_goombaria_put_away, .putAway = &world_goombaria_put_away,
.idle = NPC_ANIM_goombaria_Palette_00_Anim_1, .idle = NPC_ANIM_goombaria_Palette_00_Anim_1,
.canUseAbility = partner_is_idle, .canUseAbility = partner_is_idle,
.canPlayerPause = partner_is_idle, .canPlayerPause = partner_is_idle,
@ -314,10 +391,10 @@ WorldPartner wPartners[12] = {
.dmaDest = &world_partner_twink_VRAM, .dmaDest = &world_partner_twink_VRAM,
.isFlying = TRUE, .isFlying = TRUE,
.init = world_twink_init, .init = world_twink_init,
.takeOut = world_twink_take_out, .takeOut = &world_twink_take_out,
.update = world_twink_update, .update = &world_twink_update,
.useAbility = world_twink_use_ability, .useAbility = &world_twink_use_ability,
.putAway = world_twink_put_away, .putAway = &world_twink_put_away,
.idle = NPC_ANIM_twink_Palette_00_Anim_1, .idle = NPC_ANIM_twink_Palette_00_Anim_1,
.canUseAbility = partner_is_idle, .canUseAbility = partner_is_idle,
.canPlayerPause = partner_is_idle, .canPlayerPause = partner_is_idle,
@ -329,29 +406,29 @@ f32 wSavedPartnerPosY = 0;
f32 wSavedPartnerPosZ = 0; f32 wSavedPartnerPosZ = 0;
PartnerAnimations gPartnerAnimations[] = { PartnerAnimations gPartnerAnimations[] = {
{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {{0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}},
{0x00010000, 0x00010002, 0x00010004, 0x00010005, 0x00010001, 0x00010001, 0x00010003, 0x00010008, 0x00010007}, {{0x00010000, 0x00010002, 0x00010004, 0x00010005, 0x00010001, 0x00010001, 0x00010003, 0x00010008, 0x00010007}},
{0x00020000, 0x00020004, 0x00020006, 0x00020007, 0x00020000, 0x00020003, 0x00020005, 0x0002000D, 0x0002000C}, {{0x00020000, 0x00020004, 0x00020006, 0x00020007, 0x00020000, 0x00020003, 0x00020005, 0x0002000D, 0x0002000C}},
{0x00030000, 0x00030005, 0x00030009, 0x0003000A, 0x00030000, 0x00030003, 0x00030007, 0x0003000E, 0x0003000D}, {{0x00030000, 0x00030005, 0x00030009, 0x0003000A, 0x00030000, 0x00030003, 0x00030007, 0x0003000E, 0x0003000D}},
{0x00040000, 0x00040002, 0x00040008, 0x00040002, 0x00040002, 0x00040001, 0x00040003, 0x00040006, 0x00040005}, {{0x00040000, 0x00040002, 0x00040008, 0x00040002, 0x00040002, 0x00040001, 0x00040003, 0x00040006, 0x00040005}},
{0x009D0000, 0x009D0002, 0x009D0004, 0x009D0005, 0x009D0001, 0x009D0001, 0x009D0003, 0x009D0008, 0x009D0001}, {{0x009D0000, 0x009D0002, 0x009D0004, 0x009D0005, 0x009D0001, 0x009D0001, 0x009D0003, 0x009D0008, 0x009D0001}},
{0x00060000, 0x00060002, 0x00060002, 0x00060002, 0x00060000, 0x00060001, 0x00060003, 0x00060004, 0x00060007}, {{0x00060000, 0x00060002, 0x00060002, 0x00060002, 0x00060000, 0x00060001, 0x00060003, 0x00060004, 0x00060007}},
{0x00070000, 0x00070002, 0x00070002, 0x00070002, 0x00070000, 0x00070001, 0x00070003, 0x00070004, 0x00070008}, {{0x00070000, 0x00070002, 0x00070002, 0x00070002, 0x00070000, 0x00070001, 0x00070003, 0x00070004, 0x00070008}},
{0x00080000, 0x00080005, 0x00080005, 0x00080005, 0x00080000, 0x00080001, 0x00080007, 0x00080009, 0x0008000A}, {{0x00080000, 0x00080005, 0x00080005, 0x00080005, 0x00080000, 0x00080001, 0x00080007, 0x00080009, 0x0008000A}},
{0x00050000, 0x00050002, 0x00050002, 0x00050002, 0x00050000, 0x00050001, 0x00050003, 0x00050004, 0x0005000C}, {{0x00050000, 0x00050002, 0x00050002, 0x00050002, 0x00050000, 0x00050001, 0x00050003, 0x00050004, 0x0005000C}},
{0x009E0000, 0x009E0005, 0x009E0012, 0x009E0013, 0x009E0001, 0x009E0001, 0x009E0007, 0x009E000B, 0x009E0001}, {{0x009E0000, 0x009E0005, 0x009E0012, 0x009E0013, 0x009E0001, 0x009E0001, 0x009E0007, 0x009E000B, 0x009E0001}},
{0x00200000, 0x00200001, 0x00200001, 0x00200001, 0x00200001, 0x00200001, 0x00200001, 0x00200009, 0x00200020}, {{0x00200000, 0x00200001, 0x00200001, 0x00200001, 0x00200001, 0x00200001, 0x00200001, 0x00200009, 0x00200020}},
}; };
s32 D_800F84F8 = 0; f32 D_800F84F8 = 0.0f;
s32 use_consumable(s32 invSlot) { s32 use_consumable(s32 invSlot) {
Evt* script; Evt* script;
D_8010CD20 = invSlot; D_8010CD20 = invSlot;
invSlot = gPlayerData.invItems[invSlot]; invSlot = gPlayerData.invItems[invSlot];
dma_copy(UseItemDmaArgs[0], UseItemDmaArgs[1], _3251D0_VRAM); dma_copy(UseItemDmaArgs.dmaStart, UseItemDmaArgs.dmaEnd, _3251D0_VRAM);
script = start_script(UseItemDmaArgs[2], EVT_PRIORITY_1, 0); script = start_script(UseItemDmaArgs.script, EVT_PRIORITY_1, 0);
script->varTable[10] = invSlot; script->varTable[10] = invSlot;
return script->id; return script->id;
} }
@ -404,27 +481,27 @@ s32 world_partner_can_player_pause_default(Npc* partner) {
s32 func_800EA52C(s32 arg0) { s32 func_800EA52C(s32 arg0) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
u32 playerActionState = playerStatus->actionState; u32 playerActionState = playerStatus->actionState;
s32 ret = 0; s32 ret = FALSE;
if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) { if (playerStatus->flags & PLAYER_STATUS_FLAGS_800) {
return 0; return FALSE;
} }
if (playerActionState < ACTION_STATE_JUMP) { if (playerActionState < ACTION_STATE_JUMP) {
ret = 1; ret = TRUE;
} }
if (arg0 == 9) { if (arg0 == 9) {
if (playerActionState == ACTION_STATE_RIDE) { if (playerActionState == ACTION_STATE_RIDE) {
ret = 1; ret = TRUE;
} }
} else if (arg0 == 4) { } else if (arg0 == 4) {
if ((playerActionState != ACTION_STATE_RIDE) && (playerActionState != ACTION_STATE_IDLE) && (playerActionState != ACTION_STATE_WALK)) { if ((playerActionState != ACTION_STATE_RIDE) && (playerActionState != ACTION_STATE_IDLE) && (playerActionState != ACTION_STATE_WALK)) {
if (playerActionState == ACTION_STATE_RUN) { if (playerActionState == ACTION_STATE_RUN) {
ret = 1; ret = TRUE;
} }
} else { } else {
ret = 1; ret = TRUE;
} }
} }
@ -435,8 +512,9 @@ s32 partner_is_flying(void) {
return !wPartner->isFlying; return !wPartner->isFlying;
} }
void func_800EA5B8(s32* arg0) { void func_800EA5B8(s32* partnerNpcFlags) {
*arg0 &= ~0x2007800; *partnerNpcFlags &= ~(NPC_FLAG_SIMPLIFIED_PHYSICS | NPC_FLAG_4000 | NPC_FLAG_NO_PROJECT_SHADOW | NPC_FLAG_1000 |
NPC_FLAG_JUMPING);
} }
void partner_create_npc(void) { void partner_create_npc(void) {
@ -483,7 +561,280 @@ void partner_free_npc(void) {
free_npc_by_index(D_8010CFD0); free_npc_by_index(D_8010CFD0);
} }
INCLUDE_ASM(s32, "world/partners", _use_partner_ability); void _use_partner_ability(void) {
static u32 D_8010CD30; // goes into BSS, needs to be static for the function to match
PlayerData* playerData = &gPlayerData;
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
PlayerStatus* playerStatus = &gPlayerStatus;
if (!partnerActionStatus->inputDisabled) {
partnerActionStatus->stickX = gGameStatusPtr->stickX[gGameStatusPtr->unk_81];
partnerActionStatus->stickY = gGameStatusPtr->stickY[gGameStatusPtr->unk_81];
partnerActionStatus->currentButtons = gGameStatusPtr->currentButtons[gGameStatusPtr->unk_81];
partnerActionStatus->pressedButtons = gGameStatusPtr->pressedButtons[gGameStatusPtr->unk_81];
partnerActionStatus->heldButtons = gGameStatusPtr->heldButtons[gGameStatusPtr->unk_81];
} else {
partnerActionStatus->stickX = 0;
partnerActionStatus->stickY = 0;
partnerActionStatus->currentButtons = 0;
partnerActionStatus->pressedButtons = 0;
partnerActionStatus->heldButtons = 0;
}
if (playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_4) {
playerStatus->animFlags &= ~PLAYER_STATUS_ANIM_FLAGS_4;
partnerActionStatus->pressedButtons |= BUTTON_B | BUTTON_C_DOWN;
playerStatus->animFlags |= PLAYER_STATUS_ANIM_FLAGS_40000000;
}
if (D_8010CFE8 != 0) {
D_8010CD30 = D_8010CFE8;
D_8010CD34 = 0;
D_8010CFE8 = 0;
}
if (D_8010CD30 >= 2) {
if (D_8010CD30 != 8) {
D_8010CFC4 = 0;
}
}
switch (D_8010CD30) {
case 0:
break;
case 3:
D_8010CFC4 = 3;
switch (D_8010CD34) {
case 0:
disable_player_input();
sfx_play_sound(SOUND_D);
kill_script_by_ID(wPartnerCurrentScriptID);
wPartnerCurrentScript = start_script(wPartner->putAway, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD34 += 1;
set_time_freeze_mode(1);
break;
case 1:
if (does_script_exist(wPartnerCurrentScriptID)) {
break;
}
set_time_freeze_mode(0);
partner_free_npc();
playerData->currentPartner = D_8010CFD8 = D_8010CFE4;
partner_create_npc();
sfx_play_sound(SOUND_E);
wPartner->init(wPartnerNpc);
D_8010CD34 += 1;
case 2:
wPartnerCurrentScript = start_script(wPartner->takeOut, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD34 += 1;
set_time_freeze_mode(1);
break;
case 3:
if (does_script_exist(wPartnerCurrentScriptID)) {
break;
}
wPartnerCurrentScript = start_script(wPartner->update, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD30 = 1;
enable_player_input();
set_time_freeze_mode(0);
break;
}
break;
case 2:
D_8010CFC4 = 3;
switch (D_8010CD34) {
case 0:
kill_script_by_ID(wPartnerCurrentScriptID);
D_8010CD34 += 1;
case 1:
partner_free_npc();
playerData->currentPartner = D_8010CFD8 = D_8010CFE4;
partner_create_npc();
wPartnerNpc->pos.x = wSavedPartnerPosX;
wPartnerNpc->pos.y = wSavedPartnerPosY;
wPartnerNpc->pos.z = wSavedPartnerPosZ;
wPartnerNpc->jumpVelocity = 0.0f;
wPartnerNpc->scale.x = 1.0f;
wPartnerNpc->scale.y = 1.0f;
wPartnerNpc->scale.z = 1.0f;
wPartner->init(wPartnerNpc);
D_8010CD34 += 1;
case 2:
D_8010CD34 += 1;
break;
case 3:
wPartnerCurrentScript = start_script(wPartner->update, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD30 = 1;
break;
}
break;
case 4:
switch (D_8010CD34) {
case 0:
disable_player_input();
sfx_play_sound(SOUND_D);
kill_script_by_ID(wPartnerCurrentScriptID);
wPartnerCurrentScript = start_script(wPartner->putAway, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD34 += 1;
break;
case 1:
if (does_script_exist(wPartnerCurrentScriptID)) {
break;
}
partner_free_npc();
D_8010CD30 = 1;
playerData->currentPartner = D_8010CFD8 = D_8010CFE4;
enable_player_input();
break;
}
break;
case 5:
if (D_8010CD34 == 0) {
kill_script_by_ID(wPartnerCurrentScriptID);
partner_free_npc();
D_8010CD30 = 1;
playerData->currentPartner = D_8010CFD8 = D_8010CFE4;
break;
}
break;
case 6:
switch (D_8010CD34) {
case 0:
disable_player_input();
playerData->currentPartner = D_8010CFD8 = D_8010CFE4;
partner_create_npc();
wPartner->init(wPartnerNpc);
D_8010CD34 += 1;
case 1:
wPartnerCurrentScript = start_script(wPartner->takeOut, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD34 += 1;
break;
case 2:
if (does_script_exist(wPartnerCurrentScriptID)) {
break;
}
wPartnerCurrentScript = start_script(wPartner->update, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD30 = 1;
enable_player_input();
break;
}
break;
case 7:
D_8010CFC4 = 2;
switch (D_8010CD34) {
case 0:
disable_player_input();
playerData->currentPartner = D_8010CFD8 = D_8010CFE4;
partner_create_npc();
wPartnerNpc->pos.x = wSavedPartnerPosX;
wPartnerNpc->pos.y = wSavedPartnerPosY;
wPartnerNpc->pos.z = wSavedPartnerPosZ;
wPartnerNpc->jumpVelocity = 0.0f;
wPartnerNpc->scale.x = 1.0f;
wPartnerNpc->scale.y = 1.0f;
wPartnerNpc->scale.z = 1.0f;
wPartner->init(wPartnerNpc);
D_8010CD34 += 1;
break;
case 1:
wPartnerCurrentScript = start_script(wPartner->update, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD30 = 1;
wPartnerNpc->currentAnim.w = gPartnerAnimations[D_8010CFD8].anims[4];
enable_player_input();
break;
}
break;
case 8:
switch (D_8010CD34) {
case 0:
kill_script_by_ID(wPartnerCurrentScriptID);
wPartnerCurrentScript = start_script(wPartner->useAbility, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD34 += 1;
break;
case 1:
if (does_script_exist(wPartnerCurrentScriptID)) {
break;
}
wPartnerCurrentScript = start_script(wPartner->update, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
D_8010CD30 = 1;
break;
}
break;
case 9:
D_8010CFC4 = 1;
switch (D_8010CD34) {
case 0:
disable_player_input();
wPartner->init(wPartnerNpc);
D_8010CD34 += 1;
case 1:
D_8010CD34 += 1;
break;
case 2:
if (partnerActionStatus->partnerActionState != 1) {
wSavedPartnerPosX = playerStatus->position.x;
wSavedPartnerPosY = playerStatus->position.y;
wSavedPartnerPosZ = playerStatus->position.z;
wPartnerCurrentScript = start_script(wPartner->update, 0x14, 0x20);
wPartnerCurrentScript->owner2.npc = wPartnerNpc;
wPartnerCurrentScriptID = wPartnerCurrentScript->id;
wPartnerCurrentScript->groupFlags = 0xA;
}
enable_player_input();
D_8010CD30 = 1;
break;
}
break;
case 10:
if (D_8010CD34 == 0) {
if (does_script_exist(wPartnerCurrentScriptID)) {
kill_script_by_ID(wPartnerCurrentScriptID);
}
D_8010CD34 += 1;
}
break;
case 1:
D_8010CD30 = 0;
D_8010CFE0 = 0;
if (D_8010CFC4 != 3) {
D_8010CFC4 = 0;
}
break;
}
}
static const f32 rodata_padding = 0.0f;
void switch_to_partner(s32 arg0) { void switch_to_partner(s32 arg0) {
PlayerStatus* playerStatus = &gPlayerStatus; PlayerStatus* playerStatus = &gPlayerStatus;
@ -626,14 +977,14 @@ void partner_initialize_data(void) {
wSavedPartnerPosZ = 0; wSavedPartnerPosZ = 0;
} }
s32 partner_test_enemy_collision(s32 arg0) { s32 partner_test_enemy_collision(Npc* enemy) {
if (D_8010CFD8 != 0 && wPartner->testFirstStrike != NULL) { if (D_8010CFD8 != 0 && wPartner->testFirstStrike != NULL) {
return wPartner->testFirstStrike(wPartnerNpc, arg0); return wPartner->testFirstStrike(wPartnerNpc, enemy);
} }
return FALSE; return FALSE;
} }
Bytecode* partner_get_ride_script(void) { EvtScript* partner_get_ride_script(void) {
WorldPartner* partner = wPartner; WorldPartner* partner = wPartner;
if (partner == NULL) { if (partner == NULL) {
@ -760,7 +1111,7 @@ void partner_walking_update_player_tracking(Npc* partner) {
s32 isPlayerJumping; s32 isPlayerJumping;
PlayerPathElement* currentSnapshot; PlayerPathElement* currentSnapshot;
if ((playerStatus->flags & 6) != 0) { if (playerStatus->flags & (PLAYER_STATUS_FLAGS_FALLING | PLAYER_STATUS_FLAGS_JUMPING)) {
isPlayerJumping = (playerStatus->actionState == ACTION_STATE_LAND || playerStatus->actionState == ACTION_STATE_STEP_DOWN) ^ 1; isPlayerJumping = (playerStatus->actionState == ACTION_STATE_LAND || playerStatus->actionState == ACTION_STATE_STEP_DOWN) ^ 1;
} else { } else {
isPlayerJumping = FALSE; isPlayerJumping = FALSE;
@ -884,7 +1235,87 @@ void partner_flying_update_player_tracking(Npc* partner) {
} }
} }
INCLUDE_ASM(void, "world/partners", partner_flying_update_motion, Npc* partner); void partner_flying_update_motion(Npc* partner) {
PlayerStatus* playerStatus = &gPlayerStatus;
PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus;
f32 x, y, z, hitDepth;
f32 var_f0;
f32 var_f2;
if (gGameStatusPtr->unk_81 == 0 ||
(playerStatus->flags & (PLAYER_STATUS_FLAGS_INPUT_DISABLED | PLAYER_STATUS_FLAGS_1000)) ||
partnerActionStatus->inputDisabled ||
partnerActionStatus->partnerAction_unk_2 != 0)
{
if (!(playerStatus->animFlags & PLAYER_STATUS_ANIM_FLAGS_800) || D_800F8020 == 0) {
partner_flying_follow_player(partner);
}
if (partnerActionStatus->pressedButtons & (BUTTON_B | BUTTON_Z | BUTTON_C_DOWN | BUTTON_C_LEFT)) {
partnerActionStatus->partnerAction_unk_2 = 0;
}
}
if (D_8010CFC8 != 50 && fabsf(partner->pos.y - playerStatus->position.y) > 1000.0f) {
partner->pos.x = playerStatus->position.x;
partner->pos.y = playerStatus->position.y;
partner->pos.z = playerStatus->position.z;
partner->jumpVelocity = 0.0f;
partner->jumpScale = 0.0f;
partner->flags &= ~NPC_FLAG_JUMPING;
}
D_800F8020 = 0;
x = partner->pos.x;
y = partner->pos.y + (partner->collisionHeight * 0.5f);
z = partner->pos.z;
hitDepth = partner->collisionHeight * 0.5f;
if (npc_raycast_up(0, &x, &y, &z, &hitDepth) != 0) {
D_800F8020 = 1;
wSavedPartnerPosX = partner->pos.x;
wSavedPartnerPosY = partner->pos.y;
wSavedPartnerPosZ = partner->pos.z;
} else {
partner_do_player_collision(partner);
if (D_8010CFC8 != 0x32) {
x = partner->pos.x;
y = partner->pos.y;
z = partner->pos.z;
hitDepth = 1000.0f;
if (npc_raycast_down_around(0x10000, &x, &y, &z, &hitDepth, partner->yaw, partner->collisionRadius) == 0) {
y = playerStatus->position.y;
}
if (partner->pos.y <= y + partner->collisionHeight + 2.0f) {
if (playerStatus->currentSpeed != 0.0f) {
D_800F84F8 = ((y + (partner->collisionHeight / 2) + 2.0f) - partner->pos.y) * 0.125f;
} else {
if (y < playerStatus->position.y) {
var_f0 = playerStatus->position.y + 10.0f - partner->pos.y;
} else {
var_f0 = y + 10.0f - partner->pos.y;
}
var_f2 = 0.25f;
D_800F84F8 = var_f0 * var_f2;
}
} else {
if (playerStatus->position.y + playerStatus->colliderHeight < y) {
D_800F84F8 = (y + partner->collisionHeight - partner->pos.y) * 0.125f;
if (partner->pos.y + D_800F84F8 <= y + partner->collisionHeight) {
D_800F84F8 = (y + partner->collisionHeight - partner->pos.y) * 0.25f;
}
} else {
var_f0 = (playerStatus->position.y + playerStatus->colliderHeight + 5.0f) - partner->pos.y;
var_f2 = 0.0625f;
D_800F84F8 = var_f0 * var_f2;
}
}
partner->pos.y += D_800F84F8;
}
wSavedPartnerPosX = partner->pos.x;
wSavedPartnerPosY = partner->pos.y;
wSavedPartnerPosZ = partner->pos.z;
}
}
INCLUDE_ASM(s32, "world/partners", partner_flying_follow_player); INCLUDE_ASM(s32, "world/partners", partner_flying_follow_player);
@ -959,19 +1390,140 @@ s32 partner_put_away(Npc* partner) {
partner->jumpVelocity = 0.0f; partner->jumpVelocity = 0.0f;
partner->pos.y = partner->moveToPos.y; partner->pos.y = partner->moveToPos.y;
disable_npc_blur(partner); disable_npc_blur(partner);
return 1; return TRUE;
} }
return 0; return FALSE;
} }
s32 partner_init_get_out(Npc* arg0) { s32 partner_init_get_out(Npc* npc) {
arg0->collisionChannel = 0x10000; npc->collisionChannel = 0x10000;
D_8010CFC8 = 0; D_8010CFC8 = 0;
arg0->flags |= 0x100; npc->flags |= NPC_FLAG_100;
return D_8010CFC8; return D_8010CFC8;
} }
INCLUDE_ASM(s32, "world/partners", partner_get_out); INCLUDE_ASM(s32, "world/partners", partner_get_out);
// s32 partner_get_out(Npc* npc) {
// PlayerStatus* playerStatus = &gPlayerStatus;
// Camera* camera = &gCameras[gCurrentCameraID];
// f32 sp20;
// f32 sp24;
// f32 sp28;
// f32 sp2C;
// f32 temp_f0_2;
// f32 temp_f12;
// f32 temp_f14;
// f32 temp_f2;
// f32 duration;
// f32 x, y, z;
// switch (D_8010CFC8) {
// case 0:
// if (clamp_angle(playerStatus->spriteFacingAngle) < 180.0f) {
// npc->yaw = clamp_angle(camera->currentYaw + 90.0f);
// } else {
// npc->yaw = clamp_angle(camera->currentYaw - 90.0f);
// }
// npc->moveToPos.x = playerStatus->position.x;
// npc->moveToPos.y = playerStatus->position.y;
// if (wPartner->isFlying) {
// npc->moveToPos.y = playerStatus->position.y;
// }
// npc->moveToPos.z = playerStatus->position.z;
// add_vec2D_polar(&npc->moveToPos.x, &npc->moveToPos.z, playerStatus->colliderDiameter, npc->yaw);
// x = npc->moveToPos.x;
// y = npc->moveToPos.y;
// z = npc->moveToPos.z;
// if (!wPartner->isFlying) {
// sp20 = x;
// sp28 = y + npc->collisionHeight;
// sp24 = z;
// add_vec2D_polar(&sp20, &sp24, 2.0f, gCameras[gCurrentCameraID].currentYaw);
// sp2C = 1000.0f;
// if (((npc_raycast_down_around(0x10000, &sp20, &sp28, &sp24, &sp2C, npc->yaw, npc->collisionRadius) == 0)) || ((u32) (get_collider_type_by_id(D_8010C978) - 2) < 2U) || (sp2C > 100.0f))
// {
// x = playerStatus->position.x;
// y = playerStatus->position.y;
// z = playerStatus->position.z;
// add_vec2D_polar(&sp20, &sp24, 2.0f, gCameras[gCurrentCameraID].currentYaw);
// }
// }
// temp_f12 = playerStatus->position.x;
// npc->pos.x = playerStatus->position.x;
// temp_f2 = playerStatus->position.y + (playerStatus->colliderHeight / 2);
// npc->pos.y = temp_f2;
// temp_f14 = playerStatus->position.z;
// sp20 = temp_f12;
// sp28 = temp_f2;
// npc->moveSpeed = 4.0f;
// npc->jumpScale = 1.2f;
// npc->pos.z = temp_f14;
// sp24 = temp_f14;
// npc->planarFlyDist = dist2D(temp_f12, temp_f14, x, z);
// npc->yaw = atan2(temp_f12, temp_f14, x, z);
// npc->duration = npc->planarFlyDist / npc->moveSpeed;
// if (npc->duration < 10) {
// npc->duration = 10;
// npc->moveSpeed = npc->planarFlyDist / 10.0f;
// }
// npc->jumpVelocity = (y - sp28 + ((npc->jumpScale * npc->duration) * npc->duration * 0.5f)) / npc->duration;
// D_8010CFC8 = 1;
// sp28 = y - sp28;
// npc->currentAnim.w = gPartnerAnimations[D_8010CFD8].anims[2];
// break;
// case 1:
// if (npc->jumpVelocity < 0.0f && func_800397E8(npc, fabsf(npc->jumpVelocity))) {
// D_8010CFC8 = 2;
// return 0;
// }
// npc->jumpVelocity -= npc->jumpScale;
// npc->pos.y += npc->jumpVelocity;
// if (npc->jumpVelocity <= 0.0f) {
// npc->currentAnim.w = gPartnerAnimations[D_8010CFD8].anims[3];
// }
// npc_move_heading(npc, npc->moveSpeed, npc->yaw);
// npc_do_world_collision(npc);
// duration = npc->duration;
// if (duration > 10.0f) {
// duration = 10.0f;
// }
// npc->duration--;
// temp_f0_2 = (10.0f - duration) / 10.0f;
// npc->scale.x = temp_f0_2;
// npc->scale.y = temp_f0_2;
// npc->scale.z = temp_f0_2;
// if (npc->duration < 0) {
// D_8010CFC8 = 2;
// }
// break;
// case 2:
// npc->pos.y = npc->moveToPos.y;
// npc->jumpVelocity = 0.0f;
// npc->moveToPos.x = npc->pos.x;
// npc->moveToPos.z = npc->pos.z;
// npc->scale.x = 1.0f;
// npc->scale.y = 1.0f;
// npc->scale.z = 1.0f;
// npc->moveToPos.y = npc->pos.y;
// npc->pos.y = playerStatus->position.y;
// if (wPartner->isFlying) {
// npc->pos.y = playerStatus->position.y;
// }
// partner_clear_player_tracking(npc);
// npc->pos.x = npc->moveToPos.x;
// npc->pos.y = npc->moveToPos.y;
// npc->pos.z = npc->moveToPos.z;
// if (npc->flags & NPC_FLAG_1000) {
// if (!wPartner->isFlying) {
// func_8003D660(npc, 2);
// }
// }
// return TRUE;
// }
// return FALSE;
// }
void func_800EF300(void) { void func_800EF300(void) {
D_8010CFC8 = 40; D_8010CFC8 = 40;
@ -1093,8 +1645,8 @@ void partner_do_player_collision(Npc* partner) {
f32 partnerScreenZ; f32 partnerScreenZ;
f32 W; f32 W;
transform_point(gCameras->perspectiveMatrix, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 1.0f, &playerScreenX, &playerScreenY, &playerScreenZ, &W); transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix, playerStatus->position.x, playerStatus->position.y, playerStatus->position.z, 1.0f, &playerScreenX, &playerScreenY, &playerScreenZ, &W);
transform_point(gCameras->perspectiveMatrix, partner->pos.x, partner->pos.y, partner->pos.z, 1.0f, &partnerScreenX, &partnerScreenY, &partnerScreenZ, &W); transform_point(gCameras[CAM_DEFAULT].perspectiveMatrix, partner->pos.x, partner->pos.y, partner->pos.z, 1.0f, &partnerScreenX, &partnerScreenY, &partnerScreenZ, &W);
playerScreenX = fabsf(playerScreenX - partnerScreenX); playerScreenX = fabsf(playerScreenX - partnerScreenX);
playerScreenY = fabsf(playerScreenY - partnerScreenY); playerScreenY = fabsf(playerScreenY - partnerScreenY);
playerScreenZ = fabsf(playerScreenZ - partnerScreenZ); playerScreenZ = fabsf(playerScreenZ - partnerScreenZ);

View File

@ -1,11 +1,9 @@
#ifndef _WORLD_PARTNERS_H #ifndef _WORLD_PARTNERS_H
#define _WORLD_PARTNERS_H #define _WORLD_PARTNERS_H
#include "common.h"
typedef void (*PartnerFunc)(Npc* partner); typedef void (*PartnerFunc)(Npc* partner);
typedef s32 (*PartnerBoolFunc)(Npc* partner); typedef s32 (*PartnerBoolFunc)(Npc* partner);
typedef s32 (*PartnerUnkFunc)(Npc* partner, s32 arg1); typedef s32 (*PartnerUnkFunc)(Npc* partner, Npc* enemy);
typedef struct WorldPartner { typedef struct WorldPartner {
/* 0x00 */ void* dmaStart; /* 0x00 */ void* dmaStart;
@ -13,30 +11,19 @@ typedef struct WorldPartner {
/* 0x08 */ void* dmaDest; ///< Always `0x802BD100` /* 0x08 */ void* dmaDest; ///< Always `0x802BD100`
/* 0x0C */ s32 isFlying; /* 0x0C */ s32 isFlying;
/* 0x10 */ PartnerFunc init; /* 0x10 */ PartnerFunc init;
/* 0x14 */ Bytecode* takeOut; /* 0x14 */ EvtScript* takeOut;
/* 0x18 */ Bytecode* update; /* 0x18 */ EvtScript* update;
/* 0x1C */ Bytecode* useAbility; /* 0x1C */ EvtScript* useAbility;
/* 0x20 */ Bytecode* putAway; /* 0x20 */ EvtScript* putAway;
/* 0x24 */ s32 idle; /* 0x24 */ s32 idle;
/* 0x28 */ PartnerUnkFunc testFirstStrike; /* 0x28 */ PartnerUnkFunc testFirstStrike;
/* 0x2C */ PartnerBoolFunc canUseAbility; /* 0x2C */ PartnerBoolFunc canUseAbility;
/* 0x30 */ PartnerBoolFunc canPlayerPause; /* 0x30 */ PartnerBoolFunc canPlayerPause;
/* 0x34 */ PartnerFunc preBattle; /* 0x34 */ PartnerFunc preBattle;
/* 0x38 */ PartnerFunc postBattle; /* 0x38 */ PartnerFunc postBattle;
/* 0x3C */ Bytecode* whileRiding; /* 0x3C */ EvtScript* whileRiding;
} WorldPartner; // size = 0x40 } WorldPartner; // size = 0x40
extern s32 D_8010CFC4;
extern Evt* wPartnerCurrentScript;
extern s32 D_8010CFD8;
extern s32 wPartnerCurrentScriptID;
extern s32 D_8010CFE0;
extern s32 D_8010CFE4;
extern s32 D_8010CFE8;
extern WorldPartner wPartners[12];
extern WorldPartner* wPartner;
extern s32 D_8010CFD0; // wPartnerNpcIndex
extern Npc* wPartnerNpc; // wPartnerNpc extern Npc* wPartnerNpc; // wPartnerNpc
s32 partner_init_get_out(Npc*); s32 partner_init_get_out(Npc*);

View File

@ -213,7 +213,7 @@ ApiStatus func_80280410(Evt* script, s32 isInitialCall) {
func_800E98EC(); func_800E98EC();
shop->unk_358 = 5; shop->unk_358 = 5;
if (gGameStatusPtr->pressedButtons & 0x8000) { if (gGameStatusPtr->pressedButtons[0] & BUTTON_A) {
Evt* childScript; Evt* childScript;

View File

@ -30,7 +30,7 @@ ApiStatus CheckActionState(Evt* script, s32 isInitialCall) {
Bytecode a0 = *args++; Bytecode a0 = *args++;
s32 var = evt_get_float_variable(script, *args++); s32 var = evt_get_float_variable(script, *args++);
evt_set_variable(script, a0, gPlayerActionState == var); evt_set_variable(script, a0, gPlayerStatus.actionState == var);
return ApiStatus_DONE2; return ApiStatus_DONE2;
} }

View File

@ -20,8 +20,8 @@ glabel falling_leaves_update
/* 35EB10 E00581F0 3C020004 */ lui $v0, 4 /* 35EB10 E00581F0 3C020004 */ lui $v0, 4
/* 35EB14 E00581F4 16400006 */ bnez $s2, .LE0058210 /* 35EB14 E00581F4 16400006 */ bnez $s2, .LE0058210
/* 35EB18 E00581F8 3442F1A0 */ ori $v0, $v0, 0xf1a0 /* 35EB18 E00581F8 3442F1A0 */ ori $v0, $v0, 0xf1a0
/* 35EB1C E00581FC 3C028011 */ lui $v0, %hi(gPlayerActionState) /* 35EB1C E00581FC 3C028011 */ lui $v0, %hi(gPlayerStatus + 0xB4)
/* 35EB20 E0058200 8042F07C */ lb $v0, %lo(gPlayerActionState)($v0) /* 35EB20 E0058200 8042F07C */ lb $v0, %lo(gPlayerStatus + 0xB4)($v0)
/* 35EB24 E0058204 10400099 */ beqz $v0, .LE005846C /* 35EB24 E0058204 10400099 */ beqz $v0, .LE005846C
/* 35EB28 E0058208 3C020004 */ lui $v0, 4 /* 35EB28 E0058208 3C020004 */ lui $v0, 4
.LE005820C: .LE005820C:

View File

@ -1,733 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
dlabel jtbl_8010C118
.word .L800EB14C_845FC, .L800EB124_845D4, .L800EAA48_83EF8, .L800EA83C_83CEC, .L800EAB90_84040, .L800EAC30_840E0, .L800EAC7C_8412C, .L800EADC0_84270, .L800EAEF4_843A4, .L800EAFD0_84480, .L800EB0E0_84590, 0
.section .text
glabel _use_partner_ability
/* 83B7C 800EA6CC 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 83B80 800EA6D0 AFB3001C */ sw $s3, 0x1c($sp)
/* 83B84 800EA6D4 3C138011 */ lui $s3, %hi(gPlayerData)
/* 83B88 800EA6D8 2673F290 */ addiu $s3, $s3, %lo(gPlayerData)
/* 83B8C 800EA6DC 3C058011 */ lui $a1, %hi(gPartnerActionStatus)
/* 83B90 800EA6E0 24A5EBB0 */ addiu $a1, $a1, %lo(gPartnerActionStatus)
/* 83B94 800EA6E4 AFBF0020 */ sw $ra, 0x20($sp)
/* 83B98 800EA6E8 AFB20018 */ sw $s2, 0x18($sp)
/* 83B9C 800EA6EC AFB10014 */ sw $s1, 0x14($sp)
/* 83BA0 800EA6F0 AFB00010 */ sw $s0, 0x10($sp)
/* 83BA4 800EA6F4 80A20014 */ lb $v0, 0x14($a1)
/* 83BA8 800EA6F8 3C068011 */ lui $a2, %hi(gPlayerStatus)
/* 83BAC 800EA6FC 24C6EFC8 */ addiu $a2, $a2, %lo(gPlayerStatus)
/* 83BB0 800EA700 5440001F */ bnel $v0, $zero, .L800EA780
/* 83BB4 800EA704 A4A00004 */ sh $zero, 4($a1)
/* 83BB8 800EA708 3C038007 */ lui $v1, %hi(gGameStatusPtr)
/* 83BBC 800EA70C 8C63419C */ lw $v1, %lo(gGameStatusPtr)($v1)
/* 83BC0 800EA710 80620081 */ lb $v0, 0x81($v1)
/* 83BC4 800EA714 00621021 */ addu $v0, $v1, $v0
/* 83BC8 800EA718 90420040 */ lbu $v0, 0x40($v0)
/* 83BCC 800EA71C 00021600 */ sll $v0, $v0, 0x18
/* 83BD0 800EA720 00021603 */ sra $v0, $v0, 0x18
/* 83BD4 800EA724 A4A20004 */ sh $v0, 4($a1)
/* 83BD8 800EA728 80620081 */ lb $v0, 0x81($v1)
/* 83BDC 800EA72C 00621021 */ addu $v0, $v1, $v0
/* 83BE0 800EA730 90420044 */ lbu $v0, 0x44($v0)
/* 83BE4 800EA734 00021600 */ sll $v0, $v0, 0x18
/* 83BE8 800EA738 00021603 */ sra $v0, $v0, 0x18
/* 83BEC 800EA73C A4A20006 */ sh $v0, 6($a1)
/* 83BF0 800EA740 80620081 */ lb $v0, 0x81($v1)
/* 83BF4 800EA744 00021080 */ sll $v0, $v0, 2
/* 83BF8 800EA748 00621021 */ addu $v0, $v1, $v0
/* 83BFC 800EA74C 8C420000 */ lw $v0, ($v0)
/* 83C00 800EA750 ACA20008 */ sw $v0, 8($a1)
/* 83C04 800EA754 80620081 */ lb $v0, 0x81($v1)
/* 83C08 800EA758 00021080 */ sll $v0, $v0, 2
/* 83C0C 800EA75C 00621021 */ addu $v0, $v1, $v0
/* 83C10 800EA760 8C420010 */ lw $v0, 0x10($v0)
/* 83C14 800EA764 ACA2000C */ sw $v0, 0xc($a1)
/* 83C18 800EA768 80620081 */ lb $v0, 0x81($v1)
/* 83C1C 800EA76C 00021080 */ sll $v0, $v0, 2
/* 83C20 800EA770 00621821 */ addu $v1, $v1, $v0
/* 83C24 800EA774 8C620020 */ lw $v0, 0x20($v1)
/* 83C28 800EA778 0803A9E4 */ j .L800EA790
/* 83C2C 800EA77C ACA20010 */ sw $v0, 0x10($a1)
.L800EA780:
/* 83C30 800EA780 A4A00006 */ sh $zero, 6($a1)
/* 83C34 800EA784 ACA00008 */ sw $zero, 8($a1)
/* 83C38 800EA788 ACA0000C */ sw $zero, 0xc($a1)
/* 83C3C 800EA78C ACA00010 */ sw $zero, 0x10($a1)
.L800EA790:
/* 83C40 800EA790 8CC40004 */ lw $a0, 4($a2)
/* 83C44 800EA794 30820004 */ andi $v0, $a0, 4
/* 83C48 800EA798 1040000A */ beqz $v0, .L800EA7C4
/* 83C4C 800EA79C 2402FFFB */ addiu $v0, $zero, -5
/* 83C50 800EA7A0 8CA3000C */ lw $v1, 0xc($a1)
/* 83C54 800EA7A4 00821024 */ and $v0, $a0, $v0
/* 83C58 800EA7A8 ACC20004 */ sw $v0, 4($a2)
/* 83C5C 800EA7AC 34634004 */ ori $v1, $v1, 0x4004
/* 83C60 800EA7B0 ACA3000C */ sw $v1, 0xc($a1)
/* 83C64 800EA7B4 8CC20004 */ lw $v0, 4($a2)
/* 83C68 800EA7B8 3C034000 */ lui $v1, 0x4000
/* 83C6C 800EA7BC 00431025 */ or $v0, $v0, $v1
/* 83C70 800EA7C0 ACC20004 */ sw $v0, 4($a2)
.L800EA7C4:
/* 83C74 800EA7C4 3C038011 */ lui $v1, %hi(D_8010CFE8)
/* 83C78 800EA7C8 2463CFE8 */ addiu $v1, $v1, %lo(D_8010CFE8)
/* 83C7C 800EA7CC 8C620000 */ lw $v0, ($v1)
/* 83C80 800EA7D0 10400006 */ beqz $v0, .L800EA7EC
/* 83C84 800EA7D4 00000000 */ nop
/* 83C88 800EA7D8 3C018011 */ lui $at, %hi(D_8010CD30)
/* 83C8C 800EA7DC AC22CD30 */ sw $v0, %lo(D_8010CD30)($at)
/* 83C90 800EA7E0 3C018011 */ lui $at, %hi(D_8010CD34)
/* 83C94 800EA7E4 AC20CD34 */ sw $zero, %lo(D_8010CD34)($at)
/* 83C98 800EA7E8 AC600000 */ sw $zero, ($v1)
.L800EA7EC:
/* 83C9C 800EA7EC 3C038011 */ lui $v1, %hi(D_8010CD30)
/* 83CA0 800EA7F0 8C63CD30 */ lw $v1, %lo(D_8010CD30)($v1)
/* 83CA4 800EA7F4 2C620002 */ sltiu $v0, $v1, 2
/* 83CA8 800EA7F8 14400009 */ bnez $v0, .L800EA820
/* 83CAC 800EA7FC 2C62000B */ sltiu $v0, $v1, 0xb
/* 83CB0 800EA800 24020008 */ addiu $v0, $zero, 8
/* 83CB4 800EA804 10620006 */ beq $v1, $v0, .L800EA820
/* 83CB8 800EA808 2C62000B */ sltiu $v0, $v1, 0xb
/* 83CBC 800EA80C 3C018011 */ lui $at, %hi(D_8010CFC4)
/* 83CC0 800EA810 AC20CFC4 */ sw $zero, %lo(D_8010CFC4)($at)
/* 83CC4 800EA814 3C038011 */ lui $v1, %hi(D_8010CD30)
/* 83CC8 800EA818 8C63CD30 */ lw $v1, %lo(D_8010CD30)($v1)
/* 83CCC 800EA81C 2C62000B */ sltiu $v0, $v1, 0xb
.L800EA820:
/* 83CD0 800EA820 1040024A */ beqz $v0, .L800EB14C_845FC
/* 83CD4 800EA824 00031080 */ sll $v0, $v1, 2
/* 83CD8 800EA828 3C018011 */ lui $at, %hi(jtbl_8010C118)
/* 83CDC 800EA82C 00220821 */ addu $at, $at, $v0
/* 83CE0 800EA830 8C22C118 */ lw $v0, %lo(jtbl_8010C118)($at)
/* 83CE4 800EA834 00400008 */ jr $v0
/* 83CE8 800EA838 00000000 */ nop
.L800EA83C_83CEC:
/* 83CEC 800EA83C 24040003 */ addiu $a0, $zero, 3
/* 83CF0 800EA840 3C118011 */ lui $s1, %hi(D_8010CD34)
/* 83CF4 800EA844 2631CD34 */ addiu $s1, $s1, %lo(D_8010CD34)
/* 83CF8 800EA848 3C018011 */ lui $at, %hi(D_8010CFC4)
/* 83CFC 800EA84C AC24CFC4 */ sw $a0, %lo(D_8010CFC4)($at)
/* 83D00 800EA850 8E230000 */ lw $v1, ($s1)
/* 83D04 800EA854 24120001 */ addiu $s2, $zero, 1
/* 83D08 800EA858 1072002B */ beq $v1, $s2, .L800EA908
/* 83D0C 800EA85C 28620002 */ slti $v0, $v1, 2
/* 83D10 800EA860 50400005 */ beql $v0, $zero, .L800EA878
/* 83D14 800EA864 24020002 */ addiu $v0, $zero, 2
/* 83D18 800EA868 10600009 */ beqz $v1, .L800EA890
/* 83D1C 800EA86C 00000000 */ nop
/* 83D20 800EA870 0803AC53 */ j .L800EB14C_845FC
/* 83D24 800EA874 00000000 */ nop
.L800EA878:
/* 83D28 800EA878 1062003F */ beq $v1, $v0, .L800EA978
/* 83D2C 800EA87C 00000000 */ nop
/* 83D30 800EA880 10640056 */ beq $v1, $a0, .L800EA9DC
/* 83D34 800EA884 00000000 */ nop
/* 83D38 800EA888 0803AC53 */ j .L800EB14C_845FC
/* 83D3C 800EA88C 00000000 */ nop
.L800EA890:
/* 83D40 800EA890 0C03805E */ jal disable_player_input
/* 83D44 800EA894 00000000 */ nop
/* 83D48 800EA898 0C05272D */ jal sfx_play_sound
/* 83D4C 800EA89C 2404000D */ addiu $a0, $zero, 0xd
/* 83D50 800EA8A0 3C108011 */ lui $s0, %hi(wPartnerCurrentScriptID)
/* 83D54 800EA8A4 2610CFDC */ addiu $s0, $s0, %lo(wPartnerCurrentScriptID)
/* 83D58 800EA8A8 0C0B102B */ jal kill_script_by_ID
/* 83D5C 800EA8AC 8E040000 */ lw $a0, ($s0)
/* 83D60 800EA8B0 3C028011 */ lui $v0, %hi(wPartner)
/* 83D64 800EA8B4 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 83D68 800EA8B8 24050014 */ addiu $a1, $zero, 0x14
/* 83D6C 800EA8BC 8C440020 */ lw $a0, 0x20($v0)
/* 83D70 800EA8C0 0C0B0CF8 */ jal start_script
/* 83D74 800EA8C4 24060020 */ addiu $a2, $zero, 0x20
/* 83D78 800EA8C8 8C430144 */ lw $v1, 0x144($v0)
/* 83D7C 800EA8CC 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 83D80 800EA8D0 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 83D84 800EA8D4 AE030000 */ sw $v1, ($s0)
/* 83D88 800EA8D8 3C058011 */ lui $a1, %hi(wPartnerNpc)
/* 83D8C 800EA8DC 8CA5C930 */ lw $a1, %lo(wPartnerNpc)($a1)
/* 83D90 800EA8E0 2403000A */ addiu $v1, $zero, 0xa
/* 83D94 800EA8E4 A0430004 */ sb $v1, 4($v0)
/* 83D98 800EA8E8 8E230000 */ lw $v1, ($s1)
/* 83D9C 800EA8EC 24040001 */ addiu $a0, $zero, 1
/* 83DA0 800EA8F0 00641821 */ addu $v1, $v1, $a0
/* 83DA4 800EA8F4 AC45014C */ sw $a1, 0x14c($v0)
/* 83DA8 800EA8F8 0C009C22 */ jal set_time_freeze_mode
/* 83DAC 800EA8FC AE230000 */ sw $v1, ($s1)
/* 83DB0 800EA900 0803AC53 */ j .L800EB14C_845FC
/* 83DB4 800EA904 00000000 */ nop
.L800EA908:
/* 83DB8 800EA908 3C048011 */ lui $a0, %hi(wPartnerCurrentScriptID)
/* 83DBC 800EA90C 8C84CFDC */ lw $a0, %lo(wPartnerCurrentScriptID)($a0)
/* 83DC0 800EA910 0C0B1059 */ jal does_script_exist
/* 83DC4 800EA914 00000000 */ nop
/* 83DC8 800EA918 1440020C */ bnez $v0, .L800EB14C_845FC
/* 83DCC 800EA91C 00000000 */ nop
/* 83DD0 800EA920 0C009C22 */ jal set_time_freeze_mode
/* 83DD4 800EA924 0000202D */ daddu $a0, $zero, $zero
/* 83DD8 800EA928 0C03A9AA */ jal partner_free_npc
/* 83DDC 800EA92C 00000000 */ nop
/* 83DE0 800EA930 3C028011 */ lui $v0, %hi(D_8010CFE4)
/* 83DE4 800EA934 8C42CFE4 */ lw $v0, %lo(D_8010CFE4)($v0)
/* 83DE8 800EA938 3C018011 */ lui $at, %hi(D_8010CFD8)
/* 83DEC 800EA93C AC22CFD8 */ sw $v0, %lo(D_8010CFD8)($at)
/* 83DF0 800EA940 0C03A974 */ jal partner_create_npc
/* 83DF4 800EA944 A2620012 */ sb $v0, 0x12($s3)
/* 83DF8 800EA948 0C05272D */ jal sfx_play_sound
/* 83DFC 800EA94C 2404000E */ addiu $a0, $zero, 0xe
/* 83E00 800EA950 3C028011 */ lui $v0, %hi(wPartner)
/* 83E04 800EA954 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 83E08 800EA958 3C048011 */ lui $a0, %hi(wPartnerNpc)
/* 83E0C 800EA95C 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0)
/* 83E10 800EA960 8C420010 */ lw $v0, 0x10($v0)
/* 83E14 800EA964 0040F809 */ jalr $v0
/* 83E18 800EA968 00000000 */ nop
/* 83E1C 800EA96C 8E220000 */ lw $v0, ($s1)
/* 83E20 800EA970 24420001 */ addiu $v0, $v0, 1
/* 83E24 800EA974 AE220000 */ sw $v0, ($s1)
.L800EA978:
/* 83E28 800EA978 3C028011 */ lui $v0, %hi(wPartner)
/* 83E2C 800EA97C 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 83E30 800EA980 24050014 */ addiu $a1, $zero, 0x14
/* 83E34 800EA984 8C440014 */ lw $a0, 0x14($v0)
/* 83E38 800EA988 0C0B0CF8 */ jal start_script
/* 83E3C 800EA98C 24060020 */ addiu $a2, $zero, 0x20
/* 83E40 800EA990 8C430144 */ lw $v1, 0x144($v0)
/* 83E44 800EA994 3C068011 */ lui $a2, %hi(wPartnerNpc)
/* 83E48 800EA998 8CC6C930 */ lw $a2, %lo(wPartnerNpc)($a2)
/* 83E4C 800EA99C 3C058011 */ lui $a1, %hi(D_8010CD34)
/* 83E50 800EA9A0 24A5CD34 */ addiu $a1, $a1, %lo(D_8010CD34)
/* 83E54 800EA9A4 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 83E58 800EA9A8 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 83E5C 800EA9AC 3C018011 */ lui $at, %hi(wPartnerCurrentScriptID)
/* 83E60 800EA9B0 AC23CFDC */ sw $v1, %lo(wPartnerCurrentScriptID)($at)
/* 83E64 800EA9B4 2403000A */ addiu $v1, $zero, 0xa
/* 83E68 800EA9B8 A0430004 */ sb $v1, 4($v0)
/* 83E6C 800EA9BC 8CA30000 */ lw $v1, ($a1)
/* 83E70 800EA9C0 24040001 */ addiu $a0, $zero, 1
/* 83E74 800EA9C4 AC46014C */ sw $a2, 0x14c($v0)
/* 83E78 800EA9C8 00641821 */ addu $v1, $v1, $a0
/* 83E7C 800EA9CC 0C009C22 */ jal set_time_freeze_mode
/* 83E80 800EA9D0 ACA30000 */ sw $v1, ($a1)
/* 83E84 800EA9D4 0803AC53 */ j .L800EB14C_845FC
/* 83E88 800EA9D8 00000000 */ nop
.L800EA9DC:
/* 83E8C 800EA9DC 3C108011 */ lui $s0, %hi(wPartnerCurrentScriptID)
/* 83E90 800EA9E0 2610CFDC */ addiu $s0, $s0, %lo(wPartnerCurrentScriptID)
/* 83E94 800EA9E4 0C0B1059 */ jal does_script_exist
/* 83E98 800EA9E8 8E040000 */ lw $a0, ($s0)
/* 83E9C 800EA9EC 144001D7 */ bnez $v0, .L800EB14C_845FC
/* 83EA0 800EA9F0 24050014 */ addiu $a1, $zero, 0x14
/* 83EA4 800EA9F4 3C028011 */ lui $v0, %hi(wPartner)
/* 83EA8 800EA9F8 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 83EAC 800EA9FC 8C440018 */ lw $a0, 0x18($v0)
/* 83EB0 800EAA00 0C0B0CF8 */ jal start_script
/* 83EB4 800EAA04 24060020 */ addiu $a2, $zero, 0x20
/* 83EB8 800EAA08 3C038011 */ lui $v1, %hi(wPartnerNpc)
/* 83EBC 800EAA0C 8C63C930 */ lw $v1, %lo(wPartnerNpc)($v1)
/* 83EC0 800EAA10 8C440144 */ lw $a0, 0x144($v0)
/* 83EC4 800EAA14 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 83EC8 800EAA18 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 83ECC 800EAA1C AC43014C */ sw $v1, 0x14c($v0)
/* 83ED0 800EAA20 2403000A */ addiu $v1, $zero, 0xa
/* 83ED4 800EAA24 AE040000 */ sw $a0, ($s0)
/* 83ED8 800EAA28 A0430004 */ sb $v1, 4($v0)
/* 83EDC 800EAA2C 3C018011 */ lui $at, %hi(D_8010CD30)
/* 83EE0 800EAA30 0C038069 */ jal enable_player_input
/* 83EE4 800EAA34 AC32CD30 */ sw $s2, %lo(D_8010CD30)($at)
/* 83EE8 800EAA38 0C009C22 */ jal set_time_freeze_mode
/* 83EEC 800EAA3C 0000202D */ daddu $a0, $zero, $zero
/* 83EF0 800EAA40 0803AC53 */ j .L800EB14C_845FC
/* 83EF4 800EAA44 00000000 */ nop
.L800EAA48_83EF8:
/* 83EF8 800EAA48 24040003 */ addiu $a0, $zero, 3
/* 83EFC 800EAA4C 3C108011 */ lui $s0, %hi(D_8010CD34)
/* 83F00 800EAA50 2610CD34 */ addiu $s0, $s0, %lo(D_8010CD34)
/* 83F04 800EAA54 3C018011 */ lui $at, %hi(D_8010CFC4)
/* 83F08 800EAA58 AC24CFC4 */ sw $a0, %lo(D_8010CFC4)($at)
/* 83F0C 800EAA5C 8E030000 */ lw $v1, ($s0)
/* 83F10 800EAA60 24110001 */ addiu $s1, $zero, 1
/* 83F14 800EAA64 10710014 */ beq $v1, $s1, .L800EAAB8
/* 83F18 800EAA68 28620002 */ slti $v0, $v1, 2
/* 83F1C 800EAA6C 50400005 */ beql $v0, $zero, .L800EAA84
/* 83F20 800EAA70 24020002 */ addiu $v0, $zero, 2
/* 83F24 800EAA74 10600009 */ beqz $v1, .L800EAA9C
/* 83F28 800EAA78 00000000 */ nop
/* 83F2C 800EAA7C 0803AC53 */ j .L800EB14C_845FC
/* 83F30 800EAA80 00000000 */ nop
.L800EAA84:
/* 83F34 800EAA84 10620170 */ beq $v1, $v0, .L800EB048
/* 83F38 800EAA88 00000000 */ nop
/* 83F3C 800EAA8C 1064002E */ beq $v1, $a0, .L800EAB48
/* 83F40 800EAA90 24050014 */ addiu $a1, $zero, 0x14
/* 83F44 800EAA94 0803AC53 */ j .L800EB14C_845FC
/* 83F48 800EAA98 00000000 */ nop
.L800EAA9C:
/* 83F4C 800EAA9C 3C048011 */ lui $a0, %hi(wPartnerCurrentScriptID)
/* 83F50 800EAAA0 8C84CFDC */ lw $a0, %lo(wPartnerCurrentScriptID)($a0)
/* 83F54 800EAAA4 0C0B102B */ jal kill_script_by_ID
/* 83F58 800EAAA8 00000000 */ nop
/* 83F5C 800EAAAC 8E020000 */ lw $v0, ($s0)
/* 83F60 800EAAB0 24420001 */ addiu $v0, $v0, 1
/* 83F64 800EAAB4 AE020000 */ sw $v0, ($s0)
.L800EAAB8:
/* 83F68 800EAAB8 0C03A9AA */ jal partner_free_npc
/* 83F6C 800EAABC 00000000 */ nop
/* 83F70 800EAAC0 3C028011 */ lui $v0, %hi(D_8010CFE4)
/* 83F74 800EAAC4 8C42CFE4 */ lw $v0, %lo(D_8010CFE4)($v0)
/* 83F78 800EAAC8 3C018011 */ lui $at, %hi(D_8010CFD8)
/* 83F7C 800EAACC AC22CFD8 */ sw $v0, %lo(D_8010CFD8)($at)
/* 83F80 800EAAD0 0C03A974 */ jal partner_create_npc
/* 83F84 800EAAD4 A2620012 */ sb $v0, 0x12($s3)
/* 83F88 800EAAD8 3C048011 */ lui $a0, %hi(wPartnerNpc)
/* 83F8C 800EAADC 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0)
/* 83F90 800EAAE0 3C018010 */ lui $at, %hi(wSavedPartnerPosX)
/* 83F94 800EAAE4 C422833C */ lwc1 $f2, %lo(wSavedPartnerPosX)($at)
/* 83F98 800EAAE8 3C018010 */ lui $at, %hi(wSavedPartnerPosY)
/* 83F9C 800EAAEC C4248340 */ lwc1 $f4, %lo(wSavedPartnerPosY)($at)
/* 83FA0 800EAAF0 3C018010 */ lui $at, %hi(wSavedPartnerPosZ)
/* 83FA4 800EAAF4 C4268344 */ lwc1 $f6, %lo(wSavedPartnerPosZ)($at)
/* 83FA8 800EAAF8 3C013F80 */ lui $at, 0x3f80
/* 83FAC 800EAAFC 44810000 */ mtc1 $at, $f0
/* 83FB0 800EAB00 3C028011 */ lui $v0, %hi(wPartner)
/* 83FB4 800EAB04 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 83FB8 800EAB08 E4820038 */ swc1 $f2, 0x38($a0)
/* 83FBC 800EAB0C E484003C */ swc1 $f4, 0x3c($a0)
/* 83FC0 800EAB10 E4860040 */ swc1 $f6, 0x40($a0)
/* 83FC4 800EAB14 AC80001C */ sw $zero, 0x1c($a0)
/* 83FC8 800EAB18 E4800054 */ swc1 $f0, 0x54($a0)
/* 83FCC 800EAB1C E4800058 */ swc1 $f0, 0x58($a0)
/* 83FD0 800EAB20 E480005C */ swc1 $f0, 0x5c($a0)
/* 83FD4 800EAB24 8C420010 */ lw $v0, 0x10($v0)
/* 83FD8 800EAB28 0040F809 */ jalr $v0
/* 83FDC 800EAB2C 00000000 */ nop
/* 83FE0 800EAB30 3C038011 */ lui $v1, %hi(D_8010CD34)
/* 83FE4 800EAB34 2463CD34 */ addiu $v1, $v1, %lo(D_8010CD34)
/* 83FE8 800EAB38 8C620000 */ lw $v0, ($v1)
/* 83FEC 800EAB3C 24420001 */ addiu $v0, $v0, 1
/* 83FF0 800EAB40 0803AC14 */ j .L800EB050
/* 83FF4 800EAB44 AC620000 */ sw $v0, ($v1)
.L800EAB48:
/* 83FF8 800EAB48 3C028011 */ lui $v0, %hi(wPartner)
/* 83FFC 800EAB4C 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 84000 800EAB50 8C440018 */ lw $a0, 0x18($v0)
/* 84004 800EAB54 0C0B0CF8 */ jal start_script
/* 84008 800EAB58 24060020 */ addiu $a2, $zero, 0x20
/* 8400C 800EAB5C 3C038011 */ lui $v1, %hi(wPartnerNpc)
/* 84010 800EAB60 8C63C930 */ lw $v1, %lo(wPartnerNpc)($v1)
/* 84014 800EAB64 8C440144 */ lw $a0, 0x144($v0)
/* 84018 800EAB68 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 8401C 800EAB6C AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 84020 800EAB70 AC43014C */ sw $v1, 0x14c($v0)
/* 84024 800EAB74 2403000A */ addiu $v1, $zero, 0xa
/* 84028 800EAB78 3C018011 */ lui $at, %hi(wPartnerCurrentScriptID)
/* 8402C 800EAB7C AC24CFDC */ sw $a0, %lo(wPartnerCurrentScriptID)($at)
/* 84030 800EAB80 A0430004 */ sb $v1, 4($v0)
/* 84034 800EAB84 3C018011 */ lui $at, %hi(D_8010CD30)
/* 84038 800EAB88 0803AC53 */ j .L800EB14C_845FC
/* 8403C 800EAB8C AC31CD30 */ sw $s1, %lo(D_8010CD30)($at)
.L800EAB90_84040:
/* 84040 800EAB90 3C118011 */ lui $s1, %hi(D_8010CD34)
/* 84044 800EAB94 2631CD34 */ addiu $s1, $s1, %lo(D_8010CD34)
/* 84048 800EAB98 8E300000 */ lw $s0, ($s1)
/* 8404C 800EAB9C 12000005 */ beqz $s0, .L800EABB4
/* 84050 800EABA0 24020001 */ addiu $v0, $zero, 1
/* 84054 800EABA4 12020010 */ beq $s0, $v0, .L800EABE8
/* 84058 800EABA8 00000000 */ nop
/* 8405C 800EABAC 0803AC53 */ j .L800EB14C_845FC
/* 84060 800EABB0 00000000 */ nop
.L800EABB4:
/* 84064 800EABB4 0C03805E */ jal disable_player_input
/* 84068 800EABB8 00000000 */ nop
/* 8406C 800EABBC 0C05272D */ jal sfx_play_sound
/* 84070 800EABC0 2404000D */ addiu $a0, $zero, 0xd
/* 84074 800EABC4 3C108011 */ lui $s0, %hi(wPartnerCurrentScriptID)
/* 84078 800EABC8 2610CFDC */ addiu $s0, $s0, %lo(wPartnerCurrentScriptID)
/* 8407C 800EABCC 0C0B102B */ jal kill_script_by_ID
/* 84080 800EABD0 8E040000 */ lw $a0, ($s0)
/* 84084 800EABD4 3C028011 */ lui $v0, %hi(wPartner)
/* 84088 800EABD8 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 8408C 800EABDC 8C440020 */ lw $a0, 0x20($v0)
/* 84090 800EABE0 0803ABCE */ j .L800EAF38
/* 84094 800EABE4 24050014 */ addiu $a1, $zero, 0x14
.L800EABE8:
/* 84098 800EABE8 3C048011 */ lui $a0, %hi(wPartnerCurrentScriptID)
/* 8409C 800EABEC 8C84CFDC */ lw $a0, %lo(wPartnerCurrentScriptID)($a0)
/* 840A0 800EABF0 0C0B1059 */ jal does_script_exist
/* 840A4 800EABF4 00000000 */ nop
/* 840A8 800EABF8 14400154 */ bnez $v0, .L800EB14C_845FC
/* 840AC 800EABFC 00000000 */ nop
/* 840B0 800EAC00 0C03A9AA */ jal partner_free_npc
/* 840B4 800EAC04 00000000 */ nop
/* 840B8 800EAC08 3C028011 */ lui $v0, %hi(D_8010CFE4)
/* 840BC 800EAC0C 8C42CFE4 */ lw $v0, %lo(D_8010CFE4)($v0)
/* 840C0 800EAC10 3C018011 */ lui $at, %hi(D_8010CD30)
/* 840C4 800EAC14 AC30CD30 */ sw $s0, %lo(D_8010CD30)($at)
/* 840C8 800EAC18 3C018011 */ lui $at, %hi(D_8010CFD8)
/* 840CC 800EAC1C AC22CFD8 */ sw $v0, %lo(D_8010CFD8)($at)
/* 840D0 800EAC20 0C038069 */ jal enable_player_input
/* 840D4 800EAC24 A2620012 */ sb $v0, 0x12($s3)
/* 840D8 800EAC28 0803AC53 */ j .L800EB14C_845FC
/* 840DC 800EAC2C 00000000 */ nop
.L800EAC30_840E0:
/* 840E0 800EAC30 3C028011 */ lui $v0, %hi(D_8010CD34)
/* 840E4 800EAC34 8C42CD34 */ lw $v0, %lo(D_8010CD34)($v0)
/* 840E8 800EAC38 14400144 */ bnez $v0, .L800EB14C_845FC
/* 840EC 800EAC3C 00000000 */ nop
/* 840F0 800EAC40 3C048011 */ lui $a0, %hi(wPartnerCurrentScriptID)
/* 840F4 800EAC44 8C84CFDC */ lw $a0, %lo(wPartnerCurrentScriptID)($a0)
/* 840F8 800EAC48 0C0B102B */ jal kill_script_by_ID
/* 840FC 800EAC4C 00000000 */ nop
/* 84100 800EAC50 0C03A9AA */ jal partner_free_npc
/* 84104 800EAC54 00000000 */ nop
/* 84108 800EAC58 3C038011 */ lui $v1, %hi(D_8010CFE4)
/* 8410C 800EAC5C 8C63CFE4 */ lw $v1, %lo(D_8010CFE4)($v1)
/* 84110 800EAC60 24020001 */ addiu $v0, $zero, 1
/* 84114 800EAC64 3C018011 */ lui $at, %hi(D_8010CD30)
/* 84118 800EAC68 AC22CD30 */ sw $v0, %lo(D_8010CD30)($at)
/* 8411C 800EAC6C 3C018011 */ lui $at, %hi(D_8010CFD8)
/* 84120 800EAC70 AC23CFD8 */ sw $v1, %lo(D_8010CFD8)($at)
/* 84124 800EAC74 0803AC53 */ j .L800EB14C_845FC
/* 84128 800EAC78 A2630012 */ sb $v1, 0x12($s3)
.L800EAC7C_8412C:
/* 8412C 800EAC7C 3C108011 */ lui $s0, %hi(D_8010CD34)
/* 84130 800EAC80 2610CD34 */ addiu $s0, $s0, %lo(D_8010CD34)
/* 84134 800EAC84 8E030000 */ lw $v1, ($s0)
/* 84138 800EAC88 24110001 */ addiu $s1, $zero, 1
/* 8413C 800EAC8C 1071001D */ beq $v1, $s1, .L800EAD04
/* 84140 800EAC90 28620002 */ slti $v0, $v1, 2
/* 84144 800EAC94 50400005 */ beql $v0, $zero, .L800EACAC
/* 84148 800EAC98 24020002 */ addiu $v0, $zero, 2
/* 8414C 800EAC9C 10600007 */ beqz $v1, .L800EACBC
/* 84150 800EACA0 00000000 */ nop
/* 84154 800EACA4 0803AC53 */ j .L800EB14C_845FC
/* 84158 800EACA8 00000000 */ nop
.L800EACAC:
/* 8415C 800EACAC 1062002B */ beq $v1, $v0, .L800EAD5C
/* 84160 800EACB0 00000000 */ nop
/* 84164 800EACB4 0803AC53 */ j .L800EB14C_845FC
/* 84168 800EACB8 00000000 */ nop
.L800EACBC:
/* 8416C 800EACBC 0C03805E */ jal disable_player_input
/* 84170 800EACC0 00000000 */ nop
/* 84174 800EACC4 3C028011 */ lui $v0, %hi(D_8010CFE4)
/* 84178 800EACC8 8C42CFE4 */ lw $v0, %lo(D_8010CFE4)($v0)
/* 8417C 800EACCC 3C018011 */ lui $at, %hi(D_8010CFD8)
/* 84180 800EACD0 AC22CFD8 */ sw $v0, %lo(D_8010CFD8)($at)
/* 84184 800EACD4 0C03A974 */ jal partner_create_npc
/* 84188 800EACD8 A2620012 */ sb $v0, 0x12($s3)
/* 8418C 800EACDC 3C028011 */ lui $v0, %hi(wPartner)
/* 84190 800EACE0 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 84194 800EACE4 3C048011 */ lui $a0, %hi(wPartnerNpc)
/* 84198 800EACE8 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0)
/* 8419C 800EACEC 8C420010 */ lw $v0, 0x10($v0)
/* 841A0 800EACF0 0040F809 */ jalr $v0
/* 841A4 800EACF4 00000000 */ nop
/* 841A8 800EACF8 8E020000 */ lw $v0, ($s0)
/* 841AC 800EACFC 24420001 */ addiu $v0, $v0, 1
/* 841B0 800EAD00 AE020000 */ sw $v0, ($s0)
.L800EAD04:
/* 841B4 800EAD04 3C028011 */ lui $v0, %hi(wPartner)
/* 841B8 800EAD08 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 841BC 800EAD0C 24050014 */ addiu $a1, $zero, 0x14
/* 841C0 800EAD10 8C440014 */ lw $a0, 0x14($v0)
/* 841C4 800EAD14 0C0B0CF8 */ jal start_script
/* 841C8 800EAD18 24060020 */ addiu $a2, $zero, 0x20
/* 841CC 800EAD1C 8C430144 */ lw $v1, 0x144($v0)
/* 841D0 800EAD20 3C058011 */ lui $a1, %hi(wPartnerNpc)
/* 841D4 800EAD24 8CA5C930 */ lw $a1, %lo(wPartnerNpc)($a1)
/* 841D8 800EAD28 3C048011 */ lui $a0, %hi(D_8010CD34)
/* 841DC 800EAD2C 2484CD34 */ addiu $a0, $a0, %lo(D_8010CD34)
/* 841E0 800EAD30 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 841E4 800EAD34 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 841E8 800EAD38 3C018011 */ lui $at, %hi(wPartnerCurrentScriptID)
/* 841EC 800EAD3C AC23CFDC */ sw $v1, %lo(wPartnerCurrentScriptID)($at)
/* 841F0 800EAD40 2403000A */ addiu $v1, $zero, 0xa
/* 841F4 800EAD44 A0430004 */ sb $v1, 4($v0)
/* 841F8 800EAD48 8C830000 */ lw $v1, ($a0)
/* 841FC 800EAD4C AC45014C */ sw $a1, 0x14c($v0)
/* 84200 800EAD50 24630001 */ addiu $v1, $v1, 1
/* 84204 800EAD54 0803AC53 */ j .L800EB14C_845FC
/* 84208 800EAD58 AC830000 */ sw $v1, ($a0)
.L800EAD5C:
/* 8420C 800EAD5C 3C108011 */ lui $s0, %hi(wPartnerCurrentScriptID)
/* 84210 800EAD60 2610CFDC */ addiu $s0, $s0, %lo(wPartnerCurrentScriptID)
/* 84214 800EAD64 0C0B1059 */ jal does_script_exist
/* 84218 800EAD68 8E040000 */ lw $a0, ($s0)
/* 8421C 800EAD6C 144000F7 */ bnez $v0, .L800EB14C_845FC
/* 84220 800EAD70 24050014 */ addiu $a1, $zero, 0x14
/* 84224 800EAD74 3C028011 */ lui $v0, %hi(wPartner)
/* 84228 800EAD78 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 8422C 800EAD7C 8C440018 */ lw $a0, 0x18($v0)
/* 84230 800EAD80 0C0B0CF8 */ jal start_script
/* 84234 800EAD84 24060020 */ addiu $a2, $zero, 0x20
/* 84238 800EAD88 3C038011 */ lui $v1, %hi(wPartnerNpc)
/* 8423C 800EAD8C 8C63C930 */ lw $v1, %lo(wPartnerNpc)($v1)
/* 84240 800EAD90 8C440144 */ lw $a0, 0x144($v0)
/* 84244 800EAD94 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 84248 800EAD98 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 8424C 800EAD9C AC43014C */ sw $v1, 0x14c($v0)
/* 84250 800EADA0 2403000A */ addiu $v1, $zero, 0xa
/* 84254 800EADA4 AE040000 */ sw $a0, ($s0)
/* 84258 800EADA8 A0430004 */ sb $v1, 4($v0)
/* 8425C 800EADAC 3C018011 */ lui $at, %hi(D_8010CD30)
/* 84260 800EADB0 0C038069 */ jal enable_player_input
/* 84264 800EADB4 AC31CD30 */ sw $s1, %lo(D_8010CD30)($at)
/* 84268 800EADB8 0803AC53 */ j .L800EB14C_845FC
/* 8426C 800EADBC 00000000 */ nop
.L800EADC0_84270:
/* 84270 800EADC0 3C118011 */ lui $s1, %hi(D_8010CD34)
/* 84274 800EADC4 2631CD34 */ addiu $s1, $s1, %lo(D_8010CD34)
/* 84278 800EADC8 8E300000 */ lw $s0, ($s1)
/* 8427C 800EADCC 24020002 */ addiu $v0, $zero, 2
/* 84280 800EADD0 3C018011 */ lui $at, %hi(D_8010CFC4)
/* 84284 800EADD4 AC22CFC4 */ sw $v0, %lo(D_8010CFC4)($at)
/* 84288 800EADD8 12000005 */ beqz $s0, .L800EADF0
/* 8428C 800EADDC 24020001 */ addiu $v0, $zero, 1
/* 84290 800EADE0 12020025 */ beq $s0, $v0, .L800EAE78
/* 84294 800EADE4 24050014 */ addiu $a1, $zero, 0x14
/* 84298 800EADE8 0803AC53 */ j .L800EB14C_845FC
/* 8429C 800EADEC 00000000 */ nop
.L800EADF0:
/* 842A0 800EADF0 0C03805E */ jal disable_player_input
/* 842A4 800EADF4 00000000 */ nop
/* 842A8 800EADF8 3C028011 */ lui $v0, %hi(D_8010CFE4)
/* 842AC 800EADFC 8C42CFE4 */ lw $v0, %lo(D_8010CFE4)($v0)
/* 842B0 800EAE00 3C018011 */ lui $at, %hi(D_8010CFD8)
/* 842B4 800EAE04 AC22CFD8 */ sw $v0, %lo(D_8010CFD8)($at)
/* 842B8 800EAE08 0C03A974 */ jal partner_create_npc
/* 842BC 800EAE0C A2620012 */ sb $v0, 0x12($s3)
/* 842C0 800EAE10 3C048011 */ lui $a0, %hi(wPartnerNpc)
/* 842C4 800EAE14 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0)
/* 842C8 800EAE18 3C018010 */ lui $at, %hi(wSavedPartnerPosX)
/* 842CC 800EAE1C C422833C */ lwc1 $f2, %lo(wSavedPartnerPosX)($at)
/* 842D0 800EAE20 3C018010 */ lui $at, %hi(wSavedPartnerPosY)
/* 842D4 800EAE24 C4248340 */ lwc1 $f4, %lo(wSavedPartnerPosY)($at)
/* 842D8 800EAE28 3C018010 */ lui $at, %hi(wSavedPartnerPosZ)
/* 842DC 800EAE2C C4268344 */ lwc1 $f6, %lo(wSavedPartnerPosZ)($at)
/* 842E0 800EAE30 3C013F80 */ lui $at, 0x3f80
/* 842E4 800EAE34 44810000 */ mtc1 $at, $f0
/* 842E8 800EAE38 3C028011 */ lui $v0, %hi(wPartner)
/* 842EC 800EAE3C 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 842F0 800EAE40 E4820038 */ swc1 $f2, 0x38($a0)
/* 842F4 800EAE44 E484003C */ swc1 $f4, 0x3c($a0)
/* 842F8 800EAE48 E4860040 */ swc1 $f6, 0x40($a0)
/* 842FC 800EAE4C AC80001C */ sw $zero, 0x1c($a0)
/* 84300 800EAE50 E4800054 */ swc1 $f0, 0x54($a0)
/* 84304 800EAE54 E4800058 */ swc1 $f0, 0x58($a0)
/* 84308 800EAE58 E480005C */ swc1 $f0, 0x5c($a0)
/* 8430C 800EAE5C 8C420010 */ lw $v0, 0x10($v0)
/* 84310 800EAE60 0040F809 */ jalr $v0
/* 84314 800EAE64 00000000 */ nop
/* 84318 800EAE68 8E220000 */ lw $v0, ($s1)
/* 8431C 800EAE6C 24420001 */ addiu $v0, $v0, 1
/* 84320 800EAE70 0803AC53 */ j .L800EB14C_845FC
/* 84324 800EAE74 AE220000 */ sw $v0, ($s1)
.L800EAE78:
/* 84328 800EAE78 3C028011 */ lui $v0, %hi(wPartner)
/* 8432C 800EAE7C 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 84330 800EAE80 8C440018 */ lw $a0, 0x18($v0)
/* 84334 800EAE84 0C0B0CF8 */ jal start_script
/* 84338 800EAE88 24060020 */ addiu $a2, $zero, 0x20
/* 8433C 800EAE8C 8C430144 */ lw $v1, 0x144($v0)
/* 84340 800EAE90 3C058011 */ lui $a1, %hi(wPartnerNpc)
/* 84344 800EAE94 24A5C930 */ addiu $a1, $a1, %lo(wPartnerNpc)
/* 84348 800EAE98 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 8434C 800EAE9C AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 84350 800EAEA0 3C018011 */ lui $at, %hi(wPartnerCurrentScriptID)
/* 84354 800EAEA4 AC23CFDC */ sw $v1, %lo(wPartnerCurrentScriptID)($at)
/* 84358 800EAEA8 8CA40000 */ lw $a0, ($a1)
/* 8435C 800EAEAC 2403000A */ addiu $v1, $zero, 0xa
/* 84360 800EAEB0 A0430004 */ sb $v1, 4($v0)
/* 84364 800EAEB4 3C038011 */ lui $v1, %hi(D_8010CFD8)
/* 84368 800EAEB8 8C63CFD8 */ lw $v1, %lo(D_8010CFD8)($v1)
/* 8436C 800EAEBC AC44014C */ sw $a0, 0x14c($v0)
/* 84370 800EAEC0 000310C0 */ sll $v0, $v1, 3
/* 84374 800EAEC4 00431021 */ addu $v0, $v0, $v1
/* 84378 800EAEC8 00021080 */ sll $v0, $v0, 2
/* 8437C 800EAECC 8CA30000 */ lw $v1, ($a1)
/* 84380 800EAED0 3C018010 */ lui $at, %hi(gPartnerAnimations+0x10)
/* 84384 800EAED4 00220821 */ addu $at, $at, $v0
/* 84388 800EAED8 8C228358 */ lw $v0, %lo(gPartnerAnimations+0x10)($at)
/* 8438C 800EAEDC 3C018011 */ lui $at, %hi(D_8010CD30)
/* 84390 800EAEE0 AC30CD30 */ sw $s0, %lo(D_8010CD30)($at)
/* 84394 800EAEE4 0C038069 */ jal enable_player_input
/* 84398 800EAEE8 AC620028 */ sw $v0, 0x28($v1)
/* 8439C 800EAEEC 0803AC53 */ j .L800EB14C_845FC
/* 843A0 800EAEF0 00000000 */ nop
.L800EAEF4_843A4:
/* 843A4 800EAEF4 3C118011 */ lui $s1, %hi(D_8010CD34)
/* 843A8 800EAEF8 2631CD34 */ addiu $s1, $s1, %lo(D_8010CD34)
/* 843AC 800EAEFC 8E300000 */ lw $s0, ($s1)
/* 843B0 800EAF00 12000005 */ beqz $s0, .L800EAF18
/* 843B4 800EAF04 24020001 */ addiu $v0, $zero, 1
/* 843B8 800EAF08 1202001A */ beq $s0, $v0, .L800EAF74
/* 843BC 800EAF0C 00000000 */ nop
/* 843C0 800EAF10 0803AC53 */ j .L800EB14C_845FC
/* 843C4 800EAF14 00000000 */ nop
.L800EAF18:
/* 843C8 800EAF18 3C108011 */ lui $s0, %hi(wPartnerCurrentScriptID)
/* 843CC 800EAF1C 2610CFDC */ addiu $s0, $s0, %lo(wPartnerCurrentScriptID)
/* 843D0 800EAF20 0C0B102B */ jal kill_script_by_ID
/* 843D4 800EAF24 8E040000 */ lw $a0, ($s0)
/* 843D8 800EAF28 3C028011 */ lui $v0, %hi(wPartner)
/* 843DC 800EAF2C 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 843E0 800EAF30 24050014 */ addiu $a1, $zero, 0x14
/* 843E4 800EAF34 8C44001C */ lw $a0, 0x1c($v0)
.L800EAF38:
/* 843E8 800EAF38 0C0B0CF8 */ jal start_script
/* 843EC 800EAF3C 24060020 */ addiu $a2, $zero, 0x20
/* 843F0 800EAF40 8C430144 */ lw $v1, 0x144($v0)
/* 843F4 800EAF44 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 843F8 800EAF48 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 843FC 800EAF4C AE030000 */ sw $v1, ($s0)
/* 84400 800EAF50 3C048011 */ lui $a0, %hi(wPartnerNpc)
/* 84404 800EAF54 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0)
/* 84408 800EAF58 2403000A */ addiu $v1, $zero, 0xa
/* 8440C 800EAF5C A0430004 */ sb $v1, 4($v0)
/* 84410 800EAF60 8E230000 */ lw $v1, ($s1)
/* 84414 800EAF64 24630001 */ addiu $v1, $v1, 1
/* 84418 800EAF68 AC44014C */ sw $a0, 0x14c($v0)
/* 8441C 800EAF6C 0803AC53 */ j .L800EB14C_845FC
/* 84420 800EAF70 AE230000 */ sw $v1, ($s1)
.L800EAF74:
/* 84424 800EAF74 3C118011 */ lui $s1, %hi(wPartnerCurrentScriptID)
/* 84428 800EAF78 2631CFDC */ addiu $s1, $s1, %lo(wPartnerCurrentScriptID)
/* 8442C 800EAF7C 0C0B1059 */ jal does_script_exist
/* 84430 800EAF80 8E240000 */ lw $a0, ($s1)
/* 84434 800EAF84 14400071 */ bnez $v0, .L800EB14C_845FC
/* 84438 800EAF88 24050014 */ addiu $a1, $zero, 0x14
/* 8443C 800EAF8C 3C028011 */ lui $v0, %hi(wPartner)
/* 84440 800EAF90 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 84444 800EAF94 8C440018 */ lw $a0, 0x18($v0)
/* 84448 800EAF98 0C0B0CF8 */ jal start_script
/* 8444C 800EAF9C 24060020 */ addiu $a2, $zero, 0x20
/* 84450 800EAFA0 3C038011 */ lui $v1, %hi(wPartnerNpc)
/* 84454 800EAFA4 8C63C930 */ lw $v1, %lo(wPartnerNpc)($v1)
/* 84458 800EAFA8 8C440144 */ lw $a0, 0x144($v0)
/* 8445C 800EAFAC 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 84460 800EAFB0 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 84464 800EAFB4 AC43014C */ sw $v1, 0x14c($v0)
/* 84468 800EAFB8 2403000A */ addiu $v1, $zero, 0xa
/* 8446C 800EAFBC AE240000 */ sw $a0, ($s1)
/* 84470 800EAFC0 A0430004 */ sb $v1, 4($v0)
/* 84474 800EAFC4 3C018011 */ lui $at, %hi(D_8010CD30)
/* 84478 800EAFC8 0803AC53 */ j .L800EB14C_845FC
/* 8447C 800EAFCC AC30CD30 */ sw $s0, %lo(D_8010CD30)($at)
.L800EAFD0_84480:
/* 84480 800EAFD0 3C108011 */ lui $s0, %hi(D_8010CD34)
/* 84484 800EAFD4 2610CD34 */ addiu $s0, $s0, %lo(D_8010CD34)
/* 84488 800EAFD8 8E030000 */ lw $v1, ($s0)
/* 8448C 800EAFDC 24110001 */ addiu $s1, $zero, 1
/* 84490 800EAFE0 3C018011 */ lui $at, %hi(D_8010CFC4)
/* 84494 800EAFE4 AC31CFC4 */ sw $s1, %lo(D_8010CFC4)($at)
/* 84498 800EAFE8 10710017 */ beq $v1, $s1, .L800EB048
/* 8449C 800EAFEC 28620002 */ slti $v0, $v1, 2
/* 844A0 800EAFF0 50400005 */ beql $v0, $zero, .L800EB008
/* 844A4 800EAFF4 24020002 */ addiu $v0, $zero, 2
/* 844A8 800EAFF8 10600007 */ beqz $v1, .L800EB018
/* 844AC 800EAFFC 00000000 */ nop
/* 844B0 800EB000 0803AC53 */ j .L800EB14C_845FC
/* 844B4 800EB004 00000000 */ nop
.L800EB008:
/* 844B8 800EB008 10620015 */ beq $v1, $v0, .L800EB060
/* 844BC 800EB00C 00000000 */ nop
/* 844C0 800EB010 0803AC53 */ j .L800EB14C_845FC
/* 844C4 800EB014 00000000 */ nop
.L800EB018:
/* 844C8 800EB018 0C03805E */ jal disable_player_input
/* 844CC 800EB01C 00000000 */ nop
/* 844D0 800EB020 3C028011 */ lui $v0, %hi(wPartner)
/* 844D4 800EB024 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 844D8 800EB028 3C048011 */ lui $a0, %hi(wPartnerNpc)
/* 844DC 800EB02C 8C84C930 */ lw $a0, %lo(wPartnerNpc)($a0)
/* 844E0 800EB030 8C420010 */ lw $v0, 0x10($v0)
/* 844E4 800EB034 0040F809 */ jalr $v0
/* 844E8 800EB038 00000000 */ nop
/* 844EC 800EB03C 8E020000 */ lw $v0, ($s0)
/* 844F0 800EB040 24420001 */ addiu $v0, $v0, 1
/* 844F4 800EB044 AE020000 */ sw $v0, ($s0)
.L800EB048:
/* 844F8 800EB048 3C038011 */ lui $v1, %hi(D_8010CD34)
/* 844FC 800EB04C 2463CD34 */ addiu $v1, $v1, %lo(D_8010CD34)
.L800EB050:
/* 84500 800EB050 8C620000 */ lw $v0, ($v1)
/* 84504 800EB054 24420001 */ addiu $v0, $v0, 1
/* 84508 800EB058 0803AC53 */ j .L800EB14C_845FC
/* 8450C 800EB05C AC620000 */ sw $v0, ($v1)
.L800EB060:
/* 84510 800EB060 80A20000 */ lb $v0, ($a1)
/* 84514 800EB064 10510019 */ beq $v0, $s1, .L800EB0CC
/* 84518 800EB068 24050014 */ addiu $a1, $zero, 0x14
/* 8451C 800EB06C 3C028011 */ lui $v0, %hi(wPartner)
/* 84520 800EB070 8C42CFEC */ lw $v0, %lo(wPartner)($v0)
/* 84524 800EB074 C4C00028 */ lwc1 $f0, 0x28($a2)
/* 84528 800EB078 C4C2002C */ lwc1 $f2, 0x2c($a2)
/* 8452C 800EB07C C4C40030 */ lwc1 $f4, 0x30($a2)
/* 84530 800EB080 8C440018 */ lw $a0, 0x18($v0)
/* 84534 800EB084 3C018010 */ lui $at, %hi(wSavedPartnerPosX)
/* 84538 800EB088 E420833C */ swc1 $f0, %lo(wSavedPartnerPosX)($at)
/* 8453C 800EB08C 3C018010 */ lui $at, %hi(wSavedPartnerPosY)
/* 84540 800EB090 E4228340 */ swc1 $f2, %lo(wSavedPartnerPosY)($at)
/* 84544 800EB094 3C018010 */ lui $at, %hi(wSavedPartnerPosZ)
/* 84548 800EB098 E4248344 */ swc1 $f4, %lo(wSavedPartnerPosZ)($at)
/* 8454C 800EB09C 0C0B0CF8 */ jal start_script
/* 84550 800EB0A0 24060020 */ addiu $a2, $zero, 0x20
/* 84554 800EB0A4 3C038011 */ lui $v1, %hi(wPartnerNpc)
/* 84558 800EB0A8 8C63C930 */ lw $v1, %lo(wPartnerNpc)($v1)
/* 8455C 800EB0AC 8C440144 */ lw $a0, 0x144($v0)
/* 84560 800EB0B0 3C018011 */ lui $at, %hi(wPartnerCurrentScript)
/* 84564 800EB0B4 AC22CFD4 */ sw $v0, %lo(wPartnerCurrentScript)($at)
/* 84568 800EB0B8 AC43014C */ sw $v1, 0x14c($v0)
/* 8456C 800EB0BC 2403000A */ addiu $v1, $zero, 0xa
/* 84570 800EB0C0 3C018011 */ lui $at, %hi(wPartnerCurrentScriptID)
/* 84574 800EB0C4 AC24CFDC */ sw $a0, %lo(wPartnerCurrentScriptID)($at)
/* 84578 800EB0C8 A0430004 */ sb $v1, 4($v0)
.L800EB0CC:
/* 8457C 800EB0CC 0C038069 */ jal enable_player_input
/* 84580 800EB0D0 00000000 */ nop
/* 84584 800EB0D4 3C018011 */ lui $at, %hi(D_8010CD30)
/* 84588 800EB0D8 0803AC53 */ j .L800EB14C_845FC
/* 8458C 800EB0DC AC31CD30 */ sw $s1, %lo(D_8010CD30)($at)
.L800EB0E0_84590:
/* 84590 800EB0E0 3C108011 */ lui $s0, %hi(D_8010CD34)
/* 84594 800EB0E4 2610CD34 */ addiu $s0, $s0, %lo(D_8010CD34)
/* 84598 800EB0E8 8E020000 */ lw $v0, ($s0)
/* 8459C 800EB0EC 14400017 */ bnez $v0, .L800EB14C_845FC
/* 845A0 800EB0F0 00000000 */ nop
/* 845A4 800EB0F4 3C118011 */ lui $s1, %hi(wPartnerCurrentScriptID)
/* 845A8 800EB0F8 2631CFDC */ addiu $s1, $s1, %lo(wPartnerCurrentScriptID)
/* 845AC 800EB0FC 0C0B1059 */ jal does_script_exist
/* 845B0 800EB100 8E240000 */ lw $a0, ($s1)
/* 845B4 800EB104 10400003 */ beqz $v0, .L800EB114
/* 845B8 800EB108 00000000 */ nop
/* 845BC 800EB10C 0C0B102B */ jal kill_script_by_ID
/* 845C0 800EB110 8E240000 */ lw $a0, ($s1)
.L800EB114:
/* 845C4 800EB114 8E020000 */ lw $v0, ($s0)
/* 845C8 800EB118 24420001 */ addiu $v0, $v0, 1
/* 845CC 800EB11C 0803AC53 */ j .L800EB14C_845FC
/* 845D0 800EB120 AE020000 */ sw $v0, ($s0)
.L800EB124_845D4:
/* 845D4 800EB124 3C048011 */ lui $a0, %hi(D_8010CFC4)
/* 845D8 800EB128 2484CFC4 */ addiu $a0, $a0, %lo(D_8010CFC4)
/* 845DC 800EB12C 3C018011 */ lui $at, %hi(D_8010CD30)
/* 845E0 800EB130 AC20CD30 */ sw $zero, %lo(D_8010CD30)($at)
/* 845E4 800EB134 3C018011 */ lui $at, %hi(D_8010CFE0)
/* 845E8 800EB138 AC20CFE0 */ sw $zero, %lo(D_8010CFE0)($at)
/* 845EC 800EB13C 8C830000 */ lw $v1, ($a0)
/* 845F0 800EB140 24020003 */ addiu $v0, $zero, 3
/* 845F4 800EB144 54620001 */ bnel $v1, $v0, .L800EB14C_845FC
/* 845F8 800EB148 AC800000 */ sw $zero, ($a0)
.L800EB14C_845FC:
/* 845FC 800EB14C 8FBF0020 */ lw $ra, 0x20($sp)
/* 84600 800EB150 8FB3001C */ lw $s3, 0x1c($sp)
/* 84604 800EB154 8FB20018 */ lw $s2, 0x18($sp)
/* 84608 800EB158 8FB10014 */ lw $s1, 0x14($sp)
/* 8460C 800EB15C 8FB00010 */ lw $s0, 0x10($sp)
/* 84610 800EB160 03E00008 */ jr $ra
/* 84614 800EB164 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,286 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel partner_flying_update_motion
/* 86A80 800ED5D0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* 86A84 800ED5D4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* 86A88 800ED5D8 27BDFFB0 */ addiu $sp, $sp, -0x50
/* 86A8C 800ED5DC AFB00030 */ sw $s0, 0x30($sp)
/* 86A90 800ED5E0 AFB20038 */ sw $s2, 0x38($sp)
/* 86A94 800ED5E4 3C128011 */ lui $s2, %hi(gPlayerStatus)
/* 86A98 800ED5E8 2652EFC8 */ addiu $s2, $s2, %lo(gPlayerStatus)
/* 86A9C 800ED5EC AFBF004C */ sw $ra, 0x4c($sp)
/* 86AA0 800ED5F0 AFB60048 */ sw $s6, 0x48($sp)
/* 86AA4 800ED5F4 AFB50044 */ sw $s5, 0x44($sp)
/* 86AA8 800ED5F8 AFB40040 */ sw $s4, 0x40($sp)
/* 86AAC 800ED5FC AFB3003C */ sw $s3, 0x3c($sp)
/* 86AB0 800ED600 AFB10034 */ sw $s1, 0x34($sp)
/* 86AB4 800ED604 80420081 */ lb $v0, 0x81($v0)
/* 86AB8 800ED608 3C118011 */ lui $s1, %hi(gPartnerActionStatus)
/* 86ABC 800ED60C 2631EBB0 */ addiu $s1, $s1, %lo(gPartnerActionStatus)
/* 86AC0 800ED610 1040000B */ beqz $v0, .L800ED640
/* 86AC4 800ED614 0080802D */ daddu $s0, $a0, $zero
/* 86AC8 800ED618 8E420000 */ lw $v0, ($s2)
/* 86ACC 800ED61C 30423000 */ andi $v0, $v0, 0x3000
/* 86AD0 800ED620 14400007 */ bnez $v0, .L800ED640
/* 86AD4 800ED624 00000000 */ nop
/* 86AD8 800ED628 82220014 */ lb $v0, 0x14($s1)
/* 86ADC 800ED62C 14400004 */ bnez $v0, .L800ED640
/* 86AE0 800ED630 00000000 */ nop
/* 86AE4 800ED634 82220002 */ lb $v0, 2($s1)
/* 86AE8 800ED638 1040000F */ beqz $v0, .L800ED678
/* 86AEC 800ED63C 00000000 */ nop
.L800ED640:
/* 86AF0 800ED640 8E420004 */ lw $v0, 4($s2)
/* 86AF4 800ED644 30420800 */ andi $v0, $v0, 0x800
/* 86AF8 800ED648 10400005 */ beqz $v0, .L800ED660
/* 86AFC 800ED64C 00000000 */ nop
/* 86B00 800ED650 3C028010 */ lui $v0, %hi(D_800F8020)
/* 86B04 800ED654 8C428020 */ lw $v0, %lo(D_800F8020)($v0)
/* 86B08 800ED658 14400003 */ bnez $v0, .L800ED668
/* 86B0C 800ED65C 00000000 */ nop
.L800ED660:
/* 86B10 800ED660 0C03B67E */ jal partner_flying_follow_player
/* 86B14 800ED664 0200202D */ daddu $a0, $s0, $zero
.L800ED668:
/* 86B18 800ED668 8E22000C */ lw $v0, 0xc($s1)
/* 86B1C 800ED66C 30426006 */ andi $v0, $v0, 0x6006
/* 86B20 800ED670 54400001 */ bnel $v0, $zero, .L800ED678
/* 86B24 800ED674 A2200002 */ sb $zero, 2($s1)
.L800ED678:
/* 86B28 800ED678 3C038011 */ lui $v1, %hi(D_8010CFC8)
/* 86B2C 800ED67C 8463CFC8 */ lh $v1, %lo(D_8010CFC8)($v1)
/* 86B30 800ED680 24020032 */ addiu $v0, $zero, 0x32
/* 86B34 800ED684 10620017 */ beq $v1, $v0, .L800ED6E4
/* 86B38 800ED688 0000202D */ daddu $a0, $zero, $zero
/* 86B3C 800ED68C C600003C */ lwc1 $f0, 0x3c($s0)
/* 86B40 800ED690 C642002C */ lwc1 $f2, 0x2c($s2)
/* 86B44 800ED694 46020001 */ sub.s $f0, $f0, $f2
/* 86B48 800ED698 3C01447A */ lui $at, 0x447a
/* 86B4C 800ED69C 44811000 */ mtc1 $at, $f2
/* 86B50 800ED6A0 46000005 */ abs.s $f0, $f0
/* 86B54 800ED6A4 4600103C */ c.lt.s $f2, $f0
/* 86B58 800ED6A8 00000000 */ nop
/* 86B5C 800ED6AC 4500000D */ bc1f .L800ED6E4
/* 86B60 800ED6B0 2403F7FF */ addiu $v1, $zero, -0x801
/* 86B64 800ED6B4 C6400028 */ lwc1 $f0, 0x28($s2)
/* 86B68 800ED6B8 8E020000 */ lw $v0, ($s0)
/* 86B6C 800ED6BC E6000038 */ swc1 $f0, 0x38($s0)
/* 86B70 800ED6C0 C640002C */ lwc1 $f0, 0x2c($s2)
/* 86B74 800ED6C4 E600003C */ swc1 $f0, 0x3c($s0)
/* 86B78 800ED6C8 C6400030 */ lwc1 $f0, 0x30($s2)
/* 86B7C 800ED6CC 00431024 */ and $v0, $v0, $v1
/* 86B80 800ED6D0 AE00001C */ sw $zero, 0x1c($s0)
/* 86B84 800ED6D4 AE000014 */ sw $zero, 0x14($s0)
/* 86B88 800ED6D8 AE020000 */ sw $v0, ($s0)
/* 86B8C 800ED6DC E6000040 */ swc1 $f0, 0x40($s0)
/* 86B90 800ED6E0 0000202D */ daddu $a0, $zero, $zero
.L800ED6E4:
/* 86B94 800ED6E4 27B30020 */ addiu $s3, $sp, 0x20
/* 86B98 800ED6E8 0260282D */ daddu $a1, $s3, $zero
/* 86B9C 800ED6EC 27B50024 */ addiu $s5, $sp, 0x24
/* 86BA0 800ED6F0 02A0302D */ daddu $a2, $s5, $zero
/* 86BA4 800ED6F4 27B60028 */ addiu $s6, $sp, 0x28
/* 86BA8 800ED6F8 02C0382D */ daddu $a3, $s6, $zero
/* 86BAC 800ED6FC 860200A8 */ lh $v0, 0xa8($s0)
/* 86BB0 800ED700 3C013F00 */ lui $at, 0x3f00
/* 86BB4 800ED704 44811000 */ mtc1 $at, $f2
/* 86BB8 800ED708 44823000 */ mtc1 $v0, $f6
/* 86BBC 800ED70C 00000000 */ nop
/* 86BC0 800ED710 468031A0 */ cvt.s.w $f6, $f6
/* 86BC4 800ED714 46023182 */ mul.s $f6, $f6, $f2
/* 86BC8 800ED718 00000000 */ nop
/* 86BCC 800ED71C 3C148010 */ lui $s4, %hi(D_800F8020)
/* 86BD0 800ED720 26948020 */ addiu $s4, $s4, %lo(D_800F8020)
/* 86BD4 800ED724 27B1002C */ addiu $s1, $sp, 0x2c
/* 86BD8 800ED728 C6000038 */ lwc1 $f0, 0x38($s0)
/* 86BDC 800ED72C 44822000 */ mtc1 $v0, $f4
/* 86BE0 800ED730 00000000 */ nop
/* 86BE4 800ED734 46802120 */ cvt.s.w $f4, $f4
/* 86BE8 800ED738 46022102 */ mul.s $f4, $f4, $f2
/* 86BEC 800ED73C 00000000 */ nop
/* 86BF0 800ED740 AE800000 */ sw $zero, ($s4)
/* 86BF4 800ED744 E7A00020 */ swc1 $f0, 0x20($sp)
/* 86BF8 800ED748 C600003C */ lwc1 $f0, 0x3c($s0)
/* 86BFC 800ED74C C6020040 */ lwc1 $f2, 0x40($s0)
/* 86C00 800ED750 46060000 */ add.s $f0, $f0, $f6
/* 86C04 800ED754 E7A20028 */ swc1 $f2, 0x28($sp)
/* 86C08 800ED758 E7A4002C */ swc1 $f4, 0x2c($sp)
/* 86C0C 800ED75C E7A00024 */ swc1 $f0, 0x24($sp)
/* 86C10 800ED760 0C03739C */ jal npc_raycast_up
/* 86C14 800ED764 AFB10010 */ sw $s1, 0x10($sp)
/* 86C18 800ED768 10400006 */ beqz $v0, .L800ED784
/* 86C1C 800ED76C 24020001 */ addiu $v0, $zero, 1
/* 86C20 800ED770 C6000038 */ lwc1 $f0, 0x38($s0)
/* 86C24 800ED774 C602003C */ lwc1 $f2, 0x3c($s0)
/* 86C28 800ED778 C6040040 */ lwc1 $f4, 0x40($s0)
/* 86C2C 800ED77C 0803B66E */ j .L800ED9B8
/* 86C30 800ED780 AE820000 */ sw $v0, ($s4)
.L800ED784:
/* 86C34 800ED784 0C03BD90 */ jal partner_do_player_collision
/* 86C38 800ED788 0200202D */ daddu $a0, $s0, $zero
/* 86C3C 800ED78C 3C038011 */ lui $v1, %hi(D_8010CFC8)
/* 86C40 800ED790 8463CFC8 */ lh $v1, %lo(D_8010CFC8)($v1)
/* 86C44 800ED794 24020032 */ addiu $v0, $zero, 0x32
/* 86C48 800ED798 10620084 */ beq $v1, $v0, .L800ED9AC
/* 86C4C 800ED79C 3C040001 */ lui $a0, 1
/* 86C50 800ED7A0 C6000038 */ lwc1 $f0, 0x38($s0)
/* 86C54 800ED7A4 C602003C */ lwc1 $f2, 0x3c($s0)
/* 86C58 800ED7A8 C6040040 */ lwc1 $f4, 0x40($s0)
/* 86C5C 800ED7AC 3C01447A */ lui $at, 0x447a
/* 86C60 800ED7B0 44813000 */ mtc1 $at, $f6
/* 86C64 800ED7B4 0260282D */ daddu $a1, $s3, $zero
/* 86C68 800ED7B8 E7A00020 */ swc1 $f0, 0x20($sp)
/* 86C6C 800ED7BC E7A20024 */ swc1 $f2, 0x24($sp)
/* 86C70 800ED7C0 E7A40028 */ swc1 $f4, 0x28($sp)
/* 86C74 800ED7C4 E7A6002C */ swc1 $f6, 0x2c($sp)
/* 86C78 800ED7C8 AFB10010 */ sw $s1, 0x10($sp)
/* 86C7C 800ED7CC C600000C */ lwc1 $f0, 0xc($s0)
/* 86C80 800ED7D0 02A0302D */ daddu $a2, $s5, $zero
/* 86C84 800ED7D4 E7A00014 */ swc1 $f0, 0x14($sp)
/* 86C88 800ED7D8 860200A6 */ lh $v0, 0xa6($s0)
/* 86C8C 800ED7DC 02C0382D */ daddu $a3, $s6, $zero
/* 86C90 800ED7E0 44820000 */ mtc1 $v0, $f0
/* 86C94 800ED7E4 00000000 */ nop
/* 86C98 800ED7E8 46800020 */ cvt.s.w $f0, $f0
/* 86C9C 800ED7EC 0C0371DE */ jal npc_raycast_down_around
/* 86CA0 800ED7F0 E7A00018 */ swc1 $f0, 0x18($sp)
/* 86CA4 800ED7F4 14400003 */ bnez $v0, .L800ED804
/* 86CA8 800ED7F8 00000000 */ nop
/* 86CAC 800ED7FC C640002C */ lwc1 $f0, 0x2c($s2)
/* 86CB0 800ED800 E7A00024 */ swc1 $f0, 0x24($sp)
.L800ED804:
/* 86CB4 800ED804 960200A8 */ lhu $v0, 0xa8($s0)
/* 86CB8 800ED808 C7A60024 */ lwc1 $f6, 0x24($sp)
/* 86CBC 800ED80C 00021400 */ sll $v0, $v0, 0x10
/* 86CC0 800ED810 00021C03 */ sra $v1, $v0, 0x10
/* 86CC4 800ED814 44830000 */ mtc1 $v1, $f0
/* 86CC8 800ED818 00000000 */ nop
/* 86CCC 800ED81C 46800020 */ cvt.s.w $f0, $f0
/* 86CD0 800ED820 46003200 */ add.s $f8, $f6, $f0
/* 86CD4 800ED824 3C014000 */ lui $at, 0x4000
/* 86CD8 800ED828 44815000 */ mtc1 $at, $f10
/* 86CDC 800ED82C 00000000 */ nop
/* 86CE0 800ED830 460A4000 */ add.s $f0, $f8, $f10
/* 86CE4 800ED834 C604003C */ lwc1 $f4, 0x3c($s0)
/* 86CE8 800ED838 4600203E */ c.le.s $f4, $f0
/* 86CEC 800ED83C 00000000 */ nop
/* 86CF0 800ED840 45000024 */ bc1f .L800ED8D4
/* 86CF4 800ED844 00000000 */ nop
/* 86CF8 800ED848 C6420054 */ lwc1 $f2, 0x54($s2)
/* 86CFC 800ED84C 44800000 */ mtc1 $zero, $f0
/* 86D00 800ED850 00000000 */ nop
/* 86D04 800ED854 46001032 */ c.eq.s $f2, $f0
/* 86D08 800ED858 00000000 */ nop
/* 86D0C 800ED85C 4501000C */ bc1t .L800ED890
/* 86D10 800ED860 000217C2 */ srl $v0, $v0, 0x1f
/* 86D14 800ED864 00621021 */ addu $v0, $v1, $v0
/* 86D18 800ED868 00021043 */ sra $v0, $v0, 1
/* 86D1C 800ED86C 44820000 */ mtc1 $v0, $f0
/* 86D20 800ED870 00000000 */ nop
/* 86D24 800ED874 46800020 */ cvt.s.w $f0, $f0
/* 86D28 800ED878 46003000 */ add.s $f0, $f6, $f0
/* 86D2C 800ED87C 460A0000 */ add.s $f0, $f0, $f10
/* 86D30 800ED880 3C013E00 */ lui $at, 0x3e00
/* 86D34 800ED884 44811000 */ mtc1 $at, $f2
/* 86D38 800ED888 0803B662 */ j .L800ED988
/* 86D3C 800ED88C 46040001 */ sub.s $f0, $f0, $f4
.L800ED890:
/* 86D40 800ED890 C642002C */ lwc1 $f2, 0x2c($s2)
/* 86D44 800ED894 4602303C */ c.lt.s $f6, $f2
/* 86D48 800ED898 00000000 */ nop
/* 86D4C 800ED89C 45000005 */ bc1f .L800ED8B4
/* 86D50 800ED8A0 00000000 */ nop
/* 86D54 800ED8A4 3C014120 */ lui $at, 0x4120
/* 86D58 800ED8A8 44810000 */ mtc1 $at, $f0
/* 86D5C 800ED8AC 0803B631 */ j .L800ED8C4
/* 86D60 800ED8B0 46001000 */ add.s $f0, $f2, $f0
.L800ED8B4:
/* 86D64 800ED8B4 3C014120 */ lui $at, 0x4120
/* 86D68 800ED8B8 44810000 */ mtc1 $at, $f0
/* 86D6C 800ED8BC 00000000 */ nop
/* 86D70 800ED8C0 46003000 */ add.s $f0, $f6, $f0
.L800ED8C4:
/* 86D74 800ED8C4 3C013E80 */ lui $at, 0x3e80
/* 86D78 800ED8C8 44811000 */ mtc1 $at, $f2
/* 86D7C 800ED8CC 0803B662 */ j .L800ED988
/* 86D80 800ED8D0 46040001 */ sub.s $f0, $f0, $f4
.L800ED8D4:
/* 86D84 800ED8D4 864200B0 */ lh $v0, 0xb0($s2)
/* 86D88 800ED8D8 C642002C */ lwc1 $f2, 0x2c($s2)
/* 86D8C 800ED8DC 44820000 */ mtc1 $v0, $f0
/* 86D90 800ED8E0 00000000 */ nop
/* 86D94 800ED8E4 46800020 */ cvt.s.w $f0, $f0
/* 86D98 800ED8E8 46001080 */ add.s $f2, $f2, $f0
/* 86D9C 800ED8EC 4606103C */ c.lt.s $f2, $f6
/* 86DA0 800ED8F0 00000000 */ nop
/* 86DA4 800ED8F4 4500001C */ bc1f .L800ED968
/* 86DA8 800ED8F8 00000000 */ nop
/* 86DAC 800ED8FC 46044081 */ sub.s $f2, $f8, $f4
/* 86DB0 800ED900 3C013E00 */ lui $at, 0x3e00
/* 86DB4 800ED904 44810000 */ mtc1 $at, $f0
/* 86DB8 800ED908 00000000 */ nop
/* 86DBC 800ED90C 46001082 */ mul.s $f2, $f2, $f0
/* 86DC0 800ED910 00000000 */ nop
/* 86DC4 800ED914 860200A8 */ lh $v0, 0xa8($s0)
/* 86DC8 800ED918 44820000 */ mtc1 $v0, $f0
/* 86DCC 800ED91C 00000000 */ nop
/* 86DD0 800ED920 46800020 */ cvt.s.w $f0, $f0
/* 86DD4 800ED924 46003000 */ add.s $f0, $f6, $f0
/* 86DD8 800ED928 C608003C */ lwc1 $f8, 0x3c($s0)
/* 86DDC 800ED92C 46024100 */ add.s $f4, $f8, $f2
/* 86DE0 800ED930 3C028010 */ lui $v0, %hi(D_800F84F8)
/* 86DE4 800ED934 244284F8 */ addiu $v0, $v0, %lo(D_800F84F8)
/* 86DE8 800ED938 4600203E */ c.le.s $f4, $f0
/* 86DEC 800ED93C 00000000 */ nop
/* 86DF0 800ED940 45000015 */ bc1f .L800ED998
/* 86DF4 800ED944 E4420000 */ swc1 $f2, ($v0)
/* 86DF8 800ED948 46080001 */ sub.s $f0, $f0, $f8
/* 86DFC 800ED94C 3C013E80 */ lui $at, 0x3e80
/* 86E00 800ED950 44811000 */ mtc1 $at, $f2
/* 86E04 800ED954 00000000 */ nop
/* 86E08 800ED958 46020002 */ mul.s $f0, $f0, $f2
/* 86E0C 800ED95C 00000000 */ nop
/* 86E10 800ED960 0803B666 */ j .L800ED998
/* 86E14 800ED964 E4400000 */ swc1 $f0, ($v0)
.L800ED968:
/* 86E18 800ED968 3C0140A0 */ lui $at, 0x40a0
/* 86E1C 800ED96C 44810000 */ mtc1 $at, $f0
/* 86E20 800ED970 00000000 */ nop
/* 86E24 800ED974 46001000 */ add.s $f0, $f2, $f0
/* 86E28 800ED978 46040001 */ sub.s $f0, $f0, $f4
/* 86E2C 800ED97C 3C013D80 */ lui $at, 0x3d80
/* 86E30 800ED980 44811000 */ mtc1 $at, $f2
/* 86E34 800ED984 00000000 */ nop
.L800ED988:
/* 86E38 800ED988 46020002 */ mul.s $f0, $f0, $f2
/* 86E3C 800ED98C 00000000 */ nop
/* 86E40 800ED990 3C018010 */ lui $at, %hi(D_800F84F8)
/* 86E44 800ED994 E42084F8 */ swc1 $f0, %lo(D_800F84F8)($at)
.L800ED998:
/* 86E48 800ED998 C600003C */ lwc1 $f0, 0x3c($s0)
/* 86E4C 800ED99C 3C018010 */ lui $at, %hi(D_800F84F8)
/* 86E50 800ED9A0 C42284F8 */ lwc1 $f2, %lo(D_800F84F8)($at)
/* 86E54 800ED9A4 46020000 */ add.s $f0, $f0, $f2
/* 86E58 800ED9A8 E600003C */ swc1 $f0, 0x3c($s0)
.L800ED9AC:
/* 86E5C 800ED9AC C6000038 */ lwc1 $f0, 0x38($s0)
/* 86E60 800ED9B0 C602003C */ lwc1 $f2, 0x3c($s0)
/* 86E64 800ED9B4 C6040040 */ lwc1 $f4, 0x40($s0)
.L800ED9B8:
/* 86E68 800ED9B8 3C018010 */ lui $at, %hi(wSavedPartnerPosX)
/* 86E6C 800ED9BC E420833C */ swc1 $f0, %lo(wSavedPartnerPosX)($at)
/* 86E70 800ED9C0 3C018010 */ lui $at, %hi(wSavedPartnerPosY)
/* 86E74 800ED9C4 E4228340 */ swc1 $f2, %lo(wSavedPartnerPosY)($at)
/* 86E78 800ED9C8 3C018010 */ lui $at, %hi(wSavedPartnerPosZ)
/* 86E7C 800ED9CC E4248344 */ swc1 $f4, %lo(wSavedPartnerPosZ)($at)
/* 86E80 800ED9D0 8FBF004C */ lw $ra, 0x4c($sp)
/* 86E84 800ED9D4 8FB60048 */ lw $s6, 0x48($sp)
/* 86E88 800ED9D8 8FB50044 */ lw $s5, 0x44($sp)
/* 86E8C 800ED9DC 8FB40040 */ lw $s4, 0x40($sp)
/* 86E90 800ED9E0 8FB3003C */ lw $s3, 0x3c($sp)
/* 86E94 800ED9E4 8FB20038 */ lw $s2, 0x38($sp)
/* 86E98 800ED9E8 8FB10034 */ lw $s1, 0x34($sp)
/* 86E9C 800ED9EC 8FB00030 */ lw $s0, 0x30($sp)
/* 86EA0 800ED9F0 03E00008 */ jr $ra
/* 86EA4 800ED9F4 27BD0050 */ addiu $sp, $sp, 0x50

View File

@ -25975,11 +25975,6 @@ wPartnerCurrentScriptID = 0x8010CFDC; // type:data
D_8010CFE0 = 0x8010CFE0; // type:data D_8010CFE0 = 0x8010CFE0; // type:data
D_8010CFE4 = 0x8010CFE4; // type:data D_8010CFE4 = 0x8010CFE4; // type:data
D_8010CFE8 = 0x8010CFE8; // type:data D_8010CFE8 = 0x8010CFE8; // type:data
dead_80117163 = 0x80117160; // type:data
dead_gPartnerActionStatus = 0x80117160; // type:data
dead_gPlayerStatus = 0x80117578; // type:data
dead_gPlayerActionState = 0x8011762C; // type:data
dead_gPlayerData = 0x80117840; // type:data
_render_transition_stencil = 0x80136A80; // type:func _render_transition_stencil = 0x80136A80; // type:func
get_default_variation_for_song = 0x8014A430; // get_default_variation_for_song = 0x8014A430; //
D_8014F120 = 0x8014F120; // type:data D_8014F120 = 0x8014F120; // type:data