2020-10-03 15:22:44 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "vt.h"
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
s32 func_8006CFC0(s32 scene) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 validScenes[] = { SCENE_SPOT00, SCENE_SPOT06, SCENE_SPOT09, SCENE_SPOT12, SCENE_SPOT20 };
|
|
|
|
s32 i;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < ARRAY_COUNT(validScenes); i++) {
|
|
|
|
if (scene == validScenes[i]) {
|
2020-03-17 04:31:30 +00:00
|
|
|
return 1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006D074(GlobalContext* globalCtx) {
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.horseData.scene = SCENE_SPOT00;
|
|
|
|
gSaveContext.horseData.pos.x = -1840;
|
|
|
|
gSaveContext.horseData.pos.y = 72;
|
|
|
|
gSaveContext.horseData.pos.z = 5497;
|
|
|
|
gSaveContext.horseData.angle = -27353;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006D0AC(GlobalContext* globalCtx) {
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.horseData.scene == SCENE_SPOT06) {
|
|
|
|
gSaveContext.horseData.scene = SCENE_SPOT06;
|
|
|
|
gSaveContext.horseData.pos.x = -2065;
|
|
|
|
gSaveContext.horseData.pos.y = -863;
|
|
|
|
gSaveContext.horseData.pos.z = 1839;
|
|
|
|
gSaveContext.horseData.angle = 0;
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ s16 scene;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x02 */ Vec3s pos;
|
2020-03-22 21:19:43 +00:00
|
|
|
/* 0x08 */ s16 angle;
|
|
|
|
/* 0x0A */ s16 type;
|
2020-03-17 04:31:30 +00:00
|
|
|
} HorseSpawn;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 i;
|
2020-03-22 21:19:43 +00:00
|
|
|
HorseSpawn horseSpawns[] = {
|
|
|
|
{ 81, 0xFE34, 0x0064, 0x19F0, 0, 2 }, { 87, 0xF877, 0xFBFF, 0x0300, 0, 2 },
|
|
|
|
{ 90, 0x0A06, 0xFEFD, 0x02FF, 0, 2 }, { 93, 0xFEB8, 0x000A, 0x03B9, 0, 2 },
|
2020-03-17 04:31:30 +00:00
|
|
|
{ 99, 0x03A0, 0x0000, 0xF718, 0, 2 },
|
|
|
|
};
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if ((AREG(6) != 0) && (Flags_GetEventChkInf(0x18) || (DREG(1) != 0))) {
|
|
|
|
player->rideActor =
|
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, player->actor.posRot.pos.x,
|
|
|
|
player->actor.posRot.pos.y, player->actor.posRot.pos.z, player->actor.shape.rot.x,
|
|
|
|
player->actor.shape.rot.y, player->actor.shape.rot.z, 9);
|
|
|
|
if (player->rideActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("player->ride.actor != NULL", "../z_horse.c", 343);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
func_8002DECC(globalCtx, player, player->rideActor);
|
|
|
|
func_8002DE74(globalCtx, player);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
2020-03-17 04:31:30 +00:00
|
|
|
player->rideActor->room = -1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Actor* horseActor;
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.minigameState = 0;
|
2020-03-22 21:19:43 +00:00
|
|
|
horseActor =
|
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
|
2020-03-17 04:31:30 +00:00
|
|
|
horseActor->room = -1;
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Actor* horseActor;
|
2020-03-22 21:19:43 +00:00
|
|
|
horseActor =
|
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
|
|
|
if (horseActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("horse_actor != NULL", "../z_horse.c", 389);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
|
2020-04-16 21:36:12 +00:00
|
|
|
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18),
|
2020-03-22 21:19:43 +00:00
|
|
|
DREG(1));
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (func_8006CFC0(gSaveContext.horseData.scene)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Actor* horseActor;
|
2020-04-16 21:36:12 +00:00
|
|
|
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horseData.pos.x,
|
|
|
|
gSaveContext.horseData.pos.y, gSaveContext.horseData.pos.z, 0,
|
|
|
|
gSaveContext.horseData.angle, 0, 1);
|
2020-03-22 21:19:43 +00:00
|
|
|
if (horseActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("horse_actor != NULL", "../z_horse.c", 414);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
2020-03-17 04:31:30 +00:00
|
|
|
horseActor->room = -1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_COL(RED, WHITE));
|
|
|
|
// Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD."
|
2020-04-16 21:36:12 +00:00
|
|
|
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
|
|
|
func_8006D074(globalCtx);
|
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && !Flags_GetEventChkInf(0x18) && (DREG(1) == 0)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Actor* horseActor;
|
2020-03-22 21:19:43 +00:00
|
|
|
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -500.0f, 0, 0, 0, 1);
|
|
|
|
if (horseActor == 0) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("horse_actor != NULL", "../z_horse.c", 443);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
|
|
|
} else if (Flags_GetEventChkInf(0x18) || (DREG(1) != 0)) {
|
|
|
|
for (i = 0; i < ARRAY_COUNT(horseSpawns); i++) {
|
2020-03-17 04:31:30 +00:00
|
|
|
HorseSpawn* horseSpawn = &horseSpawns[i];
|
2020-03-22 21:19:43 +00:00
|
|
|
if (horseSpawn->scene == globalCtx->sceneNum) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Actor* horseActor;
|
2020-03-22 21:19:43 +00:00
|
|
|
horseActor =
|
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, horseSpawn->pos.x, horseSpawn->pos.y,
|
|
|
|
horseSpawn->pos.z, 0, horseSpawn->angle, 0, horseSpawn->type);
|
|
|
|
if (horseActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("horse_actor != NULL", "../z_horse.c", 466);
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
2020-03-17 04:31:30 +00:00
|
|
|
horseActor->room = -1;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if (!Flags_GetEventChkInf(0x18)) {
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.nightFlag != 0)) {
|
2020-03-22 21:19:43 +00:00
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
|
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
typedef struct {
|
|
|
|
/* 0x00 */ s16 scene;
|
|
|
|
/* 0x04 */ s32 cutsceneIndex;
|
2020-03-17 04:31:30 +00:00
|
|
|
/* 0x08 */ Vec3s pos;
|
2020-03-22 21:19:43 +00:00
|
|
|
/* 0x0E */ s16 angle;
|
|
|
|
/* 0x10 */ s16 type;
|
2020-03-17 04:31:30 +00:00
|
|
|
} struct_8011F9B8;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s32 pad;
|
|
|
|
s32 i;
|
|
|
|
Vec3s spawnPos;
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.entranceIndex == 0x028A || gSaveContext.entranceIndex == 0x028E ||
|
|
|
|
gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) &&
|
|
|
|
(gSaveContext.respawnFlag == 0)) {
|
2020-03-22 21:19:43 +00:00
|
|
|
Vec3s spawnPositions[] = {
|
2020-03-17 04:31:30 +00:00
|
|
|
{ 0xF46F, 0x0139, 0x1E14 },
|
|
|
|
{ 0xF894, 0x0139, 0x1B67 },
|
|
|
|
{ 0xF035, 0x0139, 0x1B15 },
|
|
|
|
{ 0xF6F7, 0x0139, 0x1766 },
|
|
|
|
};
|
|
|
|
|
2020-04-16 21:36:12 +00:00
|
|
|
if (gSaveContext.entranceIndex == 0x028A) {
|
2020-03-17 04:31:30 +00:00
|
|
|
spawnPos = spawnPositions[0];
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if (gSaveContext.entranceIndex == 0x028E) {
|
2020-03-17 04:31:30 +00:00
|
|
|
spawnPos = spawnPositions[1];
|
2020-04-16 21:36:12 +00:00
|
|
|
} else if (gSaveContext.entranceIndex == 0x0292) {
|
2020-03-17 04:31:30 +00:00
|
|
|
spawnPos = spawnPositions[2];
|
2020-03-23 23:11:21 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
spawnPos = spawnPositions[3];
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, spawnPos.x, spawnPos.y,
|
|
|
|
spawnPos.z, 0, player->actor.posRot.rot.y, 0, 7);
|
2020-03-23 23:11:21 +00:00
|
|
|
if (player->rideActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("player->ride.actor != NULL", "../z_horse.c", 561);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
func_8002DECC(globalCtx, player, player->rideActor);
|
|
|
|
func_8002DE74(globalCtx, player);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
|
|
|
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
(Flags_GetEventChkInf(0x18) == 0) && (DREG(1) == 0)) {
|
|
|
|
player->rideActor =
|
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 894.0f, 0.0f, -2084.0f, 0, -0x7FFF, 0, 5);
|
2020-03-23 23:11:21 +00:00
|
|
|
if (player->rideActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("player->ride.actor != NULL", "../z_horse.c", 582);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
func_8002DECC(globalCtx, player, player->rideActor);
|
|
|
|
func_8002DE74(globalCtx, player);
|
2020-04-16 21:36:12 +00:00
|
|
|
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
2020-03-17 04:31:30 +00:00
|
|
|
|
2020-03-23 23:11:21 +00:00
|
|
|
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
2020-03-17 04:31:30 +00:00
|
|
|
player->rideActor->room = -1;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
|
|
|
static struct_8011F9B8 D_8011F9B8[] = {
|
|
|
|
{ 93, 0xFFF0, 0x0E10, 0x0585, 0x0168, 0x8001, 8 }, { 99, 0xFFF0, 0xFF06, 0x0001, 0xF9D4, 0x4000, 6 },
|
|
|
|
{ 99, 0xFFF1, 0x0000, 0x0000, 0x0000, 0x0000, 5 }, { 99, 0xFFF5, 0x0000, 0x0000, 0x0000, 0x0000, 7 },
|
|
|
|
{ 81, 0xFFF3, 0xF46F, 0x0139, 0x1E14, 0x0000, 7 }, { 81, 0xFFF4, 0xF894, 0x0139, 0x1B67, 0x0000, 7 },
|
|
|
|
{ 81, 0xFFF5, 0xF035, 0x0139, 0x1B15, 0x0000, 7 }, { 81, 0xFFF6, 0xF035, 0x0139, 0x1B15, 0x0000, 7 },
|
2020-03-17 04:31:30 +00:00
|
|
|
};
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) {
|
|
|
|
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) &&
|
2020-08-30 16:51:46 +00:00
|
|
|
(((void)0, gSaveContext.cutsceneIndex) == D_8011F9B8[i].cutsceneIndex)) {
|
2020-03-22 21:19:43 +00:00
|
|
|
if (D_8011F9B8[i].type == 7) {
|
2020-08-30 16:51:46 +00:00
|
|
|
if ((globalCtx->sceneNum == 99) && (((void)0, gSaveContext.cutsceneIndex) == 0xFFF1)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
D_8011F9B8[i].pos.x = player->actor.posRot.pos.x;
|
|
|
|
D_8011F9B8[i].pos.y = player->actor.posRot.pos.y;
|
|
|
|
D_8011F9B8[i].pos.z = player->actor.posRot.pos.z;
|
|
|
|
}
|
|
|
|
|
|
|
|
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
2020-03-22 21:19:43 +00:00
|
|
|
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
|
|
|
player->actor.posRot.rot.y, 0, D_8011F9B8[i].type);
|
2020-03-23 23:11:21 +00:00
|
|
|
if (player->rideActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("player->ride.actor != NULL", "../z_horse.c", 628);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
func_8002DECC(globalCtx, player, player->rideActor);
|
|
|
|
func_8002DE74(globalCtx, player);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if ((D_8011F9B8[i].type == 5) || (D_8011F9B8[i].type == 6) || (D_8011F9B8[i].type == 8)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
Vec3f sp54;
|
|
|
|
s32 temp;
|
|
|
|
|
|
|
|
temp = 0;
|
2020-04-16 21:36:12 +00:00
|
|
|
if (((gSaveContext.eventInf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6) {
|
2020-03-17 04:31:30 +00:00
|
|
|
temp = 0x8000;
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
player->rideActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE,
|
2020-03-22 21:19:43 +00:00
|
|
|
D_8011F9B8[i].pos.x, D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0,
|
|
|
|
D_8011F9B8[i].angle, 0, D_8011F9B8[i].type | temp);
|
2020-03-23 23:11:21 +00:00
|
|
|
if (player->rideActor == NULL) {
|
2020-03-17 04:31:30 +00:00
|
|
|
__assert("player->ride.actor != NULL", "../z_horse.c", 667);
|
2020-03-23 23:11:21 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
player->actor.posRot.pos.x = D_8011F9B8[i].pos.x;
|
|
|
|
player->actor.posRot.pos.y = D_8011F9B8[i].pos.y;
|
|
|
|
player->actor.posRot.pos.z = D_8011F9B8[i].pos.z;
|
|
|
|
player->actor.shape.rot.x = player->actor.shape.rot.z = 0;
|
|
|
|
player->actor.shape.rot.y = D_8011F9B8[i].angle;
|
|
|
|
|
|
|
|
func_8002DECC(globalCtx, player, player->rideActor);
|
|
|
|
func_8002DE74(globalCtx, player);
|
|
|
|
|
|
|
|
sp54.x = player->actor.posRot.pos.x - 200.0f;
|
|
|
|
sp54.y = player->actor.posRot.pos.y + 100.0f;
|
|
|
|
sp54.z = player->actor.posRot.pos.z;
|
|
|
|
|
decompile z_camera (#398)
* cleanup
* name camera action functions
* decompile a few small functions, name a few Camera struct members
* decompile camera data, decompile a few camera functions
* Split ASM for code_800BB0A0
* removing code_800BB0A0.s
* PR Requests, Camera WIP
* remove #define NON_MATCHING from db_camera
* rename code_8007BF90.c to z_olib.c, rename functions in z_olib.c
* camera wip
* rename some struct memebers, some decomp wip
* pr updates
* camera wip
* name some fields in Camera Struct, being making sense of Camera_Update
* Camera WIP
* wip
* wip
* add z64camera.h header, begin creating CameraSetting macros
* wip
* wip
* wip
* wip
* migrate camera bss to c
* match a couple functions in db_camera
* match some small db_camera functions
* wip
* migrate db_camera rodata, match a few functions
* remote db_camera.rodata.s
* match some of db_camera
* identify types of some unknown data pieces
* some small wip
* Match Camera_Init, some function changes, some struct name changes. Change unk_C0 and unk_CC to floats from Vec3fs
* add naming for a few more Camera struct members
* wip
* match func_80043F94
* Match Camera_Jump1
* document some of Camera_Jump1
* wip
* match Camera_Jump3
* Match Camera_Update, FeelsAmazing
* wip
* wip
* match Camera_SetParam
* minor cleanup
* wip
* wip
* match Camera_KeepOn0
* some documentation, modify some matching functions to match style of others.
* match Camera_Demo1
* match camera_demo9
* document Camera_Demo1 and Camera_Demo9
* wip
* Match camera_battle4
* match camera_unique2
* Match Camera_Unique3
* match camera_special6
* match Camera_Special5
* wip
* document camera_special6
* naming updates
* match camera_Unique1
* match Camera_Unique0
* wip
* Match Camera_CalcUpFromPitchYawRoll
* match func_80045508
* document Camera_Battle4
* document several camera functions, move camera data to separate file
* rename phi/theta to pitch/yaw
* wip
* uniq9 wip
* Camera_Unqiue9 OK
* document Camera_Unique9
* name unk_160 in camera struct
* wip
* wip
* minor updates
* fix conflicts
* wip
* wip
* Olib updates
* wip
* wip
* rename most Math3D functions, few matches, documentation
* wip
* document most of math3d
* wip
* wip
* wip
* pr updates
* Match Camera_Fixed4
* match func_80058E8C
* pr updates
* add missing comment block finalizer
* Merge math3dupdates
* match Camera_ChangeSetting
* Match Camera_ChangeMode
* match func_80058148
* Match Camera_Special9
* decompile the rest of camera data
* match Camera_Demo5
* name a few camera functions in z_play
* match func_80046CB4, some work on other fucntions
* wip
* impove some non matchings
* fix function rename
* match func_800588B4
* match Camera_Subj4
* wip
* Camera_Demo3 matching, Camera_Battle1 big progress
* Camera_Normal2 OK
* wip
* match Camera_Parallel1
* normalize some things across functions
* match Camera_Normal1
* Match Camera_Normal3
* some cleanup
* more cleanup
* more cleanup , match Camera_CalcDefaultPitch
* data formatting
* Match Camera_Jump2
* document Camera_Jump2
* Match Camera_KeepOn3
* document some of Camera_KeepOn3
* improve some non_matchings
* match func_80045C74 and func_800460A8
* code cleanup, documentation
* match Camera_KeepOn1
* Match Camera_Subj3
* Match Camera_Battle1
* remove non_matching from func_80044adc and func_80046e20
* name several members of Battle1
* more documentation on Battle1
* cleanup
* renaming Camera_Vec3fScaleXYZFactor to Camera_Vec3fTranslateByUnitVector
* reorganize update structs, remove final references to params, remove CameraParams union
* implement camera enums into player
* Renaming Camera_GetDir to Camera_GetInputDir, Camera_GetRealDir to Camera_GetCamDir, etc, implement camera enum's into player
* remove non-global camera variables from variables.h
* clean up some variable declarations
* finish pr comment updates
* fix some warnings
* data formatting
* finish commenting on data
* delete unused asm
* remove asm
Co-authored-by: fig <fig02srl@gmail.com>
2020-12-06 22:39:47 +00:00
|
|
|
Gameplay_CameraSetAtEye(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
|
|
|
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, D_8011F9B8[i].pos.x,
|
|
|
|
D_8011F9B8[i].pos.y, D_8011F9B8[i].pos.z, 0, D_8011F9B8[i].angle, 0,
|
|
|
|
D_8011F9B8[i].type);
|
2020-03-17 04:31:30 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006DC68(GlobalContext* globalCtx, Player* player) {
|
|
|
|
if (LINK_IS_ADULT) {
|
2020-04-16 21:36:12 +00:00
|
|
|
if (!func_8006CFC0(gSaveContext.horseData.scene)) {
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_COL(RED, WHITE));
|
|
|
|
// Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD."
|
2020-04-16 21:36:12 +00:00
|
|
|
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
|
2020-03-17 04:31:30 +00:00
|
|
|
osSyncPrintf(VT_RST);
|
|
|
|
func_8006D074(globalCtx);
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (func_8006CFC0(globalCtx->sceneNum)) {
|
2020-04-16 21:36:12 +00:00
|
|
|
if ((gSaveContext.sceneSetupIndex > 3) ||
|
|
|
|
((gSaveContext.entranceIndex == 0x028A || gSaveContext.entranceIndex == 0x028E ||
|
|
|
|
gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) &&
|
|
|
|
(gSaveContext.respawnFlag == 0)) ||
|
|
|
|
((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
|
2020-03-22 21:19:43 +00:00
|
|
|
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_8006D684(globalCtx, player);
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
func_8006D0EC(globalCtx, player);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
void func_8006DD9C(Actor* actor, Vec3f* arg1, s16 arg2) {
|
2020-03-17 04:31:30 +00:00
|
|
|
s16 x = Math_Vec3f_Yaw(&actor->posRot.pos, arg1) - actor->posRot.rot.y;
|
|
|
|
|
2020-03-22 21:19:43 +00:00
|
|
|
if (x > arg2) {
|
2020-03-17 04:31:30 +00:00
|
|
|
actor->posRot.rot.y += arg2;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else if (x < -arg2) {
|
2020-03-17 04:31:30 +00:00
|
|
|
actor->posRot.rot.y -= arg2;
|
2020-03-22 21:19:43 +00:00
|
|
|
} else {
|
2020-03-17 04:31:30 +00:00
|
|
|
actor->posRot.rot.y += x;
|
2020-03-22 21:19:43 +00:00
|
|
|
}
|
2020-03-17 04:31:30 +00:00
|
|
|
|
|
|
|
actor->shape.rot.y = actor->posRot.rot.y;
|
|
|
|
}
|