pokecrystal-board/engine/unown_dex.asm
Remy Oukaour 7d4486e6a3 Remove all code from main.asm (some labeled INCBINs, like out-of-context graphics, are still present)
engine/routines/ stores isolated out-of-context routines as individual files. It might be preferable later to append them to their related engine/ files in unique little SECTIONs, relying on the linkerscript to place them appropriately; or some other organization method. In the meantime, they're now easily findable apart from main.asm's other content.
2017-12-24 19:35:35 -05:00

53 lines
607 B
NASM
Executable File

UpdateUnownDex: ; fba18
ld a, [UnownLetter]
ld c, a
ld b, NUM_UNOWN
ld hl, UnownDex
.loop
ld a, [hli]
and a
jr z, .done
cp c
ret z
dec b
jr nz, .loop
ret
.done
dec hl
ld [hl], c
ret
; fba2e
PrintUnownWord: ; fba2e (3e:7a2e)
hlcoord 4, 15
ld bc, 12
ld a, " "
call ByteFill
ld a, [wDexCurrentUnownIndex]
ld e, a
ld d, 0
ld hl, UnownDex
add hl, de
ld a, [hl]
ld e, a
ld d, 0
ld hl, UnownWords
add hl, de
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
hlcoord 4, 15
.loop
ld a, [de]
cp -1
ret z
inc de
ld [hli], a
jr .loop
; fba5a (3e:7a5a)
INCLUDE "data/unown_words.asm"