mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-12 19:04:38 +00:00
Decompiles most FBDemo and transition functions (#92)
* Decompile fbdemo (transition) files * run format.sh * reformat vtx array, fill in a couple unk * match TransitionTriforce_IsDone * add VTX macro, add DW_ wrapping around triangle macros * use new VTX macro, name graphic assets * Naming updates * pr updates * naming updates * remove symbols for COLOR_BUFFER, D_08000000, and D_09000000
This commit is contained in:
parent
16b304d548
commit
5525365f7f
46 changed files with 1905 additions and 2153 deletions
|
@ -6,8 +6,8 @@ void* D_8012D1F0 = NULL;
|
|||
UNK_TYPE D_8012D1F4 = 0; // unused
|
||||
Input* D_8012D1F8 = NULL;
|
||||
|
||||
TransitionStruct D_801613B0;
|
||||
s32 D_80161490;
|
||||
TransitionUnk sTrnsnUnk;
|
||||
s32 gTrnsnUnkState;
|
||||
VisMonoStruct D_80161498;
|
||||
Color_RGBA8 D_801614B0;
|
||||
FaultClient D_801614B8;
|
||||
|
@ -48,49 +48,49 @@ void func_800BC590(GlobalContext* globalCtx) {
|
|||
|
||||
#ifdef NON_MATCHING
|
||||
// single minor ordering difference
|
||||
void func_800BC5E0(GlobalContext* globalCtx, s32 arg1) {
|
||||
void func_800BC5E0(GlobalContext* globalCtx, s32 transitionType) {
|
||||
TransitionContext* transitionCtx = &globalCtx->transitionCtx;
|
||||
|
||||
bzero(transitionCtx, sizeof(TransitionContext));
|
||||
|
||||
transitionCtx->unk_228 = arg1;
|
||||
transitionCtx->transitionType = transitionType;
|
||||
|
||||
if ((transitionCtx->unk_228 >> 5) == 1) {
|
||||
transitionCtx->unk_22C = func_800B301C;
|
||||
transitionCtx->unk_230 = func_800B3044;
|
||||
transitionCtx->unk_23C = func_800B2E30;
|
||||
transitionCtx->unk_24C = func_800B346C;
|
||||
transitionCtx->unk_238 = func_800B31D0;
|
||||
transitionCtx->unk_234 = func_800B304C;
|
||||
transitionCtx->unk_240 = func_800B3474;
|
||||
transitionCtx->unk_244 = func_800B34CC;
|
||||
transitionCtx->unk_248 = func_800B34D4;
|
||||
if ((transitionCtx->transitionType >> 5) == 1) {
|
||||
transitionCtx->init = TransitionCircle_Init;
|
||||
transitionCtx->destroy = TransitionCircle_Destroy;
|
||||
transitionCtx->start = TransitionCircle_Start;
|
||||
transitionCtx->isDone = TransitionCircle_IsDone;
|
||||
transitionCtx->draw = TransitionCircle_Draw;
|
||||
transitionCtx->update = TransitionCircle_Update;
|
||||
transitionCtx->setType = TransitionCircle_SetType;
|
||||
transitionCtx->setColor = TransitionCircle_SetColor;
|
||||
transitionCtx->setEnvColor = TransitionCircle_SetEnvColor;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (transitionCtx->unk_228) {
|
||||
switch (transitionCtx->transitionType) {
|
||||
case 1:
|
||||
transitionCtx->unk_22C = func_800B2438;
|
||||
transitionCtx->unk_230 = func_800B24D0;
|
||||
transitionCtx->unk_23C = func_800B2400;
|
||||
transitionCtx->unk_24C = func_800B2944;
|
||||
transitionCtx->unk_238 = func_800B2604;
|
||||
transitionCtx->unk_234 = func_800B24D8;
|
||||
transitionCtx->unk_240 = func_800B25F4;
|
||||
transitionCtx->unk_244 = func_800B25EC;
|
||||
transitionCtx->unk_248 = NULL;
|
||||
transitionCtx->init = TransitionTriforce_Init;
|
||||
transitionCtx->destroy = TransitionTriforce_Destroy;
|
||||
transitionCtx->start = TransitionTriforce_Start;
|
||||
transitionCtx->isDone = TransitionTriforce_IsDone;
|
||||
transitionCtx->draw = TransitionTriforce_Draw;
|
||||
transitionCtx->update = TransitionTriforce_Update;
|
||||
transitionCtx->setType = TransitionTriforce_SetType;
|
||||
transitionCtx->setColor = TransitionTriforce_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
return;
|
||||
case 0:
|
||||
case 8:
|
||||
transitionCtx->unk_22C = func_800B2A88;
|
||||
transitionCtx->unk_230 = func_800B2AB0;
|
||||
transitionCtx->unk_23C = func_800B29D0;
|
||||
transitionCtx->unk_24C = func_800B2DD4;
|
||||
transitionCtx->unk_238 = func_800B2B98;
|
||||
transitionCtx->unk_234 = func_800B2AB8;
|
||||
transitionCtx->unk_240 = func_800B2DDC;
|
||||
transitionCtx->unk_244 = func_800B2E1C;
|
||||
transitionCtx->unk_248 = NULL;
|
||||
transitionCtx->init = TransitionWipe_Init;
|
||||
transitionCtx->destroy = TransitionWipe_Destroy;
|
||||
transitionCtx->start = TransitionWipe_Start;
|
||||
transitionCtx->isDone = TransitionWipe_IsDone;
|
||||
transitionCtx->draw = TransitionWipe_Draw;
|
||||
transitionCtx->update = TransitionWipe_Update;
|
||||
transitionCtx->setType = TransitionWipe_SetType;
|
||||
transitionCtx->setColor = TransitionWipe_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
return;
|
||||
case 2:
|
||||
case 3:
|
||||
|
@ -101,34 +101,34 @@ void func_800BC5E0(GlobalContext* globalCtx, s32 arg1) {
|
|||
case 17:
|
||||
case 18:
|
||||
case 19:
|
||||
transitionCtx->unk_22C = func_800B3538;
|
||||
transitionCtx->unk_230 = func_800B3560;
|
||||
transitionCtx->unk_23C = func_800B34E0;
|
||||
transitionCtx->unk_24C = func_800B37DC;
|
||||
transitionCtx->unk_238 = func_800B3718;
|
||||
transitionCtx->unk_234 = func_800B3568;
|
||||
transitionCtx->unk_240 = func_800B37EC;
|
||||
transitionCtx->unk_244 = func_800B37E4;
|
||||
transitionCtx->unk_248 = NULL;
|
||||
transitionCtx->init = TransitionFade_Init;
|
||||
transitionCtx->destroy = TransitionFade_Destroy;
|
||||
transitionCtx->start = TransitionFade_Start;
|
||||
transitionCtx->isDone = TransitionFade_IsDone;
|
||||
transitionCtx->draw = TransitionFade_Draw;
|
||||
transitionCtx->update = TransitionFade_Update;
|
||||
transitionCtx->setType = TransitionFade_SetType;
|
||||
transitionCtx->setColor = TransitionFade_SetColor;
|
||||
transitionCtx->setEnvColor = NULL;
|
||||
return;
|
||||
case 9:
|
||||
case 10:
|
||||
globalCtx->unk_1241B = 4;
|
||||
globalCtx->transitionMode = 4;
|
||||
return;
|
||||
case 11:
|
||||
globalCtx->unk_1241B = 10;
|
||||
globalCtx->transitionMode = 10;
|
||||
return;
|
||||
case 12:
|
||||
globalCtx->unk_1241B = 7;
|
||||
globalCtx->transitionMode = 7;
|
||||
return;
|
||||
case 14:
|
||||
globalCtx->unk_1241B = 12;
|
||||
globalCtx->transitionMode = 12;
|
||||
return;
|
||||
case 15:
|
||||
globalCtx->unk_1241B = 14;
|
||||
globalCtx->transitionMode = 14;
|
||||
return;
|
||||
case 16:
|
||||
globalCtx->unk_1241B = 16;
|
||||
globalCtx->transitionMode = 16;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ void func_800BC5E0(GlobalContext* globalCtx, s32 arg1) {
|
|||
#endif
|
||||
|
||||
void func_800BC88C(GlobalContext* globalCtx) {
|
||||
globalCtx->transitionCtx.unk_228 = -1;
|
||||
globalCtx->transitionCtx.transitionType = -1;
|
||||
}
|
||||
|
||||
Gfx* func_800BC8A0(GlobalContext* globalCtx, Gfx* gfx) {
|
||||
|
@ -161,19 +161,19 @@ void Gameplay_Destroy(GlobalContext* globalCtx) {
|
|||
Effect_SS_Clear(globalCtx);
|
||||
CollisionCheck_DestroyContext(globalCtx, &globalCtx->colChkCtx);
|
||||
|
||||
if (D_80161490 == 3) {
|
||||
func_800B1DBC(&D_801613B0);
|
||||
D_80161490 = 0;
|
||||
if (gTrnsnUnkState == 3) {
|
||||
TransitionUnk_Destroy(&sTrnsnUnk);
|
||||
gTrnsnUnkState = 0;
|
||||
}
|
||||
|
||||
if (globalCtx->unk_1241B == 3) {
|
||||
globalCtx->transitionCtx.unk_230(&globalCtx->transitionCtx);
|
||||
if (globalCtx->transitionMode == 3) {
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx.data);
|
||||
func_800BC88C(globalCtx);
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
|
||||
func_800B3968();
|
||||
func_800B3560(&globalCtx->sub_1241C);
|
||||
TransitionFade_Destroy(&globalCtx->transitionFade);
|
||||
func_800AD054(&D_80161498);
|
||||
|
||||
if (gSaveContext.linkAge != globalCtx->linkAgeOnLoad) {
|
||||
|
@ -336,8 +336,8 @@ void Gameplay_Init(GlobalContext* globalCtx) {
|
|||
func_800C0EA8(&globalCtx->preRenderCtx);
|
||||
func_800C0E70(&globalCtx->preRenderCtx, 0x140, 0xF0, 0, 0, 0);
|
||||
func_800C0ED8(&globalCtx->preRenderCtx, 0x140, 0xF0, 0, 0);
|
||||
D_80161490 = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
func_8008E6A0(&globalCtx->sub_7B8);
|
||||
func_800FD9A0((u32)osGetTime());
|
||||
Matrix_Init(&globalCtx->state);
|
||||
|
@ -361,10 +361,10 @@ void Gameplay_Init(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
func_800B3908();
|
||||
func_800B3538(&globalCtx->sub_1241C);
|
||||
func_800B37EC(&globalCtx->sub_1241C, 3);
|
||||
func_800B37E4(&globalCtx->sub_1241C, RGBA8(0xA0, 0xA0, 0xA0, 0xFF));
|
||||
func_800B34E0(&globalCtx->sub_1241C);
|
||||
TransitionFade_Init(&globalCtx->transitionFade);
|
||||
TransitionFade_SetType(&globalCtx->transitionFade, 3);
|
||||
TransitionFade_SetColor(&globalCtx->transitionFade, RGBA8(0xA0, 0xA0, 0xA0, 0xFF));
|
||||
TransitionFade_Start(&globalCtx->transitionFade);
|
||||
func_800AD000(&D_80161498);
|
||||
D_801614B0.a = 0x00;
|
||||
func_8006C3A0(globalCtx);
|
||||
|
@ -458,30 +458,30 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
gSegments[2] = PHYSICAL_TO_VIRTUAL(globalCtx->sceneSegment);
|
||||
|
||||
if (func_8008E6AC(&globalCtx->sub_7B8, &input[1]) != 0) {
|
||||
if ((globalCtx->unk_1241B == 0) && (globalCtx->sceneLoadFlag != 0)) {
|
||||
globalCtx->unk_1241B = 1;
|
||||
if ((globalCtx->transitionMode == 0) && (globalCtx->sceneLoadFlag != 0)) {
|
||||
globalCtx->transitionMode = 1;
|
||||
}
|
||||
|
||||
if (D_80161490 != 0) {
|
||||
switch (D_80161490) {
|
||||
if (gTrnsnUnkState != 0) {
|
||||
switch (gTrnsnUnkState) {
|
||||
case 2:
|
||||
if (func_800B1E84(&D_801613B0, 10, 7) == 0) {
|
||||
if (TransitionUnk_Init(&sTrnsnUnk, 10, 7) == 0) {
|
||||
osSyncPrintf("fbdemo_init呼出し失敗!\n"); // "fbdemo_init call failed!"
|
||||
D_80161490 = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
} else {
|
||||
D_801613B0.unk_DC = gZBuffer;
|
||||
D_80161490 = 3;
|
||||
sTrnsnUnk.zBuffer = gZBuffer;
|
||||
gTrnsnUnkState = 3;
|
||||
R_UPDATE_RATE = 1;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
func_800B23E8(&D_801613B0);
|
||||
func_800B23E8(&sTrnsnUnk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->unk_1241B != 0) {
|
||||
switch (globalCtx->unk_1241B) {
|
||||
if (globalCtx->transitionMode != 0) {
|
||||
switch (globalCtx->transitionMode) {
|
||||
case 1:
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
s16 sp6E = 0;
|
||||
|
@ -508,78 +508,91 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
func_800BC5E0(globalCtx, CREG(12));
|
||||
}
|
||||
|
||||
if (globalCtx->unk_1241B >= 4) {
|
||||
if (globalCtx->transitionMode >= 4) {
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
globalCtx->transitionCtx.unk_22C(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.init(&globalCtx->transitionCtx.data);
|
||||
|
||||
if ((globalCtx->transitionCtx.unk_228 >> 5) == 1) {
|
||||
globalCtx->transitionCtx.unk_240(&globalCtx->transitionCtx,
|
||||
globalCtx->transitionCtx.unk_228 | 0x80);
|
||||
if ((globalCtx->transitionCtx.transitionType >> 5) == 1) {
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data,
|
||||
globalCtx->transitionCtx.transitionType | 0x80);
|
||||
}
|
||||
|
||||
gSaveContext.unk_1419 = 14;
|
||||
if ((globalCtx->transitionCtx.unk_228 == 8) || (globalCtx->transitionCtx.unk_228 == 9)) {
|
||||
if ((globalCtx->transitionCtx.transitionType == 8) ||
|
||||
(globalCtx->transitionCtx.transitionType == 9)) {
|
||||
gSaveContext.unk_1419 = 28;
|
||||
}
|
||||
|
||||
gSaveContext.fadeDuration = 60;
|
||||
if ((globalCtx->transitionCtx.unk_228 == 4) || (globalCtx->transitionCtx.unk_228 == 5)) {
|
||||
if ((globalCtx->transitionCtx.transitionType == 4) ||
|
||||
(globalCtx->transitionCtx.transitionType == 5)) {
|
||||
gSaveContext.fadeDuration = 20;
|
||||
} else if ((globalCtx->transitionCtx.unk_228 == 6) || (globalCtx->transitionCtx.unk_228 == 7)) {
|
||||
} else if ((globalCtx->transitionCtx.transitionType == 6) ||
|
||||
(globalCtx->transitionCtx.transitionType == 7)) {
|
||||
gSaveContext.fadeDuration = 150;
|
||||
} else if (globalCtx->transitionCtx.unk_228 == 17) {
|
||||
} else if (globalCtx->transitionCtx.transitionType == 17) {
|
||||
gSaveContext.fadeDuration = 2;
|
||||
}
|
||||
|
||||
if ((globalCtx->transitionCtx.unk_228 == 3) || (globalCtx->transitionCtx.unk_228 == 5) ||
|
||||
(globalCtx->transitionCtx.unk_228 == 7) || (globalCtx->transitionCtx.unk_228 == 13) ||
|
||||
(globalCtx->transitionCtx.unk_228 == 17)) {
|
||||
globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0xA0, 0xA0, 0xA0, 0xFF));
|
||||
if (globalCtx->transitionCtx.unk_248 != NULL) {
|
||||
globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0xA0, 0xA0, 0xA0, 0xFF));
|
||||
if ((globalCtx->transitionCtx.transitionType == 3) ||
|
||||
(globalCtx->transitionCtx.transitionType == 5) ||
|
||||
(globalCtx->transitionCtx.transitionType == 7) ||
|
||||
(globalCtx->transitionCtx.transitionType == 13) ||
|
||||
(globalCtx->transitionCtx.transitionType == 17)) {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0xA0, 0xA0, 0xA0, 0xFF));
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0xA0, 0xA0, 0xA0, 0xFF));
|
||||
}
|
||||
} else if (globalCtx->transitionCtx.unk_228 == 18) {
|
||||
globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0x8C, 0x8C, 0x64, 0xFF));
|
||||
if (globalCtx->transitionCtx.unk_248 != NULL) {
|
||||
globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0x8C, 0x8C, 0x64, 0xFF));
|
||||
} else if (globalCtx->transitionCtx.transitionType == 18) {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0x8C, 0x8C, 0x64, 0xFF));
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0x8C, 0x8C, 0x64, 0xFF));
|
||||
}
|
||||
} else if (globalCtx->transitionCtx.unk_228 == 19) {
|
||||
globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0x46, 0x64, 0x6E, 0xFF));
|
||||
if (globalCtx->transitionCtx.unk_248 != NULL) {
|
||||
globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0x46, 0x64, 0x6E, 0xFF));
|
||||
} else if (globalCtx->transitionCtx.transitionType == 19) {
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0x46, 0x64, 0x6E, 0xFF));
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0x46, 0x64, 0x6E, 0xFF));
|
||||
}
|
||||
} else {
|
||||
globalCtx->transitionCtx.unk_244(&globalCtx->transitionCtx, RGBA8(0x00, 0x00, 0x00, 0x00));
|
||||
if (globalCtx->transitionCtx.unk_248 != NULL) {
|
||||
globalCtx->transitionCtx.unk_248(&globalCtx->transitionCtx, RGBA8(0x00, 0x00, 0x00, 0x00));
|
||||
globalCtx->transitionCtx.setColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0x00, 0x00, 0x00, 0x00));
|
||||
if (globalCtx->transitionCtx.setEnvColor != NULL) {
|
||||
globalCtx->transitionCtx.setEnvColor(&globalCtx->transitionCtx.data,
|
||||
RGBA8(0x00, 0x00, 0x00, 0x00));
|
||||
}
|
||||
}
|
||||
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
globalCtx->transitionCtx.unk_240(&globalCtx->transitionCtx, 1);
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 1);
|
||||
} else {
|
||||
globalCtx->transitionCtx.unk_240(&globalCtx->transitionCtx, 2);
|
||||
globalCtx->transitionCtx.setType(&globalCtx->transitionCtx.data, 2);
|
||||
}
|
||||
|
||||
globalCtx->transitionCtx.unk_23C(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.start(&globalCtx->transitionCtx);
|
||||
|
||||
if (globalCtx->transitionCtx.unk_228 == 13) {
|
||||
globalCtx->unk_1241B = 11;
|
||||
if (globalCtx->transitionCtx.transitionType == 13) {
|
||||
globalCtx->transitionMode = 11;
|
||||
} else {
|
||||
globalCtx->unk_1241B = 3;
|
||||
globalCtx->transitionMode = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (globalCtx->transitionCtx.unk_24C(&globalCtx->transitionCtx) != 0) {
|
||||
if (globalCtx->transitionCtx.unk_228 >= 56) {
|
||||
if (globalCtx->transitionCtx.isDone(&globalCtx->transitionCtx) != 0) {
|
||||
if (globalCtx->transitionCtx.transitionType >= 56) {
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
globalCtx->transitionCtx.unk_230(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx);
|
||||
func_800BC88C(globalCtx);
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
} else if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->state.running = 0;
|
||||
|
@ -593,23 +606,23 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
SET_NEXT_GAMESTATE(&globalCtx->state, func_80811A20, char[0x1CAE0]);
|
||||
}
|
||||
} else {
|
||||
globalCtx->transitionCtx.unk_230(&globalCtx->transitionCtx);
|
||||
globalCtx->transitionCtx.destroy(&globalCtx->transitionCtx);
|
||||
func_800BC88C(globalCtx);
|
||||
globalCtx->unk_1241B = 0;
|
||||
if (D_80161490 == 3) {
|
||||
func_800B1DBC(&D_801613B0);
|
||||
D_80161490 = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
if (gTrnsnUnkState == 3) {
|
||||
TransitionUnk_Destroy(&sTrnsnUnk);
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
}
|
||||
}
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
} else {
|
||||
globalCtx->transitionCtx.unk_234(&globalCtx->transitionCtx, R_UPDATE_RATE);
|
||||
globalCtx->transitionCtx.update(&globalCtx->transitionCtx.data, R_UPDATE_RATE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
switch (globalCtx->unk_1241B) {
|
||||
switch (globalCtx->transitionMode) {
|
||||
case 4:
|
||||
D_801614C8 = 0;
|
||||
globalCtx->envCtx.unk_E1 = 1;
|
||||
|
@ -618,10 +631,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
globalCtx->envCtx.unk_E2[2] = 0xA0;
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->envCtx.unk_E2[3] = 0;
|
||||
globalCtx->unk_1241B = 5;
|
||||
globalCtx->transitionMode = 5;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 0xFF;
|
||||
globalCtx->unk_1241B = 6;
|
||||
globalCtx->transitionMode = 6;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -632,7 +645,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
|
||||
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
} else {
|
||||
D_801614C8++;
|
||||
}
|
||||
|
@ -641,10 +654,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
case 6:
|
||||
globalCtx->envCtx.unk_E2[3] = (1 - D_801614C8 / 20.0f) * 255.0f;
|
||||
if (D_801614C8 >= 20 && 1) {
|
||||
D_80161490 = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
globalCtx->envCtx.unk_E1 = 0;
|
||||
} else {
|
||||
D_801614C8++;
|
||||
|
@ -659,10 +672,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
globalCtx->envCtx.unk_E2[2] = 0x96;
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->envCtx.unk_E2[3] = 0;
|
||||
globalCtx->unk_1241B = 5;
|
||||
globalCtx->transitionMode = 5;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E2[3] = 0xFF;
|
||||
globalCtx->unk_1241B = 6;
|
||||
globalCtx->transitionMode = 6;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -673,30 +686,30 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
|
||||
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
} else {
|
||||
D_80161490 = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
if (gSaveContext.unk_1410 != 0) {
|
||||
globalCtx->unk_1241B = 3;
|
||||
globalCtx->transitionMode = 3;
|
||||
}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
if (globalCtx->sceneLoadFlag != -0x14) {
|
||||
globalCtx->envCtx.unk_E6 = 1;
|
||||
globalCtx->unk_1241B = 13;
|
||||
globalCtx->transitionMode = 13;
|
||||
} else {
|
||||
globalCtx->envCtx.unk_E6 = 2;
|
||||
globalCtx->envCtx.unk_E7 = 0xFF;
|
||||
globalCtx->envCtx.unk_E8 = 0xFF;
|
||||
globalCtx->unk_1241B = 13;
|
||||
globalCtx->transitionMode = 13;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -704,10 +717,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
if (globalCtx->envCtx.unk_E7 < 0x6E) {
|
||||
D_80161490 = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
} else {
|
||||
if (globalCtx->envCtx.unk_E8 == 0xFF) {
|
||||
|
@ -716,7 +729,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
SET_NEXT_GAMESTATE(&globalCtx->state, Gameplay_Init, GlobalContext);
|
||||
gSaveContext.entranceIndex = globalCtx->nextEntranceIndex;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -727,9 +740,9 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
globalCtx->envCtx.unk_E7 = 0xFF;
|
||||
globalCtx->envCtx.unk_E8 = 0xFF;
|
||||
LOG_STRING("来た!!!!!!!!!!!!!!!!!!!!!", "../z_play.c", 3471); // "It's here!!!!!!!!!"
|
||||
globalCtx->unk_1241B = 15;
|
||||
globalCtx->transitionMode = 15;
|
||||
} else {
|
||||
globalCtx->unk_1241B = 12;
|
||||
globalCtx->transitionMode = 12;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -737,10 +750,10 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
Audio_PlaySoundGeneral(0x20C0, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
|
||||
if (globalCtx->sceneLoadFlag == -0x14) {
|
||||
if (globalCtx->envCtx.unk_E7 <= 0) {
|
||||
D_80161490 = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -752,17 +765,17 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
globalCtx->envCtx.unk_E2[1] = 0;
|
||||
globalCtx->envCtx.unk_E2[2] = 0;
|
||||
globalCtx->envCtx.unk_E2[3] = 0xFF;
|
||||
globalCtx->unk_1241B = 17;
|
||||
globalCtx->transitionMode = 17;
|
||||
break;
|
||||
|
||||
case 17:
|
||||
if (gSaveContext.unk_1410 != 0) {
|
||||
globalCtx->envCtx.unk_E2[3] = gSaveContext.unk_1410;
|
||||
if (gSaveContext.unk_1410 < 0x65) {
|
||||
D_80161490 = 0;
|
||||
gTrnsnUnkState = 0;
|
||||
R_UPDATE_RATE = 3;
|
||||
globalCtx->sceneLoadFlag = 0;
|
||||
globalCtx->unk_1241B = 0;
|
||||
globalCtx->transitionMode = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -774,7 +787,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
temp = HREG(63);
|
||||
if (1 && (D_80161490 != 3)) {
|
||||
if (1 && (gTrnsnUnkState != 3)) {
|
||||
if (1 && temp) {
|
||||
LOG_NUM("1", 1, "../z_play.c", 3542);
|
||||
}
|
||||
|
@ -989,7 +1002,7 @@ void Gameplay_Update(GlobalContext* globalCtx) {
|
|||
LOG_NUM("1", 1, "../z_play.c", 3783);
|
||||
}
|
||||
|
||||
func_800B3568(&globalCtx->sub_1241C, R_UPDATE_RATE);
|
||||
TransitionFade_Update(&globalCtx->transitionFade, R_UPDATE_RATE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1116,11 +1129,11 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
|||
|
||||
if ((HREG(80) != 10) || (HREG(92) != 0)) {
|
||||
Gfx* sp1CC = gfxCtx->polyOpa.p;
|
||||
Gfx* sp1D0 = Graph_GfxPlusOne(gfxCtx->polyOpa.p);
|
||||
gSPDisplayList(gfxCtx->overlay.p++, sp1D0);
|
||||
Gfx* gfxP = Graph_GfxPlusOne(gfxCtx->polyOpa.p);
|
||||
gSPDisplayList(gfxCtx->overlay.p++, gfxP);
|
||||
|
||||
if ((globalCtx->unk_1241B == 3) || (globalCtx->unk_1241B == 11) ||
|
||||
(globalCtx->transitionCtx.unk_228 >= 56)) {
|
||||
if ((globalCtx->transitionMode == 3) || (globalCtx->transitionMode == 11) ||
|
||||
(globalCtx->transitionCtx.transitionType >= 56)) {
|
||||
View view; // 0xA0
|
||||
Viewport viewport; // 0x90
|
||||
|
||||
|
@ -1133,25 +1146,25 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
|||
// clang-format on
|
||||
|
||||
View_SetViewport(&view, &viewport);
|
||||
func_800AB9EC(&view, 15, &sp1D0);
|
||||
globalCtx->transitionCtx.unk_238(&globalCtx->transitionCtx, &sp1D0);
|
||||
func_800AB9EC(&view, 15, &gfxP);
|
||||
globalCtx->transitionCtx.draw(&globalCtx->transitionCtx.data, &gfxP);
|
||||
}
|
||||
|
||||
func_800B3718(&globalCtx->sub_1241C, &sp1D0);
|
||||
TransitionFade_Draw(&globalCtx->transitionFade, &gfxP);
|
||||
|
||||
if (D_801614B0.a > 0x00) {
|
||||
D_80161498.color.rgba = D_801614B0.rgba;
|
||||
func_800AD5C0(&D_80161498, &sp1D0);
|
||||
func_800AD5C0(&D_80161498, &gfxP);
|
||||
}
|
||||
|
||||
gSPEndDisplayList(sp1D0++);
|
||||
Graph_BranchDlist(sp1CC, sp1D0);
|
||||
gfxCtx->polyOpa.p = sp1D0;
|
||||
gSPEndDisplayList(gfxP++);
|
||||
Graph_BranchDlist(sp1CC, gfxP);
|
||||
gfxCtx->polyOpa.p = gfxP;
|
||||
}
|
||||
|
||||
if (D_80161490 == 3) {
|
||||
if (gTrnsnUnkState == 3) {
|
||||
Gfx* sp88 = gfxCtx->polyOpa.p;
|
||||
func_800B2188(&D_801613B0, &sp88);
|
||||
TransitionUnk_Draw(&sTrnsnUnk, &sp88);
|
||||
gfxCtx->polyOpa.p = sp88;
|
||||
goto Gameplay_Draw_DrawOverlayElements;
|
||||
} else {
|
||||
|
@ -1282,7 +1295,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
|||
DebugDisplay_DrawObjects(globalCtx);
|
||||
}
|
||||
|
||||
if ((R_PAUSE_MENU_MODE == 1) || (D_80161490 == 1)) {
|
||||
if ((R_PAUSE_MENU_MODE == 1) || (gTrnsnUnkState == 1)) {
|
||||
Gfx* sp70 = gfxCtx->overlay.p;
|
||||
globalCtx->preRenderCtx.unk_10 = gfxCtx->curFrameBuffer;
|
||||
globalCtx->preRenderCtx.unk_14 = gZBuffer;
|
||||
|
@ -1292,7 +1305,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
|
|||
func_800C20B4(&globalCtx->preRenderCtx, &sp70);
|
||||
R_PAUSE_MENU_MODE = 2;
|
||||
} else {
|
||||
D_80161490 = 2;
|
||||
gTrnsnUnkState = 2;
|
||||
}
|
||||
gfxCtx->overlay.p = sp70;
|
||||
globalCtx->preRenderCtx.unk_A3 = 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue