diff --git a/assets/assets.json b/assets/assets.json index 32ea2ebb..c5b10da5 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -39945,11 +39945,6 @@ "size": 7, "type": "animation" }, - { - "path": "phonograph/gUnk_081145E4.bin", - "start": 1132004, - "size": 212 - }, { "path": "npc58/gUnk_081146B8.bin", "start": 1132216, diff --git a/data/const/npc/phonograph.s b/data/const/npc/phonograph.s deleted file mode 100644 index daec8b24..00000000 --- a/data/const/npc/phonograph.s +++ /dev/null @@ -1,8 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_081145E4:: @ 081145E4 - .incbin "phonograph/gUnk_081145E4.bin" diff --git a/linker.ld b/linker.ld index 0be7a0cb..fdd4f88f 100644 --- a/linker.ld +++ b/linker.ld @@ -1296,7 +1296,7 @@ SECTIONS { data/animations/npc/hurdyGurdyMan.o(.rodata); src/npc/cucco.o(.rodata); src/npc/cuccoChick.o(.rodata); - data/const/npc/phonograph.o(.rodata); + src/npc/phonograph.o(.rodata); data/const/npc/npc58.o(.rodata); src/npcDefinitions.o(.rodata); data/data_081146D0.o(.rodata); diff --git a/src/npc/phonograph.c b/src/npc/phonograph.c index 44be7575..a5de78b2 100644 --- a/src/npc/phonograph.c +++ b/src/npc/phonograph.c @@ -14,7 +14,6 @@ void sub_0806EABC(Entity* this, u32 param); #endif extern Font gUnk_081146B8; -extern s8 gUnk_081145E4[]; void Phonograph(Entity* this) { if (this->action == 0) { @@ -29,6 +28,15 @@ void Phonograph(Entity* this) { HandleEntity0x82Actions(this); } +static const s16 gUnk_081145E4[] = { + 0x0, -0x1, 0x3, 0x1c8, 0x4, 0x171, 0x5, 0x236, 0x6, -0x1, 0xa, -0x1, 0xc, 0x23a, 0xd, -0x1, 0xe, -0x1, + 0xf, -0x1, 0x13, -0x1, 0x14, -0x1, 0x15, -0x1, 0x16, -0x1, 0x17, -0x1, 0x18, -0x1, 0x19, -0x1, 0x1a, -0x1, + 0x1c, -0x1, 0x1d, -0x1, 0x20, -0x1, 0x2d, -0x1, 0x2e, -0x1, 0x2f, -0x1, 0x33, -0x1, 0x35, -0x1, 0x37, -0x1, + 0x38, -0x1, 0x3a, -0x1, 0x1, -0x1, 0x9, 0x320e, 0xb, -0x1, 0x11, -0x1, 0x1e, -0x1, 0x1f, -0x1, 0x21, -0x1, + 0x22, -0x1, 0x23, -0x1, 0x24, -0x1, 0x25, -0x1, 0x26, -0x1, 0x27, -0x1, 0x28, -0x1, 0x29, -0x1, 0x2a, -0x1, + 0x2b, -0x1, 0x2c, -0x1, 0x30, -0x1, 0x31, -0x1, 0x32, -0x1, 0x34, -0x1, 0x36, -0x1, 0x3b, -0x1 +}; + #ifdef EU void sub_0806E964(Entity* this, ScriptExecutionContext* context) { if (gInput.newKeys & B_BUTTON) { @@ -73,13 +81,13 @@ void sub_0806E964(Entity* this, ScriptExecutionContext* context) { if (gInput.newKeys & A_BUTTON) { if ((s16)this->field_0x68.HWORD != (s16)this->field_0x6a.HWORD || (s16)this->field_0x6c.HWORD == 0) { - s8* ptr2 = gUnk_081145E4; + const s16* ptr2 = gUnk_081145E4; s32 field_0x68; - SoundReq(*(s16*)(ptr2 + (s16)this->field_0x68.HWORD * 4)); + SoundReq(*(ptr2 + (s16)this->field_0x68.HWORD * 2)); this->field_0x6a.HWORD = this->field_0x68.HWORD; field_0x68 = (s16)this->field_0x68.HWORD * 4; - ptr2 += 2; - this->field_0x6c.HWORD = *(s16*)(((ptr2 + field_0x68))); + ptr2++; + this->field_0x6c.HWORD = *(s16*)((((int)ptr2 + field_0x68))); } else { SoundReq(SONG_STOP_ALL); this->field_0x6a.HWORD = 0; @@ -155,13 +163,13 @@ void sub_0806E964(Entity* this, ScriptExecutionContext* context) { if (gInput.newKeys & A_BUTTON) { if ((s16)this->field_0x68.HWORD != (s16)this->field_0x6a.HWORD || (s16)this->field_0x6c.HWORD == 0) { - s8* ptr2 = gUnk_081145E4; + const s16* ptr2 = gUnk_081145E4; s32 field_0x68; - SoundReq(*(s16*)(ptr2 + (s16)this->field_0x68.HWORD * 4)); + SoundReq(*(ptr2 + (s16)this->field_0x68.HWORD * 2)); this->field_0x6a.HWORD = this->field_0x68.HWORD; field_0x68 = (s16)this->field_0x68.HWORD * 4; - ptr2 += 2; - this->field_0x6c.HWORD = *(s16*)(((ptr2 + field_0x68))); + ptr2++; + this->field_0x6c.HWORD = *(s16*)((((int)ptr2 + field_0x68))); } else { SoundReq(SONG_STOP_ALL); this->field_0x6a.HWORD = 0;