Skip to content

Manic EMU is an all-in-one retro game emulator for iOS. It packs powerful features while keeping a clean, sleek UI and delivering buttery-smooth gameplay.

Swift

Fixed the crash when Rumble stops; fixed the first-time palette setup failure for GB; fixed RetroAchievements progress.

Daiuno8eec37f19f36
diff --git a/Cores/Libretro/configuration.c b/Cores/Libretro/configuration.c
index d07b13f9..221e8052 100644
--- a/Cores/Libretro/configuration.c
+++ b/Cores/Libretro/configuration.c
@@ -5054,6 +5054,15 @@ bool get_enable_rumble(void) {
return g_enable_rumble;
}
+static bool g_is_libretro_going_to_stop = false;
+void set_libretro_is_going_to_stop(bool stop) {
+ g_is_libretro_going_to_stop = stop;
+}
+
+bool get_is_libretro_going_to_stop(void) {
+ return g_is_libretro_going_to_stop;
+}
+
/**
* input_config_save_keybinds_user:
* @conf : pointer to config file object
diff --git a/Cores/Libretro/configuration.h b/Cores/Libretro/configuration.h
index 498dca3f..d077dd85 100644
--- a/Cores/Libretro/configuration.h
+++ b/Cores/Libretro/configuration.h
@@ -1371,6 +1371,10 @@ const char* get_custom_save_ext(void);
void set_enable_rumble(bool enable);
bool get_enable_rumble(void);
+//设置Libretro是否将要停止
+void set_libretro_is_going_to_stop(bool stop);
+bool get_is_libretro_going_to_stop(void);
+
RETRO_END_DECLS
#endif
diff --git a/Cores/Libretro/input/drivers_joypad/manic_joypad.m b/Cores/Libretro/input/drivers_joypad/manic_joypad.m
index 4d75e002..7b216c7b 100644
--- a/Cores/Libretro/input/drivers_joypad/manic_joypad.m
+++ b/Cores/Libretro/input/drivers_joypad/manic_joypad.m
@@ -370,6 +370,10 @@ static bool manic_gamecontroller_joypad_set_rumble(unsigned pad,
return false;
}
+ if (get_is_libretro_going_to_stop()) {
+ return false;
+ }
+
if (@available(iOS 14.0, macOS 11.0, tvOS 14.0, *)) {
for (GCController *controller in [GCController controllers]) {
if (!controller)
diff --git a/Cores/Libretro/ui/drivers/CheevosBridge.m b/Cores/Libretro/ui/drivers/CheevosBridge.m
index 3ceb0477..e40608cd 100644
--- a/Cores/Libretro/ui/drivers/CheevosBridge.m
+++ b/Cores/Libretro/ui/drivers/CheevosBridge.m
@@ -53,6 +53,9 @@
@implementation CheevosLeaderboard
@end
+@implementation CheevosProgress
+@end
+
@implementation CheevosBridge
#pragma mark - HTTP Server Call Implementation
@@ -193,6 +196,12 @@ static CheevosAchievement* buildAchievementObj(const rc_client_achievement_t* a)
obj.rarity = (CGFloat)a->rarity;
obj.rarityHardcore = (CGFloat)a->rarity_hardcore;
obj.type = (NSInteger)a->type;
+ if (a->type & RC_CLIENT_ACHIEVEMENT_TYPE_MISSABLE) {
+ obj.isMissable = YES;
+ }
+ if (a->type & RC_CLIENT_ACHIEVEMENT_TYPE_PROGRESSION) {
+ obj.isProgression = YES;
+ }
char url1[256];
if (rc_client_achievement_get_image_url(a, RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED, url1, sizeof(url1)) == RC_OK) {
obj.unlockedBadgeUrl = [NSString stringWithCString:url1 encoding:NSUTF8StringEncoding];
diff --git a/Cores/Libretro/ui/drivers/LibretroCore.m b/Cores/Libretro/ui/drivers/LibretroCore.m
index 57423854..b9eefcef 100644
--- a/Cores/Libretro/ui/drivers/LibretroCore.m
+++ b/Cores/Libretro/ui/drivers/LibretroCore.m
@@ -274,6 +274,9 @@ static void cheevosDidTrigger(uint32_t type, void* object1, void* object2) {
obj.rarity = (CGFloat)a->rarity;
obj.rarityHardcore = (CGFloat)a->rarity_hardcore;
obj.type = (NSInteger)a->type;
+
+
+
char url1[256];
if (rc_client_achievement_get_image_url(a, RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED, url1, sizeof(url1)) == RC_OK) {
obj.unlockedBadgeUrl = [NSString stringWithCString:url1 encoding:NSUTF8StringEncoding];
@@ -389,6 +392,66 @@ static void cheevosDidTrigger(uint32_t type, void* object1, void* object2) {
[[NSNotificationCenter defaultCenter] postNotificationName:RetroAchievementsNotification object:obj];
});
}
+ } else if (type == RC_CLIENT_EVENT_ACHIEVEMENT_PROGRESS_INDICATOR_SHOW) {
+ //进度展示
+ if (object1) {
+ rc_client_achievement_t *a = (rc_client_achievement_t *)object1;
+ if ([[NSString stringWithUTF8String:a->badge_name] isEqualToString:@"00000"]) {
+ return;
+ }
+ CheevosProgress* obj = [CheevosProgress new];
+ obj.show = YES;
+ obj.title = a->title ? [NSString stringWithUTF8String:a->title] : nil;
+ obj.points = (NSInteger)a->points;
+ obj.measuredProgress = [NSString stringWithUTF8String:a->measured_progress];
+ obj.measuredPercent = (CGFloat)a->measured_percent;
+ obj._id = (NSInteger)a->id;
+ char url1[256];
+ if (rc_client_achievement_get_image_url(a, RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED, url1, sizeof(url1)) == RC_OK) {
+ obj.unlockedBadgeUrl = [NSString stringWithCString:url1 encoding:NSUTF8StringEncoding];
+ }
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:RetroAchievementsNotification object:obj];
+ });
+ }
+
+ } else if (type == RC_CLIENT_EVENT_ACHIEVEMENT_PROGRESS_INDICATOR_HIDE) {
+ //进度隐藏
+ if (object1) {
+ rc_client_achievement_t *a = (rc_client_achievement_t *)object1;
+ if ([[NSString stringWithUTF8String:a->badge_name] isEqualToString:@"00000"]) {
+ return;
+ }
+ CheevosProgress* obj = [CheevosProgress new];
+ obj.show = NO;
+ obj._id = (NSInteger)a->id;
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:RetroAchievementsNotification object:obj];
+ });
+ }
+
+ } else if (type == RC_CLIENT_EVENT_ACHIEVEMENT_PROGRESS_INDICATOR_UPDATE) {
+ //进度更新
+ if (object1) {
+ rc_client_achievement_t *a = (rc_client_achievement_t *)object1;
+ if ([[NSString stringWithUTF8String:a->badge_name] isEqualToString:@"00000"]) {
+ return;
+ }
+ CheevosProgress* obj = [CheevosProgress new];
+ obj.show = YES;
+ obj.title = a->title ? [NSString stringWithUTF8String:a->title] : nil;
+ obj.points = (NSInteger)a->points;
+ obj.measuredProgress = [NSString stringWithUTF8String:a->measured_progress];
+ obj.measuredPercent = (CGFloat)a->measured_percent;
+ obj._id = (NSInteger)a->id;
+ char url1[256];
+ if (rc_client_achievement_get_image_url(a, RC_CLIENT_ACHIEVEMENT_STATE_UNLOCKED, url1, sizeof(url1)) == RC_OK) {
+ obj.unlockedBadgeUrl = [NSString stringWithCString:url1 encoding:NSUTF8StringEncoding];
+ }
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [[NSNotificationCenter defaultCenter] postNotificationName:RetroAchievementsNotification object:obj];
+ });
+ }
}
}
diff --git a/Cores/Libretro/ui/drivers/cocoa/CheevosBridge.h b/Cores/Libretro/ui/drivers/cocoa/CheevosBridge.h
index c898d784..1fe5efc9 100644
--- a/Cores/Libretro/ui/drivers/cocoa/CheevosBridge.h
+++ b/Cores/Libretro/ui/drivers/cocoa/CheevosBridge.h
@@ -40,6 +40,8 @@
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, copy) NSString *_Nullable unlockedBadgeUrl;
@property (nonatomic, copy) NSString *_Nullable activeBadgeUrl;
+@property (nonatomic, assign) BOOL isMissable;
+@property (nonatomic, assign) BOOL isProgression;
@end
@@ -89,6 +91,18 @@
@property (nonatomic, copy) NSString *_Nullable _description;
@end
+@interface CheevosProgress : NSObject
+
+@property (nonatomic, assign) BOOL show;
+@property (nonatomic, assign) NSInteger points;
+@property (nonatomic, copy) NSString *_Nullable title;
+@property (nonatomic, copy) NSString *_Nullable measuredProgress;
+@property (nonatomic, assign) CGFloat measuredPercent;
+@property (nonatomic, assign) NSInteger _id;
+@property (nonatomic, copy) NSString *_Nullable unlockedBadgeUrl;
+
+@end
+
///登录结果
typedef NS_ENUM(NSUInteger, LoginResult) {
///成功
diff --git a/Cores/Libretro/ui/drivers/ui_cocoatouch.m b/Cores/Libretro/ui/drivers/ui_cocoatouch.m
index c2cfcdce..833ef72e 100644
--- a/Cores/Libretro/ui/drivers/ui_cocoatouch.m
+++ b/Cores/Libretro/ui/drivers/ui_cocoatouch.m
@@ -988,6 +988,7 @@ static BOOL RespectSilentMode = false;
return;
}
LibretroInitial = true;
+ set_libretro_is_going_to_stop(false);
char arguments[] = "retroarch";
char *argv[] = {arguments, NULL};
int argc = 1;
@@ -1052,6 +1053,7 @@ static BOOL RespectSilentMode = false;
- (void)stop {
if (!LibretroInitial) { return; }
LibretroInitial = false;
+ set_libretro_is_going_to_stop(true);
command_event(CMD_EVENT_CLOSE_CONTENT, NULL);
command_event(CMD_EVENT_UNLOAD_CORE, NULL);
rarch_stop_draw_observer();
diff --git a/KeyboardKit/KeyboardKit/SelectableCollectionKeyHandler.swift b/KeyboardKit/KeyboardKit/SelectableCollectionKeyHandler.swift
index 6ef80a8e..9ca0d642 100644
--- a/KeyboardKit/KeyboardKit/SelectableCollectionKeyHandler.swift
+++ b/KeyboardKit/KeyboardKit/SelectableCollectionKeyHandler.swift
@@ -392,7 +392,7 @@ private extension SelectableCollection {
- if offsetX < 0 {
+ if offsetX < 0 || scrollView.contentSize.width < scrollViewWidth {
offsetX = -insetLeft
} else if offsetX + scrollView.bounds.width - insetRight > scrollView.contentSize.width {
offsetX = scrollView.contentSize.width - scrollView.bounds.width + insetRight
diff --git a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
index e93d6e2c..c3f2cc80 100644
--- a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
+++ b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
@@ -669,6 +669,7 @@
57CCB3CD2D6775080036476B /* Database.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57CCB3CC2D6774F50036476B /* Database.swift */; };
57CCB3FF2D69B4050036476B /* ContextMenuButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57CCB3FE2D69B3FE0036476B /* ContextMenuButton.swift */; };
57CCB4172D69D1C30036476B /* HowToButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57CCB4162D69D1BE0036476B /* HowToButton.swift */; };
+ 57D029192E6C9C5200BF1F9D /* CheevosProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57D029182E6C9C4000BF1F9D /* CheevosProgressView.swift */; };
57D0BC0A2E1AD2BE008C3049 /* N64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57D0BC092E1AD2BB008C3049 /* N64.swift */; };
57D0BC0F2E1AD35D008C3049 /* mupen64plus.next.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 57D0BC0D2E1AD31A008C3049 /* mupen64plus.next.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
57DA89002D828C6A0074052A /* TKSwitchExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57DA88FF2D828C620074052A /* TKSwitchExtensions.swift */; };
@@ -837,6 +838,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 165A3334DE78D830F5BF67BC /* Pods-ManicEmu.sideloaddebug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ManicEmu.sideloaddebug.xcconfig"; path = "Target Support Files/Pods-ManicEmu/Pods-ManicEmu.sideloaddebug.xcconfig"; sourceTree = "<group>"; };
209AFDF51E7FF4D72ADD0678 /* Pods-ManicEmu.sideloadrelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ManicEmu.sideloadrelease.xcconfig"; path = "Target Support Files/Pods-ManicEmu/Pods-ManicEmu.sideloadrelease.xcconfig"; sourceTree = "<group>"; };
57047A092D85217400C62FF6 /* PurchaseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PurchaseView.swift; sourceTree = "<group>"; };
57047A0B2D852E7200C62FF6 /* FeaturesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturesView.swift; sourceTree = "<group>"; };
@@ -1602,6 +1604,7 @@
57913B482D5ED7D7004D51AA /* SaveItemCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SaveItemCollectionViewCell.swift; sourceTree = "<group>"; };
57913B522D5EF71D004D51AA /* DateExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateExtension.swift; sourceTree = "<group>"; };
579213522D95313800E88819 /* BaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNavigationController.swift; sourceTree = "<group>"; };
+ 579AB9D52E6C1118000868CB /* Config-SideloadDebug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-SideloadDebug.xcconfig"; sourceTree = "<group>"; };
579C114A2D1D0B1900CFD1F5 /* ApplicationSceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationSceneDelegate.swift; sourceTree = "<group>"; };
579C114C2D1D0E0A00CFD1F5 /* UIWindowExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIWindowExtensions.swift; sourceTree = "<group>"; };
57AD35E92D7DEB900092FD03 /* WebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewController.swift; sourceTree = "<group>"; };
@@ -1671,6 +1674,7 @@
57CCB3CC2D6774F50036476B /* Database.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Database.swift; sourceTree = "<group>"; };
57CCB3FE2D69B3FE0036476B /* ContextMenuButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContextMenuButton.swift; sourceTree = "<group>"; };
57CCB4162D69D1BE0036476B /* HowToButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HowToButton.swift; sourceTree = "<group>"; };
+ 57D029182E6C9C4000BF1F9D /* CheevosProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheevosProgressView.swift; sourceTree = "<group>"; };
57D0BC092E1AD2BB008C3049 /* N64.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = N64.swift; sourceTree = "<group>"; };
57D0BC0D2E1AD31A008C3049 /* mupen64plus.next.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mupen64plus.next.libretro.framework; path = ../Cores/mupen64plus.next.libretro.framework; sourceTree = SOURCE_ROOT; };
57DA88FF2D828C620074052A /* TKSwitchExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TKSwitchExtensions.swift; sourceTree = "<group>"; };
@@ -1893,6 +1897,7 @@
8716E0FB35012D3F5C750B94 /* Pods-ManicEmu.devrelease.xcconfig */,
7436F3E00AF2863DB4D7DBA6 /* Pods-ManicEmu.debugsimulator.xcconfig */,
209AFDF51E7FF4D72ADD0678 /* Pods-ManicEmu.sideloadrelease.xcconfig */,
+ 165A3334DE78D830F5BF67BC /* Pods-ManicEmu.sideloaddebug.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
@@ -3683,6 +3688,7 @@
57B6EC612D77F224002E619C /* Views */ = {
isa = PBXGroup;
children = (
+ 57D029182E6C9C4000BF1F9D /* CheevosProgressView.swift */,
5771C2092E6569B60062EDE0 /* LeaderboardView.swift */,
5720CACB2DB5558B0090C0F6 /* ThreeDSKeyboardView.swift */,
579076E22D8A98FC00ED90FB /* FunctionButtonContainerView.swift */,
@@ -4141,6 +4147,7 @@
57F456CF2DA98BB8007203AF /* Config-DevRelease.xcconfig */,
57E0363F2DBBE17100B222E1 /* Config-DebugSimulator.xcconfig */,
575A3A422DCEE9F300B28FC2 /* Config-SideloadRelease.xcconfig */,
+ 579AB9D52E6C1118000868CB /* Config-SideloadDebug.xcconfig */,
);
path = Resources;
sourceTree = "<group>";
@@ -4434,7 +4441,7 @@
);
mainGroup = A5A001E624555A5F006E0F0E;
packageReferences = (
- 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R.swift" */,
+ 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R" */,
57DF84BD2D637A1A00AA0AAB /* XCRemoteSwiftPackageReference "DominantColors" */,
57F632CC2D7050B9007270E8 /* XCRemoteSwiftPackageReference "SMBClient" */,
57F632E12D714E46007270E8 /* XCRemoteSwiftPackageReference "WebDAVKitSwift" */,
@@ -4445,12 +4452,12 @@
5717445C2DA264FF007CCE25 /* XCRemoteSwiftPackageReference "zstd" */,
5717445F2DA2652F007CCE25 /* XCRemoteSwiftPackageReference "OpenSSL" */,
571BB9382DA44D6B00830134 /* XCRemoteSwiftPackageReference "SwiftSDL2" */,
- 570F59BA2DC91FC8007BFD92 /* XCLocalSwiftPackageReference "ChromaColorPicker" */,
+ 570F59BA2DC91FC8007BFD92 /* XCLocalSwiftPackageReference "../ChromaColorPicker" */,
575A39CA2DCCFA6B00B28FC2 /* XCRemoteSwiftPackageReference "SwiftSoup" */,
570A27FE2DCF03CF001249C6 /* XCRemoteSwiftPackageReference "PLzmaSDK" */,
57F0D8492DE2E7A600760F57 /* XCRemoteSwiftPackageReference "SwiftCloudDrive" */,
5706B0BC2DFDE4570066122E /* XCRemoteSwiftPackageReference "BlurUIKit" */,
- 5744C6602E34D6E10088081A /* XCLocalSwiftPackageReference "KeyboardKit" */,
+ 5744C6602E34D6E10088081A /* XCLocalSwiftPackageReference "../KeyboardKit" */,
);
productRefGroup = A5A001F024555A5F006E0F0E /* Products */;
projectDirPath = "";
@@ -4516,10 +4523,14 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ManicEmu/Pods-ManicEmu-resources-${CONFIGURATION}-input-files.xcfilelist",
);
+ inputPaths = (
+ );
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-ManicEmu/Pods-ManicEmu-resources-${CONFIGURATION}-output-files.xcfilelist",
);
+ outputPaths = (
+ );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ManicEmu/Pods-ManicEmu-resources.sh\"\n";
@@ -5197,6 +5208,7 @@
57BFBE772DD336E000AABF98 /* main.swift in Sources */,
570F590E2DC5BAEE007BFD92 /* DesktopIconCollectionViewCell.swift in Sources */,
5770059E2D3E2EE300762E8F /* FileManagerExtensions.swift in Sources */,
+ 57D029192E6C9C5200BF1F9D /* CheevosProgressView.swift in Sources */,
57047A0A2D85217C00C62FF6 /* PurchaseView.swift in Sources */,
57EC6AB82D803810002920F0 /* PlayHistoryBlankSlateView.swift in Sources */,
B23E3DF22A0C9D9B0068EADA /* GradientView.swift in Sources */,
@@ -5227,7 +5239,7 @@
/* Begin PBXTargetDependency section */
576DD4482E0FFAC900644424 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
- productRef = 576DD4472E0FFAC900644424 /* plugin:RswiftGenerateInternalResources */;
+ productRef = 576DD4472E0FFAC900644424 /* RswiftGenerateInternalResources */;
};
57BFBEB12DD489C700AABF98 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
@@ -5744,6 +5756,325 @@
};
name = SideloadRelease;
};
+ 579AB9D62E6C114F000868CB /* SideloadDebug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ CURRENT_PROJECT_VERSION = "";
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = "$(inherited)";
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ MARKETING_VERSION = "";
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ OTHER_SWIFT_FLAGS = "";
+ SDKROOT = iphoneos;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ VALIDATE_PRODUCT = YES;
+ };
+ name = SideloadDebug;
+ };
+ 579AB9D72E6C114F000868CB /* SideloadDebug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 579AB9D52E6C1118000868CB /* Config-SideloadDebug.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color";
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CODE_SIGN_ENTITLEMENTS = ManicEmu/ManicEmu.entitlements;
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = "$(APP_BUILD_VERSION)";
+ DEVELOPMENT_TEAM = UU52N52JLD;
+ ENABLE_DEBUG_DYLIB = NO;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "$(inherited)",
+ "COCOAPODS=1",
+ "PB_FIELD_32BIT=1",
+ "PB_NO_PACKED_STRUCTS=1",
+ "PB_ENABLE_MALLOC=1",
+ );
+ INFOPLIST_FILE = ManicEmu/Resources/Info.plist;
+ INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@executable_path/Frameworks/MoltenVK.framework",
+ );
+ MARKETING_VERSION = 1.0.0;
+ OTHER_LDFLAGS = (
+ "$(inherited)",
+ "-ObjC",
+ "-l\"BetterSegmentedControl\"",
+ "-l\"BlankSlate\"",
+ "-l\"Closures\"",
+ "-l\"CloudServiceKit\"",
+ "-l\"CollectionViewPagingLayout\"",
+ "-l\"DNSPageView\"",
+ "-l\"Device\"",
+ "-l\"Fireworks\"",
+ "-l\"FluentDarkModeKit\"",
+ "-l\"GCDWebServer\"",
+ "-l\"HXPhotoPicker\"",
+ "-l\"Haptica\"",
+ "-l\"IQKeyboardCore\"",
+ "-l\"IQKeyboardManagerSwift\"",
+ "-l\"IQKeyboardNotification\"",
+ "-l\"IQKeyboardReturnManager\"",
+ "-l\"IQKeyboardToolbar\"",
+ "-l\"IQKeyboardToolbarManager\"",
+ "-l\"IQTextInputViewNotification\"",
+ "-l\"IQTextView\"",
+ "-l\"IceCream\"",
+ "-l\"JXBanner\"",
+ "-l\"JXPageControl\"",
+ "-l\"KeychainAccess\"",
+ "-l\"ManicEmuCore\"",
+ "-l\"MarqueeLabel\"",
+ "-l\"MelonDSDeltaCore\"",
+ "-l\"NVActivityIndicatorView\"",
+ "-l\"OAuthSwift\"",
+ "-l\"Permission\"",
+ "-l\"ProHUD\"",
+ "-l\"Realm\"",
+ "-l\"RealmSwift\"",
+ "-l\"SFSafeSymbols\"",
+ "-l\"SSZipArchive\"",
+ "-l\"Schedule\"",
+ "-l\"SideMenu\"",
+ "-l\"SnapKit\"",
+ "-l\"SwifterSwift\"",
+ "-l\"SwipeCellKit\"",
+ "-l\"TKSwitcherCollection\"",
+ "-l\"Tiercel\"",
+ "-l\"VisualEffectView\"",
+ "-l\"ZIPFoundation\"",
+ "-l\"c++\"",
+ "-l\"compression\"",
+ "-l\"iCloudSync\"",
+ "-l\"iconv\"",
+ "-l\"realm-monorepo\"",
+ "-l\"resolv\"",
+ "-l\"sqlite3\"",
+ "-l\"swiftCoreGraphics\"",
+ "-l\"z\"",
+ "-l\"ThreeDS\"",
+ "-framework",
+ "\"CFNetwork\"",
+ "-framework",
+ "\"Combine\"",
+ "-framework",
+ "\"CoreMotion\"",
+ "-framework",
+ "\"CoreServices\"",
+ "-framework",
+ "\"CoreTelephony\"",
+ "-framework",
+ "\"Foundation\"",
+ "-framework",
+ "\"Photos\"",
+ "-framework",
+ "\"PhotosUI\"",
+ "-framework",
+ "\"QuartzCore\"",
+ "-framework",
+ "\"SafariServices\"",
+ "-framework",
+ "\"Security\"",
+ "-framework",
+ "\"SystemConfiguration\"",
+ "-framework",
+ "\"UIKit\"",
+ "-framework",
+ "\"UMCommon\"",
+ "-framework",
+ "\"UMDevice\"",
+ "-framework",
+ "\"UniversalDetector\"",
+ "-weak_framework",
+ "\"AuthenticationServices\"",
+ "-weak_framework",
+ "\"Combine\"",
+ "-weak_framework",
+ "\"Speech\"",
+ "-weak_framework",
+ "\"SwiftUI\"",
+ "-weak_framework",
+ "\"UIKit\"",
+ );
+ OTHER_SWIFT_FLAGS = "$(inherited)";
+ PRODUCT_BUNDLE_IDENTIFIER = "${APP_BUNDLE_IDENTIFIER}";
+ "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = "${APP_BUNDLE_IDENTIFIER}";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ PROVISIONING_PROFILE_SPECIFIER = "";
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+ SUPPORTS_MACCATALYST = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "STATIC_LIBRARY SIDE_LOAD CRASH_COLLECT";
+ SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ };
+ name = SideloadDebug;
+ };
+ 579AB9D82E6C114F000868CB /* SideloadDebug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = NO;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO;
+ CODE_SIGN_STYLE = Automatic;
+ DEVELOPMENT_TEAM = UU52N52JLD;
+ ENABLE_USER_SCRIPT_SANDBOXING = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_OPTIMIZATION_LEVEL = s;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ CPPHTTPLIB_OPENSSL_SUPPORT,
+ ENABLE_VULKAN,
+ HAVE_OPENAL,
+ HAVE_SDL2,
+ CITRA_ARCH_arm64,
+ HAVE_COREAUDIO,
+ VULKAN_HPP_NO_TO_STRING,
+ HAVE_AUDIOTOOLBOX,
+ );
+ "GCC_WARN_64_TO_32_BIT_CONVERSION[arch=*64]" = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(SRCROOT)/../Cores/Citra/Dependencies",
+ "$(SRCROOT)/../Cores/Citra/Dependencies/dds-ktx",
+ "$(SRCROOT)/../Cores/Citra/Dependencies/httplib",
+ "$(SRCROOT)/../Cores/Citra/Dependencies/lodepng",
+ "$(SRCROOT)/../Cores/Citra/Dependencies/microprofile",
+ "$(SRCROOT)/../Cores/Citra/Dependencies/nlohmann",
+ "$(SRCROOT)/../MoltenVK/MoltenVK/include",
+ );
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ LIBRARY_SEARCH_PATHS = (
+ "$(inherited)",
+ "$(SRCROOT)/../Cores/Citra/Dependencies/XCFrameworks",
+ /opt/homebrew/Cellar/boost/1.88.0/lib,
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACH_O_TYPE = staticlib;
+ ONLY_ACTIVE_ARCH = NO;
+ OTHER_LDFLAGS = "-ObjC";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
+ SUPPORTS_MACCATALYST = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SWIFT_OBJC_BRIDGING_HEADER = "ThreeDS/Custom/Citra-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ SWIFT_VERSION = 5.0;
+ SYSTEM_FRAMEWORK_SEARCH_PATHS = "";
+ SYSTEM_HEADER_SEARCH_PATHS = (
+ /usr/local/include,
+ "$(HOME)/VulkanSDK/1.4.309.0/macOS/include",
+ "$(HOME)/VulkanSDK/1.4.309.0/macOS/include/vma",
+ /opt/homebrew/Cellar/boost/1.88.0/include,
+ );
+ TARGETED_DEVICE_FAMILY = "1,2";
+ USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/../Cores/Citra/Core/include";
+ };
+ name = SideloadDebug;
+ };
+ 579AB9D92E6C114F000868CB /* SideloadDebug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = 57BFBE4A2DD3322B00AABF98 /* LibretroConfig.xcconfig */;
+ buildSettings = {
+ ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
+ CLANG_CXX_LANGUAGE_STANDARD = "c++11";
+ CODE_SIGN_IDENTITY = "Apple Development";
+ CODE_SIGN_STYLE = Automatic;
+ CURRENT_PROJECT_VERSION = 1;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ DEFINES_MODULE = YES;
+ DEVELOPMENT_TEAM = UU52N52JLD;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ DYLIB_INSTALL_NAME_BASE = "@rpath";
+ ENABLE_MODULE_VERIFIER = YES;
+ ENABLE_USER_SCRIPT_SANDBOXING = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu17;
+ GCC_OPTIMIZATION_LEVEL = s;
+ GENERATE_INFOPLIST_FILE = YES;
+ INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2025 Aoshuang. All rights reserved.";
+ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
+ IPHONEOS_DEPLOYMENT_TARGET = 15.0;
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/Frameworks",
+ "@executable_path/Frameworks/MoltenVK.framework",
+ );
+ LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
+ MACH_O_TYPE = mh_dylib;
+ MARKETING_VERSION = 1.0;
+ MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++";
+ MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20";
+ PRODUCT_BUNDLE_IDENTIFIER = com.aoshuang.Libretro;
+ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
+ SKIP_INSTALL = YES;
+ SWIFT_EMIT_LOC_STRINGS = YES;
+ TARGETED_DEVICE_FAMILY = "1,2";
+ VERSIONING_SYSTEM = "apple-generic";
+ VERSION_INFO_PREFIX = "";
+ };
+ name = SideloadDebug;
+ };
57BFBE212DD32F7700AABF98 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 57BFBE4A2DD3322B00AABF98 /* LibretroConfig.xcconfig */;
@@ -5881,7 +6212,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
- DEBUG_INFORMATION_FORMAT = dwarf;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = UU52N52JLD;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -6986,6 +7317,7 @@
57E0363E2DBBE13100B222E1 /* DebugSimulator */,
5717441D2DA2637F007CCE25 /* Release */,
575A3A402DCEE98500B28FC2 /* SideloadRelease */,
+ 579AB9D82E6C114F000868CB /* SideloadDebug */,
57F456CA2DA9782C007203AF /* DevRelease */,
);
defaultConfigurationIsVisible = 0;
@@ -6998,6 +7330,7 @@
57BFBE222DD32F7700AABF98 /* DebugSimulator */,
57BFBE232DD32F7700AABF98 /* Release */,
57BFBE242DD32F7700AABF98 /* SideloadRelease */,
+ 579AB9D92E6C114F000868CB /* SideloadDebug */,
57BFBE252DD32F7700AABF98 /* DevRelease */,
);
defaultConfigurationIsVisible = 0;
@@ -7010,6 +7343,7 @@
57E0363C2DBBE13100B222E1 /* DebugSimulator */,
A5A0020224555A5F006E0F0E /* Release */,
575A3A3E2DCEE98500B28FC2 /* SideloadRelease */,
+ 579AB9D62E6C114F000868CB /* SideloadDebug */,
57F456C82DA9782C007203AF /* DevRelease */,
);
defaultConfigurationIsVisible = 0;
@@ -7022,6 +7356,7 @@
57E0363D2DBBE13100B222E1 /* DebugSimulator */,
A5A0020524555A5F006E0F0E /* Release */,
575A3A3F2DCEE98500B28FC2 /* SideloadRelease */,
+ 579AB9D72E6C114F000868CB /* SideloadDebug */,
57F456C92DA9782C007203AF /* DevRelease */,
);
defaultConfigurationIsVisible = 0;
@@ -7030,11 +7365,11 @@
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
- 570F59BA2DC91FC8007BFD92 /* XCLocalSwiftPackageReference "ChromaColorPicker" */ = {
+ 570F59BA2DC91FC8007BFD92 /* XCLocalSwiftPackageReference "../ChromaColorPicker" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = ../ChromaColorPicker;
};
- 5744C6602E34D6E10088081A /* XCLocalSwiftPackageReference "KeyboardKit" */ = {
+ 5744C6602E34D6E10088081A /* XCLocalSwiftPackageReference "../KeyboardKit" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = ../KeyboardKit;
};
@@ -7105,7 +7440,7 @@
minimumVersion = 2.8.7;
};
};
- 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R.swift" */ = {
+ 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/mac-cain13/R.swift";
requirement = {
@@ -7231,12 +7566,12 @@
};
576060282D24E8BD00A98B0C /* RswiftLibrary */ = {
isa = XCSwiftPackageProductDependency;
- package = 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R.swift" */;
+ package = 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R" */;
productName = RswiftLibrary;
};
- 576DD4472E0FFAC900644424 /* plugin:RswiftGenerateInternalResources */ = {
+ 576DD4472E0FFAC900644424 /* RswiftGenerateInternalResources */ = {
isa = XCSwiftPackageProductDependency;
- package = 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R.swift" */;
+ package = 576060272D24E8BD00A98B0C /* XCRemoteSwiftPackageReference "R" */;
productName = "plugin:RswiftGenerateInternalResources";
};
57DA89122D82B0C20074052A /* SmartCodable */ = {
diff --git a/ManicEmu/ManicEmu/Resources/Config-SideloadDebug.xcconfig b/ManicEmu/ManicEmu/Resources/Config-SideloadDebug.xcconfig
new file mode 100644
index 00000000..85a4ef28
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Config-SideloadDebug.xcconfig
@@ -0,0 +1,16 @@
+//
+// Config-SideloadDebug.xcconfig
+// ManicEmu
+//
+// Created by Daiuno on 2025/5/10.
+// Copyright © 2025 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+// Configuration settings file format documentation can be found at:
+// https://help.apple.com/xcode/#/dev745c5c974
+
+#include "Pods/Target Support Files/Pods-ManicEmu/Pods-ManicEmu.sideloaddebug.xcconfig"
+#include "ManicEmu/Resources/Config-Base.xcconfig"
+
+GCC_PREPROCESSOR_DEFINITIONS[config=SideloadDebug] = $(inherited) CRASH_COLLECT=1
diff --git a/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift b/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift
index dfbbe1af..2d1bada4 100644
--- a/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift
@@ -51,12 +51,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
//注册模拟器核心
System.allCores.forEach { ManicEmu.register($0) }
-
-#if !SIDE_LOAD
- //友盟初始化
+
+#if CRASH_COLLECT
+ //收集闪退日志
+ let apmConfig = UMAPMConfig.default()
+ apmConfig.crashAndBlockMonitorEnable = true
+ apmConfig.javaScriptBridgeEnable = false
+ apmConfig.launchMonitorEnable = false
+ apmConfig.logCollectEnable = false
+ apmConfig.memMonitorEnable = false
+ apmConfig.networkEnable = false
+ apmConfig.oomMonitorEnable = false
+ apmConfig.pageMonitorEnable = false
+ apmConfig.logCollectEnable = false
+ UMCrashConfigure.setAPMConfig(apmConfig)
+#endif
+ //友盟初始化 用于统计安装数量
MobClick.setAutoPageEnabled(true)
UMConfigure.initWithAppkey(Constants.Cipher.UMAppKey, channel: nil);
-#endif
+
//启动游戏手柄监听
ExternalGameControllerUtils.shared.startDetecting()
//启动游戏手柄点击监听
diff --git a/ManicEmu/ManicEmu/Sources/Base/Bridging-Header.h b/ManicEmu/ManicEmu/Sources/Base/Bridging-Header.h
index 2bf4bba2..07dc730f 100644
--- a/ManicEmu/ManicEmu/Sources/Base/Bridging-Header.h
+++ b/ManicEmu/ManicEmu/Sources/Base/Bridging-Header.h
@@ -15,3 +15,7 @@
#import <UMCommon/UMCommon.h>
#import <UniversalDetector/UniversalDetector.h>
#import <Libretro/LibretroCore.h>
+#if CRASH_COLLECT
+#import <UMAPM/UMAPMConfig.h>
+#import <UMAPM/UMCrashConfigure.h>
+#endif
diff --git a/ManicEmu/ManicEmu/Sources/Base/Constants.swift b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
index 97a6fde4..f95c1693 100644
--- a/ManicEmu/ManicEmu/Sources/Base/Constants.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
@@ -241,7 +241,7 @@ struct Constants {
static let OneDriveSecrectKey = ""
static let AliYunAppId = ""
static let AliYunSecrectKey = ""
- static let UMAppKey = ""
+ static let UMAppKey = "6"._7.d.b._7.c._6.c._4._8.a.c._1.b._4.f._8._7.f._0._8.e._9.a
static let CLoudflareAPIToken = ""
static let UnzipKey = "123456"
static let DeepSeek = ""
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
index 9c5ccee4..e6808880 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
@@ -121,7 +121,11 @@ class GamesViewController: BaseViewController {
if empty {
self.gamesToolView.stopSearch()
}
- self.gamesToolView.isHidden = empty
+ if UIDevice.isPhone && UIDevice.isLandscape {
+ self.gamesToolView.isHidden = true
+ } else {
+ self.gamesToolView.isHidden = empty
+ }
}
return view
}()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
index 1f568b26..452ac553 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
@@ -93,6 +93,8 @@ class PlayViewController: GameViewController {
private var kvoContext = 0
//排行榜控件
private var leaderboardView: LeaderboardView? = nil
+ //进度控件
+ private var progressView: CheevosProgressView? = nil
deinit {
Log.debug("\(String(describing: Self.self)) deinit")
@@ -173,6 +175,8 @@ class PlayViewController: GameViewController {
private var isWFCConnect = false
///是否处于硬核模式
private var isHardcoreMode = false
+ ///是否是首次设置GB的调色盘
+ private var isFirstTimeSetGBPalette = true;
static func startGame(game: Game, saveState: GameSaveState? = nil) {
if game.isRomExtsts || game.isNDSHomeMenuGame {
@@ -444,7 +448,16 @@ class PlayViewController: GameViewController {
self.showRetroAchievements(title: R.string.localizable.leaderboardStart() + title, message: description, hideIcon: true);
}
- } else if let message = notification.object as? String {
+ } else if let cheevosProgress = notification.object as? CheevosProgress {
+ //排行榜追踪
+ if let progressView = self.progressView {
+ if cheevosProgress.show {
+ progressView.updateProgress(cheevosProgress)
+ } else {
+ progressView.removeProgress(id: cheevosProgress._id)
+ }
+ }
+ } else if let message = notification.object as? String {
UIView.makeToast(message: message)
}
})
@@ -1576,6 +1589,12 @@ extension PlayViewController {
LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.PokeMini.name, key: "pokemini_palette", value: item.palette.paletteTitleForPM, reload: true)
} else if manicGame.gameType == .gb {
LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.Gambatte.name, configs: ["gambatte_gb_colorization": item.palette == .None ? "disabled" : "internal", "gambatte_gb_internal_palette": item.palette.option], reload: true)
+ if isFirstTimeSetGBPalette {
+ isFirstTimeSetGBPalette = false
+ DispatchQueue.main.asyncAfter(delay: 1) {
+ LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.Gambatte.name, configs: ["gambatte_gb_colorization": item.palette == .None ? "disabled" : "internal", "gambatte_gb_internal_palette": item.palette.option], reload: true)
+ }
+ }
}
}
case .swapDisk:
@@ -1992,6 +2011,7 @@ extension PlayViewController {
"cheevos_username": user.username])
if enableAchievements {
updateLeaderboard()
+ updateProgress()
}
} else {
LibretroCore.sharedInstance().updateLibretroConfig("cheevos_enable", value: "false")
@@ -2665,6 +2685,19 @@ extension PlayViewController {
}
}
+ private func updateProgress() {
+ if progressView == nil {
+ let progressView = CheevosProgressView()
+ view.addSubview(progressView)
+ progressView.snp.makeConstraints { make in
+ make.leading.trailing.bottom.equalTo(self.gameView)
+ make.height.equalTo(32)
+ }
+ progressView.isHidden = true
+ self.progressView = progressView
+ }
+ }
+
private func getMenuInset() -> UIEdgeInsets? {
var menuInsets: UIEdgeInsets? = nil
if let traits = controllerView.controllerSkinTraits, let insets = controllerView.controllerSkin?.menuInsets(for: traits) {
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosProgressView.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosProgressView.swift
new file mode 100644
index 00000000..0269f8c8
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosProgressView.swift
@@ -0,0 +1,188 @@
+//
+// CheevosProgressView.swift
+// ManicEmu
+//
+// Created by Daiuno on 2025/9/7.
+// Copyright © 2025 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import UIKit
+
+class CheevosProgressDetailView: UIView {
+ let coverImageView: UIImageView = {
+ let view = UIImageView()
+ view.contentMode = .scaleAspectFill
+ view.layerCornerRadius = 4
+ return view
+ }()
+
+ let titleLabel: UILabel = {
+ let view = UILabel()
+ view.font = Constants.Font.caption(size: .l)
+ view.textColor = Constants.Color.LabelPrimary
+ return view
+ }()
+
+ private let progressLabel: UILabel = {
+ let view = UILabel()
+ view.font = Constants.Font.caption(size: .s)
+ view.textColor = Constants.Color.Yellow
+ return view
+ }()
+
+ let progressView: RetroAchievementsListCell.AchievementsProgressView = {
+ let view = RetroAchievementsListCell.AchievementsProgressView()
+ return view
+ }()
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+
+ alpha = 0.75
+
+ addSubview(coverImageView)
+ coverImageView.snp.makeConstraints { make in
+ make.width.equalTo(28)
+ make.top.bottom.leading.equalToSuperview().inset(2)
+ }
+
+ addSubview(titleLabel)
+ titleLabel.setContentHuggingPriority(.required, for: .horizontal)
+ titleLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
+ titleLabel.snp.makeConstraints { make in
+ make.leading.equalTo(coverImageView.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
+ make.top.equalToSuperview().offset(Constants.Size.ContentSpaceUltraTiny)
+ make.trailing.lessThanOrEqualToSuperview()
+ }
+
+ addSubview(progressView)
+ progressView.snp.makeConstraints { make in
+ make.leading.equalTo(coverImageView.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
+ make.height.equalTo(2)
+ make.bottom.equalToSuperview().offset(-Constants.Size.ContentSpaceTiny)
+ }
+
+ addSubview(progressLabel)
+ progressLabel.snp.makeConstraints { make in
+ make.leading.equalTo(progressView.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
+ make.centerY.equalTo(progressView)
+ make.trailing.equalToSuperview()
+ }
+
+ // 给最小宽度避免系统加 width == 0 的临时约束
+ self.snp.makeConstraints { make in
+ make.width.greaterThanOrEqualTo(60)
+ }
+ }
+
+ func updateProgress(_ progress: CheevosProgress) {
+ coverImageView.kf.setImage(
+ with: URL(string: progress.unlockedBadgeUrl),
+ placeholder: UIImage.placeHolder(preferenceSize: .init(32))
+ )
+ titleLabel.text = (progress.title ?? "") + " (\(progress.points) points)"
+ progressView.progress = progress.measuredPercent
+ progressLabel.text = progress.measuredProgress ?? ""
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+}
+
+// MARK: - Scroll Container
+// MARK: - 容器
+class CheevosProgressView: UIView {
+
+ private let stackView = UIStackView()
+ private var progressViewDict: [Int: CheevosProgressDetailView] = [:]
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ setupUI()
+ }
+
+ required init?(coder: NSCoder) {
+ super.init(coder: coder)
+ setupUI()
+ }
+
+ private func setupUI() {
+ backgroundColor = Constants.Color.BackgroundPrimary.withAlphaComponent(0.4)
+
+ stackView.axis = .horizontal
+ stackView.alignment = .fill
+ stackView.distribution = .fillEqually // 平分宽度
+ stackView.spacing = Constants.Size.ContentSpaceMin
+ addSubview(stackView)
+
+ stackView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+ }
+
+ // MARK: - Public API
+
+ func updateProgress(_ progress: CheevosProgress) {
+ if isHidden { isHidden = false }
+
+ if let view = progressViewDict[progress._id] {
+ view.updateProgress(progress)
+ } else {
+ let view = CheevosProgressDetailView()
+ view.updateProgress(progress)
+ configureCompressionResistance(for: view)
+ stackView.addArrangedSubview(view)
+ progressViewDict[progress._id] = view
+ }
+ updateLayoutForSingleView()
+ }
+
+ func removeProgress(id: Int) {
+ if let view = progressViewDict[id] {
+ stackView.removeArrangedSubview(view)
+ view.removeFromSuperview()
+ progressViewDict.removeValue(forKey: id)
+ }
+ if progressViewDict.isEmpty {
+ isHidden = true
+ }
+ updateLayoutForSingleView()
+ }
+
+ // MARK: - Layout
+
+ private func updateLayoutForSingleView() {
+ if stackView.arrangedSubviews.count == 1 {
+ stackView.distribution = .fill
+ stackView.alignment = .center
+ stackView.snp.remakeConstraints { make in
+ make.top.bottom.equalToSuperview()
+ make.centerX.equalToSuperview()
+ make.width.equalTo(285)
+ }
+ } else {
+ stackView.distribution = .fillEqually
+ stackView.alignment = .fill
+ stackView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+ }
+ }
+
+ private func configureCompressionResistance(for view: CheevosProgressDetailView) {
+ // coverImageView 保证最优先显示
+ view.coverImageView.setContentCompressionResistancePriority(.required, for: .horizontal)
+ view.coverImageView.setContentHuggingPriority(.required, for: .horizontal)
+
+ // titleLabel 允许压缩,字体可缩小
+ view.titleLabel.adjustsFontSizeToFitWidth = true
+ view.titleLabel.minimumScaleFactor = 0.6
+ view.titleLabel.lineBreakMode = .byTruncatingTail
+ view.titleLabel.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
+
+ // progressView 次要,可以被压缩
+ view.progressView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
+ }
+}
diff --git a/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementsListCell.swift b/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementsListCell.swift
index db3116ce..04de69d7 100644
--- a/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementsListCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementsListCell.swift
@@ -22,12 +22,40 @@ class RetroAchievementsListCell: UICollectionViewCell {
return view
}()
+ private let missableImageView: SymbolButton = {
+ let view = SymbolButton(image: UIImage(symbol: .exclamationmarkCircle, font: Constants.Font.caption(size: .l), color: .white))
+ view.enableRoundCorner = true
+ view.backgroundColor = .black
+ view.isHidden = true
+ return view
+ }()
+
+ private let progressionImageView: SymbolButton = {
+ let view = SymbolButton(image: UIImage(symbol: .clockBadgeCheckmark, font: Constants.Font.caption(size: .l), color: .white))
+ view.enableRoundCorner = true
+ view.backgroundColor = .black
+ view.isHidden = true
+ return view
+ }()
+
override init(frame: CGRect) {
super.init(frame: frame)
addSubview(imageView)
imageView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
+
+ imageView.addSubview(missableImageView)
+ missableImageView.snp.makeConstraints { make in
+ make.top.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceUltraTiny)
+ make.size.equalTo(15)
+ }
+
+ imageView.addSubview(progressionImageView)
+ progressionImageView.snp.makeConstraints { make in
+ make.top.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceUltraTiny)
+ make.size.equalTo(15)
+ }
}
required init?(coder: NSCoder) {
@@ -50,6 +78,27 @@ class RetroAchievementsListCell: UICollectionViewCell {
}
}
imageView.kf.setImage(with: URL(string: url), placeholder: UIImage.placeHolder(preferenceSize: .init(64)))
+ if achievement.isMissable && achievement.isProgression {
+ missableImageView.snp.updateConstraints { make in
+ make.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceUltraTiny * 2 + 13)
+ }
+ missableImageView.isHidden = false
+ progressionImageView.isHidden = false
+ } else {
+ missableImageView.snp.updateConstraints { make in
+ make.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceUltraTiny)
+ }
+ if achievement.isMissable {
+ missableImageView.isHidden = false
+ progressionImageView.isHidden = true
+ } else if achievement.isProgression {
+ missableImageView.isHidden = true
+ progressionImageView.isHidden = false
+ } else {
+ missableImageView.isHidden = true
+ progressionImageView.isHidden = true
+ }
+ }
}
}
diff --git a/ManicEmu/Podfile b/ManicEmu/Podfile
index ace56039..ad2ee58a 100644
--- a/ManicEmu/Podfile
+++ b/ManicEmu/Podfile
@@ -27,6 +27,7 @@ target 'ManicEmu' do
pod 'RealmSwift', '= 10.54.2'
pod 'UMCommon', '~> 7.5.2'
+ pod 'UMAPM', '~> 2.0.3', :configurations => ['SideloadDebug']
pod 'Fireworks', :git => 'https://github.com/tomkowz/fireworks.git', :branch => 'master'
pod 'SnapKit', '~> 5.0'
pod 'SwifterSwift', '~> 7.0'
diff --git a/ManicEmu/Podfile.lock b/ManicEmu/Podfile.lock
index 6ef0c021..a4659118 100644
--- a/ManicEmu/Podfile.lock
+++ b/ManicEmu/Podfile.lock
@@ -182,6 +182,8 @@ PODS:
- SwipeCellKit (2.7.1)
- Tiercel (3.2.5)
- TKSwitcherCollection (1.4.3)
+ - UMAPM (2.0.4):
+ - UMCommon
- UMCommon (7.5.2):
- UMDevice
- UMDevice (3.4.0)
@@ -231,6 +233,7 @@ DEPENDENCIES:
- SwipeCellKit (from `../SwipeCellKit`)
- Tiercel (~> 3.0)
- TKSwitcherCollection (from `../TKSwitcherCollection`)
+ - UMAPM (~> 2.0.3)
- UMCommon (~> 7.5.2)
- VisualEffectView (~> 5.0)
- ZIPFoundation (from `../ZIPFoundation`)
@@ -268,6 +271,7 @@ SPEC REPOS:
- SQLite.swift
- SwifterSwift
- Tiercel
+ - UMAPM
- UMCommon
- UMDevice
- VisualEffectView
@@ -378,11 +382,12 @@ SPEC CHECKSUMS:
SwipeCellKit: 3972254a826da74609926daf59b08d6c72e619ea
Tiercel: c0a73f876a72800333b15f4e7e48791f4ad21e90
TKSwitcherCollection: 6805f52958a8b661cd583a538345618a26ff9263
+ UMAPM: f038b65a3df4fe8e2df3245642d84cff7f5f63c8
UMCommon: 72513a01ebca2dead52f2112b4d7c6196dbbe412
UMDevice: dcdf7ec167387837559d149fbc7d793d984faf82
VisualEffectView: 173e1fabc2eb37af663547e14dc12efef7d2da8b
ZIPFoundation: b8c29ea7ae353b309bc810586181fd073cb3312c
-PODFILE CHECKSUM: c6716083ae00e5f7023f75cbece2ea336910aced
+PODFILE CHECKSUM: 570e357ed3877f57dbb0dd44fdb25cdad74f5568
COCOAPODS: 1.16.2