summaryrefslogtreecommitdiff
path: root/home/tables.asm
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2018-07-03 13:27:51 -0400
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2018-07-03 13:27:51 -0400
commit870d85fc2713703f6dbc760df5b2c54328f0c9c3 (patch)
tree4da5541e9015b8649f85206ed49d507432a199d5 /home/tables.asm
parent264748172d24333f11ecec09a2c36b2b44f597d0 (diff)
Merge branch 'master' of https://github.com/pret/pokegold-spaceworld
Diffstat (limited to 'home/tables.asm')
-rwxr-xr-xhome/tables.asm54
1 files changed, 27 insertions, 27 deletions
diff --git a/home/tables.asm b/home/tables.asm
index 5c35a4f..02fc78a 100755
--- a/home/tables.asm
+++ b/home/tables.asm
@@ -1,27 +1,27 @@
-INCLUDE "constants.asm"
-
-SECTION "FindItemInTable", ROM0[$35F8]
-
-; find value a from table hl with row length de
-; returns carry and row index b if successful
-FindItemInTable: ; 00:35F8
- ld b, 0
- ld c, a
-
-.loop
- ld a, [hl]
- cp -1
- jr z, .fail
- cp c
- jr z, .success
- inc b
- add hl, de
- jr .loop
-
-.fail
- and a
- ret
-
-.success
- scf
- ret
+INCLUDE "constants.asm"
+
+SECTION "FindItemInTable", ROM0[$35F8]
+
+; find value a from table hl with row length de
+; returns carry and row index b if successful
+FindItemInTable: ; 00:35F8
+ ld b, 0
+ ld c, a
+
+.loop
+ ld a, [hl]
+ cp -1
+ jr z, .fail
+ cp c
+ jr z, .success
+ inc b
+ add hl, de
+ jr .loop
+
+.fail
+ and a
+ ret
+
+.success
+ scf
+ ret