mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-07-08 07:16:27 +02:00
chore: applets: Cleanup redundant ReadStruct implementations & provide a default implementation for IApplet#GetResult.
This commit is contained in:
parent
08b7257be5
commit
07690e4527
10 changed files with 7 additions and 53 deletions
|
@ -11,11 +11,14 @@ namespace Ryujinx.HLE.HOS.Applets.Dummy
|
|||
{
|
||||
private readonly Horizon _system;
|
||||
private AppletSession _normalSession;
|
||||
|
||||
public event EventHandler AppletStateChanged;
|
||||
|
||||
public DummyApplet(Horizon system)
|
||||
{
|
||||
_system = system;
|
||||
}
|
||||
|
||||
public ResultCode Start(AppletSession normalSession, AppletSession interactiveSession)
|
||||
{
|
||||
_normalSession = normalSession;
|
||||
|
@ -24,10 +27,7 @@ namespace Ryujinx.HLE.HOS.Applets.Dummy
|
|||
_system.ReturnFocus();
|
||||
return ResultCode.Success;
|
||||
}
|
||||
private static T ReadStruct<T>(byte[] data) where T : struct
|
||||
{
|
||||
return MemoryMarshal.Read<T>(data.AsSpan());
|
||||
}
|
||||
|
||||
private static byte[] BuildResponse()
|
||||
{
|
||||
using MemoryStream stream = MemoryStreamManager.Shared.GetStream();
|
||||
|
@ -35,9 +35,5 @@ namespace Ryujinx.HLE.HOS.Applets.Dummy
|
|||
writer.Write((ulong)ResultCode.Success);
|
||||
return stream.ToArray();
|
||||
}
|
||||
public ResultCode GetResult()
|
||||
{
|
||||
return ResultCode.Success;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue