05-31-2014, 03:12 AM (This post was last modified: 02-06-2015 09:16 AM by ムギ.)
Post: #1
Code In-Game XMB language settings
this thing buggered me for quite a long while and with the help of xyz and binaryfail we finally came up with a pretty solid solution on how to manage the In-Game XMB's language and button layout settings.

it involves patching the systemcall sceImposeSetLanguageMode()

this systemcall has 2 arguments;
- $a0 which controls the language setting
- $a1 which controls the button mapping.

i've yet to look into it on many games, but in utawarerumono it's as follows:

Code:
move     $a0, $zero
jal      sceImposeSetLanguageMode()
move     $a1, $zero

which sets bothregisters, $a0 and $a1 to zero, which is japanese language and O=OK button mapping.

now, you can patch it to english simply by navigating to the address of $a1 and setting it to 0100, however this method is prone to errors as it may conflict with previous instructions used elsewhere. This method patches the $zero value from register $a1 to $at and it just so happens that $at seems to nearly always have a value of 1. However this method causes some odd behavior as it patches both language and button mapping to 1 somehow overwriting the setting of register $a0.

the solution we ultimately came up with was to change the move instructions to li and assign a definite value for registers $a0 and $a1 which allows independenly controlling both language and the button mapping, and is less prone to cause conflicts.

our code is as follows:

Code:
li     $a0, <number from 0 to 11>
jal    sceImposeSetLanguageMode()
li     $a1, <number 0 or 1>

to change the move instruction to li instruction, open the file with hex editor and patch the values as follows:

$a0: 2120 xxxx -> xxxx 0424
$a1: 2128 xxxx -> xxxx 0524

where xxxx is the value you want (it's 0000 ($zero) for japanese settings)
to set the language to english and X as OK button, change them to

$a0: 0100 0424
$a1: 0100 0524

the 0424 and 0524 will change the move instruction to li instruction, and the xxxx are the desired value.
For languages, see the table below:

Quote:Languages:
JAPANESE 0
ENGLISH 1
FRENCH 2
SPANISH 3
GERMAN 4
ITALIAN 5
DUTCH 6
PORTUGUESE 7
RUSSIAN 8
KOREAN 9
CHINESE_TRADITIONAL 10
CHINESE_SIMPLIFIED 11

Button mapping:
O=OK 0
X=OK 1

This hack will only affect the "quit game" screen that pops up when you press the "home" button on the psp though.
We managed to patch the save/load module and the autosave prompt (when using system modules for it) too, but those are a little more involved. I'll try to write up a little about it on a later date.

the affected subroutines are:
- sceImposeSetLanguageMode() // "home" screen
- sceUtilityMsgDialogInitStart() // autosave messages
- sceUtilitySavedataInitStart() // save/load screen
Quote




User(s) browsing this thread: 1 Guest(s)