diff --git a/assets/assets.json b/assets/assets.json index c64db559..97812d1b 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -36685,22 +36685,6 @@ "size": 40, "type": "animation" }, - { - "path": "stockwell/gUnk_0810FDA0_USA-JP-DEMO_USA-DEMO_JP.bin", - "variants": [ - "USA", - "JP", - "DEMO_USA", - "DEMO_JP" - ], - "start": 1113504, - "size": 4 - }, - { - "path": "stockwell/gUnk_0810FDB8.bin", - "start": 1113528, - "size": 16 - }, { "path": "animations/gSpriteAnimations_Talon_2.bin", "start": 1113824, diff --git a/data/const/npc/stockwell.s b/data/const/npc/stockwell.s deleted file mode 100644 index 6f23e1ba..00000000 --- a/data/const/npc/stockwell.s +++ /dev/null @@ -1,30 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -.ifndef EU -gUnk_0810FDA0:: @ 0810FDA0 - .incbin "stockwell/gUnk_0810FDA0_USA-JP-DEMO_USA-DEMO_JP.bin" -.endif - -gUnk_0810FDA4:: @ 0810FDA4 - .4byte sub_08065080 - .4byte sub_080650CC - .4byte sub_080651AC - .4byte sub_080651D8 - .4byte sub_08065368 - -gUnk_0810FDB8:: @ 0810FDB8 - .incbin "stockwell/gUnk_0810FDB8.bin" - -gUnk_0810FDC8:: @ 0810FDC8 - .4byte sub_080651F8 - .4byte sub_0806522C - .4byte sub_08065250 - .4byte sub_0806528C - .4byte sub_080652B0 - .4byte sub_080652E4 - .4byte sub_08065314 - .4byte sub_08065338 diff --git a/linker.ld b/linker.ld index 96b34625..08006750 100644 --- a/linker.ld +++ b/linker.ld @@ -1197,7 +1197,7 @@ SECTIONS { data/animations/npc/sturgeon.o(.rodata); src/npc/tingleSiblings.o(.rodata); data/animations/npc/tingleSiblings.o(.rodata); - data/const/npc/stockwell.o(.rodata); + src/npc/stockwell.o(.rodata); data/animations/npc/stockwell.o(.rodata); data/const/npc/talon.o(.rodata); data/animations/npc/talon.o(.rodata); diff --git a/src/npc/stockwell.c b/src/npc/stockwell.c index be0ce8e2..eec88d55 100644 --- a/src/npc/stockwell.c +++ b/src/npc/stockwell.c @@ -8,18 +8,35 @@ #include "item.h" #include "game.h" -extern void (*const gUnk_0810FDC8[])(Entity*); -extern void (*const gUnk_0810FDA4[])(Entity*); +#ifndef EU +static const u8 gUnk_0810FDA0[] = { 0, 8, 10, 16 }; +#endif + extern u16 script_StockwellBuy[]; extern u16 script_StockwellDogFood[]; -extern u8 gUnk_0810FDB8[]; extern void InitScriptExecutionContext(ScriptExecutionContext* context, u16* script); -extern u32 gUnk_0810FDA0; extern u16 script_Stockwell; +void sub_08065080(Entity*); +void sub_080650CC(Entity*); +void sub_080651AC(Entity*); +void sub_080651D8(Entity*); +void sub_08065368(Entity*); +void sub_080651F8(Entity*); +void sub_0806522C(Entity*); +void sub_08065250(Entity*); +void sub_0806528C(Entity*); +void sub_080652B0(Entity*); +void sub_080652E4(Entity*); +void sub_08065314(Entity*); +void sub_08065338(Entity*); + void Stockwell(Entity* this) { - gUnk_0810FDA4[this->action](this); + static void (*const actionFuncs[])(Entity*) = { + sub_08065080, sub_080650CC, sub_080651AC, sub_080651D8, sub_08065368, + }; + actionFuncs[this->action](this); ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_0806ED78(this); } @@ -40,6 +57,7 @@ void sub_08065080(Entity* this) { } void sub_080650CC(Entity* this) { + static const u8 gUnk_0810FDB8[] = { 4, 6, 6, 5, 6, 6, 6, 5, 6, 6, 6, 5, 6, 6, 6, 5 }; u32 bVar2; u32 confirmMsgId; u32 itemPrice; @@ -52,7 +70,7 @@ void sub_080650CC(Entity* this) { bVar2 = this->frame & 0x20; if ((bVar2 == 0) && (this->interactType != 0)) { this->interactType = bVar2; - this->action = this->action + 1; + this->action++; InitializeAnimation(this, 7); if (gRoomVars.shopItemType == 0) { confirmMsgId = 0x2c01; @@ -85,8 +103,11 @@ void sub_080651AC(Entity* this) { } void sub_080651D8(Entity* this) { + static void (*const subActionFuncs[])(Entity*) = { + sub_080651F8, sub_0806522C, sub_08065250, sub_0806528C, sub_080652B0, sub_080652E4, sub_08065314, sub_08065338, + }; GetNextFrame(this); - gUnk_0810FDC8[this->subAction](this); + subActionFuncs[this->subAction](this); } void sub_080651F8(Entity* this) {