forked from MeloNX/MeloNX
Hypervisor
This commit is contained in:
parent
5ee90c81e9
commit
9ce29d6ad1
46
MeloNX-hv.entitlements
Normal file
46
MeloNX-hv.entitlements
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>get-task-allow</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.developer.kernel.increased-memory-limit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.developer.kernel.extended-virtual-addressing</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.iokit.IOServiceSetAuthorizationID</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.exception.iokit-user-client-class</key>
|
||||||
|
<array>
|
||||||
|
<string>AGXCommandQueue</string>
|
||||||
|
<string>AGXDevice</string>
|
||||||
|
<string>AGXDeviceUserClient</string>
|
||||||
|
<string>AGXSharedUserClient</string>
|
||||||
|
<string>AppleUSBHostDeviceUserClient</string>
|
||||||
|
<string>AppleUSBHostInterfaceUserClient</string>
|
||||||
|
<string>IOSurfaceRootUserClient</string>
|
||||||
|
<string>IOAccelContext</string>
|
||||||
|
<string>IOAccelContext2</string>
|
||||||
|
<string>IOAccelDevice</string>
|
||||||
|
<string>IOAccelDevice2</string>
|
||||||
|
<string>IOAccelSharedUserClient</string>
|
||||||
|
<string>IOAccelSharedUserClient2</string>
|
||||||
|
<string>IOAccelSubmitter2</string>
|
||||||
|
</array>
|
||||||
|
<key>com.apple.system.diagnostics.iokit-properties</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.vm.device-access</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.hypervisor</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.memorystatus</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.security.no-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.security.storage.AppDataContainers</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.private.security.storage.MobileDocuments</key>
|
||||||
|
<true/>
|
||||||
|
<key>platform-application</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -18,7 +18,7 @@ namespace ARMeilleure.Translation.Cache
|
|||||||
private static readonly int _pageMask = _pageSize - 8;
|
private static readonly int _pageMask = _pageSize - 8;
|
||||||
|
|
||||||
private const int CodeAlignment = 4; // Bytes.
|
private const int CodeAlignment = 4; // Bytes.
|
||||||
private const int CacheSize = 2047 * 1024 * 1024;
|
private const int CacheSize = 128 * 1024 * 1024;
|
||||||
private const int CacheSizeIOS = 64 * 1024 * 1024;
|
private const int CacheSizeIOS = 64 * 1024 * 1024;
|
||||||
|
|
||||||
private static ReservedRegion _jitRegion;
|
private static ReservedRegion _jitRegion;
|
||||||
|
@ -627,6 +627,7 @@
|
|||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
);
|
);
|
||||||
GCC_OPTIMIZATION_LEVEL = fast;
|
GCC_OPTIMIZATION_LEVEL = fast;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
@ -863,6 +864,7 @@
|
|||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
|
"$(PROJECT_DIR)/MeloNX/Dependencies/Dynamic\\ Libraries",
|
||||||
);
|
);
|
||||||
GCC_OPTIMIZATION_LEVEL = fast;
|
GCC_OPTIMIZATION_LEVEL = fast;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
Binary file not shown.
@ -52,6 +52,7 @@ class Ryujinx {
|
|||||||
var fullscreen: Bool
|
var fullscreen: Bool
|
||||||
var memoryManagerMode: String
|
var memoryManagerMode: String
|
||||||
var disableShaderCache: Bool
|
var disableShaderCache: Bool
|
||||||
|
var hypervisor: Bool
|
||||||
var disableDockedMode: Bool
|
var disableDockedMode: Bool
|
||||||
var enableTextureRecompression: Bool
|
var enableTextureRecompression: Bool
|
||||||
var additionalArgs: [String]
|
var additionalArgs: [String]
|
||||||
@ -63,14 +64,15 @@ class Ryujinx {
|
|||||||
tracelogs: Bool = false,
|
tracelogs: Bool = false,
|
||||||
listinputids: Bool = false,
|
listinputids: Bool = false,
|
||||||
fullscreen: Bool = false,
|
fullscreen: Bool = false,
|
||||||
memoryManagerMode: String = "HostMapped",
|
memoryManagerMode: String = "HostMappedUnsafe",
|
||||||
disableShaderCache: Bool = false,
|
disableShaderCache: Bool = false,
|
||||||
disableDockedMode: Bool = false,
|
disableDockedMode: Bool = false,
|
||||||
nintendoinput: Bool = true,
|
nintendoinput: Bool = true,
|
||||||
enableInternet: Bool = false,
|
enableInternet: Bool = false,
|
||||||
enableTextureRecompression: Bool = true,
|
enableTextureRecompression: Bool = true,
|
||||||
additionalArgs: [String] = [],
|
additionalArgs: [String] = [],
|
||||||
resscale: Float = 1.00
|
resscale: Float = 1.00,
|
||||||
|
hypervisor: Bool = false
|
||||||
) {
|
) {
|
||||||
self.gamepath = gamepath
|
self.gamepath = gamepath
|
||||||
self.inputids = inputids
|
self.inputids = inputids
|
||||||
@ -86,6 +88,7 @@ class Ryujinx {
|
|||||||
self.resscale = resscale
|
self.resscale = resscale
|
||||||
self.nintendoinput = nintendoinput
|
self.nintendoinput = nintendoinput
|
||||||
self.enableInternet = enableInternet
|
self.enableInternet = enableInternet
|
||||||
|
self.hypervisor = hypervisor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,6 +173,10 @@ class Ryujinx {
|
|||||||
|
|
||||||
// args.append("--disable-vsync")
|
// args.append("--disable-vsync")
|
||||||
|
|
||||||
|
if config.hypervisor {
|
||||||
|
args.append("--use-hypervisor")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if config.resscale != 1.0 {
|
if config.resscale != 1.0 {
|
||||||
args.append(contentsOf: ["--resolution-scale", String(config.resscale)])
|
args.append(contentsOf: ["--resolution-scale", String(config.resscale)])
|
||||||
|
@ -39,36 +39,36 @@ struct SettingsView: View {
|
|||||||
return memoryManagerModes.filter { $0.1.localizedCaseInsensitiveContains(searchText) }
|
return memoryManagerModes.filter { $0.1.localizedCaseInsensitiveContains(searchText) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
iOSNav {
|
iOSNav {
|
||||||
List {
|
List {
|
||||||
|
|
||||||
|
|
||||||
// Graphics & Performance
|
// Graphics & Performance
|
||||||
Section {
|
Section {
|
||||||
Toggle(isOn: $config.fullscreen) {
|
Toggle(isOn: $config.fullscreen) {
|
||||||
labelWithIcon("Fullscreen", iconName: "rectangle.expand.vertical")
|
labelWithIcon("Fullscreen", iconName: "rectangle.expand.vertical")
|
||||||
}
|
}
|
||||||
.tint(.blue)
|
.tint(.blue)
|
||||||
|
|
||||||
Toggle(isOn: $config.disableShaderCache) {
|
Toggle(isOn: $config.disableShaderCache) {
|
||||||
labelWithIcon("Shader Cache", iconName: "memorychip")
|
labelWithIcon("Shader Cache", iconName: "memorychip")
|
||||||
}
|
}
|
||||||
.tint(.blue)
|
.tint(.blue)
|
||||||
|
|
||||||
Toggle(isOn: $config.enableTextureRecompression) {
|
Toggle(isOn: $config.enableTextureRecompression) {
|
||||||
labelWithIcon("Texture Recompression", iconName: "rectangle.compress.vertical")
|
labelWithIcon("Texture Recompression", iconName: "rectangle.compress.vertical")
|
||||||
}
|
}
|
||||||
.tint(.blue)
|
.tint(.blue)
|
||||||
|
|
||||||
Toggle(isOn: $config.disableDockedMode) {
|
Toggle(isOn: $config.disableDockedMode) {
|
||||||
labelWithIcon("Docked Mode", iconName: "dock.rectangle")
|
labelWithIcon("Docked Mode", iconName: "dock.rectangle")
|
||||||
}
|
}
|
||||||
.tint(.blue)
|
.tint(.blue)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 10) {
|
VStack(alignment: .leading, spacing: 10) {
|
||||||
HStack {
|
HStack {
|
||||||
labelWithIcon("Resolution Scale", iconName: "magnifyingglass")
|
labelWithIcon("Resolution Scale", iconName: "magnifyingglass")
|
||||||
@ -91,7 +91,7 @@ struct SettingsView: View {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Slider(value: $config.resscale, in: 0.1...3.0, step: 0.1) {
|
Slider(value: $config.resscale, in: 0.1...3.0, step: 0.1) {
|
||||||
Text("Resolution Scale")
|
Text("Resolution Scale")
|
||||||
} minimumValueLabel: {
|
} minimumValueLabel: {
|
||||||
@ -108,7 +108,7 @@ struct SettingsView: View {
|
|||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
.padding(.vertical, 8)
|
.padding(.vertical, 8)
|
||||||
|
|
||||||
Toggle(isOn: $performacehud) {
|
Toggle(isOn: $performacehud) {
|
||||||
labelWithIcon("Performance Overlay", iconName: "speedometer")
|
labelWithIcon("Performance Overlay", iconName: "speedometer")
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ struct SettingsView: View {
|
|||||||
} footer: {
|
} footer: {
|
||||||
Text("Select input devices and on-screen controls to play with. ")
|
Text("Select input devices and on-screen controls to play with. ")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Input Settings
|
// Input Settings
|
||||||
Section {
|
Section {
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ struct SettingsView: View {
|
|||||||
labelWithIcon("List Input IDs", iconName: "list.bullet")
|
labelWithIcon("List Input IDs", iconName: "list.bullet")
|
||||||
}
|
}
|
||||||
.tint(.blue)
|
.tint(.blue)
|
||||||
|
|
||||||
Toggle(isOn: $ryuDemo) {
|
Toggle(isOn: $ryuDemo) {
|
||||||
labelWithIcon("On-Screen Controller (Demo)", iconName: "hand.draw")
|
labelWithIcon("On-Screen Controller (Demo)", iconName: "hand.draw")
|
||||||
}
|
}
|
||||||
@ -229,6 +229,28 @@ struct SettingsView: View {
|
|||||||
labelWithIcon("Memory Manager Mode", iconName: "gearshape")
|
labelWithIcon("Memory Manager Mode", iconName: "gearshape")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let cpuInfo = getCPUInfo(), cpuInfo.hasPrefix("Apple M") {
|
||||||
|
if #available (iOS 16.4, *), (false) {
|
||||||
|
Toggle(isOn: .constant(false)) {
|
||||||
|
labelWithIcon("Hypervisor", iconName: "bolt.fill")
|
||||||
|
}
|
||||||
|
.tint(.blue)
|
||||||
|
.disabled(true)
|
||||||
|
.onAppear() {
|
||||||
|
print("CPU Info: \(cpuInfo)")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toggle(isOn: $config.hypervisor) {
|
||||||
|
labelWithIcon("Hypervisor", iconName: "bolt.fill")
|
||||||
|
}
|
||||||
|
.tint(.blue)
|
||||||
|
.onAppear() {
|
||||||
|
print("CPU Info: \(cpuInfo)")
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} header: {
|
} header: {
|
||||||
Text("CPU Mode")
|
Text("CPU Mode")
|
||||||
.font(.title3.weight(.semibold))
|
.font(.title3.weight(.semibold))
|
||||||
@ -237,8 +259,8 @@ struct SettingsView: View {
|
|||||||
} footer: {
|
} footer: {
|
||||||
Text("Select how memory is managed. 'Host (fast)' is best for most users.")
|
Text("Select how memory is managed. 'Host (fast)' is best for most users.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Other Settings
|
// Other Settings
|
||||||
Section {
|
Section {
|
||||||
|
|
||||||
@ -251,7 +273,7 @@ struct SettingsView: View {
|
|||||||
labelWithIcon("Debug Logs", iconName: "exclamationmark.bubble")
|
labelWithIcon("Debug Logs", iconName: "exclamationmark.bubble")
|
||||||
}
|
}
|
||||||
.tint(.blue)
|
.tint(.blue)
|
||||||
|
|
||||||
Toggle(isOn: $config.tracelogs) {
|
Toggle(isOn: $config.tracelogs) {
|
||||||
labelWithIcon("Trace Logs", iconName: "waveform.path")
|
labelWithIcon("Trace Logs", iconName: "waveform.path")
|
||||||
}
|
}
|
||||||
@ -264,11 +286,11 @@ struct SettingsView: View {
|
|||||||
} footer: {
|
} footer: {
|
||||||
Text("Enable logs for troubleshooting and Enable automatic TrollStore JIT.")
|
Text("Enable logs for troubleshooting and Enable automatic TrollStore JIT.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Advanced
|
// Advanced
|
||||||
Section {
|
Section {
|
||||||
DisclosureGroup {
|
DisclosureGroup {
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
labelWithIcon("Page Size", iconName: "textformat.size")
|
labelWithIcon("Page Size", iconName: "textformat.size")
|
||||||
Spacer()
|
Spacer()
|
||||||
@ -276,7 +298,7 @@ struct SettingsView: View {
|
|||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField("Additional Arguments", text: Binding(
|
TextField("Additional Arguments", text: Binding(
|
||||||
get: {
|
get: {
|
||||||
config.additionalArgs.joined(separator: " ")
|
config.additionalArgs.joined(separator: " ")
|
||||||
@ -352,6 +374,15 @@ struct SettingsView: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getCPUInfo() -> String? {
|
||||||
|
let device = MTLCreateSystemDefaultDevice()
|
||||||
|
|
||||||
|
let gpu = device?.name
|
||||||
|
print("GPU: " + (gpu ?? ""))
|
||||||
|
return gpu
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Original loadSettings function assumed to exist
|
// Original loadSettings function assumed to exist
|
||||||
func loadSettings() -> Ryujinx.Configuration? {
|
func loadSettings() -> Ryujinx.Configuration? {
|
||||||
|
|
||||||
|
BIN
src/MeloNX/MeloNX/Dependencies/Dynamic Libraries/Hypervisor.framework/Hypervisor
Executable file
BIN
src/MeloNX/MeloNX/Dependencies/Dynamic Libraries/Hypervisor.framework/Hypervisor
Executable file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>files</key>
|
||||||
|
<dict>
|
||||||
|
<key>Info.plist</key>
|
||||||
|
<data>
|
||||||
|
kW04s165Fr3AhY1rHcISuPzpuPA=
|
||||||
|
</data>
|
||||||
|
</dict>
|
||||||
|
<key>files2</key>
|
||||||
|
<dict/>
|
||||||
|
<key>rules</key>
|
||||||
|
<dict>
|
||||||
|
<key>^.*</key>
|
||||||
|
<true/>
|
||||||
|
<key>^.*\.lproj/</key>
|
||||||
|
<dict>
|
||||||
|
<key>optional</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1000</real>
|
||||||
|
</dict>
|
||||||
|
<key>^.*\.lproj/locversion.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1100</real>
|
||||||
|
</dict>
|
||||||
|
<key>^Base\.lproj/</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1010</real>
|
||||||
|
</dict>
|
||||||
|
<key>^version.plist$</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
<key>rules2</key>
|
||||||
|
<dict>
|
||||||
|
<key>.*\.dSYM($|/)</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>11</real>
|
||||||
|
</dict>
|
||||||
|
<key>^(.*/)?\.DS_Store$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>2000</real>
|
||||||
|
</dict>
|
||||||
|
<key>^.*</key>
|
||||||
|
<true/>
|
||||||
|
<key>^.*\.lproj/</key>
|
||||||
|
<dict>
|
||||||
|
<key>optional</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1000</real>
|
||||||
|
</dict>
|
||||||
|
<key>^.*\.lproj/locversion.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1100</real>
|
||||||
|
</dict>
|
||||||
|
<key>^Base\.lproj/</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>1010</real>
|
||||||
|
</dict>
|
||||||
|
<key>^Info\.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^PkgInfo$</key>
|
||||||
|
<dict>
|
||||||
|
<key>omit</key>
|
||||||
|
<true/>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^embedded\.provisionprofile$</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
<key>^version\.plist$</key>
|
||||||
|
<dict>
|
||||||
|
<key>weight</key>
|
||||||
|
<real>20</real>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -6,6 +6,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvAddressSpace : IDisposable
|
class HvAddressSpace : IDisposable
|
||||||
{
|
{
|
||||||
private const ulong KernelRegionBase = unchecked((ulong)-(1L << 39));
|
private const ulong KernelRegionBase = unchecked((ulong)-(1L << 39));
|
||||||
|
@ -8,6 +8,7 @@ using System.Threading;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvAddressSpaceRange : IDisposable
|
class HvAddressSpaceRange : IDisposable
|
||||||
{
|
{
|
||||||
private const ulong AllocationGranule = 1UL << 14;
|
private const ulong AllocationGranule = 1UL << 14;
|
||||||
|
@ -265,9 +265,10 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
}
|
}
|
||||||
|
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
static partial class HvApi
|
static partial class HvApi
|
||||||
{
|
{
|
||||||
public const string LibraryName = "/System/Library/Frameworks/Hypervisor.framework/Hypervisor";
|
public const string LibraryName = "Hypervisor.framework/Hypervisor";
|
||||||
|
|
||||||
[LibraryImport(LibraryName, SetLastError = true)]
|
[LibraryImport(LibraryName, SetLastError = true)]
|
||||||
public static partial HvResult hv_vm_get_max_vcpu_count(out uint max_vcpu_count);
|
public static partial HvResult hv_vm_get_max_vcpu_count(out uint max_vcpu_count);
|
||||||
|
@ -4,6 +4,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvCpuContext : ICpuContext
|
class HvCpuContext : ICpuContext
|
||||||
{
|
{
|
||||||
private readonly ITickSource _tickSource;
|
private readonly ITickSource _tickSource;
|
||||||
|
@ -3,6 +3,7 @@ using System.Runtime.Versioning;
|
|||||||
|
|
||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
public class HvEngine : ICpuEngine
|
public class HvEngine : ICpuEngine
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,7 @@ using System.Threading;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvExecutionContext : IExecutionContext
|
class HvExecutionContext : IExecutionContext
|
||||||
{
|
{
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
@ -7,6 +7,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvExecutionContextVcpu : IHvExecutionContext
|
class HvExecutionContextVcpu : IHvExecutionContext
|
||||||
{
|
{
|
||||||
private static readonly MemoryBlock _setSimdFpRegFuncMem;
|
private static readonly MemoryBlock _setSimdFpRegFuncMem;
|
||||||
|
@ -5,6 +5,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
readonly struct HvMemoryBlockAllocation : IDisposable
|
readonly struct HvMemoryBlockAllocation : IDisposable
|
||||||
{
|
{
|
||||||
private readonly HvMemoryBlockAllocator _owner;
|
private readonly HvMemoryBlockAllocator _owner;
|
||||||
|
@ -4,6 +4,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvMemoryBlockAllocator : PrivateMemoryAllocatorImpl<HvMemoryBlockAllocator.Block>
|
class HvMemoryBlockAllocator : PrivateMemoryAllocatorImpl<HvMemoryBlockAllocator.Block>
|
||||||
{
|
{
|
||||||
public class Block : PrivateMemoryAllocator.Block
|
public class Block : PrivateMemoryAllocator.Block
|
||||||
|
@ -16,6 +16,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
/// Represents a CPU memory manager which maps guest virtual memory directly onto the Hypervisor page table.
|
/// Represents a CPU memory manager which maps guest virtual memory directly onto the Hypervisor page table.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
public class HvMemoryManager : MemoryManagerBase, IMemoryManager, IVirtualMemoryManagerTracked, IWritableBlock
|
public class HvMemoryManager : MemoryManagerBase, IMemoryManager, IVirtualMemoryManagerTracked, IWritableBlock
|
||||||
{
|
{
|
||||||
public const int PageBits = 12;
|
public const int PageBits = 12;
|
||||||
|
@ -4,6 +4,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
unsafe class HvVcpu
|
unsafe class HvVcpu
|
||||||
{
|
{
|
||||||
private const ulong InterruptIntervalNs = 16 * 1000000; // 16 ms
|
private const ulong InterruptIntervalNs = 16 * 1000000; // 16 ms
|
||||||
|
@ -5,6 +5,7 @@ using System.Threading;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
class HvVcpuPool
|
class HvVcpuPool
|
||||||
{
|
{
|
||||||
// Since there's a limit on the number of VCPUs we can create,
|
// Since there's a limit on the number of VCPUs we can create,
|
||||||
|
@ -5,6 +5,7 @@ using System.Runtime.Versioning;
|
|||||||
namespace Ryujinx.Cpu.AppleHv
|
namespace Ryujinx.Cpu.AppleHv
|
||||||
{
|
{
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
static class HvVm
|
static class HvVm
|
||||||
{
|
{
|
||||||
// This alignment allows us to use larger blocks on the page table.
|
// This alignment allows us to use larger blocks on the page table.
|
||||||
|
@ -10,6 +10,7 @@ namespace Ryujinx.Cpu.AppleHv
|
|||||||
}
|
}
|
||||||
|
|
||||||
[SupportedOSPlatform("macos")]
|
[SupportedOSPlatform("macos")]
|
||||||
|
[SupportedOSPlatform("ios")]
|
||||||
static partial class TimeApi
|
static partial class TimeApi
|
||||||
{
|
{
|
||||||
[LibraryImport("libc", SetLastError = true)]
|
[LibraryImport("libc", SetLastError = true)]
|
||||||
|
@ -313,7 +313,14 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
lock (_queueLock)
|
lock (_queueLock)
|
||||||
{
|
{
|
||||||
_api.QueueSubmit(_queue, 1, sInfo, entry.Fence.GetUnsafe()).ThrowOnError();
|
Result result = _api.QueueSubmit(_queue, 1, sInfo, entry.Fence.GetUnsafe());
|
||||||
|
|
||||||
|
if (result != Result.Success)
|
||||||
|
{
|
||||||
|
|
||||||
|
Console.WriteLine($"QueueSubmit failed with error: {result}");
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
using Ryujinx.Common.Configuration;
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Cpu;
|
using Ryujinx.Cpu;
|
||||||
using Ryujinx.Cpu.AppleHv;
|
using Ryujinx.Cpu.AppleHv;
|
||||||
@ -49,7 +49,7 @@ namespace Ryujinx.HLE.HOS
|
|||||||
|
|
||||||
bool isArm64Host = RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
bool isArm64Host = RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS() && isArm64Host && for64Bit && context.Device.Configuration.UseHypervisor)
|
if ((OperatingSystem.IsMacOS() || (!OperatingSystem.IsIOSVersionAtLeast(16, 4))) && isArm64Host && for64Bit && context.Device.Configuration.UseHypervisor)
|
||||||
{
|
{
|
||||||
var cpuEngine = new HvEngine(_tickSource);
|
var cpuEngine = new HvEngine(_tickSource);
|
||||||
var memoryManager = new HvMemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler);
|
var memoryManager = new HvMemoryManager(context.Memory, addressSpaceSize, invalidAccessHandler);
|
||||||
|
@ -147,8 +147,8 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
[Option("audio-volume", Required = false, Default = 1.0f, HelpText = "The audio level (0 to 1).")]
|
[Option("audio-volume", Required = false, Default = 1.0f, HelpText = "The audio level (0 to 1).")]
|
||||||
public float AudioVolume { get; set; }
|
public float AudioVolume { get; set; }
|
||||||
|
|
||||||
[Option("use-hypervisor", Required = false, Default = true, HelpText = "Uses Hypervisor over JIT if available.")]
|
[Option("use-hypervisor", Required = false, Default = false, HelpText = "Uses Hypervisor over JIT if available.")]
|
||||||
public bool? UseHypervisor { get; set; }
|
public bool UseHypervisor { get; set; }
|
||||||
|
|
||||||
[Option("lan-interface-id", Required = false, Default = "0", HelpText = "GUID for the network interface used by LAN.")]
|
[Option("lan-interface-id", Required = false, Default = "0", HelpText = "GUID for the network interface used by LAN.")]
|
||||||
public string MultiplayerLanInterfaceId { get; set; }
|
public string MultiplayerLanInterfaceId { get; set; }
|
||||||
|
@ -1283,6 +1283,19 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
renderer = new ThreadedRenderer(renderer);
|
renderer = new ThreadedRenderer(renderer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AppleHV = false;
|
||||||
|
|
||||||
|
if ((!OperatingSystem.IsIOSVersionAtLeast(16, 4)) && options.UseHypervisor)
|
||||||
|
{
|
||||||
|
AppleHV = true;
|
||||||
|
}
|
||||||
|
else if (OperatingSystem.IsIOS())
|
||||||
|
{
|
||||||
|
AppleHV = false;
|
||||||
|
} else {
|
||||||
|
AppleHV = options.UseHypervisor;
|
||||||
|
}
|
||||||
|
|
||||||
HLEConfiguration configuration = new(_virtualFileSystem,
|
HLEConfiguration configuration = new(_virtualFileSystem,
|
||||||
_libHacHorizonManager,
|
_libHacHorizonManager,
|
||||||
_contentManager,
|
_contentManager,
|
||||||
@ -1306,7 +1319,7 @@ namespace Ryujinx.Headless.SDL2
|
|||||||
options.IgnoreMissingServices,
|
options.IgnoreMissingServices,
|
||||||
options.AspectRatio,
|
options.AspectRatio,
|
||||||
options.AudioVolume,
|
options.AudioVolume,
|
||||||
options.UseHypervisor ?? false,
|
AppleHV,
|
||||||
options.MultiplayerLanInterfaceId,
|
options.MultiplayerLanInterfaceId,
|
||||||
Common.Configuration.Multiplayer.MultiplayerMode.LdnMitm);
|
Common.Configuration.Multiplayer.MultiplayerMode.LdnMitm);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user