Decompile manager38

This commit is contained in:
octorock 2021-05-03 00:51:11 +02:00
parent 5be366626e
commit 1484ab66dc
3 changed files with 33 additions and 57 deletions

View File

@ -1,55 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Manager38_Main
Manager38_Main: @ 0x0805E0A8
push {lr}
ldr r2, _0805E0BC @ =gUnk_08108DE0
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_0805E0BC: .4byte gUnk_08108DE0
thumb_func_start sub_0805E0C0
sub_0805E0C0: @ 0x0805E0C0
push {r4, r5, lr}
adds r5, r0, #0
movs r0, #0
movs r1, #1
strb r1, [r5, #0xc]
strb r0, [r5, #0xe]
ldrb r0, [r5, #0xa]
bl GetCurrentRoomProperty
adds r4, r0, #0
cmp r4, #0
bne _0805E0EC
bl DeleteThisEntity
b _0805E0EC
_0805E0DE:
adds r0, r4, #0
adds r4, #0x10
bl LoadRoomEntity
str r5, [r0, #0x50]
movs r1, #0xff
strb r1, [r0, #0xe]
_0805E0EC:
ldrb r0, [r4]
cmp r0, #0xff
bne _0805E0DE
pop {r4, r5, pc}
thumb_func_start sub_0805E0F4
sub_0805E0F4: @ 0x0805E0F4
movs r1, #0
strb r1, [r0, #0xe]
bx lr
.align 2, 0

View File

@ -545,7 +545,7 @@ SECTIONS {
asm/manager2A.o(.text);
asm/manager2B.o(.text);
asm/manager2C.o(.text);
asm/manager2D.o(.text);
src/manager/manager2D.o(.text);
src/manager/manager2E.o(.text);
asm/manager2E.o(.text);
asm/manager2F.o(.text);
@ -557,7 +557,7 @@ SECTIONS {
asm/manager35.o(.text);
asm/manager36.o(.text);
asm/manager37.o(.text);
asm/manager38.o(.text);
src/manager/manager38.o(.text);
src/manager/manager39.o(.text);
asm/sub_0805E248.o(.text);
src/sub_0805E374.o(.text);

31
src/manager/manager38.c Normal file
View File

@ -0,0 +1,31 @@
#include "entity.h"
#include "room.h"
extern void (*const gUnk_08108DE0[])(Entity*);
extern Entity* LoadRoomEntity(EntityData*);
void Manager38_Main(Entity* this) {
gUnk_08108DE0[this->action](this);
}
void sub_0805E0C0(Entity* this) {
EntityData* entityData;
Entity* entity;
this->action = 1;
this->actionDelay = 0;
entityData = (EntityData*)GetCurrentRoomProperty(this->type);
if (entityData == NULL) {
DeleteThisEntity();
}
while (*(u8*)entityData != 0xff) {
entity = LoadRoomEntity(entityData++);
entity->parent = this;
entity->actionDelay = 0xff;
}
}
void sub_0805E0F4(Entity* this) {
this->actionDelay = 0;
}