aboutsummaryrefslogtreecommitdiffstats
path: root/macros/code.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2025-11-23 22:19:21 -0500
committerGitHub <noreply@github.com>2025-11-23 21:19:21 -0600
commit308189b638d3dbed2283e041221b8db7d6063094 (patch)
treea588912a560ed276dd39654e90d4b2d5cd5c3534 /macros/code.asm
parentUse more hardware and graphics constants (#532) (diff)
downloadpokeyellow-308189b638d3dbed2283e041221b8db7d6063094.tar.gz
pokeyellow-308189b638d3dbed2283e041221b8db7d6063094.tar.xz
pokeyellow-308189b638d3dbed2283e041221b8db7d6063094.zip
Use `ld_hli_a_string` macro to make byte-by-byte strings more obvious (#540)
Diffstat (limited to 'macros/code.asm')
-rw-r--r--macros/code.asm8
1 files changed, 8 insertions, 0 deletions
diff --git a/macros/code.asm b/macros/code.asm
index c972f97e..70ff4249 100644
--- a/macros/code.asm
+++ b/macros/code.asm
@@ -10,6 +10,14 @@ ENDM
; Design patterns
+MACRO ld_hli_a_string
+ FOR n, CHARLEN(\1) - 1
+ ld a, CHARVAL(STRCHAR(\1, n))
+ ld [hli], a
+ ENDR
+ ld [hl], CHARVAL(STRCHAR(\1, CHARLEN(\1) - 1))
+ENDM
+
MACRO dict
IF \1 == 0
and a