mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-12 22:00:04 +00:00
Use IPC:MakeHeader instead of hardcoded raw values for IPC command tables. (#6453)
* Use IPC:MakeHeader instead of hardcoded values for IPC command tables. * Use u32 instead of unsigned int in MakeHeader function Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com> * Fix clang format --------- Co-authored-by: SachinVin <26602104+SachinVin@users.noreply.github.com>
This commit is contained in:
parent
9bd8c9290b
commit
63bc0b59bb
74 changed files with 1983 additions and 1896 deletions
|
@ -12,52 +12,52 @@ namespace Service::CFG {
|
|||
CFG_I::CFG_I(std::shared_ptr<Module> cfg) : Module::Interface(std::move(cfg), "cfg:i", 23) {
|
||||
static const FunctionInfo functions[] = {
|
||||
// cfg common
|
||||
{0x00010082, &CFG_I::GetConfigInfoBlk2, "GetConfigInfoBlk2"},
|
||||
{0x00020000, &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"},
|
||||
{0x00030040, &CFG_I::GenHashConsoleUnique, "GenHashConsoleUnique"},
|
||||
{0x00040000, &CFG_I::GetRegionCanadaUSA, "GetRegionCanadaUSA"},
|
||||
{0x00050000, &CFG_I::GetSystemModel, "GetSystemModel"},
|
||||
{0x00060000, &CFG_I::GetModelNintendo2DS, "GetModelNintendo2DS"},
|
||||
{0x00070040, nullptr, "WriteToFirstByteCfgSavegame"},
|
||||
{0x00080080, nullptr, "GoThroughTable"},
|
||||
{0x00090040, &CFG_I::GetCountryCodeString, "GetCountryCodeString"},
|
||||
{0x000A0040, &CFG_I::GetCountryCodeID, "GetCountryCodeID"},
|
||||
{0x000B0000, nullptr, "IsFangateSupported"},
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 2, 2), &CFG_I::GetConfigInfoBlk2, "GetConfigInfoBlk2"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"},
|
||||
{IPC::MakeHeader(0x0003, 1, 0), &CFG_I::GenHashConsoleUnique, "GenHashConsoleUnique"},
|
||||
{IPC::MakeHeader(0x0004, 0, 0), &CFG_I::GetRegionCanadaUSA, "GetRegionCanadaUSA"},
|
||||
{IPC::MakeHeader(0x0005, 0, 0), &CFG_I::GetSystemModel, "GetSystemModel"},
|
||||
{IPC::MakeHeader(0x0006, 0, 0), &CFG_I::GetModelNintendo2DS, "GetModelNintendo2DS"},
|
||||
{IPC::MakeHeader(0x0007, 1, 0), nullptr, "WriteToFirstByteCfgSavegame"},
|
||||
{IPC::MakeHeader(0x0008, 2, 0), nullptr, "GoThroughTable"},
|
||||
{IPC::MakeHeader(0x0009, 1, 0), &CFG_I::GetCountryCodeString, "GetCountryCodeString"},
|
||||
{IPC::MakeHeader(0x000A, 1, 0), &CFG_I::GetCountryCodeID, "GetCountryCodeID"},
|
||||
{IPC::MakeHeader(0x000B, 0, 0), nullptr, "IsFangateSupported"},
|
||||
// cfg:i
|
||||
{0x04010082, &CFG_I::D<&CFG_I::GetConfigInfoBlk8, 0x0401>, "GetConfigInfoBlk8"},
|
||||
{0x04020082, &CFG_I::D<&CFG_I::SetConfigInfoBlk4, 0x0402>, "SetConfigInfoBlk4"},
|
||||
{0x04030000, &CFG_I::D<&CFG_I::UpdateConfigNANDSavegame, 0x0403>,
|
||||
"UpdateConfigNANDSavegame"},
|
||||
{0x04040042, nullptr, "GetLocalFriendCodeSeedData"},
|
||||
{0x04050000, nullptr, "GetLocalFriendCodeSeed"},
|
||||
{0x04060000, &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0406>, "SecureInfoGetRegion"},
|
||||
{0x04070000, nullptr, "SecureInfoGetByte101"},
|
||||
{0x04080042, nullptr, "SecureInfoGetSerialNo"},
|
||||
{0x04090000, nullptr, "UpdateConfigBlk00040003"},
|
||||
{0x08010082, &CFG_I::D<&CFG_I::GetConfigInfoBlk8, 0x0801>, "GetConfigInfoBlk8"},
|
||||
{0x08020082, &CFG_I::D<&CFG_I::SetConfigInfoBlk4, 0x0802>, "SetConfigInfoBlk4"},
|
||||
{0x08030000, &CFG_I::D<&CFG_I::UpdateConfigNANDSavegame, 0x0803>,
|
||||
"UpdateConfigNANDSavegame"},
|
||||
{0x080400C2, nullptr, "CreateConfigInfoBlk"},
|
||||
{0x08050000, nullptr, "DeleteConfigNANDSavefile"},
|
||||
{0x08060000, &CFG_I::FormatConfig, "FormatConfig"},
|
||||
{0x08080000, nullptr, "UpdateConfigBlk1"},
|
||||
{0x08090000, nullptr, "UpdateConfigBlk2"},
|
||||
{0x080A0000, nullptr, "UpdateConfigBlk3"},
|
||||
{0x080B0082, nullptr, "SetGetLocalFriendCodeSeedData"},
|
||||
{0x080C0042, nullptr, "SetLocalFriendCodeSeedSignature"},
|
||||
{0x080D0000, nullptr, "DeleteCreateNANDLocalFriendCodeSeed"},
|
||||
{0x080E0000, nullptr, "VerifySigLocalFriendCodeSeed"},
|
||||
{0x080F0042, nullptr, "GetLocalFriendCodeSeedData"},
|
||||
{0x08100000, nullptr, "GetLocalFriendCodeSeed"},
|
||||
{0x08110084, nullptr, "SetSecureInfo"},
|
||||
{0x08120000, nullptr, "DeleteCreateNANDSecureInfo"},
|
||||
{0x08130000, nullptr, "VerifySigSecureInfo"},
|
||||
{0x08140042, nullptr, "SecureInfoGetData"},
|
||||
{0x08150042, nullptr, "SecureInfoGetSignature"},
|
||||
{0x08160000, &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0816>, "SecureInfoGetRegion"},
|
||||
{0x08170000, nullptr, "SecureInfoGetByte101"},
|
||||
{0x08180042, nullptr, "SecureInfoGetSerialNo"},
|
||||
{IPC::MakeHeader(0x0401, 2, 2), &CFG_I::D<&CFG_I::GetConfigInfoBlk8, 0x0401>, "GetConfigInfoBlk8"},
|
||||
{IPC::MakeHeader(0x0402, 2, 2), &CFG_I::D<&CFG_I::SetConfigInfoBlk4, 0x0402>, "SetConfigInfoBlk4"},
|
||||
{IPC::MakeHeader(0x0403, 0, 0), &CFG_I::D<&CFG_I::UpdateConfigNANDSavegame, 0x0403>, "UpdateConfigNANDSavegame"},
|
||||
{IPC::MakeHeader(0x0404, 1, 2), nullptr, "GetLocalFriendCodeSeedData"},
|
||||
{IPC::MakeHeader(0x0405, 0, 0), nullptr, "GetLocalFriendCodeSeed"},
|
||||
{IPC::MakeHeader(0x0406, 0, 0), &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0406>, "SecureInfoGetRegion"},
|
||||
{IPC::MakeHeader(0x0407, 0, 0), nullptr, "SecureInfoGetByte101"},
|
||||
{IPC::MakeHeader(0x0408, 1, 2), nullptr, "SecureInfoGetSerialNo"},
|
||||
{IPC::MakeHeader(0x0409, 0, 0), nullptr, "UpdateConfigBlk00040003"},
|
||||
{IPC::MakeHeader(0x0801, 2, 2), &CFG_I::D<&CFG_I::GetConfigInfoBlk8, 0x0801>, "GetConfigInfoBlk8"},
|
||||
{IPC::MakeHeader(0x0802, 2, 2), &CFG_I::D<&CFG_I::SetConfigInfoBlk4, 0x0802>, "SetConfigInfoBlk4"},
|
||||
{IPC::MakeHeader(0x0803, 0, 0), &CFG_I::D<&CFG_I::UpdateConfigNANDSavegame, 0x0803>, "UpdateConfigNANDSavegame"},
|
||||
{IPC::MakeHeader(0x0804, 3, 2), nullptr, "CreateConfigInfoBlk"},
|
||||
{IPC::MakeHeader(0x0805, 0, 0), nullptr, "DeleteConfigNANDSavefile"},
|
||||
{IPC::MakeHeader(0x0806, 0, 0), &CFG_I::FormatConfig, "FormatConfig"},
|
||||
{IPC::MakeHeader(0x0808, 0, 0), nullptr, "UpdateConfigBlk1"},
|
||||
{IPC::MakeHeader(0x0809, 0, 0), nullptr, "UpdateConfigBlk2"},
|
||||
{IPC::MakeHeader(0x080A, 0, 0), nullptr, "UpdateConfigBlk3"},
|
||||
{IPC::MakeHeader(0x080B, 2, 2), nullptr, "SetGetLocalFriendCodeSeedData"},
|
||||
{IPC::MakeHeader(0x080C, 1, 2), nullptr, "SetLocalFriendCodeSeedSignature"},
|
||||
{IPC::MakeHeader(0x080D, 0, 0), nullptr, "DeleteCreateNANDLocalFriendCodeSeed"},
|
||||
{IPC::MakeHeader(0x080E, 0, 0), nullptr, "VerifySigLocalFriendCodeSeed"},
|
||||
{IPC::MakeHeader(0x080F, 1, 2), nullptr, "GetLocalFriendCodeSeedData"},
|
||||
{IPC::MakeHeader(0x0810, 0, 0), nullptr, "GetLocalFriendCodeSeed"},
|
||||
{IPC::MakeHeader(0x0811, 2, 4), nullptr, "SetSecureInfo"},
|
||||
{IPC::MakeHeader(0x0812, 0, 0), nullptr, "DeleteCreateNANDSecureInfo"},
|
||||
{IPC::MakeHeader(0x0813, 0, 0), nullptr, "VerifySigSecureInfo"},
|
||||
{IPC::MakeHeader(0x0814, 1, 2), nullptr, "SecureInfoGetData"},
|
||||
{IPC::MakeHeader(0x0815, 1, 2), nullptr, "SecureInfoGetSignature"},
|
||||
{IPC::MakeHeader(0x0816, 0, 0), &CFG_I::D<&CFG_I::SecureInfoGetRegion, 0x0816>, "SecureInfoGetRegion"},
|
||||
{IPC::MakeHeader(0x0817, 0, 0), nullptr, "SecureInfoGetByte101"},
|
||||
{IPC::MakeHeader(0x0818, 1, 2), nullptr, "SecureInfoGetSerialNo"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
|
|
@ -11,10 +11,12 @@ namespace Service::CFG {
|
|||
|
||||
CFG_NOR::CFG_NOR() : ServiceFramework("cfg:nor", 23) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0x00010040, nullptr, "Initialize"},
|
||||
{0x00020000, nullptr, "Shutdown"},
|
||||
{0x00050082, nullptr, "ReadData"},
|
||||
{0x00060082, nullptr, "WriteData"},
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 1, 0), nullptr, "Initialize"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), nullptr, "Shutdown"},
|
||||
{IPC::MakeHeader(0x0005, 2, 2), nullptr, "ReadData"},
|
||||
{IPC::MakeHeader(0x0006, 2, 2), nullptr, "WriteData"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
|
|
@ -12,28 +12,29 @@ namespace Service::CFG {
|
|||
CFG_S::CFG_S(std::shared_ptr<Module> cfg) : Module::Interface(std::move(cfg), "cfg:s", 23) {
|
||||
static const FunctionInfo functions[] = {
|
||||
// cfg common
|
||||
{0x00010082, &CFG_S::GetConfigInfoBlk2, "GetConfigInfoBlk2"},
|
||||
{0x00020000, &CFG_S::D<&CFG_S::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"},
|
||||
{0x00030040, &CFG_S::GenHashConsoleUnique, "GenHashConsoleUnique"},
|
||||
{0x00040000, &CFG_S::GetRegionCanadaUSA, "GetRegionCanadaUSA"},
|
||||
{0x00050000, &CFG_S::GetSystemModel, "GetSystemModel"},
|
||||
{0x00060000, &CFG_S::GetModelNintendo2DS, "GetModelNintendo2DS"},
|
||||
{0x00070040, nullptr, "WriteToFirstByteCfgSavegame"},
|
||||
{0x00080080, nullptr, "GoThroughTable"},
|
||||
{0x00090040, &CFG_S::GetCountryCodeString, "GetCountryCodeString"},
|
||||
{0x000A0040, &CFG_S::GetCountryCodeID, "GetCountryCodeID"},
|
||||
{0x000B0000, nullptr, "IsFangateSupported"},
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 2, 2), &CFG_S::GetConfigInfoBlk2, "GetConfigInfoBlk2"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), &CFG_S::D<&CFG_S::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"},
|
||||
{IPC::MakeHeader(0x0003, 1, 0), &CFG_S::GenHashConsoleUnique, "GenHashConsoleUnique"},
|
||||
{IPC::MakeHeader(0x0004, 0, 0), &CFG_S::GetRegionCanadaUSA, "GetRegionCanadaUSA"},
|
||||
{IPC::MakeHeader(0x0005, 0, 0), &CFG_S::GetSystemModel, "GetSystemModel"},
|
||||
{IPC::MakeHeader(0x0006, 0, 0), &CFG_S::GetModelNintendo2DS, "GetModelNintendo2DS"},
|
||||
{IPC::MakeHeader(0x0007, 1, 0), nullptr, "WriteToFirstByteCfgSavegame"},
|
||||
{IPC::MakeHeader(0x0008, 2, 0), nullptr, "GoThroughTable"},
|
||||
{IPC::MakeHeader(0x0009, 1, 0), &CFG_S::GetCountryCodeString, "GetCountryCodeString"},
|
||||
{IPC::MakeHeader(0x000A, 1, 0), &CFG_S::GetCountryCodeID, "GetCountryCodeID"},
|
||||
{IPC::MakeHeader(0x000B, 0, 0), nullptr, "IsFangateSupported"},
|
||||
// cfg:s
|
||||
{0x04010082, &CFG_S::D<&CFG_S::GetConfigInfoBlk8, 0x0401>, "GetConfigInfoBlk8"},
|
||||
{0x04020082, &CFG_S::D<&CFG_S::SetConfigInfoBlk4, 0x0402>, "SetConfigInfoBlk4"},
|
||||
{0x04030000, &CFG_S::D<&CFG_S::UpdateConfigNANDSavegame, 0x0403>,
|
||||
"UpdateConfigNANDSavegame"},
|
||||
{0x04040042, nullptr, "GetLocalFriendCodeSeedData"},
|
||||
{0x04050000, nullptr, "GetLocalFriendCodeSeed"},
|
||||
{0x04060000, &CFG_S::D<&CFG_S::SecureInfoGetRegion, 0x0406>, "SecureInfoGetRegion"},
|
||||
{0x04070000, nullptr, "SecureInfoGetByte101"},
|
||||
{0x04080042, nullptr, "SecureInfoGetSerialNo"},
|
||||
{0x04090000, nullptr, "UpdateConfigBlk00040003"},
|
||||
{IPC::MakeHeader(0x0401, 2, 2), &CFG_S::D<&CFG_S::GetConfigInfoBlk8, 0x0401>, "GetConfigInfoBlk8"},
|
||||
{IPC::MakeHeader(0x0402, 2, 2), &CFG_S::D<&CFG_S::SetConfigInfoBlk4, 0x0402>, "SetConfigInfoBlk4"},
|
||||
{IPC::MakeHeader(0x0403, 0, 0), &CFG_S::D<&CFG_S::UpdateConfigNANDSavegame, 0x0403>, "UpdateConfigNANDSavegame"},
|
||||
{IPC::MakeHeader(0x0404, 1, 2), nullptr, "GetLocalFriendCodeSeedData"},
|
||||
{IPC::MakeHeader(0x0405, 0, 0), nullptr, "GetLocalFriendCodeSeed"},
|
||||
{IPC::MakeHeader(0x0406, 0, 0), &CFG_S::D<&CFG_S::SecureInfoGetRegion, 0x0406>, "SecureInfoGetRegion"},
|
||||
{IPC::MakeHeader(0x0407, 0, 0), nullptr, "SecureInfoGetByte101"},
|
||||
{IPC::MakeHeader(0x0408, 1, 2), nullptr, "SecureInfoGetSerialNo"},
|
||||
{IPC::MakeHeader(0x0409, 0, 0), nullptr, "UpdateConfigBlk00040003"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
|
|
@ -12,17 +12,19 @@ namespace Service::CFG {
|
|||
CFG_U::CFG_U(std::shared_ptr<Module> cfg) : Module::Interface(std::move(cfg), "cfg:u", 23) {
|
||||
static const FunctionInfo functions[] = {
|
||||
// cfg common
|
||||
{0x00010082, &CFG_U::GetConfigInfoBlk2, "GetConfigInfoBlk2"},
|
||||
{0x00020000, &CFG_U::D<&CFG_U::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"},
|
||||
{0x00030040, &CFG_U::GenHashConsoleUnique, "GenHashConsoleUnique"},
|
||||
{0x00040000, &CFG_U::GetRegionCanadaUSA, "GetRegionCanadaUSA"},
|
||||
{0x00050000, &CFG_U::GetSystemModel, "GetSystemModel"},
|
||||
{0x00060000, &CFG_U::GetModelNintendo2DS, "GetModelNintendo2DS"},
|
||||
{0x00070040, nullptr, "WriteToFirstByteCfgSavegame"},
|
||||
{0x00080080, nullptr, "GoThroughTable"},
|
||||
{0x00090040, &CFG_U::GetCountryCodeString, "GetCountryCodeString"},
|
||||
{0x000A0040, &CFG_U::GetCountryCodeID, "GetCountryCodeID"},
|
||||
{0x000B0000, nullptr, "IsFangateSupported"},
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 2, 2), &CFG_U::GetConfigInfoBlk2, "GetConfigInfoBlk2"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), &CFG_U::D<&CFG_U::SecureInfoGetRegion, 0x0002>, "SecureInfoGetRegion"},
|
||||
{IPC::MakeHeader(0x0003, 1, 0), &CFG_U::GenHashConsoleUnique, "GenHashConsoleUnique"},
|
||||
{IPC::MakeHeader(0x0004, 0, 0), &CFG_U::GetRegionCanadaUSA, "GetRegionCanadaUSA"},
|
||||
{IPC::MakeHeader(0x0005, 0, 0), &CFG_U::GetSystemModel, "GetSystemModel"},
|
||||
{IPC::MakeHeader(0x0006, 0, 0), &CFG_U::GetModelNintendo2DS, "GetModelNintendo2DS"},
|
||||
{IPC::MakeHeader(0x0007, 1, 0), nullptr, "WriteToFirstByteCfgSavegame"},
|
||||
{IPC::MakeHeader(0x0008, 2, 0), nullptr, "GoThroughTable"},
|
||||
{IPC::MakeHeader(0x0009, 1, 0), &CFG_U::GetCountryCodeString, "GetCountryCodeString"},
|
||||
{IPC::MakeHeader(0x000A, 1, 0), &CFG_U::GetCountryCodeID, "GetCountryCodeID"},
|
||||
{IPC::MakeHeader(0x000B, 0, 0), nullptr, "IsFangateSupported"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue