summaryrefslogtreecommitdiff
path: root/engine/items/tmhm2.asm
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2018-03-25 16:18:33 +0200
committermid-kid <esteve.varela@gmail.com>2018-03-25 16:18:33 +0200
commit0d9241889fc8a2f047b9fd6db25e55de1e721877 (patch)
tree4ae588ae9d97639b456e6d2ba64a94676ddcf703 /engine/items/tmhm2.asm
parent60e21a86638cad5fd25133cda1c545461304d902 (diff)
Organize the engine/ directory, take 3
Renamed `title` to `movies`. Moved some functions from `engine/routines/` to their fitting directories, and cleaned up the base `engine/` directory. Moved `engine/pokemon/tmhm.asm` back to `engine/items/`. Made a new subdirectory: * engine/tilesets: Contains all map-related graphics routines.
Diffstat (limited to 'engine/items/tmhm2.asm')
-rwxr-xr-xengine/items/tmhm2.asm49
1 files changed, 49 insertions, 0 deletions
diff --git a/engine/items/tmhm2.asm b/engine/items/tmhm2.asm
new file mode 100755
index 000000000..9db3dc291
--- /dev/null
+++ b/engine/items/tmhm2.asm
@@ -0,0 +1,49 @@
+CanLearnTMHMMove: ; 11639
+ ld a, [wCurPartySpecies]
+ ld [wCurSpecies], a
+ call GetBaseData
+ ld hl, wBaseTMHM
+ push hl
+
+ ld a, [wPutativeTMHMMove]
+ ld b, a
+ ld c, 0
+ ld hl, TMHMMoves
+.loop
+ ld a, [hli]
+ and a
+ jr z, .end
+ cp b
+ jr z, .asm_11659
+ inc c
+ jr .loop
+
+.asm_11659
+ pop hl
+ ld b, CHECK_FLAG
+ push de
+ ld d, 0
+ predef SmallFarFlagAction
+ pop de
+ ret
+
+.end
+ pop hl
+ ld c, 0
+ ret
+; 1166a
+
+GetTMHMMove: ; 1166a
+ ld a, [wd265]
+ dec a
+ ld hl, TMHMMoves
+ ld b, 0
+ ld c, a
+ add hl, bc
+ ld a, [hl]
+ ld [wd265], a
+ ret
+; 1167a
+
+
+INCLUDE "data/moves/tmhm_moves.asm"