add SIGBUS breakpoint

This commit is contained in:
Stossy11 2024-11-25 19:55:59 +11:00
parent 8e229fe454
commit c4c71a4cb6
6 changed files with 64 additions and 68 deletions

View File

@ -75,7 +75,6 @@
Dependencies/XCFrameworks/libavutil.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, ); Dependencies/XCFrameworks/libavutil.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, );
Dependencies/XCFrameworks/libswresample.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, ); Dependencies/XCFrameworks/libswresample.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, );
Dependencies/XCFrameworks/libswscale.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, ); Dependencies/XCFrameworks/libswscale.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, );
Dependencies/XCFrameworks/libteakra.xcframework = (CodeSignOnCopy, RemoveHeadersOnCopy, );
}; };
buildPhase = 4E80AA092CD6FAA800029585 /* Embed Libraries */; buildPhase = 4E80AA092CD6FAA800029585 /* Embed Libraries */;
membershipExceptions = ( membershipExceptions = (
@ -90,7 +89,6 @@
Dependencies/XCFrameworks/libSPIRV.xcframework, Dependencies/XCFrameworks/libSPIRV.xcframework,
Dependencies/XCFrameworks/libswresample.xcframework, Dependencies/XCFrameworks/libswresample.xcframework,
Dependencies/XCFrameworks/libswscale.xcframework, Dependencies/XCFrameworks/libswscale.xcframework,
Dependencies/XCFrameworks/libteakra.xcframework,
Dependencies/XCFrameworks/MoltenVK.xcframework, Dependencies/XCFrameworks/MoltenVK.xcframework,
Dependencies/XCFrameworks/SDL2.xcframework, Dependencies/XCFrameworks/SDL2.xcframework,
); );
@ -496,7 +494,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportsDocumentBrowser = YES; INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0; IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -572,7 +570,7 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportsDocumentBrowser = YES; INFOPLIST_KEY_UISupportsDocumentBrowser = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.0; IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

View File

@ -23,7 +23,13 @@
<BreakpointActionProxy <BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand"> ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent <ActionContent
consoleCommand = "process handle -s false -n false"> consoleCommand = "process handle SIGUSR1 -s false -n false">
</ActionContent>
</BreakpointActionProxy>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "process handle SIGBUS -s false -n false">
</ActionContent> </ActionContent>
</BreakpointActionProxy> </BreakpointActionProxy>
</Actions> </Actions>
@ -45,30 +51,5 @@
landmarkType = "7"> landmarkType = "7">
</BreakpointContent> </BreakpointContent>
</BreakpointProxy> </BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "900AC928-2B0F-4BBE-A47D-D6B17570E9BB"
shouldBeEnabled = "Yes"
nameForDebugger = "SIGUSR1-Disable"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
filePath = "MeloNX/Views/ContentView.swift"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "133"
endingLineNumber = "133"
landmarkName = "start(displayid:)"
landmarkType = "7">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "process handle --stop false SIGUSR1">
</ActionContent>
</BreakpointActionProxy>
</Actions>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints> </Breakpoints>
</Bucket> </Bucket>

View File

