Decompile object81

This commit is contained in:
Tal Hayon 2022-03-14 12:54:30 +02:00
parent dd81c3a59c
commit 5eec991497
4 changed files with 41 additions and 95 deletions

View File

@ -1,84 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start Object81
Object81: @ 0x08098C68
push {lr}
ldr r2, _08098C7C @ =gUnk_08123674
ldrb r1, [r0, #0xc]
lsls r1, r1, #2
adds r1, r1, r2
ldr r1, [r1]
bl _call_via_r1
pop {pc}
.align 2, 0
_08098C7C: .4byte gUnk_08123674
thumb_func_start sub_08098C80
sub_08098C80: @ 0x08098C80
push {r4, r5, r6, lr}
adds r4, r0, #0
movs r0, #0
movs r5, #1
strb r5, [r4, #0xc]
strb r0, [r4, #0xe]
movs r0, #0x2e
ldrsh r1, [r4, r0]
ldr r2, _08098CC8 @ =gRoomControls
ldrh r0, [r2, #6]
subs r1, r1, r0
asrs r1, r1, #4
movs r3, #0x3f
ands r1, r3
movs r6, #0x32
ldrsh r0, [r4, r6]
ldrh r2, [r2, #8]
subs r0, r0, r2
asrs r0, r0, #4
ands r0, r3
lsls r0, r0, #6
orrs r1, r0
adds r0, r4, #0
adds r0, #0x80
strh r1, [r0]
ldr r0, _08098CCC @ =gPlayerState
ldr r0, [r0, #0x30]
movs r1, #0x80
ands r0, r1
cmp r0, #0
beq _08098CD0
adds r1, r4, #0
adds r1, #0x38
movs r0, #2
strb r0, [r1]
b _08098CD6
.align 2, 0
_08098CC8: .4byte gRoomControls
_08098CCC: .4byte gPlayerState
_08098CD0:
adds r0, r4, #0
adds r0, #0x38
strb r5, [r0]
_08098CD6:
adds r0, r4, #0
bl UpdateSpriteForCollisionLayer
adds r0, r4, #0
adds r0, #0x80
ldrh r1, [r0]
subs r1, #0x40
movs r0, #0x47
movs r2, #1
bl sub_08000148
pop {r4, r5, r6, pc}
.align 2, 0
thumb_func_start nullsub_124
nullsub_124: @ 0x08098CF0
bx lr
.align 2, 0

View File

@ -1,9 +0,0 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
.align 2
gUnk_08123674:: @ 08123674
.4byte sub_08098C80
.4byte nullsub_124

View File

@ -751,7 +751,7 @@ SECTIONS {
src/object/object7E.o(.text);
asm/object/picoBloom.o(.text);
src/object/board.o(.text);
asm/object/object81.o(.text);
src/object/object81.o(.text);
src/object/bigVortex.o(.text);
src/object/bigPushableLever.o(.text);
src/object/smallIceBlock.o(.text);
@ -1496,7 +1496,7 @@ SECTIONS {
data/const/object/picoBloom.o(.rodata);
data/animations/object/picoBloom.o(.rodata);
src/object/board.o(.rodata);
data/const/object/object81.o(.rodata);
src/object/object81.o(.rodata);
data/const/object/bigVortex.o(.rodata);
data/animations/object/bigVortex.o(.rodata);
src/object/bigPushableLever.o(.rodata);

39
src/object/object81.c Normal file
View File

@ -0,0 +1,39 @@
#define NENT_DEPRECATED
#include "entity.h"
#include "player.h"
#include "functions.h"
#include "sound.h"
typedef struct {
Entity base;
u8 filler[0x18];
u16 tilePos;
} Object81Entity;
void Object81_Init(Object81Entity*);
void Object81_Action1(Object81Entity*);
void Object81(Entity* this) {
static void (*const actionFuncs[])(Object81Entity*) = {
Object81_Init,
Object81_Action1,
};
actionFuncs[this->action]((Object81Entity*)this);
}
void Object81_Init(Object81Entity* this) {
super->action = 1;
super->actionDelay = 0;
this->tilePos = COORD_TO_TILE(super);
if (gPlayerState.flags & PL_MINISH) {
super->collisionLayer = 2;
} else {
super->collisionLayer = 1;
}
UpdateSpriteForCollisionLayer(super);
sub_08000148(0x47, this->tilePos - 0x40, 1);
}
void Object81_Action1(Object81Entity* this) {
}