Skip to content

Commit

Permalink
Fix getPalLanguage name
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Jul 6, 2024
1 parent 67e3fbd commit ee8b396
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
11 changes: 6 additions & 5 deletions include/d/d_com_inf_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -2532,13 +2532,14 @@ inline void dComIfGp_setNowVibration(u8 vibration) {
}

#if VERSION != VERSION_JPN
// Inline name is fake (not present in JP debug maps), but was guessed based on the similar
// dComIfGs_getPalLanguage inline in TP debug.
inline u8 dComIfGp_getPalLanguage() {
// Inline name is official because while it's not present in the JPN debug maps, it is present in
// the USA release maps because there was one TU where it failed to get inlined (f_op_msg_mng).
inline u8 dComIfGs_getPalLanguage() {
return g_dComIfG_gameInfo.play.getPalLanguage();
}
// Inline name is fake (not present in JP debug maps).
inline void dComIfGp_setPalLanguage(u8 lang) {

// Inline name is fake, but guessed based on the above inline.
inline void dComIfGs_setPalLanguage(u8 lang) {
g_dComIfG_gameInfo.play.setPalLanguage(lang);
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/d/actor/d_a_agb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ int daAgb_c::uploadSelect() {
char path[28];
char pathNum[4];
strcpy(path, "/res/Gba/client_");
sprintf(pathNum, "%d", dComIfGp_getPalLanguage());
sprintf(pathNum, "%d", dComIfGs_getPalLanguage());
strcat(path, pathNum);
strcat(path, ".bin");
l_gbaCommand = mDoDvdThd_toMainRam_c::create(path, 0, dMsg_getAgbWorkArea());
Expand Down Expand Up @@ -451,7 +451,7 @@ int daAgb_c::uploadMessageLoad() {
char path[28];
char pathNum[4];
strcpy(path, "/res/Gba/msg_LZ");
sprintf(pathNum, "%d", dComIfGp_getPalLanguage());
sprintf(pathNum, "%d", dComIfGs_getPalLanguage());
strcat(path, pathNum);
strcat(path, ".bin");
l_gbaCommand = mDoDvdThd_toMainRam_c::create(path, 0, NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/d/d_place_name.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ s32 dPn_c::_create() {
JUT_ASSERT(VERSION_SELECT(175, 201, 201), dComIfGp_getNowStageNum() < dPn_stage_max_e);

#if VERSION == VERSION_PAL
u32 lang = dComIfGp_getPalLanguage();
u32 lang = dComIfGs_getPalLanguage();
char buf[32];
sprintf(buf, "/res/placename/PN%d/pn_%02d_%d.bti", lang, dComIfGp_getNowStageNum() + 1, lang);
dvd = mDoDvdThd_toMainRam_c::create(buf, 0, mpHeap);
Expand Down
18 changes: 9 additions & 9 deletions src/d/d_s_logo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,13 @@ s32 phase_1(dScnLogo_c* i_this) {
if (g_mDoMemCd_control.field_0x165B >= 5) {
g_mDoMemCd_control.field_0x165B = 0;
}
dComIfGp_setPalLanguage(g_mDoMemCd_control.field_0x165B);
dComIfGs_setPalLanguage(g_mDoMemCd_control.field_0x165B);
} else {
u8 language = OSGetLanguage();
if (language >= 5) {
language = 0;
}
dComIfGp_setPalLanguage(language);
dComIfGs_setPalLanguage(language);
g_mDoMemCd_control.field_0x165B = language;
}
#endif
Expand Down Expand Up @@ -771,7 +771,7 @@ s32 phase_2(dScnLogo_c* i_this) {
#endif

#if VERSION == VERSION_PAL
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", choice[dComIfGp_getPalLanguage()]);
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", choice[dComIfGs_getPalLanguage()]);
#else
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", LOGO_BTI_PROGRESSIVE_CHOICE);
#endif
Expand All @@ -781,7 +781,7 @@ s32 phase_2(dScnLogo_c* i_this) {
i_this->progchoiceImg->setAlpha(0x00);

#if VERSION == VERSION_PAL
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", yes[dComIfGp_getPalLanguage()]);
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", yes[dComIfGs_getPalLanguage()]);
#else
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", LOGO_BTI_PROGRESSIVE_YES);
#endif
Expand All @@ -792,7 +792,7 @@ s32 phase_2(dScnLogo_c* i_this) {
i_this->progyesImg->setAlpha(0x00);

#if VERSION == VERSION_PAL
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", no[dComIfGp_getPalLanguage()]);
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", no[dComIfGs_getPalLanguage()]);
#else
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", LOGO_BTI_PROGRESSIVE_NO);
#endif
Expand All @@ -803,7 +803,7 @@ s32 phase_2(dScnLogo_c* i_this) {
i_this->prognoImg->setAlpha(0x00);

#if VERSION == VERSION_PAL
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", prog[dComIfGp_getPalLanguage()]);
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", prog[dComIfGs_getPalLanguage()]);
#else
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", LOGO_BTI_PROGRESSIVE_PRO);
#endif
Expand All @@ -813,7 +813,7 @@ s32 phase_2(dScnLogo_c* i_this) {
i_this->progImg->setAlpha(0x00);

#if VERSION == VERSION_PAL
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", intr[dComIfGp_getPalLanguage()]);
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", intr[dComIfGs_getPalLanguage()]);
#else
timg = (ResTIMG *)dComIfG_getObjectRes("Logo", LOGO_BTI_PROGRESSIVE_INTER);
#endif
Expand Down Expand Up @@ -851,7 +851,7 @@ s32 phase_2(dScnLogo_c* i_this) {
#if VERSION == VERSION_PAL
delete g_dComIfG_gameInfo.play.field_0x4820;
char buf[40];
sprintf(buf, "/res/Msg/data%d/acticon.arc", dComIfGp_getPalLanguage());
sprintf(buf, "/res/Msg/data%d/acticon.arc", dComIfGs_getPalLanguage());
l_actioniconCommand = aramMount(buf);
#else
l_actioniconCommand = aramMount("/res/Msg/acticon.arc");
Expand All @@ -868,7 +868,7 @@ s32 phase_2(dScnLogo_c* i_this) {
l_saveResCommand = aramMount("/res/Msg/saveres.arc");

#if VERSION == VERSION_PAL
sprintf(buf, "/res/Msg/data%d/bmgres.arc", dComIfGp_getPalLanguage());
sprintf(buf, "/res/Msg/data%d/bmgres.arc", dComIfGs_getPalLanguage());
l_msgDtCommand = onMemMount(buf);
#else
l_msgDtCommand = onMemMount("/res/Msg/bmgres.arc");
Expand Down
6 changes: 3 additions & 3 deletions src/d/d_s_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static BOOL dScnMenu_Draw(menu_of_scene_class* i_this) {
JUTReport(200, 400, "曜日:%s", weekpat_str[l_weekpat]);
#if VERSION != VERSION_JPN
static const char* language[] = {"ENGLISH", "GERMAN", "FRENCH", "SPANISH", "ITALIAN"};
JUTReport(40, 440, "%s", language[dComIfGp_getPalLanguage()]);
JUTReport(40, 440, "%s", language[dComIfGs_getPalLanguage()]);
#endif
if (dComIfGs_isEventBit(0x2d01)) {
JUTReport(400, 420, "3コン(A):デモ23 ON");
Expand Down Expand Up @@ -176,7 +176,7 @@ static BOOL dScnMenu_Execute(menu_of_scene_class* i_this) {
if (CPad_CHECK_TRIG_Z(3)) {
if (++l_languageType > 4)
l_languageType = 0;
dComIfGp_setPalLanguage(language[l_languageType]);
dComIfGs_setPalLanguage(language[l_languageType]);
}
#endif

Expand Down Expand Up @@ -298,7 +298,7 @@ static s32 dScnMenu_Create(scene_class* i_scn) {
};
menu_of_scene_class* i_this = (menu_of_scene_class *)i_scn;
#if VERSION != VERSION_JPN
l_languageType = dComIfGp_getPalLanguage();
l_languageType = dComIfGs_getPalLanguage();
#endif
return dComLbG_PhaseHandler(&i_this->mPhs, l_method, i_this);
}
Expand Down
10 changes: 5 additions & 5 deletions src/f_pc/f_pc_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ struct BMG_INF1 : JUTDataBlockHeader {
void messageSet(u32 status) {
#if VERSION == VERSION_PAL
BMG_INF1* inf1;
if (dComIfGp_getPalLanguage() == 1) {
if (dComIfGs_getPalLanguage() == 1) {
inf1 = (BMG_INF1*)&msg_data_ge[0x20];
} else if (dComIfGp_getPalLanguage() == 2) {
} else if (dComIfGs_getPalLanguage() == 2) {
inf1 = (BMG_INF1*)&msg_data_fr[0x20];
} else if (dComIfGp_getPalLanguage() == 3) {
} else if (dComIfGs_getPalLanguage() == 3) {
inf1 = (BMG_INF1*)&msg_data_sp[0x20];
} else if (dComIfGp_getPalLanguage() == 4) {
} else if (dComIfGs_getPalLanguage() == 4) {
inf1 = (BMG_INF1*)&msg_data_it[0x20];
} else {
inf1 = (BMG_INF1*)&msg_data[0x20]; // English
Expand Down Expand Up @@ -149,7 +149,7 @@ void messageSet(u32 status) {

ppane->draw(-12.0f, -24.0f, 665.0f, 530.0f, false, false, false);
#if VERSION == VERSION_PAL
if (dComIfGp_getPalLanguage() == 0) {
if (dComIfGs_getPalLanguage() == 0) {
spane->draw(x + 2.0f, y + 10.0f + 2.0f, 660.0f, HBIND_LEFT);
tpane->draw(x, y + 10.0f, 660.0f, HBIND_LEFT);
} else {
Expand Down

0 comments on commit ee8b396

Please sign in to comment.