summaryrefslogtreecommitdiff
path: root/include/message_data_static.h
diff options
context:
space:
mode:
authorTharo <17233964+Thar0@users.noreply.github.com>2024-07-03 03:42:52 +0100
committerGitHub <noreply@github.com>2024-07-02 22:42:52 -0400
commitbaf1e8c1748b6440e5d594a8d0079d4eb2e3acee (patch)
tree1262546b46a6e2327e55451193ce62383aceae3e /include/message_data_static.h
parent264581ff3fa28dade7544b0827ced1b1de683388 (diff)
Reworked text extraction + add JP text extraction (#1980)
* Reworked text extraction + add JP text extraction * Format * Suggested changes * Correct address for gc-us sJpnMessageEntryTable Co-authored-by: cadmic <cadmic24@gmail.com> --------- Co-authored-by: cadmic <cadmic24@gmail.com>
Diffstat (limited to 'include/message_data_static.h')
-rw-r--r--include/message_data_static.h46
1 files changed, 38 insertions, 8 deletions
diff --git a/include/message_data_static.h b/include/message_data_static.h
index b888192d5..cb655da6f 100644
--- a/include/message_data_static.h
+++ b/include/message_data_static.h
@@ -1,7 +1,7 @@
#ifndef MESSAGE_DATA_STATIC_H
#define MESSAGE_DATA_STATIC_H
-#include "global.h"
+#include "ultra64.h"
#include "message_data_fmt.h"
typedef enum {
@@ -35,24 +35,54 @@ typedef struct {
* Message Symbol Declarations
*/
-#define DEFINE_MESSAGE(textId, type, yPos, staffMessage) \
- extern const char _message_##textId##_staff[];
+/* Non-Credits Messages */
-#include "assets/text/message_data_staff.h"
+#if (TEXT_LANGUAGE == TEXT_LANG_US_JP)
+#define DEFINE_MESSAGE_NES(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ extern const char _message_##textId##_nes[];
-#undef DEFINE_MESSAGE
+#define DEFINE_MESSAGE_JPN(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ extern const char _message_##textId##_jpn[];
-#define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) \
+#define DEFINE_MESSAGE_FFFC(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ DEFINE_MESSAGE_JPN(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage)
+
+#define FONT_MESSAGE_OFFSET (_message_0xFFFC_jpn - (const char*)_jpn_message_data_staticSegmentStart)
+#define FONT_MESSAGE_LENGTH (_message_0xFFFD_jpn - _message_0xFFFC_jpn)
+#else
+#define DEFINE_MESSAGE_NES(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
extern const char _message_##textId##_nes[]; \
extern const char _message_##textId##_ger[]; \
extern const char _message_##textId##_fra[];
-#define DEFINE_MESSAGE_NES(textId, type, yPos, nesMessage) \
- extern const char _message_##textId##_nes[];
+#define DEFINE_MESSAGE_JPN(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ /* Empty */
+
+#define DEFINE_MESSAGE_FFFC(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ DEFINE_MESSAGE_NES(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage)
+
+#define FONT_MESSAGE_OFFSET (_message_0xFFFC_nes - (const char*)_nes_message_data_staticSegmentStart)
+#define FONT_MESSAGE_LENGTH (_message_0xFFFD_nes - _message_0xFFFC_nes)
+#endif
+
+#define DEFINE_MESSAGE(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ DEFINE_MESSAGE_NES(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage) \
+ DEFINE_MESSAGE_JPN(textId, type, yPos, jpnMessage, nesMessage, gerMessage, fraMessage)
#include "assets/text/message_data.h"
#undef DEFINE_MESSAGE
#undef DEFINE_MESSAGE_NES
+#undef DEFINE_MESSAGE_JPN
+#undef DEFINE_MESSAGE_FFFC
+
+/* Credits Messages */
+
+#define DEFINE_MESSAGE(textId, type, yPos, staffMessage) \
+ extern const char _message_##textId##_staff[];
+
+#include "assets/text/message_data_staff.h"
+
+#undef DEFINE_MESSAGE
#endif