Decompile no0 EntityDiplocephalusFoot (#1928)
Some checks are pending
Format code / format (push) Waiting to run
Build C code / extract-assets (push) Waiting to run
Build C code / build-linux (x86_64, Debug, clang, custom) (push) Blocked by required conditions
Build C code / build-linux (x86_64, Debug, clang, lle) (push) Blocked by required conditions
Build C code / build-linux (x86_64, Debug, gcc, custom) (push) Blocked by required conditions
Build C code / build-linux (x86_64, Debug, gcc, lle) (push) Blocked by required conditions
Build C code / build-linux (x86_64, RelWithDebInfo, clang, custom) (push) Blocked by required conditions
Build C code / build-linux (x86_64, RelWithDebInfo, clang, lle) (push) Blocked by required conditions
Build C code / build-linux (x86_64, RelWithDebInfo, gcc, custom) (push) Blocked by required conditions
Build C code / build-linux (x86_64, RelWithDebInfo, gcc, lle) (push) Blocked by required conditions
Build C code / build-macos (Debug, custom) (push) Blocked by required conditions
Build C code / build-macos (Debug, lle) (push) Blocked by required conditions
Build C code / build-macos (RelWithDebInfo, custom) (push) Blocked by required conditions
Build C code / build-macos (RelWithDebInfo, lle) (push) Blocked by required conditions
Build C code / build-windows (Debug, custom) (push) Blocked by required conditions
Build C code / build-windows (Debug, lle) (push) Blocked by required conditions
Build C code / build-windows (RelWithDebInfo, custom) (push) Blocked by required conditions
Build C code / build-windows (RelWithDebInfo, lle) (push) Blocked by required conditions
Build Saturn version / build-and-test-saturn (push) Waiting to run
Build Saturn version / function-finder-saturn (push) Waiting to run
Build Debug Module tool / build (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, hd) (push) Waiting to run
Build PSX and PSP version / build-and-test (pspeu, pspeu) (push) Waiting to run
Build PSX and PSP version / build-and-test (us, us) (push) Waiting to run
Build PSX and PSP version / generate-progress-report (pspeu, hd) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (pspeu, pspeu) (push) Blocked by required conditions
Build PSX and PSP version / generate-progress-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report (us, us) (push) Blocked by required conditions
Build PSX and PSP version / generate-duplicates-report-psp (pspeu, pspeu) (push) Blocked by required conditions

PSX: https://decomp.me/scratch/4UL86
PSP: https://decomp.me/scratch/FAeQw
This commit is contained in:
Josh Schreuder 2024-11-22 07:09:56 +11:00 committed by GitHub
parent 2244619e83
commit ff4e1baf0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 101 additions and 3 deletions

View File

@ -185,6 +185,7 @@ EntityStoneDoor = 0x801CE0F8;
EntityClockRoomUnused = 0x801CE2D8;
StageNamePopupHelper = 0x801CE654;
EntityStageNamePopup = 0x801CE824;
EntityDiplocephalusFoot = 0x801CF670;
EntitySkelerang = 0x801D191C;
EntitySkelerangBoomerang = 0x801D20A4;
EntitySkelerangUnknown = 0x801D2318;

View File

@ -2112,6 +2112,20 @@ typedef struct {
/* 0x84 */ s16 unk84;
} ET_Skelerang;
typedef struct {
/* 0x7C */ s32 : 32;
/* 0x80 */ s32 : 32;
/* 0x84 */ s32 : 32;
/* 0x88 */ s32 : 32;
/* 0x8C */ s32 : 32;
/* 0x90 */ s32 : 32;
/* 0x94 */ s32 : 32;
/* 0x98 */ u32 velocityY;
/* 0x9C */ s16 : 16;
/* 0x9E */ u8 unk9E;
/* 0x9F */ u8 unk9F;
} ET_Diplocephalus;
typedef struct {
/* 0x00 */ struct Entity* unk0;
/* 0x04 */ s16 unk4;
@ -2335,6 +2349,7 @@ typedef union { // offset=0x7C
ET_GhostEnemy ghostEnemy;
ET_GhostEnemySpawner ghostEnemySpawner;
ET_Skelerang skelerang;
ET_Diplocephalus diplocephalus;
ET_PlateLord plateLord;
ET_UnkPlatelordPlus3 unkPlatelordPlus3;
} Ext;

View File

@ -1,9 +1,88 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
#include "common.h"
#include "no0.h"
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801CF4A8);
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801CF670);
extern s16 D_us_80181D54[]; // sensors_ground
extern u8 D_us_80181D83[]; // anim frames
void EntityDiplocephalusFoot(Entity* self) {
Entity* currentEntity;
u16 x;
switch (self->step) {
case 0:
currentEntity = g_CurrentEntity;
g_CurrentEntity = self;
InitializeEntity(g_EInitDiplocephalusFoot);
g_CurrentEntity->hitboxOffY = 4;
g_CurrentEntity->animCurFrame =
D_us_80181D83[g_CurrentEntity->ext.diplocephalus.unk9E];
g_CurrentEntity = currentEntity;
// fallthrough
case 1:
currentEntity = g_CurrentEntity;
g_CurrentEntity = self;
if (UnkCollisionFunc3(D_us_80181D54) & 1) {
g_CurrentEntity->step++;
}
g_CurrentEntity = currentEntity;
break;
case 2:
if (g_CurrentEntity->step >= 4) {
if (self->facingLeft) {
self->velocityX = FIX(1.0);
} else {
self->velocityX = FIX(-1.0);
}
self->velocityY = -0x2AAA4;
self->ext.diplocephalus.unk9F = 0;
self->ext.diplocephalus.velocityY = -0x71DU;
self->animCurFrame--;
self->step = 4;
}
break;
case 3:
if (self->facingLeft) {
self->velocityX = -0x22AAA;
} else {
self->velocityX = 0x22AAA;
}
self->velocityY = -0x7FFFE;
self->ext.diplocephalus.unk9F = 0;
self->ext.diplocephalus.velocityY = 0x26AAA;
self->animCurFrame--;
self->step = 4;
break;
case 4:
self->velocityY += self->ext.diplocephalus.velocityY;
self->ext.diplocephalus.unk9F++;
currentEntity = g_CurrentEntity;
g_CurrentEntity = self;
// Walk forward, spawning dust cloud when stepping
if (UnkCollisionFunc3(&D_us_80181D54) & 1) {
PlaySfxPositional(0x779);
self->velocityX = 0;
self->velocityY = 0;
self->animCurFrame++;
if (self->ext.diplocephalus.unk9E < 3) {
if (g_CurrentEntity->facingLeft ^
(LOHU(self->ext.prim->x3) % 2)) {
EntityGreyPuffSpawner(self, 6, 3, 6, 16, 0, -4);
} else {
EntityGreyPuffSpawner(self, 6, 3, -6, 16, 0, 4);
}
}
self->step++;
}
g_CurrentEntity = currentEntity;
break;
case 5:
self->ext.diplocephalus.unk9F++;
break;
}
}
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801CF910);

