Improve stubs

This commit is contained in:
Rygnus 2018-07-19 14:25:19 +01:00 committed by GitHub
commit ee78c1c6bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,10 +13,13 @@ namespace Ryujinx.HLE.OsHle.Services.Am
private KEvent LaunchableEvent; private KEvent LaunchableEvent;
public bool IsExitLocked = false;
public ISelfController() public ISelfController()
{ {
m_Commands = new Dictionary<int, ServiceProcessRequest>() m_Commands = new Dictionary<int, ServiceProcessRequest>()
{ {
{ 0, Exit },
{ 1, LockExit }, { 1, LockExit },
{ 2, UnlockExit }, { 2, UnlockExit },
{ 9, GetLibraryAppletLaunchableEvent }, { 9, GetLibraryAppletLaunchableEvent },
@ -32,13 +35,33 @@ namespace Ryujinx.HLE.OsHle.Services.Am
LaunchableEvent = new KEvent(); LaunchableEvent = new KEvent();
} }
public long Exit(ServiceCtx Context)
{
if(IsExitLocked == false)
{
Context.Ns.Log.PrintInfo("Applet requested exit (IsExitLocked = false)");
//Exit the applet
}
else
{
Context.Ns.Log.PrintInfo("Applet requested exit, but not allowed (IsExitLocked = true)");
}
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
return 0;
}
public long LockExit(ServiceCtx Context) public long LockExit(ServiceCtx Context)
{ {
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
IsExitLocked = true;
return 0; return 0;
} }
public long UnlockExit(ServiceCtx Context) public long UnlockExit(ServiceCtx Context)
{ {
Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed.");
IsExitLocked = false;
return 0; return 0;
} }