diff options
author | pikalaxalt <PikalaxALT@gmail.com> | 2016-06-17 15:45:52 -0400 |
---|---|---|
committer | pikalaxalt <PikalaxALT@gmail.com> | 2016-06-17 15:45:52 -0400 |
commit | f42efcae5d223bb89bb103492a91801b49947bc4 (patch) | |
tree | 9fa9b1560828fb0449d2ac520127365a08ff28d3 /home/string.asm | |
parent | 13ff559c04f47db5ed1afbf7eeddc7c6a47ffc8f (diff) |
More of HOME
Diffstat (limited to 'home/string.asm')
-rw-r--r-- | home/string.asm | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/home/string.asm b/home/string.asm index 70a0f2dd..6f804a96 100644 --- a/home/string.asm +++ b/home/string.asm @@ -1,38 +1,31 @@ -InitString:: ; 2ef6 -; Init a string of length c. +InitString:: push hl - jr _InitString -; 2ef9 + jr InitString_ -InitName:: ; 2ef9 -; Intended for names, so this function is limited to ten characters. +InitName:: push hl - ld c, 10 -; 2efc - -_InitString:: ; 2efc -; if the string pointed to by hl is empty (defined as "zero or more spaces -; followed by a null"), then initialize it to the string pointed to by de. + ld c, $a +InitString_:: push bc -.loop +.asm_2fbd ld a, [hli] - cp "@" - jr z, .blank - cp " " - jr nz, .notblank + cp $50 + jr z, .asm_2fc9 + cp $7f + jr nz, .asm_2fd4 dec c - jr nz, .loop -.blank + jr nz, .asm_2fbd +.asm_2fc9 pop bc ld l, e ld h, d pop de - ld b, 0 + ld b, $0 inc c call CopyBytes ret -.notblank + +.asm_2fd4 pop bc pop hl ret -; 2f17 |