forked from MeloNX/MeloNX
add more parameters to initialize device
This commit is contained in:
parent
28eb812018
commit
2d39deba26
@ -21,6 +21,7 @@ using Microsoft.Win32.SafeHandles;
|
|||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using LibHac.Tools.Fs;
|
using LibHac.Tools.Fs;
|
||||||
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
|
|
||||||
namespace LibRyujinx
|
namespace LibRyujinx
|
||||||
{
|
{
|
||||||
@ -90,9 +91,29 @@ namespace LibRyujinx
|
|||||||
}
|
}
|
||||||
|
|
||||||
[UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_deviceInitialize")]
|
[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")]
|
[UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_deviceGetGameStats")]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using ARMeilleure.Translation;
|
using ARMeilleure.Translation;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
|
using Ryujinx.HLE.HOS.SystemState;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -15,17 +16,35 @@ namespace LibRyujinx
|
|||||||
[UnmanagedCallersOnly(EntryPoint = "device_initialize")]
|
[UnmanagedCallersOnly(EntryPoint = "device_initialize")]
|
||||||
public static bool InitializeDeviceNative()
|
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)
|
if (SwitchDevice == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SwitchDevice.InitializeContext(isHostMapped, useNce);
|
return SwitchDevice.InitializeContext(isHostMapped,
|
||||||
|
useNce,
|
||||||
|
systemLanguage,
|
||||||
|
regionCode,
|
||||||
|
enableVsync,
|
||||||
|
enableDockedMode,
|
||||||
|
enablePtc,
|
||||||
|
enableInternetAccess,
|
||||||
|
timeZone,
|
||||||
|
ignoreMissingServices);
|
||||||
}
|
}
|
||||||
|
|
||||||
[UnmanagedCallersOnly(EntryPoint = "device_load")]
|
[UnmanagedCallersOnly(EntryPoint = "device_load")]
|
||||||
|
@ -538,9 +538,18 @@ namespace LibRyujinx
|
|||||||
UserChannelPersistence = new UserChannelPersistence();
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
@ -564,21 +573,21 @@ namespace LibRyujinx
|
|||||||
LibRyujinx.AudioDriver, //Audio
|
LibRyujinx.AudioDriver, //Audio
|
||||||
MemoryConfiguration.MemoryConfiguration4GiB,
|
MemoryConfiguration.MemoryConfiguration4GiB,
|
||||||
null,
|
null,
|
||||||
SystemLanguage.AmericanEnglish,
|
systemLanguage,
|
||||||
RegionCode.USA,
|
regionCode,
|
||||||
true,
|
enableVsync,
|
||||||
true,
|
enableDockedMode,
|
||||||
true,
|
enablePtc,
|
||||||
false,
|
enableInternetAccess,
|
||||||
IntegrityCheckLevel.None,
|
IntegrityCheckLevel.None,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
"UTC",
|
timeZone,
|
||||||
isHostMapped ? MemoryManagerMode.HostMappedUnsafe : MemoryManagerMode.SoftwarePageTable,
|
isHostMapped ? MemoryManagerMode.HostMappedUnsafe : MemoryManagerMode.SoftwarePageTable,
|
||||||
false,
|
ignoreMissingServices,
|
||||||
LibRyujinx.GraphicsConfiguration.AspectRatio,
|
LibRyujinx.GraphicsConfiguration.AspectRatio,
|
||||||
100,
|
100,
|
||||||
true,
|
useNce,
|
||||||
"");
|
"");
|
||||||
|
|
||||||
EmulationContext = new Switch(configuration);
|
EmulationContext = new Switch(configuration);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user