diff --git a/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs b/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs index 7ce98ef8..7fb144ee 100644 --- a/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs +++ b/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs @@ -56,7 +56,7 @@ namespace Ryujinx.Core.OsHle.Services.Am public long GetPerformanceMode(ServiceCtx Context) { - Context.ResponseData.Write((byte)0); + Context.ResponseData.Write((byte)Apm.PerformanceMode.Handheld); return 0; } diff --git a/Ryujinx.Core/OsHle/Services/Hid/ServiceHid.cs b/Ryujinx.Core/OsHle/Services/Hid/ServiceHid.cs index 46c868aa..7c9a350b 100644 --- a/Ryujinx.Core/OsHle/Services/Hid/ServiceHid.cs +++ b/Ryujinx.Core/OsHle/Services/Hid/ServiceHid.cs @@ -15,6 +15,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid m_Commands = new Dictionary() { { 0, CreateAppletResource }, + { 1, ActivateDebugPad }, { 11, ActivateTouchScreen }, { 66, StartSixAxisSensor }, { 100, SetSupportedNpadStyleSet }, @@ -22,6 +23,7 @@ namespace Ryujinx.Core.OsHle.Services.Hid { 102, SetSupportedNpadIdType }, { 103, ActivateNpad }, { 120, SetNpadJoyHoldType }, + { 121, GetNpadJoyHoldType }, { 122, SetNpadJoyAssignmentModeSingleByDefault }, { 123, SetNpadJoyAssignmentModeSingle }, { 124, SetNpadJoyAssignmentModeDual }, @@ -39,6 +41,11 @@ namespace Ryujinx.Core.OsHle.Services.Hid return 0; } + public long ActivateDebugPad(ServiceCtx Context) + { + return 0; + } + public long ActivateTouchScreen(ServiceCtx Context) { long Unknown = Context.RequestData.ReadInt64(); diff --git a/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs b/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs index 307da1d6..929bb26e 100644 --- a/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs +++ b/Ryujinx.Core/OsHle/Services/Nifm/IRequest.cs @@ -19,7 +19,9 @@ namespace Ryujinx.Core.OsHle.Services.Nifm { { 0, GetRequestState }, { 1, GetResult }, - { 2, GetSystemEventReadableHandles } + { 2, GetSystemEventReadableHandles }, + { 3, Cancel }, + { 4, Submit }, }; Event = new KEvent(); @@ -52,6 +54,20 @@ namespace Ryujinx.Core.OsHle.Services.Nifm return 0; } + public long Cancel(ServiceCtx Context) + { + //Todo: Stub + + return 0; + } + + public long Submit(ServiceCtx Context) + { + //Todo: Stub + + return 0; + } + public void Dispose() { Dispose(true); diff --git a/Ryujinx.Core/OsHle/Services/Ns/ServiceNs.cs b/Ryujinx.Core/OsHle/Services/Ns/ServiceNs.cs index 7f8faaa5..c28ecc7a 100644 --- a/Ryujinx.Core/OsHle/Services/Ns/ServiceNs.cs +++ b/Ryujinx.Core/OsHle/Services/Ns/ServiceNs.cs @@ -13,8 +13,15 @@ namespace Ryujinx.Core.OsHle.Services.Ns { m_Commands = new Dictionary() { - //{ 1, Function } + { 2, CountAddOnContent } }; } + + public static long CountAddOnContent(ServiceCtx Context) + { + Context.ResponseData.Write(0); + + return 0; + } } } \ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Services/Vi/IApplicationDisplayService.cs b/Ryujinx.Core/OsHle/Services/Vi/IApplicationDisplayService.cs index c7e7524c..b92dc16c 100644 --- a/Ryujinx.Core/OsHle/Services/Vi/IApplicationDisplayService.cs +++ b/Ryujinx.Core/OsHle/Services/Vi/IApplicationDisplayService.cs @@ -25,6 +25,7 @@ namespace Ryujinx.Core.OsHle.Services.Vi { 103, GetIndirectDisplayTransactionService }, { 1010, OpenDisplay }, { 1020, CloseDisplay }, + { 1102, GetDisplayResolution }, { 2020, OpenLayer }, { 2021, CloseLayer }, { 2030, CreateStrayLayer }, @@ -84,6 +85,16 @@ namespace Ryujinx.Core.OsHle.Services.Vi return 0; } + public long GetDisplayResolution(ServiceCtx Context) + { + long DisplayId = Context.RequestData.ReadInt32(); + + Context.ResponseData.Write(1280); + Context.ResponseData.Write(720); + + return 0; + } + public long OpenLayer(ServiceCtx Context) { long LayerId = Context.RequestData.ReadInt64(); diff --git a/Ryujinx.Core/OsHle/Services/Vi/ISystemDisplayService.cs b/Ryujinx.Core/OsHle/Services/Vi/ISystemDisplayService.cs index 02aafebb..3bdeb32a 100644 --- a/Ryujinx.Core/OsHle/Services/Vi/ISystemDisplayService.cs +++ b/Ryujinx.Core/OsHle/Services/Vi/ISystemDisplayService.cs @@ -13,7 +13,8 @@ namespace Ryujinx.Core.OsHle.Services.Vi { m_Commands = new Dictionary() { - { 2205, SetLayerZ } + { 2205, SetLayerZ }, + { 2207, SetLayerVisibility } }; } @@ -21,5 +22,10 @@ namespace Ryujinx.Core.OsHle.Services.Vi { return 0; } + + public static long SetLayerVisibility(ServiceCtx Context) + { + return 0; + } } } \ No newline at end of file diff --git a/Ryujinx.Core/OsHle/Svc/SvcHandler.cs b/Ryujinx.Core/OsHle/Svc/SvcHandler.cs index 3ce56a3c..3bdb1060 100644 --- a/Ryujinx.Core/OsHle/Svc/SvcHandler.cs +++ b/Ryujinx.Core/OsHle/Svc/SvcHandler.cs @@ -40,6 +40,7 @@ namespace Ryujinx.Core.OsHle.Svc { 0x0c, SvcGetThreadPriority }, { 0x0d, SvcSetThreadPriority }, { 0x0f, SvcSetThreadCoreMask }, + { 0x10, SvcGetCurrentProcessorNumber }, { 0x12, SvcClearEvent }, { 0x13, SvcMapSharedMemory }, { 0x14, SvcUnmapSharedMemory }, diff --git a/Ryujinx.Core/OsHle/Svc/SvcThread.cs b/Ryujinx.Core/OsHle/Svc/SvcThread.cs index f58c2dc0..c58cffca 100644 --- a/Ryujinx.Core/OsHle/Svc/SvcThread.cs +++ b/Ryujinx.Core/OsHle/Svc/SvcThread.cs @@ -117,6 +117,13 @@ namespace Ryujinx.Core.OsHle.Svc //TODO: Error codes. } + private void SvcGetCurrentProcessorNumber(AThreadState ThreadState) + { + KThread CurrThread = Process.GetThread(ThreadState.Tpidr); + + ThreadState.X0 = (ulong)CurrThread.ProcessorId; + } + private void SvcGetThreadId(AThreadState ThreadState) { int Handle = (int)ThreadState.X1;