From c248b30aa7487b51a9182a833b1db29f14a7267c Mon Sep 17 00:00:00 2001 From: entrpntr Date: Tue, 17 Mar 2020 15:23:39 -0400 Subject: Cleanup of files for banks $01 and $04 for main.asm. --- engine/pokemon/correct_nick_errors.asm | 53 ++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 engine/pokemon/correct_nick_errors.asm (limited to 'engine/pokemon/correct_nick_errors.asm') diff --git a/engine/pokemon/correct_nick_errors.asm b/engine/pokemon/correct_nick_errors.asm new file mode 100644 index 00000000..c7b6ff39 --- /dev/null +++ b/engine/pokemon/correct_nick_errors.asm @@ -0,0 +1,53 @@ +CorrectNickErrors:: ; 677e (1:677e) + push bc + push de + ld b, MON_NAME_LENGTH +.checkchar + ld a, [de] + cp "@" + jr z, .done + ld hl, .textcommands + dec hl +.loop + inc hl + ld a, [hl] + cp $ff + jr z, .next + ld a, [de] + cp [hl] + inc hl + jr c, .loop + cp [hl] + jr nc, .loop + ld a, "?" + ld [de], a + jr .loop + +.next + inc de + dec b + jr nz, .checkchar + pop de + push de + ld a, "?" + ld [de], a + inc de + ld a, "@" + ld [de], a +.done + pop de + pop bc + ret + +.textcommands +; table defining which characters are actually text commands +; format: + ; ≥ < + db "", $04 + 1 + db "", $18 + 1 + db $1d, "%" + 1 + db $35, "" + 1 + db "", "" + 1 + db $49, "" + 1 + db "", "┘" + 1 + db -1 ; end \ No newline at end of file -- cgit v1.2.3