From b12017344aad69ab9ac88418f5e793468a09a506 Mon Sep 17 00:00:00 2001 From: David Marcec Date: Tue, 10 Jul 2018 14:39:18 +1000 Subject: [PATCH] GetConfig will now check settings only if nv!rmos_set_production_mode is set to "0" --- .../Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs | 18 ++++++++++++++++++ Ryujinx.HLE/OsHle/Services/Nv/NvResult.cs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Ryujinx.HLE/OsHle/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs b/Ryujinx.HLE/OsHle/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs index fc6ac6e92d..b25ed9a5d5 100644 --- a/Ryujinx.HLE/OsHle/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs +++ b/Ryujinx.HLE/OsHle/Services/Nv/NvHostCtrl/NvHostCtrlIoctl.cs @@ -9,10 +9,15 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl class NvHostCtrlIoctl { private static ConcurrentDictionary UserCtxs; + private static bool IsProductionMode = true; static NvHostCtrlIoctl() { UserCtxs = new ConcurrentDictionary(); + if(Set.NxSettings.Settings.ContainsKey("nv!rmos_set_production_mode")) + { + IsProductionMode = Set.NxSettings.Settings["nv!rmos_set_production_mode"].ToString() != "0"; // Default value is "" + } } public static int ProcessIoctl(ServiceCtx Context, int Cmd) @@ -71,6 +76,19 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl private static int GetConfig(ServiceCtx Context) { + if (!IsProductionMode) + { + long InputPosition = Context.Request.GetBufferType0x21().Position; + long OutputPosition = Context.Request.GetBufferType0x22().Position; + + string Nv = AMemoryHelper.ReadAsciiString(Context.Memory, InputPosition + 0, 0x41); + string Name = AMemoryHelper.ReadAsciiString(Context.Memory, InputPosition + 0x41, 0x41); + + Context.Memory.WriteByte(OutputPosition + 0x82, (byte)'0'); + + Context.Ns.Log.PrintStub(LogClass.ServiceNv, "Stubbed."); + return NvResult.Success; + } return NvResult.NotAvailableInProduction; } diff --git a/Ryujinx.HLE/OsHle/Services/Nv/NvResult.cs b/Ryujinx.HLE/OsHle/Services/Nv/NvResult.cs index 0316e6d407..78ae5ae33b 100644 --- a/Ryujinx.HLE/OsHle/Services/Nv/NvResult.cs +++ b/Ryujinx.HLE/OsHle/Services/Nv/NvResult.cs @@ -2,7 +2,7 @@ namespace Ryujinx.HLE.OsHle.Services.Nv { static class NvResult { - public const int NotAvailableInProduction = 196614, + public const int NotAvailableInProduction = 196614; public const int Success = 0; public const int TryAgain = -11; public const int OutOfMemory = -12;