mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-09-08 00:46:55 -05:00
Addresses of sections will now be added to the linkerscript via `org`, and the section name will be the path/to/file. If there is more than one section in the file, then add a @SectionName after the path/to/file to describe the section.
27 lines
326 B
NASM
Executable File
27 lines
326 B
NASM
Executable File
INCLUDE "constants.asm"
|
|
|
|
SECTION "home/tables.asm", ROM0
|
|
|
|
; 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 |