diff --git a/src/MeloNX/MeloNX.xcodeproj/project.pbxproj b/src/MeloNX/MeloNX.xcodeproj/project.pbxproj index 83e6dd820..09a4f0c5f 100644 --- a/src/MeloNX/MeloNX.xcodeproj/project.pbxproj +++ b/src/MeloNX/MeloNX.xcodeproj/project.pbxproj @@ -525,8 +525,8 @@ INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UIRequiresFullScreen = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportsDocumentBrowser = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -635,6 +635,10 @@ "$(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", ); MARKETING_VERSION = 0.0.8; PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX; @@ -672,8 +676,8 @@ INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UIRequiresFullScreen = YES; - INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; - INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait"; + INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportsDocumentBrowser = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -782,6 +786,10 @@ "$(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", ); MARKETING_VERSION = 0.0.8; PRODUCT_BUNDLE_IDENTIFIER = com.stossy11.MeloNX; diff --git a/src/MeloNX/MeloNX.xcodeproj/project.xcworkspace/xcuserdata/stossy11.xcuserdatad/UserInterfaceState.xcuserstate b/src/MeloNX/MeloNX.xcodeproj/project.xcworkspace/xcuserdata/stossy11.xcuserdatad/UserInterfaceState.xcuserstate index 208e0d36d..d027a748d 100644 Binary files a/src/MeloNX/MeloNX.xcodeproj/project.xcworkspace/xcuserdata/stossy11.xcuserdatad/UserInterfaceState.xcuserstate and b/src/MeloNX/MeloNX.xcodeproj/project.xcworkspace/xcuserdata/stossy11.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/src/MeloNX/MeloNX/Core/Swift/Controller/VirtualController.swift b/src/MeloNX/MeloNX/Core/Swift/Controller/VirtualController.swift index 3c4a8419e..11415e6d0 100644 --- a/src/MeloNX/MeloNX/Core/Swift/Controller/VirtualController.swift +++ b/src/MeloNX/MeloNX/Core/Swift/Controller/VirtualController.swift @@ -123,7 +123,7 @@ class VirtualController { } func thumbstickMoved(_ stick: ThumbstickType, x: Double, y: Double) { - var scaleFactor = 32767.0 / 160 + let scaleFactor = 32767.0 / 160 let scaledX = Int16(min(32767.0, max(-32768.0, x * scaleFactor))) let scaledY = Int16(min(32767.0, max(-32768.0, y * scaleFactor))) diff --git a/src/MeloNX/MeloNX/Core/Swift/Controller/WaitforVC.swift b/src/MeloNX/MeloNX/Core/Swift/Controller/WaitforVC.swift index eb02333eb..43cf638f7 100644 --- a/src/MeloNX/MeloNX/Core/Swift/Controller/WaitforVC.swift +++ b/src/MeloNX/MeloNX/Core/Swift/Controller/WaitforVC.swift @@ -33,22 +33,21 @@ func waitforcontroller() { } let controllerView = ControllerView() - let hostingController = UIHostingController(rootView: controllerView) - - // Create the custom container + let controllerHostingController = UIHostingController(rootView: controllerView) let containerView = TransparentHostingContainerView(frame: window.bounds) containerView.backgroundColor = .clear - hostingController.view.frame = containerView.bounds - hostingController.view.backgroundColor = .clear - containerView.addSubview(hostingController.view) + controllerHostingController.view.frame = containerView.bounds + controllerHostingController.view.backgroundColor = .clear + containerView.addSubview(controllerHostingController.view) Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { timer in if findGCControllerView(in: window) == nil { - window.addSubview(hostingController.view) + window.addSubview(containerView) + } - window.bringSubviewToFront(hostingController.view) + window.bringSubviewToFront(containerView) } } diff --git a/src/MeloNX/MeloNX/Core/Swift/Display/DisplayVisible.swift b/src/MeloNX/MeloNX/Core/Swift/Display/DisplayVisible.swift index 271a05e37..6f1f9242f 100644 --- a/src/MeloNX/MeloNX/Core/Swift/Display/DisplayVisible.swift +++ b/src/MeloNX/MeloNX/Core/Swift/Display/DisplayVisible.swift @@ -23,6 +23,20 @@ extension UIWindow { if UserDefaults.standard.bool(forKey: "isVirtualController") { if let window = theWindow { + + class LandscapeViewController: UIViewController { + override var supportedInterfaceOrientations: UIInterfaceOrientationMask { + return .landscape + } + + override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { + return .landscapeLeft + } + } + + let landscapeVC = LandscapeViewController() + landscapeVC.modalPresentationStyle = .fullScreen + theWindow?.rootViewController?.present(landscapeVC, animated: false, completion: nil) waitforcontroller() } } @@ -37,3 +51,4 @@ func patchMakeKeyAndVisible() { method_exchangeImplementations(m1, m2) } } + diff --git a/src/MeloNX/MeloNX/Views/ContentView.swift b/src/MeloNX/MeloNX/Views/ContentView.swift index 130f6f39a..5d662c03a 100644 --- a/src/MeloNX/MeloNX/Views/ContentView.swift +++ b/src/MeloNX/MeloNX/Views/ContentView.swift @@ -15,8 +15,7 @@ import MetalKit struct MoltenVKSettings: Codable, Hashable { let string: String - var bool: Bool? - var value: String? + var value: String } struct ContentView: View { @@ -39,12 +38,11 @@ struct ContentView: View { _config = State(initialValue: defaultConfig) let defaultSettings: [MoltenVKSettings] = [ - // MoltenVKSettings(string: "MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE", value: "128"), - MoltenVKSettings(string: "MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS", value: "1"), - MoltenVKSettings(string: "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS", value: "1"), + MoltenVKSettings(string: "MVK_CONFIG_MAX_ACTIVE_METAL_COMMAND_BUFFERS_PER_QUEUE", value: "192"), + MoltenVKSettings(string: "MVK_CONFIG_PREFILL_METAL_COMMAND_BUFFERS", value: "2"), MoltenVKSettings(string: "MVK_USE_METAL_PRIVATE_API", value: "1"), MoltenVKSettings(string: "MVK_CONFIG_RESUME_LOST_DEVICE", value: "1"), - MoltenVKSettings(string: "MVK_CONFIG_USE_METAL_PRIVATE_APIf", value: "1") + MoltenVKSettings(string: "MVK_CONFIG_USE_METAL_PRIVATE_API", value: "1") ] _settings = State(initialValue: defaultSettings) @@ -78,7 +76,6 @@ struct ContentView: View { } } - // MARK: - Helper Methods var SdlInitFlags: uint = SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_VIDEO; private func initializeSDL() { diff --git a/src/MeloNX/MeloNX/Views/SettingsView/SettingsView.swift b/src/MeloNX/MeloNX/Views/SettingsView/SettingsView.swift index 466f04b72..3defbcf63 100644 --- a/src/MeloNX/MeloNX/Views/SettingsView/SettingsView.swift +++ b/src/MeloNX/MeloNX/Views/SettingsView/SettingsView.swift @@ -248,15 +248,13 @@ struct SettingsView: View { .textCase(nil) .headerProminence(.increased) } footer: { - Text("For advanced users. Adjust page size or add custom arguments for experimental features.") + Text("For advanced users. See page size or add custom arguments for experimental features. (Please don't touch this if you don't know what you're doing)") } } - // Searching memory modes .searchable(text: $searchText, placement: .navigationBarDrawer(displayMode: .always)) .navigationTitle("Settings") .navigationBarTitleDisplayMode(.inline) .listStyle(.insetGrouped) - // Load and save settings to preserve original functionality .onAppear { if let configs = loadSettings() { self.config = configs