diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/global.h | 16 | ||||
-rw-r--r-- | include/string_util.h | 16 |
2 files changed, 29 insertions, 3 deletions
diff --git a/include/global.h b/include/global.h index 1f7df2ca6..b7038025b 100644 --- a/include/global.h +++ b/include/global.h @@ -3,6 +3,22 @@ #include "gba/gba.h" +// Prevent cross-jump optimization. +#define BLOCK_CROSS_JUMP asm(""); + +// to help in decompiling +#define asm_comment(x) asm volatile("@ -- " x " -- ") + +#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0])) + +#define POKEMON_NAME_LENGTH 10 +#define OT_NAME_LENGTH 7 + +extern u8 gStringVar1[]; +extern u8 gStringVar2[]; +extern u8 gStringVar3[]; +extern u8 gStringVar4[]; + enum { VERSION_SAPPHIRE = 1, diff --git a/include/string_util.h b/include/string_util.h index c20965380..382f52251 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -10,7 +10,7 @@ enum StringConvertMode u8 *StringCopy10(u8 *dest, const u8 *src); u8 *StringGetEnd10(u8 *str); -u8 *StringCopy8(u8 *dest, const u8 *src); +u8 *StringCopy7(u8 *dest, const u8 *src); u8 *StringCopy(u8 *dest, const u8 *src); u8 *StringAppend(u8 *dest, const u8 *src); u8 *StringCopyN(u8 *dest, const u8 *src, u8 n); @@ -18,15 +18,25 @@ u8 *StringAppendN(u8 *dest, const u8 *src, u8 n); u16 StringLength(const u8 *str); s32 StringCompare(const u8 *str1, const u8 *str2); s32 StringCompareN(const u8 *str1, const u8 *str2, u32 n); +bool8 IsStringLengthAtLeast(const u8 *str, s32 n); u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); -u8 *ConvertIntToDecimalStringN_DigitWidth6(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); +u8 *ConvertUIntToDecimalStringN(u8 *dest, u32 value, enum StringConvertMode mode, u8 n); u8 *ConvertIntToHexStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n); -u8 *ConvertIntToDecimalString(u8 *dest, s32 value); u8 *StringExpandPlaceholders(u8 *dest, const u8 *src); u8 *StringBraille(u8 *dest, const u8 *src); u8 *GetExpandedPlaceholder(u32 id); u8 *StringFill(u8 *dest, u8 c, u16 n); u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); u8 *StringFillWithTerminator(u8 *dest, u16 n); +u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); +u32 StringLength_Multibyte(u8 *str); +u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); +bool32 sub_8009228(u8 *str); +bool32 sub_800924C(u8 *str, s32 n); +u8 GetExtCtrlCodeLength(u8 code); +static const u8 *SkipExtCtrlCode(const u8 *s); +s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2); +void ConvertInternationalString(u8 *s, u8 language); +void StripExtCtrlCodes(u8 *str); #endif // GUARD_STRING_UTIL_H |