diff --git a/data/data_080CB570.s b/data/data_080CB570.s index ae280443..c1270bfb 100644 --- a/data/data_080CB570.s +++ b/data/data_080CB570.s @@ -2,13 +2,6 @@ .include "constants/constants.inc" .section .rodata - .align 2 - -gUnk_080CB570:: @ 080CB570 - .incbin "baserom.gba", 0x0CB570, 0x0000018 - -gUnk_080CB588:: @ 080CB588 - .incbin "baserom.gba", 0x0CB588, 0x0000008 gUnk_080CB590:: @ 080CB590 .incbin "baserom.gba", 0x0CB590, 0x0000018 diff --git a/linker.ld b/linker.ld index 962668bc..c3d812bd 100644 --- a/linker.ld +++ b/linker.ld @@ -917,6 +917,7 @@ SECTIONS { data/rollobiteAnimations.o(.rodata); src/enemy/darkNut.o(.rodata); data/darkNutAnimations.o(.rodata); + src/enemy/hangingSeed.o(.rodata); data/data_080CB570.o(.rodata); src/enemy.o(.rodata); data/data_080D3D94.o(.rodata); diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index 7f0ba1dc..cd204a6e 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -1,39 +1,51 @@ -#include "global.h" #include "entity.h" - -extern void EnemyFunctionHandler(Entity*, void (*const funcs[])(Entity*)); -extern void DeleteThisEntity(); +#include "functions.h" extern void (*const gUnk_080CB570[])(Entity*); extern void (*const gUnk_080CB588[])(Entity*); -void HangingSeed(Entity *this) -{ - EnemyFunctionHandler(this, gUnk_080CB570); +void HangingSeed(Entity* this) { + EnemyFunctionHandler(this, gUnk_080CB570); } -void sub_080216E4(Entity *this) -{ - gUnk_080CB588[this->action](this); +void sub_080216E4(Entity* this) { + gUnk_080CB588[this->action](this); } -void sub_080216FC(Entity *this) -{ - if ((this->bitfield & 0x80) != 0) { - CreateFx(this, 3, 0x80); - DeleteThisEntity(); - } +void sub_080216FC(Entity* this) { + if (this->bitfield & 0x80) { + CreateFx(this, 3, 0x80); + DeleteThisEntity(); + } } -void nullsub_7(Entity* this){} - -void sub_08021720(Entity *this) -{ - this->action = 1; - this->spriteSettings.b.draw = 1; - this->frameIndex = (this->entityType).form; - this->spriteRendering.b3 = 1; - this->spritePriority.b0 = 3; +void nullsub_7(Entity* this) { } -void nullsub_08(Entity* this){} \ No newline at end of file +void sub_08021720(Entity* this) { + this->action = 1; + this->spriteSettings.b.draw = 1; + this->frameIndex = this->entityType.form; + this->spriteRendering.b3 = 1; + this->spritePriority.b0 = 3; +} + +void nullsub_08(Entity* this) { +} + +// clang-format off +void (*const gUnk_080CB570[])(Entity*) = { + sub_080216E4, + sub_080216FC, + sub_08001324, + sub_0804A7D4, + sub_08001242, + nullsub_7, +}; + +void (*const gUnk_080CB588[])(Entity*) = { + sub_08021720, + nullsub_08, +}; +// clang-format on +