summaryrefslogtreecommitdiff
path: root/asm/code_80494EC.s
diff options
context:
space:
mode:
authorAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-01-04 00:00:31 -0600
committerAnonymousRandomPerson <chenghanngan.us@gmail.com>2022-01-04 00:00:31 -0600
commitc30cf5c6da8283330bc352d58acc037739cd8b72 (patch)
tree5111fdbfe6da65738816bfb8fd7c3b1a11f3ca29 /asm/code_80494EC.s
parenta61f7ea2a1913df28ea4f3ecd71c57fa4e5bbf5c (diff)
Decomped EvaluateItem()
Diffstat (limited to 'asm/code_80494EC.s')
-rw-r--r--asm/code_80494EC.s59
1 files changed, 59 insertions, 0 deletions
diff --git a/asm/code_80494EC.s b/asm/code_80494EC.s
new file mode 100644
index 0000000..a38b22b
--- /dev/null
+++ b/asm/code_80494EC.s
@@ -0,0 +1,59 @@
+ #include "asm/constants/gba_constants.inc"
+ #include "asm/macros.inc"
+
+ .syntax unified
+
+ .text
+
+ thumb_func_start CanTargetAdjacentPokemon
+CanTargetAdjacentPokemon:
+ push {r4-r6,lr}
+ adds r5, r0, 0
+ movs r6, 0
+_080494F2:
+ movs r1, 0x4
+ ldrsh r0, [r5, r1]
+ ldr r1, _08049538
+ lsls r2, r6, 2
+ adds r2, r1
+ movs r3, 0
+ ldrsh r1, [r2, r3]
+ adds r0, r1
+ movs r3, 0x6
+ ldrsh r1, [r5, r3]
+ movs r3, 0x2
+ ldrsh r2, [r2, r3]
+ adds r1, r2
+ bl GetMapTileAtPosition
+ ldr r4, [r0, 0x10]
+ cmp r4, 0
+ beq _0804953C
+ adds r0, r4, 0
+ bl GetEntityType
+ cmp r0, 0
+ beq _0804953C
+ adds r0, r5, 0
+ adds r1, r4, 0
+ movs r2, 0
+ movs r3, 0x1
+ bl CanTarget
+ lsls r0, 24
+ lsrs r0, 24
+ cmp r0, 0x1
+ bne _0804953C
+ movs r0, 0x1
+ b _08049544
+ .align 2, 0
+_08049538: .4byte gAdjacentTileOffsets
+_0804953C:
+ adds r6, 0x1
+ cmp r6, 0x7
+ ble _080494F2
+ movs r0, 0
+_08049544:
+ pop {r4-r6}
+ pop {r1}
+ bx r1
+ thumb_func_end CanTargetAdjacentPokemon
+
+ .align 2, 0 \ No newline at end of file