From daa05c1b7c5e079ad8554e88a290e07b333bd2db Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Sun, 18 Feb 2018 19:59:51 -0600 Subject: remove subdirectories --- src/name_string_util.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/name_string_util.c (limited to 'src/name_string_util.c') diff --git a/src/name_string_util.c b/src/name_string_util.c new file mode 100644 index 000000000..32e9358e1 --- /dev/null +++ b/src/name_string_util.c @@ -0,0 +1,40 @@ +#include "global.h" +#include "name_string_util.h" +#include "string_util.h" +#include "text.h" + +void PadNameString(u8 *a1, u8 a2) +{ + u8 i; + + Text_StripExtCtrlCodes(a1); + i = StringLength(a1); + + if (a2 == 0xFC) + { + while (i < 6) + { + a1[i] = 0xFC; + a1[i + 1] = 7; + i += 2; + } + } + else + { + while (i < 6) + { + a1[i] = a2; + i++; + } + } + + a1[i] = EOS; +} + +void SanitizeNameString(u8 *a1) +{ + if (StringLength(a1) < 6) + ConvertInternationalString(a1, 1); + else + Text_StripExtCtrlCodes(a1); +} -- cgit v1.2.3