Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decompile func_us_8018C90C #1634

Merged
merged 3 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 48 additions & 1 deletion src/boss/mar/AFC4.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include <stage.h>

#include "mar.h"

extern Dialogue g_Dialogue;

#include "../../st/cutscene_unk1.h"
Expand All @@ -21,4 +23,49 @@ INCLUDE_ASM("boss/mar/nonmatchings/AFC4", func_us_8018B74C);

INCLUDE_ASM("boss/mar/nonmatchings/AFC4", EntityMariaCutscene);

INCLUDE_ASM("boss/mar/nonmatchings/AFC4", func_us_8018C90C);
// func_psp_092467F8
void func_us_8018C90C(Entity* self) {
Entity* player;
Tilemap* tilemap; // unused but shows up in the psp code.

tilemap = &g_Tilemap;
player = &PLAYER;

switch (self->step) {
case 0:
InitializeEntity(D_80180A60);
D_8003C8B8 = 0;
g_unkGraphicsStruct.unk0 = 1;
g_Player.padSim = PAD_RIGHT;
g_Player.D_80072EFC = 1;
break;
case 1:
if ((player->posX.i.hi >= 0x21) && !(g_CutsceneFlags & 1)) {
g_CutsceneFlags |= 1;
}
if (player->posX.i.hi >= 0xB1) {
g_Player.padSim = PAD_LEFT;
self->step++;
} else {
g_Player.padSim = PAD_RIGHT;
}
g_Player.D_80072EFC = 1;
break;
case 2:
if (g_CutsceneFlags & 2) {
D_8003C8B8 = 1;

if (g_unkGraphicsStruct.unk0) {
g_unkGraphicsStruct.unk0 = 0;
}

DestroyEntity(self);
g_Statues[LEFT_STATUE] ^= 1; // suspicious, everywhere else we're
// treating this like a boolean.
}

g_Player.padSim = 0;
g_Player.D_80072EFC = 1;
break;
}
}
1 change: 1 addition & 0 deletions src/boss/mar/mar.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ typedef enum Statues {
extern u16 g_eInitGeneric2[];
extern s32 D_800973FC;
extern u16 g_Statues[];
extern u16 D_80180A60[];

#endif
Loading