47 lines
555 B
NASM
Raw Normal View History

GetLandmarkCoords:
2013-11-28 03:54:21 -05:00
; Return coordinates (d, e) of landmark e.
2013-02-17 02:56:50 -05:00
push hl
ld l, e
2013-11-28 03:54:21 -05:00
ld h, 0
2013-02-17 02:56:50 -05:00
add hl, hl
add hl, hl
2013-02-17 02:56:50 -05:00
ld de, Landmarks
add hl, de
ld a, [hli]
ld e, a
ld d, [hl]
pop hl
ret
GetLandmarkName::
2018-01-23 17:39:09 -05:00
; Copy the name of landmark e to wStringBuffer1.
2013-02-17 02:56:50 -05:00
push hl
push de
push bc
2013-11-28 03:54:21 -05:00
2013-02-17 02:56:50 -05:00
ld l, e
2013-11-28 03:54:21 -05:00
ld h, 0
2013-02-17 02:56:50 -05:00
add hl, hl
add hl, hl
2013-11-28 03:54:21 -05:00
ld de, Landmarks + 2
2013-02-17 02:56:50 -05:00
add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
2013-11-28 03:54:21 -05:00
2018-01-23 17:39:09 -05:00
ld de, wStringBuffer1
2013-02-17 02:56:50 -05:00
ld c, 18
2013-11-28 03:54:21 -05:00
.copy
2013-02-17 02:56:50 -05:00
ld a, [hli]
ld [de], a
inc de
dec c
2013-11-28 03:54:21 -05:00
jr nz, .copy
2013-02-17 02:56:50 -05:00
pop bc
pop de
pop hl
ret
INCLUDE "data/maps/landmarks.asm"