From e74dce24b4bbb0d0d23a1724932b289050b66d4a Mon Sep 17 00:00:00 2001 From: xCrystal Date: Wed, 1 Apr 2015 11:23:27 +0200 Subject: Rename battle files and split move effects Part 1 1.asm, 4.asm, and 4_2.asm --- engine/overworld/is_player_just_outside_map.asm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 engine/overworld/is_player_just_outside_map.asm (limited to 'engine/overworld') diff --git a/engine/overworld/is_player_just_outside_map.asm b/engine/overworld/is_player_just_outside_map.asm new file mode 100644 index 00000000..24e434b3 --- /dev/null +++ b/engine/overworld/is_player_just_outside_map.asm @@ -0,0 +1,16 @@ +; returns whether the player is one tile outside the map in Z +IsPlayerJustOutsideMap: ; 128d8 (4:68d8) + ld a, [W_YCOORD] + ld b, a + ld a, [W_CURMAPHEIGHT] + call .compareCoordWithMapDimension + ret z + ld a, [W_XCOORD] + ld b, a + ld a, [W_CURMAPWIDTH] +.compareCoordWithMapDimension + add a + cp b + ret z + inc b + ret -- cgit v1.3.1-sl0p