summaryrefslogtreecommitdiff
path: root/asm/code_805D850.s
blob: be2ae85620613962307046f1db4e2da020412c28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
	#include "asm/constants/gba_constants.inc"
  	#include "asm/macros.inc"

  	.syntax unified

  	.text
  
	thumb_func_start LastMoveOutOfPP
LastMoveOutOfPP:
	push {r4,r5,lr}
	movs r3, 0
	movs r5, 0x1
	adds r2, r0, 0
	movs r4, 0x10
_0805D85A:
	ldrb r1, [r2]
	adds r0, r5, 0
	ands r0, r1
	cmp r0, 0
	beq _0805D876
	adds r0, r4, 0
	ands r0, r1
	cmp r0, 0
	beq _0805D876
	ldrb r0, [r2, 0x4]
	cmp r0, 0
	bne _0805D876
	movs r0, 0x1
	b _0805D880
_0805D876:
	adds r2, 0x8
	adds r3, 0x1
	cmp r3, 0x3
	ble _0805D85A
	movs r0, 0
_0805D880:
	pop {r4,r5}
	pop {r1}
	bx r1
	thumb_func_end LastMoveOutOfPP

	.align 2, 0