diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2018-03-16 08:40:24 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2018-03-16 08:40:24 -0400 |
commit | 0e372d2fb6785ba47011b6ee0ad1b68ea05ae198 (patch) | |
tree | 72a7d12902002dc661cd543a270a11bda45a7645 /src/name_string_util.c | |
parent | b98c803e6d25785b3b268c2c26a87ac74a7e3a95 (diff) | |
parent | d51855dfadf9e1357ef8e33e90b5156f8561405c (diff) |
Merge branch 'master' into tomomichi_debug_menu
Diffstat (limited to 'src/name_string_util.c')
-rw-r--r-- | src/name_string_util.c | 40 |
1 files changed, 40 insertions, 0 deletions
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); +} |