mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-11 03:25:45 -04:00
cleanup Play_Update
This commit is contained in:
+7
-5
@@ -1450,7 +1450,9 @@ void func_800F6FF8(PlayState* play, EnvironmentContext* envCtx, LightContext* li
|
||||
// void func_800F88C4(void);
|
||||
// void func_800F8970(void);
|
||||
// void func_800F8A9C(void);
|
||||
// void func_800F8CD4(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx, s32 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
|
||||
void Environment_Update(PlayState* play, EnvironmentContext* envCtx, LightContext* lightCtx,
|
||||
PauseContext* pauseCtx, MessageContext* msgCtx, GameOverContext* gameOverCtx,
|
||||
GraphicsContext* gfxCtx);
|
||||
// void func_800F8D84(void);
|
||||
// void func_800F9728(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
|
||||
void func_800F9824(PlayState* play, EnvironmentContext* envCtx, View* view, GraphicsContext* gfxCtx, Vec3f vec, f32 arg5, f32 arg6, s8 arg7, s8 arg8);
|
||||
@@ -1886,7 +1888,7 @@ void Interface_Draw(PlayState* play);
|
||||
// void func_80120F90(void);
|
||||
// void func_80121000(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE1 param_8, UNK_TYPE1 param_9, UNK_TYPE1 param_10, UNK_TYPE4 param_11, UNK_TYPE4 param_12, UNK_TYPE4 param_13, UNK_TYPE4 param_14);
|
||||
// void func_80121064(void);
|
||||
// void func_801210E0(void);
|
||||
void Interface_Update(PlayState* play);
|
||||
void func_80121F94(PlayState* play);
|
||||
void func_80121FC4(PlayState* play);
|
||||
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
|
||||
@@ -2499,16 +2501,16 @@ void func_80163D80(TransitionContext* transitionCtx, PlayState* play);
|
||||
// void func_80163DC0(void);
|
||||
// void func_8016418C(void);
|
||||
void TransitionUnk_Destroy(FbDemoStruct* this);
|
||||
// void TransitionUnk_Init(void);
|
||||
FbDemoStruct* TransitionUnk_Init(FbDemoStruct* this, s32 row, s32 col);
|
||||
// void func_80164438(void);
|
||||
// void func_8016454C(void);
|
||||
// void func_80164678(void);
|
||||
// void func_801647AC(void);
|
||||
void func_801647AC(FbDemoStruct* this);
|
||||
// UNK_TYPE4 func_801647B8(void);
|
||||
// void TransitionFade_Start(void);
|
||||
void* TransitionFade_Init(TransitionFade* arg0);
|
||||
void TransitionFade_Destroy(TransitionFade* arg0);
|
||||
// void TransitionFade_Update(void);
|
||||
void TransitionFade_Update(TransitionFade* thisx, s32 updateRate);
|
||||
// void TransitionFade_Draw(void);
|
||||
// void TransitionFade_IsDone(void);
|
||||
void TransitionFade_SetColor(TransitionFade* arg0, u32 color);
|
||||
|
||||
+10
-2
@@ -752,8 +752,8 @@ typedef enum {
|
||||
/* 5 */ TRANS_MODE_FILL_IN,
|
||||
/* 6 */ TRANS_MODE_FILL_OUT,
|
||||
/* 7 */ TRANS_MODE_FILL_BROWN_INIT,
|
||||
/* 8 */ TRANS_MODE_08,
|
||||
/* 9 */ TRANS_MODE_09,
|
||||
/* 8 */ TRANS_MODE_08, // unused
|
||||
/* 9 */ TRANS_MODE_09, // unused
|
||||
/* 10 */ TRANS_MODE_INSTANT,
|
||||
/* 11 */ TRANS_MODE_INSTANCE_WAIT,
|
||||
/* 12 */ TRANS_MODE_SANDSTORM_INIT,
|
||||
@@ -814,6 +814,14 @@ typedef struct {
|
||||
/* 0x003 */ char unk03[0x5];
|
||||
/* 0x008 */ s32 instanceData;
|
||||
/* 0x00C */ char unk0C[0x224];
|
||||
/*
|
||||
union {
|
||||
TransitionFade fade;
|
||||
TransitionCircle circle;
|
||||
TransitionTriforce triforce;
|
||||
TransitionWipe wipe;
|
||||
} instanceData;
|
||||
*/
|
||||
/* 0x230 */ void* (*init)(void* transition);
|
||||
/* 0x234 */ void (*destroy)(void* transition);
|
||||
/* 0x238 */ void (*update)(void* transition, s32 updateRate);
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800F8A9C.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800F8CD4.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/Environment_Update.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_kankyo/func_800F8D84.s")
|
||||
|
||||
|
||||
@@ -1370,7 +1370,7 @@ u8 D_801BFD94 = 0;
|
||||
s16 D_801BFD98 = 0;
|
||||
s16 D_801BFD9C = 0;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801210E0.s")
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/Interface_Update.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80121F94.s")
|
||||
|
||||
|
||||
+62
-50
@@ -1,4 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "z64rumble.h"
|
||||
#include "overlays/gamestates/ovl_daytelop/z_daytelop.h"
|
||||
#include "overlays/gamestates/ovl_opening/z_opening.h"
|
||||
#include "overlays/gamestates/ovl_file_choose/z_file_choose.h"
|
||||
@@ -917,15 +918,8 @@ void Play_UpdateTransition(PlayState* this) {
|
||||
}
|
||||
|
||||
#ifdef NON_MATCHING
|
||||
void TransitionFade_Update(TransitionFade*, s32);
|
||||
void Rumble_SetUpdateEnabled(s32);
|
||||
void func_800F8CD4(PlayState *, EnvironmentContext *, LightContext *, PauseContext *, MessageContext *, GameOverContext *, GraphicsContext *);
|
||||
void func_801210E0(PlayState *);
|
||||
s32 func_801642D8(FbDemoStruct *, s32, s32);
|
||||
void func_801647AC(FbDemoStruct *);
|
||||
|
||||
void Play_Update(PlayState *play2) {
|
||||
PlayState* play = play2;
|
||||
void Play_Update(PlayState* play) {
|
||||
PlayState* play2 = play;
|
||||
u8 pad60;
|
||||
s32 sp5C = 0;
|
||||
Input* pad58 = play->state.input;
|
||||
@@ -934,53 +928,63 @@ void Play_Update(PlayState *play2) {
|
||||
gSegments[5] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[play->objectCtx.subKeepIndex].segment);
|
||||
gSegments[2] = VIRTUAL_TO_PHYSICAL(play->sceneSegment);
|
||||
|
||||
if (gGameInfo->data[0xB9] == 2) {
|
||||
gGameInfo->data[0xB9] = 3;
|
||||
if (SREG(89) == 2) {
|
||||
SREG(89) = 3;
|
||||
MsgEvent_SendNullTask();
|
||||
func_80165E1C(&play->pauseBgPreRender);
|
||||
gGameInfo->data[0xB9] = 0;
|
||||
SREG(89) = 0;
|
||||
}
|
||||
Actor_SetMovementScale(play->state.framerateDivisor);
|
||||
|
||||
if (FrameAdvance_Update(&play->frameAdvCtx, &pad58[1]) != 0) {
|
||||
if ((play->transitionMode == 0) && (play->transitionTrigger != 0)) {
|
||||
play->transitionMode = 1;
|
||||
if (FrameAdvance_Update(&play->frameAdvCtx, &pad58[1])) {
|
||||
if ((play->transitionMode == TRANS_MODE_OFF) && (play->transitionTrigger != TRANS_TRIGGER_OFF)) {
|
||||
play->transitionMode = TRANS_MODE_SETUP;
|
||||
}
|
||||
switch (D_801F6D10) {
|
||||
case 0:
|
||||
break;
|
||||
case 2:
|
||||
if (func_801642D8(&D_801F6C30, 0xA, 7) == 0) {
|
||||
D_801F6D10 = 0;
|
||||
} else {
|
||||
D_801F6D0C = gZBufferPtr;
|
||||
D_801F6D10 = 3;
|
||||
Game_SetFramerateDivisor(&play->state, 1);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
func_801647AC(&D_801F6C30);
|
||||
break;
|
||||
|
||||
if (gTrnsnUnkState != 0) {
|
||||
switch (gTrnsnUnkState) {
|
||||
case 2:
|
||||
if (TransitionUnk_Init(&sTrnsnUnk, 10, 7) == NULL) {
|
||||
gTrnsnUnkState = 0;
|
||||
} else {
|
||||
D_801F6D0C = gZBufferPtr;
|
||||
gTrnsnUnkState = 3;
|
||||
Game_SetFramerateDivisor(&play->state, 1);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
func_801647AC(&sTrnsnUnk);
|
||||
break;
|
||||
}
|
||||
}
|
||||
func_80166B30(play);
|
||||
if (D_801F6D10 != 3) {
|
||||
if ((gSaveContext.gameMode == 0) && (((play->msgCtx.msgMode == 0)) || ((play->msgCtx.currentTextId == 0xFF) && (play->msgCtx.msgMode == 0x42) && (play->msgCtx.unk12020 == 0x41)) || ((play->msgCtx.currentTextId >= 0x100) && ( play->msgCtx.currentTextId < 0x201))) && (play->gameOverCtx.state == 0)) {
|
||||
Play_UpdateTransition(play);
|
||||
if (gTrnsnUnkState != 3) {
|
||||
if ((gSaveContext.gameMode == 0) &&
|
||||
(((play->msgCtx.msgMode == 0)) ||
|
||||
((play->msgCtx.currentTextId == 0xFF) && (play->msgCtx.msgMode == 0x42) &&
|
||||
(play->msgCtx.unk12020 == 0x41)) ||
|
||||
((play->msgCtx.currentTextId >= 0x100) && (play->msgCtx.currentTextId < 0x201))) &&
|
||||
(play->gameOverCtx.state == 0)) {
|
||||
KaleidoSetup_Update(play);
|
||||
}
|
||||
|
||||
sp5C = (play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != 0);
|
||||
|
||||
AnimationContext_Reset(&play->animationCtx);
|
||||
Object_UpdateBank(&play->objectCtx);
|
||||
if ((sp5C == 0) && (gGameInfo->data[0x3A8] == 0)) {
|
||||
|
||||
if ((sp5C == 0) && (IREG(72) == 0)) {
|
||||
play->gameplayFrames++;
|
||||
Rumble_SetUpdateEnabled(1);
|
||||
if((play->actorCtx.freezeFlashTimer != 0) && (play->actorCtx.freezeFlashTimer-- < 5)) {
|
||||
if ((play->actorCtx.freezeFlashTimer > 0) && (( play->actorCtx.freezeFlashTimer % 2) != 0)) {
|
||||
play->envCtx.fillScreen = 1;
|
||||
play->envCtx.screenFillColor[0] = play->envCtx.screenFillColor[1] = play->envCtx.screenFillColor[2] = 150;
|
||||
Rumble_SetUpdateEnabled(true);
|
||||
if ((play->actorCtx.freezeFlashTimer != 0) && (play->actorCtx.freezeFlashTimer-- < 5)) {
|
||||
pad60 = play->actorCtx.freezeFlashTimer;
|
||||
if ((pad60 > 0) && ((pad60 % 2) != 0)) {
|
||||
play->envCtx.fillScreen = true;
|
||||
play->envCtx.screenFillColor[0] = play->envCtx.screenFillColor[1] =
|
||||
play->envCtx.screenFillColor[2] = 150;
|
||||
play->envCtx.screenFillColor[3] = 80;
|
||||
} else {
|
||||
play->envCtx.fillScreen = 0;
|
||||
play->envCtx.fillScreen = false;
|
||||
}
|
||||
} else {
|
||||
Room_HandleLoadCallbacks(play, &play->roomCtx);
|
||||
@@ -998,44 +1002,52 @@ void Play_Update(PlayState *play2) {
|
||||
EffFootmark_Update(play);
|
||||
}
|
||||
} else {
|
||||
Rumble_SetUpdateEnabled(0);
|
||||
Rumble_SetUpdateEnabled(false);
|
||||
}
|
||||
|
||||
Room_nop8012D510(play, &play->roomCtx.currRoom, &pad58[1], 0);
|
||||
Room_nop8012D510(play, &play->roomCtx.prevRoom, &pad58[1], 1);
|
||||
SkyboxDraw_Noop(&play->skyboxCtx);
|
||||
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != 0)) {
|
||||
|
||||
if ((play->pauseCtx.state != 0) || (play->pauseCtx.debugEditor != DEBUG_EDITOR_NONE)) {
|
||||
KaleidoScopeCall_Update(play);
|
||||
} else if (play->gameOverCtx.state != 0) {
|
||||
GameOver_Update(play);
|
||||
}
|
||||
|
||||
func_8015680C(play);
|
||||
func_801210E0(play);
|
||||
Interface_Update(play);
|
||||
AnimationContext_Update(play, &play->animationCtx);
|
||||
SoundSource_UpdateAll(play);
|
||||
ShrinkWindow_Update(play->state.framerateDivisor);
|
||||
TransitionFade_Update(&play->unk_18E48, play->state.framerateDivisor);
|
||||
}
|
||||
}
|
||||
if ((sp5C == 0) || (gDbgCamEnabled != 0)) {
|
||||
s32 sp54;
|
||||
|
||||
if (!sp5C || gDbgCamEnabled) {
|
||||
s32 sp54; // camId
|
||||
s32 sp50;
|
||||
Vec3s sp48;
|
||||
Vec3s sp48; // InputDir
|
||||
|
||||
play->nextCamera = play->activeCamId;
|
||||
for(sp54 = 0; sp54 < 4; sp54++) {
|
||||
for (sp54 = 0; sp54 < 4; sp54++) {
|
||||
if ((sp54 != play->nextCamera) && (play->cameraPtrs[sp54] != NULL)) {
|
||||
Camera_Update(&sp48, play->cameraPtrs[sp54]);
|
||||
}
|
||||
}
|
||||
Camera_Update(&sp48, play->cameraPtrs[play->nextCamera]);
|
||||
}
|
||||
if (sp5C == 0) {
|
||||
|
||||
if (!sp5C) {
|
||||
func_80166968(play, play->cameraPtrs[play->nextCamera]);
|
||||
Distortion_Update();
|
||||
}
|
||||
func_800F8CD4(play, &play->envCtx, &play->lightCtx, &play->pauseCtx, &play->msgCtx, &play->gameOverCtx, play->state.gfxCtx);
|
||||
|
||||
Environment_Update(play, &play->envCtx, &play->lightCtx, &play->pauseCtx, &play->msgCtx, &play->gameOverCtx,
|
||||
play->state.gfxCtx);
|
||||
|
||||
if (play->sramCtx.status != 0) {
|
||||
if (gSaveContext.save.isOwlSave != 0) {
|
||||
if (gSaveContext.save.isOwlSave) {
|
||||
func_80147198(&play->sramCtx);
|
||||
} else {
|
||||
func_80147068(&play->sramCtx);
|
||||
|
||||
@@ -1727,7 +1727,7 @@
|
||||
0x800F88C4:("func_800F88C4",),
|
||||
0x800F8970:("func_800F8970",),
|
||||
0x800F8A9C:("func_800F8A9C",),
|
||||
0x800F8CD4:("func_800F8CD4",),
|
||||
0x800F8CD4:("Environment_Update",),
|
||||
0x800F8D84:("func_800F8D84",),
|
||||
0x800F9728:("func_800F9728",),
|
||||
0x800F9824:("func_800F9824",),
|
||||
@@ -2164,7 +2164,7 @@
|
||||
0x8011F0E0:("Interface_Draw",),
|
||||
0x80120F90:("func_80120F90",),
|
||||
0x80121064:("func_80121064",),
|
||||
0x801210E0:("func_801210E0",),
|
||||
0x801210E0:("Interface_Update",),
|
||||
0x80121F94:("func_80121F94",),
|
||||
0x80121FC4:("func_80121FC4",),
|
||||
0x801224E0:("Path_GetByIndex",),
|
||||
|
||||
@@ -1241,7 +1241,7 @@ asm/non_matchings/code/z_kankyo/func_800F8554.s,func_800F8554,0x800F8554,0xDC
|
||||
asm/non_matchings/code/z_kankyo/func_800F88C4.s,func_800F88C4,0x800F88C4,0x2B
|
||||
asm/non_matchings/code/z_kankyo/func_800F8970.s,func_800F8970,0x800F8970,0x4B
|
||||
asm/non_matchings/code/z_kankyo/func_800F8A9C.s,func_800F8A9C,0x800F8A9C,0x8E
|
||||
asm/non_matchings/code/z_kankyo/func_800F8CD4.s,func_800F8CD4,0x800F8CD4,0x2C
|
||||
asm/non_matchings/code/z_kankyo/Environment_Update.s,Environment_Update,0x800F8CD4,0x2C
|
||||
asm/non_matchings/code/z_kankyo/func_800F8D84.s,func_800F8D84,0x800F8D84,0x269
|
||||
asm/non_matchings/code/z_kankyo/func_800F9728.s,func_800F9728,0x800F9728,0x3F
|
||||
asm/non_matchings/code/z_kankyo/func_800F9824.s,func_800F9824,0x800F9824,0x2DE
|
||||
@@ -1678,7 +1678,7 @@ asm/non_matchings/code/z_parameter/func_8011E730.s,func_8011E730,0x8011E730,0x26
|
||||
asm/non_matchings/code/z_parameter/Interface_Draw.s,Interface_Draw,0x8011F0E0,0x7AC
|
||||
asm/non_matchings/code/z_parameter/func_80120F90.s,func_80120F90,0x80120F90,0x35
|
||||
asm/non_matchings/code/z_parameter/func_80121064.s,func_80121064,0x80121064,0x1F
|
||||
asm/non_matchings/code/z_parameter/func_801210E0.s,func_801210E0,0x801210E0,0x3AD
|
||||
asm/non_matchings/code/z_parameter/Interface_Update.s,Interface_Update,0x801210E0,0x3AD
|
||||
asm/non_matchings/code/z_parameter/func_80121F94.s,func_80121F94,0x80121F94,0xC
|
||||
asm/non_matchings/code/z_parameter/func_80121FC4.s,func_80121FC4,0x80121FC4,0x147
|
||||
asm/non_matchings/code/z_path/func_801224E0.s,func_801224E0,0x801224E0,0x11
|
||||
|
||||
|
Reference in New Issue
Block a user