Merge pull request #256 from robojumper/d_lang

d_lang OK
This commit is contained in:
Elijah Thomas
2025-09-27 12:38:36 -04:00
committed by GitHub
11 changed files with 72 additions and 31 deletions
+4 -1
View File
@@ -245,8 +245,11 @@ d/d_heap.cpp:
.sbss start:0x805751A8 end:0x805751D0
.bss start:0x80597740 end:0x80597758
d/d_lang.cpp:
.text start:0x80054F30 end:0x80054F88 align:16
d/d_main.cpp:
.text start:0x80054F30 end:0x80055170 align:16
.text start:0x80054F90 end:0x80055170 align:16
.sbss start:0x805751D0 end:0x805751E0
d/d_pad.cpp:
+3 -3
View File
@@ -2233,9 +2233,9 @@ __nwa__FUl = .text:0x80054ED0; // type:function size:0xC
__dl__FPv = .text:0x80054EE0; // type:function size:0x8
__dla__FPv = .text:0x80054EF0; // type:function size:0x8
__sinit_\d_heap_cpp = .text:0x80054F00; // type:function size:0x30 scope:local
fn_80054F30 = .text:0x80054F30; // type:function size:0x4
fn_80054F40 = .text:0x80054F40; // type:function size:0x4
getUsedLanguageNTSCNum = .text:0x80054F50; // type:function size:0x38
getCurrentLanguage1__Fv = .text:0x80054F30; // type:function size:0x4
getCurrentLanguage2__Fv = .text:0x80054F40; // type:function size:0x4
getCurrentLanguage__Fv = .text:0x80054F50; // type:function size:0x38
fn_80054F90 = .text:0x80054F90; // type:function size:0x18
fn_80054FB0 = .text:0x80054FB0; // type:function size:0x24
fn_80054FE0 = .text:0x80054FE0; // type:function size:0x20
+1
View File
@@ -431,6 +431,7 @@ config.libs = [
Object(Matching, "d/d_gfx.cpp"),
Object(NonMatching, "d/d_gfx_measures.cpp"),
Object(Matching, "d/d_heap.cpp"),
Object(Matching, "d/d_lang.cpp"),
Object(NonMatching, "d/d_main.cpp"),
Object(NonMatching, "d/d_pad.cpp"),
Object(Matching, "d/d_pad_ex.cpp"),
+21
View File
@@ -0,0 +1,21 @@
#ifndef D_LANG_H
#define D_LANG_H
#include "rvl/SC.h"
// all of this is made up
enum dLang_e {
D_LANG_JP = SC_LANG_JP,
D_LANG_EN = SC_LANG_EN,
D_LANG_FR = SC_LANG_FR,
D_LANG_ES = SC_LANG_SP,
};
// Yes there are three...
u8 getCurrentLanguage1();
u8 getCurrentLanguage2();
u8 getCurrentLanguage();
#endif
+9 -9
View File
@@ -10,6 +10,7 @@
#include "d/d_gfx.h"
#include "d/d_hbm.h"
#include "d/d_heap.h"
#include "d/d_lang.h"
#include "d/d_message.h"
#include "d/d_pad.h"
#include "d/d_pad_manager.h"
@@ -57,9 +58,6 @@ sFPhaseBase::sFPhaseState dScBoot_c::executeLoadPhase() {
return mPhases.step();
}
extern "C" u8 getUsedLanguageNTSCNum();
extern "C" u8 fn_80054F30();
sFPhaseBase::sFPhaseState dScBoot_c::cb1() {
LayoutArcManager::GetInstance()->loadLayoutArcFromDisk("cursor", mHeap::g_archiveHeap);
LayoutArcManager::GetInstance()->loadLayoutArcFromDisk("CursorStick", mHeap::g_archiveHeap);
@@ -134,12 +132,14 @@ sFPhaseBase::sFPhaseState dScBoot_c::cb6() {
LayoutArcManager::GetInstance()->loadLayoutArcFromDisk("Main2D", nullptr);
LayoutArcManager::GetInstance()->loadLayoutArcFromDisk("DoButton", nullptr);
LayoutArcManager::GetInstance()->loadLayoutArcFromDisk("MenuHelp", nullptr);
u8 result = fn_80054F30();
u8 result = getCurrentLanguage1();
s32 gameOverType;
if (result == 3) {
if (result == D_LANG_FR) {
gameOverType = 1;
} else if (result == D_LANG_ES) {
gameOverType = 2;
} else {
gameOverType = result == 4 ? 2 : 0;
gameOverType = 0;
}
if (gameOverType == 0) {
@@ -336,13 +336,13 @@ void dScBoot_c::drawCallback() {
dScBoot_c::strap_c::strap_c() {
SizedString<8> str;
u8 langNum = getUsedLanguageNTSCNum();
u8 langNum = getCurrentLanguage();
mArcName.empty();
mLytFileName.empty();
mAnimFileName.empty();
if (langNum == 3) {
if (langNum == D_LANG_FR) {
str = "F";
} else if (langNum == 4) {
} else if (langNum == D_LANG_ES) {
str = "S";
} else {
str = "U";
+4 -5
View File
@@ -2,6 +2,7 @@
#include "d/d_dvd_unk.h"
#include "d/d_gfx.h"
#include "d/d_lang.h"
#include "d/d_lyt_hio.h"
#include "d/d_reset.h"
#include "egg/gfx/eggDrawGX.h"
@@ -64,8 +65,6 @@ static const wchar_t *sErrorsFr[] = {
sErrFrDiskError,
};
extern "C" u8 fn_80054F30();
void dDvdDriveError_c::draw() {
EGG::Screen screen;
screen.SetCanvasMode(EGG::Screen::CANVASMODE_0);
@@ -105,11 +104,11 @@ void dDvdDriveError_c::draw() {
idx = 2;
}
u8 lang = fn_80054F30();
u8 lang = getCurrentLanguage1();
const wchar_t *str;
if (lang == 3) {
if (lang == D_LANG_FR) {
str = sErrorsFr[idx];
} else if (lang == 4) {
} else if (lang == D_LANG_ES) {
str = sErrorsEs[idx];
} else {
str = sErrorsEn[idx];
+19
View File
@@ -0,0 +1,19 @@
#include "d/d_lang.h"
#include "rvl/SC/scapi.h"
u8 getCurrentLanguage1() {
return getCurrentLanguage2();
}
u8 getCurrentLanguage2() {
return getCurrentLanguage();
}
u8 getCurrentLanguage() {
u8 lang = SCGetLanguage();
if (lang != SC_LANG_FR && lang != SC_LANG_SP) {
lang = SC_LANG_EN;
}
return lang;
}
+4 -4
View File
@@ -6,6 +6,7 @@
#include "d/a/d_a_itembase.h"
#include "d/a/d_a_player.h"
#include "d/d_base.h"
#include "d/d_lang.h"
#include "d/d_light_env.h"
#include "d/d_lyt_hio.h"
#include "d/d_player.h"
@@ -1776,13 +1777,12 @@ void dMessage_c::reset() {
mMinigameTime = 0;
}
extern "C" u8 fn_80054F30();
static SizedString<8> sCurrentLanguage;
const char *dMessage_c::getLanguageIdentifier() {
u8 lang = fn_80054F30();
if (lang == 3) {
u8 lang = getCurrentLanguage1();
if (lang == D_LANG_FR) {
sCurrentLanguage = "fr_US";
} else if (lang == 4) {
} else if (lang == D_LANG_ES) {
sCurrentLanguage = "es_US";
} else {
sCurrentLanguage = "en_US";
+2 -3
View File
@@ -1,6 +1,7 @@
#include "d/lyt/d_lyt_auto_explain.h"
#include "common.h"
#include "d/d_lang.h"
#include "d/d_tag_processor.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_control_game.h"
@@ -45,11 +46,9 @@ void dLytAutoExplain_c::executeState_Invisible() {
}
void dLytAutoExplain_c::finalizeState_Invisible() {}
extern "C" u8 fn_80054F30();
void dLytAutoExplain_c::initializeState_In() {
int numLines = mpTagProcessor->getNumLinesMaybe() - 1;
if (fn_80054F30() != 0 && numLines == 3) {
if (getCurrentLanguage1() != D_LANG_JP && numLines == 3) {
numLines = 2;
}
+4 -5
View File
@@ -3,6 +3,7 @@
#include "common.h"
#include "d/d_base.h"
#include "d/d_fader.h"
#include "d/d_lang.h"
#include "d/d_message.h"
#include "d/d_sc_game.h"
#include "d/d_sc_title.h"
@@ -62,14 +63,12 @@ dLytGameOver_c::dLytGameOver_c() : mStateMgr(*this) {
init();
}
extern "C" u8 fn_80054F30();
bool dLytGameOver_c::build() {
u8 lang = fn_80054F30();
u8 lang = getCurrentLanguage1();
s32 variant;
if (lang == 3) {
if (lang == D_LANG_FR) {
variant = 1;
} else if (lang == 4) {
} else if (lang == D_LANG_ES) {
variant = 2;
} else {
variant = 0;
+1 -1
View File
@@ -358,7 +358,7 @@ void dLytPauseMain_c::initializeState_Select() {
mpPauseText->requestIn();
}
}
extern "C" void fn_80059F40(void *);
void dLytPauseMain_c::executeState_Select() {
switch (mStep) {
case 0: {