add GetAvailableLanguageCodeCount for both lists

This commit is contained in:
Dima 2022-10-30 18:46:21 +03:00 committed by Billy Laws
parent 51ce3f7c3c
commit a409f30e91
2 changed files with 23 additions and 1 deletions

View File

@ -19,12 +19,22 @@ namespace skyline::service::settings {
return {};
}
Result ISettingsServer::GetAvailableLanguageCodeCount(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
response.Push<i32>(constant::OldLanguageCodeListSize);
return {};
}
Result ISettingsServer::GetAvailableLanguageCodes2(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
request.outputBuf.at(0).copy_from(language::LanguageCodeList);
response.Push<i32>(constant::NewLanguageCodeListSize);
return {};
}
Result ISettingsServer::GetAvailableLanguageCodeCount2(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
response.Push<i32>(constant::NewLanguageCodeListSize);
return {};
}
Result ISettingsServer::GetRegionCode(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response) {
region::RegionCode regionCode{*state.settings->systemRegion};

View File

@ -24,6 +24,11 @@ namespace skyline::service::settings {
*/
Result MakeLanguageCode(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
/**
* @brief Returns the number of available language codes that an application can use (pre 4.0.0)
*/
Result GetAvailableLanguageCodeCount(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
/**
* @brief Returns the user-selected region's code
*/
@ -34,11 +39,18 @@ namespace skyline::service::settings {
*/
Result GetAvailableLanguageCodes2(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
/**
* @brief Returns the number of available language codes that an application can use (post 4.0.0)
*/
Result GetAvailableLanguageCodeCount2(type::KSession &session, ipc::IpcRequest &request, ipc::IpcResponse &response);
SERVICE_DECL(
SFUNC(0x1, ISettingsServer, GetAvailableLanguageCodes),
SFUNC(0x2, ISettingsServer, MakeLanguageCode),
SFUNC(0x3, ISettingsServer, GetAvailableLanguageCodeCount),
SFUNC(0x4, ISettingsServer, GetRegionCode),
SFUNC(0x5, ISettingsServer, GetAvailableLanguageCodes2)
SFUNC(0x5, ISettingsServer, GetAvailableLanguageCodes2),
SFUNC(0x6, ISettingsServer, GetAvailableLanguageCodeCount2)
)
};
}