From ff4c7489f588cf6a46a5495d5e42e0120f010b45 Mon Sep 17 00:00:00 2001 From: Luciano Ciccariello Date: Sat, 11 Jan 2025 00:51:26 +0000 Subject: [PATCH] Document multi-language source file --- config/splat.pspeu.stst0.yaml | 2 +- include/game.h | 5 +++++ src/st/st0_psp/{80.c => lang.c} | 20 ++++++++++---------- 3 files changed, 16 insertions(+), 11 deletions(-) rename src/st/st0_psp/{80.c => lang.c} (74%) diff --git a/config/splat.pspeu.stst0.yaml b/config/splat.pspeu.stst0.yaml index a19de24a4f..2d59597e2c 100644 --- a/config/splat.pspeu.stst0.yaml +++ b/config/splat.pspeu.stst0.yaml @@ -43,7 +43,7 @@ segments: align: 128 subalign: 8 subsegments: - - [0x80, c, st0_psp/80] + - [0x80, c, st0_psp/lang] - [0x1E8, c, st0/prologue_scroll] - [0x1578, c, st0_psp/cutscene] - [0x3F58, c, st0_psp/2A8DC] diff --git a/include/game.h b/include/game.h index 291957c6c5..e7baa6e195 100644 --- a/include/game.h +++ b/include/game.h @@ -2080,6 +2080,11 @@ extern s32 g_DebugPlayer; extern s32 D_80098894; // exclusive PSP content +#define LANG_EN 1 +#define LANG_FR 2 +#define LANG_SP 3 +#define LANG_GE 4 +#define LANG_IT 5 u8* GetLangAt(s32 idx, u8* en, u8* fr, u8* sp, u8* ge, u8* it); u8* GetLang(u8* en, u8* fr, u8* sp, u8* ge, u8* it); diff --git a/src/st/st0_psp/80.c b/src/st/st0_psp/lang.c similarity index 74% rename from src/st/st0_psp/80.c rename to src/st/st0_psp/lang.c index bd9a8c9695..97dc44af46 100644 --- a/src/st/st0_psp/80.c +++ b/src/st/st0_psp/lang.c @@ -5,15 +5,15 @@ extern s32 D_8B42058; u8* GetLangAt(s32 idx, u8* en, u8* fr, u8* sp, u8* ge, u8* it) { switch (D_8B42058) { default: - case 1: + case LANG_EN: return en + idx; - case 2: + case LANG_FR: return fr + idx; - case 3: + case LANG_SP: return sp + idx; - case 4: + case LANG_GE: return ge + idx; - case 5: + case LANG_IT: return it + idx; } } @@ -21,15 +21,15 @@ u8* GetLangAt(s32 idx, u8* en, u8* fr, u8* sp, u8* ge, u8* it) { u8* GetLang(u8* en, u8* fr, u8* sp, u8* ge, u8* it) { switch (D_8B42058) { default: - case 1: + case LANG_EN: return en; - case 2: + case LANG_FR: return fr; - case 3: + case LANG_SP: return sp; - case 4: + case LANG_GE: return ge; - case 5: + case LANG_IT: return it; } }