Skip to content

Commit

Permalink
Create locale.txt when generating for console
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto-Nessy committed Jan 22, 2024
1 parent 2e1b714 commit 80a49ca
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions source/patch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,27 @@ bool WriteAllPatches() {
}
FSFILE_Close(titleassetsOut);

/*-------------------
| LOCALE EMULATION |
-------------------*/

if (Settings::PlayOption == PATCH_CONSOLE) {
Handle localeOut;
const char* localeOutPath = "/luma/titles/0004000000125500/locale.txt";
FSUSER_DeleteFile(sdmcArchive, fsMakePath(PATH_ASCII, localeOutPath));

if (!R_SUCCEEDED(res = FSUSER_OpenFile(&localeOut, sdmcArchive, fsMakePath(PATH_ASCII, localeOutPath), FS_OPEN_WRITE | FS_OPEN_CREATE, 0))) {
return false;
}

std::vector<char> buffer = { 'U', 'S', 'A', ' ', 'E', 'N' };

if (!R_SUCCEEDED(res = FSFILE_Write(localeOut, &bytesWritten, 0, buffer.data(), buffer.size(), FS_WRITE_FLUSH))) {
return false;
}
FSFILE_Close(localeOut);
}

FSUSER_CloseArchive(sdmcArchive);

return true;
Expand Down

0 comments on commit 80a49ca

Please sign in to comment.