summaryrefslogtreecommitdiff
path: root/engine/items/tmhm.asm
diff options
context:
space:
mode:
authorU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-22 18:13:20 -0400
committerU-Fish-PC\Daniel <corrnondacqb@yahoo.com>2014-05-22 18:13:20 -0400
commit15427f532085846ab6b51719be687951a094cb6c (patch)
treeedea9b189e91641a12dd521756894df84aeeace7 /engine/items/tmhm.asm
parentea3ba4cde3706b7c77efb705555ec0c86321cbe2 (diff)
Pull a lot of engine out of main.asm
Diffstat (limited to 'engine/items/tmhm.asm')
-rwxr-xr-xengine/items/tmhm.asm26
1 files changed, 26 insertions, 0 deletions
diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm
new file mode 100755
index 00000000..5b7b4e8e
--- /dev/null
+++ b/engine/items/tmhm.asm
@@ -0,0 +1,26 @@
+; checks if the mon in wWhichPokemon already knows the move in $d0e0
+CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
+ ld a, [wWhichPokemon]
+ ld hl, W_PARTYMON1_MOVE1
+ ld bc, $2c
+ call AddNTimes
+ ld a, [$d0e0]
+ ld b, a
+ ld c, $4 ; nubmer of moves
+.loop
+ ld a, [hli]
+ cp b
+ jr z, .alreadyKnown ; found a match
+ dec c
+ jr nz, .loop
+ and a
+ ret
+.alreadyKnown
+ ld hl, AlreadyKnowsText
+ call PrintText
+ scf
+ ret
+
+AlreadyKnowsText: ; 2fe3b (b:7e3b)
+ TX_FAR _AlreadyKnowsText
+ db "@"