Initial support for the new 12.x IPC system (#2182)

* Rename CommandAttribute as CommandHIpcAttribute to prepare for 12.x changes

* Implement inital support for TIPC and adds SM command ids

* *Ipc to *ipc

* Missed a ref in last commit...

* CommandAttributeTIpc to CommandAttributeTipc

* Addresses comment and fixes some bugs around

TIPC doesn't have any padding requirements as buffer C isn't a thing
Fix for RegisterService inverting two argument only on TIPC
This commit is contained in:
Mary 2021-04-14 00:01:24 +02:00 committed by GitHub
parent faa654dbaf
commit 0746b83edf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 1077 additions and 951 deletions

View file

@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
{
public ISettingsServer(ServiceCtx context) { }
[Command(0)]
[CommandHipc(0)]
// GetLanguageCode() -> nn::settings::LanguageCode
public ResultCode GetLanguageCode(ServiceCtx context)
{
@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(1)]
[CommandHipc(1)]
// GetAvailableLanguageCodes() -> (u32, buffer<nn::settings::LanguageCode, 0xa>)
public ResultCode GetAvailableLanguageCodes(ServiceCtx context)
{
@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
0xF);
}
[Command(2)] // 4.0.0+
[CommandHipc(2)] // 4.0.0+
// MakeLanguageCode(nn::settings::Language language_index) -> nn::settings::LanguageCode
public ResultCode MakeLanguageCode(ServiceCtx context)
{
@ -45,7 +45,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(3)]
[CommandHipc(3)]
// GetAvailableLanguageCodeCount() -> u32
public ResultCode GetAvailableLanguageCodeCount(ServiceCtx context)
{
@ -54,7 +54,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(4)]
[CommandHipc(4)]
// GetRegionCode() -> u32 nn::settings::RegionCode
public ResultCode GetRegionCode(ServiceCtx context)
{
@ -72,7 +72,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(5)]
[CommandHipc(5)]
// GetAvailableLanguageCodes2() -> (u32, buffer<nn::settings::LanguageCode, 6>)
public ResultCode GetAvailableLanguageCodes2(ServiceCtx context)
{
@ -83,7 +83,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
SystemStateMgr.LanguageCodes.Length);
}
[Command(6)]
[CommandHipc(6)]
// GetAvailableLanguageCodeCount2() -> u32
public ResultCode GetAvailableLanguageCodeCount2(ServiceCtx context)
{
@ -92,14 +92,14 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(7)] // 4.0.0+
[CommandHipc(7)] // 4.0.0+
// GetKeyCodeMap() -> buffer<nn::kpr::KeyCodeMap, 0x16>
public ResultCode GetKeyCodeMap(ServiceCtx context)
{
return GetKeyCodeMapImpl(context, 1);
}
[Command(8)] // 5.0.0+
[CommandHipc(8)] // 5.0.0+
// GetQuestFlag() -> bool
public ResultCode GetQuestFlag(ServiceCtx context)
{
@ -110,7 +110,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(9)] // 6.0.0+
[CommandHipc(9)] // 6.0.0+
// GetKeyCodeMap2() -> buffer<nn::kpr::KeyCodeMap, 0x16>
public ResultCode GetKeyCodeMap2(ServiceCtx context)
{

View file

@ -18,14 +18,14 @@ namespace Ryujinx.HLE.HOS.Services.Settings
{
public ISystemSettingsServer(ServiceCtx context) { }
[Command(3)]
[CommandHipc(3)]
// GetFirmwareVersion() -> buffer<nn::settings::system::FirmwareVersion, 0x1a, 0x100>
public ResultCode GetFirmwareVersion(ServiceCtx context)
{
return GetFirmwareVersion2(context);
}
[Command(4)]
[CommandHipc(4)]
// GetFirmwareVersion2() -> buffer<nn::settings::system::FirmwareVersion, 0x1a, 0x100>
public ResultCode GetFirmwareVersion2(ServiceCtx context)
{
@ -86,7 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(23)]
[CommandHipc(23)]
// GetColorSetId() -> i32
public ResultCode GetColorSetId(ServiceCtx context)
{
@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(24)]
[CommandHipc(24)]
// GetColorSetId() -> i32
public ResultCode SetColorSetId(ServiceCtx context)
{
@ -106,7 +106,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(37)]
[CommandHipc(37)]
// GetSettingsItemValueSize(buffer<nn::settings::SettingsName, 0x19>, buffer<nn::settings::SettingsItemKey, 0x19>) -> u64
public ResultCode GetSettingsItemValueSize(ServiceCtx context)
{
@ -155,7 +155,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(38)]
[CommandHipc(38)]
// GetSettingsItemValue(buffer<nn::settings::SettingsName, 0x19, 0x48>, buffer<nn::settings::SettingsItemKey, 0x19, 0x48>) -> (u64, buffer<unknown, 6, 0>)
public ResultCode GetSettingsItemValue(ServiceCtx context)
{
@ -221,7 +221,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
return ResultCode.Success;
}
[Command(60)]
[CommandHipc(60)]
// IsUserSystemClockAutomaticCorrectionEnabled() -> bool
public ResultCode IsUserSystemClockAutomaticCorrectionEnabled(ServiceCtx context)
{