mirror of
https://github.com/zeldaret/oot
synced 2026-08-26 16:07:00 -04:00
Decompile z_play.c and Match/Document some of z_view.c (#74)
* Decompile z_play.c and Match/Document some of z_view.c Also fix the last non matching in z_sample.c and update some game state functions. * Suggestions from PR #74 * Fix undefined reference to Gameplay_DrawOverlay * Suggestion from PR #74 (2) * Fix a fake argument in func_800BC450
This commit is contained in:
@@ -93,8 +93,8 @@ u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment) {
|
||||
}
|
||||
|
||||
if (equipment == EQUIP_SWORD) {
|
||||
gSaveContext.equips.button_items[0] = ITEM_NONE;
|
||||
gSaveContext.inf_table[29] = 1;
|
||||
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
|
||||
gSaveContext.infTable[29] = 1;
|
||||
}
|
||||
|
||||
func_8008ECAC(globalCtx, player);
|
||||
|
||||
@@ -3,10 +3,7 @@
|
||||
typedef struct {
|
||||
/* 0x00 */ u32 type;
|
||||
/* 0x04 */ u32 setScissor;
|
||||
/* 0x08 */ union {
|
||||
Color_RGBA8 c;
|
||||
u32 rgba;
|
||||
} color;
|
||||
/* 0x08 */ Color_RGBA8 color;
|
||||
/* 0x0C */ u32 unk_0C;
|
||||
} struct_801664F0;
|
||||
|
||||
@@ -60,10 +57,10 @@ Gfx D_8012AC58[] = {
|
||||
void func_800ACE70(struct_801664F0* this) {
|
||||
this->type = 0;
|
||||
this->setScissor = false;
|
||||
this->color.c.r = 0xFF;
|
||||
this->color.c.g = 0xFF;
|
||||
this->color.c.b = 0xFF;
|
||||
this->color.c.a = 0xFF;
|
||||
this->color.r = 0xFF;
|
||||
this->color.g = 0xFF;
|
||||
this->color.b = 0xFF;
|
||||
this->color.a = 0xFF;
|
||||
}
|
||||
|
||||
// Destroy func
|
||||
|
||||
@@ -13,7 +13,7 @@ typedef struct InitFunc {
|
||||
// .data
|
||||
void* sInitFuncs = NULL;
|
||||
|
||||
char sNew[4] = { 'n', 'e', 'w' };
|
||||
char sNew[] = { 'n', 'e', 'w' };
|
||||
|
||||
char D_80134488[0x18] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00,
|
||||
|
||||
@@ -10,13 +10,13 @@ Arena sDebugArena;
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
// "%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&sDebugArena);
|
||||
return;
|
||||
}
|
||||
} else if (gDebugArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
// "%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -174,7 +174,7 @@ void GfxPrint_InitDlist(GfxPrint* this) {
|
||||
gDPSetTileSize(this->dlist++, i * 2, 0, 0, 60, 1020);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
|
||||
gDPSetTextureImage(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, sGfxPrintUnkData);
|
||||
gDPSetTile(this->dlist++, G_IM_FMT_CI, G_IM_SIZ_8b, 1, 0, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 3,
|
||||
@@ -204,7 +204,7 @@ void GfxPrint_SetColor(GfxPrint* this, u32 r, u32 g, u32 b, u32 a) {
|
||||
this->color.b = b;
|
||||
this->color.a = a;
|
||||
gDPPipeSync(this->dlist++);
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
}
|
||||
|
||||
void GfxPrint_SetPosPx(GfxPrint* this, s32 x, s32 y) {
|
||||
@@ -252,7 +252,7 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) {
|
||||
c * 2, (u16)(c & 4) * 64, (u16)(c >> 3) * 256, 1024, 1024);
|
||||
}
|
||||
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, *(u32*)&this->color);
|
||||
gDPSetPrimColorMod(this->dlist++, 0, 0, this->color.rgba);
|
||||
}
|
||||
|
||||
if (this->flag & GFXPRINT_FLAG64) {
|
||||
@@ -350,7 +350,7 @@ void GfxPrint_Ctor(GfxPrint* this) {
|
||||
this->posY = 0;
|
||||
this->baseX = 0;
|
||||
this->baseY = 0;
|
||||
*(u32*)&this->color = 0;
|
||||
this->color.rgba = 0;
|
||||
|
||||
this->flag &= ~GFXPRINT_FLAG1;
|
||||
this->flag &= ~GFXPRINT_USE_RGBA16;
|
||||
|
||||
+3
-4
@@ -119,7 +119,7 @@ GameStateOverlay* Graph_GetNextGameState() {
|
||||
if (gameStateInitFunc == Title_Init) {
|
||||
return &gGameStateOverlayTable[2];
|
||||
}
|
||||
if (gameStateInitFunc == func_800BCA64) {
|
||||
if (gameStateInitFunc == Gameplay_Init) {
|
||||
return &gGameStateOverlayTable[3];
|
||||
}
|
||||
if (gameStateInitFunc == Opening_Init) {
|
||||
@@ -389,7 +389,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
|
||||
|
||||
if (D_8012DBC0 && (!~(gameState->input[0].press.in.button | ~Z_TRIG)) &&
|
||||
(!~(gameState->input[0].cur.in.button | ~(L_TRIG | R_TRIG)))) {
|
||||
gSaveContext.game_mode = 0;
|
||||
gSaveContext.gameMode = 0;
|
||||
SET_NEXT_GAMESTATE(gameState, func_80801E44, char[0x240]); // TODO : SelectContext
|
||||
gameState->running = false;
|
||||
}
|
||||
@@ -438,8 +438,7 @@ void Graph_ThreadEntry(void* arg0) {
|
||||
}
|
||||
func_800C5080(gameState, ovl->init, &gfxCtx); // Game_Ct
|
||||
|
||||
while (func_800C547C(gameState)) // Game_IsGameStateRunning
|
||||
{
|
||||
while (func_800C547C(gameState)) { // Game_IsGameStateRunning
|
||||
Graph_Update(&gfxCtx, gameState);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
#include <vt.h>
|
||||
#include <sched.h>
|
||||
|
||||
u32 gScreenWidth = SCREEN_WIDTH;
|
||||
u32 gScreenHeight = SCREEN_HEIGHT;
|
||||
s32 gScreenWidth = SCREEN_WIDTH;
|
||||
s32 gScreenHeight = SCREEN_HEIGHT;
|
||||
u32 gSystemHeapSize = 0;
|
||||
|
||||
PreNmiBuff* gAppNmiBufferPtr;
|
||||
|
||||
@@ -898,8 +898,11 @@ MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (!(-32768.0f <= mf->mf[i][j]) || !(mf->mf[i][j] < 32768.0f)) {
|
||||
osSyncPrintf("%s %d: [%s] =\n/ %12.6f %12.6f %12.6f %12.6f \\\n| %12.6f %12.6f %12.6f %12.6f |\n| "
|
||||
"%12.6f %12.6f %12.6f %12.6f |\n\\ %12.6f %12.6f %12.6f %12.6f /\n",
|
||||
osSyncPrintf("%s %d: [%s] =\n"
|
||||
"/ %12.6f %12.6f %12.6f %12.6f \\\n"
|
||||
"| %12.6f %12.6f %12.6f %12.6f |\n"
|
||||
"| %12.6f %12.6f %12.6f %12.6f |\n"
|
||||
"\\ %12.6f %12.6f %12.6f %12.6f /\n",
|
||||
file, line, "mf", mf->xx, mf->yx, mf->zx, mf->wx, mf->xy, mf->yy, mf->zy, mf->wy, mf->xz,
|
||||
mf->yz, mf->zz, mf->wz, mf->xw, mf->yw, mf->zw, mf->ww);
|
||||
Fault_AddHungupAndCrash(file, line);
|
||||
|
||||
@@ -10,13 +10,13 @@ Arena gSystemArena;
|
||||
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
// "%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&gSystemArena);
|
||||
return;
|
||||
}
|
||||
} else if (gSystemArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
// "%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
+50
-48
@@ -699,10 +699,10 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx
|
||||
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4,
|
||||
s32 arg5, s32 arg6, s32 arg7) {
|
||||
Scene* loadedScene = globalCtx->loadedScene;
|
||||
u32 size = loadedScene->titleVromEnd - loadedScene->titleVromStart;
|
||||
u32 size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
|
||||
|
||||
if ((size != 0) && (size <= 0x3000)) {
|
||||
DmaMgr_SendRequest1(texture, loadedScene->titleVromStart, size, "../z_actor.c", 2765);
|
||||
DmaMgr_SendRequest1(texture, loadedScene->titleFile.vromStart, size, "../z_actor.c", 2765);
|
||||
}
|
||||
|
||||
titleCtx->texture = texture;
|
||||
@@ -1042,7 +1042,7 @@ void func_8002DE04(GlobalContext* globalCtx, Actor* actorA, Actor* actorB) {
|
||||
|
||||
void func_8002DE74(GlobalContext* globalCtx, Player* player) {
|
||||
if ((globalCtx->roomCtx.curRoom.unk_03 != 4) && func_800C0CB8(globalCtx)) {
|
||||
func_8005A77C(func_800C04A4(globalCtx, 0), 6);
|
||||
func_8005A77C(Gameplay_GetCamera(globalCtx, 0), 6);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1056,8 +1056,8 @@ s32 func_8002DEEC(Player* player) {
|
||||
return (player->stateFlags1 & 0x20000080) || player->action;
|
||||
}
|
||||
|
||||
void func_8002DF18(GlobalContext* globalCtx, ActorContext* actorCtx) {
|
||||
func_8006DC68(globalCtx, actorCtx);
|
||||
void func_8002DF18(GlobalContext* globalCtx, Player* player) {
|
||||
func_8006DC68(globalCtx, player);
|
||||
}
|
||||
|
||||
u32 func_8002DF38(GlobalContext* globalCtx, Actor* actor, u8 newAction) {
|
||||
@@ -1359,9 +1359,9 @@ void func_8002EBCC(Actor* actor, GlobalContext* globalCtx, s32 flag) {
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
lightDir.x = globalCtx->unk_10A4E;
|
||||
lightDir.y = globalCtx->unk_10A4F;
|
||||
lightDir.z = globalCtx->unk_10A50;
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
|
||||
if (HREG(80) == 6) {
|
||||
osSyncPrintf("z_actor.c 3637 game_play->view.eye=[%f(%f) %f %f]\n", (f64)globalCtx->view.eye.x,
|
||||
@@ -1393,9 +1393,9 @@ void func_8002ED80(Actor* actor, GlobalContext* globalCtx, s32 flag) {
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
lightDir.x = globalCtx->unk_10A4E;
|
||||
lightDir.y = globalCtx->unk_10A4F;
|
||||
lightDir.z = globalCtx->unk_10A50;
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
|
||||
hilite = func_8002EB44(&actor->posRot.pos, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -1770,15 +1770,15 @@ void func_8002FA60(GlobalContext* globalCtx) {
|
||||
|
||||
if (gSaveContext.fw.set) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.fw.pos_x;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.fw.pos_y;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = gSaveContext.fw.pos_z;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = gSaveContext.fw.pos.x;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.y = gSaveContext.fw.pos.y;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.z = gSaveContext.fw.pos.z;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].yaw = gSaveContext.fw.yaw;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].player_params = gSaveContext.fw.player_params;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].entrance_index = gSaveContext.fw.entrance_index;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].room_index = gSaveContext.fw.room_index;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].temp_swch_flags = gSaveContext.fw.temp_swch_flags;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].temp_collect_flags = gSaveContext.fw.temp_collect_flags;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams = gSaveContext.fw.playerParams;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex = gSaveContext.fw.entranceIndex;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].roomIndex = gSaveContext.fw.roomIndex;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].tempSwchFlags = gSaveContext.fw.tempSwchFlags;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].tempCollectFlags = gSaveContext.fw.tempCollectFlags;
|
||||
} else {
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x = 0.0f;
|
||||
@@ -1887,7 +1887,7 @@ void func_8002FBAC(GlobalContext* globalCtx) {
|
||||
|
||||
if (D_8015BC18 == 0.0f) {
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP] = gSaveContext.respawn[RESPAWN_MODE_DOWN];
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].player_params = 0x06FF;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].playerParams = 0x06FF;
|
||||
gSaveContext.respawn[RESPAWN_MODE_TOP].data = 0x28;
|
||||
}
|
||||
|
||||
@@ -1924,8 +1924,8 @@ void func_8002FBAC(GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
if ((globalCtx->csCtx.state == 0) &&
|
||||
(gSaveContext.respawn[RESPAWN_MODE_TOP].entrance_index == gSaveContext.entrance_index) &&
|
||||
(globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].room_index)) {
|
||||
(gSaveContext.respawn[RESPAWN_MODE_TOP].entranceIndex == gSaveContext.entranceIndex) &&
|
||||
(globalCtx->roomCtx.curRoom.num == gSaveContext.respawn[RESPAWN_MODE_TOP].roomIndex)) {
|
||||
gfxCtx->polyXlu.p = Gfx_CallSetupDL(gfxCtx->polyXlu.p, 0x19);
|
||||
|
||||
Matrix_Translate(gSaveContext.respawn[RESPAWN_MODE_TOP].pos.x,
|
||||
@@ -1980,12 +1980,13 @@ void func_800304B0(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
// Actor_InitContext
|
||||
void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry* actorEntry) {
|
||||
ActorOverlay* overlayEntry;
|
||||
SaveSceneFlags* saveSceneFlags;
|
||||
s32 i;
|
||||
|
||||
saveSceneFlags = &gSaveContext.scene_flags[globalCtx->sceneNum];
|
||||
saveSceneFlags = &gSaveContext.sceneFlags[globalCtx->sceneNum];
|
||||
|
||||
bzero(actorCtx, sizeof(*actorCtx));
|
||||
|
||||
@@ -2206,7 +2207,7 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) {
|
||||
func_80079EFC(lightMapper, globalCtx->state.gfxCtx);
|
||||
|
||||
if (actor->flags & 0x1000) {
|
||||
camera = &globalCtx->cameraCtx.activeCameras[0];
|
||||
camera = &globalCtx->cameras[0];
|
||||
func_800D1694(actor->posRot.pos.x + camera->unk_80.x,
|
||||
actor->posRot.pos.y + (f32)((actor->shape.unk_08 * actor->scale.y) + camera->unk_80.y),
|
||||
actor->posRot.pos.z + camera->unk_80.z, &actor->shape.rot);
|
||||
@@ -2546,6 +2547,7 @@ void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx) {
|
||||
globalCtx->msgCtx.unk_E3F4 = 0;
|
||||
}
|
||||
|
||||
// Actor_CleanupContext
|
||||
void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) {
|
||||
Actor* actor;
|
||||
s32 i;
|
||||
@@ -2568,7 +2570,7 @@ void func_80031C3C(ActorContext* actorCtx, GlobalContext* globalCtx) {
|
||||
actorCtx->absoluteSpace = NULL;
|
||||
}
|
||||
|
||||
func_800C0A44(globalCtx);
|
||||
Gameplay_SaveSceneFlags(globalCtx);
|
||||
func_80030488(globalCtx);
|
||||
ActorOverlayTable_Cleanup();
|
||||
}
|
||||
@@ -2891,7 +2893,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalC
|
||||
|
||||
if ((player != NULL) && (actor == player->unk_664)) {
|
||||
func_8008EDF0(player);
|
||||
func_8005A444(func_800C04A4(globalCtx, func_800C030C(globalCtx)), 0);
|
||||
func_8005A444(Gameplay_GetCamera(globalCtx, Gameplay_GetActiveCamId(globalCtx)), 0);
|
||||
}
|
||||
|
||||
if (actor == actorCtx->targetCtx.arrowPointedActor) {
|
||||
@@ -3516,14 +3518,14 @@ void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, GlobalContext* globalCtx)
|
||||
}
|
||||
|
||||
void func_80033DB8(GlobalContext* globalCtx, s16 arg1, s16 arg2) {
|
||||
s16 var = Quake_Add(&globalCtx->cameraCtx.activeCameras[0], 3);
|
||||
s16 var = Quake_Add(&globalCtx->cameras[0], 3);
|
||||
Quake_SetSpeed(var, 20000);
|
||||
Quake_SetQuakeValues(var, arg1, 0, 0, 0);
|
||||
Quake_SetCountdown(var, arg2);
|
||||
}
|
||||
|
||||
void func_80033E1C(GlobalContext* globalCtx, s16 arg1, s16 arg2, s16 arg3) {
|
||||
s16 var = Quake_Add(&globalCtx->cameraCtx.activeCameras[0], 3);
|
||||
s16 var = Quake_Add(&globalCtx->cameras[0], 3);
|
||||
Quake_SetSpeed(var, arg3);
|
||||
Quake_SetQuakeValues(var, arg1, 0, 0, 0);
|
||||
Quake_SetCountdown(var, arg2);
|
||||
@@ -3557,7 +3559,7 @@ typedef struct {
|
||||
/* 0x18 */ u32 unk_18;
|
||||
} struct_801160DC; // size = 0x1C
|
||||
|
||||
struct_801160DC D_801160DC[3] = {
|
||||
struct_801160DC D_801160DC[] = {
|
||||
{ 0.54f, 6000.0f, 5000.0f, 1.0f, 0.0f, 0x050011F0, 0x05001100 },
|
||||
{ 0.644f, 12000.0f, 8000.0f, 1.0f, 0.0f, 0x06001530, 0x06001400 },
|
||||
{ 0.64000005f, 8500.0f, 8000.0f, 1.75f, 0.1f, 0x050011F0, 0x05001100 },
|
||||
@@ -3634,9 +3636,9 @@ void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
|
||||
Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) {
|
||||
Vec3f lightDir;
|
||||
|
||||
lightDir.x = globalCtx->unk_10A4E;
|
||||
lightDir.y = globalCtx->unk_10A4F;
|
||||
lightDir.z = globalCtx->unk_10A50;
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
|
||||
return func_8002EABC(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -3644,9 +3646,9 @@ Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx) {
|
||||
Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx) {
|
||||
Vec3f lightDir;
|
||||
|
||||
lightDir.x = globalCtx->unk_10A4E;
|
||||
lightDir.y = globalCtx->unk_10A4F;
|
||||
lightDir.z = globalCtx->unk_10A50;
|
||||
lightDir.x = globalCtx->envCtx.unk_2A;
|
||||
lightDir.y = globalCtx->envCtx.unk_2B;
|
||||
lightDir.z = globalCtx->envCtx.unk_2C;
|
||||
|
||||
return func_8002EB44(object, &globalCtx->view.eye, &lightDir, globalCtx->state.gfxCtx);
|
||||
}
|
||||
@@ -3712,7 +3714,7 @@ typedef struct {
|
||||
/* 0x14 */ s16 unk_14;
|
||||
} struct_80116130; // size = 0x18
|
||||
|
||||
struct_80116130 D_80116130[13] = {
|
||||
struct_80116130 D_80116130[] = {
|
||||
{ { 0x2AA8, 0xF1C8, 0x18E2, 0x1554, 0x0000, 0x0000, 1 }, 170.0f, 0x3FFC },
|
||||
{ { 0x2AA8, 0xEAAC, 0x1554, 0x1554, 0xF8E4, 0x0E38, 1 }, 170.0f, 0x3FFC },
|
||||
{ { 0x31C4, 0xE390, 0x0E38, 0x0E38, 0xF1C8, 0x071C, 1 }, 170.0f, 0x3FFC },
|
||||
@@ -4233,28 +4235,28 @@ void func_80035B18(GlobalContext* globalCtx, Actor* actor, u16 textId) {
|
||||
* Tests if event_chk_inf flag is set.
|
||||
*/
|
||||
s32 Flags_GetEventChkInf(s32 flag) {
|
||||
return gSaveContext.event_chk_inf[flag >> 4] & (1 << (flag & 0xF));
|
||||
return gSaveContext.eventChkInf[flag >> 4] & (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets event_chk_inf flag.
|
||||
*/
|
||||
void Flags_SetEventChkInf(s32 flag) {
|
||||
gSaveContext.event_chk_inf[flag >> 4] |= (1 << (flag & 0xF));
|
||||
gSaveContext.eventChkInf[flag >> 4] |= (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests if inf_table flag is set.
|
||||
* Tests if "inf_table flag is set.
|
||||
*/
|
||||
s32 Flags_GetInfTable(s32 flag) {
|
||||
return gSaveContext.inf_table[flag >> 4] & (1 << (flag & 0xF));
|
||||
return gSaveContext.infTable[flag >> 4] & (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets inf_table flag.
|
||||
* Sets "inf_table" flag.
|
||||
*/
|
||||
void Flags_SetInfTable(s32 flag) {
|
||||
gSaveContext.inf_table[flag >> 4] |= (1 << (flag & 0xF));
|
||||
gSaveContext.infTable[flag >> 4] |= (1 << (flag & 0xF));
|
||||
}
|
||||
|
||||
u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) {
|
||||
@@ -4551,7 +4553,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) {
|
||||
retTextId = 0x7002;
|
||||
} else if (Flags_GetInfTable(0x6A)) {
|
||||
retTextId = 0x7004;
|
||||
} else if ((gSaveContext.day_time >= 0x4000) && (gSaveContext.day_time < 0xC556)) {
|
||||
} else if ((gSaveContext.dayTime >= 0x4000) && (gSaveContext.dayTime < 0xC556)) {
|
||||
retTextId = 0x7002;
|
||||
} else {
|
||||
retTextId = 0x7003;
|
||||
@@ -4956,7 +4958,7 @@ u32 func_80035BFC(GlobalContext* globalCtx, s16 arg1) {
|
||||
}
|
||||
} else {
|
||||
if (!Flags_GetEventChkInf(0x18)) {
|
||||
if (gSaveContext.night_flag) {
|
||||
if (gSaveContext.nightFlag) {
|
||||
retTextId = 0x204E;
|
||||
} else if (Flags_GetInfTable(0x9A)) {
|
||||
retTextId = 0x2031;
|
||||
@@ -5569,7 +5571,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
|
||||
actor->posRot2.pos = actor->posRot.pos;
|
||||
actor->posRot2.pos.y += arg4;
|
||||
|
||||
if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) {
|
||||
if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE))) {
|
||||
var = actor->rotTowardsLinkY - actor->shape.rot.y;
|
||||
abs_var = ABS(var);
|
||||
if (abs_var >= 0x4300) {
|
||||
@@ -5578,7 +5580,7 @@ s32 func_80038154(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
|
||||
}
|
||||
}
|
||||
|
||||
if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) {
|
||||
if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE)) {
|
||||
sp2C = globalCtx->view.eye;
|
||||
} else {
|
||||
sp2C = player->actor.posRot2.pos;
|
||||
@@ -5598,7 +5600,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
|
||||
|
||||
actor->posRot2.pos = arg4;
|
||||
|
||||
if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE))) {
|
||||
if (!(((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE))) {
|
||||
var = actor->rotTowardsLinkY - actor->shape.rot.y;
|
||||
abs_var = ABS(var);
|
||||
if (abs_var >= 0x4300) {
|
||||
@@ -5607,7 +5609,7 @@ s32 func_80038290(GlobalContext* globalCtx, Actor* actor, Vec3s* arg2, Vec3s* ar
|
||||
}
|
||||
}
|
||||
|
||||
if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entrance_index == 0x00EE)) {
|
||||
if (((globalCtx->csCtx.state != 0) || (D_8011D394 != 0)) && (gSaveContext.entranceIndex == 0x00EE)) {
|
||||
sp24 = globalCtx->view.eye;
|
||||
} else {
|
||||
sp24 = player->actor.posRot2.pos;
|
||||
|
||||
+16
-17
@@ -234,7 +234,6 @@ s32 func_800443A0(Camera* camera, Vec3f* b, Vec3f* c) {
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800443A0.s")
|
||||
#endif
|
||||
|
||||
f32 func_8003C940(CollisionContext*, CollisionPoly**, s32*, Vec3f*);
|
||||
f32 func_80044434(Camera* camera, Vec3f* b, Vec3f* c, s32* d) {
|
||||
s32 sp2C; // unused
|
||||
CollisionPoly* sp28;
|
||||
@@ -739,7 +738,7 @@ s16 func_80046CB4(Camera* camera, s16 b, s16 c, f32 d, f32 e) {
|
||||
if (camera->unk_D8 > 0.001f) {
|
||||
temp = b - 0x7fff; // this is probably some kind of cast that I'm too stupid to know
|
||||
sp1C = c - temp;
|
||||
phi_f14 = (s16)(sp1C - 0x7fff) * 0.00003051851f;
|
||||
phi_f14 = (s16)(sp1C - 0x7fff) * (1.0f / 32767.0f);
|
||||
} else {
|
||||
temp = b - 0x7fff;
|
||||
sp1C = c - temp;
|
||||
@@ -804,7 +803,7 @@ void Camera_Vec3fCopy(Vec3f* src, Vec3f* dst) {
|
||||
s32 func_8005AD40(Camera* camera, s32 a, s16 b, f32 c, s16 d, s16 e, s16 f);
|
||||
|
||||
void func_80057FC4(Camera* camera) {
|
||||
if (camera != &camera->globalCtx->cameraCtx.activeCameras[0]) {
|
||||
if (camera != &camera->globalCtx->cameras[0]) {
|
||||
camera->unk_154 = camera->unk_142 = 33;
|
||||
camera->unk_14C &= ~0x4;
|
||||
} else if (camera->globalCtx->roomCtx.curRoom.mesh->polygon.type != 1) {
|
||||
@@ -839,7 +838,7 @@ void Camera_Stub80058140(Camera* camera) {
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80058148.s")
|
||||
|
||||
// 109 lines (unknown arrays)
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_80058354.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/Camera_ChangeStatus.s")
|
||||
|
||||
// 261 lines
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800584E8.s")
|
||||
@@ -867,11 +866,11 @@ s32 func_80058CF8(Camera* camera) {
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_camera/func_800591EC.s")
|
||||
|
||||
void func_80059EC8(Camera* camera) {
|
||||
Camera* sp24 = camera->globalCtx->cameraCtx.activeCameraPtrs[0];
|
||||
Camera* sp24 = camera->globalCtx->cameraPtrs[0];
|
||||
Player* player = (Player*)camera->globalCtx->actorCtx.actorList[2].first;
|
||||
|
||||
if (camera->unk_160 == 0) {
|
||||
func_800C0314(camera->globalCtx, camera->unk_162, 7);
|
||||
Gameplay_ChangeCameraStatus(camera->globalCtx, camera->unk_162, 7);
|
||||
|
||||
if ((camera->unk_162 == 0) && (camera->unk_168 != 0)) {
|
||||
player->actor.freeze = 0;
|
||||
@@ -885,24 +884,24 @@ void func_80059EC8(Camera* camera) {
|
||||
sp24->unk_14C |= 8;
|
||||
}
|
||||
|
||||
if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) {
|
||||
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_14E]->unk_162 = camera->unk_162;
|
||||
if (camera->globalCtx->cameraPtrs[camera->unk_14E]->unk_162 == camera->unk_164) {
|
||||
camera->globalCtx->cameraPtrs[camera->unk_14E]->unk_162 = camera->unk_162;
|
||||
}
|
||||
|
||||
if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) {
|
||||
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E;
|
||||
if (camera->globalCtx->cameraPtrs[camera->unk_162]->unk_14E == camera->unk_164) {
|
||||
camera->globalCtx->cameraPtrs[camera->unk_162]->unk_14E = camera->unk_14E;
|
||||
}
|
||||
|
||||
if (camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_164 == 0) {
|
||||
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->unk_162]->unk_15E = 0;
|
||||
if (camera->globalCtx->cameraPtrs[camera->unk_162]->unk_164 == 0) {
|
||||
camera->globalCtx->cameraPtrs[camera->unk_162]->unk_15E = 0;
|
||||
}
|
||||
|
||||
camera->unk_162 = 0;
|
||||
camera->unk_14E = camera->unk_162;
|
||||
camera->unk_160 = -1;
|
||||
camera->globalCtx->unk_10B05 = 0;
|
||||
camera->globalCtx->envCtx.unk_E1 = 0;
|
||||
|
||||
func_800C0384(camera->globalCtx, camera->unk_164);
|
||||
Gameplay_ClearCamera(camera->globalCtx, camera->unk_164);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1128,9 +1127,9 @@ s32 func_8005B198() {
|
||||
s16 func_8005B1A4(Camera* camera) {
|
||||
camera->unk_14C |= 0x8;
|
||||
|
||||
if ((camera->unk_164 == 0) && (camera->globalCtx->cameraCtx.unk_5C0 != 0)) {
|
||||
camera->globalCtx->cameraCtx.activeCameraPtrs[camera->globalCtx->cameraCtx.unk_5C0]->unk_14C |= 0x8;
|
||||
return camera->globalCtx->cameraCtx.unk_5C0;
|
||||
if ((camera->unk_164 == 0) && (camera->globalCtx->activeCamera != 0)) {
|
||||
camera->globalCtx->cameraPtrs[camera->globalCtx->activeCamera]->unk_14C |= 0x8;
|
||||
return camera->globalCtx->activeCamera;
|
||||
}
|
||||
|
||||
return camera->unk_164;
|
||||
|
||||
@@ -298,7 +298,7 @@ s32 func_8005D1E0(GlobalContext* globalCtx, ColliderCylinderMain* collision) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D3BC.s")
|
||||
|
||||
void func_8005D400(UNK_TYPE arg0, UNK_TYPE arg1) {
|
||||
void func_8005D400(GlobalContext* globalCtx, SubGlobalContext11E60* sub_11E60) {
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005D40C.s")
|
||||
|
||||
@@ -5,15 +5,15 @@ void SaveContext_Init(void) {
|
||||
bzero(&gSaveContext, sizeof(gSaveContext));
|
||||
D_8015FA88 = 0;
|
||||
D_8015FA8C = 0;
|
||||
gSaveContext.seq_index = 0xFF;
|
||||
gSaveContext.night_sfx = 0xFF;
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.unk_140E = 0;
|
||||
gSaveContext.next_cutscene_index = 0xFFEF;
|
||||
gSaveContext.cutscene_trigger = 0;
|
||||
gSaveContext.chamber_cutscene_num = 0;
|
||||
gSaveContext.next_day_time = 0xFFFF;
|
||||
gSaveContext.environment_time = 0;
|
||||
gSaveContext.dogIsLost = 1;
|
||||
gSaveContext.transition_type = 0xFF;
|
||||
gSaveContext.nextCutsceneIndex = 0xFFEF;
|
||||
gSaveContext.cutsceneTrigger = 0;
|
||||
gSaveContext.chamberCutsceneNum = 0;
|
||||
gSaveContext.nextDayTime = 0xFFFF;
|
||||
gSaveContext.environmentTime = 0;
|
||||
gSaveContext.dogIsLost = true;
|
||||
gSaveContext.nextTransition = 0xFF;
|
||||
gSaveContext.unk_13EE = 50;
|
||||
}
|
||||
|
||||
+33
-33
@@ -19,7 +19,7 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
gSaveContext.unk_13EA = 0;
|
||||
gSaveContext.unk_13E8 = 0;
|
||||
|
||||
func_800AA278(&interfaceCtx->view, globalCtx->state.gfxCtx);
|
||||
View_Init(&interfaceCtx->view, globalCtx->state.gfxCtx);
|
||||
|
||||
interfaceCtx->unk_1EC = interfaceCtx->unk_1EE = 0;
|
||||
interfaceCtx->unk_1FA = interfaceCtx->unk_261 = interfaceCtx->unk_1FC = 0;
|
||||
@@ -94,71 +94,71 @@ void func_801109B0(GlobalContext* globalCtx) {
|
||||
__assert("parameter->icon_itemSegment != NULL", "../z_construct.c", 193);
|
||||
}
|
||||
|
||||
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.button_items[0],
|
||||
gSaveContext.equips.button_items[1], gSaveContext.equips.button_items[2],
|
||||
gSaveContext.equips.button_items[3]);
|
||||
osSyncPrintf("Register_Item[%x, %x, %x, %x]\n", gSaveContext.equips.buttonItems[0],
|
||||
gSaveContext.equips.buttonItems[1], gSaveContext.equips.buttonItems[2],
|
||||
gSaveContext.equips.buttonItems[3]);
|
||||
|
||||
if (gSaveContext.equips.button_items[0] < 0xF0) {
|
||||
if (gSaveContext.equips.buttonItems[0] < 0xF0) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x80, 0x1000,
|
||||
"../z_construct.c", 198);
|
||||
} else if (gSaveContext.equips.button_items[0] != 0xFF) {
|
||||
} else if (gSaveContext.equips.buttonItems[0] != 0xFF) {
|
||||
DmaMgr_SendRequest1(interfaceCtx->icon_itemSegment,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[0] * 0x80, 0x1000,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[0] * 0x80, 0x1000,
|
||||
"../z_construct.c", 203);
|
||||
}
|
||||
|
||||
if (gSaveContext.equips.button_items[1] < 0xF0) {
|
||||
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x1000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[1] * 0x80, 0x1000,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[1] * 0x80, 0x1000,
|
||||
"../z_construct.c", 209);
|
||||
}
|
||||
|
||||
if (gSaveContext.equips.button_items[2] < 0xF0) {
|
||||
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x2000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[2] * 0x80, 0x1000,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[2] * 0x80, 0x1000,
|
||||
"../z_construct.c", 214);
|
||||
}
|
||||
|
||||
if (gSaveContext.equips.button_items[3] < 0xF0) {
|
||||
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
|
||||
DmaMgr_SendRequest1((void*)((u32)interfaceCtx->icon_itemSegment + 0x3000),
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.button_items[3] * 0x80, 0x1000,
|
||||
_icon_item_staticSegmentRomStart + gSaveContext.equips.buttonItems[3] * 0x80, 0x1000,
|
||||
"../z_construct.c", 219);
|
||||
}
|
||||
|
||||
osSyncPrintf("EVENT=%d\n", gSaveContext.timer_1_state);
|
||||
osSyncPrintf("EVENT=%d\n", gSaveContext.timer1State);
|
||||
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8) || (gSaveContext.timer_2_state == 4) ||
|
||||
(gSaveContext.timer_2_state == 10)) {
|
||||
osSyncPrintf("restart_flag=%d\n", gSaveContext.respawn_flag);
|
||||
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8) || (gSaveContext.timer2State == 4) ||
|
||||
(gSaveContext.timer2State == 10)) {
|
||||
osSyncPrintf("restart_flag=%d\n", gSaveContext.respawnFlag);
|
||||
|
||||
if ((gSaveContext.respawn_flag == -1) || (gSaveContext.respawn_flag == 1)) {
|
||||
if (gSaveContext.timer_1_state == 4) {
|
||||
gSaveContext.timer_1_state = 1;
|
||||
gSaveContext.timer_x[0] = 140;
|
||||
gSaveContext.timer_y[0] = 80;
|
||||
if ((gSaveContext.respawnFlag == -1) || (gSaveContext.respawnFlag == 1)) {
|
||||
if (gSaveContext.timer1State == 4) {
|
||||
gSaveContext.timer1State = 1;
|
||||
gSaveContext.timerX[0] = 140;
|
||||
gSaveContext.timerY[0] = 80;
|
||||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer_1_state == 4) || (gSaveContext.timer_1_state == 8)) {
|
||||
if ((gSaveContext.timer1State == 4) || (gSaveContext.timer1State == 8)) {
|
||||
temp = 0;
|
||||
} else {
|
||||
temp = 1;
|
||||
}
|
||||
|
||||
gSaveContext.timer_x[temp] = 26;
|
||||
gSaveContext.timerX[temp] = 26;
|
||||
|
||||
if (gSaveContext.health_capacity > 0xA0) {
|
||||
gSaveContext.timer_y[temp] = 54;
|
||||
if (gSaveContext.healthCapacity > 0xA0) {
|
||||
gSaveContext.timerY[temp] = 54;
|
||||
} else {
|
||||
gSaveContext.timer_y[temp] = 46;
|
||||
gSaveContext.timerY[temp] = 46;
|
||||
}
|
||||
}
|
||||
|
||||
if ((gSaveContext.timer_1_state >= 11) && (gSaveContext.timer_1_state < 16)) {
|
||||
gSaveContext.timer_1_state = 0;
|
||||
if ((gSaveContext.timer1State >= 11) && (gSaveContext.timer1State < 16)) {
|
||||
gSaveContext.timer1State = 0;
|
||||
// Translates to: "Timer Stop!!!!!!!!!!!!!!!!!!!!!!"
|
||||
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer_1_state);
|
||||
osSyncPrintf("タイマー停止!!!!!!!!!!!!!!!!!!!!! = %d\n", gSaveContext.timer1State);
|
||||
}
|
||||
|
||||
// Translates to: "Parameter Area = %x"
|
||||
@@ -199,7 +199,7 @@ void func_80110F68(GlobalContext* globalCtx) {
|
||||
msgCtx->unk_E2F8 = msgCtx->unk_E3E4 = msgCtx->choiceIndex = msgCtx->unk_E3F0 = msgCtx->unk_E3D6 = 0;
|
||||
msgCtx->unk_E3E2 = 0xFF;
|
||||
|
||||
func_800AA278(&msgCtx->view, globalCtx->state.gfxCtx);
|
||||
View_Init(&msgCtx->view, globalCtx->state.gfxCtx);
|
||||
|
||||
msgCtx->textboxSegment = Game_Alloc(&globalCtx->state, 0x2200, "../z_construct.c", 349);
|
||||
|
||||
@@ -532,7 +532,7 @@ void func_80111070(void) {
|
||||
WREG(94) = 3;
|
||||
WREG(95) = 6;
|
||||
|
||||
if (gSaveContext.game_mode == 0) {
|
||||
if (gSaveContext.gameMode == 0) {
|
||||
VREG(0) = 0x34;
|
||||
VREG(1) = 0x24;
|
||||
VREG(2) = 0xD6;
|
||||
|
||||
@@ -8,8 +8,8 @@ typedef struct {
|
||||
|
||||
typedef void (*DebugDispObject_DrawFunc)(DebugDispObject*, u32, GlobalContext*);
|
||||
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx);
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx);
|
||||
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx);
|
||||
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx);
|
||||
|
||||
static DebugDispObject_DrawFunc sDebugObjectDrawFuncTable[] = {
|
||||
DebugDisplay_DrawSpriteI8,
|
||||
@@ -70,7 +70,7 @@ void DebugDisplay_DrawObjects(GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) {
|
||||
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
@@ -95,7 +95,7 @@ static void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, u32 texture, Glo
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_debug_display.c", 192);
|
||||
}
|
||||
|
||||
static void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) {
|
||||
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, u32 dlist, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
|
||||
+380
-380
File diff suppressed because it is too large
Load Diff
+53
-53
@@ -2,32 +2,32 @@
|
||||
#include <global.h>
|
||||
|
||||
// "Get Item" Model Draw Functions
|
||||
static void func_800694E4(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_800695C0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006969C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_80069880(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_80069AC8(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_80069CF0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_80069EB0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A060(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A158(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A73C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A88C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006AE40(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B124(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B24C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B54C(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId);
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_800694E4(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_800695C0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006969C(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_80069880(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_80069AC8(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_80069CF0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_80069EB0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A060(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A158(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A2A0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A4B0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A5F0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A73C(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A88C(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006A9CC(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006AAA8(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006ABEC(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006ACE4(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006AE40(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006AF9C(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006B124(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006B24C(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006B3C0(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006B54C(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006B6E4(GlobalContext* globalCtx, s16 drawId);
|
||||
void func_8006B870(GlobalContext* globalCtx, s16 drawId);
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void (*drawFunc)(GlobalContext*, s16);
|
||||
@@ -35,7 +35,7 @@ typedef struct {
|
||||
} DrawItemTableEntry; // size = 0x24
|
||||
|
||||
// TODO: use symbols for these dlists once objects are in C
|
||||
static DrawItemTableEntry sDrawItemTable[] = {
|
||||
DrawItemTableEntry sDrawItemTable[] = {
|
||||
{ func_8006AAA8, { 0x06000670, 0x06000750 } },
|
||||
{ func_8006A9CC, { 0x06000800 } },
|
||||
{ func_8006ABEC, { 0x06000A80, 0x06000AE0 } },
|
||||
@@ -167,7 +167,7 @@ void func_800694A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
|
||||
// All remaining functions in this file are draw functions referenced in the table and called by the function above
|
||||
|
||||
static void func_800694E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_800694E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -181,7 +181,7 @@ static void func_800694E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 565);
|
||||
}
|
||||
|
||||
static void func_800695C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_800695C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -195,7 +195,7 @@ static void func_800695C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 581);
|
||||
}
|
||||
|
||||
static void func_8006969C(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006969C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -222,7 +222,7 @@ static void func_8006969C(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 621);
|
||||
}
|
||||
|
||||
static void func_80069880(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_80069880(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -252,7 +252,7 @@ static void func_80069880(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 663);
|
||||
}
|
||||
|
||||
static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_80069AC8(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -281,7 +281,7 @@ static void func_80069AC8(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 704);
|
||||
}
|
||||
|
||||
static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_80069CF0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -305,7 +305,7 @@ static void func_80069CF0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 735);
|
||||
}
|
||||
|
||||
static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_80069EB0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -328,7 +328,7 @@ static void func_80069EB0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 765);
|
||||
}
|
||||
|
||||
static void func_8006A060(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A060(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -343,7 +343,7 @@ static void func_8006A060(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 783);
|
||||
}
|
||||
|
||||
static void func_8006A158(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A158(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -362,7 +362,7 @@ static void func_8006A158(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 827);
|
||||
}
|
||||
|
||||
static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -389,7 +389,7 @@ static void func_8006A2A0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 861);
|
||||
}
|
||||
|
||||
static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -407,7 +407,7 @@ static void func_8006A4B0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 883);
|
||||
}
|
||||
|
||||
static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -425,7 +425,7 @@ static void func_8006A5F0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 906);
|
||||
}
|
||||
|
||||
static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A73C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -443,7 +443,7 @@ static void func_8006A73C(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 929);
|
||||
}
|
||||
|
||||
static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A88C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -461,7 +461,7 @@ static void func_8006A88C(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 952);
|
||||
}
|
||||
|
||||
static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -475,7 +475,7 @@ static void func_8006A9CC(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 968);
|
||||
}
|
||||
|
||||
static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -494,7 +494,7 @@ static void func_8006AAA8(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 991);
|
||||
}
|
||||
|
||||
static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -507,7 +507,7 @@ static void func_8006ABEC(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1008);
|
||||
}
|
||||
|
||||
static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -527,7 +527,7 @@ static void func_8006ACE4(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1032);
|
||||
}
|
||||
|
||||
static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006AE40(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -547,7 +547,7 @@ static void func_8006AE40(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1056);
|
||||
}
|
||||
|
||||
static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -567,7 +567,7 @@ static void func_8006AF9C(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1081);
|
||||
}
|
||||
|
||||
static void func_8006B124(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006B124(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -584,7 +584,7 @@ static void func_8006B124(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1100);
|
||||
}
|
||||
|
||||
static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006B24C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -605,7 +605,7 @@ static void func_8006B24C(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1126);
|
||||
}
|
||||
|
||||
static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -628,7 +628,7 @@ static void func_8006B3C0(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1154);
|
||||
}
|
||||
|
||||
static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006B54C(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -649,7 +649,7 @@ static void func_8006B54C(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1181);
|
||||
}
|
||||
|
||||
static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
@@ -671,7 +671,7 @@ static void func_8006B6E4(GlobalContext* globalCtx, s16 drawId) {
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_draw.c", 1207);
|
||||
}
|
||||
|
||||
static void func_8006B870(GlobalContext* globalCtx, s16 drawId) {
|
||||
void func_8006B870(GlobalContext* globalCtx, s16 drawId) {
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
@@ -22,10 +22,10 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
|
||||
switch (msg->byte0 & 0x1E) {
|
||||
case 0:
|
||||
temp = 1 << (msg->byte1 & 0x0F);
|
||||
return ((msg->byte0 & 1) == 1) == !!(gSaveContext.event_chk_inf[(msg->byte1 & 0xF0) >> 4] & temp);
|
||||
return ((msg->byte0 & 1) == 1) == !!(gSaveContext.eventChkInf[(msg->byte1 & 0xF0) >> 4] & temp);
|
||||
case 2:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!(gBitFlags[msg->byte1 - ITEM_KEY_BOSS] & gSaveContext.dungeon_items[gSaveContext.dungeon_index]);
|
||||
!!(gBitFlags[msg->byte1 - ITEM_KEY_BOSS] & gSaveContext.dungeonItems[gSaveContext.dungeonIndex]);
|
||||
case 4:
|
||||
return ((msg->byte0 & 1) == 1) == (msg->byte3 == INV_CONTENT(msg->byte1));
|
||||
case 6:
|
||||
@@ -38,12 +38,12 @@ u32 ElfMessage_CheckCondition(ElfMessage* msg) {
|
||||
gSaveContext.equipment);
|
||||
case 0x20:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!(gBitFlags[msg->byte3 - ITEM_SONG_MINUET + 6] & gSaveContext.quest_items);
|
||||
!!(CHECK_QUEST_ITEM(msg->byte3 - ITEM_SONG_MINUET + QUEST_SONG_MINUET));
|
||||
case 0x30:
|
||||
return ((msg->byte0 & 1) == 1) ==
|
||||
!!(gBitFlags[msg->byte3 - ITEM_MEDALLION_FOREST] & gSaveContext.quest_items);
|
||||
!!(CHECK_QUEST_ITEM(msg->byte3 - ITEM_MEDALLION_FOREST + QUEST_MEDALLION_FOREST));
|
||||
case 0x40:
|
||||
return ((msg->byte0 & 1) == 1) == !!gSaveContext.magic_acquired;
|
||||
return ((msg->byte0 & 1) == 1) == !!gSaveContext.magicAcquired;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -886,13 +886,13 @@ s16 func_8001F404(s16 dropId) {
|
||||
// clang-format off
|
||||
if (((dropId == DROP_BOMBS_A || dropId == DROP_BOMBS_SPECIAL || dropId == DROP_BOMBS_B) && INV_CONTENT(ITEM_BOMB) == ITEM_NONE) ||
|
||||
((dropId == DROP_ARROWS_SMALL || dropId == DROP_ARROWS_MEDIUM || dropId == DROP_ARROWS_LARGE) && INV_CONTENT(ITEM_BOW) == ITEM_NONE) ||
|
||||
((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magic_level == 0) ||
|
||||
((dropId == DROP_MAGIC_LARGE || dropId == DROP_MAGIC_SMALL) && gSaveContext.magicLevel == 0) ||
|
||||
((dropId == DROP_SEEDS) && INV_CONTENT(ITEM_SLINGSHOT) == ITEM_NONE)) {
|
||||
return -1;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
if (dropId == DROP_HEART && gSaveContext.health_capacity == gSaveContext.health) {
|
||||
if (dropId == DROP_HEART && gSaveContext.healthCapacity == gSaveContext.health) {
|
||||
return DROP_RUPEE_GREEN;
|
||||
}
|
||||
|
||||
@@ -1038,12 +1038,12 @@ void Item_DropCollectibleRandom(GlobalContext* globalCtx, Actor* fromActor, Vec3
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_HEART;
|
||||
} else if ((gSaveContext.magic_level != 0) && (gSaveContext.magic == 0)) { // Empty magic meter
|
||||
} else if ((gSaveContext.magicLevel != 0) && (gSaveContext.magic == 0)) { // Empty magic meter
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_MAGIC_LARGE;
|
||||
} else if ((gSaveContext.magic_level != 0) &&
|
||||
(gSaveContext.magic <= (gSaveContext.magic_level >> 1))) { // Half magic or less
|
||||
} else if ((gSaveContext.magicLevel != 0) &&
|
||||
(gSaveContext.magic <= (gSaveContext.magicLevel >> 1))) { // Half magic or less
|
||||
params = 0xA * 0x10;
|
||||
dropTableIndex = 0x0;
|
||||
dropId = DROP_MAGIC_SMALL;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
u16 sReactionTextIds[60][9] = {
|
||||
u16 sReactionTextIds[][9] = {
|
||||
{ 0x0000, 0x7124, 0x7127, 0x7126, 0x7125, 0x7127, 0x7124, 0x7125, 0x7127 },
|
||||
{ 0x0000, 0x7128, 0x7129, 0x7128, 0x7128, 0x7128, 0x7128, 0x712A, 0x712B },
|
||||
{ 0x0000, 0x7128, 0x712B, 0x7128, 0x7128, 0x7129, 0x7128, 0x712B, 0x7128 },
|
||||
|
||||
@@ -12,7 +12,7 @@ GameStateOverlay gGameStateOverlayTable[] = {
|
||||
GAMESTATE_OVERLAY_INTERNAL(TitleSetup_Init, TitleSetup_Destroy, sizeof(GameState)),
|
||||
GAMESTATE_OVERLAY(select, func_80801E44, func_80801E0C, 0x240), // TODO : sizeof(SelectContext)
|
||||
GAMESTATE_OVERLAY(title, Title_Init, Title_Destroy, sizeof(TitleContext)),
|
||||
GAMESTATE_OVERLAY_INTERNAL(func_800BCA64, func_800BC8EC, sizeof(GlobalContext)),
|
||||
GAMESTATE_OVERLAY_INTERNAL(Gameplay_Init, Gameplay_Destroy, sizeof(GlobalContext)),
|
||||
GAMESTATE_OVERLAY(opening, Opening_Init, Opening_Destroy, sizeof(OpeningContext)),
|
||||
GAMESTATE_OVERLAY(file_choose, func_80811A20, func_80811A18, 0x1CAE0),
|
||||
};
|
||||
|
||||
+43
-43
@@ -16,20 +16,20 @@ s32 func_8006CFC0(s32 scene) {
|
||||
}
|
||||
|
||||
void func_8006D074(GlobalContext* globalCtx) {
|
||||
gSaveContext.horse_data.scene = SCENE_SPOT00;
|
||||
gSaveContext.horse_data.pos.x = -1840;
|
||||
gSaveContext.horse_data.pos.y = 72;
|
||||
gSaveContext.horse_data.pos.z = 5497;
|
||||
gSaveContext.horse_data.angle = -27353;
|
||||
gSaveContext.horseData.scene = SCENE_SPOT00;
|
||||
gSaveContext.horseData.pos.x = -1840;
|
||||
gSaveContext.horseData.pos.y = 72;
|
||||
gSaveContext.horseData.pos.z = 5497;
|
||||
gSaveContext.horseData.angle = -27353;
|
||||
}
|
||||
|
||||
void func_8006D0AC(GlobalContext* globalCtx) {
|
||||
if (gSaveContext.horse_data.scene == SCENE_SPOT06) {
|
||||
gSaveContext.horse_data.scene = SCENE_SPOT06;
|
||||
gSaveContext.horse_data.pos.x = -2065;
|
||||
gSaveContext.horse_data.pos.y = -863;
|
||||
gSaveContext.horse_data.pos.z = 1839;
|
||||
gSaveContext.horse_data.angle = 0;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,35 +59,35 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
player->rideActor->room = -1;
|
||||
}
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigame_state == 3)) {
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT12) && (gSaveContext.minigameState == 3)) {
|
||||
Actor* horseActor;
|
||||
gSaveContext.minigame_state = 0;
|
||||
gSaveContext.minigameState = 0;
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 3586.0f, 1413.0f, -402.0f, 0, 0x4000, 0, 1);
|
||||
horseActor->room = -1;
|
||||
} else if ((gSaveContext.entrance_index == 1230) && (gSaveContext.event_chk_inf[1] & 0x100)) {
|
||||
} else if ((gSaveContext.entranceIndex == 1230) && (gSaveContext.eventChkInf[1] & 0x100)) {
|
||||
Actor* horseActor;
|
||||
horseActor =
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, -25.0f, 0.0f, -1600.0f, 0, -0x4000, 0, 1);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 389);
|
||||
}
|
||||
} else if ((globalCtx->sceneNum == gSaveContext.horse_data.scene) &&
|
||||
} else if ((globalCtx->sceneNum == gSaveContext.horseData.scene) &&
|
||||
(Flags_GetEventChkInf(0x18) != 0 || DREG(1) != 0)) {
|
||||
// Translates to: "SET BY EXISTENCE OF HORSE %d %d %d"
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horse_data.scene, Flags_GetEventChkInf(0x18),
|
||||
osSyncPrintf("馬存在によるセット %d %d %d\n", gSaveContext.horseData.scene, Flags_GetEventChkInf(0x18),
|
||||
DREG(1));
|
||||
|
||||
if (func_8006CFC0(gSaveContext.horse_data.scene)) {
|
||||
if (func_8006CFC0(gSaveContext.horseData.scene)) {
|
||||
Actor* horseActor;
|
||||
horseActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, gSaveContext.horse_data.pos.x,
|
||||
gSaveContext.horse_data.pos.y, gSaveContext.horse_data.pos.z, 0,
|
||||
gSaveContext.horse_data.angle, 0, 1);
|
||||
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);
|
||||
if (horseActor == NULL) {
|
||||
__assert("horse_actor != NULL", "../z_horse.c", 414);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
} else {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// Translates to: "Horse_SetNormal():%d SET SPOT IS NO GOOD."
|
||||
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
|
||||
osSyncPrintf("Horse_SetNormal():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(globalCtx);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ void func_8006D0EC(GlobalContext* globalCtx, Player* player) {
|
||||
}
|
||||
}
|
||||
} else if (!Flags_GetEventChkInf(0x18)) {
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.night_flag != 0)) {
|
||||
if ((DREG(1) == 0) && (globalCtx->sceneNum == SCENE_SOUKO) && (gSaveContext.nightFlag != 0)) {
|
||||
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_HORSE, 0.0f, 0.0f, -60.0f, 0, 0x7360, 0, 1);
|
||||
}
|
||||
}
|
||||
@@ -149,9 +149,9 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
s32 i;
|
||||
Vec3s spawnPos;
|
||||
|
||||
if ((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
|
||||
(gSaveContext.respawn_flag == 0)) {
|
||||
if ((gSaveContext.entranceIndex == 0x028A || gSaveContext.entranceIndex == 0x028E ||
|
||||
gSaveContext.entranceIndex == 0x0292 || gSaveContext.entranceIndex == 0x0476) &&
|
||||
(gSaveContext.respawnFlag == 0)) {
|
||||
Vec3s spawnPositions[] = {
|
||||
{ 0xF46F, 0x0139, 0x1E14 },
|
||||
{ 0xF894, 0x0139, 0x1B67 },
|
||||
@@ -159,11 +159,11 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
{ 0xF6F7, 0x0139, 0x1766 },
|
||||
};
|
||||
|
||||
if (gSaveContext.entrance_index == 0x028A) {
|
||||
if (gSaveContext.entranceIndex == 0x028A) {
|
||||
spawnPos = spawnPositions[0];
|
||||
} else if (gSaveContext.entrance_index == 0x028E) {
|
||||
} else if (gSaveContext.entranceIndex == 0x028E) {
|
||||
spawnPos = spawnPositions[1];
|
||||
} else if (gSaveContext.entrance_index == 0x0292) {
|
||||
} else if (gSaveContext.entranceIndex == 0x0292) {
|
||||
spawnPos = spawnPositions[2];
|
||||
} else {
|
||||
spawnPos = spawnPositions[3];
|
||||
@@ -177,8 +177,8 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.eventInf[0] & 0xF) == 6) &&
|
||||
(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);
|
||||
@@ -188,7 +188,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
|
||||
func_8002DECC(globalCtx, player, player->rideActor);
|
||||
func_8002DE74(globalCtx, player);
|
||||
gSaveContext.horse_data.scene = globalCtx->sceneNum;
|
||||
gSaveContext.horseData.scene = globalCtx->sceneNum;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
player->rideActor->room = -1;
|
||||
@@ -203,9 +203,9 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(D_8011F9B8); i++) {
|
||||
if ((globalCtx->sceneNum == D_8011F9B8[i].scene) &&
|
||||
(gSaveContext.cutscene_index == D_8011F9B8[i].cutsceneIndex)) {
|
||||
(gSaveContext.cutsceneIndex == D_8011F9B8[i].cutsceneIndex)) {
|
||||
if (D_8011F9B8[i].type == 7) {
|
||||
if ((globalCtx->sceneNum == 99) && (gSaveContext.cutscene_index == 0xFFF1)) {
|
||||
if ((globalCtx->sceneNum == 99) && (gSaveContext.cutsceneIndex == 0xFFF1)) {
|
||||
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;
|
||||
@@ -226,7 +226,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
s32 pad2;
|
||||
|
||||
temp = 0;
|
||||
if (((gSaveContext.event_inf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6) {
|
||||
if (((gSaveContext.eventInf[0] & 0x10) >> 4) && D_8011F9B8[i].type == 6) {
|
||||
temp = 0x8000;
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ void func_8006D684(GlobalContext* globalCtx, Player* player) {
|
||||
sp54.y = player->actor.posRot.pos.y + 100.0f;
|
||||
sp54.z = player->actor.posRot.pos.z;
|
||||
|
||||
func_800C04D8(globalCtx, globalCtx->cameraCtx.unk_5C0, &player->actor.posRot, &sp54);
|
||||
func_800C04D8(globalCtx, globalCtx->activeCamera, &player->actor.posRot.pos, &sp54);
|
||||
} 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,
|
||||
@@ -279,20 +279,20 @@ struct_8011F9B8 D_8011F9B8[] = {
|
||||
|
||||
void func_8006DC68(GlobalContext* globalCtx, Player* player) {
|
||||
if (LINK_IS_ADULT) {
|
||||
if (!func_8006CFC0(gSaveContext.horse_data.scene)) {
|
||||
if (!func_8006CFC0(gSaveContext.horseData.scene)) {
|
||||
osSyncPrintf(VT_COL(RED, WHITE));
|
||||
// Translates to: "Horse_Set_Check():%d SET SPOT IS NO GOOD."
|
||||
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horse_data.scene);
|
||||
osSyncPrintf("Horse_Set_Check():%d セットスポットまずいです。\n", gSaveContext.horseData.scene);
|
||||
osSyncPrintf(VT_RST);
|
||||
func_8006D074(globalCtx);
|
||||
}
|
||||
|
||||
if (func_8006CFC0(globalCtx->sceneNum)) {
|
||||
if ((gSaveContext.scene_setup_index > 3) ||
|
||||
((gSaveContext.entrance_index == 0x028A || gSaveContext.entrance_index == 0x028E ||
|
||||
gSaveContext.entrance_index == 0x0292 || gSaveContext.entrance_index == 0x0476) &&
|
||||
(gSaveContext.respawn_flag == 0)) ||
|
||||
((globalCtx->sceneNum == SCENE_SPOT20) && ((gSaveContext.event_inf[0] & 0xF) == 6) &&
|
||||
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) &&
|
||||
!Flags_GetEventChkInf(0x18) && (DREG(1) == 0))) {
|
||||
func_8006D684(globalCtx, player);
|
||||
} else {
|
||||
|
||||
@@ -199,13 +199,13 @@ void Interface_DrawHealth(GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Vtx* sp154 = interfaceCtx->vtx_12C;
|
||||
s32 curHeartFraction = gSaveContext.health % 0x10;
|
||||
s16 totalHeartCount = gSaveContext.health_capacity / 0x10;
|
||||
s16 totalHeartCount = gSaveContext.healthCapacity / 0x10;
|
||||
s16 fullHeartCount = gSaveContext.health / 0x10;
|
||||
s32 pad2;
|
||||
f32 sp144 = interfaceCtx->unk_22A * 0.1f;
|
||||
s32 curCombineModeSet = 0;
|
||||
u8* curBgImgLoaded = NULL;
|
||||
s32 ddHeartCountMinusOne = gSaveContext.defense_hearts - 1;
|
||||
s32 ddHeartCountMinusOne = gSaveContext.defenseHearts - 1;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_lifemeter.c", 353);
|
||||
@@ -393,7 +393,7 @@ void Health_HandleCriticalAlarm(GlobalContext* globalCtx) {
|
||||
interfaceCtx->unk_22A = 0;
|
||||
interfaceCtx->unk_22C = 0;
|
||||
if (!func_8008E988(globalCtx) && (globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.flag == 0) &&
|
||||
Health_IsCritical() && !func_800BFC84(globalCtx)) {
|
||||
Health_IsCritical() && !Gameplay_InCsMode(globalCtx)) {
|
||||
func_80078884(NA_SE_SY_HITPOINT_ALARM);
|
||||
}
|
||||
}
|
||||
@@ -409,11 +409,11 @@ void Health_HandleCriticalAlarm(GlobalContext* globalCtx) {
|
||||
u32 Health_IsCritical(void) {
|
||||
s32 var;
|
||||
|
||||
if (gSaveContext.health_capacity <= 0x50) {
|
||||
if (gSaveContext.healthCapacity <= 0x50) {
|
||||
var = 0x10;
|
||||
} else if (gSaveContext.health_capacity <= 0xA0) {
|
||||
} else if (gSaveContext.healthCapacity <= 0xA0) {
|
||||
var = 0x18;
|
||||
} else if (gSaveContext.health_capacity <= 0xF0) {
|
||||
} else if (gSaveContext.healthCapacity <= 0xF0) {
|
||||
var = 0x20;
|
||||
} else {
|
||||
var = 0x2C;
|
||||
|
||||
+2
-2
@@ -10,13 +10,13 @@ Arena sZeldaArena;
|
||||
void ZeldaArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (gZeldaArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
//"%s: %u bytes %s failed\n"
|
||||
// "%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
__osDisplayArena(&sZeldaArena);
|
||||
return;
|
||||
}
|
||||
} else if (gZeldaArenaLogSeverity >= LOG_SEVERITY_VERBOSE) {
|
||||
//"%s: %u bytes %s succeeded\n"
|
||||
// "%s: %u bytes %s succeeded\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに成功しました\n", name, size, action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
dungeonId = gSaveContext.dungeon_index;
|
||||
dungeonId = gSaveContext.dungeonIndex;
|
||||
interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
if ((D_8015FFD0 != NULL) && (globalCtx->interfaceCtx.roomNum >= D_8015FFD0[7][dungeonId])) {
|
||||
|
||||
+520
-521
File diff suppressed because it is too large
Load Diff
+1782
-82
File diff suppressed because it is too large
Load Diff
+16
-16
@@ -3,22 +3,22 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008E750.s")
|
||||
|
||||
UNK_TYPE func_8008E8DC(GlobalContext* globalCtx, Player* player) {
|
||||
s32 func_8008E8DC(GlobalContext* globalCtx, Player* player) {
|
||||
return (player->stateFlags1 & 0x20000080 || player->action || globalCtx->sceneLoadFlag == 0x14 ||
|
||||
player->stateFlags1 & 1 || player->unk_692 & 0x80 ||
|
||||
gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0);
|
||||
(gSaveContext.unk_13F0 && func_8008F0D8(player, player->unk_154) >= 0));
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008E988(GlobalContext* globalCtx) {
|
||||
s32 func_8008E988(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return func_8008E8DC(globalCtx, player) || player->unk_6AD == 4;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008E9C4(Player* player) {
|
||||
s32 func_8008E9C4(Player* player) {
|
||||
return player->stateFlags1 & 0x10;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008E9D0(Player* player) {
|
||||
s32 func_8008E9D0(Player* player) {
|
||||
return LINK_IS_CHILD && player->currentShield == 2;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ void func_8008EC70(Player* player) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008ECAC.s")
|
||||
|
||||
void func_8008ED9C(GlobalContext* globalCtx, Player* player, UNK_TYPE item, UNK_TYPE arg2) {
|
||||
void func_8008ED9C(GlobalContext* globalCtx, Player* player, s32 item, s32 arg2) {
|
||||
Inventory_UpdateBottleItem(globalCtx, item, player->unk_150);
|
||||
if (item != ITEM_BOTTLE) {
|
||||
player->unk_152 = item;
|
||||
@@ -56,7 +56,7 @@ void func_8008EDF0(Player* player) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008EEAC.s")
|
||||
|
||||
UNK_TYPE func_8008EF44(GlobalContext* globalCtx, UNK_TYPE arg1) {
|
||||
s32 func_8008EF44(GlobalContext* globalCtx, s32 arg1) {
|
||||
globalCtx->unk_11E5C = (arg1 + 1);
|
||||
return 1;
|
||||
}
|
||||
@@ -75,17 +75,17 @@ void func_8008F08C(GlobalContext* globalCtx) {
|
||||
player->currentMask = 0;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F098(GlobalContext* globalCtx) {
|
||||
s32 func_8008F098(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return player->currentShield == 3;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F0AC(GlobalContext* globalCtx) {
|
||||
s32 func_8008F0AC(GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
return player->unk_15D == 0xa && player->currentShield == 3;
|
||||
}
|
||||
|
||||
s32 func_8008F0D8(Player* player, UNK_TYPE arg1) {
|
||||
s32 func_8008F0D8(Player* player, s32 arg1) {
|
||||
s32 temp_v0 = arg1 - 0x15;
|
||||
if (temp_v0 >= 0 && temp_v0 < 6) {
|
||||
return temp_v0;
|
||||
@@ -93,15 +93,15 @@ s32 func_8008F0D8(Player* player, UNK_TYPE arg1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F104(Player* player) {
|
||||
s32 func_8008F104(Player* player) {
|
||||
return player->unk_151 == 0x10 || player->unk_151 == 0x11;
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F128(Player* player) {
|
||||
s32 func_8008F128(Player* player) {
|
||||
return func_8008F104(player) && player->heldActor == NULL;
|
||||
}
|
||||
|
||||
s32 func_8008F158(UNK_TYPE arg0) {
|
||||
s32 func_8008F158(s32 arg0) {
|
||||
s32 temp_v0 = arg0 - 2;
|
||||
if (temp_v0 > 0 && temp_v0 < 6) {
|
||||
return temp_v0;
|
||||
@@ -113,7 +113,7 @@ void func_8008F180(Player* player) {
|
||||
func_8008F158(player->unk_151);
|
||||
}
|
||||
|
||||
UNK_TYPE func_8008F1A0(Player* player) {
|
||||
s32 func_8008F1A0(Player* player) {
|
||||
if (player->unk_151 >= 5 && player->unk_151 < 8) {
|
||||
return 1;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ UNK_TYPE func_8008F1A0(Player* player) {
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_player_lib/func_8008F1CC.s")
|
||||
|
||||
s32 func_8008F224(Player* player, UNK_TYPE arg1) {
|
||||
s32 func_8008F224(Player* player, s32 arg1) {
|
||||
s32 temp_v0 = arg1 - 0x1E;
|
||||
if (temp_v0 >= 0 && temp_v0 < 0xD) {
|
||||
return temp_v0;
|
||||
@@ -134,7 +134,7 @@ void func_8008F250(Player* player) {
|
||||
func_8008F224(player, player->unk_151);
|
||||
}
|
||||
|
||||
s32 func_8008F270(Player* player, UNK_TYPE arg1) {
|
||||
s32 func_8008F270(Player* player, s32 arg1) {
|
||||
s32 temp_v0 = arg1 - 0x12;
|
||||
if (temp_v0 >= 0 && temp_v0 < 2) {
|
||||
return temp_v0;
|
||||
|
||||
+4
-3
@@ -144,7 +144,7 @@ s16 Quake_GetFreeIndex() {
|
||||
|
||||
QuakeRequest* Quake_AddImpl(Camera* cam, u32 callbackIdx) {
|
||||
s16 idx = Quake_GetFreeIndex();
|
||||
QuakeRequest* req = sQuakeRequest + idx;
|
||||
QuakeRequest* req = &sQuakeRequest[idx];
|
||||
|
||||
func_80106860(req, 0, sizeof(QuakeRequest)); // memset
|
||||
req->cam = cam;
|
||||
@@ -164,7 +164,8 @@ void Quake_Remove(QuakeRequest* req) {
|
||||
}
|
||||
|
||||
QuakeRequest* Quake_GetRequest(s16 idx) {
|
||||
QuakeRequest* req = sQuakeRequest + (idx & 3);
|
||||
QuakeRequest* req = &sQuakeRequest[idx & 3];
|
||||
|
||||
if (req->callbackIdx == 0) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -329,7 +330,7 @@ s16 Quake_Calc(Camera* camera, UnkQuakeCalcStruct* camData) {
|
||||
for (idx = 0; idx < ARRAY_COUNT(sQuakeRequest); idx++) {
|
||||
req = &sQuakeRequest[idx];
|
||||
if (req->callbackIdx != 0) {
|
||||
if (globalCtx->cameraCtx.activeCameraPtrs[req->camPtrIdx] == 0) {
|
||||
if (globalCtx->cameraPtrs[req->camPtrIdx] == 0) {
|
||||
osSyncPrintf(VT_COL(YELLOW, BLACK) "quake: stopped! 'coz camera [%d] killed!!\n" VT_RST,
|
||||
req->camPtrIdx);
|
||||
Quake_Remove(req);
|
||||
|
||||
+5
-8
@@ -1460,12 +1460,10 @@ void func_80095248(GraphicsContext* gfxCtx, u8 r, u8 g, u8 b) {
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sFillSetupDL);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, sFillSetupDL);
|
||||
gSPDisplayList(gfxCtx->overlay.p++, sFillSetupDL);
|
||||
gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f,
|
||||
(s32)gScreenHeight * 4.0f);
|
||||
gDPSetScissorFrac(gfxCtx->polyXlu.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f,
|
||||
(s32)gScreenHeight * 4.0f);
|
||||
gDPSetScissorFrac(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f,
|
||||
(s32)gScreenHeight * 4.0f);
|
||||
|
||||
gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f);
|
||||
gDPSetScissorFrac(gfxCtx->polyXlu.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f);
|
||||
gDPSetScissorFrac(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f);
|
||||
|
||||
gDPSetColorImage(gfxCtx->polyOpa.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, gfxCtx->curFrameBuffer);
|
||||
gDPSetColorImage(gfxCtx->polyOpa.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, gfxCtx->curFrameBuffer);
|
||||
@@ -1554,8 +1552,7 @@ void func_80095974(GraphicsContext* gfxCtx) {
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_rcp.c", 2503);
|
||||
|
||||
gSPDisplayList(gfxCtx->polyOpa.p++, sFillSetupDL);
|
||||
gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, (s32)gScreenWidth * 4.0f,
|
||||
(s32)gScreenHeight * 4.0f);
|
||||
gDPSetScissorFrac(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, 0, 0, gScreenWidth * 4.0f, gScreenHeight * 4.0f);
|
||||
gDPSetDepthImage(gfxCtx->polyOpa.p++, gZBuffer);
|
||||
gDPSetColorImage(gfxCtx->polyOpa.p++, G_IM_FMT_RGBA, G_IM_SIZ_16b, gScreenWidth, gfxCtx->curFrameBuffer);
|
||||
|
||||
|
||||
+6
-6
@@ -29,7 +29,7 @@ void (*sRoomDrawHandlers[])(GlobalContext* globalCtx, Room* room, u32 flags) = {
|
||||
func_80095D04,
|
||||
};
|
||||
|
||||
void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3) {
|
||||
void func_80095AA0(GlobalContext* globalCtx, Room* room, Input* arg2, UNK_TYPE arg3) {
|
||||
}
|
||||
|
||||
// Room Draw Polygon Type 0
|
||||
@@ -343,7 +343,7 @@ void func_80096680(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_room.c", 628);
|
||||
|
||||
camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0];
|
||||
camera = globalCtx->cameraPtrs[globalCtx->activeCamera];
|
||||
polygon1 = &room->mesh->polygon1;
|
||||
sp9C = (camera->unk_142 ^ 25) == 0;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
@@ -405,7 +405,7 @@ BgImage* func_80096A74(PolygonType1* polygon1, GlobalContext* globalCtx) {
|
||||
BgImage* bgImage;
|
||||
s32 i;
|
||||
|
||||
camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0];
|
||||
camera = globalCtx->cameraPtrs[globalCtx->activeCamera];
|
||||
camId = camera->unk_148;
|
||||
camId2 = func_80041C10(&globalCtx->colCtx, camId, 50)->unk_0E;
|
||||
if (camId2 >= 0) {
|
||||
@@ -449,7 +449,7 @@ void func_80096B6C(GlobalContext* globalCtx, Room* room, u32 flags) {
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_room.c", 752);
|
||||
|
||||
camera = globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0];
|
||||
camera = globalCtx->cameraPtrs[globalCtx->activeCamera];
|
||||
sp98 = (camera->unk_142 ^ 25) == 0;
|
||||
polygon1 = &room->mesh->polygon1;
|
||||
polygonDlist = SEGMENTED_TO_VIRTUAL(polygon1->dlist);
|
||||
@@ -576,8 +576,8 @@ u32 func_80096FE8(GlobalContext* globalCtx, RoomContext* roomCtx) {
|
||||
roomCtx->unk_30 = 0;
|
||||
roomCtx->status = 0;
|
||||
|
||||
if (gSaveContext.respawn_flag > 0) {
|
||||
nextRoomNum = gSaveContext.respawn[gSaveContext.respawn_flag - 1].room_index;
|
||||
if (gSaveContext.respawnFlag > 0) {
|
||||
nextRoomNum = gSaveContext.respawn[gSaveContext.respawnFlag - 1].roomIndex;
|
||||
} else {
|
||||
nextRoomNum = globalCtx->setupEntranceList[globalCtx->curSpawn].room;
|
||||
}
|
||||
|
||||
+17
-22
@@ -2,21 +2,17 @@
|
||||
#include <global.h>
|
||||
#include <PR/os_cont.h>
|
||||
|
||||
void Sample_Calc(SampleContext* this) {
|
||||
void Sample_HandleStateChange(SampleContext* this) {
|
||||
if (!~(this->state.input[0].press.in.button | ~START_BUTTON)) {
|
||||
SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext);
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
this->state.running = false;
|
||||
}
|
||||
}
|
||||
|
||||
// very close from matching, the only difference is the place of "mtx" in the stack
|
||||
#ifdef NON_MATCHING
|
||||
void Sample_Draw(SampleContext* this) {
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
||||
View* view = &this->view;
|
||||
Gfx* dispRefs[4];
|
||||
Mtx* mtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_sample.c", 62);
|
||||
|
||||
@@ -25,12 +21,14 @@ void Sample_Draw(SampleContext* this) {
|
||||
|
||||
func_80095248(gfxCtx, 0, 0, 0);
|
||||
|
||||
view->unk_120 = 7;
|
||||
view->flags = 1 | 2 | 4;
|
||||
func_800AAA50(view, 15);
|
||||
|
||||
mtx = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
func_80103D58(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD);
|
||||
if (1) {
|
||||
Mtx* mtx = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
func_80103D58(mtx, SREG(37), SREG(38), SREG(39), 1.0f, SREG(40), SREG(41), SREG(42));
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, mtx, G_MTX_LOAD);
|
||||
}
|
||||
|
||||
gfxCtx->polyOpa.p = Gfx_SetFog2(gfxCtx->polyOpa.p, 0xFF, 0xFF, 0xFF, 0, 0, 0);
|
||||
func_80093D18(gfxCtx);
|
||||
@@ -42,13 +40,10 @@ void Sample_Draw(SampleContext* this) {
|
||||
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_sample.c", 111);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sample/Sample_Draw.s")
|
||||
#endif
|
||||
|
||||
void Sample_Update(SampleContext* this) {
|
||||
void Sample_Main(SampleContext* this) {
|
||||
Sample_Draw(this);
|
||||
Sample_Calc(this);
|
||||
Sample_HandleStateChange(this);
|
||||
}
|
||||
|
||||
void Sample_Destroy(SampleContext* this) {
|
||||
@@ -57,21 +52,21 @@ void Sample_Destroy(SampleContext* this) {
|
||||
void Sample_SetupView(SampleContext* this) {
|
||||
View* view;
|
||||
GraphicsContext* gfxCtx;
|
||||
u32 v0[4];
|
||||
Viewport viewport;
|
||||
Vec3f v1;
|
||||
Vec3f v2;
|
||||
Vec3f v3;
|
||||
|
||||
view = &this->view;
|
||||
gfxCtx = this->state.gfxCtx;
|
||||
func_800AA278(view, gfxCtx);
|
||||
View_Init(view, gfxCtx);
|
||||
|
||||
// clang-format off
|
||||
v0[1] = SCREEN_HEIGHT; v0[3] = SCREEN_WIDTH;
|
||||
v0[0] = 0; v0[2] = 0;
|
||||
viewport.bottomY = SCREEN_HEIGHT; viewport.rightX = SCREEN_WIDTH;
|
||||
viewport.topY = 0; viewport.leftX = 0;
|
||||
// clang-format on
|
||||
|
||||
func_800AA4FC(view, &v0);
|
||||
View_SetViewport(view, &viewport);
|
||||
func_800AA460(view, 60, 10, 12800);
|
||||
|
||||
v1.x = 0;
|
||||
@@ -95,7 +90,7 @@ void Sample_LoadTitleStatic(SampleContext* this) {
|
||||
}
|
||||
|
||||
void Sample_Init(SampleContext* this) {
|
||||
this->state.main = Sample_Update;
|
||||
this->state.main = Sample_Main;
|
||||
this->state.destroy = Sample_Destroy;
|
||||
R_UPDATE_RATE = 1;
|
||||
Sample_SetupView(this);
|
||||
|
||||
+49
-49
@@ -44,7 +44,7 @@ void Object_InitBank(GlobalContext* globalCtx, ObjectContext* objectCtx) {
|
||||
if (globalCtx2->sceneNum == SCENE_SPOT00) {
|
||||
spaceSize = 1024000;
|
||||
} else if (globalCtx2->sceneNum == SCENE_GANON_DEMO) {
|
||||
if (gSaveContext.scene_setup_index != 4) {
|
||||
if (gSaveContext.sceneSetupIndex != 4) {
|
||||
spaceSize = 1177600;
|
||||
} else {
|
||||
spaceSize = 1024000;
|
||||
@@ -203,9 +203,9 @@ void func_80098508(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s32 linkAge;
|
||||
|
||||
globalCtx->linkActorEntry = linkEntry;
|
||||
globalCtx->linkAgeOnLoad = gSaveContext.link_age;
|
||||
globalCtx->linkAgeOnLoad = gSaveContext.linkAge;
|
||||
|
||||
linkAge = gSaveContext.link_age;
|
||||
linkAge = gSaveContext.linkAge;
|
||||
linkObjectId = gLinkObjectIds[linkAge];
|
||||
|
||||
gActorOverlayTable[linkEntry->id].initInfo->objectId = linkObjectId;
|
||||
@@ -261,7 +261,7 @@ void func_8009883C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
}
|
||||
|
||||
if (cmd->specialFiles.cUpElfMsgNum != 0) {
|
||||
globalCtx->cUpElfMsgs = func_800BFE5C(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
|
||||
globalCtx->cUpElfMsgs = Gameplay_LoadFile(globalCtx, &sNaviMsgFiles[cmd->specialFiles.cUpElfMsgNum - 1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,21 +362,21 @@ void func_80098CBC(GlobalContext* globalCtx, u8* nbTransitionActors) {
|
||||
|
||||
// Scene Command 0x0F: Light Setting List
|
||||
void func_80098CC8(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->nbLightSettings = cmd->lightSettingList.num;
|
||||
globalCtx->lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment);
|
||||
globalCtx->envCtx.nbLightSettings = cmd->lightSettingList.num;
|
||||
globalCtx->envCtx.lightSettingsList = SEGMENTED_TO_VIRTUAL(cmd->lightSettingList.segment);
|
||||
}
|
||||
|
||||
// Scene Command 0x11: Skybox Settings
|
||||
void func_80098D1C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyboxId = cmd->skyboxSettings.skyboxId;
|
||||
globalCtx->gloomySky = globalCtx->unk_10A3C = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->unk_10A42 = cmd->skyboxSettings.unk_06;
|
||||
globalCtx->envCtx.gloomySky = globalCtx->envCtx.unk_18 = cmd->skyboxSettings.unk_05;
|
||||
globalCtx->envCtx.unk_1E = cmd->skyboxSettings.unk_06;
|
||||
}
|
||||
|
||||
// Scene Command 0x12: Skybox Disables
|
||||
void func_80098D5C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->skyDisabled = cmd->skyboxDisables.unk_04;
|
||||
globalCtx->sunMoonDisabled = cmd->skyboxDisables.unk_05;
|
||||
globalCtx->envCtx.skyDisabled = cmd->skyboxDisables.unk_04;
|
||||
globalCtx->envCtx.sunMoonDisabled = cmd->skyboxDisables.unk_05;
|
||||
}
|
||||
|
||||
// Scene Command 0x10: Time Settings
|
||||
@@ -384,38 +384,38 @@ void func_80098D80(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
u32 dayTime;
|
||||
|
||||
if ((cmd->timeSettings.hour != 0xFF) && (cmd->timeSettings.min != 0xFF)) {
|
||||
gSaveContext.environment_time = gSaveContext.day_time =
|
||||
gSaveContext.environmentTime = gSaveContext.dayTime =
|
||||
((cmd->timeSettings.hour + (cmd->timeSettings.min / 60.0f)) * 60.0f) / 0.021972656f;
|
||||
}
|
||||
|
||||
if (cmd->timeSettings.unk_06 != 0xFF) {
|
||||
globalCtx->unk_10A26 = cmd->timeSettings.unk_06;
|
||||
globalCtx->envCtx.unk_02 = cmd->timeSettings.unk_06;
|
||||
} else {
|
||||
globalCtx->unk_10A26 = 0;
|
||||
globalCtx->envCtx.unk_02 = 0;
|
||||
}
|
||||
|
||||
if (gSaveContext.unk_1422 == 0) {
|
||||
D_8011FB40 = globalCtx->unk_10A26;
|
||||
D_8011FB40 = globalCtx->envCtx.unk_02;
|
||||
}
|
||||
|
||||
dayTime = gSaveContext.day_time;
|
||||
globalCtx->unk_10A28 = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.day_time;
|
||||
globalCtx->unk_10A2C = (Math_Coss(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.day_time;
|
||||
globalCtx->unk_10A30 = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f;
|
||||
dayTime = gSaveContext.dayTime;
|
||||
globalCtx->envCtx.unk_04.x = -(Math_Sins(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.dayTime;
|
||||
globalCtx->envCtx.unk_04.y = (Math_Coss(dayTime - 0x8000) * 120.0f) * 25.0f;
|
||||
dayTime = gSaveContext.dayTime;
|
||||
globalCtx->envCtx.unk_04.z = (Math_Coss(dayTime - 0x8000) * 20.0f) * 25.0f;
|
||||
|
||||
if (((globalCtx->unk_10A26 == 0) && (gSaveContext.cutscene_index < 0xFFF0)) ||
|
||||
(gSaveContext.entrance_index == 0x0604)) {
|
||||
gSaveContext.environment_time = gSaveContext.day_time;
|
||||
if ((gSaveContext.environment_time >= 0x2AAC) && (gSaveContext.environment_time < 0x4555)) {
|
||||
gSaveContext.environment_time = 0x3556;
|
||||
} else if ((gSaveContext.environment_time >= 0x4555) && (gSaveContext.environment_time < 0x5556)) {
|
||||
gSaveContext.environment_time = 0x5556;
|
||||
} else if ((gSaveContext.environment_time >= 0xAAAB) && (gSaveContext.environment_time < 0xB556)) {
|
||||
gSaveContext.environment_time = 0xB556;
|
||||
} else if ((gSaveContext.environment_time >= 0xC001) && (gSaveContext.environment_time < 0xCAAC)) {
|
||||
gSaveContext.environment_time = 0xCAAC;
|
||||
if (((globalCtx->envCtx.unk_02 == 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) ||
|
||||
(gSaveContext.entranceIndex == 0x0604)) {
|
||||
gSaveContext.environmentTime = gSaveContext.dayTime;
|
||||
if ((gSaveContext.environmentTime >= 0x2AAC) && (gSaveContext.environmentTime < 0x4555)) {
|
||||
gSaveContext.environmentTime = 0x3556;
|
||||
} else if ((gSaveContext.environmentTime >= 0x4555) && (gSaveContext.environmentTime < 0x5556)) {
|
||||
gSaveContext.environmentTime = 0x5556;
|
||||
} else if ((gSaveContext.environmentTime >= 0xAAAB) && (gSaveContext.environmentTime < 0xB556)) {
|
||||
gSaveContext.environmentTime = 0xB556;
|
||||
} else if ((gSaveContext.environmentTime >= 0xC001) && (gSaveContext.environmentTime < 0xCAAC)) {
|
||||
gSaveContext.environmentTime = 0xCAAC;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -426,10 +426,10 @@ void func_80099090(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
s8 temp2 = cmd->windSettings.unk_05;
|
||||
s8 temp3 = cmd->windSettings.unk_06;
|
||||
|
||||
globalCtx->unk_10ACC = temp1;
|
||||
globalCtx->unk_10ACE = temp2;
|
||||
globalCtx->unk_10AD0 = temp3;
|
||||
globalCtx->unk_10AD4 = cmd->windSettings.unk_07;
|
||||
globalCtx->envCtx.unk_A8 = temp1;
|
||||
globalCtx->envCtx.unk_AA = temp2;
|
||||
globalCtx->envCtx.unk_AC = temp3;
|
||||
globalCtx->envCtx.unk_B0 = cmd->windSettings.unk_07;
|
||||
}
|
||||
|
||||
// Scene Command 0x13: Exit List
|
||||
@@ -446,7 +446,7 @@ void func_80099140(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
globalCtx->soundCtx.musicSeq = cmd->soundSettings.musicSeq;
|
||||
globalCtx->soundCtx.nighttimeSFX = cmd->soundSettings.nighttimeSFX;
|
||||
|
||||
if (gSaveContext.seq_index == 0xFF) {
|
||||
if (gSaveContext.seqIndex == 0xFF) {
|
||||
Audio_SetBGM(cmd->soundSettings.bgmId | 0xF0000000);
|
||||
}
|
||||
}
|
||||
@@ -463,13 +463,13 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
SceneCmd** altHeaders;
|
||||
SceneCmd* altHeader;
|
||||
|
||||
osSyncPrintf("\n[ZU]sceneset age =[%X]", gSaveContext.link_age);
|
||||
osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutscene_index);
|
||||
osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.scene_setup_index);
|
||||
osSyncPrintf("\n[ZU]sceneset age =[%X]", gSaveContext.linkAge);
|
||||
osSyncPrintf("\n[ZU]sceneset time =[%X]", gSaveContext.cutsceneIndex);
|
||||
osSyncPrintf("\n[ZU]sceneset counter=[%X]", gSaveContext.sceneSetupIndex);
|
||||
|
||||
if (gSaveContext.scene_setup_index != 0) {
|
||||
if (gSaveContext.sceneSetupIndex != 0) {
|
||||
altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment);
|
||||
altHeader = altHeaders[gSaveContext.scene_setup_index - 1];
|
||||
altHeader = altHeaders[gSaveContext.sceneSetupIndex - 1];
|
||||
|
||||
if (altHeader != NULL) {
|
||||
Scene_ExecuteCommands(globalCtx, SEGMENTED_TO_VIRTUAL(altHeader));
|
||||
@@ -478,9 +478,9 @@ void func_800991A0(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
// Translates to: "COUGHH! THERE IS NO SPECIFIED DATAAAAA!"
|
||||
osSyncPrintf("\nげぼはっ! 指定されたデータがないでええっす!");
|
||||
|
||||
if (gSaveContext.scene_setup_index == 3) {
|
||||
if (gSaveContext.sceneSetupIndex == 3) {
|
||||
altHeaders = SEGMENTED_TO_VIRTUAL(cmd->altHeaders.segment);
|
||||
altHeader = altHeaders[gSaveContext.scene_setup_index - 2];
|
||||
altHeader = altHeaders[gSaveContext.sceneSetupIndex - 2];
|
||||
|
||||
// Translates to: "USING ADULT DAY DATA THERE!"
|
||||
osSyncPrintf("\nそこで、大人の昼データを使用するでええっす!!");
|
||||
@@ -507,20 +507,20 @@ void func_8009934C(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
// Scene Command 0x19: Misc. Settings (Camera & World Map Area)
|
||||
void func_800993C0(GlobalContext* globalCtx, SceneCmd* cmd) {
|
||||
YREG(15) = cmd->miscSettings.cameraMovement;
|
||||
gSaveContext.world_map_area = cmd->miscSettings.area;
|
||||
gSaveContext.worldMapArea = cmd->miscSettings.area;
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_SHOP1) || (globalCtx->sceneNum == SCENE_SYATEKIJYOU)) {
|
||||
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
|
||||
gSaveContext.world_map_area = 1;
|
||||
gSaveContext.worldMapArea = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (((globalCtx->sceneNum >= SCENE_SPOT00) && (globalCtx->sceneNum <= SCENE_GANON_TOU)) ||
|
||||
((globalCtx->sceneNum >= SCENE_ENTRA) && (globalCtx->sceneNum <= SCENE_SHRINE_R))) {
|
||||
if (gSaveContext.cutscene_index < 0xFFF0) {
|
||||
gSaveContext.world_map_area_data |= gBitFlags[gSaveContext.world_map_area];
|
||||
osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.world_map_area_data,
|
||||
gSaveContext.world_map_area);
|
||||
if (gSaveContext.cutsceneIndex < 0xFFF0) {
|
||||
gSaveContext.worldMapAreaData |= gBitFlags[gSaveContext.worldMapArea];
|
||||
osSyncPrintf("000 area_arrival=%x (%d)\n", gSaveContext.worldMapAreaData,
|
||||
gSaveContext.worldMapArea);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+817
-552
File diff suppressed because it is too large
Load Diff
@@ -15,14 +15,14 @@ void SkelAnime_AnimationType3Loaded(GlobalContext* globalCtx, AnimationEntryType
|
||||
void SkelAnime_AnimationType4Loaded(GlobalContext* globalCtx, AnimationEntryType4* entry);
|
||||
void SkelAnime_AnimationType5Loaded(GlobalContext* globalCtx, AnimationEntryType5* entry);
|
||||
|
||||
//.data
|
||||
// .data
|
||||
u32 D_8012A480 = 0;
|
||||
static AnimationEntryCallback sAnimationLoadDone[] = {
|
||||
&SkelAnime_LinkAnimetionLoaded, &SkelAnime_AnimationType1Loaded, &SkelAnime_AnimationType2Loaded,
|
||||
&SkelAnime_AnimationType3Loaded, &SkelAnime_AnimationType4Loaded, &SkelAnime_AnimationType5Loaded,
|
||||
};
|
||||
|
||||
//.bss
|
||||
// .bss
|
||||
u32 D_801600B0;
|
||||
|
||||
/*
|
||||
|
||||
+297
-272
@@ -2,154 +2,165 @@
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
volatile u32 D_8012ABF0 = 1;
|
||||
volatile u32 D_8012ABF0 = true;
|
||||
|
||||
// TODO replace UnkViewStruct with Viewport and match with that instead
|
||||
void func_800AA190(UnkViewStruct* arg0, Viewport* viewport) {
|
||||
s32 xLen;
|
||||
s32 yLen;
|
||||
void View_ViewportToVp(Vp* dest, Viewport* src) {
|
||||
s32 width = src->rightX - src->leftX;
|
||||
s32 height = src->bottomY - src->topY;
|
||||
|
||||
xLen = viewport->rightX - viewport->leftX;
|
||||
yLen = viewport->bottomY - viewport->topY;
|
||||
arg0->unk_0 = (xLen * 2);
|
||||
arg0->unk_2 = (yLen * 2);
|
||||
arg0->unk_4 = 0x01FF;
|
||||
arg0->unk_6 = 0;
|
||||
arg0->unk_8 = (((viewport->leftX * 2) + xLen) * 2);
|
||||
arg0->unk_A = (((viewport->topY * 2) + yLen) * 2);
|
||||
arg0->unk_C = 0x01FF;
|
||||
arg0->unk_E = 0;
|
||||
dest->vp.vscale[0] = width * 2;
|
||||
dest->vp.vscale[1] = height * 2;
|
||||
dest->vp.vscale[2] = 0x01FF;
|
||||
dest->vp.vscale[3] = 0;
|
||||
dest->vp.vtrans[0] = ((src->leftX * 2) + width) * 2;
|
||||
dest->vp.vtrans[1] = ((src->topY * 2) + height) * 2;
|
||||
dest->vp.vtrans[2] = 0x01FF;
|
||||
dest->vp.vtrans[3] = 0;
|
||||
}
|
||||
|
||||
View* func_800AA1F8(GraphicsContext* gfxCtx) {
|
||||
View* View_New(GraphicsContext* gfxCtx) {
|
||||
View* view = SystemArena_MallocDebug(sizeof(View), "../z_view.c", 285);
|
||||
|
||||
if (view != NULL) {
|
||||
func_80106860(view, 0, sizeof(View)); // TODO prototype this
|
||||
func_800AA278(view, gfxCtx);
|
||||
func_80106860(view, 0, sizeof(View)); // memset
|
||||
View_Init(view, gfxCtx);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
void func_800AA250(View* view) {
|
||||
void View_Free(View* view) {
|
||||
SystemArena_FreeDebug(view, "../z_view.c", 297);
|
||||
}
|
||||
|
||||
void func_800AA278(View* view, GraphicsContext* gfxCtx) {
|
||||
void View_Init(View* view, GraphicsContext* gfxCtx) {
|
||||
view->gfxCtx = gfxCtx;
|
||||
view->viewport.topY = 0;
|
||||
view->viewport.bottomY = 240;
|
||||
view->viewport.bottomY = SCREEN_HEIGHT;
|
||||
view->viewport.leftX = 0;
|
||||
view->viewport.rightX = 320;
|
||||
view->magic = 0x56494557; //"VIEW"
|
||||
view->viewport.rightX = SCREEN_WIDTH;
|
||||
view->magic = 0x56494557; // "VIEW"
|
||||
view->eye.x = 0.0f;
|
||||
view->eye.y = 0.0f;
|
||||
view->unk_24 = 1.0f;
|
||||
view->fieldOfView = 60.0f;
|
||||
view->fogDistance = 10.0f;
|
||||
view->zDepth = 12800.0f;
|
||||
view->scale = 1.0f;
|
||||
view->fovy = 60.0f;
|
||||
view->near = 10.0f;
|
||||
view->far = 12800.0f;
|
||||
view->unk_34.x = 0.0f;
|
||||
view->unk_40.x = 0.0f;
|
||||
view->unk_40.y = 1.0f;
|
||||
view->unk_40.z = 0.0f;
|
||||
view->eye.z = -1.0f;
|
||||
|
||||
if (D_8012ABF0 != 0) {
|
||||
if (D_8012ABF0) {
|
||||
if (&D_8012ABF0) {}
|
||||
osSyncPrintf("\nview: initialize ---\n", gfxCtx, view);
|
||||
D_8012ABF0 = 0;
|
||||
osSyncPrintf("\nview: initialize ---\n");
|
||||
D_8012ABF0 = false;
|
||||
}
|
||||
|
||||
view->unk_124 = 0;
|
||||
view->unk_120 = 7;
|
||||
view->flags = 1 | 2 | 4;
|
||||
func_800AA7B8(view);
|
||||
}
|
||||
|
||||
void func_800AA358(View* view, Vec3f* vec1, Vec3f* vec2, Vec3f* vec3) {
|
||||
if (vec1->x == vec2->x && vec1->z == vec2->z) {
|
||||
vec1->x += 0.1f;
|
||||
void func_800AA358(View* view, Vec3f* eye, Vec3f* vec2, Vec3f* vec3) {
|
||||
if (eye->x == vec2->x && eye->z == vec2->z) {
|
||||
eye->x += 0.1f;
|
||||
}
|
||||
view->eye = *vec1;
|
||||
|
||||
view->eye = *eye;
|
||||
view->unk_34 = *vec2;
|
||||
view->unk_40 = *vec3;
|
||||
view->unk_120 |= 1;
|
||||
view->flags |= 1;
|
||||
}
|
||||
|
||||
void func_800AA3F0(View* view, Vec3f* vec1, Vec3f* vec2, Vec3f* vec3) {
|
||||
view->eye = *vec1;
|
||||
void func_800AA3F0(View* view, Vec3f* eye, Vec3f* vec2, Vec3f* vec3) {
|
||||
view->eye = *eye;
|
||||
view->unk_34 = *vec2;
|
||||
view->unk_40 = *vec3;
|
||||
}
|
||||
|
||||
void func_800AA43C(View* view, f32 arg1) {
|
||||
view->unk_120 |= 4;
|
||||
view->unk_24 = arg1;
|
||||
void View_SetScale(View* view, f32 scale) {
|
||||
view->flags |= 4;
|
||||
view->scale = scale;
|
||||
}
|
||||
|
||||
void func_800AA454(View* view, f32* arg1) {
|
||||
*arg1 = view->unk_24;
|
||||
void View_GetScale(View* view, f32* scale) {
|
||||
*scale = view->scale;
|
||||
}
|
||||
|
||||
void func_800AA460(View* view, f32 fieldOfView, f32 fogDistance, f32 zDepth) {
|
||||
view->fieldOfView = fieldOfView;
|
||||
view->fogDistance = fogDistance;
|
||||
view->zDepth = zDepth;
|
||||
view->unk_120 |= 4;
|
||||
void func_800AA460(View* view, f32 fovy, f32 near, f32 far) {
|
||||
view->fovy = fovy;
|
||||
view->near = near;
|
||||
view->far = far;
|
||||
view->flags |= 4;
|
||||
}
|
||||
|
||||
void func_800AA48C(View* view, f32* fieldOfView, f32* fogDistance, f32* zDepth) {
|
||||
*fieldOfView = view->fieldOfView;
|
||||
*fogDistance = view->fogDistance;
|
||||
*zDepth = view->zDepth;
|
||||
void func_800AA48C(View* view, f32* fovy, f32* near, f32* far) {
|
||||
*fovy = view->fovy;
|
||||
*near = view->near;
|
||||
*far = view->far;
|
||||
}
|
||||
|
||||
void func_800AA4A8(View* view, f32 fieldOfView, f32 fogDistance, f32 zDepth) {
|
||||
view->fieldOfView = fieldOfView;
|
||||
view->fogDistance = fogDistance;
|
||||
view->zDepth = zDepth;
|
||||
view->unk_120 |= 8;
|
||||
view->unk_24 = 1.0f;
|
||||
void func_800AA4A8(View* view, f32 fovy, f32 near, f32 far) {
|
||||
view->fovy = fovy;
|
||||
view->near = near;
|
||||
view->far = far;
|
||||
view->flags |= 8;
|
||||
view->scale = 1.0f;
|
||||
}
|
||||
|
||||
void func_800AA4E0(View* view, f32* fieldOfView, f32* fogDistance, f32* zDepth) {
|
||||
*fieldOfView = view->fieldOfView;
|
||||
*fogDistance = view->fogDistance;
|
||||
*zDepth = view->zDepth;
|
||||
void func_800AA4E0(View* view, f32* fovy, f32* near, f32* far) {
|
||||
*fovy = view->fovy;
|
||||
*near = view->near;
|
||||
*far = view->far;
|
||||
}
|
||||
|
||||
void func_800AA4FC(View* view, Viewport* viewport) {
|
||||
void View_SetViewport(View* view, Viewport* viewport) {
|
||||
view->viewport = *viewport;
|
||||
view->unk_120 |= 2;
|
||||
view->flags |= 2;
|
||||
}
|
||||
|
||||
void func_800AA52C(View* view, Viewport* viewport) {
|
||||
void View_GetViewport(View* view, Viewport* viewport) {
|
||||
*viewport = view->viewport;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc, zeros optimised out
|
||||
void func_800AA550(View* view) {
|
||||
s32 phi_v1;
|
||||
s32 phi_v1_2;
|
||||
s32 varY;
|
||||
s32 varX;
|
||||
s32 pad;
|
||||
s32 ulx;
|
||||
s32 uly;
|
||||
s32 lrx;
|
||||
s32 lry;
|
||||
GraphicsContext* gfxCtx;
|
||||
s32 temp_a0;
|
||||
Gfx* dispRefs[4];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
phi_v1 = func_800B38FC();
|
||||
if (phi_v1 < 0) {
|
||||
phi_v1 = 0;
|
||||
|
||||
varY = func_800B38FC();
|
||||
|
||||
varX = -1; // The following is optimized to varX = 0 but affects codegen
|
||||
|
||||
if (varX < 0) {
|
||||
varX = 0;
|
||||
}
|
||||
if (phi_v1 >= 0x79) {
|
||||
phi_v1 = 0x78;
|
||||
if (varX > SCREEN_WIDTH / 2) {
|
||||
varX = SCREEN_WIDTH / 2;
|
||||
}
|
||||
ulx = view->viewport.leftX + 0;
|
||||
uly = view->viewport.topY + phi_v1;
|
||||
lrx = view->viewport.rightX - 0;
|
||||
lry = view->viewport.bottomY - phi_v1;
|
||||
|
||||
if (varY < 0) {
|
||||
varY = 0;
|
||||
}
|
||||
if (varY > SCREEN_HEIGHT / 2) {
|
||||
varY = SCREEN_HEIGHT / 2;
|
||||
}
|
||||
|
||||
ulx = view->viewport.leftX + varX;
|
||||
uly = view->viewport.topY + varY;
|
||||
lrx = view->viewport.rightX - varX;
|
||||
lry = view->viewport.bottomY - varY;
|
||||
|
||||
if (ulx < 0) {
|
||||
__assert("ulx >= 0", "../z_view.c", 454);
|
||||
}
|
||||
@@ -162,27 +173,27 @@ void func_800AA550(View* view) {
|
||||
if (lry > SCREEN_HEIGHT) {
|
||||
__assert("lry <= SCREEN_HT", "../z_view.c", 457);
|
||||
}
|
||||
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 459);
|
||||
|
||||
gDPPipeSync(gfxCtx->polyOpa.p++);
|
||||
gDPSetScissor(gfxCtx->polyOpa.p++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry);
|
||||
gDPPipeSync(gfxCtx->polyXlu.p++);
|
||||
gDPSetScissor(gfxCtx->polyXlu.p++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry);
|
||||
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 472);
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AA550.s")
|
||||
#endif
|
||||
|
||||
void func_800AA76C(View* view, f32 arg1, f32 arg2, f32 arg3) {
|
||||
view->unk_E8.x = arg1;
|
||||
view->unk_E8.y = arg2;
|
||||
view->unk_E8.z = arg3;
|
||||
void func_800AA76C(View* view, f32 x, f32 y, f32 z) {
|
||||
view->unk_E8.x = x;
|
||||
view->unk_E8.y = y;
|
||||
view->unk_E8.z = z;
|
||||
}
|
||||
|
||||
void func_800AA78C(View* view, f32 arg1, f32 arg2, f32 arg3) {
|
||||
view->unk_F4.x = arg1;
|
||||
view->unk_F4.y = arg2;
|
||||
view->unk_F4.z = arg3;
|
||||
void func_800AA78C(View* view, f32 x, f32 y, f32 z) {
|
||||
view->unk_F4.x = x;
|
||||
view->unk_F4.y = y;
|
||||
view->unk_F4.z = z;
|
||||
}
|
||||
|
||||
void func_800AA7AC(View* view, f32 arg1) {
|
||||
@@ -218,7 +229,7 @@ void func_800AA840(View* view, Vec3f vec1, Vec3f vec2, f32 arg3) {
|
||||
}
|
||||
|
||||
s32 func_800AA890(View* view, Mtx* mtx) {
|
||||
MtxF mtxF;
|
||||
MtxF mf;
|
||||
|
||||
if (view->unk_100 == 0.0f) {
|
||||
return 0;
|
||||
@@ -235,21 +246,24 @@ s32 func_800AA890(View* view, Mtx* mtx) {
|
||||
view->unk_110.y += ((view->unk_F4.y - view->unk_110.y) * view->unk_100);
|
||||
view->unk_110.z += ((view->unk_F4.z - view->unk_110.z) * view->unk_100);
|
||||
}
|
||||
Matrix_MtxToMtxF(mtx, &mtxF);
|
||||
Matrix_Put(&mtxF);
|
||||
Matrix_RotateX(view->unk_104.x, 1);
|
||||
Matrix_RotateY(view->unk_104.y, 1);
|
||||
Matrix_RotateZ(view->unk_104.z, 1);
|
||||
|
||||
Matrix_MtxToMtxF(mtx, &mf);
|
||||
Matrix_Put(&mf);
|
||||
Matrix_RotateX(view->unk_104.x, MTXMODE_APPLY);
|
||||
Matrix_RotateY(view->unk_104.y, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(view->unk_104.z, MTXMODE_APPLY);
|
||||
Matrix_Scale(view->unk_110.x, view->unk_110.y, view->unk_110.z, MTXMODE_APPLY);
|
||||
Matrix_RotateZ(-view->unk_104.z, 1);
|
||||
Matrix_RotateY(-view->unk_104.y, 1);
|
||||
Matrix_RotateX(-view->unk_104.x, 1);
|
||||
Matrix_RotateZ(-view->unk_104.z, MTXMODE_APPLY);
|
||||
Matrix_RotateY(-view->unk_104.y, MTXMODE_APPLY);
|
||||
Matrix_RotateX(-view->unk_104.x, MTXMODE_APPLY);
|
||||
Matrix_ToMtx(mtx, "../z_view.c", 566);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void func_800AAA50(View* view, s32 arg1) {
|
||||
arg1 = (view->unk_120 & arg1) | arg1 >> 4;
|
||||
arg1 = (view->flags & arg1) | arg1 >> 4;
|
||||
|
||||
if (arg1 & 8) {
|
||||
func_800AB0A8(view);
|
||||
} else {
|
||||
@@ -257,91 +271,99 @@ void func_800AAA50(View* view, s32 arg1) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// Just one stack var
|
||||
s32 func_800AAA9C(View* view) {
|
||||
s32 pad;
|
||||
s32 pad1;
|
||||
s32 ylen;
|
||||
Viewport* viewport;
|
||||
f32 aspect;
|
||||
s32 width;
|
||||
s32 height;
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
MtxF* viewing;
|
||||
Gfx* dispRefs[6];
|
||||
s32 xlen;
|
||||
Mtx* viewing;
|
||||
GraphicsContext* gfxCtx;
|
||||
s32 i;
|
||||
MtxF mtxF;
|
||||
MtxF mtxFv;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 596);
|
||||
viewport = Graph_Alloc(gfxCtx, sizeof(Viewport));
|
||||
LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 601);
|
||||
func_800AA190(viewport, &view->viewport);
|
||||
view->unk_50 = *viewport;
|
||||
|
||||
vp = Graph_Alloc(gfxCtx, sizeof(Vp));
|
||||
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 601);
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
func_800AA550(view);
|
||||
|
||||
gSPViewport(gfxCtx->polyOpa.p++, viewport);
|
||||
gSPViewport(gfxCtx->polyXlu.p++, viewport);
|
||||
gSPViewport(gfxCtx->polyOpa.p++, vp);
|
||||
gSPViewport(gfxCtx->polyXlu.p++, vp);
|
||||
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 616);
|
||||
view->unk_E0 = projection;
|
||||
xlen = view->viewport.rightX - view->viewport.leftX;
|
||||
ylen = view->viewport.bottomY - view->viewport.topY;
|
||||
if (HREG(80) == 0xB) {
|
||||
if (HREG(94) != 0xB) {
|
||||
HREG(94) = 0xB;
|
||||
HREG(83) = 0x3C;
|
||||
HREG(84) = 0x3415;
|
||||
HREG(85) = 0xA;
|
||||
HREG(86) = 0x3200;
|
||||
HREG(87) = 0x64;
|
||||
view->projectionPtr = projection;
|
||||
|
||||
width = view->viewport.rightX - view->viewport.leftX;
|
||||
height = view->viewport.bottomY - view->viewport.topY;
|
||||
aspect = (f32)width / (f32)height;
|
||||
|
||||
if (HREG(80) == 11) {
|
||||
if (HREG(94) != 11) {
|
||||
HREG(94) = 11;
|
||||
HREG(83) = 60;
|
||||
HREG(84) = 13333;
|
||||
HREG(85) = 10;
|
||||
HREG(86) = 12800;
|
||||
HREG(87) = 100;
|
||||
}
|
||||
guPerspective(projection, &view->unk_11C, HREG(83), HREG(84) / 10000.0f, HREG(85), HREG(86), HREG(87) / 100.0f);
|
||||
guPerspective(projection, &view->normal, HREG(83), HREG(84) / 10000.0f, HREG(85), HREG(86), HREG(87) / 100.0f);
|
||||
} else {
|
||||
guPerspective(projection, &view->unk_11C, view->fieldOfView, (f32)xlen / (f32)ylen, view->fogDistance,
|
||||
view->zDepth, view->unk_24);
|
||||
guPerspective(projection, &view->normal, view->fovy, aspect, view->near, view->far, view->scale);
|
||||
}
|
||||
|
||||
if (QREG(88) & 1) {
|
||||
osSyncPrintf("fovy %f near %f far %f scale %f aspect %f normal %08x\n", view->fieldOfView, view->fogDistance,
|
||||
view->zDepth, view->unk_24, (f32)xlen / (f32)ylen, view->unk_11C);
|
||||
Matrix_MtxToMtxF(projection, &mtxF);
|
||||
s32 i;
|
||||
MtxF mf;
|
||||
|
||||
osSyncPrintf("fovy %f near %f far %f scale %f aspect %f normal %08x\n", view->fovy, view->near, view->far,
|
||||
view->scale, aspect, view->normal);
|
||||
|
||||
Matrix_MtxToMtxF(projection, &mf);
|
||||
osSyncPrintf("projection\n");
|
||||
for (i = 0; i < 4; i++) {
|
||||
osSyncPrintf(" %f %f %f %f\n", mtxF.mf[i][0], mtxF.mf[i][1], mtxF.mf[i][2],
|
||||
mtxF.mf[i][3]);
|
||||
osSyncPrintf(" %f %f %f %f\n", mf.mf[i][0], mf.mf[i][1], mf.mf[i][2], mf.mf[i][3]);
|
||||
}
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
view->unk_60 = *projection;
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
func_800AA890(view, projection);
|
||||
|
||||
gSPPerspNormalize(gfxCtx->polyOpa.p++, view->unk_11C);
|
||||
gSPPerspNormalize(gfxCtx->polyOpa.p++, view->normal);
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPPerspNormalize(gfxCtx->polyXlu.p++, view->unk_11C);
|
||||
gSPPerspNormalize(gfxCtx->polyXlu.p++, view->normal);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
viewing = Graph_Alloc(gfxCtx, sizeof(MtxF));
|
||||
viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667);
|
||||
view->unk_E4 = viewing;
|
||||
view->viewingPtr = viewing;
|
||||
|
||||
if (view->eye.x == view->unk_34.x && view->eye.y == view->unk_34.y && view->eye.z == view->unk_34.z) {
|
||||
view->eye.x += 1.0f;
|
||||
view->eye.y += 1.0f;
|
||||
view->eye.z += 1.0f;
|
||||
}
|
||||
|
||||
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
|
||||
func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z,
|
||||
view->unk_40.x, view->unk_40.y, view->unk_40.z);
|
||||
view->unk_A0 = *viewing;
|
||||
|
||||
view->viewing = *viewing;
|
||||
|
||||
if (QREG(88) & 2) {
|
||||
Matrix_MtxToMtxF(view->unk_E4, &mtxFv);
|
||||
s32 i;
|
||||
MtxF mf;
|
||||
|
||||
Matrix_MtxToMtxF(view->viewingPtr, &mf);
|
||||
osSyncPrintf("viewing\n");
|
||||
for (i = 0; i < 4; i++) {
|
||||
osSyncPrintf(" %f %f %f %f\n", mtxFv.mf[i][0], mtxFv.mf[i][1], mtxFv.mf[i][2],
|
||||
mtxFv.mf[i][3]);
|
||||
osSyncPrintf(" %f %f %f %f\n", mf.mf[i][0], mf.mf[i][1], mf.mf[i][2], mf.mf[i][3]);
|
||||
}
|
||||
osSyncPrintf("\n");
|
||||
}
|
||||
@@ -350,224 +372,227 @@ s32 func_800AAA9C(View* view) {
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
|
||||
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 711);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AAA9C.s")
|
||||
#endif
|
||||
|
||||
s32 func_800AB0A8(View* view) {
|
||||
Viewport* viewport;
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
s32 pad;
|
||||
s32 pad1;
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[3];
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 726);
|
||||
viewport = Graph_Alloc(gfxCtx, sizeof(Viewport));
|
||||
LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 730);
|
||||
func_800AA190(viewport, &view->viewport);
|
||||
view->unk_50 = *viewport;
|
||||
|
||||
vp = Graph_Alloc(gfxCtx, sizeof(Vp));
|
||||
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 730);
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
func_800AA550(view);
|
||||
|
||||
gSPViewport(gfxCtx->polyOpa.p++, viewport);
|
||||
gSPViewport(gfxCtx->polyXlu.p++, viewport);
|
||||
gSPViewport(gfxCtx->overlay.p++, viewport);
|
||||
gSPViewport(gfxCtx->polyOpa.p++, vp);
|
||||
gSPViewport(gfxCtx->polyXlu.p++, vp);
|
||||
gSPViewport(gfxCtx->overlay.p++, vp);
|
||||
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 744);
|
||||
view->unk_E0 = projection;
|
||||
func_801045A4(projection, -(f32)(s32)gScreenWidth * 0.5f, (f32)(s32)gScreenWidth * 0.5f,
|
||||
-(f32)(s32)gScreenHeight * 0.5f, (f32)(s32)gScreenHeight * 0.5f, view->fogDistance, view->zDepth,
|
||||
view->unk_24);
|
||||
view->projectionPtr = projection;
|
||||
|
||||
view->unk_60 = *projection;
|
||||
func_801045A4(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f,
|
||||
(f32)gScreenHeight * 0.5f, view->near, view->far, view->scale);
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
gSPMatrix(gfxCtx->polyOpa.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 762);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// saved registers allocated differently, everything else is OK
|
||||
s32 func_800AB2C4(View* view) {
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
f32 pad;
|
||||
f32 pad1;
|
||||
Viewport* viewport;
|
||||
Gfx* dispRefs[4];
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
if (1) {} // Necessary to match
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 777);
|
||||
viewport = Graph_Alloc(gfxCtx, sizeof(Viewport));
|
||||
LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 781);
|
||||
func_800AA190(viewport, &view->viewport);
|
||||
view->unk_50 = *viewport;
|
||||
|
||||
vp = Graph_Alloc(gfxCtx, sizeof(Vp));
|
||||
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 781);
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetScissor(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY,
|
||||
view->viewport.rightX, view->viewport.bottomY);
|
||||
gSPViewport(gfxCtx->overlay.p++, viewport);
|
||||
gSPViewport(gfxCtx->overlay.p++, vp);
|
||||
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 791);
|
||||
view->unk_E0 = projection;
|
||||
func_801045A4(projection, -(f32)(s32)gScreenWidth * 0.5f, (f32)(s32)gScreenWidth * 0.5f,
|
||||
-(f32)(s32)gScreenHeight * 0.5f, (f32)(s32)gScreenHeight * 0.5f, view->fogDistance, view->zDepth,
|
||||
view->unk_24);
|
||||
view->unk_60 = *projection;
|
||||
view->projectionPtr = projection;
|
||||
|
||||
func_801045A4(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f,
|
||||
(f32)gScreenHeight * 0.5f, view->near, view->far, view->scale);
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
gSPMatrix(gfxCtx->overlay.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 801);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB2C4.s")
|
||||
#endif
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// regalloc
|
||||
s32 func_800AB560(View* view) {
|
||||
s32 pad;
|
||||
s32 pad1;
|
||||
s32 pad2;
|
||||
s32 pad3;
|
||||
GraphicsContext* gfxCtx;
|
||||
Viewport* viewport;
|
||||
Mtx* projection;
|
||||
MtxF* viewing;
|
||||
Gfx* dispRefs[6];
|
||||
s32 pad[2];
|
||||
f32 aspect;
|
||||
s32 width;
|
||||
s32 height;
|
||||
Vp* vp;
|
||||
Mtx* projection;
|
||||
Mtx* viewing;
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, "../z_view.c", 816);
|
||||
|
||||
viewport = Graph_Alloc(gfxCtx, sizeof(Viewport));
|
||||
LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 821);
|
||||
vp = Graph_Alloc(gfxCtx, sizeof(Vp));
|
||||
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 821);
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
func_800AA190(viewport, &view->viewport);
|
||||
view->unk_50 = *viewport;
|
||||
gDPPipeSync(gfxCtx->overlay.p++);
|
||||
gDPSetScissor(gfxCtx->overlay.p++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY,
|
||||
view->viewport.rightX, view->viewport.bottomY);
|
||||
gSPViewport(gfxCtx->overlay.p++, viewport);
|
||||
gSPViewport(gfxCtx->overlay.p++, vp);
|
||||
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 833);
|
||||
view->projectionPtr = projection;
|
||||
|
||||
view->unk_E0 = projection;
|
||||
guPerspective(projection, &view->unk_11C, view->fieldOfView,
|
||||
(f32)(view->viewport.rightX - view->viewport.leftX) /
|
||||
(f32)(view->viewport.bottomY - view->viewport.topY),
|
||||
view->fogDistance, view->zDepth, view->unk_24);
|
||||
view->unk_60 = *projection;
|
||||
gSPPerspNormalize(gfxCtx->overlay.p++, view->unk_11C);
|
||||
width = view->viewport.rightX - view->viewport.leftX;
|
||||
height = view->viewport.bottomY - view->viewport.topY;
|
||||
|
||||
aspect = (f32)width / (f32)height;
|
||||
guPerspective(projection, &view->normal, view->fovy, aspect, view->near, view->far, view->scale);
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
gSPPerspNormalize(gfxCtx->overlay.p++, view->normal);
|
||||
gSPMatrix(gfxCtx->overlay.p++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
|
||||
viewing = Graph_Alloc(gfxCtx, sizeof(MtxF));
|
||||
viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 848);
|
||||
view->viewingPtr = viewing;
|
||||
|
||||
view->unk_E4 = viewing;
|
||||
if (view->eye.x == view->unk_34.x && view->eye.y == view->unk_34.y && view->eye.z == view->unk_34.z) {
|
||||
view->eye.x += 1.0f;
|
||||
view->eye.y += 1.0f;
|
||||
view->eye.z += 1.0f;
|
||||
}
|
||||
|
||||
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
|
||||
func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z,
|
||||
view->unk_40.x, view->unk_40.y, view->unk_40.z);
|
||||
view->unk_A0 = *viewing;
|
||||
|
||||
view->viewing = *viewing;
|
||||
|
||||
gSPMatrix(gfxCtx->overlay.p++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
|
||||
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, "../z_view.c", 871);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_view/func_800AB560.s")
|
||||
#endif
|
||||
|
||||
s32 func_800AB944(View* view) {
|
||||
Gfx* dispRefs[5];
|
||||
|
||||
Graph_OpenDisps(dispRefs, view->gfxCtx, "../z_view.c", 878);
|
||||
|
||||
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
|
||||
func_80101E34(view->unk_E4, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z,
|
||||
view->unk_40.x, view->unk_40.y, view->unk_40.z);
|
||||
func_80101E34(view->viewingPtr, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y,
|
||||
view->unk_34.z, view->unk_40.x, view->unk_40.y, view->unk_40.z);
|
||||
|
||||
Graph_CloseDisps(dispRefs, view->gfxCtx, "../z_view.c", 886);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
// saved register usage is wrong, relatively minor reorderings, regalloc
|
||||
s32 func_800AB9EC(View* view, s32 arg1, Gfx** p) {
|
||||
Viewport* viewport;
|
||||
Mtx* projection;
|
||||
Mtx* projection2;
|
||||
MtxF* viewing;
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* pLocal;
|
||||
s32 func_800AB9EC(View* view, s32 arg1, Gfx** gfxp) {
|
||||
GraphicsContext* gfxCtx = view->gfxCtx;
|
||||
Gfx* gfx = *gfxp;
|
||||
|
||||
arg1 = (view->flags & arg1) | arg1 >> 4;
|
||||
|
||||
gfxCtx = view->gfxCtx;
|
||||
pLocal = *p;
|
||||
arg1 = (view->unk_120 & arg1) | arg1 >> 4;
|
||||
if (arg1 & 2) {
|
||||
viewport = Graph_Alloc(view->gfxCtx, sizeof(Viewport));
|
||||
LogUtils_CheckNullPointer("vp", viewport, "../z_view.c", 910);
|
||||
func_800AA190(viewport, &view->viewport);
|
||||
Vp* vp = Graph_Alloc(view->gfxCtx, sizeof(Vp));
|
||||
LogUtils_CheckNullPointer("vp", vp, "../z_view.c", 910);
|
||||
View_ViewportToVp(vp, &view->viewport);
|
||||
view->vp = *vp;
|
||||
|
||||
view->unk_50 = *viewport;
|
||||
|
||||
gDPPipeSync(pLocal++);
|
||||
gDPSetScissor(pLocal++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY, view->viewport.rightX,
|
||||
gDPPipeSync(gfx++);
|
||||
gDPSetScissor(gfx++, G_SC_NON_INTERLACE, view->viewport.leftX, view->viewport.topY, view->viewport.rightX,
|
||||
view->viewport.bottomY);
|
||||
gSPViewport(pLocal++, viewport);
|
||||
gSPViewport(gfx++, vp);
|
||||
}
|
||||
|
||||
if (arg1 & 8) {
|
||||
projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 921);
|
||||
view->unk_E0 = projection;
|
||||
func_801045A4(projection, -(f32)(s32)gScreenWidth * 0.5f, (f32)(s32)gScreenWidth * 0.5f,
|
||||
-(f32)(s32)gScreenHeight * 0.5f, (f32)(s32)gScreenHeight * 0.5f, view->fogDistance, view->zDepth,
|
||||
view->unk_24);
|
||||
view->projectionPtr = projection;
|
||||
|
||||
view->unk_60 = *projection;
|
||||
func_801045A4(projection, -(f32)gScreenWidth * 0.5f, (f32)gScreenWidth * 0.5f, -(f32)gScreenHeight * 0.5f,
|
||||
(f32)gScreenHeight * 0.5f, view->near, view->far, view->scale);
|
||||
|
||||
gSPMatrix(pLocal++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
view->projection = *projection;
|
||||
|
||||
gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
} else if (arg1 & 6) {
|
||||
projection2 = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection2, "../z_view.c", 932);
|
||||
view->unk_E0 = projection2;
|
||||
guPerspective(projection2, &view->unk_11C, view->fieldOfView,
|
||||
(f32)(view->viewport.rightX - view->viewport.leftX) /
|
||||
(f32)(view->viewport.bottomY - view->viewport.topY),
|
||||
view->fogDistance, view->zDepth, view->unk_24);
|
||||
s32 width;
|
||||
s32 height;
|
||||
Mtx* projection = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("projection", projection, "../z_view.c", 932);
|
||||
view->projectionPtr = projection;
|
||||
|
||||
view->unk_60 = *projection2;
|
||||
width = view->viewport.rightX - view->viewport.leftX;
|
||||
height = view->viewport.bottomY - view->viewport.topY;
|
||||
|
||||
gSPPerspNormalize(pLocal++, view->unk_11C);
|
||||
gSPMatrix(pLocal++, projection2, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
guPerspective(projection, &view->normal, view->fovy, (f32)width / (f32)height, view->near, view->far,
|
||||
view->scale);
|
||||
|
||||
view->projection = *projection;
|
||||
|
||||
gSPPerspNormalize(gfx++, view->normal);
|
||||
gSPMatrix(gfx++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
}
|
||||
|
||||
if (arg1 & 1) {
|
||||
viewing = Graph_Alloc(gfxCtx, sizeof(MtxF));
|
||||
Mtx* viewing = Graph_Alloc(gfxCtx, sizeof(Mtx));
|
||||
LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 948);
|
||||
view->unk_E4 = viewing;
|
||||
view->viewingPtr = viewing;
|
||||
|
||||
func_800ABE74(view->eye.x, view->eye.y, view->eye.z);
|
||||
func_80101E34(viewing, view->eye.x, view->eye.y, view->eye.z, view->unk_34.x, view->unk_34.y, view->unk_34.z,
|
||||
view->unk_40.x, view->unk_40.y, view->unk_40.z);
|
||||
|
||||
view->unk_A0 = *viewing;
|
||||
view->viewing = *viewing;
|
||||
|
||||
gSPMatrix(pLocal++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
|
||||
gSPMatrix(gfx++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
|
||||
}
|
||||
view->unk_120 = 0;
|
||||
*p = pLocal;
|
||||
|
||||
view->flags = 0;
|
||||
*gfxp = gfx;
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
@@ -575,28 +600,28 @@ s32 func_800AB9EC(View* view, s32 arg1, Gfx** p) {
|
||||
#endif
|
||||
|
||||
s32 func_800ABE74(f32 eyeX, f32 eyeY, f32 eyeZ) {
|
||||
s32 errorCode = 0;
|
||||
s32 error = 0;
|
||||
|
||||
if ((eyeX * eyeX) + (eyeY * eyeY) + (eyeZ * eyeZ) > 1073676288.0f) {
|
||||
errorCode = 3;
|
||||
if (SQ(eyeX) + SQ(eyeY) + SQ(eyeZ) > SQ(32767.0f)) {
|
||||
error = 3;
|
||||
} else {
|
||||
f32 absEyeX;
|
||||
f32 absEyeY;
|
||||
f32 absEyeZ;
|
||||
absEyeX = ABS(eyeX);
|
||||
absEyeY = ABS(eyeY);
|
||||
absEyeZ = ABS(eyeZ);
|
||||
f32 absEyeX = ABS(eyeX);
|
||||
f32 absEyeY = ABS(eyeY);
|
||||
f32 absEyeZ = ABS(eyeZ);
|
||||
|
||||
if (((18900.0f < absEyeX) || (18900.0f < absEyeY)) || (18900.0f < absEyeZ)) {
|
||||
errorCode = 2;
|
||||
error = 2;
|
||||
} else if (((16000.0f < absEyeX) || (16000.0f < absEyeY)) || (16000.0f < absEyeZ)) {
|
||||
errorCode = 1;
|
||||
error = 1;
|
||||
}
|
||||
}
|
||||
if (errorCode != 0) {
|
||||
|
||||
if (error != 0) {
|
||||
osSyncPrintf(VT_FGCOL(RED));
|
||||
// Is too large
|
||||
osSyncPrintf("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", eyeX, eyeY, eyeZ, errorCode);
|
||||
// "Is too large"
|
||||
osSyncPrintf("eye が大きすぎます eye=[%8.3f %8.3f %8.3f] error=%d\n", eyeX, eyeY, eyeZ, error);
|
||||
osSyncPrintf(VT_RST);
|
||||
}
|
||||
return errorCode;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_arrow_fire.h"
|
||||
|
||||
#include "../ovl_En_Arrow/z_en_arrow.h"
|
||||
|
||||
#define FLAGS 0x02000010
|
||||
@@ -53,14 +54,14 @@ void ArrowFire_Init(ArrowFire* this, GlobalContext* globalCtx) {
|
||||
|
||||
void ArrowFire_Destroy(ArrowFire* this, GlobalContext* globalCtx) {
|
||||
func_800876C8(globalCtx);
|
||||
// Translates to: ""Disappearance" = Disappearance"
|
||||
// Translates to: "Disappearance"
|
||||
LOG_STRING("消滅", "../z_arrow_fire.c", 421);
|
||||
}
|
||||
|
||||
void ArrowFire_Charge(ArrowFire* this, GlobalContext* globalCtx) {
|
||||
EnArrow* arrow;
|
||||
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -147,7 +148,7 @@ void ArrowFire_Fly(ArrowFire* this, GlobalContext* globalCtx) {
|
||||
f32 distanceScaled;
|
||||
s32 pad;
|
||||
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -194,7 +195,7 @@ void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx) {
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
stateFrames = globalCtx->state.frames;
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if (1) {}
|
||||
|
||||
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_arrow_ice.h"
|
||||
|
||||
#include "../ovl_En_Arrow/z_en_arrow.h"
|
||||
|
||||
#define FLAGS 0x02000010
|
||||
@@ -53,14 +54,14 @@ void ArrowIce_Init(ArrowIce* this, GlobalContext* globalCtx) {
|
||||
|
||||
void ArrowIce_Destroy(ArrowIce* this, GlobalContext* globalCtx) {
|
||||
func_800876C8(globalCtx);
|
||||
// Translates to: ""Disappearance" = Disappearance"
|
||||
// Translates to: "Disappearance"
|
||||
LOG_STRING("消滅", "../z_arrow_ice.c", 415);
|
||||
}
|
||||
|
||||
void ArrowIce_Charge(ArrowIce* this, GlobalContext* globalCtx) {
|
||||
EnArrow* arrow;
|
||||
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -147,7 +148,7 @@ void ArrowIce_Fly(ArrowIce* this, GlobalContext* globalCtx) {
|
||||
f32 distanceScaled;
|
||||
s32 pad;
|
||||
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -194,7 +195,7 @@ void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx) {
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
stateFrames = globalCtx->state.frames;
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if (1) {}
|
||||
|
||||
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "z_arrow_light.h"
|
||||
|
||||
#include "../ovl_En_Arrow/z_en_arrow.h"
|
||||
|
||||
#define FLAGS 0x02000010
|
||||
@@ -53,14 +54,14 @@ void ArrowLight_Init(ArrowLight* this, GlobalContext* globalCtx) {
|
||||
|
||||
void ArrowLight_Destroy(ArrowLight* this, GlobalContext* globalCtx) {
|
||||
func_800876C8(globalCtx);
|
||||
// Translates to: ""Disappearance" = Disappearance"
|
||||
// Translates to: "Disappearance"
|
||||
LOG_STRING("消滅", "../z_arrow_light.c", 403);
|
||||
}
|
||||
|
||||
void ArrowLight_Charge(ArrowLight* this, GlobalContext* globalCtx) {
|
||||
EnArrow* arrow;
|
||||
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -147,7 +148,7 @@ void ArrowLight_Fly(ArrowLight* this, GlobalContext* globalCtx) {
|
||||
f32 distanceScaled;
|
||||
s32 pad;
|
||||
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if ((arrow == NULL) || (arrow->actor.update == NULL)) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
@@ -194,7 +195,7 @@ void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx) {
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
stateFrames = globalCtx->state.frames;
|
||||
arrow = this->actor.attachedA;
|
||||
arrow = (EnArrow*)this->actor.attachedA;
|
||||
if (1) {}
|
||||
|
||||
if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) {
|
||||
|
||||
@@ -69,7 +69,7 @@ s32 BgBdanObjects_GetContactRu1(BgBdanObjects* this, s32 arg1) {
|
||||
case 0:
|
||||
return this->unk_1B8 == 1;
|
||||
case 4:
|
||||
return gSaveContext.inf_table[20] & 0x40;
|
||||
return gSaveContext.infTable[20] & 0x40;
|
||||
case 3:
|
||||
return this->unk_1B8 == 4;
|
||||
default:
|
||||
@@ -87,7 +87,7 @@ void BgBdanObjects_SetContactRu1(BgBdanObjects* this, s32 arg1) {
|
||||
this->unk_1B8 = 3;
|
||||
break;
|
||||
case 4:
|
||||
gSaveContext.inf_table[20] |= 0x40;
|
||||
gSaveContext.infTable[20] |= 0x40;
|
||||
break;
|
||||
default:
|
||||
osSyncPrintf("Bg_Bdan_Objects_Set_Contact_Ru1\nそんな送信モードは無い%d!!!!!!!!\n");
|
||||
@@ -185,7 +185,7 @@ void func_8086C054(BgBdanObjects* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((!func_800BFC84(globalCtx)) && (!BgBdanObjects_GetContactRu1(this, 0))) {
|
||||
if (!Gameplay_InCsMode(globalCtx) && !BgBdanObjects_GetContactRu1(this, 0)) {
|
||||
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y + -79.0f;
|
||||
} else {
|
||||
this->dyna.actor.posRot.pos.y = (this->dyna.actor.initPosRot.pos.y + -79.0f) - 5.0f;
|
||||
@@ -218,7 +218,7 @@ void func_8086C29C(BgBdanObjects* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_16A != 0) {
|
||||
this->unk_16A -= 1;
|
||||
if (this->unk_16A == 0) {
|
||||
temp = Quake_Add(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 1);
|
||||
temp = Quake_Add(globalCtx->cameraPtrs[globalCtx->activeCamera], 1);
|
||||
Quake_SetSpeed(temp, 0x3A98);
|
||||
Quake_SetQuakeValues(temp, 0, 1, 0xFA, 1);
|
||||
Quake_SetCountdown(temp, 0xA);
|
||||
@@ -232,7 +232,7 @@ void func_8086C29C(BgBdanObjects* this, GlobalContext* globalCtx) {
|
||||
BgBdanObjects_SetContactRu1(this, 4);
|
||||
this->unk_16A = 0xA;
|
||||
this->actionFunc = (ActorFunc)func_8086C55C;
|
||||
func_8005B1A4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]);
|
||||
func_8005B1A4(globalCtx->cameraPtrs[globalCtx->activeCamera]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,13 +345,13 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
if (this->unk_168 == 0) {
|
||||
if (func_8004356C(&this->dyna.actor)) {
|
||||
this->unk_1B8 = globalCtx->cameraCtx.activeCameraPtrs[0]->unk_142;
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 0x3A);
|
||||
func_8005AD1C(globalCtx->cameraCtx.activeCameraPtrs[0], 4);
|
||||
this->unk_1B8 = globalCtx->cameraPtrs[0]->unk_142;
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], 0x3A);
|
||||
func_8005AD1C(globalCtx->cameraPtrs[0], 4);
|
||||
this->unk_168 = 0xAU;
|
||||
}
|
||||
} else {
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 0x3A);
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], 0x3A);
|
||||
if (!func_8004356C(&this->dyna.actor)) {
|
||||
if (this->unk_168 != 0) {
|
||||
this->unk_168 -= 1;
|
||||
@@ -360,8 +360,8 @@ void func_8086C874(BgBdanObjects* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_168 == 0) {
|
||||
do {
|
||||
} while (0);
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], (s16)this->unk_1B8);
|
||||
func_8005ACFC(globalCtx->cameraCtx.activeCameraPtrs[0], 4);
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], (s16)this->unk_1B8);
|
||||
func_8005ACFC(globalCtx->cameraPtrs[0], 4);
|
||||
}
|
||||
}
|
||||
this->dyna.actor.posRot.pos.y = this->dyna.actor.initPosRot.pos.y -
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "z_bg_bom_guard.h"
|
||||
|
||||
#include "../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h"
|
||||
|
||||
#include <vt.h>
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
#include "../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
/* 0x0164 */ ActorFunc actionFunc;
|
||||
|
||||
@@ -46,7 +46,7 @@ void BgGateShutter_Init(BgGateShutter* this, GlobalContext* globalCtx) {
|
||||
this->somePosX = thisx->posRot.pos.x;
|
||||
this->somePosY = thisx->posRot.pos.y;
|
||||
this->somePosZ = thisx->posRot.pos.z;
|
||||
if ((gSaveContext.inf_table[7] & 0x40) || (gSaveContext.event_chk_inf[4] & 0x20)) {
|
||||
if ((gSaveContext.infTable[7] & 0x40) || (gSaveContext.eventChkInf[4] & 0x20)) {
|
||||
if (globalCtx->sceneNum == SCENE_SPOT01) {
|
||||
thisx->posRot.pos.x = -89.0f;
|
||||
thisx->posRot.pos.z = -1375.0f;
|
||||
@@ -65,7 +65,7 @@ void BgGateShutter_Destroy(BgGateShutter* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_8087828C(BgGateShutter* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_168 == 1 && !(gSaveContext.inf_table[7] & 0x40)) {
|
||||
if (this->unk_168 == 1 && !(gSaveContext.infTable[7] & 0x40)) {
|
||||
this->unk_178 = 2;
|
||||
this->actionFunc = (ActorFunc)func_80878300;
|
||||
} else if (this->unk_168 == 2) {
|
||||
|
||||
@@ -52,7 +52,7 @@ void BgGjyoBridge_Init(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
|
||||
this->dyna.dynaPolyId = DynaPolyInfo_RegisterActor(globalCtx, dynaCollisionContext, this, local_c);
|
||||
|
||||
if (gSaveContext.event_chk_inf[4] & 0x2000) {
|
||||
if (gSaveContext.eventChkInf[4] & 0x2000) {
|
||||
this->actionFunc = func_808787A4;
|
||||
} else {
|
||||
this->dyna.actor.draw = NULL;
|
||||
@@ -71,13 +71,13 @@ void func_808787A4(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
void BgGjyoBridge_TriggerCutscene(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
|
||||
if ((gBitFlags[3] & gSaveContext.quest_items) && (gBitFlags[4] & gSaveContext.quest_items) &&
|
||||
if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
|
||||
(INV_CONTENT(ITEM_ARROW_LIGHT) == ITEM_ARROW_LIGHT) && (player->actor.posRot.pos.x > -70.0f) &&
|
||||
(player->actor.posRot.pos.x < 300.0f) && (player->actor.posRot.pos.y > 1340.0f) &&
|
||||
(player->actor.posRot.pos.z > 1340.0f) && (player->actor.posRot.pos.z < 1662.0f) &&
|
||||
(func_800BFC84(globalCtx) == 0)) {
|
||||
!Gameplay_InCsMode(globalCtx)) {
|
||||
globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(&D_02002640);
|
||||
gSaveContext.cutscene_trigger = 1;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->actionFunc = BgGjyoBridge_SpawnBridge;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,7 @@ void BgGjyoBridge_SpawnBridge(BgGjyoBridge* this, GlobalContext* globalCtx) {
|
||||
(globalCtx->csCtx.actorActions[2]->action == 2)) {
|
||||
this->dyna.actor.draw = &BgGjyoBridge_Draw;
|
||||
func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dyna.dynaPolyId);
|
||||
gSaveContext.event_chk_inf[4] |= 0x2000;
|
||||
gSaveContext.eventChkInf[4] |= 0x2000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -191,9 +191,8 @@ void BgHidanFirewall_Update(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
||||
|
||||
void BgHidanFirewall_Draw(BgHidanFirewall* this, GlobalContext* globalCtx) {
|
||||
UNK_PTR* temp;
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[3];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
|
||||
@@ -132,12 +132,12 @@ void BgHidanFslift_Update(BgHidanFslift* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_16A == 0) {
|
||||
this->unk_16A = 3;
|
||||
}
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 0x30);
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], 0x30);
|
||||
return;
|
||||
}
|
||||
if (func_8004356C(thisx) == 0) {
|
||||
if (this->unk_16A != 0) {
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 3);
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], 3);
|
||||
}
|
||||
this->unk_16A = 0;
|
||||
}
|
||||
|
||||
@@ -108,12 +108,12 @@ void BgHidanSyoku_Update(BgHidanSyoku* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_168 == 0) {
|
||||
this->unk_168 = 3;
|
||||
}
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 0x30);
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], 0x30);
|
||||
return;
|
||||
}
|
||||
if (!func_8004356C(&this->dyna.actor)) {
|
||||
if (this->unk_168 != 0) {
|
||||
func_8005A77C(globalCtx->cameraCtx.activeCameraPtrs[0], 3);
|
||||
func_8005A77C(globalCtx->cameraPtrs[0], 3);
|
||||
}
|
||||
this->unk_168 = 0;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ void func_80899950(BgJyaKanaami* this, GlobalContext* globalCtx) {
|
||||
if (Math_ApproxUpdateScaledS(&this->actor.posRot.rot.x, 0x4000, this->unk_168)) {
|
||||
func_80899A08(this);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_TRAP_BOUND);
|
||||
var = Quake_Add(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 3);
|
||||
var = Quake_Add(globalCtx->cameraPtrs[globalCtx->activeCamera], 3);
|
||||
Quake_SetSpeed(var, 25000);
|
||||
Quake_SetQuakeValues(var, 2, 0, 0, 0);
|
||||
Quake_SetCountdown(var, 0x10);
|
||||
|
||||
@@ -45,8 +45,8 @@ void BgSpot01Fusya_Init(BgSpot01Fusya* this, GlobalContext* globalCtx) {
|
||||
this->unk_154 = 100.0f;
|
||||
this->unk_158 = 100.0f;
|
||||
this->unk_15C = 0.5f;
|
||||
if (gSaveContext.scene_setup_index < 4) {
|
||||
gSaveContext.event_chk_inf[6] &= 0xFFDF;
|
||||
if (gSaveContext.sceneSetupIndex < 4) {
|
||||
gSaveContext.eventChkInf[6] &= 0xFFDF;
|
||||
}
|
||||
BgSpot01Fusya_SetupAction(this, func_808AAA50);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ void BgSpot01Fusya_Destroy(BgSpot01Fusya* this, GlobalContext* globalCtx) {
|
||||
void func_808AAA50(BgSpot01Fusya* this, GlobalContext* globalCtx) {
|
||||
f32 temp;
|
||||
Actor* thisx = &this->actor;
|
||||
if (gSaveContext.event_chk_inf[6] & 0x20) {
|
||||
if (gSaveContext.eventChkInf[6] & 0x20) {
|
||||
this->unk_158 = 1800.0f;
|
||||
}
|
||||
thisx->shape.rot.z += this->unk_154;
|
||||
|
||||
@@ -9,8 +9,8 @@ typedef struct {
|
||||
/* 0x014C */ char unk_14C[0x18];
|
||||
/* 0x0164 */ ActorFunc actionFunc;
|
||||
/* 0x0168 */ char unk_168[0x10];
|
||||
/* 0x0178 */ s8 objBankIndex;
|
||||
/* 0x0179 */ char unk_179[0x7];
|
||||
/* 0x0178 */ s32 objectId;
|
||||
/* 0x0179 */ char unk_179[0x4];
|
||||
} BgSpot01Objects2; // size = 0x0180
|
||||
|
||||
extern const ActorInit Bg_Spot01_Objects2_InitVars;
|
||||
|
||||
@@ -57,11 +57,11 @@ s32 func_808B1AE0(BgSpot09Obj* this, GlobalContext* globalCtx) {
|
||||
s32 carpentersRescued;
|
||||
Actor* thisx = &this->dyna.actor;
|
||||
|
||||
if (gSaveContext.scene_setup_index >= 4) {
|
||||
if (gSaveContext.sceneSetupIndex >= 4) {
|
||||
return thisx->params == 0;
|
||||
}
|
||||
|
||||
carpentersRescued = (gSaveContext.event_chk_inf[9] & 0xF) == 0xF;
|
||||
carpentersRescued = (gSaveContext.eventChkInf[9] & 0xF) == 0xF;
|
||||
|
||||
if (LINK_AGE_IN_YEARS == YEARS_ADULT) {
|
||||
switch (thisx->params) {
|
||||
@@ -136,7 +136,7 @@ void BgSpot09Obj_Init(BgSpot09Obj* this, GlobalContext* globalCtx) {
|
||||
Actor* thisx = &this->dyna.actor;
|
||||
|
||||
osSyncPrintf("Spot09 Object [arg_data : 0x%04x](大工救出フラグ 0x%x)\n", thisx->params,
|
||||
gSaveContext.event_chk_inf[9] & 0xF);
|
||||
gSaveContext.eventChkInf[9] & 0xF);
|
||||
thisx->params &= 0xFF;
|
||||
if ((thisx->params < 0) || (thisx->params >= 5)) {
|
||||
osSyncPrintf("Error : Spot 09 object の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n",
|
||||
|
||||
@@ -113,7 +113,7 @@ void func_808B318C(BgSpot12Gate* this, GlobalContext* globalCtx) {
|
||||
Math_ApproxF(&thisx->velocity.y, 1.6f, 0.03f);
|
||||
if (Math_ApproxF(&thisx->posRot.pos.y, thisx->initPosRot.pos.y + 200.0f, thisx->velocity.y)) {
|
||||
func_808B3274(this);
|
||||
var = Quake_Add(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0], 3);
|
||||
var = Quake_Add(globalCtx->cameraPtrs[globalCtx->activeCamera], 3);
|
||||
Quake_SetSpeed(var, -0x3CB0);
|
||||
Quake_SetQuakeValues(var, 3, 0, 0, 0);
|
||||
Quake_SetCountdown(var, 0xC);
|
||||
|
||||
@@ -46,7 +46,7 @@ void BgSpot15Saku_Init(BgSpot15Saku* this, GlobalContext* globalCtx) {
|
||||
this->unk_170 = thisx->posRot.pos.x;
|
||||
this->unk_174 = thisx->posRot.pos.y;
|
||||
this->unk_178 = thisx->posRot.pos.z;
|
||||
if ((gSaveContext.inf_table[7] & 2) != 0) {
|
||||
if ((gSaveContext.infTable[7] & 2) != 0) {
|
||||
thisx->posRot.pos.z = 2659.0f;
|
||||
}
|
||||
this->actionFunc = func_808B4930;
|
||||
@@ -57,7 +57,7 @@ void BgSpot15Saku_Destroy(BgSpot15Saku* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808B4930(BgSpot15Saku* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_168 && !(gSaveContext.inf_table[7] & 2)) {
|
||||
if (this->unk_168 && !(gSaveContext.infTable[7] & 2)) {
|
||||
this->unk_17C = 2;
|
||||
this->actionFunc = func_808B4978;
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ void func_808B7478(BgSpot17Funen* this, GlobalContext* globalCtx) {
|
||||
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_bg_spot17_funen.c", 153);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
Matrix_RotateY((s16)(func_8005A9F4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]) -
|
||||
this->actor.shape.rot.y + 0x8000) *
|
||||
9.58738019108e-05f,
|
||||
MTXMODE_APPLY);
|
||||
Matrix_RotateY(
|
||||
(s16)(func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) - this->actor.shape.rot.y + 0x8000) *
|
||||
9.58738019108e-05f,
|
||||
MTXMODE_APPLY);
|
||||
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_spot17_funen.c", 161),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
@@ -193,7 +193,7 @@ void BgTokiSwd_Init(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
thisx->draw = NULL;
|
||||
}
|
||||
|
||||
if (gSaveContext.scene_setup_index == 5) {
|
||||
if (gSaveContext.sceneSetupIndex == 5) {
|
||||
globalCtx->unk_11D30[0] = 0xFF;
|
||||
}
|
||||
|
||||
@@ -209,13 +209,13 @@ void BgTokiSwd_Destroy(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
if (((gSaveContext.event_chk_inf[4] & 0x8000) == 0) && (gSaveContext.scene_setup_index < 4) &&
|
||||
(func_8002E12C(&this->actor, 800.0f, 0x7530) != 0) && (func_800BFC84(globalCtx) == 0)) {
|
||||
gSaveContext.event_chk_inf[4] |= 0x8000;
|
||||
if (((gSaveContext.eventChkInf[4] & 0x8000) == 0) && (gSaveContext.sceneSetupIndex < 4) &&
|
||||
(func_8002E12C(&this->actor, 800.0f, 0x7530) != 0) && !Gameplay_InCsMode(globalCtx)) {
|
||||
gSaveContext.eventChkInf[4] |= 0x8000;
|
||||
globalCtx->csCtx.segment = D_808BBD90;
|
||||
gSaveContext.cutscene_trigger = 1;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
}
|
||||
if (LINK_IS_CHILD || ((gSaveContext.event_chk_inf[5] & 0x20) != 0)) {
|
||||
if (LINK_IS_CHILD || ((gSaveContext.eventChkInf[5] & 0x20) != 0)) {
|
||||
if (func_8002F410(&this->actor, globalCtx) != 0) {
|
||||
if (LINK_IS_CHILD) {
|
||||
Item_Give(globalCtx, ITEM_SWORD_MASTER);
|
||||
@@ -225,7 +225,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
Audio_SetBGM(NA_BGM_STOP);
|
||||
Audio_SetBGM(NA_SE_PL_BOUND_DIRT);
|
||||
gSaveContext.cutscene_trigger = 1;
|
||||
gSaveContext.cutsceneTrigger = 1;
|
||||
this->actor.attachedA = 0;
|
||||
BgTokiSwd_SetupAction(this, func_808BB0AC);
|
||||
} else {
|
||||
@@ -234,7 +234,7 @@ void func_808BAF40(BgTokiSwd* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gSaveContext.scene_setup_index == 5) {
|
||||
if (gSaveContext.sceneSetupIndex == 5) {
|
||||
if (globalCtx->unk_11D30[0] > 0) {
|
||||
globalCtx->unk_11D30[0]--;
|
||||
} else {
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "z_bg_zg.h"
|
||||
|
||||
#include <vt.h>
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
|
||||
void BgZg_Init(BgZg* this, GlobalContext* globalCtx);
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ DynaPolyActor dyna;
|
||||
|
||||
@@ -45,7 +45,7 @@ static s16 entrances[] = {
|
||||
};
|
||||
|
||||
// display list
|
||||
extern Gfx* D_05001390;
|
||||
extern Gfx D_05001390[];
|
||||
|
||||
// sets current actionFunc to be ran on next update call
|
||||
void DoorAna_SetupAction(DoorAna* this, ActorFunc func) {
|
||||
@@ -120,7 +120,7 @@ void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) {
|
||||
if ((this->actor.unk_1F != 0) && (globalCtx->sceneLoadFlag == 0) && (player->stateFlags1 & 0x80000000) &&
|
||||
(player->unk_84F == 0)) {
|
||||
destinationIdx = ((this->actor.params >> 0xC) & 7) - 1;
|
||||
func_800C0AF4(globalCtx, 1, 0x4FF);
|
||||
Gameplay_SetupRespawnPoint(globalCtx, RESPAWN_MODE_RETURN, 0x4FF);
|
||||
gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.posRot.pos.y;
|
||||
gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.initPosRot.rot.y;
|
||||
gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF;
|
||||
@@ -130,7 +130,7 @@ void DoorAna_Update_Open(DoorAna* this, GlobalContext* globalCtx) {
|
||||
globalCtx->nextEntranceIndex = entrances[destinationIdx];
|
||||
DoorAna_SetupAction(this, (ActorFunc)&DoorAna_Update_Entering);
|
||||
} else {
|
||||
if (func_8008E988(globalCtx) == 0 && !(player->stateFlags1 & 0x8800000) &&
|
||||
if (!func_8008E988(globalCtx) && !(player->stateFlags1 & 0x8800000) &&
|
||||
this->actor.xzDistanceFromLink <= 15.0f && -50.0f <= this->actor.yDistanceFromLink &&
|
||||
this->actor.yDistanceFromLink <= 15.0f) {
|
||||
player->stateFlags1 |= 0x80000000;
|
||||
@@ -157,19 +157,17 @@ void DoorAna_Update_Entering(DoorAna* this, GlobalContext* globalCtx) {
|
||||
void DoorAna_Update(DoorAna* this, GlobalContext* globalCtx) {
|
||||
this->actionFunc(this, globalCtx);
|
||||
// changes the grottos facing angle based on camera angle
|
||||
this->actor.shape.rot.y =
|
||||
func_8005A9F4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]) + 0x8000;
|
||||
this->actor.shape.rot.y = func_8005A9F4(globalCtx->cameraPtrs[globalCtx->activeCamera]) + 0x8000;
|
||||
}
|
||||
|
||||
void DoorAna_Draw(DoorAna* this, GlobalContext* globalCtx) {
|
||||
GraphicsContext* gfxCtx = globalCtx->state.gfxCtx;
|
||||
Gfx** dList = &D_05001390; // required for stack placement?
|
||||
Gfx* dispRefs[3];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
Graph_OpenDisps(dispRefs, globalCtx->state.gfxCtx, "../z_door_ana.c", 440);
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_door_ana.c", 446),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, dList);
|
||||
gSPDisplayList(gfxCtx->polyXlu.p++, D_05001390);
|
||||
Graph_CloseDisps(dispRefs, globalCtx->state.gfxCtx, "../z_door_ana.c", 449);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void DoorToki_Destroy(DoorToki* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void DoorToki_Update(DoorToki* this, GlobalContext* globalCtx) {
|
||||
if (gSaveContext.event_chk_inf[4] & 0x800) {
|
||||
if (gSaveContext.eventChkInf[4] & 0x800) {
|
||||
func_8003EBF8(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId);
|
||||
} else {
|
||||
func_8003EC50(globalCtx, &globalCtx->colCtx.dyna, this->dynaPolyId);
|
||||
|
||||
@@ -123,7 +123,7 @@ void func_809B0558(EnAni* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
EnAni_SetupAction(this, func_809B0524);
|
||||
}
|
||||
gSaveContext.item_get_inf[1] |= 0x20;
|
||||
gSaveContext.itemGetInf[1] |= 0x20;
|
||||
return;
|
||||
}
|
||||
func_8002F434(&this->actor, globalCtx, GI_HEART_PIECE, 10000.0f, 200.0f);
|
||||
@@ -147,8 +147,8 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
|
||||
if (!textId) {}
|
||||
|
||||
if (textId2 == 0) {
|
||||
textId = gSaveContext.night_flag ? 0x5051 : 0x5050; // "...all I can do is look at the stars."
|
||||
// "...all I can do is look at Death Mountain."
|
||||
textId = gSaveContext.nightFlag ? 0x5051 : 0x5050; // "...all I can do is look at the stars."
|
||||
// "...all I can do is look at Death Mountain."
|
||||
}
|
||||
|
||||
yawDiff = this->actor.rotTowardsLinkY - this->actor.shape.rot.y;
|
||||
@@ -162,7 +162,7 @@ void func_809B064C(EnAni* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistanceFromLink < 150.0f &&
|
||||
-80.0f < this->actor.yDistanceFromLink) {
|
||||
if (gSaveContext.item_get_inf[1] & 0x20) {
|
||||
if (gSaveContext.itemGetInf[1] & 0x20) {
|
||||
EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..."
|
||||
} else {
|
||||
EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento."
|
||||
@@ -188,17 +188,17 @@ void func_809B07F8(EnAni* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
} else if (yawDiff >= -0x36AF && yawDiff < 0 && this->actor.xzDistanceFromLink < 150.0f &&
|
||||
-80.0f < this->actor.yDistanceFromLink) {
|
||||
if ((gSaveContext.item_get_inf[1] & 0x20) != 0) {
|
||||
if ((gSaveContext.itemGetInf[1] & 0x20) != 0) {
|
||||
EnAni_SetText(this, globalCtx, 0x5056); // "To get a good view..."
|
||||
} else {
|
||||
EnAni_SetText(this, globalCtx, 0x5055); // "...I'll give you this as a memento."
|
||||
}
|
||||
} else if (yawDiff >= -0x3E7 && yawDiff < 0x36B0 && this->actor.xzDistanceFromLink < 350.0f) {
|
||||
if ((gSaveContext.event_chk_inf[2] & 0x8000) == 0) {
|
||||
if ((gSaveContext.eventChkInf[2] & 0x8000) == 0) {
|
||||
textId = 0x5052; // "...Something is happening on Death Mountain!"
|
||||
} else {
|
||||
textId = (gSaveContext.item_get_inf[1] & 0x20) ? 0x5054 : 0x5053; // "I don't feel like getting down..."
|
||||
// "...Death Mountain is back to normal!"
|
||||
textId = (gSaveContext.itemGetInf[1] & 0x20) ? 0x5054 : 0x5053; // "I don't feel like getting down..."
|
||||
// "...Death Mountain is back to normal!"
|
||||
}
|
||||
EnAni_SetText(this, globalCtx, textId);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "z_en_anubice_tag.h"
|
||||
|
||||
#include <vt.h>
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
|
||||
void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx);
|
||||
@@ -29,7 +31,7 @@ const ActorInit En_Anubice_Tag_InitVars = {
|
||||
|
||||
void EnAnubiceTag_Init(EnAnubiceTag* this, GlobalContext* globalCtx) {
|
||||
osSyncPrintf("\n\n");
|
||||
//"Anubis control tag generated"
|
||||
// "Anubis control tag generated"
|
||||
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ アヌビス制御タグ発生 ☆☆☆☆☆ %d\n" VT_RST, this->actor.params);
|
||||
|
||||
if (this->actor.params < (s16)0xFFFF) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
#include "../ovl_En_Anubice/z_en_anubice.h"
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -33,10 +33,9 @@ const ActorInit En_Dog_InitVars = {
|
||||
};
|
||||
|
||||
static ColliderCylinderInit cylinderInit = {
|
||||
0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00000000,
|
||||
0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
|
||||
|
||||
0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
0x06, 0x00, 0x09, 0x39, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00000000, 0x00, 0x00, 0x00, 0x00, 0xFFCFFFFF, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x01, 0x00, 0x0010, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
};
|
||||
|
||||
static Sub98Init5 sub98Data = {
|
||||
@@ -54,15 +53,6 @@ static struct_80034EC0_Entry animations[] = {
|
||||
{ 0x06000928, 1.0f, 0.0f, 6.0f, 0x02, -6.0f }, { 0x06000C28, 1.0f, 0.0f, -1.0f, 0x00, -6.0f },
|
||||
};
|
||||
|
||||
// Bandaid fix for a lw vs lh issue in EnDog_FollowPath. Roman will look at it later.
|
||||
typedef union {
|
||||
/* 0x00 */ s32 entry;
|
||||
struct {
|
||||
s16 unk_0;
|
||||
s16 unk_2;
|
||||
};
|
||||
} s16ArrEntry;
|
||||
|
||||
typedef enum {
|
||||
/* 0x00 */ DOG_WALK,
|
||||
/* 0x01 */ DOG_RUN,
|
||||
@@ -164,7 +154,7 @@ s32 EnDog_PlayAnimAndSFX(EnDog* this) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
|
||||
s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
|
||||
if ((this->collider.base.collideFlags & 2)) {
|
||||
this->collider.base.collideFlags &= ~2;
|
||||
return 2;
|
||||
@@ -186,7 +176,7 @@ static s8 EnDog_CanFollow(EnDog* this, GlobalContext* globalCtx) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) {
|
||||
s32 EnDog_UpdateWaypoint(EnDog* this, GlobalContext* globalCtx) {
|
||||
s32 change;
|
||||
|
||||
if (this->path == NULL) {
|
||||
@@ -293,8 +283,8 @@ void EnDog_Destroy(EnDog* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) {
|
||||
s16ArrEntry behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK };
|
||||
s16ArrEntry unused[] = { 40, 80, 20 };
|
||||
s32 behaviors[] = { DOG_SIT, DOG_BOW, DOG_BARK };
|
||||
s32 unused[] = { 40, 80, 20 };
|
||||
f32 speed;
|
||||
s32 frame;
|
||||
|
||||
@@ -316,16 +306,16 @@ void EnDog_FollowPath(EnDog* this, GlobalContext* globalCtx) {
|
||||
// depending on where he is on his path. En_Hy checks these event flags.
|
||||
if (this->waypoint < 9) {
|
||||
// Richard is close to her, text says something about his coat
|
||||
gSaveContext.event_inf[3] |= 1;
|
||||
gSaveContext.eventInf[3] |= 1;
|
||||
} else {
|
||||
// Richard is far, text says something about running fast
|
||||
gSaveContext.event_inf[3] &= ~1;
|
||||
gSaveContext.eventInf[3] &= ~1;
|
||||
}
|
||||
} else {
|
||||
frame = globalCtx->state.frames % 3;
|
||||
this->nextBehavior = behaviors[frame].entry;
|
||||
// no clue why they're using the action id to calculate timer. possibly meant to use the unused array?
|
||||
this->behaviorTimer = Math_Rand_S16Offset(60, behaviors[frame].unk_2);
|
||||
this->nextBehavior = behaviors[frame];
|
||||
// no clue why they're using the behavior id to calculate timer. possibly meant to use the unused array?
|
||||
this->behaviorTimer = Math_Rand_S16Offset(60, behaviors[frame]);
|
||||
this->actionFunc = EnDog_ChooseMovement;
|
||||
}
|
||||
}
|
||||
@@ -451,8 +441,7 @@ void EnDog_Update(EnDog* this, GlobalContext* globalCtx) {
|
||||
Actor_CollisionCheck_SetOT(globalCtx, &globalCtx->sub_11E60, &this->collider);
|
||||
}
|
||||
|
||||
static UNK_TYPE EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot,
|
||||
Actor* actor) {
|
||||
s32 EnDog_Callback1(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* actor) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void EnDs_DisplayOddPotionText(EnDs* this, GlobalContext* globalCtx) {
|
||||
this->actor.textId = 0x504F;
|
||||
this->actionFunc = EnDs_TalkAfterGiveOddPotion;
|
||||
this->actor.flags &= ~0x100;
|
||||
gSaveContext.item_get_inf[3] |= 1;
|
||||
gSaveContext.itemGetInf[3] |= 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void EnDs_GiveOddPotion(EnDs* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F410(&this->actor, globalCtx) != 0) {
|
||||
this->actor.attachedA = NULL;
|
||||
this->actionFunc = EnDs_DisplayOddPotionText;
|
||||
gSaveContext.timer_2_state = 0;
|
||||
gSaveContext.timer2State = 0;
|
||||
} else {
|
||||
func_8002F434(&this->actor, globalCtx, GI_ODD_POTION, 10000.0f, 50.0f);
|
||||
}
|
||||
@@ -229,7 +229,7 @@ void EnDs_Wait(EnDs* this, GlobalContext* globalCtx) {
|
||||
Audio_PlaySoundGeneral(NA_SE_SY_TRE_BOX_APPEAR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
player->actor.textId = 0x504A;
|
||||
this->actionFunc = EnDs_OfferOddPotion;
|
||||
} else if (gSaveContext.item_get_inf[3] & 1) {
|
||||
} else if (gSaveContext.itemGetInf[3] & 1) {
|
||||
player->actor.textId = 0x500C;
|
||||
this->actionFunc = EnDs_OfferBluePotion;
|
||||
} else {
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
|
||||
#include "z_en_eg.h"
|
||||
|
||||
#include <vt.h>
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
|
||||
void EnEg_PlayVoidOutSFX();
|
||||
void EnEg_Init(EnEg* this, GlobalContext* globalCtx);
|
||||
void EnEg_Destroy(EnEg* this, GlobalContext* globalCtx);
|
||||
void func_809FFDC8(EnEg* this, GlobalContext* globalCtx);
|
||||
@@ -32,7 +33,7 @@ const ActorInit En_Eg_InitVars = {
|
||||
(ActorFunc)EnEg_Draw,
|
||||
};
|
||||
|
||||
void PlayVoidOutSFX() {
|
||||
void EnEg_PlayVoidOutSFX() {
|
||||
func_800788CC(NA_SE_OC_ABYSS);
|
||||
}
|
||||
|
||||
@@ -44,13 +45,13 @@ void EnEg_Init(EnEg* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_809FFDC8(EnEg* this, GlobalContext* globalCtx) {
|
||||
if (!hasVoidedOut && (gSaveContext.timer_2_value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) {
|
||||
if (!hasVoidedOut && (gSaveContext.timer2Value < 1) && Flags_GetSwitch(globalCtx, 0x36) && (kREG(0) == 0)) {
|
||||
// Void the player out
|
||||
func_800C0C88(globalCtx);
|
||||
gSaveContext.respawn_flag = -2;
|
||||
Gameplay_TriggerRespawn(globalCtx);
|
||||
gSaveContext.respawnFlag = -2;
|
||||
Audio_SetBGM(NA_BGM_STOP);
|
||||
globalCtx->fadeOutTransition = 2;
|
||||
PlayVoidOutSFX();
|
||||
globalCtx->fadeTransition = 2;
|
||||
EnEg_PlayVoidOutSFX();
|
||||
hasVoidedOut = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
|
||||
@@ -105,9 +105,8 @@ Gfx* func_80A28148(GraphicsContext* gfxCtx, BossGanon* dorf) {
|
||||
|
||||
void EnGanonOrgan_Draw(EnGanonOrgan* this, GlobalContext* globalCtx) {
|
||||
BossGanon* dorf;
|
||||
u32 pad;
|
||||
GraphicsContext* gfxCtx;
|
||||
Gfx* dispRefs[3];
|
||||
Gfx* dispRefs[4];
|
||||
|
||||
dorf = (BossGanon*)this->actor.attachedA;
|
||||
gfxCtx = globalCtx->state.gfxCtx;
|
||||
|
||||
@@ -138,7 +138,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnMs_Sell(EnMs* this, GlobalContext* globalCtx) {
|
||||
if (func_8002F410(&this->actor, globalCtx) != 0) { // if attached is set
|
||||
Rupees_ChangeBy(-prices[BEANS_BOUGHT]); // decrease ruppees
|
||||
Rupees_ChangeBy(-prices[BEANS_BOUGHT]);
|
||||
this->actor.attachedA = NULL;
|
||||
this->actionFunc = &EnMs_TalkAfterBuy;
|
||||
return;
|
||||
@@ -165,7 +165,7 @@ void EnMs_Update(EnMs* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
this->actionFunc(this, globalCtx);
|
||||
|
||||
if (gSaveContext.entrance_index == 0x157 && gSaveContext.scene_setup_index == 8) { // ride carpet if in credits
|
||||
if (gSaveContext.entranceIndex == 0x157 && gSaveContext.sceneSetupIndex == 8) { // ride carpet if in credits
|
||||
Actor_MoveForward(&this->actor);
|
||||
osSyncPrintf("OOOHHHHHH %f\n", this->actor.velocity.y);
|
||||
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
|
||||
@@ -41,33 +41,33 @@ void EnOkarinaEffect_SetupAction(EnOkarinaEffect* this, ActorFunc* newActionFunc
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_Destroy(EnOkarinaEffect* this, GlobalContext* globalCtx) {
|
||||
globalCtx->unk_10B16[0] = 0;
|
||||
if ((D_8011FB30 != 4) && (D_8011FB30 != 5) && (globalCtx->gloomySkyEvent == 1)) {
|
||||
globalCtx->gloomySkyEvent = 2; // end gloomy sky
|
||||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
if ((D_8011FB30 != 4) && (D_8011FB30 != 5) && (globalCtx->envCtx.gloomySkyEvent == 1)) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 2; // end gloomy sky
|
||||
func_80077684(globalCtx);
|
||||
}
|
||||
globalCtx->lightning = 2; // end lightning
|
||||
globalCtx->envCtx.lightning = 2; // end lightning
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_Init(EnOkarinaEffect* this, GlobalContext* globalCtx) {
|
||||
osSyncPrintf("\n\n");
|
||||
//"Ocarina Storm Effect"
|
||||
// "Ocarina Storm Effect"
|
||||
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ オカリナあらし効果ビカビカビカ〜 ☆☆☆☆☆ \n" VT_RST);
|
||||
osSyncPrintf("\n\n");
|
||||
if (globalCtx->unk_10B12[1] != 0) {
|
||||
if (globalCtx->envCtx.unk_EE[1] != 0) {
|
||||
Actor_Kill(&this->actor); // kill if an instance is already spawned
|
||||
}
|
||||
EnOkarinaEffect_SetupAction(this, &EnOkarinaEffect_TriggerStorm);
|
||||
}
|
||||
|
||||
void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) {
|
||||
this->timer = 400; // 20 seconds
|
||||
globalCtx->unk_10B16[0] = 20; // rain intensity target
|
||||
globalCtx->gloomySkyEvent = 1; // start gloomy sky
|
||||
if ((D_8011FB30 != 0) || globalCtx->gloomySky != 0) {
|
||||
globalCtx->unk_10B02 = 1;
|
||||
this->timer = 400; // 20 seconds
|
||||
globalCtx->envCtx.unk_F2[0] = 20; // rain intensity target
|
||||
globalCtx->envCtx.gloomySkyEvent = 1; // start gloomy sky
|
||||
if ((D_8011FB30 != 0) || globalCtx->envCtx.gloomySky != 0) {
|
||||
globalCtx->envCtx.unk_DE = 1;
|
||||
}
|
||||
globalCtx->lightning = 1; // start lightning
|
||||
globalCtx->envCtx.lightning = 1; // start lightning
|
||||
func_80077624(globalCtx);
|
||||
EnOkarinaEffect_SetupAction(this, &EnOkarinaEffect_ManageStorm);
|
||||
}
|
||||
@@ -75,14 +75,14 @@ void EnOkarinaEffect_TriggerStorm(EnOkarinaEffect* this, GlobalContext* globalCt
|
||||
void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx) {
|
||||
func_8006C438(globalCtx, 5); // clear bean grow env flag
|
||||
if (((globalCtx->pauseCtx.state == 0) && (globalCtx->unk_10A20 == 0) && (globalCtx->msgCtx.unk_E300 == 0) &&
|
||||
(func_800C0D28(globalCtx) == 0) && ((globalCtx->unk_1241B == 0) || (gSaveContext.game_mode != 0))) ||
|
||||
(func_800C0D28(globalCtx) == 0) && ((globalCtx->unk_1241B == 0) || (gSaveContext.gameMode != 0))) ||
|
||||
(this->timer >= 250)) {
|
||||
if (globalCtx->unk_10A42 != 0 || globalCtx->unk_10A43 != 1) {
|
||||
if (globalCtx->envCtx.unk_1E != 0 || globalCtx->envCtx.unk_1F != 1) {
|
||||
this->timer--;
|
||||
}
|
||||
osSyncPrintf("\nthis->timer=[%d]", this->timer);
|
||||
if (this->timer == 308) {
|
||||
//"Let's grow some beans"
|
||||
// "Let's grow some beans"
|
||||
osSyncPrintf("\n\n\n豆よ のびろ 指定\n\n\n");
|
||||
func_8006C3D0(globalCtx, 5); // set bean grow env flag
|
||||
}
|
||||
@@ -93,7 +93,7 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
||||
}
|
||||
|
||||
if (this->timer == 0) {
|
||||
globalCtx->unk_10B16[0] = 0;
|
||||
globalCtx->envCtx.unk_F2[0] = 0;
|
||||
if (globalCtx->csCtx.state == 0) {
|
||||
func_80077684(globalCtx);
|
||||
} else if (func_800FA0B4(0) == 1) {
|
||||
@@ -101,14 +101,14 @@ void EnOkarinaEffect_ManageStorm(EnOkarinaEffect* this, GlobalContext* globalCtx
|
||||
func_800F6D58(0xE, 1, 0);
|
||||
}
|
||||
osSyncPrintf("\n\n\nE_wether_flg=[%d]", D_8011FB30);
|
||||
osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->gloomySkyEvent);
|
||||
if (D_8011FB30 == 0 && (globalCtx->gloomySkyEvent == 1)) {
|
||||
globalCtx->gloomySkyEvent = 2; // end gloomy sky
|
||||
osSyncPrintf("\nrain_evt_trg=[%d]\n\n", globalCtx->envCtx.gloomySkyEvent);
|
||||
if (D_8011FB30 == 0 && (globalCtx->envCtx.gloomySkyEvent == 1)) {
|
||||
globalCtx->envCtx.gloomySkyEvent = 2; // end gloomy sky
|
||||
} else {
|
||||
globalCtx->gloomySkyEvent = 0;
|
||||
globalCtx->unk_10B02 = 0;
|
||||
globalCtx->envCtx.gloomySkyEvent = 0;
|
||||
globalCtx->envCtx.unk_DE = 0;
|
||||
}
|
||||
globalCtx->lightning = 2; // end lightning
|
||||
globalCtx->envCtx.lightning = 2; // end lightning
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,11 +266,11 @@ void func_80AF2AB4(EnRu2* this, GlobalContext* globalCtx) {
|
||||
Player* player;
|
||||
s16 temp;
|
||||
|
||||
if (gSaveContext.chamber_cutscene_num == 2 && gSaveContext.scene_setup_index < 4) {
|
||||
if (gSaveContext.chamberCutsceneNum == 2 && gSaveContext.sceneSetupIndex < 4) {
|
||||
player = PLAYER;
|
||||
this->action = 1;
|
||||
globalCtx->csCtx.segment = &D_80AF411C;
|
||||
gSaveContext.cutscene_trigger = 2;
|
||||
gSaveContext.cutsceneTrigger = 2;
|
||||
Item_Give(globalCtx, ITEM_MEDALLION_WATER);
|
||||
temp = this->actor.posRot.rot.y + 0x8000;
|
||||
player->actor.shape.rot.y = temp;
|
||||
@@ -626,7 +626,7 @@ s32 func_80AF383C(EnRu2* this, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void func_80AF3878(EnRu2* this, GlobalContext* globalCtx) {
|
||||
if (func_80AF383C(this, globalCtx) && !func_800BFC84(globalCtx)) {
|
||||
if (func_80AF383C(this, globalCtx) && !Gameplay_InCsMode(globalCtx)) {
|
||||
this->action = 16;
|
||||
func_800800F8(globalCtx, 0xC3A, -0x63, &this->actor, 0);
|
||||
}
|
||||
@@ -667,7 +667,7 @@ void func_80AF39DC(EnRu2* this, GlobalContext* globalCtx) {
|
||||
if (this->unk_2C2 % 6 == 3) {
|
||||
player = PLAYER;
|
||||
osSyncPrintf("うおりゃー! \n");
|
||||
func_8005B1A4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]);
|
||||
func_8005B1A4(globalCtx->cameraPtrs[globalCtx->activeCamera]);
|
||||
player->actor.posRot.pos.x = 820.0f;
|
||||
player->actor.posRot.pos.y = 0.0f;
|
||||
player->actor.posRot.pos.z = 180.0f;
|
||||
@@ -678,7 +678,7 @@ void func_80AF39DC(EnRu2* this, GlobalContext* globalCtx) {
|
||||
this->unk_2C3 = dialogState;
|
||||
if (func_8010BDBC(msgCtx) == 2) {
|
||||
this->action = 18;
|
||||
func_8005B1A4(globalCtx->cameraCtx.activeCameraPtrs[globalCtx->cameraCtx.unk_5C0]);
|
||||
func_8005B1A4(globalCtx->cameraPtrs[globalCtx->activeCamera]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ u16 func_80B1C54C(GlobalContext* globalCtx, Actor* a1) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (gSaveContext.inf_table[13] & 0x0200) {
|
||||
if (gSaveContext.infTable[13] & 0x0200) {
|
||||
/* "Do you want me to dig here? ..." */
|
||||
return 0x5019;
|
||||
} else {
|
||||
@@ -373,7 +373,7 @@ s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* actor) {
|
||||
case 2:
|
||||
/* "I am the boss of the carpenters ..." (wtf?) */
|
||||
if (actor->textId == 0x5028) {
|
||||
gSaveContext.inf_table[13] |= 0x0100;
|
||||
gSaveContext.infTable[13] |= 0x0100;
|
||||
}
|
||||
ret = 0;
|
||||
break;
|
||||
@@ -390,11 +390,11 @@ s16 func_80B1C5A0(GlobalContext* globalCtx, Actor* actor) {
|
||||
} else {
|
||||
globalCtx->msgCtx.msgMode = 0x37;
|
||||
Rupees_ChangeBy(-10);
|
||||
gSaveContext.inf_table[13] |= 0x0200;
|
||||
gSaveContext.infTable[13] |= 0x0200;
|
||||
return 2;
|
||||
}
|
||||
func_8010B720(globalCtx, actor->textId);
|
||||
gSaveContext.inf_table[13] |= 0x0200;
|
||||
gSaveContext.infTable[13] |= 0x0200;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
@@ -507,7 +507,7 @@ void EnTk_Init(EnTk* this, GlobalContext* globalCtx) {
|
||||
|
||||
func_80061EFC(&thisAgain->actor.sub_98, NULL, &D_80B1D534);
|
||||
|
||||
if (gSaveContext.day_time <= 0xC000 || gSaveContext.day_time >= 0xE000 || !LINK_IS_CHILD ||
|
||||
if (gSaveContext.dayTime <= 0xC000 || gSaveContext.dayTime >= 0xE000 || !LINK_IS_CHILD ||
|
||||
globalCtx->sceneNum != SCENE_SPOT02) {
|
||||
Actor_Kill(&thisAgain->actor);
|
||||
return;
|
||||
@@ -629,8 +629,8 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
|
||||
* Upgrade the purple rupee reward to the heart piece if this
|
||||
* is the first grand prize dig.
|
||||
*/
|
||||
if ((gSaveContext.item_get_inf[1] & 0x1000) == 0) {
|
||||
gSaveContext.item_get_inf[1] |= 0x1000;
|
||||
if ((gSaveContext.itemGetInf[1] & 0x1000) == 0) {
|
||||
gSaveContext.itemGetInf[1] |= 0x1000;
|
||||
this->currentReward = 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ void EnTuboTrap_WaitForProximity(EnTuboTrap* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.xzDistanceFromLink < 200.0f && this->actor.posRot.pos.y <= player->actor.posRot.pos.y) {
|
||||
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, this, ACTORTYPE_ENEMY);
|
||||
this->actor.flags |= 1;
|
||||
targetHeight = 40.0f + -10.0f * gSaveContext.link_age;
|
||||
targetHeight = 40.0f + -10.0f * gSaveContext.linkAge;
|
||||
|
||||
this->targetY = player->actor.posRot.pos.y + targetHeight;
|
||||
if (this->targetY < this->actor.posRot.pos.y) {
|
||||
|
||||
@@ -69,7 +69,7 @@ static ActorDamageChart damageChart = { {
|
||||
{ 0x0, 0x2 }, { 0x0, 0x2 }, { 0x0, 0x8 }, { 0x0, 0x4 }, { 0x0, 0x0 }, { 0x0, 0x0 }, { 0x0, 0x4 }, { 0x0, 0x0 },
|
||||
} };
|
||||
|
||||
static InitChainEntry initChain[3] = {
|
||||
static InitChainEntry initChain[] = {
|
||||
ICHAIN_S8(naviEnemyId, 0x30, 1),
|
||||
ICHAIN_F32(unk_4C, 0x157C, 1),
|
||||
ICHAIN_F32_DIV1000(gravity, 0xFA24, 0),
|
||||
@@ -295,7 +295,7 @@ void EnWallmas_WaitToDrop(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
|
||||
void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
if ((func_8008E988(globalCtx) == 0) && (player->stateFlags2 & 0x10) == 0 && (player->unk_A78 >= 0) &&
|
||||
if (!func_8008E988(globalCtx) && (player->stateFlags2 & 0x10) == 0 && (player->unk_A78 >= 0) &&
|
||||
(this->actor.xzDistanceFromLink < 30.0f) && (this->actor.yDistanceFromLink < -5.0f) &&
|
||||
(-(f32)(player->unk_4DA + 0xA) < this->actor.yDistanceFromLink)) {
|
||||
EnWallmas_TakePlayerBegin(this, globalCtx);
|
||||
@@ -417,14 +417,14 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
this->actor.posRot.pos.y = this->actor.posRot.pos.y + 10.0f;
|
||||
}
|
||||
|
||||
if (gSaveContext.link_age != 0) {
|
||||
if (LINK_IS_CHILD) {
|
||||
player->actor.posRot.pos.y = this->actor.posRot.pos.y - 30.0f;
|
||||
} else {
|
||||
player->actor.posRot.pos.y = this->actor.posRot.pos.y - 50.0f;
|
||||
}
|
||||
|
||||
if (this->timer == -0x1E) {
|
||||
if (gSaveContext.link_age != 0) {
|
||||
if (LINK_IS_CHILD) {
|
||||
func_8002F7DC(&this->actor, NA_SE_VO_LI_TAKEN_AWAY_KID);
|
||||
} else {
|
||||
func_8002F7DC(&this->actor, NA_SE_VO_LI_TAKEN_AWAY);
|
||||
@@ -436,8 +436,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
|
||||
this->timer = this->timer + 2;
|
||||
} else {
|
||||
Math_ApproxF(&this->actor.posRot.pos.y,
|
||||
player->actor.posRot.pos.y + (gSaveContext.link_age != 0 ? 30.0f : 50.0f), 5.0f);
|
||||
Math_ApproxF(&this->actor.posRot.pos.y, player->actor.posRot.pos.y + (LINK_IS_CHILD ? 30.0f : 50.0f), 5.0f);
|
||||
}
|
||||
|
||||
Math_ApproxF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 3.0f);
|
||||
@@ -445,7 +444,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
|
||||
|
||||
if (this->timer == 0x1E) {
|
||||
func_80078884(NA_SE_OC_ABYSS);
|
||||
func_800C0C88(globalCtx);
|
||||
Gameplay_TriggerRespawn(globalCtx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "z_obj_makekinsuta.h"
|
||||
|
||||
#include <vt.h>
|
||||
|
||||
#define FLAGS 0x00000010
|
||||
|
||||
void ObjMakekinsuta_Init(ObjMakekinsuta* this, GlobalContext* globalCtx);
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
#include <vt.h>
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ Actor actor;
|
||||
|
||||
@@ -46,8 +46,8 @@ void ObjRoomtimer_Init(ObjRoomtimer* this, GlobalContext* globalCtx) {
|
||||
|
||||
void ObjRoomtimer_Destroy(ObjRoomtimer* this, GlobalContext* globalCtx) {
|
||||
if (this->actor.params != 0x3FF) {
|
||||
if (gSaveContext.timer_1_value > 0) {
|
||||
gSaveContext.timer_1_state = 10;
|
||||
if (gSaveContext.timer1Value > 0) {
|
||||
gSaveContext.timer1State = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ void func_80B9D054(ObjRoomtimer* this, GlobalContext* globalCtx) {
|
||||
void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) {
|
||||
if (Flags_GetTempClear(globalCtx, this->actor.room)) {
|
||||
if (this->actor.params != 0x3FF) {
|
||||
gSaveContext.timer_1_state = 10;
|
||||
gSaveContext.timer1State = 10;
|
||||
}
|
||||
|
||||
Flags_SetClear(globalCtx, this->actor.room);
|
||||
@@ -73,9 +73,9 @@ void func_80B9D0B0(ObjRoomtimer* this, GlobalContext* globalCtx) {
|
||||
Actor_Kill(&this->actor);
|
||||
} else {
|
||||
if (this->actor.params != 0x3FF) {
|
||||
if (gSaveContext.timer_1_value == 0) {
|
||||
if (gSaveContext.timer1Value == 0) {
|
||||
Audio_PlaySoundGeneral(NA_SE_OC_ABYSS, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
func_800C0B60(globalCtx); // Void Out
|
||||
Gameplay_TriggerVoidOut(globalCtx);
|
||||
Actor_Kill(&this->actor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,22 +7,22 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
void Opening_SetNextGameState(OpeningContext* this) {
|
||||
gSaveContext.game_mode = 1;
|
||||
void Opening_SetupTitleScreen(OpeningContext* this) {
|
||||
gSaveContext.gameMode = 1;
|
||||
this->state.running = false;
|
||||
gSaveContext.link_age = 0;
|
||||
gSaveContext.linkAge = 0;
|
||||
func_800A82C8();
|
||||
gSaveContext.cutscene_index = 0xFFF3;
|
||||
gSaveContext.scene_setup_index = 7;
|
||||
SET_NEXT_GAMESTATE(&this->state, func_800BCA64, GlobalContext);
|
||||
gSaveContext.cutsceneIndex = 0xFFF3;
|
||||
gSaveContext.sceneSetupIndex = 7;
|
||||
SET_NEXT_GAMESTATE(&this->state, Gameplay_Init, GlobalContext);
|
||||
}
|
||||
|
||||
void func_80803C5C(OpeningContext* this) {
|
||||
}
|
||||
|
||||
void Opening_Update(OpeningContext* this) {
|
||||
void Opening_Main(OpeningContext* this) {
|
||||
func_80095248(this->state.gfxCtx, 0, 0, 0);
|
||||
Opening_SetNextGameState(this);
|
||||
Opening_SetupTitleScreen(this);
|
||||
func_80803C5C(this);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ void Opening_Destroy(OpeningContext* this) {
|
||||
void Opening_Init(OpeningContext* this) {
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
func_800AA278(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Opening_Update;
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Opening_Main;
|
||||
this->state.destroy = Opening_Destroy;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void Title_Calc(TitleContext* this) {
|
||||
this->exit = 1;
|
||||
}
|
||||
|
||||
void Title_InitView(TitleContext* this, f32 x, f32 y, f32 z) {
|
||||
void Title_SetupView(TitleContext* this, f32 x, f32 y, f32 z) {
|
||||
View* view;
|
||||
Vec3f v1;
|
||||
Vec3f v2;
|
||||
@@ -91,7 +91,7 @@ void Title_Draw(TitleContext* this) {
|
||||
|
||||
func_8002EABC(&v1, &v2, &v3, this->state.gfxCtx);
|
||||
gSPSetLights1(gfxCtx->polyOpa.p++, sTitleLights);
|
||||
Title_InitView(this, 0, 150.0, 300.0);
|
||||
Title_SetupView(this, 0, 150.0, 300.0);
|
||||
func_80093D18(this->state.gfxCtx);
|
||||
Matrix_Translate(-53.0, -5.0, 0, MTXMODE_NEW);
|
||||
Matrix_Scale(1.0, 1.0, 1.0, MTXMODE_APPLY);
|
||||
@@ -127,12 +127,11 @@ void Title_Draw(TitleContext* this) {
|
||||
Graph_CloseDisps(dispRefs, this->state.gfxCtx, "../z_title.c", 483);
|
||||
}
|
||||
|
||||
void Title_Update(TitleContext* this) {
|
||||
void Title_Main(TitleContext* this) {
|
||||
GraphicsContext* gfxCtx = this->state.gfxCtx;
|
||||
u32 pad;
|
||||
Gfx* dispRefs[4];
|
||||
u32 pad2;
|
||||
Gfx* gfx[2];
|
||||
Gfx* dispRefs[5];
|
||||
u32 pad[2];
|
||||
Gfx* gfx;
|
||||
|
||||
Graph_OpenDisps(dispRefs, this->state.gfxCtx, "../z_title.c", 494);
|
||||
|
||||
@@ -142,14 +141,14 @@ void Title_Update(TitleContext* this) {
|
||||
Title_Calc(this);
|
||||
Title_Draw(this);
|
||||
if (D_8012DBC0) {
|
||||
gfx[0] = gfxCtx->polyOpa.p;
|
||||
gfx = gfxCtx->polyOpa.p;
|
||||
Title_PrintBuildInfo(&gfx);
|
||||
gfxCtx->polyOpa.p = gfx[0];
|
||||
gfxCtx->polyOpa.p = gfx;
|
||||
}
|
||||
if (this->exit) {
|
||||
gSaveContext.seq_index = -1;
|
||||
gSaveContext.night_sfx = -1;
|
||||
gSaveContext.game_mode = 1;
|
||||
gSaveContext.seqIndex = 0xFF;
|
||||
gSaveContext.nightSeqIndex = 0xFF;
|
||||
gSaveContext.gameMode = 1;
|
||||
this->state.running = false;
|
||||
SET_NEXT_GAMESTATE(&this->state, Opening_Init, OpeningContext);
|
||||
}
|
||||
@@ -173,11 +172,11 @@ void Title_Init(TitleContext* this) {
|
||||
DmaMgr_SendRequest1(this->staticSegment, (u32)_nintendo_rogo_staticSegmentRomStart, size, "../z_title.c", 615);
|
||||
R_UPDATE_RATE = 1;
|
||||
Matrix_Init(&this->state);
|
||||
func_800AA278(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Title_Update;
|
||||
View_Init(&this->view, this->state.gfxCtx);
|
||||
this->state.main = Title_Main;
|
||||
this->state.destroy = Title_Destroy;
|
||||
this->exit = false;
|
||||
gSaveContext.file_num = 0xFF;
|
||||
gSaveContext.fileNum = 0xFF;
|
||||
func_800A9CD4(&this->state, &this->sram);
|
||||
this->ult = 0;
|
||||
this->unk_1D4 = 0x14;
|
||||
|
||||
Reference in New Issue
Block a user