diff options
| author | 2016-03-01 17:09:53 -0500 | |
|---|---|---|
| committer | 2016-03-01 17:09:53 -0500 | |
| commit | 95addab57bcc60f5f518ed4f372412b8440b223f (patch) | |
| tree | de3d88c1ee09fdc7e707b7f05bdc352fb114a331 | |
| parent | Merge pull request #1427 from MerryMage/emit-lbit (diff) | |
| parent | Service/CFG: Fix potential endianess issue (diff) | |
| download | yuzu-95addab57bcc60f5f518ed4f372412b8440b223f.tar.gz yuzu-95addab57bcc60f5f518ed4f372412b8440b223f.tar.xz yuzu-95addab57bcc60f5f518ed4f372412b8440b223f.zip | |
Merge pull request #1433 from yuriks/config-000A0000
Service/CFG: Add block 0x000A0000 (username) to default config file
Diffstat (limited to '')
| -rw-r--r-- | src/core/hle/service/cfg/cfg.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 7556aa6a5..4c82a58e4 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp | |||
| @@ -4,9 +4,10 @@ | |||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | 6 | ||
| 7 | #include "common/file_util.h" | ||
| 7 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| 8 | #include "common/string_util.h" | 9 | #include "common/string_util.h" |
| 9 | #include "common/file_util.h" | 10 | #include "common/swap.h" |
| 10 | 11 | ||
| 11 | #include "core/file_sys/archive_systemsavedata.h" | 12 | #include "core/file_sys/archive_systemsavedata.h" |
| 12 | #include "core/file_sys/file_backend.h" | 13 | #include "core/file_sys/file_backend.h" |
| @@ -334,6 +335,18 @@ ResultCode FormatConfig() { | |||
| 334 | res = CreateConfigInfoBlk(0x000A0000, sizeof(CONSOLE_USERNAME_BLOCK), 0xE, &CONSOLE_USERNAME_BLOCK); | 335 | res = CreateConfigInfoBlk(0x000A0000, sizeof(CONSOLE_USERNAME_BLOCK), 0xE, &CONSOLE_USERNAME_BLOCK); |
| 335 | if (!res.IsSuccess()) return res; | 336 | if (!res.IsSuccess()) return res; |
| 336 | 337 | ||
| 338 | // 0x000A0000 - Profile username | ||
| 339 | struct { | ||
| 340 | u16_le username[10]; | ||
| 341 | u8 unused[4]; | ||
| 342 | u32_le wordfilter_version; // Unused by Citra | ||
| 343 | } profile_username = {}; | ||
| 344 | |||
| 345 | std::u16string username_string = Common::UTF8ToUTF16("Citra"); | ||
| 346 | std::copy(username_string.cbegin(), username_string.cend(), profile_username.username); | ||
| 347 | res = CreateConfigInfoBlk(0x000A0000, sizeof(profile_username), 0xE, &profile_username); | ||
| 348 | if (!res.IsSuccess()) return res; | ||
| 349 | |||
| 337 | // 0x000A0001 - Profile birthday | 350 | // 0x000A0001 - Profile birthday |
| 338 | const u8 profile_birthday[2] = {3, 25}; // March 25th, 2014 | 351 | const u8 profile_birthday[2] = {3, 25}; // March 25th, 2014 |
| 339 | res = CreateConfigInfoBlk(0x000A0001, sizeof(profile_birthday), 0xE, profile_birthday); | 352 | res = CreateConfigInfoBlk(0x000A0001, sizeof(profile_birthday), 0xE, profile_birthday); |
| @@ -344,9 +357,10 @@ ResultCode FormatConfig() { | |||
| 344 | res = CreateConfigInfoBlk(0x000B0000, sizeof(COUNTRY_INFO), 0xE, &COUNTRY_INFO); | 357 | res = CreateConfigInfoBlk(0x000B0000, sizeof(COUNTRY_INFO), 0xE, &COUNTRY_INFO); |
| 345 | if (!res.IsSuccess()) return res; | 358 | if (!res.IsSuccess()) return res; |
| 346 | 359 | ||
| 347 | char16_t country_name_buffer[16][0x40] = {}; | 360 | u16_le country_name_buffer[16][0x40] = {}; |
| 361 | std::u16string region_name = Common::UTF8ToUTF16("Gensokyo"); | ||
| 348 | for (size_t i = 0; i < 16; ++i) { | 362 | for (size_t i = 0; i < 16; ++i) { |
| 349 | Common::UTF8ToUTF16("Gensokyo").copy(country_name_buffer[i], 0x40); | 363 | std::copy(region_name.cbegin(), region_name.cend(), country_name_buffer[i]); |
| 350 | } | 364 | } |
| 351 | // 0x000B0001 - Localized names for the profile Country | 365 | // 0x000B0001 - Localized names for the profile Country |
| 352 | res = CreateConfigInfoBlk(0x000B0001, sizeof(country_name_buffer), 0xE, country_name_buffer); | 366 | res = CreateConfigInfoBlk(0x000B0001, sizeof(country_name_buffer), 0xE, country_name_buffer); |