Bombers notebook + small cleanup

This commit is contained in:
Derek Hensley 2022-10-04 22:47:11 -07:00
parent 5631915dd5
commit 80af6ca479
9 changed files with 64 additions and 61 deletions

View File

@ -2462,10 +2462,10 @@ void Play_Destroy(GameState* thisx);
void func_80166968(PlayState* this, Camera* camera);
void Play_UpdateTransition(PlayState* this);
void Play_Update(PlayState* this);
void func_80167DE4(PlayState* this);
void Play_SetupUpdate(PlayState* this);
// void Play_DrawOverlayElements(void);
void Play_Draw(PlayState* this);
void func_80168DAC(PlayState* this);
void Play_SetupDraw(PlayState* this);
void Play_Main(GameState* thisx);
s32 Play_InCsMode(PlayState* this);
f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* feetPos);
@ -2513,11 +2513,11 @@ void Play_Init(GameState* thisx);
// void func_8016CD4C(void);
// void func_8016E40C(void);
// void func_8016EA90(void);
void func_8016F1A8(HiresoStruct* arg0, GraphicsContext* gfxCtx);
void Hireso_Draw(HiresoStruct* arg0, GraphicsContext* gfxCtx);
// void func_8016F4EC(void);
void func_8016F5A8(PlayState* play, HiresoStruct* arg1, Input* input);
void func_8016FC78(HiresoStruct* this);
void func_8016FC98(HiresoStruct* this);
void Hireso_Update(PlayState* play, HiresoStruct* arg1, Input* input);
void Hireso_Init(HiresoStruct* this);
void Hireso_Destroy(HiresoStruct* this);
void PreRender_SetValuesSave(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf, void* cvg);
void PreRender_Init(PreRender* this);
void PreRender_SetValues(PreRender* this, u32 width, u32 height, void* fbuf, void* zbuf);

View File

@ -3179,8 +3179,8 @@ extern UNK_TYPE4 gTrnsnUnkState;
extern Color_RGBA8_u32 gVisMonoColor;
// extern UNK_TYPE1 D_801F6D38;
// extern UNK_TYPE4 D_801F6D4C;
// extern UNK_TYPE1 D_801F6D50;
extern u8 D_801F6DFC;
// extern UNK_TYPE1 sHireso;
extern u8 sBombersNotebookOpen;
// extern UNK_TYPE1 D_801F6DFD;
extern SlowlyTask D_801F6E00;
extern s32 D_801F6FC0;

View File

