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
Fix the issue where Dolphin core RetroAchievements cannot be recognized
Daiuno1285df69a61a
diff --git a/Cores/dolphin.libretro.framework/dolphin.libretro b/Cores/dolphin.libretro.framework/dolphin.libretroindex cffdbd54..202d8fb2 100755--- a/Cores/dolphin.libretro.framework/dolphin.libretro+++ b/Cores/dolphin.libretro.framework/dolphin.libretro@@ -1,3 +1,3 @@version https://git-lfs.github.com/spec/v1-oid sha256:6a3c4256f03b2a28a865e48761b61fa6ff039816797e1e73fd280ba1f358b923-size 21909072+oid sha256:ae31b8523e2ef97fce111d20e5e320214890f7db3d353f0480c5a344605a121a+size 21909584diff --git a/Dependencies/Libretro b/Dependencies/Libretroindex d3c30f1c..00689c83 160000--- a/Dependencies/Libretro+++ b/Dependencies/Libretro@@ -1 +1 @@-Subproject commit d3c30f1cb0d1945d978e1f64f3e9ec8cc2e0932c+Subproject commit 00689c83f4d458e061d5fd7b52a181b8d240fe65diff --git a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfigindex 77cdbc4e..7dc78b65 100644--- a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig+++ b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig@@ -11,7 +11,7 @@// https://help.apple.com/xcode/#/dev745c5c974APP_BUNDLE_IDENTIFIER = com.aoshuang.manicemu-APP_BUILD_VERSION = 11+APP_BUILD_VERSION = 12APP_VERSION = 2.0.1// Prebuilt cores under ProjectManicEMU/Cores (Citra.framework, *.libretro.framework, …)diff --git a/ManicEmu/ManicEmu/Sources/Base/Constants.swift b/ManicEmu/ManicEmu/Sources/Base/Constants.swiftindex 2831c295..fd14774d 100644--- a/ManicEmu/ManicEmu/Sources/Base/Constants.swift+++ b/ManicEmu/ManicEmu/Sources/Base/Constants.swift@@ -1170,6 +1170,8 @@ extension _R {static let HideGameRating = NSNotification.Name(rawValue: "HideGameRating")//GameMetadataChangestatic let GameMetadataChange = NSNotification.Name(rawValue: "GameMetadataChange")+ //show filter view for landscape mode+ static let ShowFilterForLandscapeMode = NSNotification.Name(rawValue: "ShowFilterForLandscapeMode")}struct _URLs {diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swiftindex 79b70534..05a023ff 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift@@ -299,7 +299,7 @@ class GameCoverView: BaseView {} else if gameTypeCategory == 2 {image = style == .style2 ? R.image.win98_cover_v() : R.image.win98_cover_h()}- } else if gameType == .xbox360 {+ } else if gameType == .xbox {image = style == .style2 ? R.image.xbox_cover_v() : R.image.xbox_cover_h()} else if gameType == .symbian {image = style == .style2 ? R.image.symbian_cover_v() : R.image.symbian_cover_h()diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swiftindex 82eed568..60b10dbf 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift@@ -424,7 +424,7 @@ class GameListLandscapeView: BaseView {})notificationTokens.append(center.addObserver(forName: R.NotificationName.GameMetadataChange, object: nil, queue: .main) { [weak self] notification in- guard let self = self, !R.Style.GameHideRating else { return }+ guard let self, !R.Style.GameHideRating else { return }guard let gameId = notification.object as? String else { return }if self.isCarouselEnabled,let row = self.displayGames.firstIndex(where: { $0.id == gameId }) {@@ -441,6 +441,11 @@ class GameListLandscapeView: BaseView {notificationTokens.append(center.addObserver(forName: .externalGameControllerDidDisconnect, object: nil, queue: .main, using: inputChange))notificationTokens.append(center.addObserver(forName: .externalKeyboardDidConnect, object: nil, queue: .main, using: inputChange))notificationTokens.append(center.addObserver(forName: .externalKeyboardDidDisconnect, object: nil, queue: .main, using: inputChange))++ notificationTokens.append(center.addObserver(forName: R.NotificationName.ShowFilterForLandscapeMode, object: nil, queue: .main) { [weak self] notification in+ guard let self else { return }+ self.showManufacturerFilterSheet()+ })}/// Hide when nothing is connected; Command glyph for keyboard-only, Select glyph when a gamepad is present.@@ -1601,7 +1606,7 @@ class GameListLandscapeView: BaseView {private func shiftCarouselPage(_ offset: Int) -> Bool {let count = carouselView.numberOfItems(inSection: 0)let next = carouselLayout.currentPage + offset- guard count > 0, next >= 0, next < count else { return false }+ guard count > 0, next >= 0, next < count else { return true }focusCarouselPage(next, animated: true)return true}diff --git a/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swiftindex dae61c67..d8f8e473 100644--- a/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Home/ViewControllers/HomeViewController.swift@@ -198,6 +198,9 @@ class HomeViewController: BaseViewController {NotificationCenter.default.post(name: R.NotificationName.ViewWillTransition, object: nil)}homeTabBarBlurView.isHidden = UIDevice.isLandscape+ if currentChildViewController is GamesViewController {+ updateGamesFocusCommands(focusContext: currentChildViewController.focusContext)+ }coordinator.animate(alongsideTransition: { [weak self] _ inguard let self else { return }if UIDevice.isPhone {@@ -343,17 +346,14 @@ class HomeViewController: BaseViewController {])if self.homeTabBar.currentSelection == .games {- context.addCommands([- FocusCommand(key: FocusKey("l1"), title: R.string.localizable.scrollToFirstGame(), action: { [weak self] in- self?.gamesViewController.scrollToFirstGame()- }),- FocusCommand(key: FocusKey("r1"), title: R.string.localizable.scrollToLastGame(), action: { [weak self] in- self?.gamesViewController.scrollToLastGame()- })- ])- } else {- context.removeCommands(for: FocusKey("l1"))- context.removeCommands(for: FocusKey("r1"))+ var commands = [FocusCommand(key: FocusKey("l1"), title: R.string.localizable.scrollToFirstGame(), action: { [weak self] in+ self?.gamesViewController.scrollToFirstGame()+ }),+ FocusCommand(key: FocusKey("r1"), title: R.string.localizable.scrollToLastGame(), action: { [weak self] in+ self?.gamesViewController.scrollToLastGame()+ })]+ self.updateGamesFocusCommands(focusContext: context)+ context.addCommands(commands)}context.onFocusChange = { [weak self] focusView, attemptedDirection in@@ -383,6 +383,17 @@ class HomeViewController: BaseViewController {shouldHandoffTabFocus = truehomeTabBar.currentSelection = newSelection}++ private func updateGamesFocusCommands(focusContext: FocusContext) {+ guard currentChildViewController is GamesViewController else { return }+ if UIDevice.isLandscape {+ focusContext.addCommand(FocusCommand(key: FocusKey("l3"), title: R.string.localizable.filterTitle(), action: {+ NotificationCenter.default.post(name: R.NotificationName.ShowFilterForLandscapeMode, object: nil)+ }))+ } else {+ focusContext.removeCommands(for: FocusKey("l3"))+ }+ }}extension HomeViewController: UIGestureRecognizerDelegate {diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swiftindex 378fe205..bea33e64 100644--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift@@ -1690,6 +1690,13 @@ class Game: Object, ObjectUpdatable {var isDolphinCore: Bool {gameType == .ngc || gameType == .wii}++ /// RC_CONSOLE_GAMECUBE (16) / RC_CONSOLE_WII (19) for Dolphin only; 0 keeps default hashing.+ var retroAchievementsConsoleId: UInt {+ if gameType == .ngc { return 16 }+ if gameType == .wii { return 19 }+ return 0+ }var supportSlowMotion: Bool {if isLibretroType && gameType != .symbian {diff --git a/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementListView.swift b/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementListView.swiftindex c7ccda28..2adcb211 100644--- a/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementListView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/RetroAchievements/Views/RetroAchievementListView.swift@@ -84,7 +84,9 @@ class RetroAchievementListView: BaseView {didShowLoading = true}- CheevosBridge.getCheevosGameInfo(gamePath, reuseInGameClient: PlayViewController.isGaming) { [weak self] result, cheevosGame in+ CheevosBridge.getCheevosGameInfo(gamePath,+ consoleId: game.retroAchievementsConsoleId,+ reuseInGameClient: PlayViewController.isGaming) { [weak self] result, cheevosGame inguard let self else { return }if didShowLoading {UIView.hideLoading()