diff options
author | Pokeglitch <pokeglitchx@gmail.com> | 2018-06-04 20:54:45 -0400 |
---|---|---|
committer | Pokeglitch <pokeglitchx@gmail.com> | 2018-06-04 20:54:45 -0400 |
commit | c315ddbf891866de0dc0566d09ac29614287f767 (patch) | |
tree | 307b208bcf1b5849009776eec7ceec3386403341 /home/tables.asm | |
parent | 30833ed3d7f4e93682a2382a7f84d77a1db5b48f (diff) |
More formatting fixes
Diffstat (limited to 'home/tables.asm')
-rwxr-xr-x | home/tables.asm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/home/tables.asm b/home/tables.asm index dc0a7a2..dc9cebe 100755 --- a/home/tables.asm +++ b/home/tables.asm @@ -4,20 +4,19 @@ 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
-.nextItem
+.loop
ld a, [hl]
- cp $FF
+ cp -1
jr z, .fail
cp c
jr z, .success
inc b
add hl, de
- jr .nextItem
+ jr .loop
.fail
and a
@@ -25,4 +24,4 @@ FindItemInTable: ; 00:35F8 .success
scf
- ret
\ No newline at end of file + ret
|