Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ea02716
Decompile 28 rcat functions (e_breakable_wall, e_spikes, lava, partic…
shikyo13 Mar 27, 2026
149a58d
Fix rcat decomp for post-rebase compatibility
shikyo13 Mar 27, 2026
fe37a9f
Decompile 22 BO6 us_39144.c functions (Richter boss utilities)
shikyo13 Mar 27, 2026
c18876e
Decompile BO6_ReboundStoneBounce1 and BO6_ReboundStoneBounce2 in BO6 …
shikyo13 Mar 27, 2026
fed6c52
Decompile BO6_PrimDecreaseBrightness in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
8e9c57e
Decompile BO6_DebugShowWaitInfo and BO6_DebugInputWait in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
8de7d6c
Decompile func_us_801C8590 in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
8f050e9
Decompile BO6_AguneaShuffleParams in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
5208f46
Decompile BO6_RicCheckSubwpnChainLimit in BO6 (SHA1 verified)
shikyo13 Mar 27, 2026
07ab729
Decompile BO6_GetAguneaLightningAngle in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
7ee66ed
Decompile BO6_RicDoSubweapon in BO6 (SHA1 verified)
shikyo13 Mar 27, 2026
34ec7ba
Decompile BO6_RicDoAttack in BO6 (SHA1 verified)
shikyo13 Mar 27, 2026
1c0f59a
Decompile BO6_RicDoCrash in BO6 (SHA1 verified)
shikyo13 Mar 27, 2026
063270c
Decompile func_us_801C488C and BO6_GetAguneaLightningAngle in BO6 us_…
shikyo13 Mar 27, 2026
3bcba56
Decompile 4 entity functions in BO6 us_39144.c
shikyo13 Mar 27, 2026
2611676
Decompile BO6_RicEntitySubwpnCrossTrail in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
bb30bf6
Decompile BO6_RicCheckSubweapon in BO6 (SHA1 verified)
shikyo13 Mar 27, 2026
3f4e708
Decompile func_us_801BD47C in BO6 (SHA1 verified)
shikyo13 Mar 27, 2026
755c523
Decompile BO6_RicEntityArmBrandishWhip in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
0caa354
Decompile func_us_801BD384 in BO6
shikyo13 Mar 27, 2026
91657dc
Revert "Decompile func_us_801BD384 in BO6"
shikyo13 Mar 27, 2026
5a4e49c
Revert "Decompile func_us_801BD47C in BO6 (SHA1 verified)"
shikyo13 Mar 27, 2026
3e356b2
Decompile 14 functions in BO6 richter.c
shikyo13 Mar 27, 2026
c6cf113
Decompile BO6_RicEntityCrashReboundStone in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
7121f7b
Decompile func_us_801BE79C in BO6 us_3E79C.c
shikyo13 Mar 27, 2026
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
13 changes: 13 additions & 0 deletions include/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,18 @@ typedef struct {
s16 unk8A;
} ET_BatEcho;

typedef struct {
/* 0x7C */ s16 : 16;
/* 0x7E */ u16 unk7E;
/* 0x80 */ s16 unk80;
/* 0x82 */ s16 : 16;
/* 0x84 */ struct Primitive* unk84;
/* 0x88 */ s16 unk88;
/* 0x8A */ s16 unk8A;
/* 0x8C */ s16 : 16;
/* 0x8E */ s16 unk8E;
} ET_EchoBounce;

typedef struct {
/* 0x7C */ s16 pad7C;
/* 0x7E */ s16 unk7E;
Expand Down Expand Up @@ -4013,6 +4025,7 @@ typedef union { // offset=0x7C
ET_Bat bat;
ET_BatFamBlueTrail batFamBlueTrail;
ET_BatEcho batEcho;
ET_EchoBounce echoBounce;
ET_Ghost ghost;
ET_Faerie faerie;
ET_FaerieWings faerieWings;
Expand Down
239 changes: 225 additions & 14 deletions src/boss/bo6/richter.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,69 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "bo6.h"
#include "sfx.h"

// From ric.h, not included in bo6.h
enum RicInputChecks {
CHECK_GROUND = 1,
CHECK_FALL = 4,
CHECK_FACING = 8,
CHECK_JUMP = 0x10,
CHECK_CRASH = 0x40,
CHECK_80 = 0x80,
CHECK_GRAVITY_HIT = 0x200,
CHECK_ATTACK = 0x1000,
CHECK_CROUCH = 0x2000,
CHECK_GRAVITY_FALL = 0x8000,
CHECK_GRAVITY_JUMP = 0x10000,
CHECK_GROUND_AFTER_HIT = 0x20000,
CHECK_SLIDE = 0x40000,
};

extern u16 D_us_801D165E;
extern u16 D_us_801D1666;
extern u16 D_us_801D165A;
extern s32 D_us_801D07F8;
extern s32 D_us_801CF3C8;
extern s32 D_us_801CF3CC;

extern AnimationFrame D_us_80181F24[];
extern AnimationFrame D_us_801820B0[];
extern AnimationFrame D_us_801820BC[];

INCLUDE_ASM("boss/bo6/nonmatchings/richter", func_us_801B4BD0);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", func_us_801B4EAC);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_CheckBladeDashInput);
static void BO6_CheckBladeDashInput(void) {
if (RIC.step - 1 < 2u || RIC.step == 3 || RIC.step - 4 < 2u) {
if (D_us_801D165E) {
return;
}
if (g_Ric.padTapped & PAD_SQUARE) {
func_us_801BA9D0();
}
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_CheckHighJumpInput);
static void BO6_CheckHighJumpInput(void) {
if (RIC.step == PL_S_CROUCH || RIC.step == PL_S_STAND ||
(RIC.step == PL_S_JUMP && RIC.velocityY > FIX(1)) ||
RIC.step == PL_S_FALL) {
if (D_us_801D165E) {
return;
}
if (g_Ric.padTapped & PAD_UP) {
func_us_801BA050();
}
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicMain);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", func_us_801B5A14);
void func_us_801B5A14(s32 arg0) {
D_us_801CF3C8 = arg0;
D_us_801CF3CC = 0;
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", RichterThinking);

Expand All @@ -21,40 +73,199 @@ INCLUDE_ASM("boss/bo6/nonmatchings/richter", EntityRichter);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepStand);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepWalk);
void BO6_RicStepWalk(void) {
if (!BO6_RicCheckInput(CHECK_FALL | CHECK_FACING | CHECK_JUMP | CHECK_CRASH |
CHECK_ATTACK | CHECK_CROUCH)) {
DecelerateX(FIX(0.125));
if (BO6_RicCheckFacing() == 0) {
BO6_RicSetStand(0);
return;
}
if (RIC.step_s != 0) {
if (RIC.step_s) {
}
} else {
BO6_RicSetSpeedX(FIX(1.25));
}
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepRun);
void BO6_RicStepRun(void) {
g_Ric.timers[PL_T_8] = 8;
g_Ric.timers[PL_T_CURSE] = 8;
if (!BO6_RicCheckInput(CHECK_FALL | CHECK_FACING | CHECK_JUMP | CHECK_CRASH |
CHECK_ATTACK | CHECK_CROUCH)) {
DecelerateX(FIX(0.125));
if (BO6_RicCheckFacing() == 0) {
BO6_RicSetStand(0);
if (g_Ric.timers[PL_T_RUN] == 0) {
if (!(g_Ric.vram_flag &
(TOUCHING_L_WALL | TOUCHING_R_WALL))) {
BO6_RicSetAnimation(D_us_80181F24);
BO6_RicCreateEntFactoryFromEntity(
g_CurrentEntity, BP_SKID_SMOKE, 0);
}
} else {
RIC.velocityX = 0;
}
return;
}
if (RIC.step_s != 0) {
if (RIC.step_s) {
}
} else {
BO6_RicSetSpeedX(FIX(2.25));
}
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepJump);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepFall);
void BO6_RicStepFall(void) {
if (BO6_RicCheckInput(
CHECK_GROUND | CHECK_FACING | CHECK_ATTACK | CHECK_GRAVITY_FALL)) {
return;
}
DecelerateX(FIX(1. / 16));
switch (RIC.step_s) {
case 0:
if (g_Ric.timers[PL_T_5] && g_Ric.padTapped & PAD_CROSS) {
func_us_801B9E70();
} else if (BO6_RicCheckFacing()) {
BO6_RicSetSpeedX(FIX(0.75));
}
break;
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepCrouch);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicResetPose);
void BO6_RicResetPose(void) {
RIC.pose = RIC.poseTimer = 0;
g_Ric.unk44 = 0;
D_us_801D165E = 0;
RIC.drawFlags &= ~ENTITY_ROTATE;
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", func_us_801B77D8);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepHit);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepDead);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepStandInAir);
void BO6_RicStepStandInAir(void) {
if (RIC.step_s == 0) {
RIC.velocityY += 0x3800;
if (RIC.velocityY > 0) {
RIC.velocityY = 0;
RIC.step_s = 1;
}
} else if (D_us_801D1666) {
D_us_801D165E = 0;
BO6_RicSetStep(PL_S_JUMP);
BO6_RicSetAnimation(D_us_801820B0);
g_Ric.unk44 = 0;
}
}

void BO6_RicStepEnableFlameWhip(void) {
if (RIC.animCurFrame == 181 && RIC.poseTimer == 1) {
BO6_RicCreateEntFactoryFromEntity(g_CurrentEntity, BP_35, 0);
g_api.PlaySfx(SFX_WEAPON_APPEAR);
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepEnableFlameWhip);
if (RIC.poseTimer < 0) {
BO6_RicSetStand(0);
D_us_801D165E = 0;
BO6_RicCreateEntFactoryFromEntity(
g_CurrentEntity, FACTORY(BP_RIC_BLINK, 0x45), 0);
g_Ric.timers[PL_T_POISON] = 0x800;
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepHydrostorm);
void BO6_RicStepHydrostorm(void) {
if (RIC.poseTimer < 0) {
BO6_RicSetStand(0);
D_us_801D165E = 0;
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepGenericSubwpnCrash);
void BO6_RicStepGenericSubwpnCrash(void) {
if (D_us_801D1666) {
BO6_RicSetStand(0);
D_us_801D165E = 0;
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepThrowDaggers);
void BO6_RicStepThrowDaggers(void) {
if (RIC.step_s == 0) {
D_us_801D07F8 = 0x200;
RIC.step_s++;
} else {
BO6_RicCheckFacing();
if (!--D_us_801D07F8) {
D_us_801D165E = 0;
BO6_RicSetStand(0);
D_us_801D1666 = 1;
}
}
if (g_Ric.padTapped & PAD_CROSS) {
func_us_801B9E70();
D_us_801D165E = 0;
D_us_801D1666 = 1;
D_us_801D07F8 = 0;
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepSlide);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepSlideKick);

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepBladeDash);
void BO6_RicStepBladeDash(void) {
DecelerateX(0x1C00);

if (RIC.poseTimer < 0) {
D_us_801D165E = 0;
BO6_RicSetStand(0);
} else if (RIC.pose >= 0x12 && !(g_Ric.vram_flag & TOUCHING_GROUND)) {
D_us_801D165E = 0;
BO6_RicSetFall();
} else {
if (!(g_GameTimer & 3) && RIC.pose < 0x12 &&
g_Ric.vram_flag & TOUCHING_GROUND) {
BO6_RicCreateEntFactoryFromEntity(
g_CurrentEntity, FACTORY(BP_SLIDE, 2), 0);
}

if (RIC.pose == 18 && RIC.poseTimer == 1 &&
(g_Ric.vram_flag & TOUCHING_GROUND)) {
BO6_RicCreateEntFactoryFromEntity(
g_CurrentEntity, BP_SKID_SMOKE, 0);
}
}
}

void func_us_801B8E80(u16 arg0) {
s16 xMod = 3;
if (RIC.facingLeft) {
xMod = -xMod;
}

RIC.posY.i.hi -= 16;
RIC.posX.i.hi += xMod;
BO6_RicCreateEntFactoryFromEntity(
g_CurrentEntity, FACTORY(BP_EMBERS, 1), 0);
RIC.posY.i.hi += 16;
RIC.posX.i.hi -= xMod;

INCLUDE_ASM("boss/bo6/nonmatchings/richter", func_us_801B8E80);
if (arg0 & 1) {
g_api.func_80102CD8(3);
g_api.PlaySfx(SFX_WALL_DEBRIS_B);
}
if (arg0 & 2) {
RIC.velocityX = 0;
RIC.velocityY = 0;
}
}

INCLUDE_ASM("boss/bo6/nonmatchings/richter", BO6_RicStepHighJump);
Loading
Loading