mirror of https://github.com/zeldaret/tmc.git
matched sub_0807DE80
This commit is contained in:
parent
fa3339a8c2
commit
6917076fdc
|
|
@ -2084,54 +2084,3 @@ _0807DE70:
|
|||
_0807DE7C:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0807DE80
|
||||
sub_0807DE80: @ 0x0807DE80
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x80
|
||||
ldrh r3, [r0]
|
||||
cmp r3, #7
|
||||
bhi _0807DEB0
|
||||
adds r0, #2
|
||||
ldrh r1, [r0]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0807DEA4
|
||||
movs r1, #0xfc
|
||||
ands r1, r3
|
||||
ldrb r0, [r4, #0xf]
|
||||
lsrs r0, r0, #1
|
||||
adds r3, r1, r0
|
||||
b _0807DEB0
|
||||
_0807DEA4:
|
||||
movs r0, #0xfc
|
||||
ands r0, r3
|
||||
ldrb r2, [r4, #0x14]
|
||||
lsrs r1, r2, #1
|
||||
adds r3, r0, r1
|
||||
strb r2, [r4, #0xf]
|
||||
_0807DEB0:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x58
|
||||
ldrb r0, [r0]
|
||||
cmp r3, r0
|
||||
beq _0807DEC2
|
||||
adds r0, r4, #0
|
||||
adds r1, r3, #0
|
||||
bl InitAnimationForceUpdate
|
||||
_0807DEC2:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x82
|
||||
ldrh r1, [r0]
|
||||
movs r0, #4
|
||||
ands r0, r1
|
||||
movs r1, #1
|
||||
cmp r0, #0
|
||||
beq _0807DED4
|
||||
movs r1, #2
|
||||
_0807DED4:
|
||||
adds r0, r4, #0
|
||||
bl sub_080042BA
|
||||
pop {r4, pc}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,46 @@
|
|||
#include "structures.h"
|
||||
#include "functions.h"
|
||||
#include "script.h"
|
||||
#include "entity.h"
|
||||
|
||||
extern u8 gUnk_0811E514[];
|
||||
|
||||
void sub_0807DF38(void);
|
||||
extern void sub_0801C4A0(u32);
|
||||
|
||||
void sub_0807DEDC(Entity* entity, ScriptExecutionContext* context, u32 arg2, u32 arg3)
|
||||
{
|
||||
void sub_0807DE80(Entity* entity) {
|
||||
u32 local1;
|
||||
u16 local2;
|
||||
|
||||
u32 temp;
|
||||
|
||||
local2 = entity->field_0x80.HWORD;
|
||||
if (local2 < 8) {
|
||||
if (entity->field_0x82.HWORD & 1) {
|
||||
u32 t1, t2;
|
||||
t1 = local2 & 0xfc;
|
||||
t2 = entity->field_0xf >> 1;
|
||||
local2 = t1 + t2;
|
||||
} else {
|
||||
u32 t1, t2;
|
||||
t1 = local2 & 0xfc;
|
||||
t2 = entity->animationState >> 1;
|
||||
local2 = t1 + t2;
|
||||
entity->field_0xf = entity->animationState;
|
||||
}
|
||||
}
|
||||
if (local2 != entity->animIndex) {
|
||||
InitAnimationForceUpdate(entity, local2);
|
||||
}
|
||||
temp = entity->field_0x82.HWORD & 4;
|
||||
local1 = 1;
|
||||
if (temp) {
|
||||
local1 = 2;
|
||||
}
|
||||
sub_080042BA(entity, local1);
|
||||
}
|
||||
|
||||
void sub_0807DEDC(Entity* entity, ScriptExecutionContext* context, u32 arg2, u32 arg3) {
|
||||
int temp;
|
||||
s32 t0, t1;
|
||||
|
||||
|
|
@ -22,7 +54,7 @@ void sub_0807DEDC(Entity* entity, ScriptExecutionContext* context, u32 arg2, u32
|
|||
t1 = context->unk_20.HALF.HI - entity->y.HALF.HI;
|
||||
temp = sub_080045DA(t0, t1);
|
||||
entity->direction = temp;
|
||||
entity->animationState = (entity->animationState & 0x80) | gUnk_0811E514[(u32)(temp <<0x18)>>0x1c];
|
||||
entity->animationState = (entity->animationState & 0x80) | gUnk_0811E514[(u32)(temp << 0x18) >> 0x1c];
|
||||
}
|
||||
|
||||
void sub_0807DF28(void) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue