From b04d5046c2527b9f8af619526aaf593ed081e1f8 Mon Sep 17 00:00:00 2001 From: ser-pounce Date: Fri, 15 Dec 2023 10:04:14 +0100 Subject: [PATCH] Decompile NP3 func_801D0B40 (#847) Thanks for the help on Discord, resolves #718. --- include/entity.h | 8 ++++++++ src/st/np3/4E69C.c | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/include/entity.h b/include/entity.h index 5035a00e4..30104197f 100644 --- a/include/entity.h +++ b/include/entity.h @@ -357,6 +357,13 @@ typedef struct { /* 0x84 */ s32 elevatorTarget; } ET_Elevator; +typedef struct { + /* 0x7C */ s32 pad[8]; + /* 0x84 */ s16 unk84; + /* 0x86 */ s16 unk86; + /* 0x88 */ s16* unk88; +} ET_801D0B40; + typedef struct { /* 0x7C */ struct Primitive* prim; /* 0x80 */ char pad_80[0xC]; @@ -654,6 +661,7 @@ typedef union { /* 0x7C */ ET_CastleDoor castleDoor; /* 0x7C */ ET_DeathSkySwirl deathSkySwirl; /* 0x7C */ ET_Elevator elevator; + /* 0x7C */ ET_801D0B40 et_801D0B40; /* 0x7C */ ET_801D1BB8 et_801D1BB8; /* 0x7C */ ET_801D0B78 et_801D0B78; /* 0x7C */ ET_WaterEffects waterEffects; diff --git a/src/st/np3/4E69C.c b/src/st/np3/4E69C.c index bbf6ada5b..043de07d5 100644 --- a/src/st/np3/4E69C.c +++ b/src/st/np3/4E69C.c @@ -266,7 +266,13 @@ void func_801D0A00(s16* arg0) { } } -INCLUDE_ASM("asm/us/st/np3/nonmatchings/4E69C", func_801D0B40); +void func_801D0B40(void) { + s16* unk88 = g_CurrentEntity[15].ext.et_801D0B40.unk88; + g_CurrentEntity[15].ext.et_801D0B40.unk84 = unk88[0x4E] - 0x600; + + unk88 = g_CurrentEntity[16].ext.et_801D0B40.unk88; + g_CurrentEntity[16].ext.et_801D0B40.unk84 = unk88[0x4E] - 0x600; +} s32 func_801D0B78(void) { s32 ret;