diff --git a/Ryujinx.HLE/HOS/Applets/AppletManager.cs b/Ryujinx.HLE/HOS/Applets/AppletManager.cs index e731454048..686a50bd7a 100644 --- a/Ryujinx.HLE/HOS/Applets/AppletManager.cs +++ b/Ryujinx.HLE/HOS/Applets/AppletManager.cs @@ -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); } } } diff --git a/Ryujinx.HLE/HOS/Applets/StubApplet.cs b/Ryujinx.HLE/HOS/Applets/StubApplet.cs new file mode 100644 index 0000000000..4444ac1fb2 --- /dev/null +++ b/Ryujinx.HLE/HOS/Applets/StubApplet.cs @@ -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]; + } + } +}