service/cfg, citra_qt: add country code configuration

This commit is contained in:
zhupengfei 2018-07-18 14:32:56 +08:00
parent a1b1d827bf
commit e61b7d265f
No known key found for this signature in database
GPG key ID: 85B82A3E62174206
5 changed files with 243 additions and 1 deletions

View file

@ -666,6 +666,17 @@ SoundOutputMode Module::GetSoundOutputMode() {
return static_cast<SoundOutputMode>(block);
}
void Module::SetCountryCode(u8 country_code) {
ConsoleCountryInfo block = {{0, 0, 0}, country_code};
SetConfigInfoBlock(CountryInfoBlockID, sizeof(block), 4, &block);
}
u8 Module::GetCountryCode() {
ConsoleCountryInfo block;
GetConfigInfoBlock(CountryInfoBlockID, sizeof(block), 8, &block);
return block.country_code;
}
void Module::GenerateConsoleUniqueId(u32& random_number, u64& console_id) {
CryptoPP::AutoSeededRandomPool rng;
random_number = rng.GenerateWord32(0, 0xFFFF);

View file

@ -357,6 +357,18 @@ public:
*/
SoundOutputMode GetSoundOutputMode();
/**
* Sets the country code in config savegame.
* @param country_code the country code to set
*/
void SetCountryCode(u8 country_code);
/**
* Gets the country code from config savegame.
* @returns the country code
*/
u8 GetCountryCode();
/**
* Generates a new random console unique id.
* @param random_number a random generated 16bit number stored at 0x90002, used for generating