Skip to content

Commit

Permalink
Update supported language bitmask
Browse files Browse the repository at this point in the history
Fixes error when selecting a region-exclusive language in System Settings
  • Loading branch information
RocketRobz committed Jan 25, 2024
1 parent eb9dac2 commit fc83ba8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,20 @@ int main( int argc, char **argv) {
if (newRegion != oldRegion) {
FILE* f_hwinfoS = fopen("sd:/sys/HWINFO_S.dat", "rb+");
if (f_hwinfoS) {
u32 supportedLangBitmask = 0x01; // JPN
if (newRegion == 5) {
supportedLangBitmask = 0x80; // KOR
} else if (newRegion == 4) {
supportedLangBitmask = 0x40; // CHN
} else if (newRegion == 3) {
supportedLangBitmask = BIT(1); // AUS
} else if (newRegion == 2) {
supportedLangBitmask = 0x3E; // EUR
} else if (newRegion == 1) {
supportedLangBitmask = 0x26; // USA
}
fseek(f_hwinfoS, 0x88, SEEK_SET);
fwrite(&supportedLangBitmask, sizeof(u32), 1, f_hwinfoS);
fseek(f_hwinfoS, 0x90, SEEK_SET);
fwrite(&newRegion, 1, 1, f_hwinfoS);
fclose(f_hwinfoS);
Expand Down

0 comments on commit fc83ba8

Please sign in to comment.