Skip to content

Commit

Permalink
Uploaded v1.0.6.3/4 code (Xcode 15 is brokey)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodnorwell committed Jun 6, 2023
1 parent 373ddd1 commit da711e3
Show file tree
Hide file tree
Showing 17 changed files with 421 additions and 188 deletions.
44 changes: 35 additions & 9 deletions emuThreeDS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,9 @@
C17FAB8B2A1B74380020FF0B /* CitraWrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = C17FAB8A2A1B74380020FF0B /* CitraWrapper.mm */; };
C17FAB8D2A1B74AD0020FF0B /* EmulationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17FAB8C2A1B74AD0020FF0B /* EmulationView.swift */; };
C17FAB8F2A1B74BD0020FF0B /* LibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17FAB8E2A1B74BD0020FF0B /* LibraryView.swift */; };
C17FFB632A28498C0035B362 /* LayoutOptionsSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17FFB622A28498C0035B362 /* LayoutOptionsSettingView.swift */; };
C17FFB652A284A0F0035B362 /* ResolutionFactorSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17FFB642A284A0F0035B362 /* ResolutionFactorSettingView.swift */; };
C17FFB672A284E6E0035B362 /* CPUClockSettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C17FFB662A284E6E0035B362 /* CPUClockSettingView.swift */; };
C1A3E21D2A1F139300440F83 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A3E21C2A1F139300440F83 /* SettingsView.swift */; };
C1A3E2242A1F1DCC00440F83 /* LibraryManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A3E2232A1F1DCC00440F83 /* LibraryManager.swift */; };
C1A3E22C2A1F2B3600440F83 /* DirectoryManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = C1A3E22B2A1F2B3600440F83 /* DirectoryManager.mm */; };
Expand Down Expand Up @@ -1270,6 +1273,9 @@
C17FAB8A2A1B74380020FF0B /* CitraWrapper.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CitraWrapper.mm; sourceTree = "<group>"; };
C17FAB8C2A1B74AD0020FF0B /* EmulationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmulationView.swift; sourceTree = "<group>"; };
C17FAB8E2A1B74BD0020FF0B /* LibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryView.swift; sourceTree = "<group>"; };
C17FFB622A28498C0035B362 /* LayoutOptionsSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LayoutOptionsSettingView.swift; sourceTree = "<group>"; };
C17FFB642A284A0F0035B362 /* ResolutionFactorSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResolutionFactorSettingView.swift; sourceTree = "<group>"; };
C17FFB662A284E6E0035B362 /* CPUClockSettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CPUClockSettingView.swift; sourceTree = "<group>"; };
C1A3E21C2A1F139300440F83 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
C1A3E2222A1F1DBF00440F83 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
C1A3E2232A1F1DCC00440F83 /* LibraryManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1344,6 +1350,7 @@
C122F1D82A21C56700EB2F2F /* Views */ = {
isa = PBXGroup;
children = (
C17FFB612A2849740035B362 /* Settings */,
C15DC0CC2A1B40C00053B8EA /* ContentView.swift */,
C17FAB8C2A1B74AD0020FF0B /* EmulationView.swift */,
C17FAB8E2A1B74BD0020FF0B /* LibraryView.swift */,
Expand Down Expand Up @@ -2657,6 +2664,16 @@
path = citra_wrapper;
sourceTree = "<group>";
};
C17FFB612A2849740035B362 /* Settings */ = {
isa = PBXGroup;
children = (
C17FFB662A284E6E0035B362 /* CPUClockSettingView.swift */,
C17FFB622A28498C0035B362 /* LayoutOptionsSettingView.swift */,
C17FFB642A284A0F0035B362 /* ResolutionFactorSettingView.swift */,
);
path = Settings;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -2689,7 +2706,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1430;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1500;
TargetAttributes = {
C15DC0C62A1B40C00053B8EA = {
CreatedOnToolsVersion = 14.3;
Expand Down Expand Up @@ -2764,6 +2781,7 @@
C15E08F62A1B5D9700D70564 /* serpent.cpp in Sources */,
C15E097E2A1B5D9700D70564 /* chachapoly.cpp in Sources */,
C15E096E2A1B5D9700D70564 /* validat9.cpp in Sources */,
C17FFB652A284A0F0035B362 /* ResolutionFactorSettingView.swift in Sources */,
C15DC4CC2A1B438B0053B8EA /* vfpdouble.cpp in Sources */,
C15DC5A22A1B46380053B8EA /* regs.cpp in Sources */,
C15DC41D2A1B438B0053B8EA /* am.cpp in Sources */,
Expand Down Expand Up @@ -3092,6 +3110,7 @@
C15E097A2A1B5D9700D70564 /* speck128_simd.cpp in Sources */,
C15DC5C32A1B46380053B8EA /* vertex_loader.cpp in Sources */,
C15E08DE2A1B5D9700D70564 /* power9_ppc.cpp in Sources */,
C17FFB672A284E6E0035B362 /* CPUClockSettingView.swift in Sources */,
C15DC4312A1B438B0053B8EA /* act_a.cpp in Sources */,
C15DC7742A1B4B2D0053B8EA /* disassembler.cpp in Sources */,
C15DC4142A1B438B0053B8EA /* ptm_gets.cpp in Sources */,
Expand Down Expand Up @@ -3231,6 +3250,7 @@
C15DC77A2A1B4B2D0053B8EA /* flowcontrol.cpp in Sources */,
C15DC4192A1B438B0053B8EA /* nim_aoc.cpp in Sources */,
C15DC7782A1B4B2D0053B8EA /* declaration.cpp in Sources */,
C17FFB632A28498C0035B362 /* LayoutOptionsSettingView.swift in Sources */,
C15DC4452A1B438B0053B8EA /* uds_beacon.cpp in Sources */,
C15DC4442A1B438B0053B8EA /* nwm_soc.cpp in Sources */,
C15DC4A12A1B438B0053B8EA /* savedata_archive.cpp in Sources */,
Expand Down Expand Up @@ -3316,6 +3336,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Expand Down Expand Up @@ -3348,6 +3369,7 @@
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -3376,6 +3398,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
Expand Down Expand Up @@ -3408,6 +3431,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand All @@ -3429,11 +3453,11 @@
C15DC0D62A1B40C10053B8EA /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = DarkAppIcon;
ASSETCATALOG_COMPILER_APPICON_NAME = LightAppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = emuThreeDS/emuThreeDS.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"emuThreeDS/Preview Content\"";
DEVELOPMENT_TEAM = Z3ZEABYY6P;
ENABLE_PREVIEWS = YES;
Expand All @@ -3458,7 +3482,7 @@
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -3468,6 +3492,7 @@
"$(PROJECT_DIR)/emuThreeDS/externals",
);
MARKETING_VERSION = 1.0.6;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-lboost_serialization",
"-lboost_program_options",
Expand All @@ -3484,7 +3509,7 @@
SYSTEM_HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/emuThreeDS/externals/include\"",
"\"$(SRCROOT)/emuThreeDS/externals/source/cryptopp\"",
"$(HOME)/VulkanSDK/1.3.243.0/MoltenVK/include",
"$(HOME)/VulkanSDK/1.3.250.0/MoltenVK/include",
);
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -3493,11 +3518,11 @@
C15DC0D72A1B40C10053B8EA /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = DarkAppIcon;
ASSETCATALOG_COMPILER_APPICON_NAME = LightAppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = emuThreeDS/emuThreeDS.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_ASSET_PATHS = "\"emuThreeDS/Preview Content\"";
DEVELOPMENT_TEAM = Z3ZEABYY6P;
ENABLE_PREVIEWS = YES;
Expand All @@ -3518,7 +3543,7 @@
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait";
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -3528,6 +3553,7 @@
"$(PROJECT_DIR)/emuThreeDS/externals",
);
MARKETING_VERSION = 1.0.6;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-lboost_serialization",
"-lboost_program_options",
Expand All @@ -3544,7 +3570,7 @@
SYSTEM_HEADER_SEARCH_PATHS = (
"\"$(SRCROOT)/emuThreeDS/externals/include\"",
"\"$(SRCROOT)/emuThreeDS/externals/source/cryptopp\"",
"$(HOME)/VulkanSDK/1.3.243.0/MoltenVK/include",
"$(HOME)/VulkanSDK/1.3.250.0/MoltenVK/include",
);
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"location" : "https://github.com/facebook/zstd",
"state" : {
"branch" : "dev",
"revision" : "7806d803383b75b00868a5367154a18caf535a92"
"revision" : "5059618295bc67f4f70eb6f12e6cf57b8d3de141"
}
}
],
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1500"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion emuThreeDS/Swift/Classes/EmulationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import MetalKit

