partial managerA.c ok

first three functions decomped
This commit is contained in:
Ibot02 2020-08-08 17:01:13 +02:00
parent 10819392f7
commit b3dc734ad8
4 changed files with 57 additions and 74 deletions

View File

@ -6,80 +6,6 @@
.text
thumb_func_start sub_08058380
sub_08058380: @ 0x08058380
push {lr}
ldr r2, _08058394 @ =gUnk_081081F4
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_08058394: .4byte gUnk_081081F4
thumb_func_start sub_08058398
sub_08058398: @ 0x08058398
push {r4, lr}
adds r4, r0, #0
ldrh r0, [r4, #0x3c]
bl CheckFlags
cmp r0, #0
beq _080583AA
bl DeleteThisEntity
_080583AA:
adds r0, r4, #0
adds r0, #0x3a
ldrb r1, [r0]
lsls r1, r1, #3
strh r1, [r4, #0x24]
adds r0, #1
ldrb r2, [r0]
lsls r2, r2, #3
strh r2, [r4, #0x26]
subs r0, #3
ldrb r0, [r0]
lsls r0, r0, #4
adds r1, r1, r0
strh r1, [r4, #0x20]
adds r0, r4, #0
adds r0, #0x39
ldrb r0, [r0]
lsls r0, r0, #4
adds r2, r2, r0
strh r2, [r4, #0x22]
adds r0, r4, #0
movs r1, #6
bl sub_0805E3A0
ldrh r0, [r4, #0x3e]
cmp r0, #0
bne _080583E4
movs r0, #2
b _080583E6
_080583E4:
movs r0, #1
_080583E6:
strb r0, [r4, #0xc]
pop {r4, pc}
.align 2, 0
thumb_func_start sub_080583EC
sub_080583EC: @ 0x080583EC
push {r4, lr}
adds r4, r0, #0
ldrh r0, [r4, #0x3e]
bl CheckFlags
cmp r0, #0
beq _08058404
movs r0, #2
strb r0, [r4, #0xc]
adds r0, r4, #0
bl sub_08058408
_08058404:
pop {r4, pc}
.align 2, 0
thumb_func_start sub_08058408
sub_08058408: @ 0x08058408
push {r4, r5, r6, lr}

View File

@ -3,6 +3,23 @@
#include "global.h"
typedef struct {
u8 unk_00[0x0c];
u8 unk_0c;
u8 unk_0d[0x13];
u16 unk_20;
u16 unk_22;
u16 unk_24;
u16 unk_26;
u8 unk_28[0x10];
u8 unk_38;
u8 unk_39;
u8 unk_3a;
u8 unk_3b;
u16 unk_3c;
u16 unk_3e;
} Manager;
typedef struct {
u16 field_0x00;
u16 field_0x02;

View File

@ -476,6 +476,7 @@ SECTIONS {
asm/manager7.o(.text);
asm/manager8.o(.text);
asm/manager9.o(.text);
src/manager/managerA.o(.text);
asm/managerA.o(.text);
asm/managerB.o(.text);
asm/managerC.o(.text);

39
src/manager/managerA.c Normal file
View File

@ -0,0 +1,39 @@
#include "global.h"
#include "entity.h"
extern void (*gUnk_081081F4[])(Entity*);
void sub_08058380(Entity* this) {
gUnk_081081F4[this->action](this);
}
extern u32 CheckFlags(u32);
extern void DeleteThisEntity();
extern void sub_0805E3A0(Manager*, u32);
void sub_08058398(Manager* this) {
if (CheckFlags(this->unk_3c) != 0) {
DeleteThisEntity();
}
this->unk_24 = this->unk_3a<<3;
this->unk_26 = this->unk_3b<<3;
this->unk_20 = this->unk_24 + (this->unk_38<<4);
this->unk_22 = this->unk_26 + (this->unk_39<<4);
sub_0805E3A0(this, 0x06);
if (this->unk_3e == 0) {
this->unk_0c = 2;
} else {
this->unk_0c = 1;
}
}
extern void sub_08058408(Manager* this);
void sub_080583EC(Manager* this) {
if (CheckFlags(this->unk_3e) != 0) {
this->unk_0c = 2;
sub_08058408(this);
}
}