diff options
author | Ac_K <Acoustik666@gmail.com> | 2023-01-08 13:13:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-08 12:13:39 +0000 |
commit | 550747eac6c0f6da14070c8b6d208bde6f1d1eb9 (patch) | |
tree | 1be203777156dae17a4221589c852c638b273d94 /Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs | |
parent | 3ffceab1fb220c13f5982de599d788f2e3e7cc47 (diff) |
Horizon: Impl Prepo, Fixes bugs, Clean things (#4220)1.1.519
* Horizon: Impl Prepo, Fixes bugs, Clean things
* remove ToArray()
* resultCode > status
* Remove old services
* Addresses gdkchan's comments and more cleanup
* Addresses Gdkchan's feedback 2
* Reorganize services, make sure service are loaded before guest
Co-Authored-By: gdkchan <5624669+gdkchan@users.noreply.github.com>
* Create interfaces for lm and sm
Co-authored-by: gdkchan <5624669+gdkchan@users.noreply.github.com>
Diffstat (limited to 'Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs')
-rw-r--r-- | Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs b/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs index a0e28ca8..81600067 100644 --- a/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs +++ b/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs @@ -39,17 +39,21 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif if (!entries.TryGetValue((int)commandId, out var commandHandler)) { - Logger.Warning?.Print(LogClass.KernelIpc, $"{objectName} command ID 0x{commandId:X} is not implemented"); - if (HorizonStatic.Options.IgnoreMissingServices) { // If ignore missing services is enabled, just pretend that everything is fine. - var response = PrepareForStubReply(ref context, out Span<byte> outRawData); + PrepareForStubReply(ref context, out Span<byte> outRawData); CommandHandler.GetCmifOutHeaderPointer(ref outHeader, ref outRawData); outHeader[0] = new CmifOutHeader() { Magic = CmifMessage.CmifOutHeaderMagic, Result = Result.Success }; + Logger.Warning?.Print(LogClass.Service, $"Missing service {objectName} (command ID: {commandId}) ignored"); + return Result.Success; } + else if (HorizonStatic.Options.ThrowOnInvalidCommandIds) + { + throw new NotImplementedException($"{objectName} command ID: {commandId} is not implemented"); + } return SfResult.UnknownCommandId; } @@ -72,6 +76,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif if (outHeader.IsEmpty) { commandResult.AbortOnSuccess(); + return commandResult; } @@ -80,11 +85,10 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif return Result.Success; } - private static HipcMessageData PrepareForStubReply(scoped ref ServiceDispatchContext context, out Span<byte> outRawData) + private static void PrepareForStubReply(scoped ref ServiceDispatchContext context, out Span<byte> outRawData) { var response = HipcMessage.WriteResponse(context.OutMessageBuffer, 0, 0x20 / sizeof(uint), 0, 0); outRawData = MemoryMarshal.Cast<uint, byte>(response.DataWords); - return response; } } -} +}
\ No newline at end of file |