class EmulationManager {
static let shared = EmulationManager()
private let wrapper = CitraWrapper()
let wrapper = CitraWrapper()

var hasConfigured: Bool = false

Expand Down
1 change: 0 additions & 1 deletion emuThreeDS/Swift/Classes/LibraryManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class LibraryManager {

let publisher = wrapper.getPublisher(path)
let region = wrapper.getRegion(path)
print(region)
let title = wrapper.getTitle(path).replacingOccurrences(of: "\n", with: " ") // some games have newlines...

let initial = Initial(character: String(title.first?.uppercased() ?? ""))
Expand Down
50 changes: 42 additions & 8 deletions emuThreeDS/Swift/Classes/SuperController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,37 +51,71 @@ class SuperController {
}
}

var handleThumbstick: GCControllerDirectionPadValueChangedHandler? = nil {
var handleLeftShoulder: GCControllerButtonValueChangedHandler? = nil {
didSet {
guard let lShoulder = virtualController?.controller?.extendedGamepad?.leftShoulder else {
return
}

lShoulder.valueChangedHandler = handleLeftShoulder
}
}

var handleRightShoulder: GCControllerButtonValueChangedHandler? = nil {
didSet {
guard let rShoulder = virtualController?.controller?.extendedGamepad?.rightShoulder else {
return
}

rShoulder.valueChangedHandler = handleRightShoulder
}
}

var handleLeftThumbstick: GCControllerDirectionPadValueChangedHandler? = nil {
didSet {
guard let lThumbstick = virtualController?.controller?.extendedGamepad?.leftThumbstick else {
return
}

lThumbstick.valueChangedHandler = handleThumbstick
lThumbstick.valueChangedHandler = handleLeftThumbstick
}
}

var handleRightThumbstick: GCControllerDirectionPadValueChangedHandler? = nil {
didSet {
guard let rThumbstick = virtualController?.controller?.extendedGamepad?.rightThumbstick else {
return
}

rThumbstick.valueChangedHandler = handleRightThumbstick
}
}

var handleOptions: GCControllerButtonValueChangedHandler? = nil {
var handleLeftTrigger: GCControllerButtonValueChangedHandler? = nil {
didSet {
guard let options = virtualController?.controller?.extendedGamepad?.buttonOptions else {
guard let lTrigger = virtualController?.controller?.extendedGamepad?.leftTrigger else {
return
}

options.valueChangedHandler = handleOptions
lTrigger.valueChangedHandler = handleLeftTrigger
}
}

var handleMenu: GCControllerButtonValueChangedHandler? = nil {
var handleRightTrigger: GCControllerButtonValueChangedHandler? = nil {
didSet {
guard let menu = virtualController?.controller?.extendedGamepad?.buttonMenu else {
guard let rTrigger = virtualController?.controller?.extendedGamepad?.rightTrigger else {
return
}

menu.valueChangedHandler = handleMenu
rTrigger.valueChangedHandler = handleRightTrigger
}
}






init(elements: Set<String>) {
var isMacCatalyst = false

Expand Down
54 changes: 41 additions & 13 deletions emuThreeDS/Swift/ViewControllers/EmulationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import Foundation
import GameController
import MetalKit
import SwiftUI
import UIKit

class EmulationViewController : UIViewController {
var emulationManager: EmulationManager

var metalView = MTKView()

var virtualController = SuperController(elements: [GCInputLeftThumbstick, GCInputLeftShoulder, GCInputRightShoulder, GCInputButtonMenu, GCInputButtonOptions, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY])
var virtualController = SuperController(elements: [GCInputLeftThumbstick, GCInputRightThumbstick, GCInputLeftShoulder, GCInputRightShoulder, GCInputLeftTrigger, GCInputRightTrigger, GCInputButtonA, GCInputButtonB, GCInputButtonX, GCInputButtonY])

init(emulationManager: EmulationManager) {
self.emulationManager = emulationManager
Expand All @@ -41,6 +42,7 @@ class EmulationViewController : UIViewController {
])

NotificationCenter.default.addObserver(self, selector: #selector(controllerDidConnect), name: NSNotification.Name.GCControllerDidConnect, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(controllerDidConnect), name: NSNotification.Name.GCControllerDidDisconnect, object: nil)
}

override func viewDidAppear(_ animated: Bool) {
Expand All @@ -61,7 +63,7 @@ class EmulationViewController : UIViewController {

override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
if emulationManager.hasConfigured {
if emulationManager.hasConfigured, emulationManager.wrapper.isRunning {
emulationManager.orientationChanged(orientation: UIDevice.current.orientation, with: metalView.layer as! CAMetalLayer)
}
disconnect(); connect()
Expand Down Expand Up @@ -104,16 +106,42 @@ class EmulationViewController : UIViewController {


@objc func controllerDidConnect() {
print("controller connected")

virtualController.handleA = EmulationInput.buttonA.valueChangedHandler
virtualController.handleB = EmulationInput.buttonB.valueChangedHandler
virtualController.handleX = EmulationInput.buttonX.valueChangedHandler
virtualController.handleY = EmulationInput.buttonY.valueChangedHandler

virtualController.handleOptions = EmulationInput.buttonSelect.valueChangedHandler
virtualController.handleOptions = EmulationInput.buttonSelect.valueChangedHandler

virtualController.handleThumbstick = EmulationInput.circlePad.valueChangedHandler
if let controller = GCController.controllers().first(where: { $0.battery != nil }) {
if let _ = controller.battery {
virtualController.disconnect()

controller.extendedGamepad?.buttonA.pressedChangedHandler = EmulationInput.buttonA.valueChangedHandler
controller.extendedGamepad?.buttonB.pressedChangedHandler = EmulationInput.buttonB.valueChangedHandler
controller.extendedGamepad?.buttonX.pressedChangedHandler = EmulationInput.buttonX.valueChangedHandler
controller.extendedGamepad?.buttonY.pressedChangedHandler = EmulationInput.buttonY.valueChangedHandler

controller.extendedGamepad?.leftShoulder.pressedChangedHandler = EmulationInput.buttonSelect.valueChangedHandler
controller.extendedGamepad?.rightShoulder.pressedChangedHandler = EmulationInput.buttonStart.valueChangedHandler

controller.extendedGamepad?.leftTrigger.valueChangedHandler = EmulationInput.buttonL.valueChangedHandler
controller.extendedGamepad?.rightTrigger.valueChangedHandler = EmulationInput.buttonR.valueChangedHandler

controller.extendedGamepad?.leftThumbstick.valueChangedHandler = EmulationInput.circlePad.valueChangedHandler
controller.extendedGamepad?.rightThumbstick.valueChangedHandler = EmulationInput.circlePadPro.valueChangedHandler
} else {
Task {
try await virtualController.connect()
}

virtualController.handleA = EmulationInput.buttonA.valueChangedHandler
virtualController.handleB = EmulationInput.buttonB.valueChangedHandler
virtualController.handleX = EmulationInput.buttonX.valueChangedHandler
virtualController.handleY = EmulationInput.buttonY.valueChangedHandler

virtualController.handleLeftShoulder = EmulationInput.buttonSelect.valueChangedHandler
virtualController.handleRightShoulder = EmulationInput.buttonStart.valueChangedHandler

virtualController.handleLeftTrigger = EmulationInput.buttonL.valueChangedHandler
virtualController.handleRightTrigger = EmulationInput.buttonR.valueChangedHandler

virtualController.handleLeftThumbstick = EmulationInput.circlePad.valueChangedHandler
virtualController.handleRightThumbstick = EmulationInput.circlePadPro.valueChangedHandler
}
}
}
}
Loading

0 comments on commit da711e3

Please sign in to comment.