mirror of https://github.com/pret/pokeemerald.git
GetOppositeDirection
This commit is contained in:
parent
9514206969
commit
0e3dbf3235
|
@ -5,36 +5,6 @@
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start GetOppositeDirection
|
|
||||||
@ u8 GetOppositeDirection(u8 direction)
|
|
||||||
GetOppositeDirection: @ 8093800
|
|
||||||
push {r4,lr}
|
|
||||||
sub sp, 0x8
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r4, r0, 24
|
|
||||||
ldr r1, =gUnknown_0850DC27
|
|
||||||
mov r0, sp
|
|
||||||
movs r2, 0x8
|
|
||||||
bl memcpy
|
|
||||||
subs r1, r4, 0x1
|
|
||||||
lsls r0, r1, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
cmp r0, 0x7
|
|
||||||
bhi _08093828
|
|
||||||
mov r2, sp
|
|
||||||
adds r0, r2, r1
|
|
||||||
ldrb r0, [r0]
|
|
||||||
b _0809382A
|
|
||||||
.pool
|
|
||||||
_08093828:
|
|
||||||
adds r0, r4, 0
|
|
||||||
_0809382A:
|
|
||||||
add sp, 0x8
|
|
||||||
pop {r4}
|
|
||||||
pop {r1}
|
|
||||||
bx r1
|
|
||||||
thumb_func_end GetOppositeDirection
|
|
||||||
|
|
||||||
thumb_func_start zffu_offset_calc
|
thumb_func_start zffu_offset_calc
|
||||||
zffu_offset_calc: @ 8093834
|
zffu_offset_calc: @ 8093834
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
|
|
|
@ -4058,3 +4058,17 @@ dirn2anim_2(sub_8093750, gUnknown_0850DC13);
|
||||||
dirn2anim_2(sub_809377C, gUnknown_0850DC18);
|
dirn2anim_2(sub_809377C, gUnknown_0850DC18);
|
||||||
dirn2anim_2(sub_80937A8, gUnknown_0850DC1D);
|
dirn2anim_2(sub_80937A8, gUnknown_0850DC1D);
|
||||||
dirn2anim_2(d2s_08064034, gUnknown_0850DC22);
|
dirn2anim_2(d2s_08064034, gUnknown_0850DC22);
|
||||||
|
|
||||||
|
extern const u8 gUnknown_0850DC27[8];
|
||||||
|
|
||||||
|
u8 GetOppositeDirection(u8 direction)
|
||||||
|
{
|
||||||
|
u8 directions[sizeof gUnknown_0850DC27];
|
||||||
|
|
||||||
|
memcpy(directions, gUnknown_0850DC27, sizeof gUnknown_0850DC27);
|
||||||
|
if (direction < 1 || direction > (sizeof gUnknown_0850DC27))
|
||||||
|
{
|
||||||
|
return direction;
|
||||||
|
}
|
||||||
|
return directions[direction - 1];
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue