mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-13 02:18:35 +02:00
fix?
This commit is contained in:
parent
6f620a00d0
commit
e11b8a0733
26 changed files with 80 additions and 435 deletions
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -17,31 +17,21 @@ add_executable(eden-ios
|
||||||
EmulationWindow.mm
|
EmulationWindow.mm
|
||||||
VMA.cpp
|
VMA.cpp
|
||||||
|
|
||||||
EnableJIT.swift
|
|
||||||
EmulationGame.swift
|
EmulationGame.swift
|
||||||
JoystickView.swift
|
JoystickView.swift
|
||||||
CoreSettingsView.swift
|
|
||||||
ContentView.swift
|
|
||||||
EmulationHandler.swift
|
EmulationHandler.swift
|
||||||
DetectServer.swift
|
|
||||||
NavView.swift
|
NavView.swift
|
||||||
PomeloApp.swift
|
PomeloApp.swift
|
||||||
SettingsView.swift
|
SettingsView.swift
|
||||||
FileManager.swift
|
FileManager.swift
|
||||||
EmulationView.swift
|
EmulationView.swift
|
||||||
LibraryView.swift
|
LibraryView.swift
|
||||||
GameButtonListView.swift
|
|
||||||
KeyboardHostingController.swift
|
KeyboardHostingController.swift
|
||||||
MetalView.swift
|
MetalView.swift
|
||||||
BootOSView.swift
|
|
||||||
ControllerView.swift
|
ControllerView.swift
|
||||||
AppUI.swift
|
|
||||||
InfoView.swift
|
InfoView.swift
|
||||||
FolderMonitor.swift
|
FolderMonitor.swift
|
||||||
AdvancedSettingsView.swift
|
|
||||||
GameButtonView.swift
|
GameButtonView.swift
|
||||||
AppIconProvider.swift
|
|
||||||
Haptics.swift
|
|
||||||
EmulationScreenView.swift
|
EmulationScreenView.swift
|
||||||
GameListView.swift
|
GameListView.swift
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -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() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import GameController
|
import GameController
|
||||||
import AppUI
|
|
||||||
import SwiftUIJoystick
|
import SwiftUIJoystick
|
||||||
|
|
||||||
struct ControllerView: View {
|
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 {
|
struct ButtonView: View {
|
||||||
var button: VirtualControllerButtonType
|
var button: VirtualControllerButtonType
|
||||||
@StateObject private var viewModel: EmulationViewModel = EmulationViewModel(game: nil)
|
@StateObject private var viewModel: EmulationViewModel = EmulationViewModel(game: nil)
|
||||||
|
|
|
||||||
|
|
@ -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)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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, Error>) -> 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
|
|
||||||
}
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import AppUI
|
|
||||||
import Metal
|
import Metal
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import AppUI
|
|
||||||
import MetalKit
|
import MetalKit
|
||||||
|
|
||||||
class EmulationScreenView: UIView {
|
class EmulationScreenView: UIView {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import AppUI
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import GameController
|
import GameController
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
|
||||||
|
|
@ -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, SideJITServerErrorType>) -> 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, SideJITServerErrorType>) -> 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()
|
|
||||||
}
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import AppUI
|
|
||||||
import Zip
|
import Zip
|
||||||
|
|
||||||
struct Core : Comparable, Hashable {
|
struct Core : Comparable, Hashable {
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -165,7 +165,6 @@ struct HomeView: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct GameCarouselView: View {
|
struct GameCarouselView: View {
|
||||||
// let games: [EmulationGame]
|
// let games: [EmulationGame]
|
||||||
@State var core: Core
|
@State var core: Core
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,39 @@ import SwiftUI
|
||||||
import Foundation
|
import Foundation
|
||||||
import UIKit
|
import UIKit
|
||||||
import UniformTypeIdentifiers
|
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 {
|
struct GameListView: View {
|
||||||
@State var core: Core
|
@State var core: Core
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import SwiftUIJoystick
|
import SwiftUIJoystick
|
||||||
import AppUI
|
|
||||||
|
|
||||||
public struct Joystick: View {
|
public struct Joystick: View {
|
||||||
@State var iscool: Bool? = nil
|
@State var iscool: Bool? = nil
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ import SwiftUI
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
class KeyboardHostingController<Content: View>: UIHostingController<Content> {
|
class KeyboardHostingController<Content: View>: UIHostingController<Content> {
|
||||||
|
|
||||||
override var canBecomeFirstResponder: Bool {
|
override var canBecomeFirstResponder: Bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
@ -56,7 +55,6 @@ class KeyboardHostingController<Content: View>: UIHostingController<Content> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct KeyboardSupportView: UIViewControllerRepresentable {
|
struct KeyboardSupportView: UIViewControllerRepresentable {
|
||||||
let content: Text
|
let content: Text
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import CryptoKit
|
import CryptoKit
|
||||||
import AppUI
|
|
||||||
|
|
||||||
struct LibraryView: View {
|
struct LibraryView: View {
|
||||||
@Binding var core: Core
|
@Binding var core: Core
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
import Metal
|
import Metal
|
||||||
import AppUI
|
|
||||||
|
|
||||||
struct MetalView: UIViewRepresentable {
|
struct MetalView: UIViewRepresentable {
|
||||||
let device: MTLDevice?
|
let device: MTLDevice?
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,25 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
import SwiftUI
|
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 {
|
struct NavView: View {
|
||||||
@Binding var core: Core
|
@Binding var core: Core
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,14 @@ func --(lhs: Bool, rhs: Bool) -> Bool {
|
||||||
return lhs || rhs
|
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
|
@main
|
||||||
struct PomeloApp: App {
|
struct PomeloApp: App {
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue