summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
authorGravatar wwylele2016-06-01 10:40:52 +0300
committerGravatar wwylele2016-07-03 08:23:59 +0300
commit457b6413e639adff0c4d3e313c62667a585e20cf (patch)
tree0901593d91e87f9c55d2264b7860269c22ce81bf /src/core/hle
parentService::CFG: add SetConfigInfoBlk4 (diff)
downloadyuzu-457b6413e639adff0c4d3e313c62667a585e20cf.tar.gz
yuzu-457b6413e639adff0c4d3e313c62667a585e20cf.tar.xz
yuzu-457b6413e639adff0c4d3e313c62667a585e20cf.zip
Service::CFG: move known block ID to an enum
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/cfg/cfg.cpp36
1 files changed, 25 insertions, 11 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index 907a82301..0f95464e6 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -40,6 +40,20 @@ struct SaveFileConfig {
40}; 40};
41static_assert(sizeof(SaveFileConfig) == 0x455C, "SaveFileConfig header must be exactly 0x455C bytes"); 41static_assert(sizeof(SaveFileConfig) == 0x455C, "SaveFileConfig header must be exactly 0x455C bytes");
42 42
43enum ConfigBlockID {
44 StereoCameraSettingsBlockID = 0x00050005,
45 SoundOutputModeBlockID = 0x00070001,
46 ConsoleUniqueIDBlockID = 0x00090001,
47 UsernameBlockID = 0x000A0000,
48 BirthdayBlockID = 0x000A0001,
49 LanguageBlockID = 0x000A0002,
50 CountryInfoBlockID = 0x000B0000,
51 CountryNameBlockID = 0x000B0001,
52 StateNameBlockID = 0x000B0002,
53 EULAVersionBlockID = 0x000D0000,
54 ConsoleModelBlockID = 0x000F0004,
55};
56
43struct UsernameBlock { 57struct UsernameBlock {
44 char16_t username[10]; ///< Exactly 20 bytes long, padded with zeros at the end if necessary 58 char16_t username[10]; ///< Exactly 20 bytes long, padded with zeros at the end if necessary
45 u32 zero; 59 u32 zero;
@@ -372,25 +386,25 @@ ResultCode FormatConfig() {
372 res = CreateConfigInfoBlk(0x00030001, 0x8, 0xE, zero_buffer); 386 res = CreateConfigInfoBlk(0x00030001, 0x8, 0xE, zero_buffer);
373 if (!res.IsSuccess()) return res; 387 if (!res.IsSuccess()) return res;
374 388
375 res = CreateConfigInfoBlk(0x00050005, sizeof(STEREO_CAMERA_SETTINGS), 0xE, STEREO_CAMERA_SETTINGS.data()); 389 res = CreateConfigInfoBlk(StereoCameraSettingsBlockID, sizeof(STEREO_CAMERA_SETTINGS), 0xE, STEREO_CAMERA_SETTINGS.data());
376 if (!res.IsSuccess()) return res; 390 if (!res.IsSuccess()) return res;
377 391
378 res = CreateConfigInfoBlk(0x00070001, sizeof(SOUND_OUTPUT_MODE), 0xE, &SOUND_OUTPUT_MODE); 392 res = CreateConfigInfoBlk(SoundOutputModeBlockID, sizeof(SOUND_OUTPUT_MODE), 0xE, &SOUND_OUTPUT_MODE);
379 if (!res.IsSuccess()) return res; 393 if (!res.IsSuccess()) return res;
380 394
381 res = CreateConfigInfoBlk(0x00090001, sizeof(CONSOLE_UNIQUE_ID), 0xE, &CONSOLE_UNIQUE_ID); 395 res = CreateConfigInfoBlk(ConsoleUniqueIDBlockID, sizeof(CONSOLE_UNIQUE_ID), 0xE, &CONSOLE_UNIQUE_ID);
382 if (!res.IsSuccess()) return res; 396 if (!res.IsSuccess()) return res;
383 397
384 res = CreateConfigInfoBlk(0x000A0000, sizeof(CONSOLE_USERNAME_BLOCK), 0xE, &CONSOLE_USERNAME_BLOCK); 398 res = CreateConfigInfoBlk(UsernameBlockID, sizeof(CONSOLE_USERNAME_BLOCK), 0xE, &CONSOLE_USERNAME_BLOCK);
385 if (!res.IsSuccess()) return res; 399 if (!res.IsSuccess()) return res;
386 400
387 res = CreateConfigInfoBlk(0x000A0001, sizeof(PROFILE_BIRTHDAY), 0xE, &PROFILE_BIRTHDAY); 401 res = CreateConfigInfoBlk(BirthdayBlockID, sizeof(PROFILE_BIRTHDAY), 0xE, &PROFILE_BIRTHDAY);
388 if (!res.IsSuccess()) return res; 402 if (!res.IsSuccess()) return res;
389 403
390 res = CreateConfigInfoBlk(0x000A0002, sizeof(CONSOLE_LANGUAGE), 0xE, &CONSOLE_LANGUAGE); 404 res = CreateConfigInfoBlk(LanguageBlockID, sizeof(CONSOLE_LANGUAGE), 0xE, &CONSOLE_LANGUAGE);
391 if (!res.IsSuccess()) return res; 405 if (!res.IsSuccess()) return res;
392 406
393 res = CreateConfigInfoBlk(0x000B0000, sizeof(COUNTRY_INFO), 0xE, &COUNTRY_INFO); 407 res = CreateConfigInfoBlk(CountryInfoBlockID, sizeof(COUNTRY_INFO), 0xE, &COUNTRY_INFO);
394 if (!res.IsSuccess()) return res; 408 if (!res.IsSuccess()) return res;
395 409
396 u16_le country_name_buffer[16][0x40] = {}; 410 u16_le country_name_buffer[16][0x40] = {};
@@ -399,10 +413,10 @@ ResultCode FormatConfig() {
399 std::copy(region_name.cbegin(), region_name.cend(), country_name_buffer[i]); 413 std::copy(region_name.cbegin(), region_name.cend(), country_name_buffer[i]);
400 } 414 }
401 // 0x000B0001 - Localized names for the profile Country 415 // 0x000B0001 - Localized names for the profile Country
402 res = CreateConfigInfoBlk(0x000B0001, sizeof(country_name_buffer), 0xE, country_name_buffer); 416 res = CreateConfigInfoBlk(CountryNameBlockID, sizeof(country_name_buffer), 0xE, country_name_buffer);
403 if (!res.IsSuccess()) return res; 417 if (!res.IsSuccess()) return res;
404 // 0x000B0002 - Localized names for the profile State/Province 418 // 0x000B0002 - Localized names for the profile State/Province
405 res = CreateConfigInfoBlk(0x000B0002, sizeof(country_name_buffer), 0xE, country_name_buffer); 419 res = CreateConfigInfoBlk(StateNameBlockID, sizeof(country_name_buffer), 0xE, country_name_buffer);
406 if (!res.IsSuccess()) return res; 420 if (!res.IsSuccess()) return res;
407 421
408 // 0x000B0003 - Unknown, related to country/address (zip code?) 422 // 0x000B0003 - Unknown, related to country/address (zip code?)
@@ -418,10 +432,10 @@ ResultCode FormatConfig() {
418 if (!res.IsSuccess()) return res; 432 if (!res.IsSuccess()) return res;
419 433
420 // 0x000D0000 - Accepted EULA version 434 // 0x000D0000 - Accepted EULA version
421 res = CreateConfigInfoBlk(0x000D0000, 0x4, 0xE, zero_buffer); 435 res = CreateConfigInfoBlk(EULAVersionBlockID, 0x4, 0xE, zero_buffer);
422 if (!res.IsSuccess()) return res; 436 if (!res.IsSuccess()) return res;
423 437
424 res = CreateConfigInfoBlk(0x000F0004, sizeof(CONSOLE_MODEL), 0xC, &CONSOLE_MODEL); 438 res = CreateConfigInfoBlk(ConsoleModelBlockID, sizeof(CONSOLE_MODEL), 0xC, &CONSOLE_MODEL);
425 if (!res.IsSuccess()) return res; 439 if (!res.IsSuccess()) return res;
426 440
427 // 0x00170000 - Unknown 441 // 0x00170000 - Unknown