Skip to content

Commit

Permalink
Document multi-language source file
Browse files Browse the repository at this point in the history
  • Loading branch information
Xeeynamo committed Jan 11, 2025
1 parent 8fc05f7 commit ff4c748
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/splat.pspeu.stst0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 5 additions & 0 deletions include/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
20 changes: 10 additions & 10 deletions src/st/st0_psp/80.c → src/st/st0_psp/lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@ 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;
}
}

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;
}
}

0 comments on commit ff4c748

Please sign in to comment.