From b57193fff903d4ef4ab8ebb2f2345832be84591d Mon Sep 17 00:00:00 2001 From: Starlet Date: Fri, 13 Jul 2018 21:37:59 -0400 Subject: [PATCH 1/2] Initial stubs --- .../Services/Am/IApplicationFunctions.cs | 21 +++++++++++++++ .../OsHle/Services/Nifm/IGeneralService.cs | 27 ++++++++++++++++++- .../Services/Pctl/IParentalControlService.cs | 10 ++++++- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs b/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs index e25b524abb..78a9a187df 100644 --- a/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs +++ b/Ryujinx.HLE/OsHle/Services/Am/IApplicationFunctions.cs @@ -19,6 +19,8 @@ namespace Ryujinx.HLE.OsHle.Services.Am { 21, GetDesiredLanguage }, { 22, SetTerminateResult }, { 23, GetDisplayVersion }, + { 25, ExtendSaveData }, + { 26, GetSaveDataSize }, { 40, NotifyRunning }, { 50, GetPseudoDeviceId }, { 66, InitializeGamePlayRecording }, @@ -81,6 +83,25 @@ namespace Ryujinx.HLE.OsHle.Services.Am return 0; } + public long ExtendSaveData(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + Context.ResponseData.Write(0x400L); + + return 0; + } + + public long GetSaveDataSize(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceAm, "Stubbed."); + + Context.ResponseData.Write(0L); + Context.ResponseData.Write(0x200L); + + return 0; + } + public long NotifyRunning(ServiceCtx Context) { Context.ResponseData.Write(1); diff --git a/Ryujinx.HLE/OsHle/Services/Nifm/IGeneralService.cs b/Ryujinx.HLE/OsHle/Services/Nifm/IGeneralService.cs index e289a8db8f..e16d241844 100644 --- a/Ryujinx.HLE/OsHle/Services/Nifm/IGeneralService.cs +++ b/Ryujinx.HLE/OsHle/Services/Nifm/IGeneralService.cs @@ -14,7 +14,9 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm { m_Commands = new Dictionary() { - { 4, CreateRequest } + { 4, CreateRequest }, + { 5, GetCurrentNetworkProfile }, + { 12, GetCurrentIpAddress } }; } @@ -29,5 +31,28 @@ namespace Ryujinx.HLE.OsHle.Services.Nifm return 0; } + + public long GetCurrentNetworkProfile(ServiceCtx Context) + { + (long Position, long Size) = Context.Request.GetBufferType0x21(); + + Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed."); + + for (int Index = 0; Index < Size; Index++) + { + Context.Memory.WriteByte(Position + Index, 0); + } + + return 0; + } + + public long GetCurrentIpAddress(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServiceNifm, "Stubbed."); + + Context.ResponseData.Write(0); + + return 0; + } } } \ No newline at end of file diff --git a/Ryujinx.HLE/OsHle/Services/Pctl/IParentalControlService.cs b/Ryujinx.HLE/OsHle/Services/Pctl/IParentalControlService.cs index 60a69f58c9..0fb620b665 100644 --- a/Ryujinx.HLE/OsHle/Services/Pctl/IParentalControlService.cs +++ b/Ryujinx.HLE/OsHle/Services/Pctl/IParentalControlService.cs @@ -18,7 +18,8 @@ namespace Ryujinx.HLE.OsHle.Services.Pctl { m_Commands = new Dictionary() { - { 1, Initialize } + { 1, Initialize }, + { 1001, CheckFreeCommunicationPermission } }; this.NeedInitialize = NeedInitialize; @@ -37,5 +38,12 @@ namespace Ryujinx.HLE.OsHle.Services.Pctl return 0; } + + public long CheckFreeCommunicationPermission(ServiceCtx Context) + { + Context.Ns.Log.PrintStub(LogClass.ServicePctl, "Stubbed."); + + return 0; + } } } \ No newline at end of file From 7248f45524022f4e6d009b18e57c240a91663164 Mon Sep 17 00:00:00 2001 From: Starlet Date: Fri, 13 Jul 2018 22:14:26 -0400 Subject: [PATCH 2/2] Other things... --- .../OsHle/Services/FspSrv/IFileSystemProxy.cs | 29 ++++++++++++++++++- .../OsHle/Services/FspSrv/StorageTypes.cs | 12 ++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs diff --git a/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs b/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs index 84a0bc3de0..8c94b142c0 100644 --- a/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs +++ b/Ryujinx.HLE/OsHle/Services/FspSrv/IFileSystemProxy.cs @@ -1,6 +1,8 @@ using Ryujinx.HLE.Logging; using Ryujinx.HLE.OsHle.Ipc; +using System; using System.Collections.Generic; +using System.IO; namespace Ryujinx.HLE.OsHle.Services.FspSrv { @@ -19,11 +21,11 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv { 22, CreateSaveDataFileSystem }, { 51, OpenSaveDataFileSystem }, { 200, OpenDataStorageByCurrentProcess }, + { 202, OpenDataStorageByDataId }, { 203, OpenPatchDataStorageByCurrentProcess }, { 1005, GetGlobalAccessLogMode } }; } - public long SetCurrentProcess(ServiceCtx Context) { return 0; @@ -57,6 +59,31 @@ namespace Ryujinx.HLE.OsHle.Services.FspSrv return 0; } + public long OpenDataStorageByDataId(ServiceCtx Context) + { + StorageTypes StorageId = (StorageTypes) Context.RequestData.ReadByte(); + long TitleId = Context.RequestData.ReadInt64(); + + if (StorageId == StorageTypes.NandSystem) + { + Context.Ns.Log.PrintStub(LogClass.ServiceFs, $"[{StorageId}] Stubbed."); + + Stream FakeStream = new MemoryStream(); + + MakeObject(Context, new IStorage(FakeStream)); + } + else + { + Context.Ns.Log.PrintWarning(LogClass.ServiceFs, $"{StorageId} is not implemented!"); + + Stream FakeStream = new MemoryStream(); + + MakeObject(Context, new IStorage(FakeStream)); + } + + return 0; + } + public long OpenPatchDataStorageByCurrentProcess(ServiceCtx Context) { MakeObject(Context, new IStorage(Context.Ns.VFs.RomFs)); diff --git a/Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs b/Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs new file mode 100644 index 0000000000..0ce1162c76 --- /dev/null +++ b/Ryujinx.HLE/OsHle/Services/FspSrv/StorageTypes.cs @@ -0,0 +1,12 @@ +namespace Ryujinx.HLE.OsHle.Services.FspSrv +{ + enum StorageTypes + { + None, + Host, + GameCard, + NandSystem, + NandUser, + SdCard + } +}