summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorcadmic <cadmic24@gmail.com>2024-09-25 14:41:08 -0700
committerGitHub <noreply@github.com>2024-09-25 17:41:08 -0400
commit0acaed6d17afb9b47de50628d8afb8df009a2dc9 (patch)
tree013e6fefed99c3bfff01a74f94c0d66c57a89fe0 /src/code
parent8ff4faa084f58b4606dd9f8e420a75975cb04957 (diff)
[PAL N64] Match z_message.c (#2202)
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_message.c50
1 files changed, 43 insertions, 7 deletions
diff --git a/src/code/z_message.c b/src/code/z_message.c
index 86b1e2070..0f3502f36 100644
--- a/src/code/z_message.c
+++ b/src/code/z_message.c
@@ -3,13 +3,12 @@
#include "terminal.h"
#include "versions.h"
#include "assets/textures/parameter_static/parameter_static.h"
-#include "versions.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
- "ntsc-1.2:112"
+ "ntsc-1.2:112 pal-1.0:128 pal-1.1:128"
#if !PLATFORM_GC
#define OCARINA_BUTTON_A_PRIM_1_R 80
@@ -108,7 +107,7 @@ u16 sNextTextId = 0;
s16 sTextIsCredits = false;
-#if OOT_PAL
+#if PLATFORM_GC && OOT_PAL
UNK_TYPE D_8014B30C = 0;
#endif
@@ -1724,7 +1723,7 @@ void Message_Decode(PlayState* play) {
Font* font = &play->msgCtx.font;
s32 charTexIdx = 0;
s16 i;
-#if OOT_NTSC
+#if !(PLATFORM_GC && OOT_PAL)
s16 j;
#endif
s16 decodedBufPos = 0;
@@ -1735,7 +1734,7 @@ void Message_Decode(PlayState* play) {
s16 loadChar;
u16 value;
u8 curChar;
-#if OOT_NTSC
+#if !(PLATFORM_GC && OOT_PAL)
u16 curCharWide;
u8* fontBuf;
#endif
@@ -2562,18 +2561,47 @@ void Message_OpenText(PlayState* play, u16 textId) {
if (gSaveContext.language == LANGUAGE_ENG) {
Message_FindMessagePAL(play, textId);
msgCtx->msgLength = font->msgLength;
+#if PLATFORM_N64
+ if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_64(&play->msgCtx.font)) {
+
+ } else {
+ DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset,
+ font->msgLength);
+ }
+#else
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_nes_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1966);
+#endif
} else if (gSaveContext.language == LANGUAGE_GER) {
Message_FindMessagePAL(play, textId);
msgCtx->msgLength = font->msgLength;
+#if PLATFORM_N64
+ //! @bug checks unk_64 != NULL instead of unk_68 != NULL
+ if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_68(&play->msgCtx.font)) {
+
+ } else {
+ DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset,
+ font->msgLength);
+ }
+#else
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_ger_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1978);
+#endif
} else {
Message_FindMessagePAL(play, textId);
msgCtx->msgLength = font->msgLength;
+#if PLATFORM_N64
+ //! @bug checks unk_64 != NULL instead of unk_6C_PAL != NULL
+ if ((B_80121220 != NULL) && (B_80121220->unk_64 != NULL) && B_80121220->unk_6C_PAL(&play->msgCtx.font)) {
+
+ } else {
+ DmaMgr_RequestSync(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset,
+ font->msgLength);
+ }
+#else
DMA_REQUEST_SYNC(font->msgBuf, (uintptr_t)_fra_message_data_staticSegmentRomStart + font->msgOffset,
font->msgLength, "../z_message_PAL.c", 1990);
+#endif
}
#endif
}
@@ -4005,7 +4033,10 @@ void Message_Update(PlayState* play) {
s16 playerFocusScreenPosY;
s16 actorFocusScreenPosY;
#if OOT_VERSION < GC_US
- s32 pad[2];
+ s32 pad1;
+#endif
+#if OOT_NTSC && OOT_VERSION < GC_US
+ s32 pad2;
#endif
#if OOT_DEBUG
@@ -4323,9 +4354,14 @@ void Message_SetTables(void) {
sStaffMessageEntryTablePtr = sStaffMessageEntryTable;
-#if PLATFORM_N64
+#if PLATFORM_N64 && OOT_NTSC
if ((B_80121220 != NULL) && (B_80121220->unk_58 != NULL)) {
B_80121220->unk_58(&sJpnMessageEntryTablePtr, &sNesMessageEntryTablePtr, &sStaffMessageEntryTablePtr);
}
+#elif PLATFORM_N64 && OOT_PAL
+ if ((B_80121220 != NULL) && (B_80121220->unk_58 != NULL)) {
+ B_80121220->unk_58(&sNesMessageEntryTablePtr, &sGerMessageEntryTablePtr, &sFraMessageEntryTablePtr,
+ &sStaffMessageEntryTablePtr);
+ }
#endif
}