From 4bfc3f4629eeacf69c1e3a70b63afc93b16879ca Mon Sep 17 00:00:00 2001 From: pizza1398 <259104093+pizza1398@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:41:47 +0100 Subject: [PATCH 1/6] Write regional languages to patch - Append regional languages to Language struct - Process the 3 new languages when writing patch - Write new languages to bigger "offsets" array - Write delays to "offsets" array's 10 leftover bits --- source/custom_messages.cpp | 28 ++++++++++++++++------------ source/include/custom_messages.hpp | 15 +++++++++------ 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/source/custom_messages.cpp b/source/custom_messages.cpp index d7884b7..9e27d39 100644 --- a/source/custom_messages.cpp +++ b/source/custom_messages.cpp @@ -51,15 +51,18 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua newEntry.flags = flags; newEntry.sfxAndFlags = ((instant) ? 0x8000 : 0x0000) | ((repeatSfx) ? 0x4000 : 0x0000) | sfx; - u32 offsetEn = 0, offsetFr = 0, offsetEs = 0, offsetDe = 0, offsetIt = 0, offsetNl = 0; + u32 offsetNaEn = 0, offsetNaFr = 0, offsetNaEs = 0, offsetEuEn = 0, offsetEuFr = 0, offsetEuEs = 0, offsetEuDe = 0, offsetEuIt = 0, offsetEuNl = 0; u32 offsetCol = 0, offsetIcon = 0, offsetDelay = 0; - if (text.English) offsetEn = pushText(text.English); - if (text.French) offsetFr = pushText(text.French); - if (text.Spanish) offsetEs = pushText(text.Spanish); - if (text.German) offsetDe = pushText(text.German); - if (text.Italian) offsetIt = pushText(text.Italian); - if (text.Dutch) offsetNl = pushText(text.Dutch); + if (text.NaEnglish) offsetNaEn = offsetEuEn = pushText(text.NaEnglish); + if (text.NaFrench) offsetNaFr = offsetEuFr = pushText(text.NaFrench); + if (text.NaSpanish) offsetNaEs = offsetEuEs = pushText(text.NaSpanish); + if (text.EuGerman) offsetEuDe = pushText(text.EuGerman); + if (text.EuItalian) offsetEuIt = pushText(text.EuItalian); + if (text.EuDutch) offsetEuNl = pushText(text.EuDutch); + if (text.EuEnglish) offsetEuEn = pushText(text.EuEnglish); + if (text.EuFrench) offsetEuFr = pushText(text.EuFrench); + if (text.EuSpanish) offsetEuEs = pushText(text.EuSpanish); if (cols.size()) { offsetCol = colData.size() * 2 - colParity; @@ -160,11 +163,12 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua delayParity = (delayParity + 1) % 4; } - newEntry.offsets[0] = offsetEn | (offsetFr << 18); - newEntry.offsets[1] = (offsetFr >> 14) | (offsetEs << 4) | (offsetDe << 22); - newEntry.offsets[2] = (offsetDe >> 10) | (offsetIt << 8) | (offsetNl << 26); - newEntry.offsets[3] = (offsetNl >> 6) | (offsetCol << 12) | (offsetIcon << 22); - newEntry.delayOffset= (u16)offsetDelay; + newEntry.offsets[0] = offsetNaEn | (offsetNaFr << 18); + newEntry.offsets[1] = (offsetNaFr >> 14) | (offsetNaEs << 4) | (offsetEuEn << 22); + newEntry.offsets[2] = (offsetEuEn >> 10) | (offsetEuFr << 8) | (offsetEuEs << 26); + newEntry.offsets[3] = (offsetEuEs >> 6) | (offsetEuDe << 12) | (offsetEuIt << 30); + newEntry.offsets[4] = (offsetEuIt >> 2) | (offsetEuNl << 16); + newEntry.offsets[5] = (offsetEuNl >> 16) | (offsetCol << 2) | (offsetIcon << 12) | (offsetDelay << 22); messageEntries.insert(newEntry); // Duplicate moon trial hints to their alternate version diff --git a/source/include/custom_messages.hpp b/source/include/custom_messages.hpp index 1c96360..f4f2304 100644 --- a/source/include/custom_messages.hpp +++ b/source/include/custom_messages.hpp @@ -7,12 +7,15 @@ namespace CustomMessages { typedef struct { - const char* English; - const char* French; - const char* Spanish; - const char* German; - const char* Italian; - const char* Dutch; + const char* NaEnglish; + const char* NaFrench; + const char* NaSpanish; + const char* EuGerman; + const char* EuItalian; + const char* EuDutch; + const char* EuEnglish; + const char* EuFrench; + const char* EuSpanish; } Language; void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Language& text, const std::vector& cols, const std::vector& icons, const std::vector& delays, From 0e77a8d992eed96088fbaac7481ce161b7bf1b96 Mon Sep 17 00:00:00 2001 From: pizza1398 <259104093+pizza1398@users.noreply.github.com> Date: Fri, 27 Feb 2026 16:38:38 +0100 Subject: [PATCH 2/6] Comment out Dutch from Languages and CustomMessage Processing a language that the game refuses to load is pointless --- source/custom_messages.cpp | 2 +- source/include/custom_messages.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/custom_messages.cpp b/source/custom_messages.cpp index 9e27d39..95f461e 100644 --- a/source/custom_messages.cpp +++ b/source/custom_messages.cpp @@ -59,7 +59,7 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua if (text.NaSpanish) offsetNaEs = offsetEuEs = pushText(text.NaSpanish); if (text.EuGerman) offsetEuDe = pushText(text.EuGerman); if (text.EuItalian) offsetEuIt = pushText(text.EuItalian); - if (text.EuDutch) offsetEuNl = pushText(text.EuDutch); + //if (text.EuDutch) offsetEuNl = pushText(text.EuDutch); if (text.EuEnglish) offsetEuEn = pushText(text.EuEnglish); if (text.EuFrench) offsetEuFr = pushText(text.EuFrench); if (text.EuSpanish) offsetEuEs = pushText(text.EuSpanish); diff --git a/source/include/custom_messages.hpp b/source/include/custom_messages.hpp index f4f2304..bf6e1e2 100644 --- a/source/include/custom_messages.hpp +++ b/source/include/custom_messages.hpp @@ -12,7 +12,7 @@ typedef struct { const char* NaSpanish; const char* EuGerman; const char* EuItalian; - const char* EuDutch; + //const char* EuDutch; const char* EuEnglish; const char* EuFrench; const char* EuSpanish; From 0267bf331c7766f17d6f8ddba950133de2ae680e Mon Sep 17 00:00:00 2001 From: pizza1398 <259104093+pizza1398@users.noreply.github.com> Date: Fri, 27 Feb 2026 16:55:17 +0100 Subject: [PATCH 3/6] Reduce redundancy when pushing text to patch If a language's string is identical to its "parent", just leave it --- source/custom_messages.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/custom_messages.cpp b/source/custom_messages.cpp index 95f461e..4052ee5 100644 --- a/source/custom_messages.cpp +++ b/source/custom_messages.cpp @@ -54,15 +54,16 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua u32 offsetNaEn = 0, offsetNaFr = 0, offsetNaEs = 0, offsetEuEn = 0, offsetEuFr = 0, offsetEuEs = 0, offsetEuDe = 0, offsetEuIt = 0, offsetEuNl = 0; u32 offsetCol = 0, offsetIcon = 0, offsetDelay = 0; + //If text exists and doesn't seem redundant, write it to patch and store its offset if (text.NaEnglish) offsetNaEn = offsetEuEn = pushText(text.NaEnglish); - if (text.NaFrench) offsetNaFr = offsetEuFr = pushText(text.NaFrench); - if (text.NaSpanish) offsetNaEs = offsetEuEs = pushText(text.NaSpanish); - if (text.EuGerman) offsetEuDe = pushText(text.EuGerman); - if (text.EuItalian) offsetEuIt = pushText(text.EuItalian); + if (text.NaFrench && (text.NaFrench != text.NaEnglish)) offsetNaFr = offsetEuFr = pushText(text.NaFrench); + if (text.NaSpanish && (text.NaSpanish != text.NaEnglish)) offsetNaEs = offsetEuEs = pushText(text.NaSpanish); + if (text.EuGerman && (text.EuGerman != text.EuEnglish)) offsetEuDe = pushText(text.EuGerman); + if (text.EuItalian && (text.EuItalian != text.EuEnglish)) offsetEuIt = pushText(text.EuItalian); //if (text.EuDutch) offsetEuNl = pushText(text.EuDutch); - if (text.EuEnglish) offsetEuEn = pushText(text.EuEnglish); - if (text.EuFrench) offsetEuFr = pushText(text.EuFrench); - if (text.EuSpanish) offsetEuEs = pushText(text.EuSpanish); + if (text.EuEnglish && (text.EuEnglish != text.NaEnglish)) offsetEuEn = pushText(text.EuEnglish); + if (text.EuFrench && (text.EuFrench != text.NaFrench )) offsetEuFr = pushText(text.EuFrench); + if (text.EuSpanish && (text.EuSpanish != text.NaSpanish)) offsetEuEs = pushText(text.EuSpanish); if (cols.size()) { offsetCol = colData.size() * 2 - colParity; From 6d98e262ff9fb7ed0f19de917f2b3471d5f3d935 Mon Sep 17 00:00:00 2001 From: pizza1398 <259104093+pizza1398@users.noreply.github.com> Date: Sat, 28 Feb 2026 18:48:42 +0100 Subject: [PATCH 4/6] Update Z3DR --- Z3DR | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Z3DR b/Z3DR index 84ab8cb..51f90ff 160000 --- a/Z3DR +++ b/Z3DR @@ -1 +1 @@ -Subproject commit 84ab8cb35f17366d8ef4501d592b203314bd5556 +Subproject commit 51f90ff4d71a1851bf482e8e97e672829f7712d6 From ba7953941acdf77db2dce8d2a841eff79554765a Mon Sep 17 00:00:00 2001 From: pizza1398 <259104093+pizza1398@users.noreply.github.com> Date: Sat, 28 Feb 2026 20:32:22 +0100 Subject: [PATCH 5/6] Rename Dutch variables to Japanese --- source/custom_messages.cpp | 8 ++++---- source/include/custom_messages.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/custom_messages.cpp b/source/custom_messages.cpp index 4052ee5..977716b 100644 --- a/source/custom_messages.cpp +++ b/source/custom_messages.cpp @@ -51,7 +51,7 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua newEntry.flags = flags; newEntry.sfxAndFlags = ((instant) ? 0x8000 : 0x0000) | ((repeatSfx) ? 0x4000 : 0x0000) | sfx; - u32 offsetNaEn = 0, offsetNaFr = 0, offsetNaEs = 0, offsetEuEn = 0, offsetEuFr = 0, offsetEuEs = 0, offsetEuDe = 0, offsetEuIt = 0, offsetEuNl = 0; + u32 offsetNaEn = 0, offsetNaFr = 0, offsetNaEs = 0, offsetEuEn = 0, offsetEuFr = 0, offsetEuEs = 0, offsetEuDe = 0, offsetEuIt = 0, offsetJpJp = 0; u32 offsetCol = 0, offsetIcon = 0, offsetDelay = 0; //If text exists and doesn't seem redundant, write it to patch and store its offset @@ -60,7 +60,7 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua if (text.NaSpanish && (text.NaSpanish != text.NaEnglish)) offsetNaEs = offsetEuEs = pushText(text.NaSpanish); if (text.EuGerman && (text.EuGerman != text.EuEnglish)) offsetEuDe = pushText(text.EuGerman); if (text.EuItalian && (text.EuItalian != text.EuEnglish)) offsetEuIt = pushText(text.EuItalian); - //if (text.EuDutch) offsetEuNl = pushText(text.EuDutch); + //if (text.Japanese && (text.Japanese != text.NaEnglish)) offsetJpJp = pushText(text.Japanese); if (text.EuEnglish && (text.EuEnglish != text.NaEnglish)) offsetEuEn = pushText(text.EuEnglish); if (text.EuFrench && (text.EuFrench != text.NaFrench )) offsetEuFr = pushText(text.EuFrench); if (text.EuSpanish && (text.EuSpanish != text.NaSpanish)) offsetEuEs = pushText(text.EuSpanish); @@ -168,8 +168,8 @@ void CreateMessage(u16 textId, u16 field_2, u32 field_4, u32 flags, const Langua newEntry.offsets[1] = (offsetNaFr >> 14) | (offsetNaEs << 4) | (offsetEuEn << 22); newEntry.offsets[2] = (offsetEuEn >> 10) | (offsetEuFr << 8) | (offsetEuEs << 26); newEntry.offsets[3] = (offsetEuEs >> 6) | (offsetEuDe << 12) | (offsetEuIt << 30); - newEntry.offsets[4] = (offsetEuIt >> 2) | (offsetEuNl << 16); - newEntry.offsets[5] = (offsetEuNl >> 16) | (offsetCol << 2) | (offsetIcon << 12) | (offsetDelay << 22); + newEntry.offsets[4] = (offsetEuIt >> 2) | (offsetJpJp << 16); + newEntry.offsets[5] = (offsetJpJp >> 16) | (offsetCol << 2) | (offsetIcon << 12) | (offsetDelay << 22); messageEntries.insert(newEntry); // Duplicate moon trial hints to their alternate version diff --git a/source/include/custom_messages.hpp b/source/include/custom_messages.hpp index bf6e1e2..d50870d 100644 --- a/source/include/custom_messages.hpp +++ b/source/include/custom_messages.hpp @@ -12,7 +12,7 @@ typedef struct { const char* NaSpanish; const char* EuGerman; const char* EuItalian; - //const char* EuDutch; + //const char* Japanese; const char* EuEnglish; const char* EuFrench; const char* EuSpanish; From f252b121e5036a6cdb78507e4197b6e868822773 Mon Sep 17 00:00:00 2001 From: pizza1398 <259104093+pizza1398@users.noreply.github.com> Date: Sat, 28 Feb 2026 21:38:54 +0100 Subject: [PATCH 6/6] Update Z3DR --- Z3DR | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Z3DR b/Z3DR index 51f90ff..c08d2cf 160000 --- a/Z3DR +++ b/Z3DR @@ -1 +1 @@ -Subproject commit 51f90ff4d71a1851bf482e8e97e672829f7712d6 +Subproject commit c08d2cf3121e33be9d3510e0ef419b693b79eef8