mirror of
https://github.com/pmret/papermario.git
synced 2024-11-08 12:02:30 +01:00
parent
a773da8c2d
commit
0e2d3b96d4
@ -186,24 +186,24 @@ typedef struct NpcQuizmoBlur {
|
||||
/* 0x04 */ char unk_04[0x4];
|
||||
} NpcQuizmoBlur; // size = 0x8;
|
||||
|
||||
typedef struct Unk2A4Part {
|
||||
/* 0x00 */ s8 unk_00;
|
||||
typedef struct NpcHistoryPoint {
|
||||
/* 0x00 */ s8 isAirborne;
|
||||
/* 0x01 */ char unk_01[0x3];
|
||||
/* 0x04 */ Vec3f pos;
|
||||
} Unk2A4Part; // size = 0x10
|
||||
} NpcHistoryPoint; // size = 0x10
|
||||
|
||||
typedef struct Unk2A4Blur {
|
||||
/* 0x000 */ Unk2A4Part unk_00[40];
|
||||
/* 0x280 */ s32 partIdx;
|
||||
/* 0x284 */ s32 unk_284;
|
||||
/* 0x288 */ s32 unk_288;
|
||||
/* 0x28C */ s32 npcID;
|
||||
typedef struct NpcFollowData {
|
||||
/* 0x000 */ NpcHistoryPoint moveHistory[40];
|
||||
/* 0x280 */ s32 lastPointIdx;
|
||||
/* 0x284 */ s32 targetPointIdx;
|
||||
/* 0x288 */ s32 followState;
|
||||
/* 0x28C */ s32 targetNpcID;
|
||||
/* 0x290 */ s32* animIDs;
|
||||
/* 0x294 */ f32 unk_294;
|
||||
/* 0x298 */ f32 unk_298;
|
||||
/* 0x29C */ f32 unk_29C;
|
||||
/* 0x2A0 */ f32 unk_2A0;
|
||||
} Unk2A4Blur; // size = 0x2A4
|
||||
/* 0x294 */ f32 walkSpeed;
|
||||
/* 0x298 */ f32 runSpeed;
|
||||
/* 0x29C */ f32 idleRadius;
|
||||
/* 0x2A0 */ f32 walkRadius;
|
||||
} NpcFollowData; // size = 0x2A4
|
||||
|
||||
typedef struct Npc {
|
||||
/* 0x000 */ s32 flags;
|
||||
@ -219,7 +219,7 @@ typedef struct Npc {
|
||||
NpcMotionBlur* motion; ///< Null unless flag 0x100000 is set.
|
||||
NpcChompBlur* chomp;
|
||||
NpcQuizmoBlur* quizmo;
|
||||
Unk2A4Blur* unk2A4;
|
||||
NpcFollowData* followData;
|
||||
struct Npc* keepAwayNpc;
|
||||
s32* keepAwayStarted;
|
||||
} blur;
|
||||
|
@ -1026,9 +1026,9 @@ void sync_status_menu(void);
|
||||
void create_cameras_a(void);
|
||||
void func_80045AC0(void);
|
||||
void func_8005AF84(void);
|
||||
void func_8005DECC(Npc*, s32, s32*, f32, f32, s32, s32);
|
||||
void func_8005DFD4(Npc*);
|
||||
void func_8005E12C(Npc*);
|
||||
void npc_follow_init(Npc*, s32, s32*, f32, f32, s32, s32);
|
||||
void npc_update_npc_tracking(Npc*);
|
||||
void npc_follow_npc(Npc*);
|
||||
void create_encounters(void);
|
||||
void update_encounters_neutral(void);
|
||||
void update_encounters_pre_battle(void);
|
||||
|
@ -1,5 +1,12 @@
|
||||
#include "common.h"
|
||||
|
||||
enum NpcFollowStates {
|
||||
NPC_FOLLOW_STATE_RUN = 0,
|
||||
NPC_FOLLOW_STATE_JUMP = 1,
|
||||
NPC_FOLLOW_STATE_FALL = 2,
|
||||
NPC_FOLLOW_STATE_IDLE = 10,
|
||||
};
|
||||
|
||||
void get_npc_pos(s32 npcID, f32* outX, f32* outY, f32* outZ, s32* outAirborne) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
Npc* npc;
|
||||
@ -28,122 +35,118 @@ void get_npc_pos(s32 npcID, f32* outX, f32* outY, f32* outZ, s32* outAirborne) {
|
||||
|
||||
}
|
||||
|
||||
void func_8005DECC(Npc* npc, s32 arg1, s32* animIDs, f32 arg3, f32 arg4, s32 arg5, s32 arg6) {
|
||||
void npc_follow_init(Npc* npc, s32 targetNpcID, s32* animIDs, f32 walkSpeed, f32 runSpeed, s32 idleRadius, s32 walkRadius) {
|
||||
PlayerStatus* playerStatus = &gPlayerStatus;
|
||||
Unk2A4Blur* blur;
|
||||
NpcFollowData* followData;
|
||||
s32 i;
|
||||
|
||||
npc->blur.unk2A4 = blur = heap_malloc(sizeof(*blur));
|
||||
ASSERT(blur != NULL);
|
||||
npc->blur.followData = followData = heap_malloc(sizeof(*followData));
|
||||
ASSERT(followData != NULL);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(blur->unk_00); i++) {
|
||||
blur->unk_00[i].pos.x = playerStatus->position.x;
|
||||
blur->unk_00[i].pos.y = playerStatus->position.y;
|
||||
blur->unk_00[i].pos.z = playerStatus->position.z;
|
||||
blur->unk_00[i].unk_00 = 0;
|
||||
for (i = 0; i < ARRAY_COUNT(followData->moveHistory); i++) {
|
||||
followData->moveHistory[i].pos.x = playerStatus->position.x;
|
||||
followData->moveHistory[i].pos.y = playerStatus->position.y;
|
||||
followData->moveHistory[i].pos.z = playerStatus->position.z;
|
||||
followData->moveHistory[i].isAirborne = FALSE;
|
||||
}
|
||||
blur->partIdx = 0;
|
||||
blur->unk_284 = 0;
|
||||
blur->unk_288 = 0;
|
||||
blur->npcID = arg1;
|
||||
blur->animIDs = animIDs;
|
||||
blur->unk_294 = arg3;
|
||||
blur->unk_298 = arg4;
|
||||
blur->unk_29C = arg5;
|
||||
blur->unk_2A0 = arg6;
|
||||
npc->currentAnim = blur->animIDs[4];
|
||||
followData->lastPointIdx = 0;
|
||||
followData->targetPointIdx = 0;
|
||||
followData->followState = NPC_FOLLOW_STATE_RUN;
|
||||
followData->targetNpcID = targetNpcID;
|
||||
followData->animIDs = animIDs;
|
||||
followData->walkSpeed = walkSpeed;
|
||||
followData->runSpeed = runSpeed;
|
||||
followData->idleRadius = idleRadius;
|
||||
followData->walkRadius = walkRadius;
|
||||
npc->currentAnim = followData->animIDs[4];
|
||||
npc->jumpVelocity = 0.0f;
|
||||
npc->flags |= NPC_FLAG_GRAVITY;
|
||||
npc->flags &= ~NPC_FLAG_100;
|
||||
npc->collisionChannel = 0x10000;
|
||||
npc->collisionChannel = COLLISION_CHANNEL_10000;
|
||||
}
|
||||
|
||||
void func_8005DFD4(Npc* npc) {
|
||||
Unk2A4Blur* blur = npc->blur.unk2A4;
|
||||
void npc_update_npc_tracking(Npc* npc) {
|
||||
NpcFollowData* followData = npc->blur.followData;
|
||||
f32 x, y, z;
|
||||
s32 airborne;
|
||||
s32 isAirborne;
|
||||
Unk2A4Part* part;
|
||||
NpcHistoryPoint* historyPoint;
|
||||
|
||||
get_npc_pos(blur->npcID, &x, &y, &z, &airborne);
|
||||
part = &blur->unk_00[blur->partIdx];
|
||||
get_npc_pos(followData->targetNpcID, &x, &y, &z, &airborne);
|
||||
historyPoint = &followData->moveHistory[followData->lastPointIdx];
|
||||
isAirborne = airborne != FALSE;
|
||||
|
||||
if (part->unk_00 != 0 && isAirborne) {
|
||||
if (historyPoint->isAirborne && isAirborne) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isAirborne && dist2D(npc->pos.x, npc->pos.z, x, z) <= blur->unk_29C && part->unk_00 == 0) {
|
||||
if (!isAirborne && dist2D(npc->pos.x, npc->pos.z, x, z) <= followData->idleRadius && !historyPoint->isAirborne) {
|
||||
return;
|
||||
}
|
||||
|
||||
part = &blur->unk_00[blur->partIdx];
|
||||
if (part->pos.x != x || part->pos.y != y || part->pos.z != z) {
|
||||
if (blur->unk_284 != blur->partIdx + 1) {
|
||||
blur->partIdx++;
|
||||
if (blur->partIdx >= ARRAY_COUNT(blur->unk_00)) {
|
||||
blur->partIdx = 0;
|
||||
historyPoint = &followData->moveHistory[followData->lastPointIdx];
|
||||
if (historyPoint->pos.x != x || historyPoint->pos.y != y || historyPoint->pos.z != z) {
|
||||
if (followData->targetPointIdx != followData->lastPointIdx + 1) {
|
||||
followData->lastPointIdx++;
|
||||
if (followData->lastPointIdx >= ARRAY_COUNT(followData->moveHistory)) {
|
||||
followData->lastPointIdx = 0;
|
||||
}
|
||||
part = &blur->unk_00[blur->partIdx];
|
||||
part->pos.x = x;
|
||||
part->pos.y = y;
|
||||
part->pos.z = z;
|
||||
part->unk_00 = isAirborne;
|
||||
historyPoint = &followData->moveHistory[followData->lastPointIdx];
|
||||
historyPoint->pos.x = x;
|
||||
historyPoint->pos.y = y;
|
||||
historyPoint->pos.z = z;
|
||||
historyPoint->isAirborne = isAirborne;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// float regalloc
|
||||
#ifdef NON_MATCHING
|
||||
void func_8005E12C(Npc* npc) {
|
||||
Unk2A4Blur* blur = npc->blur.unk2A4;
|
||||
void npc_follow_npc(Npc* npc) {
|
||||
NpcFollowData* followData = npc->blur.followData;
|
||||
f32 x, y, z;
|
||||
s32 airborne;
|
||||
f32 sp28;
|
||||
f32 sp2C;
|
||||
f32 sp30;
|
||||
f32 currentX, currentY, currentZ;
|
||||
f32 dist;
|
||||
Unk2A4Part* part;
|
||||
f32 npcX, npcZ;
|
||||
f32 partX, partY, partZ;
|
||||
NpcHistoryPoint* historyPoint;
|
||||
f32 targetX, targetY, targetZ;
|
||||
f32 theta;
|
||||
f32 yaw;
|
||||
|
||||
get_npc_pos(blur->npcID, &x, &y, &z, &airborne);
|
||||
get_npc_pos(followData->targetNpcID, &x, &y, &z, &airborne);
|
||||
|
||||
switch (followData->followState) {
|
||||
case NPC_FOLLOW_STATE_RUN:
|
||||
historyPoint = &followData->moveHistory[followData->targetPointIdx];
|
||||
targetX = historyPoint->pos.x;
|
||||
targetY = historyPoint->pos.y;
|
||||
targetZ = historyPoint->pos.z;
|
||||
currentX = npc->pos.x;
|
||||
currentY = npc->pos.y;
|
||||
currentZ = npc->pos.z;
|
||||
npc->moveSpeed = followData->walkSpeed;
|
||||
|
||||
switch (blur->unk_288) {
|
||||
case 0:
|
||||
part = &blur->unk_00[blur->unk_284];
|
||||
partX = part->pos.x;
|
||||
partZ = part->pos.z;
|
||||
npcX = npc->pos.x;
|
||||
npcZ = npc->pos.z;
|
||||
sp28 = npcX;
|
||||
sp2C = npc->pos.y;
|
||||
sp30 = npcZ;
|
||||
npc->moveSpeed = blur->unk_294;
|
||||
dist = dist2D(npc->pos.x, npc->pos.z, x, z);
|
||||
if (blur->unk_2A0 <= dist) {
|
||||
npc->moveSpeed = blur->unk_298;
|
||||
if (dist >= followData->walkRadius) {
|
||||
npc->moveSpeed = followData->runSpeed;
|
||||
}
|
||||
npc->currentAnim = blur->animIDs[5];
|
||||
|
||||
npc->currentAnim = followData->animIDs[5];
|
||||
if (!(npc->flags & NPC_FLAG_1000)) {
|
||||
npc->currentAnim = blur->animIDs[2];
|
||||
npc->currentAnim = followData->animIDs[2];
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
dist = dist2D(sp28, sp30, partX, partZ);
|
||||
yaw = atan2(sp28, sp30, partX, partZ);
|
||||
if (npc->moveSpeed < dist) {
|
||||
dist = dist2D(sp28, sp30, x, z);
|
||||
if (blur->unk_2A0 < dist) {
|
||||
dist = dist2D(currentX, currentZ, targetX, targetZ);
|
||||
yaw = atan2(currentX, currentZ, targetX, targetZ);
|
||||
if (dist > npc->moveSpeed) {
|
||||
dist = dist2D(currentX, currentZ, x, z);
|
||||
if (dist > followData->walkRadius) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (blur->unk_29C < dist) {
|
||||
npc->moveSpeed = dist - blur->unk_29C;
|
||||
if (npc->moveSpeed > blur->unk_294) {
|
||||
npc->moveSpeed = blur->unk_294;
|
||||
if (dist > followData->idleRadius) {
|
||||
npc->moveSpeed = dist - followData->idleRadius;
|
||||
if (npc->moveSpeed > followData->walkSpeed) {
|
||||
npc->moveSpeed = followData->walkSpeed;
|
||||
} else {
|
||||
npc->moveSpeed += 1.0;
|
||||
}
|
||||
@ -151,35 +154,35 @@ void func_8005E12C(Npc* npc) {
|
||||
}
|
||||
}
|
||||
|
||||
if (blur->unk_284 == blur->partIdx) {
|
||||
if (followData->targetPointIdx == followData->lastPointIdx) {
|
||||
npc->moveSpeed = 0.0f;
|
||||
yaw = npc->yaw;
|
||||
npc->currentAnim = blur->animIDs[4];
|
||||
} else {
|
||||
dist = dist2D(npc->pos.x, npc->pos.z, x, z);
|
||||
if (dist <= blur->unk_29C) {
|
||||
npc->moveSpeed = 0.0f;
|
||||
yaw = npc->yaw;
|
||||
npc->currentAnim = blur->animIDs[4];
|
||||
blur->unk_288 = 0xA;
|
||||
} else {
|
||||
blur->unk_284++;
|
||||
if (blur->unk_284 >= ARRAY_COUNT(blur->unk_00)) {
|
||||
blur->unk_284 = 0;
|
||||
}
|
||||
part = &blur->unk_00[blur->unk_284];
|
||||
partX = part->pos.x;
|
||||
partZ = part->pos.z;
|
||||
if (npc->flags & NPC_FLAG_1000) {
|
||||
if (part->unk_00 != 0) {
|
||||
blur->unk_288 = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
npc->currentAnim = followData->animIDs[4];
|
||||
break;
|
||||
}
|
||||
|
||||
dist = dist2D(npc->pos.x, npc->pos.z, x, z);
|
||||
if (dist <= followData->idleRadius) {
|
||||
npc->moveSpeed = 0.0f;
|
||||
yaw = npc->yaw;
|
||||
npc->currentAnim = followData->animIDs[4];
|
||||
followData->followState = NPC_FOLLOW_STATE_IDLE;
|
||||
break;
|
||||
}
|
||||
|
||||
followData->targetPointIdx++;
|
||||
if (followData->targetPointIdx >= ARRAY_COUNT(followData->moveHistory)) {
|
||||
followData->targetPointIdx = 0;
|
||||
}
|
||||
historyPoint = &followData->moveHistory[followData->targetPointIdx];
|
||||
targetX = historyPoint->pos.x;
|
||||
targetZ = historyPoint->pos.z;
|
||||
if (npc->flags & NPC_FLAG_1000) {
|
||||
if (historyPoint->isAirborne) {
|
||||
followData->followState = NPC_FOLLOW_STATE_JUMP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!(npc->flags & NPC_FLAG_1000)) {
|
||||
@ -187,38 +190,38 @@ void func_8005E12C(Npc* npc) {
|
||||
}
|
||||
npc->yaw = yaw;
|
||||
npc_move_heading(npc, npc->moveSpeed, yaw);
|
||||
if ((npc->flags & (NPC_FLAG_4000 | NPC_FLAG_1000)) == (NPC_FLAG_4000 | NPC_FLAG_1000)) {
|
||||
blur->unk_288 = 1;
|
||||
if ((npc->flags & NPC_FLAG_4000) && (npc->flags & NPC_FLAG_1000)) {
|
||||
followData->followState = NPC_FOLLOW_STATE_JUMP;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (blur->unk_284 != blur->partIdx) {
|
||||
blur->unk_284++;
|
||||
if (blur->unk_284 >= ARRAY_COUNT(blur->unk_00)) {
|
||||
blur->unk_284 = 0;
|
||||
case NPC_FOLLOW_STATE_JUMP:
|
||||
if (followData->targetPointIdx != followData->lastPointIdx) {
|
||||
followData->targetPointIdx++;
|
||||
if (followData->targetPointIdx >= ARRAY_COUNT(followData->moveHistory)) {
|
||||
followData->targetPointIdx = 0;
|
||||
}
|
||||
part = &blur->unk_00[blur->unk_284];
|
||||
partX = part->pos.x;
|
||||
partY = part->pos.y;
|
||||
partZ = part->pos.z;
|
||||
npc->moveToPos.x = partX;
|
||||
npc->moveToPos.y = partY;
|
||||
npc->moveToPos.z = partZ;
|
||||
historyPoint = &followData->moveHistory[followData->targetPointIdx];
|
||||
targetX = historyPoint->pos.x;
|
||||
targetY = historyPoint->pos.y;
|
||||
targetZ = historyPoint->pos.z;
|
||||
npc->moveToPos.x = targetX;
|
||||
npc->moveToPos.y = targetY;
|
||||
npc->moveToPos.z = targetZ;
|
||||
npc->duration = 0;
|
||||
npc->jumpScale = 2.0f;
|
||||
npc->moveSpeed = blur->unk_298;
|
||||
npc->moveSpeed = followData->runSpeed;
|
||||
npc->planarFlyDist = dist2D(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, npc->moveToPos.x, npc->moveToPos.z);
|
||||
dist = npc->planarFlyDist;
|
||||
sp2C = partY - npc->pos.y;
|
||||
if (dist < sp2C) {
|
||||
dist = sp2C;
|
||||
currentY = npc->moveToPos.y - npc->pos.y;
|
||||
if (npc->planarFlyDist < currentY) {
|
||||
dist = currentY;
|
||||
}
|
||||
if (dist < blur->unk_29C) {
|
||||
if (dist < followData->idleRadius) {
|
||||
npc->jumpVelocity = 0.0f;
|
||||
npc->flags |= NPC_FLAG_GRAVITY;
|
||||
npc->yaw = atan2(npc->pos.x, npc->pos.z, x, z);
|
||||
blur->unk_288 = 0;
|
||||
followData->followState = NPC_FOLLOW_STATE_RUN;
|
||||
return;
|
||||
}
|
||||
npc->duration = dist / npc->moveSpeed;
|
||||
@ -226,105 +229,101 @@ void func_8005E12C(Npc* npc) {
|
||||
npc->duration = 10;
|
||||
}
|
||||
npc->moveSpeed = npc->planarFlyDist / npc->duration;
|
||||
npc->jumpVelocity = (sp2C + (npc->jumpScale * npc->duration * npc->duration * 0.5f)) / npc->duration;
|
||||
npc->currentAnim = blur->animIDs[1];
|
||||
npc->jumpVelocity = (currentY + (npc->jumpScale * npc->duration * npc->duration * 0.5f)) / npc->duration;
|
||||
npc->currentAnim = followData->animIDs[1];
|
||||
npc->flags &= ~NPC_FLAG_GRAVITY;
|
||||
blur->unk_288 = 2;
|
||||
followData->followState = NPC_FOLLOW_STATE_FALL;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case NPC_FOLLOW_STATE_FALL:
|
||||
npc->jumpVelocity -= npc->jumpScale;
|
||||
npc->pos.y += npc->jumpVelocity;
|
||||
if (npc->jumpVelocity <= 0.0f) {
|
||||
npc->currentAnim = blur->animIDs[2];
|
||||
npc->currentAnim = followData->animIDs[2];
|
||||
}
|
||||
npc_move_heading(npc, npc->moveSpeed, npc->yaw);
|
||||
if (npc->jumpVelocity <= 0.0f) {
|
||||
sp28 = npc->pos.x;
|
||||
sp30 = npc->pos.z;
|
||||
currentX = npc->pos.x;
|
||||
dist = fabsf(npc->jumpVelocity) + 8.0;
|
||||
sp2C = npc->pos.y + dist;
|
||||
if ((npc_raycast_down_sides(npc->collisionChannel, &sp28, &sp2C, &sp30, &dist) != 0) &&
|
||||
(dist <= (fabsf(npc->jumpVelocity) + 8.0)))
|
||||
currentY = npc->pos.y + dist;
|
||||
currentZ = npc->pos.z;
|
||||
if (npc_raycast_down_sides(npc->collisionChannel, ¤tX, ¤tY, ¤tZ, &dist) != 0 &&
|
||||
dist <= fabsf(npc->jumpVelocity) + 8.0)
|
||||
{
|
||||
npc->currentAnim = blur->animIDs[3];
|
||||
npc->currentAnim = followData->animIDs[3];
|
||||
npc->jumpVelocity = 0.0f;
|
||||
npc->pos.y = sp2C;
|
||||
npc->pos.y = currentY;
|
||||
npc->flags |= NPC_FLAG_GRAVITY;
|
||||
npc->yaw = atan2(sp28, sp30, x, z);
|
||||
blur->unk_288 = 0;
|
||||
npc->yaw = atan2(currentX, currentZ, x, z);
|
||||
followData->followState = NPC_FOLLOW_STATE_RUN;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
npcX = npc->pos.x;
|
||||
npcZ = npc->pos.z;
|
||||
part = &blur->unk_00[blur->unk_284];
|
||||
partX = part->pos.x;
|
||||
partZ = part->pos.z;
|
||||
sp28 = npcX;
|
||||
sp2C = npc->pos.y;
|
||||
sp30 = npcZ;
|
||||
dist = dist2D(npcX, npcZ, x, z);
|
||||
if (dist <= blur->unk_29C) {
|
||||
case NPC_FOLLOW_STATE_IDLE:
|
||||
historyPoint = &followData->moveHistory[followData->targetPointIdx];
|
||||
targetX = historyPoint->pos.x;
|
||||
targetY = historyPoint->pos.y;
|
||||
targetZ = historyPoint->pos.z;
|
||||
currentX = npc->pos.x;
|
||||
currentY = npc->pos.y;
|
||||
currentZ = npc->pos.z;
|
||||
dist = dist2D(npc->pos.x, npc->pos.z, x, z);
|
||||
if (dist <= followData->idleRadius) {
|
||||
break;
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
if (part->unk_00 != 0) {
|
||||
if (historyPoint->isAirborne) {
|
||||
break;
|
||||
}
|
||||
|
||||
theta = atan2(npc->pos.x, npc->pos.z, partX, partZ);
|
||||
if (fabsf(get_clamped_angle_diff(theta, atan2(npc->pos.x, npc->pos.z, x, z))) < 90.0f) {
|
||||
yaw = atan2(npc->pos.x, npc->pos.z, targetX, targetZ);
|
||||
if (fabsf(get_clamped_angle_diff(yaw, atan2(npc->pos.x, npc->pos.z, x, z))) < 90.0f) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (blur->unk_284 == blur->partIdx) {
|
||||
if (followData->targetPointIdx == followData->lastPointIdx) {
|
||||
break;
|
||||
}
|
||||
|
||||
blur->unk_284++;
|
||||
if (blur->unk_284 >= ARRAY_COUNT(blur->unk_00)) {
|
||||
blur->unk_284 = 0;
|
||||
followData->targetPointIdx++;
|
||||
if (followData->targetPointIdx >= ARRAY_COUNT(followData->moveHistory)) {
|
||||
followData->targetPointIdx = 0;
|
||||
}
|
||||
part = &blur->unk_00[blur->unk_284];
|
||||
partX = part->pos.x;
|
||||
partZ = part->pos.z;
|
||||
historyPoint = &followData->moveHistory[followData->targetPointIdx];
|
||||
targetX = historyPoint->pos.x;
|
||||
targetZ = historyPoint->pos.z;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (part->unk_00 == 0) {
|
||||
blur->unk_288 = 0;
|
||||
if (!historyPoint->isAirborne) {
|
||||
followData->followState = NPC_FOLLOW_STATE_RUN;
|
||||
return;
|
||||
}
|
||||
|
||||
while (TRUE) {
|
||||
if (part->unk_00 == 0) {
|
||||
if (!historyPoint->isAirborne) {
|
||||
break;
|
||||
}
|
||||
|
||||
theta = atan2(npc->pos.x, npc->pos.z, partX, partZ);
|
||||
if (fabsf(get_clamped_angle_diff(theta, atan2(npc->pos.x, npc->pos.z, x, z))) < 90.0f) {
|
||||
yaw = atan2(npc->pos.x, npc->pos.z, targetX, targetZ);
|
||||
if (fabsf(get_clamped_angle_diff(yaw, atan2(npc->pos.x, npc->pos.z, x, z))) < 90.0f) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (blur->unk_284 == blur->partIdx) {
|
||||
if (followData->targetPointIdx == followData->lastPointIdx) {
|
||||
break;
|
||||
}
|
||||
|
||||
blur->unk_284++;
|
||||
if (blur->unk_284 >= ARRAY_COUNT(blur->unk_00)) {
|
||||
blur->unk_284 = 0;
|
||||
followData->targetPointIdx++;
|
||||
if (followData->targetPointIdx >= ARRAY_COUNT(followData->moveHistory)) {
|
||||
followData->targetPointIdx = 0;
|
||||
}
|
||||
part = &blur->unk_00[blur->unk_284];
|
||||
partX = part->pos.x;
|
||||
partZ = part->pos.z;
|
||||
historyPoint = &followData->moveHistory[followData->targetPointIdx];
|
||||
targetX = historyPoint->pos.x;
|
||||
targetZ = historyPoint->pos.z;
|
||||
}
|
||||
blur->unk_288 = 1;
|
||||
followData->followState = NPC_FOLLOW_STATE_JUMP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "39210_len_aa0", func_8005E12C);
|
||||
#endif
|
||||
|
@ -7,7 +7,7 @@ extern f32 JumpedOnSwitchX;
|
||||
extern f32 JumpedOnSwitchZ;
|
||||
extern f32 D_8010C984;
|
||||
|
||||
s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 arg2);
|
||||
s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw);
|
||||
s32 phys_check_interactable_collision(void);
|
||||
void phys_save_ground_pos(void);
|
||||
|
||||
@ -754,9 +754,7 @@ void collision_main_lateral(void) {
|
||||
}
|
||||
}
|
||||
|
||||
//something weird with hitID
|
||||
#ifdef NON_EQUIVALENT
|
||||
s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 arg2) {
|
||||
s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 yaw) {
|
||||
f32 angle = 0.0f;
|
||||
s32 ret = -1;
|
||||
s32 i;
|
||||
@ -765,12 +763,24 @@ s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 arg2) {
|
||||
f32 x = gPlayerStatusPtr->position.x;
|
||||
f32 y = gPlayerStatusPtr->position.y + arg1;
|
||||
f32 z = gPlayerStatusPtr->position.z;
|
||||
s32 hitID = player_test_lateral_overlap(mode, gPlayerStatusPtr, &x, &y, &z, 0, angle);
|
||||
s32 hitID, hitID2;
|
||||
|
||||
if (hitID >= 0) {
|
||||
ret = hitID;
|
||||
hitID = player_test_lateral_overlap(mode, gPlayerStatusPtr, &x, &y, &z, 0.0f, angle);
|
||||
|
||||
// required to match
|
||||
if (hitID > 0 || hitID == 0) {
|
||||
hitID2 = hitID;
|
||||
} else if (hitID == -1) {
|
||||
hitID2 = hitID;
|
||||
} else {
|
||||
hitID2 = hitID;
|
||||
}
|
||||
|
||||
if (hitID2 >= 0) {
|
||||
ret = hitID2;
|
||||
}
|
||||
gPlayerStatusPtr = gPlayerStatusPtr;
|
||||
|
||||
gPlayerStatusPtr->position.x = x;
|
||||
gPlayerStatusPtr->position.z = z;
|
||||
angle += 90.0f;
|
||||
@ -778,9 +788,6 @@ s32 collision_check_player_intersecting_world(s32 mode, s32 arg1, f32 arg2) {
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
INCLUDE_ASM(s32, "7bb60_len_41b0", collision_check_player_intersecting_world, s32 mode, s32 arg1, f32 arg2);
|
||||
#endif
|
||||
|
||||
s32 func_800E4404(s32 mode, s32 arg1, f32 arg2, f32* outX, f32* outY, f32* outZ) {
|
||||
f32 angle = 0.0f;
|
||||
|
@ -13,13 +13,13 @@ API_CALLABLE(N(func_802401B0_7E7550)) {
|
||||
Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID);
|
||||
|
||||
if (rand_int(1000) < 500) {
|
||||
func_8005DECC(npc, -1, N(GoombariaAnims),
|
||||
npc_follow_init(npc, NPC_SELF, N(GoombariaAnims),
|
||||
rand_int(4) + 1,
|
||||
rand_int(3) + 5,
|
||||
rand_int(50) + 50,
|
||||
rand_int(100) + 100);
|
||||
} else {
|
||||
func_8005DECC(npc, rand_int(3) + 10, N(GoombariaAnims),
|
||||
npc_follow_init(npc, rand_int(3) + NPC_Goompa, N(GoombariaAnims),
|
||||
rand_int(4) + 1,
|
||||
rand_int(3) + 5,
|
||||
rand_int(50) + 50,
|
||||
@ -31,14 +31,14 @@ API_CALLABLE(N(func_802401B0_7E7550)) {
|
||||
API_CALLABLE(N(func_802402EC_7E768C)) {
|
||||
Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID);
|
||||
|
||||
func_8005DFD4(npc);
|
||||
npc_update_npc_tracking(npc);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
API_CALLABLE(N(func_80240318_7E76B8)) {
|
||||
Npc* npc = get_npc_unsafe(script->owner1.enemy->npcID);
|
||||
|
||||
func_8005E12C(npc);
|
||||
npc_follow_npc(npc);
|
||||
return ApiStatus_DONE2;
|
||||
}
|
||||
|
||||
|
@ -1,514 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel func_8005E12C
|
||||
/* 3952C 8005E12C 27BDFF98 */ addiu $sp, $sp, -0x68
|
||||
/* 39530 8005E130 AFB20040 */ sw $s2, 0x40($sp)
|
||||
/* 39534 8005E134 0080902D */ daddu $s2, $a0, $zero
|
||||
/* 39538 8005E138 27A50018 */ addiu $a1, $sp, 0x18
|
||||
/* 3953C 8005E13C 27A6001C */ addiu $a2, $sp, 0x1c
|
||||
/* 39540 8005E140 AFBF0044 */ sw $ra, 0x44($sp)
|
||||
/* 39544 8005E144 AFB1003C */ sw $s1, 0x3c($sp)
|
||||
/* 39548 8005E148 AFB00038 */ sw $s0, 0x38($sp)
|
||||
/* 3954C 8005E14C F7BA0060 */ sdc1 $f26, 0x60($sp)
|
||||
/* 39550 8005E150 F7B80058 */ sdc1 $f24, 0x58($sp)
|
||||
/* 39554 8005E154 F7B60050 */ sdc1 $f22, 0x50($sp)
|
||||
/* 39558 8005E158 F7B40048 */ sdc1 $f20, 0x48($sp)
|
||||
/* 3955C 8005E15C 8E510020 */ lw $s1, 0x20($s2)
|
||||
/* 39560 8005E160 27A20024 */ addiu $v0, $sp, 0x24
|
||||
/* 39564 8005E164 AFA20010 */ sw $v0, 0x10($sp)
|
||||
/* 39568 8005E168 8E24028C */ lw $a0, 0x28c($s1)
|
||||
/* 3956C 8005E16C 0C017784 */ jal get_npc_pos
|
||||
/* 39570 8005E170 27A70020 */ addiu $a3, $sp, 0x20
|
||||
/* 39574 8005E174 8E230288 */ lw $v1, 0x288($s1)
|
||||
/* 39578 8005E178 24020001 */ addiu $v0, $zero, 1
|
||||
/* 3957C 8005E17C 106200A4 */ beq $v1, $v0, .L8005E410
|
||||
/* 39580 8005E180 28620002 */ slti $v0, $v1, 2
|
||||
/* 39584 8005E184 50400005 */ beql $v0, $zero, .L8005E19C
|
||||
/* 39588 8005E188 24020002 */ addiu $v0, $zero, 2
|
||||
/* 3958C 8005E18C 10600015 */ beqz $v1, .L8005E1E4
|
||||
/* 39590 8005E190 00000000 */ nop
|
||||
/* 39594 8005E194 08017A20 */ j .L8005E880
|
||||
/* 39598 8005E198 00000000 */ nop
|
||||
.L8005E19C:
|
||||
/* 3959C 8005E19C 10620104 */ beq $v1, $v0, .L8005E5B0
|
||||
/* 395A0 8005E1A0 2402000A */ addiu $v0, $zero, 0xa
|
||||
/* 395A4 8005E1A4 1062014C */ beq $v1, $v0, .L8005E6D8
|
||||
/* 395A8 8005E1A8 00000000 */ nop
|
||||
/* 395AC 8005E1AC 08017A20 */ j .L8005E880
|
||||
/* 395B0 8005E1B0 00000000 */ nop
|
||||
.L8005E1B4:
|
||||
/* 395B4 8005E1B4 8E220290 */ lw $v0, 0x290($s1)
|
||||
/* 395B8 8005E1B8 C658000C */ lwc1 $f24, 0xc($s2)
|
||||
/* 395BC 8005E1BC 8C420010 */ lw $v0, 0x10($v0)
|
||||
/* 395C0 8005E1C0 080178ED */ j .L8005E3B4
|
||||
/* 395C4 8005E1C4 AE420028 */ sw $v0, 0x28($s2)
|
||||
.L8005E1C8:
|
||||
/* 395C8 8005E1C8 AE400018 */ sw $zero, 0x18($s2)
|
||||
/* 395CC 8005E1CC 8E220290 */ lw $v0, 0x290($s1)
|
||||
/* 395D0 8005E1D0 C658000C */ lwc1 $f24, 0xc($s2)
|
||||
/* 395D4 8005E1D4 8C420010 */ lw $v0, 0x10($v0)
|
||||
/* 395D8 8005E1D8 AE420028 */ sw $v0, 0x28($s2)
|
||||
/* 395DC 8005E1DC 080178EC */ j .L8005E3B0
|
||||
/* 395E0 8005E1E0 2402000A */ addiu $v0, $zero, 0xa
|
||||
.L8005E1E4:
|
||||
/* 395E4 8005E1E4 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 395E8 8005E1E8 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 395EC 8005E1EC 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 395F0 8005E1F0 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 395F4 8005E1F4 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 395F8 8005E1F8 C642003C */ lwc1 $f2, 0x3c($s2)
|
||||
/* 395FC 8005E1FC C6260294 */ lwc1 $f6, 0x294($s1)
|
||||
/* 39600 8005E200 00021100 */ sll $v0, $v0, 4
|
||||
/* 39604 8005E204 02228021 */ addu $s0, $s1, $v0
|
||||
/* 39608 8005E208 46006006 */ mov.s $f0, $f12
|
||||
/* 3960C 8005E20C C6160004 */ lwc1 $f22, 4($s0)
|
||||
/* 39610 8005E210 C614000C */ lwc1 $f20, 0xc($s0)
|
||||
/* 39614 8005E214 46007106 */ mov.s $f4, $f14
|
||||
/* 39618 8005E218 E7A00028 */ swc1 $f0, 0x28($sp)
|
||||
/* 3961C 8005E21C E7A2002C */ swc1 $f2, 0x2c($sp)
|
||||
/* 39620 8005E220 E7A40030 */ swc1 $f4, 0x30($sp)
|
||||
/* 39624 8005E224 0C00A7B5 */ jal dist2D
|
||||
/* 39628 8005E228 E6460018 */ swc1 $f6, 0x18($s2)
|
||||
/* 3962C 8005E22C C62202A0 */ lwc1 $f2, 0x2a0($s1)
|
||||
/* 39630 8005E230 4600103E */ c.le.s $f2, $f0
|
||||
/* 39634 8005E234 00000000 */ nop
|
||||
/* 39638 8005E238 45000003 */ bc1f .L8005E248
|
||||
/* 3963C 8005E23C E7A00034 */ swc1 $f0, 0x34($sp)
|
||||
/* 39640 8005E240 C6200298 */ lwc1 $f0, 0x298($s1)
|
||||
/* 39644 8005E244 E6400018 */ swc1 $f0, 0x18($s2)
|
||||
.L8005E248:
|
||||
/* 39648 8005E248 8E220290 */ lw $v0, 0x290($s1)
|
||||
/* 3964C 8005E24C 8C430014 */ lw $v1, 0x14($v0)
|
||||
/* 39650 8005E250 8E420000 */ lw $v0, ($s2)
|
||||
/* 39654 8005E254 30421000 */ andi $v0, $v0, 0x1000
|
||||
/* 39658 8005E258 14400004 */ bnez $v0, .L8005E26C
|
||||
/* 3965C 8005E25C AE430028 */ sw $v1, 0x28($s2)
|
||||
/* 39660 8005E260 8E220290 */ lw $v0, 0x290($s1)
|
||||
/* 39664 8005E264 8C420008 */ lw $v0, 8($v0)
|
||||
/* 39668 8005E268 AE420028 */ sw $v0, 0x28($s2)
|
||||
.L8005E26C:
|
||||
/* 3966C 8005E26C C7AC0028 */ lwc1 $f12, 0x28($sp)
|
||||
/* 39670 8005E270 C7AE0030 */ lwc1 $f14, 0x30($sp)
|
||||
/* 39674 8005E274 4406B000 */ mfc1 $a2, $f22
|
||||
/* 39678 8005E278 4407A000 */ mfc1 $a3, $f20
|
||||
/* 3967C 8005E27C 0C00A7B5 */ jal dist2D
|
||||
/* 39680 8005E280 00000000 */ nop
|
||||
/* 39684 8005E284 C7AC0028 */ lwc1 $f12, 0x28($sp)
|
||||
/* 39688 8005E288 C7AE0030 */ lwc1 $f14, 0x30($sp)
|
||||
/* 3968C 8005E28C 4406B000 */ mfc1 $a2, $f22
|
||||
/* 39690 8005E290 4407A000 */ mfc1 $a3, $f20
|
||||
/* 39694 8005E294 0C00A720 */ jal atan2
|
||||
/* 39698 8005E298 E7A00034 */ swc1 $f0, 0x34($sp)
|
||||
/* 3969C 8005E29C C6440018 */ lwc1 $f4, 0x18($s2)
|
||||
/* 396A0 8005E2A0 C7A20034 */ lwc1 $f2, 0x34($sp)
|
||||
/* 396A4 8005E2A4 4602203C */ c.lt.s $f4, $f2
|
||||
/* 396A8 8005E2A8 00000000 */ nop
|
||||
/* 396AC 8005E2AC 45000020 */ bc1f .L8005E330
|
||||
/* 396B0 8005E2B0 46000606 */ mov.s $f24, $f0
|
||||
/* 396B4 8005E2B4 C7AC0028 */ lwc1 $f12, 0x28($sp)
|
||||
/* 396B8 8005E2B8 C7AE0030 */ lwc1 $f14, 0x30($sp)
|
||||
/* 396BC 8005E2BC 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 396C0 8005E2C0 0C00A7B5 */ jal dist2D
|
||||
/* 396C4 8005E2C4 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 396C8 8005E2C8 E7A00034 */ swc1 $f0, 0x34($sp)
|
||||
/* 396CC 8005E2CC C62202A0 */ lwc1 $f2, 0x2a0($s1)
|
||||
/* 396D0 8005E2D0 4600103C */ c.lt.s $f2, $f0
|
||||
/* 396D4 8005E2D4 00000000 */ nop
|
||||
/* 396D8 8005E2D8 45010036 */ bc1t .L8005E3B4
|
||||
/* 396DC 8005E2DC 00000000 */ nop
|
||||
/* 396E0 8005E2E0 C622029C */ lwc1 $f2, 0x29c($s1)
|
||||
/* 396E4 8005E2E4 4600103C */ c.lt.s $f2, $f0
|
||||
/* 396E8 8005E2E8 00000000 */ nop
|
||||
/* 396EC 8005E2EC 45000010 */ bc1f .L8005E330
|
||||
/* 396F0 8005E2F0 00000000 */ nop
|
||||
/* 396F4 8005E2F4 46020001 */ sub.s $f0, $f0, $f2
|
||||
/* 396F8 8005E2F8 E6400018 */ swc1 $f0, 0x18($s2)
|
||||
/* 396FC 8005E2FC C6220294 */ lwc1 $f2, 0x294($s1)
|
||||
/* 39700 8005E300 4600103C */ c.lt.s $f2, $f0
|
||||
/* 39704 8005E304 00000000 */ nop
|
||||
/* 39708 8005E308 4503002A */ bc1tl .L8005E3B4
|
||||
/* 3970C 8005E30C E6420018 */ swc1 $f2, 0x18($s2)
|
||||
/* 39710 8005E310 3C013FF0 */ lui $at, 0x3ff0
|
||||
/* 39714 8005E314 44811800 */ mtc1 $at, $f3
|
||||
/* 39718 8005E318 44801000 */ mtc1 $zero, $f2
|
||||
/* 3971C 8005E31C 46000021 */ cvt.d.s $f0, $f0
|
||||
/* 39720 8005E320 46220000 */ add.d $f0, $f0, $f2
|
||||
/* 39724 8005E324 46200020 */ cvt.s.d $f0, $f0
|
||||
/* 39728 8005E328 080178ED */ j .L8005E3B4
|
||||
/* 3972C 8005E32C E6400018 */ swc1 $f0, 0x18($s2)
|
||||
.L8005E330:
|
||||
/* 39730 8005E330 8E230284 */ lw $v1, 0x284($s1)
|
||||
/* 39734 8005E334 8E220280 */ lw $v0, 0x280($s1)
|
||||
/* 39738 8005E338 5062FF9E */ beql $v1, $v0, .L8005E1B4
|
||||
/* 3973C 8005E33C AE400018 */ sw $zero, 0x18($s2)
|
||||
/* 39740 8005E340 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39744 8005E344 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39748 8005E348 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 3974C 8005E34C 0C00A7B5 */ jal dist2D
|
||||
/* 39750 8005E350 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 39754 8005E354 C622029C */ lwc1 $f2, 0x29c($s1)
|
||||
/* 39758 8005E358 4602003E */ c.le.s $f0, $f2
|
||||
/* 3975C 8005E35C 00000000 */ nop
|
||||
/* 39760 8005E360 4501FF99 */ bc1t .L8005E1C8
|
||||
/* 39764 8005E364 E7A00034 */ swc1 $f0, 0x34($sp)
|
||||
/* 39768 8005E368 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 3976C 8005E36C 24420001 */ addiu $v0, $v0, 1
|
||||
/* 39770 8005E370 AE220284 */ sw $v0, 0x284($s1)
|
||||
/* 39774 8005E374 28420028 */ slti $v0, $v0, 0x28
|
||||
/* 39778 8005E378 50400001 */ beql $v0, $zero, .L8005E380
|
||||
/* 3977C 8005E37C AE200284 */ sw $zero, 0x284($s1)
|
||||
.L8005E380:
|
||||
/* 39780 8005E380 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 39784 8005E384 00021100 */ sll $v0, $v0, 4
|
||||
/* 39788 8005E388 02228021 */ addu $s0, $s1, $v0
|
||||
/* 3978C 8005E38C C6160004 */ lwc1 $f22, 4($s0)
|
||||
/* 39790 8005E390 8E420000 */ lw $v0, ($s2)
|
||||
/* 39794 8005E394 C614000C */ lwc1 $f20, 0xc($s0)
|
||||
/* 39798 8005E398 30421000 */ andi $v0, $v0, 0x1000
|
||||
/* 3979C 8005E39C 1040FFB3 */ beqz $v0, .L8005E26C
|
||||
/* 397A0 8005E3A0 00000000 */ nop
|
||||
/* 397A4 8005E3A4 82020000 */ lb $v0, ($s0)
|
||||
/* 397A8 8005E3A8 1040FFB0 */ beqz $v0, .L8005E26C
|
||||
/* 397AC 8005E3AC 24020001 */ addiu $v0, $zero, 1
|
||||
.L8005E3B0:
|
||||
/* 397B0 8005E3B0 AE220288 */ sw $v0, 0x288($s1)
|
||||
.L8005E3B4:
|
||||
/* 397B4 8005E3B4 8E420000 */ lw $v0, ($s2)
|
||||
/* 397B8 8005E3B8 30421000 */ andi $v0, $v0, 0x1000
|
||||
/* 397BC 8005E3BC 14400008 */ bnez $v0, .L8005E3E0
|
||||
/* 397C0 8005E3C0 00000000 */ nop
|
||||
/* 397C4 8005E3C4 C6400018 */ lwc1 $f0, 0x18($s2)
|
||||
/* 397C8 8005E3C8 3C013F00 */ lui $at, 0x3f00
|
||||
/* 397CC 8005E3CC 44811000 */ mtc1 $at, $f2
|
||||
/* 397D0 8005E3D0 00000000 */ nop
|
||||
/* 397D4 8005E3D4 46020002 */ mul.s $f0, $f0, $f2
|
||||
/* 397D8 8005E3D8 00000000 */ nop
|
||||
/* 397DC 8005E3DC E6400018 */ swc1 $f0, 0x18($s2)
|
||||
.L8005E3E0:
|
||||
/* 397E0 8005E3E0 8E450018 */ lw $a1, 0x18($s2)
|
||||
/* 397E4 8005E3E4 4406C000 */ mfc1 $a2, $f24
|
||||
/* 397E8 8005E3E8 0240202D */ daddu $a0, $s2, $zero
|
||||
/* 397EC 8005E3EC 0C00EA95 */ jal npc_move_heading
|
||||
/* 397F0 8005E3F0 AE46000C */ sw $a2, 0xc($s2)
|
||||
/* 397F4 8005E3F4 8E420000 */ lw $v0, ($s2)
|
||||
/* 397F8 8005E3F8 24035000 */ addiu $v1, $zero, 0x5000
|
||||
/* 397FC 8005E3FC 30425000 */ andi $v0, $v0, 0x5000
|
||||
/* 39800 8005E400 1443011F */ bne $v0, $v1, .L8005E880
|
||||
/* 39804 8005E404 24020001 */ addiu $v0, $zero, 1
|
||||
/* 39808 8005E408 08017A20 */ j .L8005E880
|
||||
/* 3980C 8005E40C AE220288 */ sw $v0, 0x288($s1)
|
||||
.L8005E410:
|
||||
/* 39810 8005E410 8E230284 */ lw $v1, 0x284($s1)
|
||||
/* 39814 8005E414 8E220280 */ lw $v0, 0x280($s1)
|
||||
/* 39818 8005E418 10620119 */ beq $v1, $v0, .L8005E880
|
||||
/* 3981C 8005E41C 24620001 */ addiu $v0, $v1, 1
|
||||
/* 39820 8005E420 AE220284 */ sw $v0, 0x284($s1)
|
||||
/* 39824 8005E424 28420028 */ slti $v0, $v0, 0x28
|
||||
/* 39828 8005E428 50400001 */ beql $v0, $zero, .L8005E430
|
||||
/* 3982C 8005E42C AE200284 */ sw $zero, 0x284($s1)
|
||||
.L8005E430:
|
||||
/* 39830 8005E430 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39834 8005E434 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 39838 8005E438 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 3983C 8005E43C 3C014000 */ lui $at, 0x4000
|
||||
/* 39840 8005E440 44810000 */ mtc1 $at, $f0
|
||||
/* 39844 8005E444 00021100 */ sll $v0, $v0, 4
|
||||
/* 39848 8005E448 02228021 */ addu $s0, $s1, $v0
|
||||
/* 3984C 8005E44C C6160004 */ lwc1 $f22, 4($s0)
|
||||
/* 39850 8005E450 C614000C */ lwc1 $f20, 0xc($s0)
|
||||
/* 39854 8005E454 C6020008 */ lwc1 $f2, 8($s0)
|
||||
/* 39858 8005E458 A640008E */ sh $zero, 0x8e($s2)
|
||||
/* 3985C 8005E45C E6400014 */ swc1 $f0, 0x14($s2)
|
||||
/* 39860 8005E460 E6560060 */ swc1 $f22, 0x60($s2)
|
||||
/* 39864 8005E464 E6540068 */ swc1 $f20, 0x68($s2)
|
||||
/* 39868 8005E468 E6420064 */ swc1 $f2, 0x64($s2)
|
||||
/* 3986C 8005E46C C6200298 */ lwc1 $f0, 0x298($s1)
|
||||
/* 39870 8005E470 4406B000 */ mfc1 $a2, $f22
|
||||
/* 39874 8005E474 4407A000 */ mfc1 $a3, $f20
|
||||
/* 39878 8005E478 0C00A7B5 */ jal dist2D
|
||||
/* 3987C 8005E47C E6400018 */ swc1 $f0, 0x18($s2)
|
||||
/* 39880 8005E480 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39884 8005E484 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39888 8005E488 8E460060 */ lw $a2, 0x60($s2)
|
||||
/* 3988C 8005E48C 8E470068 */ lw $a3, 0x68($s2)
|
||||
/* 39890 8005E490 0C00A720 */ jal atan2
|
||||
/* 39894 8005E494 E6400010 */ swc1 $f0, 0x10($s2)
|
||||
/* 39898 8005E498 C6480010 */ lwc1 $f8, 0x10($s2)
|
||||
/* 3989C 8005E49C C6440064 */ lwc1 $f4, 0x64($s2)
|
||||
/* 398A0 8005E4A0 C642003C */ lwc1 $f2, 0x3c($s2)
|
||||
/* 398A4 8005E4A4 E640000C */ swc1 $f0, 0xc($s2)
|
||||
/* 398A8 8005E4A8 46022101 */ sub.s $f4, $f4, $f2
|
||||
/* 398AC 8005E4AC 46004186 */ mov.s $f6, $f8
|
||||
/* 398B0 8005E4B0 E7A80034 */ swc1 $f8, 0x34($sp)
|
||||
/* 398B4 8005E4B4 4604303C */ c.lt.s $f6, $f4
|
||||
/* 398B8 8005E4B8 00000000 */ nop
|
||||
/* 398BC 8005E4BC 45000002 */ bc1f .L8005E4C8
|
||||
/* 398C0 8005E4C0 E7A4002C */ swc1 $f4, 0x2c($sp)
|
||||
/* 398C4 8005E4C4 E7A40034 */ swc1 $f4, 0x34($sp)
|
||||
.L8005E4C8:
|
||||
/* 398C8 8005E4C8 C620029C */ lwc1 $f0, 0x29c($s1)
|
||||
/* 398CC 8005E4CC C7A20034 */ lwc1 $f2, 0x34($sp)
|
||||
/* 398D0 8005E4D0 4600103C */ c.lt.s $f2, $f0
|
||||
/* 398D4 8005E4D4 00000000 */ nop
|
||||
/* 398D8 8005E4D8 4500000A */ bc1f .L8005E504
|
||||
/* 398DC 8005E4DC 00000000 */ nop
|
||||
/* 398E0 8005E4E0 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 398E4 8005E4E4 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 398E8 8005E4E8 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 398EC 8005E4EC 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 398F0 8005E4F0 8E420000 */ lw $v0, ($s2)
|
||||
/* 398F4 8005E4F4 AE40001C */ sw $zero, 0x1c($s2)
|
||||
/* 398F8 8005E4F8 34420200 */ ori $v0, $v0, 0x200
|
||||
/* 398FC 8005E4FC 080179B1 */ j .L8005E6C4
|
||||
/* 39900 8005E500 AE420000 */ sw $v0, ($s2)
|
||||
.L8005E504:
|
||||
/* 39904 8005E504 C6400018 */ lwc1 $f0, 0x18($s2)
|
||||
/* 39908 8005E508 46001003 */ div.s $f0, $f2, $f0
|
||||
/* 3990C 8005E50C 4600028D */ trunc.w.s $f10, $f0
|
||||
/* 39910 8005E510 44025000 */ mfc1 $v0, $f10
|
||||
/* 39914 8005E514 00000000 */ nop
|
||||
/* 39918 8005E518 A642008E */ sh $v0, 0x8e($s2)
|
||||
/* 3991C 8005E51C 00021400 */ sll $v0, $v0, 0x10
|
||||
/* 39920 8005E520 00021403 */ sra $v0, $v0, 0x10
|
||||
/* 39924 8005E524 2842000A */ slti $v0, $v0, 0xa
|
||||
/* 39928 8005E528 10400002 */ beqz $v0, .L8005E534
|
||||
/* 3992C 8005E52C 2402000A */ addiu $v0, $zero, 0xa
|
||||
/* 39930 8005E530 A642008E */ sh $v0, 0x8e($s2)
|
||||
.L8005E534:
|
||||
/* 39934 8005E534 8642008E */ lh $v0, 0x8e($s2)
|
||||
/* 39938 8005E538 C6420014 */ lwc1 $f2, 0x14($s2)
|
||||
/* 3993C 8005E53C 44823000 */ mtc1 $v0, $f6
|
||||
/* 39940 8005E540 00000000 */ nop
|
||||
/* 39944 8005E544 468031A0 */ cvt.s.w $f6, $f6
|
||||
/* 39948 8005E548 46061082 */ mul.s $f2, $f2, $f6
|
||||
/* 3994C 8005E54C 00000000 */ nop
|
||||
/* 39950 8005E550 46061082 */ mul.s $f2, $f2, $f6
|
||||
/* 39954 8005E554 00000000 */ nop
|
||||
/* 39958 8005E558 3C013F00 */ lui $at, 0x3f00
|
||||
/* 3995C 8005E55C 44810000 */ mtc1 $at, $f0
|
||||
/* 39960 8005E560 00000000 */ nop
|
||||
/* 39964 8005E564 46001082 */ mul.s $f2, $f2, $f0
|
||||
/* 39968 8005E568 00000000 */ nop
|
||||
/* 3996C 8005E56C 2404FDFF */ addiu $a0, $zero, -0x201
|
||||
/* 39970 8005E570 C7A4002C */ lwc1 $f4, 0x2c($sp)
|
||||
/* 39974 8005E574 46003206 */ mov.s $f8, $f6
|
||||
/* 39978 8005E578 C6400010 */ lwc1 $f0, 0x10($s2)
|
||||
/* 3997C 8005E57C 46022100 */ add.s $f4, $f4, $f2
|
||||
/* 39980 8005E580 46080003 */ div.s $f0, $f0, $f8
|
||||
/* 39984 8005E584 E6400018 */ swc1 $f0, 0x18($s2)
|
||||
/* 39988 8005E588 46062103 */ div.s $f4, $f4, $f6
|
||||
/* 3998C 8005E58C E644001C */ swc1 $f4, 0x1c($s2)
|
||||
/* 39990 8005E590 8E230290 */ lw $v1, 0x290($s1)
|
||||
/* 39994 8005E594 8E420000 */ lw $v0, ($s2)
|
||||
/* 39998 8005E598 8C630004 */ lw $v1, 4($v1)
|
||||
/* 3999C 8005E59C 00441024 */ and $v0, $v0, $a0
|
||||
/* 399A0 8005E5A0 AE420000 */ sw $v0, ($s2)
|
||||
/* 399A4 8005E5A4 24020002 */ addiu $v0, $zero, 2
|
||||
/* 399A8 8005E5A8 08017A1F */ j .L8005E87C
|
||||
/* 399AC 8005E5AC AE430028 */ sw $v1, 0x28($s2)
|
||||
.L8005E5B0:
|
||||
/* 399B0 8005E5B0 C640001C */ lwc1 $f0, 0x1c($s2)
|
||||
/* 399B4 8005E5B4 C6420014 */ lwc1 $f2, 0x14($s2)
|
||||
/* 399B8 8005E5B8 46020001 */ sub.s $f0, $f0, $f2
|
||||
/* 399BC 8005E5BC C642003C */ lwc1 $f2, 0x3c($s2)
|
||||
/* 399C0 8005E5C0 46001080 */ add.s $f2, $f2, $f0
|
||||
/* 399C4 8005E5C4 4480B000 */ mtc1 $zero, $f22
|
||||
/* 399C8 8005E5C8 00000000 */ nop
|
||||
/* 399CC 8005E5CC 4616003E */ c.le.s $f0, $f22
|
||||
/* 399D0 8005E5D0 E640001C */ swc1 $f0, 0x1c($s2)
|
||||
/* 399D4 8005E5D4 45000004 */ bc1f .L8005E5E8
|
||||
/* 399D8 8005E5D8 E642003C */ swc1 $f2, 0x3c($s2)
|
||||
/* 399DC 8005E5DC 8E220290 */ lw $v0, 0x290($s1)
|
||||
/* 399E0 8005E5E0 8C420008 */ lw $v0, 8($v0)
|
||||
/* 399E4 8005E5E4 AE420028 */ sw $v0, 0x28($s2)
|
||||
.L8005E5E8:
|
||||
/* 399E8 8005E5E8 8E450018 */ lw $a1, 0x18($s2)
|
||||
/* 399EC 8005E5EC 8E46000C */ lw $a2, 0xc($s2)
|
||||
/* 399F0 8005E5F0 0C00EA95 */ jal npc_move_heading
|
||||
/* 399F4 8005E5F4 0240202D */ daddu $a0, $s2, $zero
|
||||
/* 399F8 8005E5F8 C640001C */ lwc1 $f0, 0x1c($s2)
|
||||
/* 399FC 8005E5FC 4616003E */ c.le.s $f0, $f22
|
||||
/* 39A00 8005E600 00000000 */ nop
|
||||
/* 39A04 8005E604 4500009E */ bc1f .L8005E880
|
||||
/* 39A08 8005E608 27A50028 */ addiu $a1, $sp, 0x28
|
||||
/* 39A0C 8005E60C 46000005 */ abs.s $f0, $f0
|
||||
/* 39A10 8005E610 46000021 */ cvt.d.s $f0, $f0
|
||||
/* 39A14 8005E614 27A6002C */ addiu $a2, $sp, 0x2c
|
||||
/* 39A18 8005E618 27A20034 */ addiu $v0, $sp, 0x34
|
||||
/* 39A1C 8005E61C 3C014020 */ lui $at, 0x4020
|
||||
/* 39A20 8005E620 4481A800 */ mtc1 $at, $f21
|
||||
/* 39A24 8005E624 4480A000 */ mtc1 $zero, $f20
|
||||
/* 39A28 8005E628 C6420038 */ lwc1 $f2, 0x38($s2)
|
||||
/* 39A2C 8005E62C 46340000 */ add.d $f0, $f0, $f20
|
||||
/* 39A30 8005E630 E7A20028 */ swc1 $f2, 0x28($sp)
|
||||
/* 39A34 8005E634 C642003C */ lwc1 $f2, 0x3c($s2)
|
||||
/* 39A38 8005E638 C6440040 */ lwc1 $f4, 0x40($s2)
|
||||
/* 39A3C 8005E63C 46200020 */ cvt.s.d $f0, $f0
|
||||
/* 39A40 8005E640 46001080 */ add.s $f2, $f2, $f0
|
||||
/* 39A44 8005E644 E7A40030 */ swc1 $f4, 0x30($sp)
|
||||
/* 39A48 8005E648 E7A00034 */ swc1 $f0, 0x34($sp)
|
||||
/* 39A4C 8005E64C E7A2002C */ swc1 $f2, 0x2c($sp)
|
||||
/* 39A50 8005E650 AFA20010 */ sw $v0, 0x10($sp)
|
||||
/* 39A54 8005E654 8E440080 */ lw $a0, 0x80($s2)
|
||||
/* 39A58 8005E658 0C0372DF */ jal npc_raycast_down_sides
|
||||
/* 39A5C 8005E65C 27A70030 */ addiu $a3, $sp, 0x30
|
||||
/* 39A60 8005E660 10400087 */ beqz $v0, .L8005E880
|
||||
/* 39A64 8005E664 00000000 */ nop
|
||||
/* 39A68 8005E668 C640001C */ lwc1 $f0, 0x1c($s2)
|
||||
/* 39A6C 8005E66C C7A20034 */ lwc1 $f2, 0x34($sp)
|
||||
/* 39A70 8005E670 46000005 */ abs.s $f0, $f0
|
||||
/* 39A74 8005E674 46000021 */ cvt.d.s $f0, $f0
|
||||
/* 39A78 8005E678 46340000 */ add.d $f0, $f0, $f20
|
||||
/* 39A7C 8005E67C 460010A1 */ cvt.d.s $f2, $f2
|
||||
/* 39A80 8005E680 4620103E */ c.le.d $f2, $f0
|
||||
/* 39A84 8005E684 00000000 */ nop
|
||||
/* 39A88 8005E688 4500007D */ bc1f .L8005E880
|
||||
/* 39A8C 8005E68C 00000000 */ nop
|
||||
/* 39A90 8005E690 C7AC0028 */ lwc1 $f12, 0x28($sp)
|
||||
/* 39A94 8005E694 C7AE0030 */ lwc1 $f14, 0x30($sp)
|
||||
/* 39A98 8005E698 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 39A9C 8005E69C 8E220290 */ lw $v0, 0x290($s1)
|
||||
/* 39AA0 8005E6A0 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 39AA4 8005E6A4 C7A0002C */ lwc1 $f0, 0x2c($sp)
|
||||
/* 39AA8 8005E6A8 8C43000C */ lw $v1, 0xc($v0)
|
||||
/* 39AAC 8005E6AC 8E420000 */ lw $v0, ($s2)
|
||||
/* 39AB0 8005E6B0 E656001C */ swc1 $f22, 0x1c($s2)
|
||||
/* 39AB4 8005E6B4 E640003C */ swc1 $f0, 0x3c($s2)
|
||||
/* 39AB8 8005E6B8 34420200 */ ori $v0, $v0, 0x200
|
||||
/* 39ABC 8005E6BC AE420000 */ sw $v0, ($s2)
|
||||
/* 39AC0 8005E6C0 AE430028 */ sw $v1, 0x28($s2)
|
||||
.L8005E6C4:
|
||||
/* 39AC4 8005E6C4 0C00A720 */ jal atan2
|
||||
/* 39AC8 8005E6C8 00000000 */ nop
|
||||
/* 39ACC 8005E6CC E640000C */ swc1 $f0, 0xc($s2)
|
||||
/* 39AD0 8005E6D0 08017A20 */ j .L8005E880
|
||||
/* 39AD4 8005E6D4 AE200288 */ sw $zero, 0x288($s1)
|
||||
.L8005E6D8:
|
||||
/* 39AD8 8005E6D8 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39ADC 8005E6DC C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39AE0 8005E6E0 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 39AE4 8005E6E4 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 39AE8 8005E6E8 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 39AEC 8005E6EC C642003C */ lwc1 $f2, 0x3c($s2)
|
||||
/* 39AF0 8005E6F0 00021100 */ sll $v0, $v0, 4
|
||||
/* 39AF4 8005E6F4 02228021 */ addu $s0, $s1, $v0
|
||||
/* 39AF8 8005E6F8 46006006 */ mov.s $f0, $f12
|
||||
/* 39AFC 8005E6FC C6160004 */ lwc1 $f22, 4($s0)
|
||||
/* 39B00 8005E700 C614000C */ lwc1 $f20, 0xc($s0)
|
||||
/* 39B04 8005E704 46007106 */ mov.s $f4, $f14
|
||||
/* 39B08 8005E708 E7A00028 */ swc1 $f0, 0x28($sp)
|
||||
/* 39B0C 8005E70C E7A2002C */ swc1 $f2, 0x2c($sp)
|
||||
/* 39B10 8005E710 0C00A7B5 */ jal dist2D
|
||||
/* 39B14 8005E714 E7A40030 */ swc1 $f4, 0x30($sp)
|
||||
/* 39B18 8005E718 C622029C */ lwc1 $f2, 0x29c($s1)
|
||||
/* 39B1C 8005E71C 4602003E */ c.le.s $f0, $f2
|
||||
/* 39B20 8005E720 00000000 */ nop
|
||||
/* 39B24 8005E724 45010056 */ bc1t .L8005E880
|
||||
/* 39B28 8005E728 E7A00034 */ swc1 $f0, 0x34($sp)
|
||||
/* 39B2C 8005E72C 3C0142B4 */ lui $at, 0x42b4
|
||||
/* 39B30 8005E730 4481D000 */ mtc1 $at, $f26
|
||||
.L8005E734:
|
||||
/* 39B34 8005E734 82020000 */ lb $v0, ($s0)
|
||||
/* 39B38 8005E738 14400028 */ bnez $v0, .L8005E7DC
|
||||
/* 39B3C 8005E73C 00000000 */ nop
|
||||
/* 39B40 8005E740 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39B44 8005E744 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39B48 8005E748 4406B000 */ mfc1 $a2, $f22
|
||||
/* 39B4C 8005E74C 4407A000 */ mfc1 $a3, $f20
|
||||
/* 39B50 8005E750 0C00A720 */ jal atan2
|
||||
/* 39B54 8005E754 00000000 */ nop
|
||||
/* 39B58 8005E758 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39B5C 8005E75C C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39B60 8005E760 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 39B64 8005E764 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 39B68 8005E768 0C00A720 */ jal atan2
|
||||
/* 39B6C 8005E76C 46000606 */ mov.s $f24, $f0
|
||||
/* 39B70 8005E770 4600C306 */ mov.s $f12, $f24
|
||||
/* 39B74 8005E774 0C00A70A */ jal get_clamped_angle_diff
|
||||
/* 39B78 8005E778 46000386 */ mov.s $f14, $f0
|
||||
/* 39B7C 8005E77C 46000005 */ abs.s $f0, $f0
|
||||
/* 39B80 8005E780 461A003C */ c.lt.s $f0, $f26
|
||||
/* 39B84 8005E784 00000000 */ nop
|
||||
/* 39B88 8005E788 4501000F */ bc1t .L8005E7C8
|
||||
/* 39B8C 8005E78C 00000000 */ nop
|
||||
/* 39B90 8005E790 8E230284 */ lw $v1, 0x284($s1)
|
||||
/* 39B94 8005E794 8E220280 */ lw $v0, 0x280($s1)
|
||||
/* 39B98 8005E798 1062000B */ beq $v1, $v0, .L8005E7C8
|
||||
/* 39B9C 8005E79C 24620001 */ addiu $v0, $v1, 1
|
||||
/* 39BA0 8005E7A0 AE220284 */ sw $v0, 0x284($s1)
|
||||
/* 39BA4 8005E7A4 28420028 */ slti $v0, $v0, 0x28
|
||||
/* 39BA8 8005E7A8 50400001 */ beql $v0, $zero, .L8005E7B0
|
||||
/* 39BAC 8005E7AC AE200284 */ sw $zero, 0x284($s1)
|
||||
.L8005E7B0:
|
||||
/* 39BB0 8005E7B0 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 39BB4 8005E7B4 00021100 */ sll $v0, $v0, 4
|
||||
/* 39BB8 8005E7B8 02228021 */ addu $s0, $s1, $v0
|
||||
/* 39BBC 8005E7BC C6160004 */ lwc1 $f22, 4($s0)
|
||||
/* 39BC0 8005E7C0 080179CD */ j .L8005E734
|
||||
/* 39BC4 8005E7C4 C614000C */ lwc1 $f20, 0xc($s0)
|
||||
.L8005E7C8:
|
||||
/* 39BC8 8005E7C8 82020000 */ lb $v0, ($s0)
|
||||
/* 39BCC 8005E7CC 14400003 */ bnez $v0, .L8005E7DC
|
||||
/* 39BD0 8005E7D0 00000000 */ nop
|
||||
/* 39BD4 8005E7D4 08017A20 */ j .L8005E880
|
||||
/* 39BD8 8005E7D8 AE200288 */ sw $zero, 0x288($s1)
|
||||
.L8005E7DC:
|
||||
/* 39BDC 8005E7DC 3C0142B4 */ lui $at, 0x42b4
|
||||
/* 39BE0 8005E7E0 4481D000 */ mtc1 $at, $f26
|
||||
.L8005E7E4:
|
||||
/* 39BE4 8005E7E4 82020000 */ lb $v0, ($s0)
|
||||
/* 39BE8 8005E7E8 10400024 */ beqz $v0, .L8005E87C
|
||||
/* 39BEC 8005E7EC 24020001 */ addiu $v0, $zero, 1
|
||||
/* 39BF0 8005E7F0 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39BF4 8005E7F4 C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39BF8 8005E7F8 4406B000 */ mfc1 $a2, $f22
|
||||
/* 39BFC 8005E7FC 4407A000 */ mfc1 $a3, $f20
|
||||
/* 39C00 8005E800 0C00A720 */ jal atan2
|
||||
/* 39C04 8005E804 00000000 */ nop
|
||||
/* 39C08 8005E808 C64C0038 */ lwc1 $f12, 0x38($s2)
|
||||
/* 39C0C 8005E80C C64E0040 */ lwc1 $f14, 0x40($s2)
|
||||
/* 39C10 8005E810 8FA60018 */ lw $a2, 0x18($sp)
|
||||
/* 39C14 8005E814 8FA70020 */ lw $a3, 0x20($sp)
|
||||
/* 39C18 8005E818 0C00A720 */ jal atan2
|
||||
/* 39C1C 8005E81C 46000606 */ mov.s $f24, $f0
|
||||
/* 39C20 8005E820 4600C306 */ mov.s $f12, $f24
|
||||
/* 39C24 8005E824 0C00A70A */ jal get_clamped_angle_diff
|
||||
/* 39C28 8005E828 46000386 */ mov.s $f14, $f0
|
||||
/* 39C2C 8005E82C 46000005 */ abs.s $f0, $f0
|
||||
/* 39C30 8005E830 461A003C */ c.lt.s $f0, $f26
|
||||
/* 39C34 8005E834 00000000 */ nop
|
||||
/* 39C38 8005E838 45010010 */ bc1t .L8005E87C
|
||||
/* 39C3C 8005E83C 24020001 */ addiu $v0, $zero, 1
|
||||
/* 39C40 8005E840 8E230284 */ lw $v1, 0x284($s1)
|
||||
/* 39C44 8005E844 8E220280 */ lw $v0, 0x280($s1)
|
||||
/* 39C48 8005E848 1062000B */ beq $v1, $v0, .L8005E878
|
||||
/* 39C4C 8005E84C 24620001 */ addiu $v0, $v1, 1
|
||||
/* 39C50 8005E850 AE220284 */ sw $v0, 0x284($s1)
|
||||
/* 39C54 8005E854 28420028 */ slti $v0, $v0, 0x28
|
||||
/* 39C58 8005E858 50400001 */ beql $v0, $zero, .L8005E860
|
||||
/* 39C5C 8005E85C AE200284 */ sw $zero, 0x284($s1)
|
||||
.L8005E860:
|
||||
/* 39C60 8005E860 8E220284 */ lw $v0, 0x284($s1)
|
||||
/* 39C64 8005E864 00021100 */ sll $v0, $v0, 4
|
||||
/* 39C68 8005E868 02228021 */ addu $s0, $s1, $v0
|
||||
/* 39C6C 8005E86C C6160004 */ lwc1 $f22, 4($s0)
|
||||
/* 39C70 8005E870 080179F9 */ j .L8005E7E4
|
||||
/* 39C74 8005E874 C614000C */ lwc1 $f20, 0xc($s0)
|
||||
.L8005E878:
|
||||
/* 39C78 8005E878 24020001 */ addiu $v0, $zero, 1
|
||||
.L8005E87C:
|
||||
/* 39C7C 8005E87C AE220288 */ sw $v0, 0x288($s1)
|
||||
.L8005E880:
|
||||
/* 39C80 8005E880 8FBF0044 */ lw $ra, 0x44($sp)
|
||||
/* 39C84 8005E884 8FB20040 */ lw $s2, 0x40($sp)
|
||||
/* 39C88 8005E888 8FB1003C */ lw $s1, 0x3c($sp)
|
||||
/* 39C8C 8005E88C 8FB00038 */ lw $s0, 0x38($sp)
|
||||
/* 39C90 8005E890 D7BA0060 */ ldc1 $f26, 0x60($sp)
|
||||
/* 39C94 8005E894 D7B80058 */ ldc1 $f24, 0x58($sp)
|
||||
/* 39C98 8005E898 D7B60050 */ ldc1 $f22, 0x50($sp)
|
||||
/* 39C9C 8005E89C D7B40048 */ ldc1 $f20, 0x48($sp)
|
||||
/* 39CA0 8005E8A0 03E00008 */ jr $ra
|
||||
/* 39CA4 8005E8A4 27BD0068 */ addiu $sp, $sp, 0x68
|
||||
/* 39CA8 8005E8A8 00000000 */ nop
|
||||
/* 39CAC 8005E8AC 00000000 */ nop
|
@ -1,69 +0,0 @@
|
||||
.set noat # allow manual use of $at
|
||||
.set noreorder # don't insert nops after branches
|
||||
|
||||
glabel collision_check_player_intersecting_world
|
||||
/* 7D7B8 800E4308 27BDFFA0 */ addiu $sp, $sp, -0x60
|
||||
/* 7D7BC 800E430C F7B40048 */ sdc1 $f20, 0x48($sp)
|
||||
/* 7D7C0 800E4310 4480A000 */ mtc1 $zero, $f20
|
||||
/* 7D7C4 800E4314 F7B80058 */ sdc1 $f24, 0x58($sp)
|
||||
/* 7D7C8 800E4318 3C0142B4 */ lui $at, 0x42b4
|
||||
/* 7D7CC 800E431C 4481C000 */ mtc1 $at, $f24
|
||||
/* 7D7D0 800E4320 AFB40040 */ sw $s4, 0x40($sp)
|
||||
/* 7D7D4 800E4324 0080A02D */ daddu $s4, $a0, $zero
|
||||
/* 7D7D8 800E4328 AFB20038 */ sw $s2, 0x38($sp)
|
||||
/* 7D7DC 800E432C 2412FFFF */ addiu $s2, $zero, -1
|
||||
/* 7D7E0 800E4330 AFB10034 */ sw $s1, 0x34($sp)
|
||||
/* 7D7E4 800E4334 0000882D */ daddu $s1, $zero, $zero
|
||||
/* 7D7E8 800E4338 AFB00030 */ sw $s0, 0x30($sp)
|
||||
/* 7D7EC 800E433C 3C10800F */ lui $s0, %hi(gPlayerStatusPtr)
|
||||
/* 7D7F0 800E4340 26107B30 */ addiu $s0, $s0, %lo(gPlayerStatusPtr)
|
||||
/* 7D7F4 800E4344 F7B60050 */ sdc1 $f22, 0x50($sp)
|
||||
/* 7D7F8 800E4348 4485B000 */ mtc1 $a1, $f22
|
||||
/* 7D7FC 800E434C 00000000 */ nop
|
||||
/* 7D800 800E4350 4680B5A0 */ cvt.s.w $f22, $f22
|
||||
/* 7D804 800E4354 AFB3003C */ sw $s3, 0x3c($sp)
|
||||
/* 7D808 800E4358 27B30028 */ addiu $s3, $sp, 0x28
|
||||
/* 7D80C 800E435C AFBF0044 */ sw $ra, 0x44($sp)
|
||||
.L800E4360:
|
||||
/* 7D810 800E4360 0280202D */ daddu $a0, $s4, $zero
|
||||
/* 7D814 800E4364 8E020000 */ lw $v0, ($s0)
|
||||
/* 7D818 800E4368 27A60020 */ addiu $a2, $sp, 0x20
|
||||
/* 7D81C 800E436C 0040182D */ daddu $v1, $v0, $zero
|
||||
/* 7D820 800E4370 C4440028 */ lwc1 $f4, 0x28($v0)
|
||||
/* 7D824 800E4374 C440002C */ lwc1 $f0, 0x2c($v0)
|
||||
/* 7D828 800E4378 C4620030 */ lwc1 $f2, 0x30($v1)
|
||||
/* 7D82C 800E437C 46160000 */ add.s $f0, $f0, $f22
|
||||
/* 7D830 800E4380 E7A40020 */ swc1 $f4, 0x20($sp)
|
||||
/* 7D834 800E4384 E7A20028 */ swc1 $f2, 0x28($sp)
|
||||
/* 7D838 800E4388 E7A00024 */ swc1 $f0, 0x24($sp)
|
||||
/* 7D83C 800E438C AFB30010 */ sw $s3, 0x10($sp)
|
||||
/* 7D840 800E4390 AFA00014 */ sw $zero, 0x14($sp)
|
||||
/* 7D844 800E4394 E7B40018 */ swc1 $f20, 0x18($sp)
|
||||
/* 7D848 800E4398 8E050000 */ lw $a1, ($s0)
|
||||
/* 7D84C 800E439C 0C037B01 */ jal player_test_lateral_overlap
|
||||
/* 7D850 800E43A0 27A70024 */ addiu $a3, $sp, 0x24
|
||||
/* 7D854 800E43A4 0040182D */ daddu $v1, $v0, $zero
|
||||
/* 7D858 800E43A8 04630001 */ bgezl $v1, .L800E43B0
|
||||
/* 7D85C 800E43AC 0060902D */ daddu $s2, $v1, $zero
|
||||
.L800E43B0:
|
||||
/* 7D860 800E43B0 26310001 */ addiu $s1, $s1, 1
|
||||
/* 7D864 800E43B4 8E020000 */ lw $v0, ($s0)
|
||||
/* 7D868 800E43B8 C7A00020 */ lwc1 $f0, 0x20($sp)
|
||||
/* 7D86C 800E43BC C7A20028 */ lwc1 $f2, 0x28($sp)
|
||||
/* 7D870 800E43C0 E4400028 */ swc1 $f0, 0x28($v0)
|
||||
/* 7D874 800E43C4 E4420030 */ swc1 $f2, 0x30($v0)
|
||||
/* 7D878 800E43C8 2A220004 */ slti $v0, $s1, 4
|
||||
/* 7D87C 800E43CC 1440FFE4 */ bnez $v0, .L800E4360
|
||||
/* 7D880 800E43D0 4618A500 */ add.s $f20, $f20, $f24
|
||||
/* 7D884 800E43D4 0240102D */ daddu $v0, $s2, $zero
|
||||
/* 7D888 800E43D8 8FBF0044 */ lw $ra, 0x44($sp)
|
||||
/* 7D88C 800E43DC 8FB40040 */ lw $s4, 0x40($sp)
|
||||
/* 7D890 800E43E0 8FB3003C */ lw $s3, 0x3c($sp)
|
||||
/* 7D894 800E43E4 8FB20038 */ lw $s2, 0x38($sp)
|
||||
/* 7D898 800E43E8 8FB10034 */ lw $s1, 0x34($sp)
|
||||
/* 7D89C 800E43EC 8FB00030 */ lw $s0, 0x30($sp)
|
||||
/* 7D8A0 800E43F0 D7B80058 */ ldc1 $f24, 0x58($sp)
|
||||
/* 7D8A4 800E43F4 D7B60050 */ ldc1 $f22, 0x50($sp)
|
||||
/* 7D8A8 800E43F8 D7B40048 */ ldc1 $f20, 0x48($sp)
|
||||
/* 7D8AC 800E43FC 03E00008 */ jr $ra
|
||||
/* 7D8B0 800E4400 27BD0060 */ addiu $sp, $sp, 0x60
|
@ -850,9 +850,9 @@ func_8005DB00 = 0x8005DB00; // type:func rom:0x38F00
|
||||
func_8005DD54 = 0x8005DD54; // type:func rom:0x39154
|
||||
func_8005DDF0 = 0x8005DDF0; // type:func rom:0x391F0
|
||||
get_npc_pos = 0x8005DE10; // type:func rom:0x39210
|
||||
func_8005DECC = 0x8005DECC; // type:func rom:0x392CC
|
||||
func_8005DFD4 = 0x8005DFD4; // type:func rom:0x393D4
|
||||
func_8005E12C = 0x8005E12C; // type:func rom:0x3952C
|
||||
npc_follow_init = 0x8005DECC; // type:func rom:0x392CC
|
||||
npc_update_npc_tracking = 0x8005DFD4; // type:func rom:0x393D4
|
||||
npc_follow_npc = 0x8005E12C; // type:func rom:0x3952C
|
||||
nuBoot = 0x8005E8B0; // type:func rom:0x39CB0
|
||||
boot_idle = 0x8005E90C; // type:func rom:0x39D0C
|
||||
nuScCreateScheduler = 0x8005E9B0; // type:func rom:0x39DB0
|
||||
|
Loading…
Reference in New Issue
Block a user