ref: 1e1bbbbf8c82364dcfb8e64ad22c4ce3e9988c75
parent: 81306889e33c599f8015bc4e653929bb7de00967
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Wed Apr 4 20:04:53 EDT 2018
check_nick_errors → correct_nick_errors; matches correct_party_errors
--- a/engine/pokemon/check_nick_errors.asm
+++ /dev/null
@@ -1,74 +1,0 @@
-CheckNickErrors:: ; 669f
-; error-check monster nick before use
-; must be a peace offering to gamesharkers
-
-; input: de = nick location
-
- push bc
- push de
- ld b, MON_NAME_LENGTH
-
-.checkchar
-; end of nick?
- ld a, [de]
- cp "@" ; terminator
- jr z, .end
-
-; check if this char is a text command
- ld hl, .textcommands
- dec hl
-.loop
-; next entry
- inc hl
-; reached end of commands table?
- ld a, [hl]
- cp -1
- jr z, .done
-
-; is the current char between this value (inclusive)...
- ld a, [de]
- cp [hl]
- inc hl
- jr c, .loop
-; ...and this one?
- cp [hl]
- jr nc, .loop
-
-; replace it with a "?"
- ld a, "?"
- ld [de], a
- jr .loop
-
-.done
-; next char
- inc de
-; reached end of nick without finding a terminator?
- dec b
- jr nz, .checkchar
-
-; change nick to "?@"
- pop de
- push de
- ld a, "?"
- ld [de], a
- inc de
- ld a, "@"
- ld [de], a
-.end
-; if the nick has any errors at this point it's out of our hands
- pop de
- pop bc
- ret
-
-.textcommands ; 66cf
-; table defining which characters are actually text commands
-; format:
- ; ≥ <
- db TX_START, TX_BOX + 1
- db "<PLAY_G>", "<JP_18>" + 1
- db "<NI>", "<NO>" + 1
- db "<ROUTE>", "<GREEN>" + 1
- db "<ENEMY>", "<ENEMY>" + 1
- db "<MOM>", "<TM>" + 1
- db "<ROCKET>", "┘" + 1
- db -1 ; end
--- /dev/null
+++ b/engine/pokemon/correct_nick_errors.asm
@@ -1,0 +1,74 @@
+CorrectNickErrors:: ; 669f
+; error-check monster nick before use
+; must be a peace offering to gamesharkers
+
+; input: de = nick location
+
+ push bc
+ push de
+ ld b, MON_NAME_LENGTH
+
+.checkchar
+; end of nick?
+ ld a, [de]
+ cp "@" ; terminator
+ jr z, .end
+
+; check if this char is a text command
+ ld hl, .textcommands
+ dec hl
+.loop
+; next entry
+ inc hl
+; reached end of commands table?
+ ld a, [hl]
+ cp -1
+ jr z, .done
+
+; is the current char between this value (inclusive)...
+ ld a, [de]
+ cp [hl]
+ inc hl
+ jr c, .loop
+; ...and this one?
+ cp [hl]
+ jr nc, .loop
+
+; replace it with a "?"
+ ld a, "?"
+ ld [de], a
+ jr .loop
+
+.done
+; next char
+ inc de
+; reached end of nick without finding a terminator?
+ dec b
+ jr nz, .checkchar
+
+; change nick to "?@"
+ pop de
+ push de
+ ld a, "?"
+ ld [de], a
+ inc de
+ ld a, "@"
+ ld [de], a
+.end
+; if the nick has any errors at this point it's out of our hands
+ pop de
+ pop bc
+ ret
+
+.textcommands ; 66cf
+; table defining which characters are actually text commands
+; format:
+ ; ≥ <
+ db TX_START, TX_BOX + 1
+ db "<PLAY_G>", "<JP_18>" + 1
+ db "<NI>", "<NO>" + 1
+ db "<ROUTE>", "<GREEN>" + 1
+ db "<ENEMY>", "<ENEMY>" + 1
+ db "<MOM>", "<TM>" + 1
+ db "<ROCKET>", "┘" + 1
+ db -1 ; end
--- a/engine/pokemon/stats_screen.asm
+++ b/engine/pokemon/stats_screen.asm
@@ -772,7 +772,7 @@
ld hl, .OTNamePointers
call GetNicknamePointer
call CopyNickname
- farcall CheckNickErrors
+ farcall CorrectNickErrors
hlcoord 2, 13
call PlaceString
ld a, [wTempMonCaughtGender]
--- a/home.asm
+++ b/home.asm
@@ -1211,7 +1211,7 @@
call CopyBytes
pop de
- callfar CheckNickErrors
+ callfar CorrectNickErrors
pop bc
pop hl
--- a/main.asm
+++ b/main.asm
@@ -9,7 +9,7 @@
INCLUDE "engine/menus/intro_menu.asm"
INCLUDE "engine/overworld/init_map.asm"
INCLUDE "engine/pokemon/learn.asm"
-INCLUDE "engine/pokemon/check_nick_errors.asm"
+INCLUDE "engine/pokemon/correct_nick_errors.asm"
INCLUDE "engine/math/math.asm"
INCLUDE "data/items/attributes.asm"
INCLUDE "engine/overworld/npc_movement.asm"