From f13be6429b89d7707aaea71bc3fb6ddbcc50566e Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Mon, 11 Jun 2018 01:53:28 +0200 Subject: [PATCH 1/3] Implement GetDefaultDisplayResolution/+ChangeEvent on ICommonStateGetter --- .../OsHle/Services/Am/ICommonStateGetter.cs | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs b/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs index ba87cf32..e0b8f6ed 100644 --- a/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs +++ b/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs @@ -13,6 +13,8 @@ namespace Ryujinx.Core.OsHle.Services.Am public override IReadOnlyDictionary Commands => m_Commands; + private KEvent DisplayResolutionChangeEvent; + public ICommonStateGetter() { m_Commands = new Dictionary() @@ -22,8 +24,12 @@ namespace Ryujinx.Core.OsHle.Services.Am { 5, GetOperationMode }, { 6, GetPerformanceMode }, { 8, GetBootMode }, - { 9, GetCurrentFocusState } + { 9, GetCurrentFocusState }, + { 60, GetDefaultDisplayResolution }, + { 61, GetDefaultDisplayResolutionChangeEvent } }; + + DisplayResolutionChangeEvent = new KEvent(); } public long GetEventHandle(ServiceCtx Context) @@ -78,5 +84,26 @@ namespace Ryujinx.Core.OsHle.Services.Am return 0; } + + public long GetDefaultDisplayResolution(ServiceCtx Context) + { + Context.ResponseData.Write(1280); + Context.ResponseData.Write(720); + + // Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } + + public long GetDefaultDisplayResolutionChangeEvent(ServiceCtx Context) + { + int Handle = Context.Process.HandleTable.OpenHandle(DisplayResolutionChangeEvent); + + Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle); + + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + return 0; + } } } \ No newline at end of file From 851f2ded9a369633bb18a5fc97c123b3ef94c24e Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Mon, 11 Jun 2018 02:10:09 +0200 Subject: [PATCH 2/3] Fix bracket alignment --- .../OsHle/Services/Am/ICommonStateGetter.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs b/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs index e0b8f6ed..3c76daf8 100644 --- a/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs +++ b/Ryujinx.Core/OsHle/Services/Am/ICommonStateGetter.cs @@ -19,13 +19,13 @@ namespace Ryujinx.Core.OsHle.Services.Am { m_Commands = new Dictionary() { - { 0, GetEventHandle }, - { 1, ReceiveMessage }, - { 5, GetOperationMode }, - { 6, GetPerformanceMode }, - { 8, GetBootMode }, - { 9, GetCurrentFocusState }, - { 60, GetDefaultDisplayResolution }, + { 0, GetEventHandle }, + { 1, ReceiveMessage }, + { 5, GetOperationMode }, + { 6, GetPerformanceMode }, + { 8, GetBootMode }, + { 9, GetCurrentFocusState }, + { 60, GetDefaultDisplayResolution }, { 61, GetDefaultDisplayResolutionChangeEvent } }; From 5b9ce52108b24b52b489e43cb0cc508c05abfa7a Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Wed, 13 Jun 2018 01:29:39 +0200 Subject: [PATCH 3/3] Remove comment --- Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs b/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs index 55560572..e1a13c59 100644 --- a/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs +++ b/Ryujinx.HLE/OsHle/Services/Am/ICommonStateGetter.cs @@ -90,8 +90,6 @@ namespace Ryujinx.HLE.OsHle.Services.Am Context.ResponseData.Write(1280); Context.ResponseData.Write(720); - // Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); - return 0; }