summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/global.h77
-rw-r--r--include/string_util.h32
-rw-r--r--include/text.h14
3 files changed, 123 insertions, 0 deletions
diff --git a/include/global.h b/include/global.h
index 0047fcbdb..1f7df2ca6 100644
--- a/include/global.h
+++ b/include/global.h
@@ -3,4 +3,81 @@
#include "gba/gba.h"
+enum
+{
+ VERSION_SAPPHIRE = 1,
+ VERSION_RUBY = 2,
+ VERSION_EMERALD = 3,
+};
+
+enum LanguageId {
+ LANGUAGE_JAPANESE = 1,
+ LANGUAGE_ENGLISH = 2,
+ LANGUAGE_GERMAN = 5,
+};
+
+#define GAME_LANGUAGE (LANGUAGE_ENGLISH)
+
+enum
+{
+ MALE,
+ FEMALE
+};
+
+enum
+{
+ OPTIONS_BUTTON_MODE_NORMAL,
+ OPTIONS_BUTTON_MODE_LR,
+ OPTIONS_BUTTON_MODE_L_EQUALS_A
+};
+
+enum
+{
+ OPTIONS_TEXT_SPEED_SLOW,
+ OPTIONS_TEXT_SPEED_MID,
+ OPTIONS_TEXT_SPEED_FAST
+};
+
+enum
+{
+ OPTIONS_SOUND_MONO,
+ OPTIONS_SOUND_STEREO
+};
+
+enum
+{
+ OPTIONS_BATTLE_STYLE_SHIFT,
+ OPTIONS_BATTLE_STYLE_SET
+};
+
+enum
+{
+ BAG_ITEMS = 1,
+ BAG_POKEBALLS,
+ BAG_TMsHMs,
+ BAG_BERRIES,
+ BAG_KEYITEMS
+};
+
+struct SaveBlock2
+{
+ /*0x00*/ u8 playerName[8];
+ /*0x08*/ u8 playerGender; // MALE, FEMALE
+ /*0x09*/ u8 specialSaveWarp;
+ /*0x0A*/ u8 playerTrainerId[4];
+ /*0x0E*/ u16 playTimeHours;
+ /*0x10*/ u8 playTimeMinutes;
+ /*0x11*/ u8 playTimeSeconds;
+ /*0x12*/ u8 playTimeVBlanks;
+ /*0x13*/ u8 optionsButtonMode; // OPTIONS_BUTTON_MODE_[NORMAL/LR/L_EQUALS_A]
+ /*0x14*/ u16 optionsTextSpeed:3; // OPTIONS_TEXT_SPEED_[SLOW/MID/FAST]
+ u16 optionsWindowFrameType:5; // Specifies one of the 20 decorative borders for text boxes
+ u16 optionsSound:1; // OPTIONS_SOUND_[MONO/STEREO]
+ u16 optionsBattleStyle:1; // OPTIONS_BATTLE_STYLE_[SHIFT/SET]
+ u16 optionsBattleSceneOff:1; // whether battle animations are disabled
+ u16 regionMapZoom:1; // whether the map is zoomed in
+};
+
+extern struct SaveBlock2 *gSaveBlock2Ptr;
+
#endif // GUARD_GLOBAL_H
diff --git a/include/string_util.h b/include/string_util.h
new file mode 100644
index 000000000..c20965380
--- /dev/null
+++ b/include/string_util.h
@@ -0,0 +1,32 @@
+#ifndef GUARD_STRING_UTIL_H
+#define GUARD_STRING_UTIL_H
+
+enum StringConvertMode
+{
+ STR_CONV_MODE_LEFT_ALIGN,
+ STR_CONV_MODE_RIGHT_ALIGN,
+ STR_CONV_MODE_LEADING_ZEROS
+};
+
+u8 *StringCopy10(u8 *dest, const u8 *src);
+u8 *StringGetEnd10(u8 *str);
+u8 *StringCopy8(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);
+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);
+u8 *ConvertIntToDecimalStringN(u8 *dest, s32 value, enum StringConvertMode mode, u8 n);
+u8 *ConvertIntToDecimalStringN_DigitWidth6(u8 *dest, s32 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);
+
+#endif // GUARD_STRING_UTIL_H
diff --git a/include/text.h b/include/text.h
new file mode 100644
index 000000000..98d8406b5
--- /dev/null
+++ b/include/text.h
@@ -0,0 +1,14 @@
+#ifndef GUARD_TEXT_H
+#define GUARD_TEXT_H
+
+#define CHAR_SPACE 0x00
+#define CHAR_QUESTION_MARK 0xAC
+#define CHAR_HYPHEN 0xAE
+#define CHAR_CURRENCY 0xB7
+#define CHAR_COLON 0xF0
+#define EXT_CTRL_CODE_BEGIN 0xFC // extended control code
+#define PLACEHOLDER_BEGIN 0xFD // string placeholder
+#define CHAR_NEWLINE 0xFE
+#define EOS 0xFF // end of string
+
+#endif // GUARD_TEXT_H