Decompiler manager25

This commit is contained in:
octorock 2021-08-28 21:14:34 +02:00
parent 5981c5b71d
commit 0d8b5c786b
5 changed files with 33 additions and 105 deletions

View File

@ -1,82 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Manager25_Main
Manager25_Main: @ 0x0805C61C
push {r4, r5, lr}
adds r4, r0, #0
ldrb r0, [r4, #0xc]
cmp r0, #0
bne _0805C674
movs r0, #0x38
ldrsh r1, [r4, r0]
ldr r2, _0805C668 @ =gRoomControls
ldrh r0, [r2, #6]
subs r1, r1, r0
asrs r1, r1, #4
movs r3, #0x3f
ands r1, r3
movs r5, #0x3a
ldrsh r0, [r4, r5]
ldrh r2, [r2, #8]
subs r0, r0, r2
asrs r0, r0, #4
ands r0, r3
lsls r0, r0, #6
orrs r1, r0
strh r1, [r4, #0x38]
movs r1, #0x38
ldrsh r0, [r4, r1]
movs r1, #2
bl GetTileType
cmp r0, #0x75
bne _0805C670
movs r0, #1
strb r0, [r4, #0xc]
ldr r0, _0805C66C @ =0x0000406A
movs r2, #0x38
ldrsh r1, [r4, r2]
movs r2, #1
bl SetTile
b _0805C674
.align 2, 0
_0805C668: .4byte gRoomControls
_0805C66C: .4byte 0x0000406A
_0805C670:
bl DeleteThisEntity
_0805C674:
movs r5, #0x38
ldrsh r0, [r4, r5]
movs r1, #1
bl GetTileType
ldr r5, _0805C6B4 @ =0x0000406B
cmp r0, r5
bne _0805C694
movs r0, #0x38
ldrsh r1, [r4, r0]
movs r0, #0x76
movs r2, #2
bl sub_0807B7D8
bl DeleteThisEntity
_0805C694:
movs r1, #0x38
ldrsh r0, [r4, r1]
movs r1, #2
bl GetTileType
cmp r0, #0x76
bne _0805C6B2
movs r2, #0x38
ldrsh r1, [r4, r2]
adds r0, r5, #0
movs r2, #1
bl SetTile
bl DeleteThisEntity
_0805C6B2:
pop {r4, r5, pc}
.align 2, 0
_0805C6B4: .4byte 0x0000406B

View File

@ -176,7 +176,7 @@ extern void Manager21_Main(Entity*);
extern void Manager22_Main(Entity*);
extern void Manager23_Main(Entity*);
extern void Manager24_Main();
extern void Manager25_Main(Entity*);
extern void Manager25_Main();
extern void Manager26_Main();
extern void Manager27_Main();
extern void Manager28_Main();

View File

@ -537,7 +537,7 @@ SECTIONS {
asm/manager22.o(.text);
asm/manager23.o(.text);
src/manager/manager24.o(.text);
asm/manager25.o(.text);
src/manager/manager25.o(.text);
src/manager/manager26.o(.text);
src/manager/manager27.o(.text);
src/manager/manager28.o(.text);

View File

@ -8,27 +8,7 @@
typedef struct {
Manager manager;
u8 field_0x20;
u8 field_0x21;
u8 field_0x22;
u8 field_0x23;
u8 field_0x24;
u8 field_0x25;
u8 field_0x26;
u8 field_0x27;
u8 field_0x28;
u8 field_0x29;
u8 field_0x2a;
u8 field_0x2b;
u8 field_0x2c;
u8 field_0x2d;
u8 field_0x2e;
u8 field_0x2f;
u8 field_0x30;
u8 field_0x31;
u8 field_0x32;
u8 field_0x33;
u8 field_0x34;
u8 field_0x20[0x15];
u8 field_0x35;
u8 field_0x36;
u8 field_0x37;

30
src/manager/manager25.c Normal file
View File

@ -0,0 +1,30 @@
#include "manager.h"
#include "room.h"
#include "functions.h"
typedef struct {
struct Manager manager;
u8 field_0x20[0x18];
s16 field_0x38;
s16 field_0x3a;
} Manager25;
void Manager25_Main(Manager25* this) {
if (this->manager.action == 0) {
this->field_0x38 = TILE(this->field_0x38, this->field_0x3a);
if (GetTileType(this->field_0x38, 2) == 0x75) {
this->manager.action = 1;
SetTile(0x406a, this->field_0x38, 1);
} else {
DeleteThisEntity();
}
}
if (GetTileType(this->field_0x38, 1) == 0x406b) {
sub_0807B7D8(0x76, this->field_0x38, 2);
DeleteThisEntity();
}
if (GetTileType(this->field_0x38, 2) == 0x76) {
SetTile(0x406b, this->field_0x38, 1);
DeleteThisEntity();
}
}