language support

This commit is contained in:
MelonSpeedruns
2026-05-30 15:19:22 -04:00
parent 228d4d2bd1
commit e1d0f99fc3
4 changed files with 68 additions and 6 deletions
+31 -1
View File
@@ -1660,7 +1660,37 @@ void dMsgObject_c::readMessageGroupLocal(mDoDvdThd_mountXArchive_c** p_arcMount)
#if TARGET_PC
// Original game UB
if (dusk::version::isRegionPal()) {
if (dusk::tphd_active()) {
switch (dComIfGs_getPalLanguage()) {
case dSv_player_config_c::LANGUAGE_GERMAN:
snprintf(arcName, sizeof(arcName), "/res/Msgde/bmgres%d.arc", msgGroup);
break;
case dSv_player_config_c::LANGUAGE_FRENCH:
if (dusk::version::isRegionPal()) {
snprintf(arcName, sizeof(arcName), "/res/Msgfr/bmgres%d.arc", msgGroup);
}
else {
snprintf(arcName, sizeof(arcName), "/res/Msgusfr/bmgres%d.arc", msgGroup);
}
break;
case dSv_player_config_c::LANGUAGE_SPANISH:
if (dusk::version::isRegionPal()) {
snprintf(arcName, sizeof(arcName), "/res/Msgsp/bmgres%d.arc", msgGroup);
} else {
snprintf(arcName, sizeof(arcName), "/res/Msgussp/bmgres%d.arc", msgGroup);
}
break;
case dSv_player_config_c::LANGUAGE_ITALIAN:
snprintf(arcName, sizeof(arcName), "/res/Msgit/bmgres%d.arc", msgGroup);
break;
default:
if (dusk::version::isRegionPal()) {
snprintf(arcName, sizeof(arcName), "/res/Msguk/bmgres%d.arc", msgGroup);
} else {
snprintf(arcName, sizeof(arcName), "/res/Msgus/bmgres%d.arc", msgGroup);
}
}
} else if (dusk::version::isRegionPal()) {
switch (dComIfGs_getPalLanguage()) {
case dSv_player_config_c::LANGUAGE_GERMAN:
snprintf(arcName, sizeof(arcName), "/res/Msgde/bmgres%d.arc", msgGroup);
+33 -1
View File
@@ -1504,7 +1504,39 @@ void dScnLogo_c::dvdDataLoad() {
mpCardIconCommand = aramMount(ICON_RES_PATH, mDoExt_getJ2dHeap());
#if TARGET_PC
if (getGameVersion() == GameVersion::GcnPal) {
if (dusk::tphd_active) {
switch (getPalLanguage()) {
case 1:
mpBmgResCommand = onMemMount("/res/Msgde/bmgres.arc");
break;
case 2:
if (getGameVersion() == GameVersion::GcnPal) {
mpBmgResCommand = onMemMount("/res/Msgfr/bmgres.arc");
} else {
mpBmgResCommand = onMemMount("/res/Msgusfr/bmgres.arc");
}
break;
case 3:
if (getGameVersion() == GameVersion::GcnPal) {
mpBmgResCommand = onMemMount("/res/Msgsp/bmgres.arc");
} else {
mpBmgResCommand = onMemMount("/res/Msgussp/bmgres.arc");
}
break;
case 4:
mpBmgResCommand = onMemMount("/res/Msgit/bmgres.arc");
break;
case 0:
default:
if (getGameVersion() == GameVersion::GcnPal) {
mpBmgResCommand = onMemMount("/res/Msguk/bmgres.arc");
}
else {
mpBmgResCommand = onMemMount("/res/Msgus/bmgres.arc");
}
break;
}
} else if (getGameVersion() == GameVersion::GcnPal) {
switch (getPalLanguage()) {
case 1:
mpBmgResCommand = onMemMount("/res/Msgde/bmgres.arc");
+2 -2
View File
@@ -639,7 +639,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
.getValue =
[] {
const auto& state = prelaunch_state();
if (!state.configuredDiscCanLaunch || !state.configuredDiscInfo.isPal) {
if (!state.configuredDiscCanLaunch || (!state.configuredDiscInfo.isPal && !dusk::tphd_active())) {
return kLanguageNames[0];
}
const u8 idx = static_cast<u8>(getSettings().game.language.getValue());
@@ -649,7 +649,7 @@ SettingsWindow::SettingsWindow(bool prelaunch) : mPrelaunch(prelaunch) {
[] {
const auto& state = prelaunch_state();
return !state.configuredDiscCanLaunch ||
!state.configuredDiscInfo.isPal;
(!state.configuredDiscInfo.isPal && !dusk::tphd_active());
},
.isModified =
[] {
+2 -2
View File
@@ -469,9 +469,9 @@ u8 OSGetLanguage() {
}
static void LanguageInit() {
// Keep language at 0 (English) if not on a PAL disc.
// Keep language at 0 (English) if not on a PAL disc and if TPHD is unloaded.
// Doubt this matters, but avoid funky shit.
if (!dusk::version::isRegionPal()) {
if (!dusk::version::isRegionPal() && !dusk::tphd_active()) {
return;
}