diff --git a/src/ios/AdvancedSettingsView.swift b/src/ios/AdvancedSettingsView.swift deleted file mode 100644 index 9c40af442c..0000000000 --- a/src/ios/AdvancedSettingsView.swift +++ /dev/null @@ -1,77 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import SwiftUI -import UniformTypeIdentifiers - -struct AdvancedSettingsView: View { - @AppStorage("exitgame") var exitgame: Bool = false - @AppStorage("ClearBackingRegion") var kpagetable: Bool = false - @AppStorage("WaitingforJIT") var waitingJIT: Bool = false - @AppStorage("cangetfullpath") var canGetFullPath: Bool = false - @AppStorage("onscreenhandheld") var onscreenjoy: Bool = false - var body: some View { - ScrollView { - Rectangle() - .fill(Color(uiColor: UIColor.secondarySystemBackground)) - .cornerRadius(10) - .frame(width: .infinity, height: 50) - .overlay() { - HStack { - Toggle("Exit Game Button", isOn: $exitgame) - .padding() - } - } - Text("This is very unstable and can lead to game freezing and overall bad preformance after you exit a game") - .padding(.bottom) - .font(.footnote) - .foregroundColor(.gray) - Rectangle() - .fill(Color(uiColor: UIColor.secondarySystemBackground)) - .cornerRadius(10) - .frame(width: .infinity, height: 50) - .overlay() { - HStack { - Toggle("Memory Usage Increase", isOn: $kpagetable) - .padding() - } - } - Text("This makes games way more stable but a lot of games will crash as you will run out of Memory way quicker. (Don't Enable this on devices with less then 8GB of memory as most games will crash)") - .padding(.bottom) - .font(.footnote) - .foregroundColor(.gray) - - Rectangle() - .fill(Color(uiColor: UIColor.secondarySystemBackground)) - .cornerRadius(10) - .frame(width: .infinity, height: 50) - .overlay() { - HStack { - Toggle("Check for Booting OS", isOn: $canGetFullPath) - .padding() - } - } - Text("If you do not have the neccesary files for Booting the Switch OS, it will just crash almost instantly.") - .padding(.bottom) - .font(.footnote) - .foregroundColor(.gray) - - Rectangle() - .fill(Color(uiColor: UIColor.secondarySystemBackground)) - .cornerRadius(10) - .frame(width: .infinity, height: 50) - .overlay() { - HStack { - Toggle("Set OnScreen Controls to Handheld", isOn: $onscreenjoy) - .padding() - } - } - Text("You need in Core Settings to set \"use_docked_mode = 0\"") - .padding(.bottom) - .font(.footnote) - .foregroundColor(.gray) - } - } -} diff --git a/src/ios/Air.swift b/src/ios/Air.swift deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/ios/AirPlay.swift b/src/ios/AirPlay.swift deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/ios/AppIconProvider.swift b/src/ios/AppIconProvider.swift deleted file mode 100644 index 61ebd4df64..0000000000 --- a/src/ios/AppIconProvider.swift +++ /dev/null @@ -1,19 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import Foundation - -enum AppIconProvider { - static func appIcon(in bundle: Bundle = .main) -> String { - guard let icons = bundle.object(forInfoDictionaryKey: "CFBundleIcons") as? [String: Any], - let primaryIcon = icons["CFBundlePrimaryIcon"] as? [String: Any], - let iconFiles = primaryIcon["CFBundleIconFiles"] as? [String], - let iconFileName = iconFiles.last else { - print("Could not find icons in bundle") - return "" - } - return iconFileName - } -} diff --git a/src/ios/BootOSView.swift b/src/ios/BootOSView.swift deleted file mode 100644 index 5af5d55145..0000000000 --- a/src/ios/BootOSView.swift +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import SwiftUI -import AppUI - -struct BootOSView: View { - @Binding var core: Core - @Binding var currentnavigarion: Int - @State var appui = AppUI.shared - @AppStorage("cangetfullpath") var canGetFullPath: Bool = false - var body: some View { - if (appui.canGetFullPath() -- canGetFullPath) { - EmulationView(game: nil) - } else { - VStack { - Text("Unable Launch Switch OS") - .font(.largeTitle) - .padding() - Text("You do not have the Switch Home Menu Files Needed to launch the Ηome Menu") - } - } - } -} diff --git a/src/ios/CMakeLists.txt b/src/ios/CMakeLists.txt index 5d979c2ce5..6f7ad7e94f 100644 --- a/src/ios/CMakeLists.txt +++ b/src/ios/CMakeLists.txt @@ -17,31 +17,21 @@ add_executable(eden-ios EmulationWindow.mm VMA.cpp - EnableJIT.swift EmulationGame.swift JoystickView.swift - CoreSettingsView.swift - ContentView.swift EmulationHandler.swift - DetectServer.swift NavView.swift PomeloApp.swift SettingsView.swift FileManager.swift EmulationView.swift LibraryView.swift - GameButtonListView.swift KeyboardHostingController.swift MetalView.swift - BootOSView.swift ControllerView.swift - AppUI.swift InfoView.swift FolderMonitor.swift - AdvancedSettingsView.swift GameButtonView.swift - AppIconProvider.swift - Haptics.swift EmulationScreenView.swift GameListView.swift ) diff --git a/src/ios/ContentView.swift b/src/ios/ContentView.swift deleted file mode 100644 index 07d41f89e6..0000000000 --- a/src/ios/ContentView.swift +++ /dev/null @@ -1,15 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import SwiftUI -import AppUI - -struct ContentView: View { -@State var core = Core(games: [], root: FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]) - var body: some View { - HomeView(core: core).onAppear() { - } - } -} diff --git a/src/ios/ControllerView.swift b/src/ios/ControllerView.swift index a19cdffd28..c4d5a8a6a7 100644 --- a/src/ios/ControllerView.swift +++ b/src/ios/ControllerView.swift @@ -5,7 +5,7 @@ import SwiftUI import GameController -import AppUI + import SwiftUIJoystick struct ControllerView: View { @@ -335,6 +335,18 @@ struct ABXYView: View { } } +class Haptics { + static let shared = Haptics() + private init() { } + func play(_ feedbackStyle: UIImpactFeedbackGenerator.FeedbackStyle) { + print("haptics") + UIImpactFeedbackGenerator(style: feedbackStyle).impactOccurred() + } + func notify(_ feedbackType: UINotificationFeedbackGenerator.FeedbackType) { + UINotificationFeedbackGenerator().notificationOccurred(feedbackType) + } +} + struct ButtonView: View { var button: VirtualControllerButtonType @StateObject private var viewModel: EmulationViewModel = EmulationViewModel(game: nil) diff --git a/src/ios/CoreSettingsView.swift b/src/ios/CoreSettingsView.swift deleted file mode 100644 index 12b5c3c624..0000000000 --- a/src/ios/CoreSettingsView.swift +++ /dev/null @@ -1,88 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import SwiftUI -import Foundation -import AppUI - -struct CoreSettingsView: View { - @State private var text: String = "" - @State private var isLoading: Bool = true - @Environment(\.presentationMode) var presentationMode - - var body: some View { - VStack { - if isLoading { - ProgressView() - .progressViewStyle(CircularProgressViewStyle()) - } else { - TextEditor(text: $text) - .padding() - - } - } - .toolbar { - ToolbarItem(placement: .navigationBarTrailing) { - Button { - let documentDirectory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] - let configfolder = documentDirectory.appendingPathComponent("config", conformingTo: .folder) - let fileURL = configfolder.appendingPathComponent("config.ini") - - presentationMode.wrappedValue.dismiss() - - do { - try FileManager.default.removeItem(at: fileURL) - } catch { - print("\(error.localizedDescription)") - } - - AppUI.shared.settingsSaved() - - } label: { - Text("Reset File") - } - } - } - .onAppear { - loadFile() - } - .onDisappear() { - saveFile() - } - } - - private func loadFile() { - let fileManager = FileManager.default - let documentDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let configfolder = documentDirectory.appendingPathComponent("config", conformingTo: .folder) - let fileURL = configfolder.appendingPathComponent("config.ini") - - if fileManager.fileExists(atPath: fileURL.path) { - do { - text = try String(contentsOf: fileURL, encoding: .utf8) - } catch { - print("Error reading file: \(error)") - } - } else { - text = "" // Initialize with empty text if file doesn't exist - } - isLoading = false - } - - private func saveFile() { - let fileManager = FileManager.default - let documentDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] - let configfolder = documentDirectory.appendingPathComponent("config", conformingTo: .folder) - let fileURL = configfolder.appendingPathComponent("config.ini") - - do { - try text.write(to: fileURL, atomically: true, encoding: .utf8) - AppUI.shared.settingsSaved() - print("File saved successfully!") - } catch { - print("Error saving file: \(error)") - } - } -} diff --git a/src/ios/DetectServer.swift b/src/ios/DetectServer.swift deleted file mode 100644 index a36563fc66..0000000000 --- a/src/ios/DetectServer.swift +++ /dev/null @@ -1,26 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import Foundation - -func isSideJITServerDetected(completion: @escaping (Result) -> Void) { - let address = UserDefaults.standard.string(forKey: "sidejitserver") ?? "" - var SJSURL = address - if (address).isEmpty { - SJSURL = "http://sidejitserver._http._tcp.local:8080" - } - // Create a network operation at launch to Refresh SideJITServer - let url = URL(string: SJSURL)! - let task = URLSession.shared.dataTask(with: url) { (data, response, error) in - if let error = error { - print("No SideJITServer on Network") - completion(.failure(error)) - return - } - completion(.success(())) - } - task.resume() - return -} diff --git a/src/ios/EmulationHandler.swift b/src/ios/EmulationHandler.swift index 9ae1e2f248..4db9de1fdb 100644 --- a/src/ios/EmulationHandler.swift +++ b/src/ios/EmulationHandler.swift @@ -4,7 +4,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later import SwiftUI -import AppUI + import Metal import Foundation diff --git a/src/ios/EmulationScreenView.swift b/src/ios/EmulationScreenView.swift index 9db9d5abba..55b8f0c229 100644 --- a/src/ios/EmulationScreenView.swift +++ b/src/ios/EmulationScreenView.swift @@ -4,7 +4,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later import SwiftUI -import AppUI + import MetalKit class EmulationScreenView: UIView { diff --git a/src/ios/EmulationView.swift b/src/ios/EmulationView.swift index 586afa88c1..354f1dfe33 100644 --- a/src/ios/EmulationView.swift +++ b/src/ios/EmulationView.swift @@ -4,7 +4,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later import SwiftUI -import AppUI + import Foundation import GameController import UIKit diff --git a/src/ios/EnableJIT.swift b/src/ios/EnableJIT.swift deleted file mode 100644 index 105615fd29..0000000000 --- a/src/ios/EnableJIT.swift +++ /dev/null @@ -1,52 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import Foundation - -enum SideJITServerErrorType: Error { - case invalidURL - case errorConnecting - case deviceNotFound - case other(String) -} - -func sendrequestsidejit(url: String, completion: @escaping (Result) -> Void) { - let url = URL(string: url)! - let task = URLSession.shared.dataTask(with: url) {(data, response, error) in - if let error = error { - completion(.failure(.errorConnecting)) - return - } - guard let data = data, let datastring = String(data: data, encoding: .utf8) else { return } - if datastring == "Enabled JIT" { - completion(.success(())) - } else { - let errorType: SideJITServerErrorType = datastring == "Could not find device!" ? .deviceNotFound : .other(datastring) - completion(.failure(errorType)) - } - } - task.resume() -} - -func sendrefresh(url: String, completion: @escaping (Result) -> Void) { - let url = URL(string: url)! - - let task = URLSession.shared.dataTask(with: url) {(data, response, error) in - if let error = error { - completion(.failure(.errorConnecting)) - return - } - - guard let data = data, let datastring = String(data: data, encoding: .utf8) else { return } - let inputText = "{\"OK\":\"Refreshed!\"}" - if datastring == inputText { - completion(.success(())) - } else { - let errorType: SideJITServerErrorType = datastring == "Could not find device!" ? .deviceNotFound : .other(datastring) - completion(.failure(errorType)) - } - } - task.resume() -} diff --git a/src/ios/FileManager.swift b/src/ios/FileManager.swift index f3fddff8b1..5d0b317c56 100644 --- a/src/ios/FileManager.swift +++ b/src/ios/FileManager.swift @@ -6,7 +6,7 @@ import SwiftUI import Foundation import UIKit -import AppUI + import Zip struct Core : Comparable, Hashable { diff --git a/src/ios/GameButtonListView.swift b/src/ios/GameButtonListView.swift deleted file mode 100644 index c58d329e72..0000000000 --- a/src/ios/GameButtonListView.swift +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, TechGuy -// SPDX-License-Identifier: GPL-3.0-or-later - -import SwiftUI -import Foundation -import UIKit - -struct GameButtonListView: View { - var game: EmulationGame - @Environment(\.colorScheme) var colorScheme - - var body: some View { - HStack(spacing: 15) { - if let image = UIImage(data: game.imageData) { - Image(uiImage: image) - .resizable() - .frame(width: 60, height: 60) - .cornerRadius(8) - } else { - Image(systemName: "photo") - .resizable() - .frame(width: 60, height: 60) - .cornerRadius(8) - } - - VStack(alignment: .leading, spacing: 4) { - Text(game.title) - .font(.headline) - .foregroundColor(colorScheme == .dark ? Color.white : Color.black) - Text(game.developer) - .font(.subheadline) - .foregroundColor(.gray) - } - Spacer() - } - .padding(.vertical, 8) - } -} diff --git a/src/ios/GameButtonView.swift b/src/ios/GameButtonView.swift index fae44544e7..c4b2b2537d 100644 --- a/src/ios/GameButtonView.swift +++ b/src/ios/GameButtonView.swift @@ -165,7 +165,6 @@ struct HomeView: View { } } - struct GameCarouselView: View { // let games: [EmulationGame] @State var core: Core diff --git a/src/ios/GameListView.swift b/src/ios/GameListView.swift index 1c8d39e780..a2bef69b9c 100644 --- a/src/ios/GameListView.swift +++ b/src/ios/GameListView.swift @@ -7,7 +7,39 @@ import SwiftUI import Foundation import UIKit import UniformTypeIdentifiers -import AppUI + + +struct GameButtonListView: View { + var game: EmulationGame + @Environment(\.colorScheme) var colorScheme + + var body: some View { + HStack(spacing: 15) { + if let image = UIImage(data: game.imageData) { + Image(uiImage: image) + .resizable() + .frame(width: 60, height: 60) + .cornerRadius(8) + } else { + Image(systemName: "photo") + .resizable() + .frame(width: 60, height: 60) + .cornerRadius(8) + } + + VStack(alignment: .leading, spacing: 4) { + Text(game.title) + .font(.headline) + .foregroundColor(colorScheme == .dark ? Color.white : Color.black) + Text(game.developer) + .font(.subheadline) + .foregroundColor(.gray) + } + Spacer() + } + .padding(.vertical, 8) + } +} struct GameListView: View { @State var core: Core diff --git a/src/ios/Haptics.swift b/src/ios/Haptics.swift deleted file mode 100644 index 096c9f4e67..0000000000 --- a/src/ios/Haptics.swift +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Pomelo, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import UIKit -import SwiftUI -import AppUI - -class Haptics { - static let shared = Haptics() - - private init() { } - - func play(_ feedbackStyle: UIImpactFeedbackGenerator.FeedbackStyle) { - print("haptics") - UIImpactFeedbackGenerator(style: feedbackStyle).impactOccurred() - } - - func notify(_ feedbackType: UINotificationFeedbackGenerator.FeedbackType) { - UINotificationFeedbackGenerator().notificationOccurred(feedbackType) - } -} diff --git a/src/ios/InfoView.swift b/src/ios/InfoView.swift deleted file mode 100644 index 26d8b866be..0000000000 --- a/src/ios/InfoView.swift +++ /dev/null @@ -1,46 +0,0 @@ -// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project -// SPDX-License-Identifier: GPL-3.0-or-later -// SPDX-FileCopyrightText: Copyright 2024 Yuzu, Stossy11 -// SPDX-License-Identifier: GPL-3.0-or-later - -import SwiftUI - -struct InfoView: View { - @AppStorage("entitlementNotExists") private var entitlementNotExists: Bool = false - @AppStorage("increaseddebugmem") private var increaseddebugmem: Bool = false - @AppStorage("extended-virtual-addressing") private var extended: Bool = false - let infoDictionary = Bundle.main.infoDictionary - - var body: some View { - ScrollView { - VStack { - Text("Welcome").font(.largeTitle) - Divider() - Text("Entitlements:").font(.title).font(Font.headline.weight(.bold)) - Spacer().frame(height: 10) - Group { - Text("Required:").font(.title2).font(Font.headline.weight(.bold)) - Spacer().frame(height: 10) - Text("Limit: \(String(describing: !entitlementNotExists))") - Spacer().frame(height: 10) - } - Group { - Spacer().frame(height: 10) - Text("Reccomended:").font(.title2).font(Font.headline.weight(.bold)) - Spacer().frame(height: 10) - Text("Limit: \(String(describing: increaseddebugmem))").padding() - Text("Extended: \(String(describing: extended))") - } - - } - .padding() - Text("Version: \(getAppVersion())").foregroundColor(.gray) - } - } - func getAppVersion() -> String { - guard let s = infoDictionary?["CFBundleShortVersionString"] as? String else { - return "Unknown" - } - return s - } -} diff --git a/src/ios/JoystickView.swift b/src/ios/JoystickView.swift index 24ce8e4739..61d56cedc4 100644 --- a/src/ios/JoystickView.swift +++ b/src/ios/JoystickView.swift @@ -5,7 +5,7 @@ import SwiftUI import SwiftUIJoystick -import AppUI + public struct Joystick: View { @State var iscool: Bool? = nil diff --git a/src/ios/KeyboardHostingController.swift b/src/ios/KeyboardHostingController.swift index 85e1cd01d0..4646b17062 100644 --- a/src/ios/KeyboardHostingController.swift +++ b/src/ios/KeyboardHostingController.swift @@ -7,7 +7,6 @@ import SwiftUI import UIKit class KeyboardHostingController: UIHostingController { - override var canBecomeFirstResponder: Bool { return true } @@ -56,7 +55,6 @@ class KeyboardHostingController: UIHostingController { } } - struct KeyboardSupportView: UIViewControllerRepresentable { let content: Text diff --git a/src/ios/LibraryView.swift b/src/ios/LibraryView.swift index c85b39608d..a2a3f418c6 100644 --- a/src/ios/LibraryView.swift +++ b/src/ios/LibraryView.swift @@ -5,7 +5,7 @@ import SwiftUI import CryptoKit -import AppUI + struct LibraryView: View { @Binding var core: Core diff --git a/src/ios/MetalView.swift b/src/ios/MetalView.swift index c6a746e9f2..f0471a6ce6 100644 --- a/src/ios/MetalView.swift +++ b/src/ios/MetalView.swift @@ -5,7 +5,7 @@ import SwiftUI import Metal -import AppUI + struct MetalView: UIViewRepresentable { let device: MTLDevice? diff --git a/src/ios/NavView.swift b/src/ios/NavView.swift index b989dd5925..3ce63c44a0 100644 --- a/src/ios/NavView.swift +++ b/src/ios/NavView.swift @@ -4,7 +4,25 @@ // SPDX-License-Identifier: GPL-3.0-or-later import SwiftUI -import AppUI + +struct BootOSView: View { + @Binding var core: Core + @Binding var currentnavigarion: Int + @State var appui = AppUI.shared + @AppStorage("cangetfullpath") var canGetFullPath: Bool = false + var body: some View { + if (appui.canGetFullPath() -- canGetFullPath) { + EmulationView(game: nil) + } else { + VStack { + Text("Unable Launch Switch OS") + .font(.largeTitle) + .padding() + Text("You do not have the Switch Home Menu Files Needed to launch the Ηome Menu") + } + } + } +} struct NavView: View { @Binding var core: Core diff --git a/src/ios/PomeloApp.swift b/src/ios/PomeloApp.swift index 4a48939f54..2dbc2a9c5c 100644 --- a/src/ios/PomeloApp.swift +++ b/src/ios/PomeloApp.swift @@ -11,6 +11,14 @@ func --(lhs: Bool, rhs: Bool) -> Bool { return lhs || rhs } +struct ContentView: View { +@State var core = Core(games: [], root: FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]) + var body: some View { + HomeView(core: core).onAppear() { + } + } +} + @main struct PomeloApp: App { var body: some Scene {