matched sub_0807DE80

This commit is contained in:
Henny022p
2021-02-15 10:41:38 +01:00
parent fa3339a8c2
commit 6917076fdc
2 changed files with 35 additions and 54 deletions
+35 -3
View File
@@ -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) {