@ -15,6 +15,20 @@ struct Controller: Identifiable, Hashable {
let name: String let name: String
} }
struct iOSNav<Content: View>: View {
@ViewBuilder var content: () -> Content
var body: some View {
if #available(iOS 16, *) {
NavigationStack(root: content)
} else {
NavigationView(content: content)
.navigationViewStyle(StackNavigationViewStyle())
.navigationViewStyle(.stack)
}
}
}
class Ryujinx { class Ryujinx {
private var isRunning = false private var isRunning = false
@ -40,7 +54,7 @@ class Ryujinx {
tracelogs: Bool = false, tracelogs: Bool = false,
listinputids: Bool = false, listinputids: Bool = false,
fullscreen: Bool = false, fullscreen: Bool = false,
hostMappedMemory: Bool = false, hostMappedMemory: Bool = true,
disableVSync: Bool = true, disableVSync: Bool = true,
disableShaderCache: Bool = false, disableShaderCache: Bool = false,
disableDockedMode: Bool = true, disableDockedMode: Bool = true,

View File

@ -11,7 +11,8 @@ import GameController
struct MoltenVKSettings: Codable, Hashable { struct MoltenVKSettings: Codable, Hashable {
let string: String let string: String
var value: String var bool: Bool?
var value: String?
} }
struct ContentView: View { struct ContentView: View {
@ -22,11 +23,11 @@ struct ContentView: View {
@State var currentControllers: [Controller] = [] @State var currentControllers: [Controller] = []
@State var config: Ryujinx.Configuration = Ryujinx.Configuration(gamepath: "") @State var config: Ryujinx.Configuration = Ryujinx.Configuration(gamepath: "")
@State private var settings: [MoltenVKSettings] = [ @State var settings: [MoltenVKSettings] = [
MoltenVKSettings(string: "MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS", value: "0"), // MoltenVKSettings(string: "MVK_CONFIG_SYNCHRONOUS_QUEUE_SUBMITS", value: ""),
MoltenVKSettings(string: "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS", value: "0"), // MoltenVKSettings(string: "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS", value: "1"),
MoltenVKSettings(string: "MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE", value: "1024"), MoltenVKSettings(string: "MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE", value: "1024"),
MoltenVKSettings(string: "MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS", value: "0"), MoltenVKSettings(string: "MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS", value: "1"),
MoltenVKSettings(string: "MVK_CONFIG_RESUME_LOST_DEVICE", value: "1") MoltenVKSettings(string: "MVK_CONFIG_RESUME_LOST_DEVICE", value: "1")
] ]
@ -58,7 +59,7 @@ struct ContentView: View {
} }
var body: some View { var body: some View {
NavigationStack { iOSNav {
if let game { if let game {
ZStack { ZStack {
@ -80,7 +81,7 @@ struct ContentView: View {
List { List {
Section("Settings") { Section("Settings") {
NavigationLink { NavigationLink {
SettingsView(config: $config) SettingsView(config: $config, MoltenVKSettings: $settings)
} label: { } label: {
Text("Config") Text("Config")
} }
@ -146,7 +147,7 @@ struct ContentView: View {
let physicalMemory = ProcessInfo.processInfo.physicalMemory let physicalMemory = ProcessInfo.processInfo.physicalMemory
let totalMemoryInGB = Double(physicalMemory) / (1024 * 1024 * 1024) let totalMemoryInGB = Double(physicalMemory) / (1024 * 1024 * 1024)
let mem = totalMemoryInGB - 1 let mem = totalMemoryInGB
print(mem) print(mem)
// Allocate memory // Allocate memory
let pointer = UnsafeMutableRawPointer.allocate(byteCount: Int(mem), alignment: MemoryLayout<UInt8>.alignment) let pointer = UnsafeMutableRawPointer.allocate(byteCount: Int(mem), alignment: MemoryLayout<UInt8>.alignment)

View File

@ -9,39 +9,41 @@ import SwiftUI
struct SettingsView: View { struct SettingsView: View {
@Binding var config: Ryujinx.Configuration @Binding var config: Ryujinx.Configuration
@Binding var MoltenVKSettings: [MoltenVKSettings]
var body: some View { var body: some View {
Form { Form {
Section(header: Text("Ryujinx")) {
Section(header: Text("Graphics and Performance")) { Section(header: Text("Graphics and Performance")) {
Toggle("Fullscreen", isOn: $config.fullscreen) Toggle("Fullscreen", isOn: $config.fullscreen)
Toggle("Disable V-Sync", isOn: $config.disableVSync) Toggle("Disable V-Sync", isOn: $config.disableVSync)
Toggle("Disable Shader Cache", isOn: $config.disableShaderCache) Toggle("Disable Shader Cache", isOn: $config.disableShaderCache)
Toggle("Enable Texture Recompression", isOn: $config.enableTextureRecompression) Toggle("Enable Texture Recompression", isOn: $config.enableTextureRecompression)
} }
Section(header: Text("Input Settings")) {
Toggle("List Input IDs", isOn: $config.listinputids)
Toggle("Host Mapped Memory", isOn: $config.hostMappedMemory)
Toggle("Disable Docked Mode", isOn: $config.disableDockedMode)
}
Section(header: Text("Logging Settings")) {
Toggle("Enable Debug Logs", isOn: $config.debuglogs)
Toggle("Enable Trace Logs", isOn: $config.tracelogs)
}
Section(header: Text("Game Settings")) {
//TextField("Game Path", text: $config.gamepath)
TextField("Additional Arguments", text: Binding( Section(header: Text("Input Settings")) {
get: { Toggle("List Input IDs", isOn: $config.listinputids)
config.additionalArgs.joined(separator: ", ") Toggle("Host Mapped Memory", isOn: $config.hostMappedMemory)
}, Toggle("Disable Docked Mode", isOn: $config.disableDockedMode)
set: { newValue in }
config.additionalArgs = newValue.split(separator: ",").map { String($0).trimmingCharacters(in: .whitespaces) }
} Section(header: Text("Logging Settings")) {
)) Toggle("Enable Debug Logs", isOn: $config.debuglogs)
Toggle("Enable Trace Logs", isOn: $config.tracelogs)
}
Section(header: Text("Game Settings")) {
//TextField("Game Path", text: $config.gamepath)
TextField("Additional Arguments", text: Binding(
get: {
config.additionalArgs.joined(separator: ", ")
},
set: { newValue in
config.additionalArgs = newValue.split(separator: ",").map { String($0).trimmingCharacters(in: .whitespaces) }
}
))
}
} }
} }
.onAppear { .onAppear {