View File

@ -184,7 +184,7 @@ EInit D_us_80180B00 = {ANIMSET_OVL(0x0C), 0x00, 0x4A, 0x22E, 0x056};
EInit D_us_80180B0C = {ANIMSET_OVL(0x0C), 0x00, 0x4A, 0x22E, 0x057};
EInit g_EInitDamageNum = {ANIMSET_DRA(0x00), 0x00, 0x00, 0x000, 0x003};
EInit D_us_80180B24 = {ANIMSET_OVL(0x09), 0x01, 0x4B, 0x20E, 0x010};
EInit D_us_80180B30 = {ANIMSET_OVL(0x09), 0x0C, 0x4B, 0x20E, 0x011};
EInit g_EInitDiplocephalusFoot = {ANIMSET_OVL(0x09), 0x0C, 0x4B, 0x20E, 0x011};
EInit D_us_80180B3C = {ANIMSET_OVL(0x09), 0x08, 0x4B, 0x20E, 0x005};
EInit D_us_80180B48 = {ANIMSET_OVL(0x09), 0x16, 0x4B, 0x20E, 0x012};
EInit D_us_80180B54 = {ANIMSET_OVL(0x0D), 0x00, 0x4E, 0x2C0, 0x013};

View File

@ -96,6 +96,9 @@ extern EInit g_EInitCtulhu;
extern EInit g_EInitCtulhuFireball;
extern EInit g_EInitCtulhuIceShockwave;
// Diplocephalus
extern EInit g_EInitDiplocephalusFoot;
// Clock room
extern EInit g_Statues;