mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-22 20:49:50 +00:00
Decompile no0
func_us_801D0718
+ func_us_801D0898
(#1930)
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
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
Couple of smaller Diplo functions and a little bit of clean up for the earlier function I did `func_us_801D0718` PSX: https://decomp.me/scratch/NkB3j PSP: https://decomp.me/scratch/xz0Oi `func_us_801D0898` PSX: https://decomp.me/scratch/7GFMG PSP: https://decomp.me/scratch/aHDvP
This commit is contained in:
parent
e883d78be3
commit
e0c36018a7
@ -2113,17 +2113,21 @@ typedef struct {
|
||||
} ET_Skelerang;
|
||||
|
||||
typedef struct {
|
||||
/* 0x7C */ s32 : 32;
|
||||
/* 0x80 */ s32 : 32;
|
||||
/* 0x7C */ struct Entity* parent;
|
||||
/* 0x80 */ struct Entity* entity;
|
||||
/* 0x84 */ s32 : 32;
|
||||
/* 0x88 */ s32 : 32;
|
||||
/* 0x8C */ s32 : 32;
|
||||
/* 0x90 */ s32 : 32;
|
||||
/* 0x90 */ Point32* unk90;
|
||||
/* 0x94 */ s32 : 32;
|
||||
/* 0x98 */ u32 velocityY;
|
||||
/* 0x98 */ s32 velocityY;
|
||||
/* 0x9C */ s16 : 16;
|
||||
/* 0x9E */ u8 unk9E;
|
||||
/* 0x9F */ u8 unk9F;
|
||||
/* 0xA0 */ u32 : 32;
|
||||
/* 0xA4 */ s32 posX;
|
||||
/* 0xA8 */ s32 posY;
|
||||
/* 0xAC */ s32 unkAC;
|
||||
} ET_Diplocephalus;
|
||||
|
||||
typedef struct {
|
||||
|
@ -68,7 +68,7 @@ void EntityDiplocephalusFoot(Entity* self) {
|
||||
self->animCurFrame++;
|
||||
if (self->ext.diplocephalus.unk9E < 3) {
|
||||
if (g_CurrentEntity->facingLeft ^
|
||||
(LOHU(self->ext.prim->x3) % 2)) {
|
||||
(self->ext.diplocephalus.parent->step % 2)) {
|
||||
EntityGreyPuffSpawner(self, 6, 3, 6, 16, 0, -4);
|
||||
} else {
|
||||
EntityGreyPuffSpawner(self, 6, 3, -6, 16, 0, 4);
|
||||
@ -86,15 +86,75 @@ void EntityDiplocephalusFoot(Entity* self) {
|
||||
|
||||
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801CF910);
|
||||
|
||||
// Main entity?
|
||||
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801CFBE8);
|
||||
|
||||
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801D0718);
|
||||
// Likely the torso entity that player can stand on top of
|
||||
void func_us_801D0718(Entity* self) {
|
||||
Entity* parent;
|
||||
Entity* player;
|
||||
s32 step;
|
||||
s32 collision;
|
||||
s32 posX;
|
||||
s32 posY;
|
||||
|
||||
if (!self->step) {
|
||||
InitializeEntity(g_EInitInteractable);
|
||||
self->ext.diplocephalus.posX = self->posX.i.hi + g_Tilemap.scrollX.i.hi;
|
||||
self->ext.diplocephalus.posY = self->posY.i.hi + g_Tilemap.scrollY.i.hi;
|
||||
}
|
||||
|
||||
player = &PLAYER;
|
||||
parent = self->ext.diplocephalus.parent;
|
||||
self->posX.i.hi = parent->posX.i.hi;
|
||||
self->posY.i.hi = parent->posY.i.hi;
|
||||
posX =
|
||||
self->posX.i.hi + g_Tilemap.scrollX.i.hi - self->ext.diplocephalus.posX;
|
||||
posY =
|
||||
self->posY.i.hi + g_Tilemap.scrollY.i.hi - self->ext.diplocephalus.posY;
|
||||
collision = 0;
|
||||
step = parent->step;
|
||||
if (step < 13) {
|
||||
collision = GetPlayerCollisionWith(self, 8, 18, 4) & 0xFF;
|
||||
if (collision) {
|
||||
player->posX.i.hi += posX;
|
||||
player->posY.i.hi += 2;
|
||||
D_80097488.x.i.hi += posX;
|
||||
D_80097488.y.i.hi += 2;
|
||||
}
|
||||
}
|
||||
self->ext.diplocephalus.posX = self->posX.i.hi + g_Tilemap.scrollX.i.hi;
|
||||
self->ext.diplocephalus.posY = self->posY.i.hi + g_Tilemap.scrollY.i.hi;
|
||||
|
||||
// Parent is func_us_801CFBE8 (self - 1)
|
||||
if (parent->entityId != 0x21) {
|
||||
DestroyEntity(self);
|
||||
}
|
||||
}
|
||||
|
||||
// Death explosion
|
||||
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801D0898);
|
||||
void func_us_801D0898(Entity* self, s32 count) {
|
||||
Entity* newEntity;
|
||||
s32 i;
|
||||
s8 randomX;
|
||||
s8 randomY;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
randomX = (Random() & 0x3F) - 0x20;
|
||||
randomY = (Random() & 0x1F) - 0xF;
|
||||
newEntity = AllocEntity(&g_Entities[160], &g_Entities[192]);
|
||||
if (newEntity != NULL) {
|
||||
CreateEntityFromEntity(E_EXPLOSION, self, newEntity);
|
||||
newEntity->params = 1;
|
||||
newEntity->posX.i.hi += randomX;
|
||||
newEntity->posY.i.hi += randomY;
|
||||
newEntity->zPriority = self->zPriority + 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Fireball
|
||||
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801D0990);
|
||||
|
||||
// Main entity?
|
||||
// Tail entity
|
||||
INCLUDE_ASM("st/no0/nonmatchings/e_diplocephalus", func_us_801D0E7C);
|
||||
|
Loading…
Reference in New Issue
Block a user