From bbf2f51a02b2544f1bef32a5868503b474ae2fef Mon Sep 17 00:00:00 2001 From: Rangi Date: Tue, 7 Jul 2020 18:50:58 -0400 Subject: Move all code out of home.asm into home/ This results in 64 home/*.asm files, comparable to pokecrystal's 57. --- home/move_mon.asm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'home/move_mon.asm') diff --git a/home/move_mon.asm b/home/move_mon.asm index cf7213b1..3e69e6d0 100644 --- a/home/move_mon.asm +++ b/home/move_mon.asm @@ -1,3 +1,18 @@ +; Copies [hl, bc) to [de, de + bc - hl). +; In other words, the source data is from hl up to but not including bc, +; and the destination is de. +CopyDataUntil:: + ld a, [hli] + ld [de], a + inc de + ld a, h + cp b + jr nz, CopyDataUntil + ld a, l + cp c + jr nz, CopyDataUntil + ret + ; Function to remove a pokemon from the party or the current box. ; wWhichPokemon determines the pokemon. ; [wRemoveMonFromBox] == 0 specifies the party. -- cgit v1.3.1-sl0p