Add the stub applet instead of not implemented exception.
This commit is contained in:
parent
0dd38028cb
commit
e589cc804c
2 changed files with 49 additions and 1 deletions
|
@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||
return (IApplet)Activator.CreateInstance(appletClass, system);
|
||||
}
|
||||
|
||||
throw new NotImplementedException($"{applet} applet is not implemented.");
|
||||
return new StubApplet(applet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
48
Ryujinx.HLE/HOS/Applets/StubApplet.cs
Normal file
48
Ryujinx.HLE/HOS/Applets/StubApplet.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.HLE.HOS.Services.Am.AppletAE;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Applets
|
||||
{
|
||||
class StubApplet : IApplet
|
||||
{
|
||||
public AppletId AppletId { get; }
|
||||
|
||||
public event EventHandler AppletStateChanged;
|
||||
|
||||
public StubApplet(AppletId appletId)
|
||||
{
|
||||
AppletId = appletId;
|
||||
}
|
||||
|
||||
public ResultCode GetResult()
|
||||
{
|
||||
Logger.PrintWarning(LogClass.ServiceAm, $"Stub {AppletId} applet called.");
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
public ResultCode Start(AppletSession normalSession, AppletSession interactiveSession)
|
||||
{
|
||||
Logger.PrintWarning(LogClass.ServiceAm, $"Stub {AppletId} applet called.");
|
||||
|
||||
byte[] normalData;
|
||||
byte[] interactiveData;
|
||||
|
||||
normalSession.TryPop(out normalData);
|
||||
interactiveSession.TryPop(out interactiveData);
|
||||
|
||||
normalSession.Push(BuildResponse());
|
||||
interactiveSession.Push(BuildResponse());
|
||||
|
||||
AppletStateChanged?.Invoke(this, null);
|
||||
|
||||
return ResultCode.Success;
|
||||
}
|
||||
|
||||
private byte[] BuildResponse()
|
||||
{
|
||||
return new byte[0x1000];
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue