mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 22:52:15 +13:00
Pull a lot of engine out of main.asm
This commit is contained in:
parent
ea3ba4cde3
commit
15427f5320
110 changed files with 39093 additions and 38990 deletions
26
engine/items/tmhm.asm
Executable file
26
engine/items/tmhm.asm
Executable file
|
|
@ -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 "@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue