From 88d87495ed2e5e29074ee97d5c636ec75a6e88fe Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 12 Jan 2017 21:00:43 -0800 Subject: decompile name_string_util --- src/name_string_util.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 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..27e6d99d0 --- /dev/null +++ b/src/name_string_util.c @@ -0,0 +1,39 @@ +#include "global.h" +#include "text.h" +#include "string_util.h" + +void PadNameString(u8 *a1, u8 a2) +{ + u8 i; + + 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 + StripExtCtrlCodes(a1); +} -- cgit v1.2.3 From c9722602cb47eb5b6ecbccddf13df5f286a8ef7b Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:13:04 +0100 Subject: Sort includes --- src/name_string_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/name_string_util.c') diff --git a/src/name_string_util.c b/src/name_string_util.c index 27e6d99d0..a1812d5e9 100644 --- a/src/name_string_util.c +++ b/src/name_string_util.c @@ -1,6 +1,6 @@ #include "global.h" -#include "text.h" #include "string_util.h" +#include "text.h" void PadNameString(u8 *a1, u8 a2) { -- cgit v1.2.3