diff --git a/assets/assets.json b/assets/assets.json index ecb9f510..50118494 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -43044,16 +43044,6 @@ "size": 27, "type": "animation" }, - { - "path": "swordsmanNewsletter/gUnk_081228A8.bin", - "start": 1190056, - "size": 8 - }, - { - "path": "swordsmanNewsletter/gUnk_081228B8.bin", - "start": 1190072, - "size": 16 - }, { "path": "animations/gSpriteAnimations_Object64_0.bin", "start": 1190252, diff --git a/data/const/object/swordsmanNewsletter.s b/data/const/object/swordsmanNewsletter.s deleted file mode 100644 index 2040cdfd..00000000 --- a/data/const/object/swordsmanNewsletter.s +++ /dev/null @@ -1,15 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_081228A8:: @ 081228A8 - .incbin "swordsmanNewsletter/gUnk_081228A8.bin" - -gUnk_081228B0:: @ 081228B0 - .4byte sub_080933D8 - .4byte sub_080933FC - -gUnk_081228B8:: @ 081228B8 - .incbin "swordsmanNewsletter/gUnk_081228B8.bin" diff --git a/linker.ld b/linker.ld index 93613e76..68c8e5b3 100644 --- a/linker.ld +++ b/linker.ld @@ -1451,7 +1451,7 @@ SECTIONS { src/object/whirlwind.o(.rodata); data/animations/object/whirlwind.o(.rodata); src/object/objectBlockingStairs.o(.rodata); - data/const/object/swordsmanNewsletter.o(.rodata); + src/object/swordsmanNewsletter.o(.rodata); src/object/object61.o(.rodata); src/object/giantTwig.o(.rodata); src/object/object63.o(.rodata); diff --git a/src/object/swordsmanNewsletter.c b/src/object/swordsmanNewsletter.c index d71fd1f8..344ea110 100644 --- a/src/object/swordsmanNewsletter.c +++ b/src/object/swordsmanNewsletter.c @@ -3,27 +3,33 @@ #include "message.h" extern void sub_080787B4(Entity*); +void sub_080933D8(Entity*); +void sub_080933FC(Entity*); -extern void (*const gUnk_081228B0[])(Entity*); - -extern Hitbox gUnk_081228A8; -extern u16 gUnk_081228B8[]; +static const Hitbox gUnk_081228A8 = { 0, 0, {}, 6, 8 }; void SwordsmanNewsletter(Entity* this) { - gUnk_081228B0[this->action](this); + static void (*const actionFuncs[])(Entity*) = { + sub_080933D8, + sub_080933FC, + }; + actionFuncs[this->action](this); } void sub_080933D8(Entity* this) { this->action = 1; this->frameIndex = this->type; UpdateSpriteForCollisionLayer(this); - this->hitbox = &gUnk_081228A8; + this->hitbox = (Hitbox*)&gUnk_081228A8; sub_080787B4(this); } void sub_080933FC(Entity* this) { + static const u16 messageIndices[] = { + 0x301, 0x302, 0x303, 0x304, 0x305, 0x306, 0x307, 0x308, + }; if (this->interactType != 0) { this->interactType = 0; - MessageNoOverlap(gUnk_081228B8[this->type], this); + MessageNoOverlap(messageIndices[this->type], this); } }