@ -418,7 +418,7 @@ typedef struct {
/* 0x1E8 */ OSMesg loadMsg;
/* 0x1EC */ u16 state;
/* 0x1EE */ u16 debugEditor;
/* 0x1F0 */ u8 unk_1F0;
/* 0x1F0 */ u8 bombersNotebookOpen;
/* 0x1F4 */ Vec3f eye;
/* 0x200 */ u16 unk_200;
/* 0x202 */ u16 mode;

View File

@ -251,7 +251,7 @@ void Lights_FreeNode(LightNode* light) {
void LightContext_Init(PlayState* play, LightContext* lightCtx) {
LightContext_InitList(play, lightCtx);
LightContext_SetAmbientColor(lightCtx, 80, 80, 80);
LightContext_SetFogProperties(lightCtx, 0, 0, 0, 0x3E4, 0x3200);
LightContext_SetFogProperties(lightCtx, 0, 0, 0, 996, 12800);
bzero(&sLightsBuffer, sizeof(LightsBuffer));
}

View File

@ -330,7 +330,7 @@ void func_80151938(PlayState* play, u16 textId) {
}
msgCtx->unk1203C = msgCtx->unk1203A;
if (play->pauseCtx.unk_1F0 != 0) {
if (play->pauseCtx.bombersNotebookOpen != 0) {
msgCtx->unk12004 = 0x22;
msgCtx->unk12006 = 0x15E;
func_80149C18(play);

View File

@ -23,8 +23,8 @@ extern VisMono sVisMono;
extern Color_RGBA8_u32 gVisMonoColor;
extern Struct_80140E80 D_801F6D38;
extern Struct_80140E80* D_801F6D4C;
extern HiresoStruct D_801F6D50;
extern u8 D_801F6DFC;
extern HiresoStruct sHireso;
extern u8 sBombersNotebookOpen;
extern u8 sMotionBlurStatus;
typedef enum {
@ -398,7 +398,7 @@ void Play_Destroy(GameState* thisx) {
PlayState* this = (PlayState*)thisx;
GraphicsContext* gfxCtx = this->state.gfxCtx;
if (D_801F6DFC) {
if (sBombersNotebookOpen) {
MsgEvent_SendNullTask();
func_80178750();
gfxCtx->curFrameBuffer = SysCfb_GetFbPtr(gfxCtx->framebufferIdx % 2);
@ -408,10 +408,10 @@ void Play_Destroy(GameState* thisx) {
gfxCtx->xScale = gViConfigXScale;
gfxCtx->yScale = gViConfigYScale;
gfxCtx->updateViMode = true;
D_801F6DFC = false;
sBombersNotebookOpen = false;
}
func_8016FC98(&D_801F6D50);
Hireso_Destroy(&sHireso);
this->state.gfxCtx->callback = NULL;
this->state.gfxCtx->callbackParam = 0;
Play_DestroyMotionBlur();
@ -1071,19 +1071,19 @@ void Play_Update(PlayState* this) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_Update.s")
#endif
void func_80167DE4(PlayState* this) {
if (!D_801F6DFC) {
if (this->pauseCtx.unk_1F0 != 0) {
D_801F6DFC = true;
D_801F6D50.unk_00 = 0;
void Play_SetupUpdate(PlayState* this) {
if (!sBombersNotebookOpen) {
if (this->pauseCtx.bombersNotebookOpen) {
sBombersNotebookOpen = true;
sHireso.unk_00 = 0;
}
} else {
if (CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_L) ||
CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_B) ||
CHECK_BTN_ALL(CONTROLLER1(&this->state)->press.button, BTN_START) || (gIrqMgrResetStatus != 0)) {
D_801F6DFC = false;
this->pauseCtx.unk_1F0 = 0;
D_801F6D50.unk_00 = 0;
sBombersNotebookOpen = false;
this->pauseCtx.bombersNotebookOpen = false;
sHireso.unk_00 = 0;
this->msgCtx.msgLength = 0;
this->msgCtx.msgMode = 0;
this->msgCtx.currentTextId = 0;
@ -1091,8 +1091,8 @@ void func_80167DE4(PlayState* this) {
play_sound(NA_SE_SY_CANCEL);
}
}
if (D_801F6DFC) {
func_8016F5A8(this, &D_801F6D50, this->state.input);
if (sBombersNotebookOpen) {
Hireso_Update(this, &sHireso, this->state.input);
Message_Update(this);
} else {
Play_Update(this);
@ -1442,13 +1442,13 @@ void Play_Draw(PlayState* this) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play/Play_Draw.s")
#endif
void func_80168DAC(PlayState* this) {
void Play_SetupDraw(PlayState* this) {
GraphicsContext* gfxCtx = this->state.gfxCtx;
{
GraphicsContext* gfxCtx2 = this->state.gfxCtx;
if (D_801F6DFC) {
if (sBombersNotebookOpen) {
if (D_801FBBD4 != 1) {
MsgEvent_SendNullTask();
func_80178818();
@ -1475,8 +1475,8 @@ void func_80168DAC(PlayState* this) {
}
}
if (D_801F6DFC && ((SREG(2) != 2) || (gZBufferPtr == NULL))) {
func_8016F1A8(&D_801F6D50, gfxCtx);
if (sBombersNotebookOpen && ((SREG(2) != 2) || (gZBufferPtr == NULL))) {
Hireso_Draw(&sHireso, gfxCtx);
Message_Draw(this);
} else {
Play_Draw(this);
@ -1484,10 +1484,10 @@ void func_80168DAC(PlayState* this) {
}
void Play_Main(GameState* thisx) {
static Input* D_801D0D60 = NULL;
static Input* prevInput = NULL;
PlayState* this = (PlayState*)thisx;
D_801D0D60 = CONTROLLER1(&this->state);
prevInput = CONTROLLER1(&this->state);
DebugDisplay_Init();
{
@ -1496,18 +1496,18 @@ void Play_Main(GameState* thisx) {
if (1) {
this->state.gfxCtx = NULL;
}
func_80167DE4(this);
Play_SetupUpdate(this);
this->state.gfxCtx = gfxCtx;
}
{
Input sp28 = *CONTROLLER1(&this->state);
Input input = *CONTROLLER1(&this->state);
if (1) {
*CONTROLLER1(&this->state) = D_801F6C18;
}
func_80168DAC(this);
*CONTROLLER1(&this->state) = sp28;
Play_SetupDraw(this);
*CONTROLLER1(&this->state) = input;
}
ActorCutscene_Update();
@ -1518,11 +1518,11 @@ s32 Play_InCsMode(PlayState* this) {
return (this->csCtx.state != 0) || Player_InCsMode(this);
}
f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* feetPos) {
f32 floorHeight = BgCheck_EntityRaycastFloor3(&this->colCtx, poly, bgId, feetPos);
f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, Vec3f* pos) {
f32 floorHeight = BgCheck_EntityRaycastFloor3(&this->colCtx, poly, bgId, pos);
if (floorHeight > BGCHECK_Y_MIN) {
func_800C0094(*poly, feetPos->x, floorHeight, feetPos->z, mtx);
func_800C0094(*poly, pos->x, floorHeight, pos->z, mtx);
} else {
mtx->xy = 0.0f;
mtx->zx = 0.0f;
@ -1536,11 +1536,12 @@ f32 func_80169100(PlayState* this, MtxF* mtx, CollisionPoly** poly, s32* bgId, V
mtx->yz = 0.0f;
mtx->zy = 0.0f;
mtx->yy = 1.0f;
mtx->xw = feetPos->x;
mtx->yw = feetPos->y;
mtx->zw = feetPos->z;
mtx->xw = pos->x;
mtx->yw = pos->y;
mtx->zw = pos->z;
mtx->ww = 1.0f;
}
return floorHeight;
}
@ -2302,7 +2303,9 @@ void Play_Init(GameState* thisx) {
ZeldaArena_Init(((temp_v0_12 + 8) & ~0xF), (sp94 - ((temp_v0_12 + 8) & ~0xF)) + temp_v0_12);
Actor_InitContext(this, &this->actorCtx, this->linkActorEntry);
while (Room_HandleLoadCallbacks(this, &this->roomCtx) == 0) {}
while (!Room_HandleLoadCallbacks(this, &this->roomCtx)) {
// Empty
}
if ((CURRENT_DAY != 0) && ((this->roomCtx.curRoom.unk3 == 1) || (this->roomCtx.curRoom.unk3 == 5))) {
Actor_Spawn(&this->actorCtx, this, 0x15A, 0.0f, 0.0f, 0.0f, 0, 0, 0, 0);
@ -2325,8 +2328,8 @@ void Play_Init(GameState* thisx) {
AnimationContext_Update(this, &this->animationCtx);
func_800EDBE0(this);
gSaveContext.respawnFlag = 0;
D_801F6DFC = false;
func_8016FC78(&D_801F6D50);
sBombersNotebookOpen = false;
Hireso_Init(&sHireso);
}
// play_hireso need to confirm still

View File

@ -16,12 +16,12 @@
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016EA90.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016F1A8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/Hireso_Draw.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016F4EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016F5A8.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/Hireso_Update.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016FC78.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/Hireso_Init.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/func_8016FC98.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_play_hireso/Hireso_Destroy.s")

View File

@ -2993,10 +2993,10 @@
0x80166968:("func_80166968",),
0x80166B30:("Play_UpdateTransition",),
0x80167814:("Play_Update",),
0x80167DE4:("func_80167DE4",),
0x80167DE4:("Play_SetupUpdate",),
0x80167F0C:("Play_DrawOverlayElements",),
0x80168090:("Play_Draw",),
0x80168DAC:("func_80168DAC",),
0x80168DAC:("Play_SetupDraw",),
0x80168F64:("Play_Main",),
0x801690CC:("Play_InCsMode",),
0x80169100:("func_80169100",),
@ -3048,11 +3048,11 @@
0x8016CD4C:("func_8016CD4C",),
0x8016E40C:("func_8016E40C",),
0x8016EA90:("func_8016EA90",),
0x8016F1A8:("func_8016F1A8",),
0x8016F1A8:("Hireso_Draw",),
0x8016F4EC:("func_8016F4EC",),
0x8016F5A8:("func_8016F5A8",),
0x8016FC78:("func_8016FC78",),
0x8016FC98:("func_8016FC98",),
0x8016F5A8:("Hireso_Update",),
0x8016FC78:("Hireso_Init",),
0x8016FC98:("Hireso_Destroy",),
0x8016FCF0:("PreRender_SetValuesSave",),
0x8016FD2C:("PreRender_Init",),
0x8016FD60:("PreRender_SetValues",),

View File

@ -2507,10 +2507,10 @@ asm/non_matchings/code/z_play/func_801668B4.s,func_801668B4,0x801668B4,0x2D
asm/non_matchings/code/z_play/func_80166968.s,func_80166968,0x80166968,0x72
asm/non_matchings/code/z_play/Play_UpdateTransition.s,Play_UpdateTransition,0x80166B30,0x339
asm/non_matchings/code/z_play/Play_Update.s,Play_Update,0x80167814,0x174
asm/non_matchings/code/z_play/func_80167DE4.s,func_80167DE4,0x80167DE4,0x4A
asm/non_matchings/code/z_play/Play_SetupUpdate.s,Play_SetupUpdate,0x80167DE4,0x4A
asm/non_matchings/code/z_play/Play_DrawOverlayElements.s,Play_DrawOverlayElements,0x80167F0C,0x61
asm/non_matchings/code/z_play/Play_Draw.s,Play_Draw,0x80168090,0x347
asm/non_matchings/code/z_play/func_80168DAC.s,func_80168DAC,0x80168DAC,0x6E
asm/non_matchings/code/z_play/Play_SetupDraw.s,Play_SetupDraw,0x80168DAC,0x6E
asm/non_matchings/code/z_play/Play_Main.s,Play_Main,0x80168F64,0x5A
asm/non_matchings/code/z_play/Play_InCsMode.s,Play_InCsMode,0x801690CC,0xD
asm/non_matchings/code/z_play/func_80169100.s,func_80169100,0x80169100,0x3C
@ -2562,11 +2562,11 @@ asm/non_matchings/code/z_play_hireso/func_8016C344.s,func_8016C344,0x8016C344,0x
asm/non_matchings/code/z_play_hireso/func_8016CD4C.s,func_8016CD4C,0x8016CD4C,0x5B0
asm/non_matchings/code/z_play_hireso/func_8016E40C.s,func_8016E40C,0x8016E40C,0x1A1
asm/non_matchings/code/z_play_hireso/func_8016EA90.s,func_8016EA90,0x8016EA90,0x1C6
asm/non_matchings/code/z_play_hireso/func_8016F1A8.s,func_8016F1A8,0x8016F1A8,0xD1
asm/non_matchings/code/z_play_hireso/Hireso_Draw.s,Hireso_Draw,0x8016F1A8,0xD1
asm/non_matchings/code/z_play_hireso/func_8016F4EC.s,func_8016F4EC,0x8016F4EC,0x2F
asm/non_matchings/code/z_play_hireso/func_8016F5A8.s,func_8016F5A8,0x8016F5A8,0x1B4
asm/non_matchings/code/z_play_hireso/func_8016FC78.s,func_8016FC78,0x8016FC78,0x8
asm/non_matchings/code/z_play_hireso/func_8016FC98.s,func_8016FC98,0x8016FC98,0x16
asm/non_matchings/code/z_play_hireso/Hireso_Update.s,Hireso_Update,0x8016F5A8,0x1B4
asm/non_matchings/code/z_play_hireso/Hireso_Init.s,Hireso_Init,0x8016FC78,0x8
asm/non_matchings/code/z_play_hireso/Hireso_Destroy.s,Hireso_Destroy,0x8016FC98,0x16
asm/non_matchings/code/PreRender/PreRender_SetValuesSave.s,PreRender_SetValuesSave,0x8016FCF0,0xF
asm/non_matchings/code/PreRender/PreRender_Init.s,PreRender_Init,0x8016FD2C,0xD
asm/non_matchings/code/PreRender/PreRender_SetValues.s,PreRender_SetValues,0x8016FD60,0xD

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2507 asm/non_matchings/code/z_play/func_80166968.s func_80166968 0x80166968 0x72
2508 asm/non_matchings/code/z_play/Play_UpdateTransition.s Play_UpdateTransition 0x80166B30 0x339
2509 asm/non_matchings/code/z_play/Play_Update.s Play_Update 0x80167814 0x174
2510 asm/non_matchings/code/z_play/func_80167DE4.s asm/non_matchings/code/z_play/Play_SetupUpdate.s func_80167DE4 Play_SetupUpdate 0x80167DE4 0x4A
2511 asm/non_matchings/code/z_play/Play_DrawOverlayElements.s Play_DrawOverlayElements 0x80167F0C 0x61
2512 asm/non_matchings/code/z_play/Play_Draw.s Play_Draw 0x80168090 0x347
2513 asm/non_matchings/code/z_play/func_80168DAC.s asm/non_matchings/code/z_play/Play_SetupDraw.s func_80168DAC Play_SetupDraw 0x80168DAC 0x6E
2514 asm/non_matchings/code/z_play/Play_Main.s Play_Main 0x80168F64 0x5A
2515 asm/non_matchings/code/z_play/Play_InCsMode.s Play_InCsMode 0x801690CC 0xD
2516 asm/non_matchings/code/z_play/func_80169100.s func_80169100 0x80169100 0x3C
2562 asm/non_matchings/code/z_play_hireso/func_8016CD4C.s func_8016CD4C 0x8016CD4C 0x5B0
2563 asm/non_matchings/code/z_play_hireso/func_8016E40C.s func_8016E40C 0x8016E40C 0x1A1
2564 asm/non_matchings/code/z_play_hireso/func_8016EA90.s func_8016EA90 0x8016EA90 0x1C6
2565 asm/non_matchings/code/z_play_hireso/func_8016F1A8.s asm/non_matchings/code/z_play_hireso/Hireso_Draw.s func_8016F1A8 Hireso_Draw 0x8016F1A8 0xD1
2566 asm/non_matchings/code/z_play_hireso/func_8016F4EC.s func_8016F4EC 0x8016F4EC 0x2F
2567 asm/non_matchings/code/z_play_hireso/func_8016F5A8.s asm/non_matchings/code/z_play_hireso/Hireso_Update.s func_8016F5A8 Hireso_Update 0x8016F5A8 0x1B4
2568 asm/non_matchings/code/z_play_hireso/func_8016FC78.s asm/non_matchings/code/z_play_hireso/Hireso_Init.s func_8016FC78 Hireso_Init 0x8016FC78 0x8
2569 asm/non_matchings/code/z_play_hireso/func_8016FC98.s asm/non_matchings/code/z_play_hireso/Hireso_Destroy.s func_8016FC98 Hireso_Destroy 0x8016FC98 0x16
2570 asm/non_matchings/code/PreRender/PreRender_SetValuesSave.s PreRender_SetValuesSave 0x8016FCF0 0xF
2571 asm/non_matchings/code/PreRender/PreRender_Init.s PreRender_Init 0x8016FD2C 0xD
2572 asm/non_matchings/code/PreRender/PreRender_SetValues.s PreRender_SetValues 0x8016FD60 0xD