GetConfig will now check settings only if nv!rmos_set_production_mode is set to "0"

This commit is contained in:
David Marcec 2018-07-10 14:39:18 +10:00
parent 90050c3f84
commit b12017344a
2 changed files with 19 additions and 1 deletions

View file

@ -9,10 +9,15 @@ namespace Ryujinx.HLE.OsHle.Services.Nv.NvHostCtrl
class NvHostCtrlIoctl
{
private static ConcurrentDictionary<Process, NvHostCtrlUserCtx> UserCtxs;
private static bool IsProductionMode = true;
static NvHostCtrlIoctl()
{
UserCtxs = new ConcurrentDictionary<Process, NvHostCtrlUserCtx>();
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;
}

View file

@ -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;