mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 03:44:34 +00:00
Merge branch 'master' into doc_pause_menu
This commit is contained in:
commit
ac3a7e20fb
457 changed files with 1314 additions and 969 deletions
|
@ -27,14 +27,15 @@ void AudioMgr_HandleRetrace(AudioMgr* audioMgr) {
|
|||
Sched_Notify(audioMgr->sched);
|
||||
}
|
||||
|
||||
D_8016A550 = osGetTime();
|
||||
gAudioThreadUpdateTimeStart = osGetTime();
|
||||
if (SREG(20) >= 2) {
|
||||
rspTask = NULL;
|
||||
} else {
|
||||
rspTask = func_800E4FE0();
|
||||
}
|
||||
D_8016A558 += osGetTime() - D_8016A550;
|
||||
D_8016A550 = 0;
|
||||
gAudioThreadUpdateTimeAcc += osGetTime() - gAudioThreadUpdateTimeStart;
|
||||
gAudioThreadUpdateTimeStart = 0;
|
||||
|
||||
if (audioMgr->rspTask != NULL) {
|
||||
osRecvMesg(&audioMgr->taskQueue, NULL, OS_MESG_BLOCK);
|
||||
func_800C3C80(audioMgr);
|
||||
|
|
|
@ -4,8 +4,16 @@
|
|||
#define GFXPOOL_HEAD_MAGIC 0x1234
|
||||
#define GFXPOOL_TAIL_MAGIC 0x5678
|
||||
|
||||
OSTime sGraphUpdateTime;
|
||||
OSTime sGraphSetTaskTime;
|
||||
/**
|
||||
* The time at which the previous `Graph_Update` ended.
|
||||
*/
|
||||
OSTime sGraphPrevUpdateEndTime;
|
||||
|
||||
/**
|
||||
* The time at which the previous graphics task was scheduled to run.
|
||||
*/
|
||||
OSTime sGraphPrevTaskTimeStart;
|
||||
|
||||
FaultClient sGraphFaultClient;
|
||||
CfbInfo sGraphCfbInfos[3];
|
||||
FaultClient sGraphUcodeFaultClient;
|
||||
|
@ -144,18 +152,18 @@ void Graph_Destroy(GraphicsContext* gfxCtx) {
|
|||
}
|
||||
|
||||
void Graph_TaskSet00(GraphicsContext* gfxCtx) {
|
||||
static Gfx* D_8012D260 = NULL;
|
||||
static Gfx* sPrevTaskWorkBuffer = NULL;
|
||||
static s32 sGraphCfbInfoIdx = 0;
|
||||
|
||||
OSTime time;
|
||||
OSTime timeNow;
|
||||
OSTimer timer;
|
||||
OSMesg msg;
|
||||
OSTask_t* task = &gfxCtx->task.list.t;
|
||||
OSScTask* scTask = &gfxCtx->task;
|
||||
CfbInfo* cfb;
|
||||
s32 pad1;
|
||||
|
||||
D_8016A528 = osGetTime() - sGraphSetTaskTime - D_8016A558;
|
||||
gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime =
|
||||
osGetTime() - sGraphPrevTaskTimeStart - gAudioThreadUpdateTimeAcc;
|
||||
|
||||
osSetTimer(&timer, OS_USEC_TO_CYCLES(3000000), 0, &gfxCtx->queue, (OSMesg)666);
|
||||
|
||||
|
@ -166,36 +174,41 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
|
|||
osSyncPrintf(VT_FGCOL(RED));
|
||||
osSyncPrintf("RCPが帰ってきませんでした。"); // "RCP did not return."
|
||||
osSyncPrintf(VT_RST);
|
||||
|
||||
LogUtils_LogHexDump((void*)&HW_REG(SP_MEM_ADDR_REG, u32), 0x20);
|
||||
LogUtils_LogHexDump((void*)&DPC_START_REG, 0x20);
|
||||
LogUtils_LogHexDump(gGfxSPTaskYieldBuffer, sizeof(gGfxSPTaskYieldBuffer));
|
||||
|
||||
SREG(6) = -1;
|
||||
if (D_8012D260 != NULL) {
|
||||
if (sPrevTaskWorkBuffer != NULL) {
|
||||
HREG(80) = 7;
|
||||
HREG(81) = 1;
|
||||
HREG(83) = 2;
|
||||
D_8012D260 = D_8012D260;
|
||||
Graph_DisassembleUCode(D_8012D260);
|
||||
sPrevTaskWorkBuffer = sPrevTaskWorkBuffer;
|
||||
Graph_DisassembleUCode(sPrevTaskWorkBuffer);
|
||||
}
|
||||
Fault_AddHungupAndCrashImpl("RCP is HUNG UP!!", "Oh! MY GOD!!");
|
||||
}
|
||||
|
||||
osRecvMesg(&gfxCtx->queue, &msg, OS_MESG_NOBLOCK);
|
||||
|
||||
D_8012D260 = gfxCtx->workBuffer;
|
||||
sPrevTaskWorkBuffer = gfxCtx->workBuffer;
|
||||
if (gfxCtx->callback != NULL) {
|
||||
gfxCtx->callback(gfxCtx, gfxCtx->callbackParam);
|
||||
}
|
||||
|
||||
time = osGetTime();
|
||||
if (D_8016A550 != 0) {
|
||||
D_8016A558 = (D_8016A558 + time) - D_8016A550;
|
||||
D_8016A550 = time;
|
||||
timeNow = osGetTime();
|
||||
if (gAudioThreadUpdateTimeStart != 0) {
|
||||
// The audio thread update is running
|
||||
// Add the time already spent to the accumulator and leave the rest for the next cycle
|
||||
|
||||
gAudioThreadUpdateTimeAcc += timeNow - gAudioThreadUpdateTimeStart;
|
||||
gAudioThreadUpdateTimeStart = timeNow;
|
||||
}
|
||||
D_8016A520 = D_8016A558;
|
||||
D_8016A558 = 0;
|
||||
sGraphSetTaskTime = osGetTime();
|
||||
gAudioThreadUpdateTimeTotalPerGfxTask = gAudioThreadUpdateTimeAcc;
|
||||
gAudioThreadUpdateTimeAcc = 0;
|
||||
|
||||
sGraphPrevTaskTimeStart = osGetTime();
|
||||
|
||||
task->type = M_GFXTASK;
|
||||
task->flags = OS_SC_DRAM_DLIST;
|
||||
|
@ -242,7 +255,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
|
|||
cfb->updateRate = R_UPDATE_RATE;
|
||||
|
||||
scTask->framebuffer = cfb;
|
||||
sGraphCfbInfoIdx = sGraphCfbInfoIdx % ARRAY_COUNT(sGraphCfbInfos);
|
||||
sGraphCfbInfoIdx %= ARRAY_COUNT(sGraphCfbInfos);
|
||||
|
||||
if (1) {}
|
||||
|
||||
|
@ -255,7 +268,7 @@ void Graph_TaskSet00(GraphicsContext* gfxCtx) {
|
|||
void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
||||
u32 problem;
|
||||
|
||||
gameState->unk_A0 = 0;
|
||||
gameState->inPreNMIState = false;
|
||||
Graph_InitTHGA(gfxCtx);
|
||||
|
||||
OPEN_DISPS(gfxCtx, "../graph.c", 966);
|
||||
|
@ -366,20 +379,20 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
|||
func_800F3054();
|
||||
|
||||
{
|
||||
OSTime time = osGetTime();
|
||||
OSTime timeNow = osGetTime();
|
||||
s32 pad[4];
|
||||
|
||||
D_8016A538 = gRSPGFXTotalTime;
|
||||
D_8016A530 = gRSPAudioTotalTime;
|
||||
D_8016A540 = gRDPTotalTime;
|
||||
gRSPGFXTotalTime = 0;
|
||||
gRSPAudioTotalTime = 0;
|
||||
gRDPTotalTime = 0;
|
||||
gRSPGfxTimeTotal = gRSPGfxTimeAcc;
|
||||
gRSPAudioTimeTotal = gRSPAudioTimeAcc;
|
||||
gRDPTimeTotal = gRDPTimeAcc;
|
||||
gRSPGfxTimeAcc = 0;
|
||||
gRSPAudioTimeAcc = 0;
|
||||
gRDPTimeAcc = 0;
|
||||
|
||||
if (sGraphUpdateTime != 0) {
|
||||
D_8016A548 = time - sGraphUpdateTime;
|
||||
if (sGraphPrevUpdateEndTime != 0) {
|
||||
gGraphUpdatePeriod = timeNow - sGraphPrevUpdateEndTime;
|
||||
}
|
||||
sGraphUpdateTime = time;
|
||||
sGraphPrevUpdateEndTime = timeNow;
|
||||
}
|
||||
|
||||
if (gIsCtrlr2Valid && CHECK_BTN_ALL(gameState->input[0].press.button, BTN_Z) &&
|
||||
|
@ -389,7 +402,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
|||
gameState->running = false;
|
||||
}
|
||||
|
||||
if (gIsCtrlr2Valid && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->unk_A0) {
|
||||
if (gIsCtrlr2Valid && PreNmiBuff_IsResetting(gAppNmiBufferPtr) && !gameState->inPreNMIState) {
|
||||
// "To reset mode"
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "PRE-NMIによりリセットモードに移行します\n" VT_RST);
|
||||
SET_NEXT_GAMESTATE(gameState, PreNMI_Init, PreNMIState);
|
||||
|
@ -419,12 +432,13 @@ void Graph_ThreadEntry(void* arg0) {
|
|||
|
||||
gameState = SystemArena_MallocDebug(size, "../graph.c", 1196);
|
||||
|
||||
if (!gameState) {
|
||||
if (gameState == NULL) {
|
||||
osSyncPrintf("確保失敗\n"); // "Failure to secure"
|
||||
|
||||
sprintf(faultMsg, "CLASS SIZE= %d bytes", size);
|
||||
Fault_AddHungupAndCrashImpl("GAME CLASS MALLOC FAILED", faultMsg);
|
||||
}
|
||||
|
||||
GameState_Init(gameState, ovl->init, &gfxCtx);
|
||||
|
||||
while (GameState_IsRunning(gameState)) {
|
||||
|
|
29
src/code/object_table.c
Normal file
29
src/code/object_table.c
Normal file
|
@ -0,0 +1,29 @@
|
|||
#include "global.h"
|
||||
|
||||
s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };
|
||||
|
||||
u32 gObjectTableSize = ARRAY_COUNT(gObjectTable);
|
||||
|
||||
// Object linker symbol declarations (used in the table below)
|
||||
#define DEFINE_OBJECT(name, _1) DECLARE_ROM_SEGMENT(name)
|
||||
#define DEFINE_OBJECT_NULL(_0, _1)
|
||||
#define DEFINE_OBJECT_UNSET(_0)
|
||||
|
||||
#include "tables/object_table.h"
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_UNSET
|
||||
|
||||
// Object Table definition
|
||||
#define DEFINE_OBJECT(name, _1) ROM_FILE(name),
|
||||
#define DEFINE_OBJECT_NULL(name, _1) ROM_FILE_EMPTY(name),
|
||||
#define DEFINE_OBJECT_UNSET(_0) { 0 },
|
||||
|
||||
RomFile gObjectTable[] = {
|
||||
#include "tables/object_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_UNSET
|
|
@ -47,10 +47,10 @@
|
|||
|
||||
vs32 sLogScheduler = false;
|
||||
|
||||
OSTime sRSPGFXStartTime;
|
||||
OSTime sRSPAudioStartTime;
|
||||
OSTime sRSPOtherStartTime;
|
||||
OSTime sRDPStartTime;
|
||||
OSTime sRSPGfxTimeStart;
|
||||
OSTime sRSPAudioTimeStart;
|
||||
OSTime sRSPOtherTimeStart;
|
||||
OSTime sRDPTimeStart;
|
||||
|
||||
/**
|
||||
* Set the current framebuffer to the swapbuffer pointed to by the provided cfb
|
||||
|
@ -120,20 +120,20 @@ void Sched_HandlePreNMI(Scheduler* sc) {
|
|||
if (sc->curRSPTask->framebuffer == NULL) {
|
||||
// audio and jpeg tasks end up in here
|
||||
LOG_TIME("(((u64)(now - audio_rsp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))",
|
||||
OS_CYCLES_TO_USEC(now - sRSPAudioStartTime), "../sched.c", 421);
|
||||
} else if (OS_CYCLES_TO_USEC(now - sRSPGFXStartTime) > 1000000 ||
|
||||
OS_CYCLES_TO_USEC(now - sRDPStartTime) > 1000000) {
|
||||
OS_CYCLES_TO_USEC(now - sRSPAudioTimeStart), "../sched.c", 421);
|
||||
} else if (OS_CYCLES_TO_USEC(now - sRSPGfxTimeStart) > 1000000 ||
|
||||
OS_CYCLES_TO_USEC(now - sRDPTimeStart) > 1000000) {
|
||||
// More than 1 second since the RSP or RDP tasks began, halt the RSP and RDP
|
||||
RcpUtils_Reset();
|
||||
// Manually send RSP/RDP done messages to the scheduler interrupt queue if appropriate
|
||||
if (sc->curRSPTask != NULL) {
|
||||
LOG_TIME("(((u64)(now - graph_rsp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))",
|
||||
OS_CYCLES_TO_USEC(now - sRSPGFXStartTime), "../sched.c", 427);
|
||||
OS_CYCLES_TO_USEC(now - sRSPGfxTimeStart), "../sched.c", 427);
|
||||
osSendMesg(&sc->interruptQueue, (OSMesg)RSP_DONE_MSG, OS_MESG_NOBLOCK);
|
||||
}
|
||||
if (sc->curRDPTask != NULL) {
|
||||
LOG_TIME("(((u64)(now - rdp_start_time)*(1000000LL/15625LL))/((62500000LL*3/4)/15625LL))",
|
||||
OS_CYCLES_TO_USEC(now - sRDPStartTime), "../sched.c", 431);
|
||||
OS_CYCLES_TO_USEC(now - sRDPTimeStart), "../sched.c", 431);
|
||||
osSendMesg(&sc->interruptQueue, (OSMesg)RDP_DONE_MSG, OS_MESG_NOBLOCK);
|
||||
}
|
||||
}
|
||||
|
@ -390,11 +390,11 @@ void Sched_RunTask(Scheduler* sc, OSScTask* spTask, OSScTask* dpTask) {
|
|||
|
||||
// Begin profiling timers
|
||||
if (spTask->list.t.type == M_AUDTASK) {
|
||||
sRSPAudioStartTime = osGetTime();
|
||||
sRSPAudioTimeStart = osGetTime();
|
||||
} else if (spTask->list.t.type == M_GFXTASK) {
|
||||
sRSPGFXStartTime = osGetTime();
|
||||
sRSPGfxTimeStart = osGetTime();
|
||||
} else {
|
||||
sRSPOtherStartTime = osGetTime();
|
||||
sRSPOtherTimeStart = osGetTime();
|
||||
}
|
||||
|
||||
// Run RSP
|
||||
|
@ -412,7 +412,7 @@ void Sched_RunTask(Scheduler* sc, OSScTask* spTask, OSScTask* dpTask) {
|
|||
// If the task also uses the RDP, set current running RDP task
|
||||
if (spTask == dpTask && sc->curRDPTask == NULL) {
|
||||
sc->curRDPTask = dpTask;
|
||||
sRDPStartTime = sRSPGFXStartTime;
|
||||
sRDPTimeStart = sRSPGfxTimeStart;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -508,11 +508,11 @@ void Sched_HandleRSPDone(Scheduler* sc) {
|
|||
|
||||
// Task profiling
|
||||
if (sc->curRSPTask->list.t.type == M_AUDTASK) {
|
||||
gRSPAudioTotalTime += osGetTime() - sRSPAudioStartTime;
|
||||
gRSPAudioTimeAcc += osGetTime() - sRSPAudioTimeStart;
|
||||
} else if (sc->curRSPTask->list.t.type == M_GFXTASK) {
|
||||
gRSPGFXTotalTime += osGetTime() - sRSPGFXStartTime;
|
||||
gRSPGfxTimeAcc += osGetTime() - sRSPGfxTimeStart;
|
||||
} else {
|
||||
gRSPOtherTotalTime += osGetTime() - sRSPOtherStartTime;
|
||||
gRSPOtherTimeAcc += osGetTime() - sRSPOtherTimeStart;
|
||||
}
|
||||
|
||||
// Clear current RSP task
|
||||
|
@ -564,7 +564,7 @@ void Sched_HandleRDPDone(Scheduler* sc) {
|
|||
s32 state;
|
||||
|
||||
// Task profiling
|
||||
gRDPTotalTime = osGetTime() - sRDPStartTime;
|
||||
gRDPTimeAcc = osGetTime() - sRDPTimeStart;
|
||||
|
||||
// Sanity check
|
||||
ASSERT(sc->curRDPTask != NULL, "sc->curRDPTask", "../sched.c", 878);
|
||||
|
|
|
@ -1,25 +1,70 @@
|
|||
#include "global.h"
|
||||
#include "vt.h"
|
||||
|
||||
volatile OSTime D_8016A520;
|
||||
volatile OSTime D_8016A528;
|
||||
volatile OSTime D_8016A530;
|
||||
volatile OSTime D_8016A538;
|
||||
volatile OSTime D_8016A540;
|
||||
volatile OSTime D_8016A548;
|
||||
volatile OSTime D_8016A550;
|
||||
volatile OSTime D_8016A558;
|
||||
volatile OSTime gRSPAudioTotalTime;
|
||||
volatile OSTime gRSPGFXTotalTime;
|
||||
volatile OSTime gRSPOtherTotalTime;
|
||||
/**
|
||||
* How much time the audio update on the audio thread (`func_800E4FE0`) took in total, between scheduling the last two
|
||||
* graphics tasks.
|
||||
*/
|
||||
volatile OSTime gAudioThreadUpdateTimeTotalPerGfxTask;
|
||||
|
||||
/**
|
||||
* How much time elapsed between scheduling the previous graphics task and the current one being ready (the previous
|
||||
* task not necessarily being finished yet), without the amount of time spent on the audio update in the audio thread.
|
||||
*/
|
||||
volatile OSTime gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime;
|
||||
|
||||
/**
|
||||
* How much time the RSP ran audio tasks for over the course of `gGraphUpdatePeriod`.
|
||||
*/
|
||||
volatile OSTime gRSPAudioTimeTotal;
|
||||
|
||||
/**
|
||||
* How much time the RSP ran graphics tasks for over the course of `gGraphUpdatePeriod`.
|
||||
* Typically the RSP runs 1 graphics task per `Graph_Update` cycle, but may run 0 (see `Graph_Update`).
|
||||
*/
|
||||
volatile OSTime gRSPGfxTimeTotal;
|
||||
|
||||
/**
|
||||
* How much time the RDP ran for over the course of `gGraphUpdatePeriod`.
|
||||
*/
|
||||
volatile OSTime gRDPTimeTotal;
|
||||
|
||||
/**
|
||||
* How much time elapsed between the last two `Graph_Update` ending.
|
||||
* This is expected to be at least the duration of a single frame, since it includes the time spent waiting on the
|
||||
* graphics task to be done.
|
||||
*/
|
||||
volatile OSTime gGraphUpdatePeriod;
|
||||
|
||||
/**
|
||||
* The time at which the audio thread audio update started.
|
||||
*/
|
||||
volatile OSTime gAudioThreadUpdateTimeStart;
|
||||
|
||||
// Accumulator for `gAudioThreadUpdateTimeStart`
|
||||
volatile OSTime gAudioThreadUpdateTimeAcc;
|
||||
|
||||
// Accumulator for `gRSPAudioTimeTotal`
|
||||
volatile OSTime gRSPAudioTimeAcc;
|
||||
|
||||
// Accumulator for `gRSPGfxTimeTotal`.
|
||||
volatile OSTime gRSPGfxTimeAcc;
|
||||
|
||||
volatile OSTime gRSPOtherTimeAcc;
|
||||
volatile OSTime D_8016A578;
|
||||
volatile OSTime gRDPTotalTime;
|
||||
|
||||
// Accumulator for `gRDPTimeTotal`
|
||||
volatile OSTime gRDPTimeAcc;
|
||||
|
||||
SpeedMeterTimeEntry* sSpeedMeterTimeEntryPtr;
|
||||
|
||||
SpeedMeterTimeEntry sSpeedMeterTimeEntryArray[] = {
|
||||
{ &D_8016A520, 0, 0, GPACK_RGBA5551(255, 0, 0, 1) }, { &D_8016A528, 0, 2, GPACK_RGBA5551(255, 255, 0, 1) },
|
||||
{ &D_8016A530, 0, 4, GPACK_RGBA5551(0, 0, 255, 1) }, { &D_8016A538, 0, 6, GPACK_RGBA5551(255, 128, 128, 1) },
|
||||
{ &D_8016A540, 0, 8, GPACK_RGBA5551(0, 255, 0, 1) }, { &D_8016A548, 0, 10, GPACK_RGBA5551(255, 0, 255, 1) },
|
||||
{ &gAudioThreadUpdateTimeTotalPerGfxTask, 0, 0, GPACK_RGBA5551(255, 0, 0, 1) },
|
||||
{ &gGfxTaskSentToNextReadyMinusAudioThreadUpdateTime, 0, 2, GPACK_RGBA5551(255, 255, 0, 1) },
|
||||
{ &gRSPAudioTimeTotal, 0, 4, GPACK_RGBA5551(0, 0, 255, 1) },
|
||||
{ &gRSPGfxTimeTotal, 0, 6, GPACK_RGBA5551(255, 128, 128, 1) },
|
||||
{ &gRDPTimeTotal, 0, 8, GPACK_RGBA5551(0, 255, 0, 1) },
|
||||
{ &gGraphUpdatePeriod, 0, 10, GPACK_RGBA5551(255, 0, 255, 1) },
|
||||
};
|
||||
|
||||
#define gDrawRect(gfx, color, ulx, uly, lrx, lry) \
|
||||
|
@ -44,7 +89,7 @@ void SpeedMeter_Destroy(SpeedMeter* this) {
|
|||
void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) {
|
||||
s32 pad[2];
|
||||
u32 baseX = 32;
|
||||
s32 temp;
|
||||
s32 width;
|
||||
s32 i;
|
||||
s32 uly;
|
||||
s32 lry;
|
||||
|
@ -64,8 +109,8 @@ void SpeedMeter_DrawTimeEntries(SpeedMeter* this, GraphicsContext* gfxCtx) {
|
|||
|
||||
sSpeedMeterTimeEntryPtr = &sSpeedMeterTimeEntryArray[0];
|
||||
for (i = 0; i < ARRAY_COUNT(sSpeedMeterTimeEntryArray); i++) {
|
||||
temp = ((f64)*sSpeedMeterTimeEntryPtr->time / gIrqMgrRetraceTime) * 64.0;
|
||||
sSpeedMeterTimeEntryPtr->x = temp + baseX;
|
||||
width = ((f64)*sSpeedMeterTimeEntryPtr->time / gIrqMgrRetraceTime) * 64.0;
|
||||
sSpeedMeterTimeEntryPtr->x = baseX + width;
|
||||
sSpeedMeterTimeEntryPtr++;
|
||||
}
|
||||
|
||||
|
@ -151,11 +196,11 @@ void SpeedMeter_DrawAllocEntry(SpeedMeterAllocEntry* this, GraphicsContext* gfxC
|
|||
}
|
||||
|
||||
void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, GameState* state) {
|
||||
s32 pad[2];
|
||||
s32 pad1[2];
|
||||
u32 ulx = 30;
|
||||
u32 lrx = 290;
|
||||
SpeedMeterAllocEntry entry;
|
||||
u32 temp;
|
||||
u32 pad2;
|
||||
s32 y;
|
||||
TwoHeadGfxArena* thga;
|
||||
u32 zeldaFreeMax;
|
||||
|
@ -166,7 +211,7 @@ void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, Gam
|
|||
s32 sysAlloc;
|
||||
|
||||
y = 212;
|
||||
if (SREG(0) > 2) {
|
||||
if (R_ENABLE_ARENA_DBG > 2) {
|
||||
if (ZeldaArena_IsInitialized()) {
|
||||
ZeldaArena_GetSizes(&zeldaFreeMax, &zeldaFree, &zeldaAlloc);
|
||||
SpeedMeter_InitAllocEntry(&entry, zeldaFree + zeldaAlloc, zeldaAlloc, GPACK_RGBA5551(0, 0, 255, 1),
|
||||
|
@ -177,7 +222,7 @@ void SpeedMeter_DrawAllocEntries(SpeedMeter* meter, GraphicsContext* gfxCtx, Gam
|
|||
}
|
||||
}
|
||||
|
||||
if (SREG(0) > 1) {
|
||||
if (R_ENABLE_ARENA_DBG > 1) {
|
||||
SystemArena_GetSizes((u32*)&sysFreeMax, (u32*)&sysFree, (u32*)&sysAlloc);
|
||||
SpeedMeter_InitAllocEntry(&entry, sysFree + sysAlloc - state->tha.size, sysAlloc - state->tha.size,
|
||||
GPACK_RGBA5551(0, 0, 255, 1), GPACK_RGBA5551(255, 128, 128, 1), ulx, lrx, y, y);
|
||||
|
|
|
@ -931,20 +931,24 @@ f32 Actor_WorldDistXZToPoint(Actor* actor, Vec3f* refPoint) {
|
|||
return Math_Vec3f_DistXZ(&actor->world.pos, refPoint);
|
||||
}
|
||||
|
||||
void func_8002DBD0(Actor* actor, Vec3f* result, Vec3f* arg2) {
|
||||
f32 cosRot2Y;
|
||||
f32 sinRot2Y;
|
||||
/**
|
||||
* Convert `pos` to be relative to the actor's position and yaw, store into `dest`.
|
||||
* Actor_WorldToActorCoords
|
||||
*/
|
||||
void func_8002DBD0(Actor* actor, Vec3f* dest, Vec3f* pos) {
|
||||
f32 cosY;
|
||||
f32 sinY;
|
||||
f32 deltaX;
|
||||
f32 deltaZ;
|
||||
|
||||
cosRot2Y = Math_CosS(actor->shape.rot.y);
|
||||
sinRot2Y = Math_SinS(actor->shape.rot.y);
|
||||
deltaX = arg2->x - actor->world.pos.x;
|
||||
deltaZ = arg2->z - actor->world.pos.z;
|
||||
cosY = Math_CosS(actor->shape.rot.y);
|
||||
sinY = Math_SinS(actor->shape.rot.y);
|
||||
deltaX = pos->x - actor->world.pos.x;
|
||||
deltaZ = pos->z - actor->world.pos.z;
|
||||
|
||||
result->x = (deltaX * cosRot2Y) - (deltaZ * sinRot2Y);
|
||||
result->z = (deltaX * sinRot2Y) + (deltaZ * cosRot2Y);
|
||||
result->y = arg2->y - actor->world.pos.y;
|
||||
dest->x = (deltaX * cosY) - (deltaZ * sinY);
|
||||
dest->z = (deltaX * sinY) + (deltaZ * cosY);
|
||||
dest->y = pos->y - actor->world.pos.y;
|
||||
}
|
||||
|
||||
f32 Actor_HeightDiff(Actor* actorA, Actor* actorB) {
|
||||
|
|
|
@ -63,8 +63,8 @@ s32 D_80119D90[WALL_TYPE_MAX] = {
|
|||
WALL_FLAG_0 | WALL_FLAG_1, // WALL_TYPE_2
|
||||
WALL_FLAG_0 | WALL_FLAG_2, // WALL_TYPE_3
|
||||
WALL_FLAG_3, // WALL_TYPE_4
|
||||
WALL_FLAG_4, // WALL_TYPE_5
|
||||
WALL_FLAG_5, // WALL_TYPE_6
|
||||
WALL_FLAG_CRAWLSPACE_1, // WALL_TYPE_5
|
||||
WALL_FLAG_CRAWLSPACE_2, // WALL_TYPE_6
|
||||
WALL_FLAG_6, // WALL_TYPE_7
|
||||
};
|
||||
|
||||
|
|
|
@ -4372,21 +4372,25 @@ s32 Camera_Subj4(Camera* camera) {
|
|||
Vec3f* at = &camera->at;
|
||||
u16 crawlspaceNumPoints;
|
||||
Vec3s* crawlspacePoints;
|
||||
Vec3f sp98;
|
||||
Vec3f sp8C;
|
||||
f32 sp88;
|
||||
s16 pad2;
|
||||
f32 temp_f16;
|
||||
PosRot sp6C;
|
||||
VecGeo sp64;
|
||||
VecGeo sp5C;
|
||||
s16 temp_a0;
|
||||
f32 tx;
|
||||
Vec3f temp1;
|
||||
Vec3f zoomAtTarget;
|
||||
f32 temp2;
|
||||
Player* player;
|
||||
PosRot* playerPosRot = &camera->playerPosRot;
|
||||
f32 eyeLerp;
|
||||
PosRot playerPosRot;
|
||||
VecGeo targetOffset;
|
||||
VecGeo atEyeOffset;
|
||||
s16 eyeToAtYaw;
|
||||
s32 pad[2];
|
||||
f32 temp;
|
||||
Subj4ReadOnlyData* roData = &camera->paramData.subj4.roData;
|
||||
Subj4ReadWriteData* rwData = &camera->paramData.subj4.rwData;
|
||||
|
||||
#define vCrawlSpaceBackPos temp1
|
||||
#define vEyeTarget temp1
|
||||
#define vPlayerDistToFront temp2
|
||||
#define vZoomTimer temp2
|
||||
|
||||
if (RELOAD_PARAMS(camera) || R_RELOAD_CAM_PARAMS) {
|
||||
CameraModeValue* values = sCameraSettings[camera->setting].cameraModes[camera->mode].values;
|
||||
|
||||
|
@ -4398,99 +4402,126 @@ s32 Camera_Subj4(Camera* camera) {
|
|||
}
|
||||
|
||||
if (camera->play->view.unk_124 == 0) {
|
||||
camera->play->view.unk_124 = (camera->camId | 0x50);
|
||||
rwData->unk_24 = camera->xzSpeed;
|
||||
camera->play->view.unk_124 = camera->camId | 0x50;
|
||||
rwData->xzSpeed = camera->xzSpeed;
|
||||
return true;
|
||||
}
|
||||
|
||||
Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor);
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
|
||||
OLib_Vec3fDiffToVecGeo(&atEyeOffset, at, eye);
|
||||
|
||||
OLib_Vec3fDiffToVecGeo(&sp5C, at, eye);
|
||||
sCameraInterfaceFlags = roData->interfaceFlags;
|
||||
|
||||
// Crawlspace setup (runs for only 1 frame)
|
||||
if (camera->animState == 0) {
|
||||
crawlspacePoints = (Vec3s*)Camera_GetBgCamFuncDataUnderPlayer(camera, &crawlspaceNumPoints);
|
||||
Camera_Vec3sToVec3f(&rwData->unk_00.point, &crawlspacePoints[1]);
|
||||
Camera_Vec3sToVec3f(&sp98, &crawlspacePoints[crawlspaceNumPoints - 2]);
|
||||
// Second entry of crawlspacePoints contains the front position
|
||||
Camera_Vec3sToVec3f(&rwData->crawlspaceLine.point, &crawlspacePoints[1]);
|
||||
// Second last entry of crawlspacePoints contains the back position
|
||||
Camera_Vec3sToVec3f(&vCrawlSpaceBackPos, &crawlspacePoints[crawlspaceNumPoints - 2]);
|
||||
|
||||
sp64.r = 10.0f;
|
||||
// 0x238C ~ 50 degrees
|
||||
sp64.pitch = 0x238C;
|
||||
sp64.yaw = Camera_XZAngle(&sp98, &rwData->unk_00.point);
|
||||
sp88 = OLib_Vec3fDist(&playerPosRot->pos, &rwData->unk_00.point);
|
||||
if (OLib_Vec3fDist(&playerPosRot->pos, &sp98) < sp88) {
|
||||
rwData->unk_00.dir.x = rwData->unk_00.point.x - sp98.x;
|
||||
rwData->unk_00.dir.y = rwData->unk_00.point.y - sp98.y;
|
||||
rwData->unk_00.dir.z = rwData->unk_00.point.z - sp98.z;
|
||||
rwData->unk_00.point = sp98;
|
||||
targetOffset.r = 10.0f;
|
||||
targetOffset.pitch = 0x238C; // ~50 degrees
|
||||
targetOffset.yaw = Camera_XZAngle(&vCrawlSpaceBackPos, &rwData->crawlspaceLine.point);
|
||||
|
||||
vPlayerDistToFront = OLib_Vec3fDist(&camera->playerPosRot.pos, &rwData->crawlspaceLine.point);
|
||||
if (OLib_Vec3fDist(&camera->playerPosRot.pos, &vCrawlSpaceBackPos) < vPlayerDistToFront) {
|
||||
// Player is entering the crawlspace from the back
|
||||
rwData->crawlspaceLine.dir.x = rwData->crawlspaceLine.point.x - vCrawlSpaceBackPos.x;
|
||||
rwData->crawlspaceLine.dir.y = rwData->crawlspaceLine.point.y - vCrawlSpaceBackPos.y;
|
||||
rwData->crawlspaceLine.dir.z = rwData->crawlspaceLine.point.z - vCrawlSpaceBackPos.z;
|
||||
rwData->crawlspaceLine.point = vCrawlSpaceBackPos;
|
||||
} else {
|
||||
rwData->unk_00.dir.x = sp98.x - rwData->unk_00.point.x;
|
||||
rwData->unk_00.dir.y = sp98.y - rwData->unk_00.point.y;
|
||||
rwData->unk_00.dir.z = sp98.z - rwData->unk_00.point.z;
|
||||
sp64.yaw = sp64.yaw - 0x7FFF;
|
||||
// Player is entering the crawlspace from the front
|
||||
rwData->crawlspaceLine.dir.x = vCrawlSpaceBackPos.x - rwData->crawlspaceLine.point.x;
|
||||
rwData->crawlspaceLine.dir.y = vCrawlSpaceBackPos.y - rwData->crawlspaceLine.point.y;
|
||||
rwData->crawlspaceLine.dir.z = vCrawlSpaceBackPos.z - rwData->crawlspaceLine.point.z;
|
||||
targetOffset.yaw -= 0x7FFF;
|
||||
}
|
||||
rwData->unk_30 = sp64.yaw;
|
||||
rwData->unk_32 = 0xA;
|
||||
rwData->unk_2C = 0;
|
||||
rwData->unk_2E = false;
|
||||
rwData->unk_28 = 0.0f;
|
||||
|
||||
rwData->forwardYaw = targetOffset.yaw;
|
||||
rwData->zoomTimer = 10;
|
||||
rwData->eyeLerpPhase = 0;
|
||||
rwData->isSfxOff = false;
|
||||
rwData->eyeLerp = 0.0f;
|
||||
camera->animState++;
|
||||
}
|
||||
|
||||
if (rwData->unk_32 != 0) {
|
||||
sp64.r = 10.0f;
|
||||
sp64.pitch = 0x238C;
|
||||
sp64.yaw = rwData->unk_30;
|
||||
Camera_AddVecGeoToVec3f(&sp8C, &sp6C.pos, &sp64);
|
||||
sp88 = (rwData->unk_32 + 1.0f);
|
||||
at->x += (sp8C.x - at->x) / sp88;
|
||||
at->y += (sp8C.y - at->y) / sp88;
|
||||
at->z += (sp8C.z - at->z) / sp88;
|
||||
sp5C.r -= (sp5C.r / sp88);
|
||||
sp5C.yaw = BINANG_LERPIMPINV(sp5C.yaw, (s16)(sp6C.rot.y - 0x7FFF), rwData->unk_32);
|
||||
sp5C.pitch = BINANG_LERPIMPINV(sp5C.pitch, sp6C.rot.x, rwData->unk_32);
|
||||
Camera_AddVecGeoToVec3f(eyeNext, at, &sp5C);
|
||||
// Camera zooms in from third person to first person over 10 frames
|
||||
if (rwData->zoomTimer != 0) {
|
||||
targetOffset.r = 10.0f;
|
||||
targetOffset.pitch = 0x238C; // ~50 degrees
|
||||
targetOffset.yaw = rwData->forwardYaw;
|
||||
Camera_AddVecGeoToVec3f(&zoomAtTarget, &playerPosRot.pos, &targetOffset);
|
||||
|
||||
vZoomTimer = rwData->zoomTimer + 1.0f;
|
||||
at->x = F32_LERPIMPINV(at->x, zoomAtTarget.x, vZoomTimer);
|
||||
at->y = F32_LERPIMPINV(at->y, zoomAtTarget.y, vZoomTimer);
|
||||
at->z = F32_LERPIMPINV(at->z, zoomAtTarget.z, vZoomTimer);
|
||||
|
||||
atEyeOffset.r -= (atEyeOffset.r / vZoomTimer);
|
||||
atEyeOffset.yaw = BINANG_LERPIMPINV(atEyeOffset.yaw, (s16)(playerPosRot.rot.y - 0x7FFF), rwData->zoomTimer);
|
||||
atEyeOffset.pitch = BINANG_LERPIMPINV(atEyeOffset.pitch, playerPosRot.rot.x, rwData->zoomTimer);
|
||||
Camera_AddVecGeoToVec3f(eyeNext, at, &atEyeOffset);
|
||||
*eye = *eyeNext;
|
||||
rwData->unk_32--;
|
||||
return false;
|
||||
} else if (rwData->unk_24 < 0.5f) {
|
||||
rwData->zoomTimer--;
|
||||
return false;
|
||||
}
|
||||
|
||||
Actor_GetWorldPosShapeRot(&sp6C, &camera->player->actor);
|
||||
Math3D_LineClosestToPoint(&rwData->unk_00, &sp6C.pos, eyeNext);
|
||||
at->x = eyeNext->x + rwData->unk_00.dir.x;
|
||||
at->y = eyeNext->y + rwData->unk_00.dir.y;
|
||||
at->z = eyeNext->z + rwData->unk_00.dir.z;
|
||||
if (rwData->xzSpeed < 0.5f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Actor_GetWorldPosShapeRot(&playerPosRot, &camera->player->actor);
|
||||
Math3D_LineClosestToPoint(&rwData->crawlspaceLine, &playerPosRot.pos, eyeNext);
|
||||
|
||||
// *at is unused before getting overwritten later this function
|
||||
at->x = eyeNext->x + rwData->crawlspaceLine.dir.x;
|
||||
at->y = eyeNext->y + rwData->crawlspaceLine.dir.y;
|
||||
at->z = eyeNext->z + rwData->crawlspaceLine.dir.z;
|
||||
|
||||
*eye = *eyeNext;
|
||||
sp64.yaw = rwData->unk_30;
|
||||
sp64.r = 5.0f;
|
||||
sp64.pitch = 0x238C;
|
||||
Camera_AddVecGeoToVec3f(&sp98, eyeNext, &sp64);
|
||||
rwData->unk_2C += 0xBB8;
|
||||
temp_f16 = Math_CosS(rwData->unk_2C);
|
||||
eye->x += (sp98.x - eye->x) * fabsf(temp_f16);
|
||||
eye->y += (sp98.y - eye->y) * fabsf(temp_f16);
|
||||
eye->z += (sp98.z - eye->z) * fabsf(temp_f16);
|
||||
|
||||
if ((rwData->unk_28 < temp_f16) && !rwData->unk_2E) {
|
||||
targetOffset.yaw = rwData->forwardYaw;
|
||||
targetOffset.r = 5.0f;
|
||||
targetOffset.pitch = 0x238C; // ~50 degrees
|
||||
|
||||
Camera_AddVecGeoToVec3f(&vEyeTarget, eyeNext, &targetOffset);
|
||||
|
||||
rwData->eyeLerpPhase += 0xBB8;
|
||||
eyeLerp = Math_CosS(rwData->eyeLerpPhase);
|
||||
|
||||
// VEC3F_LERPIMPDST(eye, eye, &vEyeTarget, fabsf(eyeLerp))
|
||||
eye->x += (vEyeTarget.x - eye->x) * fabsf(eyeLerp);
|
||||
eye->y += (vEyeTarget.y - eye->y) * fabsf(eyeLerp);
|
||||
eye->z += (vEyeTarget.z - eye->z) * fabsf(eyeLerp);
|
||||
|
||||
// When camera reaches the peak of offset and starts to move down
|
||||
// && alternating cycles (sfx plays only every 2nd cycle)
|
||||
if ((eyeLerp > rwData->eyeLerp) && !rwData->isSfxOff) {
|
||||
player = camera->player;
|
||||
rwData->unk_2E = true;
|
||||
func_800F4010(&player->actor.projectedPos, player->unk_89E + 0x8B0, 4.0f);
|
||||
} else if (rwData->unk_28 > temp_f16) {
|
||||
rwData->unk_2E = false;
|
||||
rwData->isSfxOff = true;
|
||||
func_800F4010(&player->actor.projectedPos, NA_SE_PL_CRAWL + player->unk_89E, 4.0f);
|
||||
} else if (eyeLerp < rwData->eyeLerp) {
|
||||
rwData->isSfxOff = false;
|
||||
}
|
||||
|
||||
rwData->unk_28 = temp_f16;
|
||||
rwData->eyeLerp = eyeLerp;
|
||||
|
||||
camera->player->actor.world.pos = *eyeNext;
|
||||
camera->player->actor.world.pos.y = camera->playerGroundY;
|
||||
camera->player->actor.shape.rot.y = sp64.yaw;
|
||||
temp_f16 = ((240.0f * temp_f16) * (rwData->unk_24 * 0.416667f));
|
||||
temp_a0 = temp_f16 + rwData->unk_30;
|
||||
at->x = eye->x + (Math_SinS(temp_a0) * 10.0f);
|
||||
camera->player->actor.shape.rot.y = targetOffset.yaw;
|
||||
|
||||
eyeLerp = (240.0f * eyeLerp) * (rwData->xzSpeed * 0.416667f);
|
||||
eyeToAtYaw = rwData->forwardYaw + eyeLerp;
|
||||
|
||||
at->x = eye->x + (Math_SinS(eyeToAtYaw) * 10.0f);
|
||||
at->y = eye->y;
|
||||
at->z = eye->z + (Math_CosS(temp_a0) * 10.0f);
|
||||
at->z = eye->z + (Math_CosS(eyeToAtYaw) * 10.0f);
|
||||
|
||||
camera->roll = Camera_LERPCeilS(0, camera->roll, 0.5f, 0xA);
|
||||
return 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
s32 Camera_Subj0(Camera* camera) {
|
||||
|
|
|
@ -21,7 +21,7 @@ void EnAObj_SetupBlockRot(EnAObj* this, s16 type);
|
|||
void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type);
|
||||
void EnAObj_SetupBlock(EnAObj* this, s16 type);
|
||||
|
||||
const ActorInit En_A_Obj_InitVars = {
|
||||
ActorInit En_A_Obj_InitVars = {
|
||||
ACTOR_EN_A_OBJ,
|
||||
ACTORCAT_PROP,
|
||||
FLAGS,
|
||||
|
|
|
@ -20,7 +20,7 @@ void EnItem00_DrawCollectible(EnItem00* this, PlayState* play);
|
|||
void EnItem00_DrawHeartContainer(EnItem00* this, PlayState* play);
|
||||
void EnItem00_DrawHeartPiece(EnItem00* this, PlayState* play);
|
||||
|
||||
const ActorInit En_Item00_InitVars = {
|
||||
ActorInit En_Item00_InitVars = {
|
||||
ACTOR_EN_ITEM00,
|
||||
ACTORCAT_MISC,
|
||||
FLAGS,
|
||||
|
|
|
@ -949,7 +949,7 @@ void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContex
|
|||
gSaveContext.nightFlag = 0;
|
||||
}
|
||||
|
||||
if (SREG(0) != 0 || CREG(2) != 0) {
|
||||
if (R_ENABLE_ARENA_DBG != 0 || CREG(2) != 0) {
|
||||
Gfx* displayList;
|
||||
Gfx* prevDisplayList;
|
||||
|
||||
|
|
|
@ -331,14 +331,18 @@ s32 OnePointCutscene_SetInfo(PlayState* play, s16 subCamId, s16 csId, Actor* act
|
|||
Play_SetCameraRoll(play, subCamId, childCam->roll);
|
||||
break;
|
||||
case 9601:
|
||||
// Leaving a crawlspace forwards
|
||||
Play_CameraChangeSetting(play, subCamId, CAM_SET_CS_3);
|
||||
Play_CameraChangeSetting(play, CAM_ID_MAIN, mainCam->prevSetting);
|
||||
OnePointCutscene_SetCsCamPoints(subCam, D_80120430 | 0x1000, D_8012042C, D_80120308, D_80120398);
|
||||
OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer,
|
||||
sCrawlspaceAtPoints, sCrawlspaceForwardsEyePoints);
|
||||
break;
|
||||
case 9602:
|
||||
// Leaving a crawlspace backwards
|
||||
Play_CameraChangeSetting(play, subCamId, CAM_SET_CS_3);
|
||||
Play_CameraChangeSetting(play, CAM_ID_MAIN, mainCam->prevSetting);
|
||||
OnePointCutscene_SetCsCamPoints(subCam, D_80120430 | 0x1000, D_8012042C, D_80120308, D_80120434);
|
||||
OnePointCutscene_SetCsCamPoints(subCam, sCrawlspaceActionParam | 0x1000, sCrawlspaceTimer,
|
||||
sCrawlspaceAtPoints, sCrawlspaceBackwardsEyePoints);
|
||||
break;
|
||||
case 4175:
|
||||
csInfo->keyFrames = D_8012147C;
|
||||
|
|
|
@ -29,24 +29,24 @@ static s16 D_801202FC = 13;
|
|||
static s16 D_80120300 = 210;
|
||||
static s16 D_80120304 = 0;
|
||||
|
||||
static CutsceneCameraPoint D_80120308[9] = {
|
||||
static CutsceneCameraPoint sCrawlspaceAtPoints[9] = {
|
||||
{ CS_CMD_CONTINUE, 0, 10, 40.0f, { 0, 4, 0 } }, { CS_CMD_CONTINUE, 0, 10, 40.000004f, { 0, 4, 0 } },
|
||||
{ CS_CMD_CONTINUE, 0, 10, 50.0f, { 0, 9, 0 } }, { CS_CMD_CONTINUE, 0, 12, 55.0f, { 0, 12, 0 } },
|
||||
{ CS_CMD_CONTINUE, 0, 15, 61.0f, { 0, 18, 0 } }, { CS_CMD_CONTINUE, 0, 20, 65.0f, { 0, 29, 0 } },
|
||||
{ CS_CMD_CONTINUE, 0, 40, 60.0f, { 0, 34, 0 } }, { CS_CMD_STOP, 0, 40, 60.0f, { 0, 34, 0 } },
|
||||
{ CS_CMD_STOP, 0, 10, 60.0f, { 0, 34, 0 } },
|
||||
};
|
||||
static CutsceneCameraPoint D_80120398[9] = {
|
||||
static CutsceneCameraPoint sCrawlspaceForwardsEyePoints[9] = {
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 9, 45 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 8, 50 } },
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 17, 58 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 21, 78 } },
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 46, 109 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 58, 118 } },
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 63, 119 } }, { CS_CMD_STOP, 0, 0, 60.0f, { 0, 62, 119 } },
|
||||
{ CS_CMD_STOP, 0, 0, 60.0f, { 0, 62, 119 } },
|
||||
};
|
||||
static s16 D_80120428 = 9;
|
||||
static s16 D_8012042C = 90;
|
||||
static s16 D_80120430 = 1;
|
||||
static CutsceneCameraPoint D_80120434[10] = {
|
||||
static s16 sCrawlspaceUnused = 9;
|
||||
static s16 sCrawlspaceTimer = 90;
|
||||
static s16 sCrawlspaceActionParam = 1;
|
||||
static CutsceneCameraPoint sCrawlspaceBackwardsEyePoints[10] = {
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 9, -45 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 9, -45 } },
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 8, -50 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 17, -58 } },
|
||||
{ CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 21, -78 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { 0, 46, -109 } },
|
||||
|
|
|
@ -754,7 +754,7 @@ void func_80083108(PlayState* play) {
|
|||
}
|
||||
|
||||
Interface_ChangeAlpha(50);
|
||||
} else if ((player->stateFlags1 & PLAYER_STATE1_21) || (player->stateFlags2 & PLAYER_STATE2_18)) {
|
||||
} else if ((player->stateFlags1 & PLAYER_STATE1_21) || (player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
|
||||
if (gSaveContext.buttonStatus[0] != BTN_DISABLED) {
|
||||
gSaveContext.buttonStatus[0] = BTN_DISABLED;
|
||||
gSaveContext.buttonStatus[1] = BTN_DISABLED;
|
||||
|
@ -2800,7 +2800,7 @@ void Interface_DrawItemButtons(PlayState* play) {
|
|||
if ((gSaveContext.unk_13EA == 1) || (gSaveContext.unk_13EA == 2) || (gSaveContext.unk_13EA == 5)) {
|
||||
temp = 0;
|
||||
} else if ((player->stateFlags1 & PLAYER_STATE1_21) || (func_8008F2F8(play) == 4) ||
|
||||
(player->stateFlags2 & PLAYER_STATE2_18)) {
|
||||
(player->stateFlags2 & PLAYER_STATE2_CRAWLING)) {
|
||||
temp = 70;
|
||||
} else {
|
||||
temp = interfaceCtx->healthAlpha;
|
||||
|
|
|
@ -17,7 +17,7 @@ void Player_Destroy(Actor* thisx, PlayState* play);
|
|||
void Player_Update(Actor* thisx, PlayState* play);
|
||||
void Player_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
const ActorInit Player_InitVars = {
|
||||
ActorInit Player_InitVars = {
|
||||
ACTOR_PLAYER,
|
||||
ACTORCAT_PLAYER,
|
||||
FLAGS,
|
||||
|
|
|
@ -899,7 +899,7 @@ void Player_DrawImpl(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dL
|
|||
SkelAnime_DrawFlexLod(play, skeleton, jointTable, dListCount, overrideLimbDraw, postLimbDraw, data, lod);
|
||||
|
||||
if ((overrideLimbDraw != Player_OverrideLimbDrawGameplayFirstPerson) &&
|
||||
(overrideLimbDraw != Player_OverrideLimbDrawGameplay_80090440) &&
|
||||
(overrideLimbDraw != Player_OverrideLimbDrawGameplayCrawling) &&
|
||||
(gSaveContext.gameMode != GAMEMODE_END_CREDITS)) {
|
||||
if (LINK_IS_ADULT) {
|
||||
s32 strengthUpgrade = CUR_UPG_VALUE(UPG_STRENGTH);
|
||||
|
@ -1198,8 +1198,8 @@ s32 Player_OverrideLimbDrawGameplayFirstPerson(PlayState* play, s32 limbIndex, G
|
|||
return false;
|
||||
}
|
||||
|
||||
s32 Player_OverrideLimbDrawGameplay_80090440(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
s32 Player_OverrideLimbDrawGameplayCrawling(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
void* thisx) {
|
||||
if (!Player_OverrideLimbDrawGameplayCommon(play, limbIndex, dList, pos, rot, thisx)) {
|
||||
*dList = NULL;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ void PreNMI_Main(GameState* thisx) {
|
|||
PreNMI_Update(this);
|
||||
PreNMI_Draw(this);
|
||||
|
||||
this->state.unk_A0 = 1;
|
||||
this->state.inPreNMIState = true;
|
||||
}
|
||||
|
||||
void PreNMI_Destroy(GameState* thisx) {
|
||||
|
|
|
@ -500,33 +500,4 @@ void (*gSceneCmdHandlers[SCENE_CMD_ID_MAX])(PlayState*, SceneCmd*) = {
|
|||
RomFile sNaviQuestHintFiles[] = {
|
||||
ROM_FILE(elf_message_field),
|
||||
ROM_FILE(elf_message_ydan),
|
||||
ROM_FILE_UNSET,
|
||||
};
|
||||
|
||||
s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };
|
||||
|
||||
u32 gObjectTableSize = ARRAY_COUNT(gObjectTable);
|
||||
|
||||
// Object linker symbol declarations (used in the table below)
|
||||
#define DEFINE_OBJECT(name, _1) DECLARE_ROM_SEGMENT(name)
|
||||
#define DEFINE_OBJECT_NULL(_0, _1)
|
||||
#define DEFINE_OBJECT_UNSET(_0)
|
||||
|
||||
#include "tables/object_table.h"
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_UNSET
|
||||
|
||||
// Object Table definition
|
||||
#define DEFINE_OBJECT(name, _1) ROM_FILE(name),
|
||||
#define DEFINE_OBJECT_NULL(name, _1) ROM_FILE_EMPTY(name),
|
||||
#define DEFINE_OBJECT_UNSET(_0) { 0 },
|
||||
|
||||
RomFile gObjectTable[] = {
|
||||
#include "tables/object_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_OBJECT
|
||||
#undef DEFINE_OBJECT_NULL
|
||||
#undef DEFINE_OBJECT_UNSET
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue