summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi@gmail.com>2018-06-01 01:08:22 -0400
committerRangi <remy.oukaour+rangi@gmail.com>2018-06-01 01:08:22 -0400
commit26646f96eafb177b81c2d80311e5d21508eef008 (patch)
tree93c0585b5188a26e9ec642d8d89737cd6b5767a8
parent1f764d96c4ee5f09ac784d506f1b53e315dccdf5 (diff)
Some landmark name routines
-rw-r--r--engine/landmarks.asm11
-rw-r--r--home/names.asm19
2 files changed, 30 insertions, 0 deletions
diff --git a/engine/landmarks.asm b/engine/landmarks.asm
new file mode 100644
index 0000000..9e3c95d
--- /dev/null
+++ b/engine/landmarks.asm
@@ -0,0 +1,11 @@
+INCLUDE "constants.asm"
+
+SECTION "GetLandmarkName", ROMX[$4AA5], BANK[$3F]
+
+GetLandmarkName::
+ dec a
+ ld hl, LandmarkNames
+ call GetNthString
+ ld d, h
+ ld e, l
+ ret
diff --git a/home/names.asm b/home/names.asm
new file mode 100644
index 0000000..366d795
--- /dev/null
+++ b/home/names.asm
@@ -0,0 +1,19 @@
+INCLUDE "constants.asm"
+
+SECTION "GetNthString", ROM0[$3732]
+
+GetNthString::
+; Return the address of the ath string starting from hl.
+ and a
+ ret z
+ push bc
+ ld b, a
+ ld c, "@"
+.readChar:
+ ld a, [hli]
+ cp c
+ jr nz, .readChar
+ dec b
+ jr nz, .readChar
+ pop bc
+ ret