Decompile fusionMenuNPC

This commit is contained in:
octorock 2021-04-29 23:22:53 +02:00
parent ef5d1e4fa3
commit 8878c724fb
3 changed files with 18 additions and 54 deletions

View File

@ -1,53 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start FusionMenuNPC
FusionMenuNPC: @ 0x0806E8CC
push {lr}
adds r3, r0, #0
ldr r2, _0806E8EC @ =gNPCFunctions
ldrb r1, [r3, #0xf]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #2
adds r2, #8
adds r0, r0, r2
ldr r1, [r0]
cmp r1, #0
beq _0806E8F0
adds r0, r3, #0
bl _call_via_r1
b _0806E8F4
.align 2, 0
_0806E8EC: .4byte gNPCFunctions
_0806E8F0:
bl DeleteThisEntity
_0806E8F4:
pop {pc}
.align 2, 0
thumb_func_start FusionMenuNPC_Head
FusionMenuNPC_Head: @ 0x0806E8F8
push {lr}
adds r3, r0, #0
ldr r2, _0806E918 @ =gNPCFunctions
ldrb r1, [r3, #0xf]
lsls r0, r1, #1
adds r0, r0, r1
lsls r0, r0, #2
adds r2, #4
adds r0, r0, r2
ldr r1, [r0]
cmp r1, #0
beq _0806E916
adds r0, r3, #0
bl _call_via_r1
_0806E916:
pop {pc}
.align 2, 0
_0806E918: .4byte gNPCFunctions

View File

@ -648,7 +648,7 @@ SECTIONS {
asm/hurdyGurdyMan.o(.text);
asm/cucco.o(.text);
asm/cuccoChick.o(.text);
asm/fusionMenuNPC.o(.text);
src/npc/fusionMenuNPC.o(.text);
asm/phonograph.o(.text);
asm/npc58.o(.text);
/* END npcs */

17
src/npc/fusionMenuNPC.c Normal file
View File

@ -0,0 +1,17 @@
#include "global.h"
#include "entity.h"
#include "npc.h"
void FusionMenuNPC(Entity* this) {
if (gNPCFunctions[this->field_0xf][2] != NULL) {
gNPCFunctions[this->field_0xf][2](this);
} else {
DeleteThisEntity();
}
}
void FusionMenuNPC_Head(Entity* this) {
if (gNPCFunctions[this->field_0xf][1] != NULL) {
gNPCFunctions[this->field_0xf][1](this);
}
}