diff --git a/src/LibRyujinx/JniExportedMethods.cs b/src/LibRyujinx/JniExportedMethods.cs index 55bb2e42a..b2f98c9fe 100644 --- a/src/LibRyujinx/JniExportedMethods.cs +++ b/src/LibRyujinx/JniExportedMethods.cs @@ -21,6 +21,7 @@ using Microsoft.Win32.SafeHandles; using Newtonsoft.Json.Linq; using System.Security.Cryptography; using LibHac.Tools.Fs; +using Ryujinx.HLE.HOS.SystemState; namespace LibRyujinx { @@ -90,9 +91,29 @@ namespace LibRyujinx } [UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_deviceInitialize")] - public static JBoolean JniInitializeDeviceNative(JEnvRef jEnv, JObjectLocalRef jObj, JBoolean isHostMapped, JBoolean useNce) + public static JBoolean JniInitializeDeviceNative(JEnvRef jEnv, + JObjectLocalRef jObj, + JBoolean isHostMapped, + JBoolean useNce, + JInt systemLanguage, + JInt regionCode, + JBoolean enableVsync, + JBoolean enableDockedMode, + JBoolean enablePtc, + JBoolean enableInternetAccess, + JStringLocalRef timeZone, + JBoolean ignoreMissingServices) { - return InitializeDevice(isHostMapped, useNce); + return InitializeDevice(isHostMapped, + useNce, + (SystemLanguage)(int)systemLanguage, + (RegionCode)(int)regionCode, + enableVsync, + enableDockedMode, + enablePtc, + enableInternetAccess, + GetString(jEnv, timeZone), + ignoreMissingServices); } [UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_deviceGetGameStats")] diff --git a/src/LibRyujinx/LibRyujinx.Device.cs b/src/LibRyujinx/LibRyujinx.Device.cs index fdfa60642..cdd805172 100644 --- a/src/LibRyujinx/LibRyujinx.Device.cs +++ b/src/LibRyujinx/LibRyujinx.Device.cs @@ -1,5 +1,6 @@ using ARMeilleure.Translation; using Ryujinx.Common.Logging; +using Ryujinx.HLE.HOS.SystemState; using System; using System.Collections.Generic; using System.IO; @@ -15,17 +16,35 @@ namespace LibRyujinx [UnmanagedCallersOnly(EntryPoint = "device_initialize")] public static bool InitializeDeviceNative() { - return InitializeDevice(true, false); + return InitializeDevice(true, false, SystemLanguage.AmericanEnglish, RegionCode.USA, true, true, true, false, "UTC", false); } - public static bool InitializeDevice(bool isHostMapped, bool useNce) + public static bool InitializeDevice(bool isHostMapped, + bool useNce, + SystemLanguage systemLanguage, + RegionCode regionCode, + bool enableVsync, + bool enableDockedMode, + bool enablePtc, + bool enableInternetAccess, + string timeZone, + bool ignoreMissingServices) { if (SwitchDevice == null) { return false; } - return SwitchDevice.InitializeContext(isHostMapped, useNce); + return SwitchDevice.InitializeContext(isHostMapped, + useNce, + systemLanguage, + regionCode, + enableVsync, + enableDockedMode, + enablePtc, + enableInternetAccess, + timeZone, + ignoreMissingServices); } [UnmanagedCallersOnly(EntryPoint = "device_load")] diff --git a/src/LibRyujinx/LibRyujinx.cs b/src/LibRyujinx/LibRyujinx.cs index 7ad604b95..4d2097e02 100644 --- a/src/LibRyujinx/LibRyujinx.cs +++ b/src/LibRyujinx/LibRyujinx.cs @@ -538,9 +538,18 @@ namespace LibRyujinx UserChannelPersistence = new UserChannelPersistence(); } - public bool InitializeContext(bool isHostMapped, bool useNce) + public bool InitializeContext(bool isHostMapped, + bool useNce, + SystemLanguage systemLanguage, + RegionCode regionCode, + bool enableVsync, + bool enableDockedMode, + bool enablePtc, + bool enableInternetAccess, + string timeZone, + bool ignoreMissingServices) { - if(LibRyujinx.Renderer == null) + if (LibRyujinx.Renderer == null) { return false; } @@ -564,21 +573,21 @@ namespace LibRyujinx LibRyujinx.AudioDriver, //Audio MemoryConfiguration.MemoryConfiguration4GiB, null, - SystemLanguage.AmericanEnglish, - RegionCode.USA, - true, - true, - true, - false, + systemLanguage, + regionCode, + enableVsync, + enableDockedMode, + enablePtc, + enableInternetAccess, IntegrityCheckLevel.None, 0, 0, - "UTC", + timeZone, isHostMapped ? MemoryManagerMode.HostMappedUnsafe : MemoryManagerMode.SoftwarePageTable, - false, + ignoreMissingServices, LibRyujinx.GraphicsConfiguration.AspectRatio, 100, - true, + useNce, ""); EmulationContext = new Switch(configuration);