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
Add background music and sound effects; add cover scraping.Bug fixes;
Daiunof67cf47dfa04
diff --git a/Cores/azahar.libretro.framework/azahar.libretro b/Cores/azahar.libretro.framework/azahar.libretroindex b9310d84..11f09e8b 100755--- a/Cores/azahar.libretro.framework/azahar.libretro+++ b/Cores/azahar.libretro.framework/azahar.libretro@@ -1,3 +1,3 @@version https://git-lfs.github.com/spec/v1-oid sha256:e807d1f4282a67595169748b7ebba5ed082ac298f12b116ea3e617468a2ef7b8-size 27783584+oid sha256:a806f9199c85cacc2e996db1eeb12335347ed8b6218fda5cdf76df0cd0dab3a0+size 27800000diff --git a/Cores/dolphin.libretro.framework/dolphin.libretro b/Cores/dolphin.libretro.framework/dolphin.libretroindex 3b13f24f..194ef48c 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:39b2f27ec7ab88231638ad9bc4f48570d7c53ef2fe32e75737a6a9cf9fef1985-size 15226256+oid sha256:d7333e32c3b492c65ccbc1279550d7b627fd6b7f7c83b926dacb97fedafc2643+size 15237264diff --git a/Dependencies/Libretro b/Dependencies/Libretroindex fb3950ea..9e88994b 160000--- a/Dependencies/Libretro+++ b/Dependencies/Libretro@@ -1 +1 @@-Subproject commit fb3950ea500e619f7af186e923d0419a35eb872f+Subproject commit 9e88994b39f5f42f0ec4e7553c0dcc1985470fd8diff --git a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj b/ManicEmu/ManicEmu.xcodeproj/project.pbxprojindex 0e4c61e0..68783586 100644--- a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj+++ b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj@@ -180,6 +180,15 @@576A7DAE2E3B4FD400008E35 /* mednafen.psx.hw.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 576A7DAA2E3B4FBC00008E35 /* mednafen.psx.hw.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };576C46312E16D9090008D087 /* MultiDiscDescCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C46302E16D8F20008D087 /* MultiDiscDescCollectionCell.swift */; };576C46352E16DA1B0008D087 /* MultiDiscItemCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C46342E16DA0D0008D087 /* MultiDiscItemCollectionCell.swift */; };+ 576C4BDD3041749100DB526E /* BackgroundMusicKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4BD83041748700DB526E /* BackgroundMusicKit.swift */; };+ 576C4BDE3041749100DB526E /* BackgroundMusicKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4BD83041748700DB526E /* BackgroundMusicKit.swift */; };+ 576C4BDF3041749100DB526E /* BackgroundMusicKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4BD83041748700DB526E /* BackgroundMusicKit.swift */; };+ 576C4BE7304174AA00DB526E /* FocusSoundEffects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4BE13041749900DB526E /* FocusSoundEffects.swift */; };+ 576C4BE8304174AA00DB526E /* FocusSoundEffects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4BE13041749900DB526E /* FocusSoundEffects.swift */; };+ 576C4BE9304174AA00DB526E /* FocusSoundEffects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4BE13041749900DB526E /* FocusSoundEffects.swift */; };+ 576C4C093041979700DB526E /* GameCoverScrapingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4C043041978C00DB526E /* GameCoverScrapingView.swift */; };+ 576C4C0A3041979700DB526E /* GameCoverScrapingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4C043041978C00DB526E /* GameCoverScrapingView.swift */; };+ 576C4C0B3041979700DB526E /* GameCoverScrapingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C4C043041978C00DB526E /* GameCoverScrapingView.swift */; };576C8C683032B5B700AEB08F /* IceCream in Frameworks */ = {isa = PBXBuildFile; productRef = 576C8C673032B5B700AEB08F /* IceCream */; };576C8C723032B5D800AEB08F /* IceCream in Frameworks */ = {isa = PBXBuildFile; productRef = 576C8C713032B5D800AEB08F /* IceCream */; };576C8C863032C96100AEB08F /* GameOptionTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 576C8C853032C95B00AEB08F /* GameOptionTypes.swift */; };@@ -1932,6 +1941,9 @@576A7DAA2E3B4FBC00008E35 /* mednafen.psx.hw.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mednafen.psx.hw.libretro.framework; path = ../Cores/mednafen.psx.hw.libretro.framework; sourceTree = SOURCE_ROOT; };576C46302E16D8F20008D087 /* MultiDiscDescCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiDiscDescCollectionCell.swift; sourceTree = "<group>"; };576C46342E16DA0D0008D087 /* MultiDiscItemCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiDiscItemCollectionCell.swift; sourceTree = "<group>"; };+ 576C4BD83041748700DB526E /* BackgroundMusicKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundMusicKit.swift; sourceTree = "<group>"; };+ 576C4BE13041749900DB526E /* FocusSoundEffects.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusSoundEffects.swift; sourceTree = "<group>"; };+ 576C4C043041978C00DB526E /* GameCoverScrapingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameCoverScrapingView.swift; sourceTree = "<group>"; };576C8C853032C95B00AEB08F /* GameOptionTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameOptionTypes.swift; sourceTree = "<group>"; };576C8D6A30332B2F00AEB08F /* ShaderToyScripts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShaderToyScripts.swift; sourceTree = "<group>"; };576F0DA42D85CD3900D2A1BA /* FeaturesCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeaturesCell.swift; sourceTree = "<group>"; };@@ -7210,6 +7222,7 @@576F0E042D88005800D2A1BA /* GameSavePurchaseGuideView.swift */,57F1A9172D7D25B600D0CC93 /* GameInfoView.swift */,57D9424F302CA8E100C06208 /* GameCoverModifyView.swift */,+ 576C4C043041978C00DB526E /* GameCoverScrapingView.swift */,57913B412D5ED722004D51AA /* GameInfoCoverView.swift */,57F1D4D02FFE10CC00FC5B2A /* GameInfoDetailView.swift */,575A39D32DCD9C7000B28FC2 /* LibretroCoverSearchView.swift */,@@ -12945,6 +12958,7 @@A5A69BA9256E56FF00D51C09 /* Others */ = {isa = PBXGroup;children = (+ 576C4BD83041748700DB526E /* BackgroundMusicKit.swift */,577EC55F2F7E561900E8E3EB /* UniversalScript.swift */,577EC5AA2F7E566700E8E3EB /* UniversalScript.c */,57DC7FFB2F52EC38004B6FFD /* WeakScriptMessageHandler.swift */,@@ -13082,6 +13096,7 @@F0C5000000000000000000FF /* FocusKit */ = {isa = PBXGroup;children = (+ 576C4BE13041749900DB526E /* FocusSoundEffects.swift */,57F1D4FB2FFF58B400FC5B2A /* FocusKeyObserver.swift */,F0C500000000000000000101 /* FocusTypes.swift */,F0C500000000000000000102 /* Focusable.swift */,@@ -13479,6 +13494,7 @@5790938F303C7D9100A53656 /* FocusContext.swift in Sources */,57909390303C7D9100A53656 /* FocusEngine.swift in Sources */,57909391303C7D9100A53656 /* FocusCollectionView.swift in Sources */,+ 576C4C093041979700DB526E /* GameCoverScrapingView.swift in Sources */,57909392303C7D9100A53656 /* FocusSystem.swift in Sources */,57909393303C7D9100A53656 /* FocusSystem+UIViewController.swift in Sources */,57909394303C7D9100A53656 /* CheersView.swift in Sources */,@@ -13486,6 +13502,7 @@57909396303C7D9100A53656 /* SNES.swift in Sources */,57909397303C7D9100A53656 /* GameOptionsView.swift in Sources */,57909398303C7D9100A53656 /* ASButton.swift in Sources */,+ 576C4BDE3041749100DB526E /* BackgroundMusicKit.swift in Sources */,57909399303C7D9100A53656 /* PurchaseButtonReusableView.swift in Sources */,5790939A303C7D9100A53656 /* ControllerMapping.swift in Sources */,5790939B303C7D9100A53656 /* GB.swift in Sources */,@@ -13513,6 +13530,7 @@579093B1303C7D9100A53656 /* ShaderPreviewView.swift in Sources */,579093B2303C7D9100A53656 /* PretendoNetworkingView.swift in Sources */,579093B3303C7D9100A53656 /* CheevosPopupView.swift in Sources */,+ 576C4BE9304174AA00DB526E /* FocusSoundEffects.swift in Sources */,579093B4303C7D9100A53656 /* GlobalCoreSwitch.swift in Sources */,579093B5303C7D9100A53656 /* ASListCustomCollectionCell.swift in Sources */,579093B6303C7D9100A53656 /* ASSheetView.swift in Sources */,@@ -13926,6 +13944,7 @@F0C500000000000000000204 /* FocusContext.swift in Sources */,F0C500000000000000000205 /* FocusEngine.swift in Sources */,F0C500000000000000000206 /* FocusCollectionView.swift in Sources */,+ 576C4C0A3041979700DB526E /* GameCoverScrapingView.swift in Sources */,F0C500000000000000000207 /* FocusSystem.swift in Sources */,F0C500000000000000000208 /* FocusSystem+UIViewController.swift in Sources */,57CDCD8C2FD5CBD3005BA4C8 /* CheersView.swift in Sources */,@@ -13933,6 +13952,7 @@57CDCD8F2FD5CBD3005BA4C8 /* SNES.swift in Sources */,57F1D4A92FF630D000FC5B2A /* GameOptionsView.swift in Sources */,5796DB202FE4184D0051F661 /* ASButton.swift in Sources */,+ 576C4BDD3041749100DB526E /* BackgroundMusicKit.swift in Sources */,57CDCD912FD5CBD3005BA4C8 /* PurchaseButtonReusableView.swift in Sources */,57CDCD922FD5CBD3005BA4C8 /* ControllerMapping.swift in Sources */,57CDCD932FD5CBD3005BA4C8 /* GB.swift in Sources */,@@ -13960,6 +13980,7 @@57FD14133011C73D007F211A /* ShaderPreviewView.swift in Sources */,57CDCDA32FD5CBD3005BA4C8 /* PretendoNetworkingView.swift in Sources */,57CDCDA52FD5CBD3005BA4C8 /* CheevosPopupView.swift in Sources */,+ 576C4BE8304174AA00DB526E /* FocusSoundEffects.swift in Sources */,57CDCDA62FD5CBD3005BA4C8 /* GlobalCoreSwitch.swift in Sources */,57D482B23019D3330030A771 /* ASListCustomCollectionCell.swift in Sources */,57C79DE12FE3EC49003C737F /* ASSheetView.swift in Sources */,@@ -14336,6 +14357,7 @@F0C500000000000000000304 /* FocusContext.swift in Sources */,F0C500000000000000000305 /* FocusEngine.swift in Sources */,F0C500000000000000000306 /* FocusCollectionView.swift in Sources */,+ 576C4C0B3041979700DB526E /* GameCoverScrapingView.swift in Sources */,F0C500000000000000000307 /* FocusSystem.swift in Sources */,F0C500000000000000000308 /* FocusSystem+UIViewController.swift in Sources */,57E48D932D8D73AD008000A3 /* CheersView.swift in Sources */,@@ -14343,6 +14365,7 @@57C8A11A2DF2BA3E00593F82 /* SNES.swift in Sources */,57F1D4A82FF630D000FC5B2A /* GameOptionsView.swift in Sources */,5796DB212FE4184D0051F661 /* ASButton.swift in Sources */,+ 576C4BDF3041749100DB526E /* BackgroundMusicKit.swift in Sources */,57047A1D2D85BB2200C62FF6 /* PurchaseButtonReusableView.swift in Sources */,5720D1C12DB9DCBB0090C0F6 /* ControllerMapping.swift in Sources */,57E8B0822E1CDB8B00F93E60 /* GB.swift in Sources */,@@ -14370,6 +14393,7 @@57FD14143011C73D007F211A /* ShaderPreviewView.swift in Sources */,572D026B2F87E3F8000BD6F4 /* PretendoNetworkingView.swift in Sources */,57DFBE8C2E71BC7A008C2161 /* CheevosPopupView.swift in Sources */,+ 576C4BE7304174AA00DB526E /* FocusSoundEffects.swift in Sources */,578E4B592F8A2F480027E6D0 /* GlobalCoreSwitch.swift in Sources */,57D482B33019D3330030A771 /* ASListCustomCollectionCell.swift in Sources */,57C79DE22FE3EC49003C737F /* ASSheetView.swift in Sources */,@@ -14988,6 +15012,7 @@isa = XCBuildConfiguration;baseConfigurationReference = B2C97B562A0A420E00053A4C /* Config-Debug.xcconfig */;buildSettings = {+ APP_BUILD_CONDITIONS = "DEBUG SIDE_LOAD";ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear AppIcon_Lily AppIcon_Rainbow1 AppIcon_Rainbow2 AppIcon_Rainbow3 AppIcon_Unity";ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;@@ -15024,7 +15049,7 @@SUPPORTS_MACCATALYST = NO;SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;- SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(APP_BUILD_CONDITIONS)";+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(APP_BUILD_CONDITIONS)";SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";SWIFT_VERSION = 5.0;TARGETED_DEVICE_FAMILY = "1,2";@@ -15531,7 +15556,7 @@};57CDCF782FD5CBD3005BA4C8 /* SideloadRelease */ = {isa = XCBuildConfiguration;- baseConfigurationReference = 575A3A422DCEE9F300B28FC2 /* Config-SideloadRelease.xcconfig */;+ baseConfigurationReference = B2C97B562A0A420E00053A4C /* Config-Debug.xcconfig */;buildSettings = {ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear AppIcon_Lily AppIcon_Rainbow1 AppIcon_Rainbow2 AppIcon_Rainbow3 AppIcon_Unity";ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcschemeindex 8436df75..d127904b 100644--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme@@ -53,7 +53,7 @@</BuildableProductRunnable></LaunchAction><ProfileAction- buildConfiguration = "Release"+ buildConfiguration = "Debug"shouldUseLaunchSchemeArgsEnv = "YES"savedToolIdentifier = ""useCustomWorkingDirectory = "NO"@@ -73,7 +73,7 @@buildConfiguration = "Debug"></AnalyzeAction><ArchiveAction- buildConfiguration = "Release"+ buildConfiguration = "Debug"revealArchiveInOrganizer = "YES"></ArchiveAction></Scheme>diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuRelease.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuRelease.xcschemeindex bf39d4e8..1dccbc7b 100644--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuRelease.xcscheme+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuRelease.xcscheme@@ -24,7 +24,7 @@</BuildActionEntries></BuildAction><TestAction- buildConfiguration = "Debug"+ buildConfiguration = "Release"selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"shouldUseLaunchSchemeArgsEnv = "YES"@@ -70,7 +70,7 @@</BuildableProductRunnable></ProfileAction><AnalyzeAction- buildConfiguration = "Debug">+ buildConfiguration = "Release"></AnalyzeAction><ArchiveActionbuildConfiguration = "Release"diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcschemeindex 8a1a2947..fad547de 100644--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme@@ -24,16 +24,16 @@</BuildActionEntries></BuildAction><TestAction- buildConfiguration = "Debug"+ buildConfiguration = "SideloadRelease"selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"shouldUseLaunchSchemeArgsEnv = "YES"shouldAutocreateTestPlan = "YES"></TestAction><LaunchAction- buildConfiguration = "Debug"- selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"- selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"+ buildConfiguration = "SideloadRelease"+ selectedDebuggerIdentifier = ""+ selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"launchStyle = "0"useCustomWorkingDirectory = "NO"ignoresPersistentStateOnLaunch = "NO"@@ -53,7 +53,7 @@</BuildableProductRunnable></LaunchAction><ProfileAction- buildConfiguration = "Release"+ buildConfiguration = "SideloadRelease"shouldUseLaunchSchemeArgsEnv = "YES"savedToolIdentifier = ""useCustomWorkingDirectory = "NO"@@ -70,7 +70,7 @@</BuildableProductRunnable></ProfileAction><AnalyzeAction- buildConfiguration = "Debug">+ buildConfiguration = "SideloadRelease"></AnalyzeAction><ArchiveActionbuildConfiguration = "SideloadRelease"diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/Contents.jsonnew file mode 100644index 00000000..5997d8ad--- /dev/null+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/Contents.json@@ -0,0 +1,54 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "3x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected]new file mode 100644index 00000000..4687c76eBinary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected]new file mode 100644index 00000000..d37f1782Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected]new file mode 100644index 00000000..d4821e61Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected]new file mode 100644index 00000000..2cb8e7abBinary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/ps2_group_brand.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected]index c8f0bfe7..0cbae6b5 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected]index 6e6f1f29..4b9a9c5c 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/xbox_group_brand.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected]index 9d733302..5f460a2f 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected]index 50e807cd..4aa8a8b6 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Common/avatar.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/Contents.jsonnew file mode 100644index 00000000..a8680627--- /dev/null+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/Contents.json@@ -0,0 +1,54 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "3x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected]new file mode 100644index 00000000..72003eacBinary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected]new file mode 100644index 00000000..9284014aBinary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected]new file mode 100644index 00000000..a3d34722Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected]new file mode 100644index 00000000..5b2d9252Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_h.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/Contents.jsonnew file mode 100644index 00000000..63bde17f--- /dev/null+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/Contents.json@@ -0,0 +1,54 @@+{+ "images" : [+ {+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "idiom" : "universal",+ "scale" : "1x"+ },+ {+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "2x"+ },+ {+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "3x"+ },+ {+ "appearances" : [+ {+ "appearance" : "luminosity",+ "value" : "dark"+ }+ ],+ "filename" : "[email protected]",+ "idiom" : "universal",+ "scale" : "3x"+ }+ ],+ "info" : {+ "author" : "xcode",+ "version" : 1+ }+}diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected]new file mode 100644index 00000000..7a4ff25bBinary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected]new file mode 100644index 00000000..fea46b27Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected]new file mode 100644index 00000000..611ccdb3Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected]new file mode 100644index 00000000..9b0b5f64Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/ps2_cover_v.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected]index ebebbc13..7f3bf05e 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected]index 5fb205a4..6c77aa52 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_h.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected]index d01d6da1..c16f98b9 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected]index d68e00f6..2e195532 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/xbox_cover_v.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected]index dccb4311..03a85100 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected]index f2a9cef3..36e74def 100644Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Service/import_ip.imageset/[email protected] differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/Contents.jsondeleted file mode 100644index 0d723c53..00000000--- a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/Contents.json+++ /dev/null@@ -1,22 +0,0 @@-{- "images" : [- {- "idiom" : "universal",- "scale" : "1x"- },- {- "filename" : "[email protected]",- "idiom" : "universal",- "scale" : "2x"- },- {- "filename" : "[email protected]",- "idiom" : "universal",- "scale" : "3x"- }- ],- "info" : {- "author" : "xcode",- "version" : 1- }-}diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/[email protected]deleted file mode 100644index e9d36855..00000000Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/[email protected] and /dev/null differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/[email protected]deleted file mode 100644index 91dd4abf..00000000Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/overTheMoon.imageset/[email protected] and /dev/null differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/Contents.jsondeleted file mode 100644index fed75542..00000000--- a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/Contents.json+++ /dev/null@@ -1,22 +0,0 @@-{- "images" : [- {- "idiom" : "universal",- "scale" : "1x"- },- {- "filename" : "[email protected]",- "idiom" : "universal",- "scale" : "2x"- },- {- "filename" : "[email protected]",- "idiom" : "universal",- "scale" : "3x"- }- ],- "info" : {- "author" : "xcode",- "version" : 1- }-}diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/[email protected]deleted file mode 100644index b26283f9..00000000Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/[email protected] and /dev/null differdiff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/[email protected]deleted file mode 100644index 92d67221..00000000Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/ShaderToy/toonCloud.imageset/[email protected] and /dev/null differdiff --git a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfigindex 585b7f01..db8a60a9 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 = 15APP_VERSION = 2.0.0// Prebuilt cores under ProjectManicEMU/Cores (Citra.framework, *.libretro.framework, …)diff --git a/ManicEmu/ManicEmu/Resources/Info.plist b/ManicEmu/ManicEmu/Resources/Info.plistindex 24ab54fe..9316213a 100644--- a/ManicEmu/ManicEmu/Resources/Info.plist+++ b/ManicEmu/ManicEmu/Resources/Info.plist@@ -602,6 +602,9 @@<string>xenios</string><string>stikjit</string><string>dukex</string>+ <string>armsx2</string>+ <string>armsx2-ios</string>+ <string>armsx2ios</string></array><key>LSRequiresIPhoneOS</key><true/>diff --git a/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.stringsindex d58161fc..3c0e182b 100644--- a/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings+++ b/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings@@ -1061,3 +1061,27 @@ Press the controller button to complete mapping...";"DoomSaveTips" = "Please use the Files app to open: Manic EMU - PrBoom - doom to manage your save files on your own.";"ContinuedAlert" = "Are you sure you want to %@? Any unsaved game progress will be lost!";++"BackgroundMusic" = "Background Music";+"SoundEffects" = "Sound Effects";++"BackgroundMusicDesc" = "Add a track with the button below, or place .m4a / .aac / .mp3 / .wav files in the Manic EMU - Assets folder.\nName files as Song Title(Author).";+"AddBackgroundMusic" = "Add Background Music";+"CoverScraping" = "Cover Scraping";+"CoverScrapingDesc" = "Automatically fetch covers, icons, and banners from SteamGridDB.";+"SkipExistingCovers" = "Skip Existing Artwork";+"ScrapeCover" = "Scrape Covers";+"ScrapeIcon" = "Scrape Icons";+"ScrapeBanner" = "Scrape Banners";+"StartScraping" = "Start Scraping";+"RemoveCover" = "Remove Covers";+"RemoveIcon" = "Remove Icons";+"RemoveBanner" = "Remove Banners";+"RemoveAllArtwork" = "Remove All Artwork";+"RemoveCoverAlert" = "Remove covers from these games? This cannot be undone.";+"RemoveIconAlert" = "Remove icons from these games? This cannot be undone.";+"RemoveBannerAlert" = "Remove banners from these games? This cannot be undone.";+"RemoveAllArtworkAlert" = "Remove all covers, icons, and banners from these games? This cannot be undone.";+"CoverScrapingComplete" = "Scraping complete.";+"CoverScrapingStat" = "%@: %d updated, %d skipped, %d failed";+"FetchGamesFromARMSX2" = "Import Games from ARMSX2";diff --git a/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.stringsindex 526bad21..ab1ff899 100644--- a/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings+++ b/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings@@ -1057,3 +1057,26 @@"DoomSaveTips" = "请使用“文件”App 打开:Manic EMU - PrBoom - doom,自行管理存档文件。";"ContinuedAlert" = "是否确认执行 %@ ,未保存的游戏进度将会失去!";++"BackgroundMusic" = "背景音乐";+"SoundEffects" = "音效";+"BackgroundMusicDesc" = "点按下方按钮添加曲目,或将 .m4a / .aac / .mp3 / .wav 文件放入 Manic EMU - Assets 目录。\n文件请按 歌曲名(作者) 命名。";+"AddBackgroundMusic" = "添加背景音乐";+"CoverScraping" = "封面抓取";+"CoverScrapingDesc" = "从 SteamGridDB 自动获取封面、图标和横幅。";+"SkipExistingCovers" = "跳过已有素材";+"ScrapeCover" = "抓取封面";+"ScrapeIcon" = "抓取图标";+"ScrapeBanner" = "抓取横幅";+"StartScraping" = "开始抓取";+"RemoveCover" = "移除封面";+"RemoveIcon" = "移除图标";+"RemoveBanner" = "移除横幅";+"RemoveAllArtwork" = "移除全部素材";+"RemoveCoverAlert" = "确定移除这些游戏的封面?此操作无法恢复。";+"RemoveIconAlert" = "确定移除这些游戏的图标?此操作无法恢复。";+"RemoveBannerAlert" = "确定移除这些游戏的横幅?此操作无法恢复。";+"RemoveAllArtworkAlert" = "确定移除这些游戏的全部封面、图标和横幅?此操作无法恢复。";+"CoverScrapingComplete" = "抓取完成。";+"CoverScrapingStat" = "%@: 已更新 %d,已跳过 %d,失败 %d";+"FetchGamesFromARMSX2" = "从 ARMSX2 导入游戏";diff --git a/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift b/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swiftindex b41ea7a6..77a88228 100644--- a/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift+++ b/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift@@ -28,6 +28,8 @@ class ApplicationSceneDelegate: UIResponder, UIWindowSceneDelegate {ThemeManager.shared.setup()self.window?.rootViewController = HomeViewController()self.window?.makeKeyAndVisible()+ BackgroundMusicKit.shared.startMonitoring()+ FocusSoundEffects.shared.startMonitoring()if Settings.defalut.iCloudSyncEnable {SyncManager.shared.startSync()}@@ -95,6 +97,8 @@ class ApplicationSceneDelegate: UIResponder, UIWindowSceneDelegate {EmulatorInteractionKit.processGames(type: .xeniOS, callbackUrl: url)} else if let host = url.host, host == R.Strings.DukeXScheme {EmulatorInteractionKit.processGames(type: .dukeX, callbackUrl: url)+ } else if let host = url.host, host == R.Strings.ARMSX2Scheme {+ EmulatorInteractionKit.processGames(type: .armsx2, callbackUrl: url)} else {Self.launchGameID = url.lastPathComponent}diff --git a/ManicEmu/ManicEmu/Sources/Base/Constants.swift b/ManicEmu/ManicEmu/Sources/Base/Constants.swiftindex 5e893955..a5cec9f5 100644--- a/ManicEmu/ManicEmu/Sources/Base/Constants.swift+++ b/ManicEmu/ManicEmu/Sources/Base/Constants.swift@@ -78,6 +78,7 @@ extension _R {case .dos, .win95, .win98: return 0.8case .chm: return 0.7908case .xbox: return 0.714+ case .ps2: return 0.711case .ngc, .wii: return 0.706case .ngp, .ngpc: return 0.8594case .c64: return 0.7146@@ -529,6 +530,10 @@ extension _R {static let NimbusPath = Resource.appendingPathComponent("Nimbus210")static let Nimbus3DSPath = NimbusPath.appendingPathComponent("3ds")static let NimbusCiaPath = NimbusPath.appendingPathComponent("cias/nimbus.cia")+ static let GamecubeUser = Dolphin.appendingPathComponent("/User/GC")+ static let GamecubeUserEUR = GamecubeUser.appendingPathComponent("/EUR")+ static let GamecubeUserJAP = GamecubeUser.appendingPathComponent("/JAP")+ static let GamecubeUserUSA = GamecubeUser.appendingPathComponent("/USA")}struct _DefaultKey {@@ -599,19 +604,21 @@ extension _R {static let MeloNXScheme = "atariemulator"static let XeniOSScheme = "xenios"static let DukeXScheme = "dukex"+ static let ARMSX2Scheme = "armsx2"static let J2MEScreenSizes = ["96x65", "96x96", "104x80", "128x128", "132x176", "128x160", "176x208", "176x220", "208x208", "240x320", "320x240", "240x400", "352x416", "360x640", "640x360", "480x800", "800x480"]static let DOSKeyboardSkinID = "public.aoshuang.game.dos.standard.keyboard"static let AzaharArticBaseGameID = "AzaharArticBase"static let WiiControllers = ["Classic Controller Pro","Wiimote",- R.string.localizable.wiimoteSideways()+ R.string.localizable.wiimoteSideways(),+ "Wiimote+Nunchuk"]static let SymbianEdgeSkinIdentifier = "public.aoshuang.game.symbian.standard.edge"static let SymbianEdgeFlexSkinIdentifier = "public.aoshuang.game.symbian.edge.flex"static let SymbianSkinIdentifier = "public.aoshuang.game.symbian.standard"static let SymbianFlexSkinIdentifier = "public.aoshuang.game.symbian.flex"-+ static let WiimoteSkinIdentifier = "public.aoshuang.game.wiimote"}enum _Config {@@ -836,6 +843,22 @@ extension _R {static func XeniOSGameLaunch(gameId: String) -> URL { URL(string: "\(R.Strings.XeniOSScheme)://launch?title-id=\(gameId)")! }static let FetchDukeXGames = URL(string: "\(R.Strings.DukeXScheme)://gameInfo?scheme=manicemu")!static func DukeXGameLaunch(gameId: String) -> URL { URL(string: "\(R.Strings.DukeXScheme)://launch?titleid=\(gameId)")! }+ static let FetchARMSX2Games: URL = {+ var components = URLComponents()+ components.scheme = R.Strings.ARMSX2Scheme+ components.host = "library"+ components.queryItems = [+ URLQueryItem(name: "callback", value: "\(R.Strings.ManicScheme)://\(R.Strings.ARMSX2Scheme)")+ ]+ return components.url!+ }()+ static func ARMSX2GameLaunch(gameId: String) -> URL {+ var components = URLComponents()+ components.scheme = R.Strings.ARMSX2Scheme+ components.host = "launch"+ components.queryItems = [URLQueryItem(name: "game", value: gameId)]+ return components.url!+ }#if SIDE_LOADstatic let EnableJITUrl = URL(string: "stikjit://enable-jit?bundle-id=com.aoshuang.manicemu&script-name=universal.js")!#endifdiff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swiftindex 4fb32a9f..bed6f807 100644--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift@@ -71,6 +71,8 @@ enum ExtraKey: String {case steamGridDBAPIKeycase landscapeListStylecase landscapeShaderToy+ case landscapeBackgroundMusic+ case landscapeSoundEffectscase gameMetadatacase hasQueryMetadatacase hideGameRatingdiff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToy.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToy.swiftindex db1cacdd..caad1a7a 100644--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToy.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToy.swift@@ -13,12 +13,10 @@ struct ShaderToy {case mellowVoronoicase synthwaveSunsetcase paperScroll- case overTheMooncase insideTheMatrixcase singularitycase floatingPlaystationShapescase harmonicSineWave- case toonCloudcase gradientFlowcase pS3HomeBackgroundcase pSPXMB@@ -37,8 +35,6 @@ struct ShaderToy {"nyri0"case .paperScroll:"Ping2_0"- case .overTheMoon:- "BigWIngs"case .insideTheMatrix:"And390"case .singularity:@@ -47,8 +43,6 @@ struct ShaderToy {"will7007"case .harmonicSineWave:"trinketMage"- case .toonCloud:- "AntoineC"case .gradientFlow:"hahnzhu"case .pS3HomeBackground:@@ -68,8 +62,6 @@ struct ShaderToy {return Self.MellowVoronoicase .synthwaveSunset:return Self.SynthwaveSunset- case .overTheMoon:- return Self.OverTheMooncase .paperScroll:return Self.PaperScrollcase .insideTheMatrix:@@ -91,8 +83,6 @@ struct ShaderToy {waveColor: UIColor(.dm,light: .white,dark: R.Color.BackgroundPrimary.forceStyle(.dark)))- case .toonCloud:- return Self.ToonCloudcase .gradientFlow:return Self.gradientFlowScript(colors: R.Color.Gradient)case .pS3HomeBackground:@@ -140,8 +130,6 @@ struct ShaderToy {return "Mellow Voronoi"case .synthwaveSunset:return "Synthwave sunset"- case .overTheMoon:- return "Over the Moon"case .paperScroll:return "Paper scroll"case .insideTheMatrix:@@ -152,8 +140,6 @@ struct ShaderToy {return "Floating Shapes"case .harmonicSineWave:return "Harmonic Sine Wave"- case .toonCloud:- return "Toon Cloud"case .gradientFlow:return "Gradient Flow"case .pS3HomeBackground:@@ -177,8 +163,6 @@ struct ShaderToy {.image(R.image.mellowVoronoi(), cornerStyle: .radius(R.Size.CornerRadiusMicro))case .synthwaveSunset:.image(R.image.synthwaveSunset(), cornerStyle: .radius(R.Size.CornerRadiusMicro))- case .overTheMoon:- .image(R.image.overTheMoon(), cornerStyle: .radius(R.Size.CornerRadiusMicro))case .paperScroll:.image(R.image.paperScroll(), cornerStyle: .radius(R.Size.CornerRadiusMicro))case .insideTheMatrix:@@ -189,8 +173,6 @@ struct ShaderToy {.image(R.image.floatingPlaystationShapes(), cornerStyle: .radius(R.Size.CornerRadiusMicro))case .harmonicSineWave:.image(R.image.harmonicSineWave(), cornerStyle: .radius(R.Size.CornerRadiusMicro))- case .toonCloud:- .image(R.image.toonCloud(), cornerStyle: .radius(R.Size.CornerRadiusMicro))case .gradientFlow:.image(R.image.gradientFlow(), cornerStyle: .radius(R.Size.CornerRadiusMicro))case .pS3HomeBackground:@@ -207,8 +189,6 @@ struct ShaderToy {switch style {case .synthwaveSunset:return 0.55- case .overTheMoon:- return 0.45case .none:return 0.35default:diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swiftindex 5337e255..55a761f9 100644--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ShaderToyScripts.swift@@ -824,96 +824,6 @@ extension ShaderToy {}"""}-- //AntoineC- static let ToonCloud = """- // ----------------------------------------------------------------------------------------- // "Toon Cloud" by Antoine Clappier - March 2015- //- // Licensed under:- // A Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.- // http://creativecommons.org/licenses/by-nc-sa/4.0/- // ------------------------------------------------------------------------------------------ #define TAU 6.28318530718--- const vec3 BackColor = vec3(0.0, 0.4, 0.58);- const vec3 CloudColor = vec3(0.18,0.70,0.87);--- float Func(float pX)- {- return 0.6*(0.5*sin(0.1*pX) + 0.5*sin(0.553*pX) + 0.7*sin(1.2*pX));- }--- float FuncR(float pX)- {- return 0.5 + 0.25*(1.0 + sin(mod(40.0*pX, TAU)));- }--- float Layer(vec2 pQ, float pT)- {- vec2 Qt = 3.5*pQ;- pT *= 0.5;- Qt.x += pT;-- float Xi = floor(Qt.x);- float Xf = Qt.x - Xi -0.5;-- vec2 C;- float Yi;- float D = 1.0 - step(Qt.y, Func(Qt.x));-- // Disk:- Yi = Func(Xi + 0.5);- C = vec2(Xf, Qt.y - Yi );- D = min(D, length(C) - FuncR(Xi+ pT/80.0));-- // Previous disk:- Yi = Func(Xi+1.0 + 0.5);- C = vec2(Xf-1.0, Qt.y - Yi );- D = min(D, length(C) - FuncR(Xi+1.0+ pT/80.0));-- // Next Disk:- Yi = Func(Xi-1.0 + 0.5);- C = vec2(Xf+1.0, Qt.y - Yi );- D = min(D, length(C) - FuncR(Xi-1.0+ pT/80.0));-- return min(1.0, D);- }---- void mainImage( out vec4 fragColor, in vec2 fragCoord )- {- // Setup:- vec2 UV = 2.0*(fragCoord.xy - iResolution.xy/2.0) / min(iResolution.x, iResolution.y);-- // Render:- vec3 Color= BackColor;-- for(float J=0.0; J<=1.0; J+=1.0/3.0)- {- // Cloud Layer:- float Lt = iTime*(0.5 + 2.0*J)*(1.0 + 0.1*sin(226.0*J)) + 17.0*J;- vec2 Lp = vec2(0.0, 0.3+1.5*( J - 0.5));- float L = Layer(UV + Lp, Lt);-- // Blur and color:- float Blur = 4.0*(0.5*abs(2.0 - 5.0*J))/(11.0 - 5.0*J);-- float V = mix( 0.0, 1.0, 1.0 - smoothstep( 0.0, 0.01 +0.2*Blur, L ) );- vec3 Lc= mix( CloudColor, vec3(1.0), J);-- Color =mix(Color, Lc, V);- }-- fragColor = vec4(Color, 1.0);- }- """//hahnzhu — colors injected from [UIColor]; layer rot computed once/// GradientFlow 默认四色(黄 / 深蓝 / 红 / 蓝)@@ -1261,127 +1171,6 @@ extension ShaderToy {}"""- // BigWings — restore depth/trees; keep stars slightly cheaper than original- static let OverTheMoon = """- #define PI 3.1415- #define S(x,y,z) smoothstep(x,y,z)- #define B(x,y,z,b) S(x, x+b, z)*S(y+b, y, z)- #define saturate(x) clamp(x,0.,1.)- #define MOD3 vec3(.1031,.11369,.13787)- #define MOONPOS vec2(1.3, .8)-- float hash11(float p) {- vec3 p3 = fract(vec3(p) * MOD3);- p3 += dot(p3, p3.yzx + 19.19);- return fract((p3.x + p3.y) * p3.z);- }-- float hash12(vec2 p) {- vec3 p3 = fract(vec3(p.xyx) * MOD3);- p3 += dot(p3, p3.yzx + 19.19);- return fract((p3.x + p3.y) * p3.z);- }-- float within(float a, float b, float t) {- return (t-a) / (b-a);- }-- float skewbox(vec2 uv, vec3 top, vec3 bottom, float blur) {- float y = within(top.z, bottom.z, uv.y);- float left = mix(top.x, bottom.x, y);- float right = mix(top.y, bottom.y, y);- return B(left, right, uv.x, blur) * B(bottom.z, top.z, uv.y, blur);- }-- vec4 pine(vec2 uv, float focus) {- uv.x -= .5;- float c = skewbox(uv, vec3(.0, .0, 1.), vec3(-.14, .14, .65), focus);- c += skewbox(uv, vec3(-.10, .10, .65), vec3(-.18, .18, .43), focus);- c += skewbox(uv, vec3(-.13, .13, .43), vec3(-.22, .22, .2), focus);- c += skewbox(uv, vec3(-.04, .04, .2), vec3(-.04, .04, -.1), focus);- float shadow = skewbox(uv.yx, vec3(.6, .65, .13), vec3(.65, .65, -.1), focus);- shadow += skewbox(uv.yx, vec3(.43, .43, .13), vec3(.36, .43, -.2), focus);- shadow += skewbox(uv.yx, vec3(.15, .2, .08), vec3(.17, .2, -.08), focus);- return vec4(mix(vec3(1.), vec3(.8), shadow), c);- }-- float getheight(float x) {- return sin(x) + sin(x*2.234+.123)*.5 + sin(x*4.45+2.2345)*.25;- }-- vec4 landscape(vec2 uv, float d, float p, float f, float a, float y, float seed, float focus) {- uv *= d;- float x = uv.x*PI*f+p;- float c = getheight(x)*a+y;- float b = floor(x*5.)/5.+.1;- float h = getheight(b)*a+y;- float e = max(fwidth(uv.y), 0.0015);- vec4 col = vec4(S(c+e, c-e, uv.y));- x *= 5.;- float id = floor(x);- float n = hash11(id+seed);- x = fract(x);- float treeHeight = (.07/d) * mix(1.3, .5, n);- float ty = within(h, h+treeHeight, uv.y);- x += (n-.5)*.6;- // Soften pine AA at low res- vec4 pineCol = pine(vec2(x, ty/d), focus + d*.1 + e*2.);- col.rgb = mix(col.rgb, pineCol.rgb, pineCol.a);- col.a = max(col.a, pineCol.a);- return saturate(col);- }-- float circ(vec2 uv, vec2 pos, float radius, float blur) {- return S(radius+blur, radius-blur, length(uv-pos));- }-- float stars(vec2 uv, float t) {- t *= 3.;- float n1 = hash12(uv*10000.);- float n2 = hash12(uv*11234.);- float alpha1 = pow(n1, 20.);- float alpha2 = pow(n2, 20.);- float twinkle = sin((uv.x-t+cos(uv.y*20.+t))*10.);- twinkle *= cos((uv.y*.234-t*3.24+sin(uv.x*12.3+t*.243))*7.34);- twinkle = (twinkle + 1.)*.5;- return alpha1 * alpha2 * twinkle;- }-- void mainImage(out vec4 fragColor, in vec2 fragCoord)- {- vec2 uv = fragCoord.xy / iResolution.xy;- float t = iTime*.05;- vec2 bgUV = uv*vec2(iResolution.x/iResolution.y, 1.);-- vec4 col = vec4(1.-length(MOONPOS-bgUV)/1.4)*.8;- float moonC = circ(bgUV, MOONPOS, .07, .001);- moonC *= 1.-circ(bgUV, MOONPOS+vec2(.03), .07, .001)*.95;- col += vec4(saturate(moonC)*.8);- col += stars(uv, t);-- float dist = 1.;- float height = .55;- float amplitude = .02;- vec4 trees = vec4(0.);- // 8 layers — denser than 5, cheaper than original 10- for (float i = 0.; i < 8.; i++) {- vec4 layer = landscape(uv, dist, t+i, 3., amplitude, height, i, .01);- layer.rgb *= mix(vec3(.1, .1, .2), vec3(.3)+col.x, 1.-i/8.);- trees = mix(trees, layer, layer.a);- dist -= .12;- height -= .07;- }- col = mix(col, trees, trees.a);- col += vec4(circ(bgUV, MOONPOS, .1, .2)*.2);- col = saturate(col);-- vec4 foreground = landscape(uv, .02, t, 3., .0, -0.04, 1., .1);- foreground.rgb *= vec3(.1, .1, .2)*.5;- col = mix(col, foreground, foreground.a);- fragColor = col;- }- """-// Synthwave — analytical AA (no 4x MSAA); soft palm/triangle/sun edgesstatic let SynthwaveSunset = """#define NH 4diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swiftindex ff11d4b3..66335b85 100644--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift@@ -132,6 +132,7 @@ enum SpecialCoreOption: String {case citra_swap_screen_modecase citra_large_screen_proportioncase citra_custom_layout_config+ case citra_motion_rotation//a2600case stella_crop_hoverscan//a5200@@ -175,6 +176,23 @@ enum SpecialCoreOption: String {case dolphin_skip_gc_bioscase dolphin_cheats_enabledcase dolphin_cheats_import+ //gamecube+ case dolphin_gc_sp1+ case dolphin_enable_gamecube_mic+ case dolphin_hotkey_activate_microphone+ //wii+ case dolphin_widescreen+ case dolphin_progressive_scan+ case dolphin_pal60+ case dolphin_sensor_bar_position+ case dolphin_enable_rumble+ case dolphin_wiimote_continuous_scanning+ case dolphin_alt_gc_ports_on_wii+ case dolphin_wiispeak_enable+ case dolphin_wiispeak_muted+ case dolphin_wii_logi_microphone_enable+ case dolphin_bluetooth_passthrough+//pcecase pce_default_joypad_type_p1case pce_default_joypad_type_p2@@ -327,6 +345,7 @@ enum SpecialCoreOption: String {.citra_swap_screen_mode,.citra_large_screen_proportion,.citra_custom_layout_config,+ .citra_motion_rotation,]} else if game.gameType == .doom {return [.prboom_resolution]@@ -336,11 +355,29 @@ enum SpecialCoreOption: String {return [.eka2l1_cpu_backend,.eka2l1_device_index]} else if game.isDolphinCore {- var options: Set<Self> = [.dolphin_cheats_enabled, .dolphin_cheats_import]- if game.gameType == .ngc {- options.insert(.dolphin_skip_gc_bios)+ var result: [SpecialCoreOption] = [.dolphin_cheats_enabled,+ .dolphin_cheats_import,+ .dolphin_cpu_core,+ .dolphin_skip_gc_bios]+ if game.gameType == .wii {+ result += [.dolphin_gc_sp1,+ .dolphin_enable_gamecube_mic,+ .dolphin_hotkey_activate_microphone]+ } else if game.gameType == .ngc {+ result += [.dolphin_widescreen,+ .dolphin_progressive_scan,+ .dolphin_pal60,+ .dolphin_sensor_bar_position,+ .dolphin_enable_rumble,+ .dolphin_wiimote_continuous_scanning,+ .dolphin_alt_gc_ports_on_wii,+ .dolphin_wiispeak_enable,+ .dolphin_wiispeak_muted,+ .dolphin_wii_logi_microphone_enable,+ .dolphin_bluetooth_passthrough]}- return options+ return Set(result)+} else if game.gameType == .pce {return [.pce_default_joypad_type_p1,.pce_default_joypad_type_p2,@@ -453,11 +490,21 @@ enum SpecialCoreOption: String {.dolphin_log_core: "disabled",.dolphin_log_video: "disabled",.dolphin_log_common: "disabled",- .dolphin_vi_skip: "disabled"+ .dolphin_vi_skip: "disabled",+ .dolphin_skip_gc_bios: "disabled",]} else {+ let clockRate: String+ switch UIDevice.performanceTier {+ case .high:+ clockRate = "0.30"+ case .ultra:+ clockRate = "0.50"+ default:+ clockRate = "0.20"+ }result = [- .dolphin_cpu_clock_rate: "0.20",+ .dolphin_cpu_clock_rate: clockRate,.dolphin_osd_enabled: "disabled",.dolphin_fast_disc_speed: "enabled",.dolphin_gpu_texture_decoding: "enabled",@@ -467,7 +514,8 @@ enum SpecialCoreOption: String {.dolphin_log_core: "disabled",.dolphin_log_video: "disabled",.dolphin_log_common: "disabled",- .dolphin_vi_skip: "enabled"+ .dolphin_vi_skip: "enabled",+ .dolphin_skip_gc_bios: "disabled",]}} else if game.gameType == .pce {diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverModifyView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverModifyView.swiftindex e50644bf..4bcb8b1f 100644--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverModifyView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverModifyView.swift@@ -121,8 +121,17 @@ class GameCoverModifyView: BaseView {sources.append(.editImageUrl(url))}- ImageFetcher.showCommonFetcher(sources: sources) { [weak self] image, _ in- guard let self, let image else { return }+ if kind.hasRemovableImage(game: game) {+ sources.append(.delete)+ }++ ImageFetcher.showCommonFetcher(sources: sources) { [weak self] image, source in+ guard let self else { return }+ if case .delete = source {+ self.removeImage(for: kind)+ return+ }+ guard let image else { return }self.persist(image: image, for: kind)}}@@ -149,6 +158,26 @@ class GameCoverModifyView: BaseView {}}+ /// Clears the selected artwork. Box art leaves `hasCoverMatch` unchanged so auto-match will not refill it.+ private func removeImage(for kind: CoverSlotKind) {+ Game.change { realm in+ switch kind {+ case .boxArt:+ self.game.gameCover?.deleteAndClean(realm: realm)+ self.game.gameCover = nil+ self.game.onlineCoverUrl = nil+ case .icon:+ self.game.icon?.deleteAndClean(realm: realm)+ self.game.icon = nil+ case .banner:+ self.game.banner?.deleteAndClean(realm: realm)+ self.game.banner = nil+ }+ }+ slot(for: kind).reloadImage()+ NotificationCenter.default.post(name: R.NotificationName.GameCoverChange, object: nil)+ }+private func slot(for kind: CoverSlotKind) -> CoverSlotView {switch kind {case .boxArt: return boxArtSlot@@ -201,6 +230,17 @@ private enum CoverSlotKind {}}+ func hasRemovableImage(game: Game) -> Bool {+ switch self {+ case .boxArt:+ return game.gameCover != nil || game.onlineCoverUrl != nil+ case .icon:+ return game.icon != nil+ case .banner:+ return game.banner != nil+ }+ }+func currentEditableImage(game: Game) -> UIImage? {switch self {case .boxArt:diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverScrapingView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverScrapingView.swiftnew file mode 100644index 00000000..809faae7--- /dev/null+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverScrapingView.swift@@ -0,0 +1,603 @@+//+// GameCoverScrapingView.swift+// ManicEmu+//+// Created by Daiuno on 2026/8/28.+// Copyright © 2026 Manic EMU. All rights reserved.+//++import RealmSwift+import IceCream+import Kingfisher+import Fuse++class GameCoverScrapingView: BaseView {+ private enum NavTool: Int {+ case apiKey = 0+ case more = 1+ }++ private enum ScrapeRow {+ case skipExisting+ case scrapeCover+ case scrapeIcon+ case scrapeBanner++ static func from(_ indexPath: IndexPath) -> ScrapeRow? {+ switch (indexPath.section, indexPath.row) {+ case (0, 0): return .skipExisting+ case (1, 0): return .scrapeCover+ case (1, 1): return .scrapeIcon+ case (1, 2): return .scrapeBanner+ default: return nil+ }+ }+ }++ private let games: [Game]+ private var skipExisting = true+ private var scrapeCover = false+ private var scrapeIcon = false+ private var scrapeBanner = false+ private var isScraping = false+ private var showClose: Bool++ private lazy var listPageView: ASListPageView = {+ let view = ASListPageView(getListPage())+ view.didActionOccurred = { [weak self] action in+ self?.handleAction(action)+ }+ return view+ }()++ required init?(parameters: Any...) {+ guard let games = parameters.compactMap({ $0 as? [Game] }).first else { return nil }+ self.showClose = parameters.compactMap({ $0 as? Bool }).first ?? true+ self.games = games+ super.init(frame: .zero)++ addSubview(listPageView)+ listPageView.snp.makeConstraints { make in+ make.edges.equalToSuperview()+ }+ }++ convenience init(showClose: Bool) {+ self.init(parameters: showClose)!+ }++ @MainActor required init?(coder: NSCoder) {+ fatalError("init(coder:) has not been implemented")+ }++ //MARK: - Page++ private var canStartScraping: Bool {+ scrapeCover || scrapeIcon || scrapeBanner+ }++ private func getListPage() -> ASListPage {+ var navigation = ASListPage.Navigation.defaultNavigation(+ title: R.string.localizable.coverScraping(),+ titleIcon: GameOption.coverScraping.icon,+ tools: [+ .symbolImage(R.image.key_iconSymbols(), weight: .regular),+ .symbolImage(R.image.ellipsis_iconSymbols())+ ]+ )+ navigation.enableClose = showClose++ return ASListPage(+ navigation: navigation,+ sections: getSections(),+ bottom: getBottom(),+ backgroundColor: .clear,+ pageInsets: .insets(top: R.Size.SheetGrabberTopInset)+ )+ }++ private func getSections() -> [ASListPage.Section] {+ let skipSection = ASListPage.Section(+ cells: [+ .iconTitleDetailSwitchCell(title: R.string.localizable.skipExistingCovers(),+ state: skipExisting ? .on : .off,+ enablePressEffect: false)+ ],+ header: .texts([.smallText(R.string.localizable.coverScrapingDesc(), numberOfLines: 0)], pin: false)+ )+ let scrapeSection = ASListPage.Section(cells: [+ .iconTitleDetailSwitchCell(title: R.string.localizable.scrapeCover(),+ state: scrapeCover ? .on : .off,+ enablePressEffect: false),+ .iconTitleDetailSwitchCell(title: R.string.localizable.scrapeIcon(),+ state: scrapeIcon ? .on : .off,+ enablePressEffect: false),+ .iconTitleDetailSwitchCell(title: R.string.localizable.scrapeBanner(),+ state: scrapeBanner ? .on : .off,+ enablePressEffect: false)+ ])+ return [skipSection, scrapeSection]+ }++ private func getBottom() -> ASButton {+ var button = ASButton.large(title: R.string.localizable.startScraping(),+ titleColor: R.Color.LabelPrimary.forceStyle(.dark),+ titleAlignment: .center,+ background: R.Color.Main)+ var disableAttributes = button.allAttributes[.normal]!+ disableAttributes.background = R.Color.BackgroundSecondary+ disableAttributes.title?.attributes?.color = R.Color.LabelTertiary+ button.allAttributes[.disabled] = disableAttributes+ button.state = canStartScraping ? .normal : .disabled+ return button+ }++ private func updateBottom() {+ listPageView.bottom = getBottom()+ }++ //MARK: - Actions++ private func handleAction(_ action: ASListPage.Action) {+ if let navigationValue = action.navigationValue {+ if navigationValue.isTapClose {+ hide()+ } else if let toolIndex = navigationValue.tapToolsValue {+ switch NavTool(rawValue: toolIndex) {+ case .apiKey:+ showAPIKeyInput()+ case .more:+ showMoreMenu()+ case .none:+ break+ }+ }+ } else if let (indexPath, cellData, subActions) = action.normalItemValue {+ guard let isOn = subActions?.extraValue as? Bool,+ let row = ScrapeRow.from(indexPath) else { return }+ applySwitch(row: row, isOn: isOn)+ listPageView.updateCellData(cellData.updateNormalSwitch(state: isOn ? .on : .off),+ indexPath: indexPath,+ reloadView: false)+ if row != .skipExisting {+ updateBottom()+ }+ } else if action.isBottom {+ beginScraping()+ }+ }++ private func applySwitch(row: ScrapeRow, isOn: Bool) {+ switch row {+ case .skipExisting: skipExisting = isOn+ case .scrapeCover: scrapeCover = isOn+ case .scrapeIcon: scrapeIcon = isOn+ case .scrapeBanner: scrapeBanner = isOn+ }+ }++ private func showAPIKeyInput(onSaved: ((String) -> Void)? = nil) {+ LimitedTextInputView.show(icon: .symbolImage(R.image.key_iconSymbols()),+ title: onSaved == nil ? "SteamGridDB API Key" : "API Key",+ detail: R.string.localizable.steamGridDBAPIKeyDesc() + "\n" + R.string.localizable.steamGridDBAPIKeyAlert(),+ limitedType: .normal(maxTextSize: 255),+ confirmAction: { key in+ if let key = key as? String, !key.trimmed.isEmpty {+ Settings.defalut.updateExtra(key: ExtraKey.steamGridDBAPIKey.rawValue, value: key)+ onSaved?(key.trimmed)+ } else {+ UIView.makeToast(message: R.string.localizable.steamGridDBAPIKeyAlert())+ }+ })+ }++ private func showMoreMenu() {+ ChevronSheetView.show(icon: .symbolImage(R.image.ellipsis_iconSymbols()),+ title: R.string.localizable.moreSettingTitle(),+ cellOptions: [+ .iconTitleChevronCell(icon: .symbolImage(R.image.delete_iconSymbols(), colors: [R.Color.Red]),+ title: R.string.localizable.removeCover(),+ titleColor: R.Color.Red),+ .iconTitleChevronCell(icon: .symbolImage(R.image.delete_iconSymbols(), colors: [R.Color.Red]),+ title: R.string.localizable.removeIcon(),+ titleColor: R.Color.Red),+ .iconTitleChevronCell(icon: .symbolImage(R.image.delete_iconSymbols(), colors: [R.Color.Red]),+ title: R.string.localizable.removeBanner(),+ titleColor: R.Color.Red),+ .iconTitleChevronCell(icon: .symbolImage(R.image.delete_iconSymbols(), colors: [R.Color.Red]),+ title: R.string.localizable.removeAllArtwork(),+ titleColor: R.Color.Red)+ ]) { [weak self] index in+ guard let self, let index else { return }+ switch index {+ case 0:+ self.confirmRemove(detail: R.string.localizable.removeCoverAlert(), cover: true, icon: false, banner: false)+ case 1:+ self.confirmRemove(detail: R.string.localizable.removeIconAlert(), cover: false, icon: true, banner: false)+ case 2:+ self.confirmRemove(detail: R.string.localizable.removeBannerAlert(), cover: false, icon: false, banner: true)+ case 3:+ self.confirmRemove(detail: R.string.localizable.removeAllArtworkAlert(), cover: true, icon: true, banner: true)+ default:+ break+ }+ }+ }++ private func confirmRemove(detail: String, cover: Bool, icon: Bool, banner: Bool) {+ UIView.makeAlert(detail: detail,+ confirmTitle: R.string.localizable.confirmTitle(),+ confirmAction: { [weak self] in+ self?.removeAssets(cover: cover, icon: icon, banner: banner)+ })+ }++ private func removeAssets(cover: Bool, icon: Bool, banner: Bool) {+ let ids = games.map(\.id)+ Game.change { realm in+ for id in ids {+ guard let game = realm.object(ofType: Game.self, forPrimaryKey: id), !game.isDeleted else { continue }+ if cover {+ game.gameCover?.deleteAndClean(realm: realm)+ game.gameCover = nil+ game.onlineCoverUrl = nil+ }+ if icon {+ game.icon?.deleteAndClean(realm: realm)+ game.icon = nil+ }+ if banner {+ game.banner?.deleteAndClean(realm: realm)+ game.banner = nil+ }+ }+ }+ NotificationCenter.default.post(name: R.NotificationName.GameCoverChange, object: nil)+ }++ //MARK: - Scraping++ private func beginScraping() {+ guard canStartScraping, !isScraping else { return }++ func start(apiKey: String) {+ startScraping(apiKey: apiKey)+ }++ if let apiKey = Settings.defalut.SteamGridDBAPIKey, !apiKey.trimmed.isEmpty {+ start(apiKey: apiKey)+ } else {+ showAPIKeyInput(onSaved: { key in+ start(apiKey: key)+ })+ }+ }++ private func startScraping(apiKey: String) {+ guard canStartScraping, !isScraping else { return }+ isScraping = true++ let snapshots = games.map { GameCoverScraper.Snapshot(game: $0) }+ let options = GameCoverScraper.Options(skipExisting: skipExisting,+ scrapeCover: scrapeCover,+ scrapeIcon: scrapeIcon,+ scrapeBanner: scrapeBanner)+ UIView.makeLoading()+ Task { [weak self] in+ let summary = await GameCoverScraper.scrape(snapshots: snapshots, options: options, apiKey: apiKey)+ let detail = summary.detailText(options: options)+ await MainActor.run {+ self?.isScraping = false+ if summary.didUpdateArtwork {+ NotificationCenter.default.post(name: R.NotificationName.GameCoverChange, object: nil)+ }+ UIView.hideLoading {+ UIView.makeAlert(title: R.string.localizable.coverScraping(),+ detail: detail,+ detailAlignment: .left,+ cancelTitle: R.string.localizable.confirmTitle())+ }+ }+ }+ }+}++extension GameCoverScrapingView: ShowableView {+ static func show(games: [Game]? = nil) {+ if let games {+ Self.show(parameters: games)+ } else {+ let realm = Database.realm+ let games = realm.objects(Game.self).where({ !$0.isDeleted })+ if games.count > 0 {+ Self.show(parameters: Array(games))+ } else {+ UIView.makeToast(message: R.string.localizable.transferPakNoGames())+ }+ }+ }+}++// MARK: - Scraper++private enum GameCoverScraper {+ private static let maxConcurrent = 4+ private static let jpegQuality: CGFloat = 0.7++ struct Snapshot {+ let id: String+ let displayName: String+ let hasCover: Bool+ let hasIcon: Bool+ let hasBanner: Bool++ init(game: Game) {+ id = game.id+ displayName = game.displayName+ let onlineCover = game.onlineCoverUrl?.trimmed ?? ""+ hasCover = game.gameCover != nil || !onlineCover.isEmpty+ hasIcon = game.icon != nil+ hasBanner = game.banner != nil+ }+ }++ struct Options {+ let skipExisting: Bool+ let scrapeCover: Bool+ let scrapeIcon: Bool+ let scrapeBanner: Bool+ }++ struct AssetCount {+ var updated = 0+ var skipped = 0+ var failed = 0++ mutating func add(_ result: AssetResult) {+ switch result {+ case .unused: break+ case .skipped: skipped += 1+ case .updated: updated += 1+ case .failed: failed += 1+ }+ }+ }++ enum AssetResult {+ case unused, skipped, updated, failed+ }++ struct GameOutcome {+ var cover: AssetResult = .unused+ var icon: AssetResult = .unused+ var banner: AssetResult = .unused+ }++ struct Summary {+ var cover = AssetCount()+ var icon = AssetCount()+ var banner = AssetCount()++ var didUpdateArtwork: Bool {+ cover.updated > 0 || icon.updated > 0 || banner.updated > 0+ }++ mutating func merge(_ outcome: GameOutcome) {+ cover.add(outcome.cover)+ icon.add(outcome.icon)+ banner.add(outcome.banner)+ }++ func detailText(options: Options) -> String {+ var lines = [R.string.localizable.coverScrapingComplete()]+ if options.scrapeCover {+ lines.append(R.string.localizable.coverScrapingStat(R.string.localizable.boxArt(),+ cover.updated,+ cover.skipped,+ cover.failed))+ }+ if options.scrapeIcon {+ lines.append(R.string.localizable.coverScrapingStat(R.string.localizable.icon(),+ icon.updated,+ icon.skipped,+ icon.failed))+ }+ if options.scrapeBanner {+ lines.append(R.string.localizable.coverScrapingStat(R.string.localizable.banner(),+ banner.updated,+ banner.skipped,+ banner.failed))+ }+ return lines.joined(separator: "\n")+ }+ }++ static func scrape(snapshots: [Snapshot], options: Options, apiKey: String) async -> Summary {+ var summary = Summary()+ await withTaskGroup(of: GameOutcome.self) { group in+ var nextIndex = 0+ func enqueue() {+ guard nextIndex < snapshots.count else { return }+ let snapshot = snapshots[nextIndex]+ nextIndex += 1+ group.addTask {+ await scrapeOne(snapshot: snapshot, options: options, apiKey: apiKey)+ }+ }+ for _ in 0..<min(maxConcurrent, snapshots.count) {+ enqueue()+ }+ for await outcome in group {+ summary.merge(outcome)+ enqueue()+ }+ }+ return summary+ }++ private static func scrapeOne(snapshot: Snapshot, options: Options, apiKey: String) async -> GameOutcome {+ var outcome = GameOutcome()++ // Skip Existing Covers applies to every enabled asset that is already present.+ let needCover = options.scrapeCover && !(options.skipExisting && snapshot.hasCover)+ let needIcon = options.scrapeIcon && !(options.skipExisting && snapshot.hasIcon)+ let needBanner = options.scrapeBanner && !(options.skipExisting && snapshot.hasBanner)++ if options.scrapeCover, options.skipExisting, snapshot.hasCover {+ outcome.cover = .skipped+ }+ if options.scrapeIcon, options.skipExisting, snapshot.hasIcon {+ outcome.icon = .skipped+ }+ if options.scrapeBanner, options.skipExisting, snapshot.hasBanner {+ outcome.banner = .skipped+ }++ guard needCover || needIcon || needBanner else { return outcome }++ let query = snapshot.displayName.trimmed+ guard !query.isEmpty else {+ if needCover { outcome.cover = .failed }+ if needIcon { outcome.icon = .failed }+ if needBanner { outcome.banner = .failed }+ return outcome+ }++ let matches: [SteamGridDBGame]+ do {+ matches = try await SteamGridDBKit.searchGame(apiKey: apiKey, query: query)+ } catch {+ if needCover { outcome.cover = .failed }+ if needIcon { outcome.icon = .failed }+ if needBanner { outcome.banner = .failed }+ return outcome+ }++ guard let sgdbGame = bestMatch(query: query, in: matches) else {+ if needCover { outcome.cover = .failed }+ if needIcon { outcome.icon = .failed }+ if needBanner { outcome.banner = .failed }+ return outcome+ }++ async let coverImage = fetchImageIfNeeded(needCover, apiKey: apiKey, gameId: sgdbGame.id, kind: .cover)+ async let iconImage = fetchImageIfNeeded(needIcon, apiKey: apiKey, gameId: sgdbGame.id, kind: .icon)+ async let bannerImage = fetchImageIfNeeded(needBanner, apiKey: apiKey, gameId: sgdbGame.id, kind: .banner)+ let images = await (cover: coverImage, icon: iconImage, banner: bannerImage)++ let coverData = imageData(images.cover)+ let iconData = imageData(images.icon)+ let bannerData = imageData(images.banner)++ if needCover, coverData == nil { outcome.cover = .failed }+ if needIcon, iconData == nil { outcome.icon = .failed }+ if needBanner, bannerData == nil { outcome.banner = .failed }++ guard coverData != nil || iconData != nil || bannerData != nil else { return outcome }++ let persisted = await MainActor.run {+ persist(gameID: snapshot.id, coverData: coverData, iconData: iconData, bannerData: bannerData)+ }+ if needCover, coverData != nil {+ outcome.cover = persisted.cover ? .updated : .failed+ }+ if needIcon, iconData != nil {+ outcome.icon = persisted.icon ? .updated : .failed+ }+ if needBanner, bannerData != nil {+ outcome.banner = persisted.banner ? .updated : .failed+ }+ return outcome+ }++ private enum ArtworkKind {+ case cover, icon, banner+ }++ /// Fuse scores are lower when closer; pick the closest title among SteamGridDB hits.+ private static func bestMatch(query: String, in games: [SteamGridDBGame]) -> SteamGridDBGame? {+ guard !games.isEmpty else { return nil }+ let fuse = Fuse()+ let pattern = fuse.createPattern(from: query)+ let scored = games.compactMap { game -> (SteamGridDBGame, Double)? in+ guard let score = fuse.search(pattern, in: game.name)?.score else { return nil }+ return (game, score)+ }+ if let best = scored.min(by: { $0.1 < $1.1 }) {+ return best.0+ }+ return games.first+ }++ private static func fetchImageIfNeeded(_ need: Bool, apiKey: String, gameId: Int, kind: ArtworkKind) async -> UIImage? {+ guard need else { return nil }+ return await firstImage(apiKey: apiKey, gameId: gameId, kind: kind)+ }++ private static func imageData(_ image: UIImage?) -> Data? {+ guard let image else { return nil }+ return image.jpegData(compressionQuality: jpegQuality) ?? image.pngData()+ }++ private static func firstImage(apiKey: String, gameId: Int, kind: ArtworkKind) async -> UIImage? {+ let page: SteamGridDBImagePage+ do {+ switch kind {+ case .cover:+ page = try await SteamGridDBKit.getGridsById(apiKey: apiKey, id: gameId)+ case .icon:+ page = try await SteamGridDBKit.getIconsById(apiKey: apiKey, id: gameId)+ case .banner:+ page = try await SteamGridDBKit.getHeroesById(apiKey: apiKey, id: gameId)+ }+ } catch {+ return nil+ }+ guard let image = page.images.first else { return nil }+ if let downloaded = await downloadImage(image.url) {+ return downloaded+ }+ return await downloadImage(image.thumb)+ }++ private static func downloadImage(_ urlString: String) async -> UIImage? {+ guard let url = URL(string: urlString), !urlString.isEmpty else { return nil }+ return await withCheckedContinuation { continuation in+ KingfisherManager.shared.retrieveImage(with: url) { result in+ switch result {+ case .success(let imageResult):+ continuation.resume(returning: imageResult.image)+ case .failure:+ continuation.resume(returning: nil)+ }+ }+ }+ }++ @MainActor+ private static func persist(gameID: String, coverData: Data?, iconData: Data?, bannerData: Data?) -> (cover: Bool, icon: Bool, banner: Bool) {+ var coverOK = false+ var iconOK = false+ var bannerOK = false+ Game.change { realm in+ guard let game = realm.object(ofType: Game.self, forPrimaryKey: gameID), !game.isDeleted else { return }+ if let coverData {+ game.gameCover?.deleteAndClean(realm: realm)+ game.gameCover = CreamAsset.create(objectID: game.id, propName: "gameCover", data: coverData)+ game.onlineCoverUrl = nil+ coverOK = true+ }+ if let iconData {+ game.icon?.deleteAndClean(realm: realm)+ game.icon = CreamAsset.create(objectID: game.id, propName: "icon", data: iconData)+ iconOK = true+ }+ if let bannerData {+ game.banner?.deleteAndClean(realm: realm)+ game.banner = CreamAsset.create(objectID: game.id, propName: "banner", data: bannerData)+ bannerOK = true+ }+ }+ return (coverOK, iconOK, bannerOK)+ }+}diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swiftindex b5e7eb67..aea5b1df 100644--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift@@ -156,7 +156,7 @@ class GameInfoView: BaseView {if let image {self.gameCoverView.updateImage(image)self.navigationView.gameCover.image = image.scaled(toSize: CGSize(R.Size.ItemHeightLarge - R.Size.ContentSpaceSmall*2))- } else if let onlineCoverUrl = self.game.onlineCoverUrl {+ } else if let _ = self.game.onlineCoverUrl {self.game.getCoverImage(completion: { [weak self] image inguard let self else { return }if let image {@@ -164,6 +164,10 @@ class GameInfoView: BaseView {self.navigationView.gameCover.image = image.scaled(toSize: CGSize(R.Size.ItemHeightLarge - R.Size.ContentSpaceSmall*2))}})+ } else {+ let placeHolder = UIImage.placeHolder(preferenceSize: self.gameCoverView.size)+ self.gameCoverView.updateImage(placeHolder)+ self.navigationView.gameCover.image = placeHolder.scaled(toSize: CGSize(R.Size.ItemHeightLarge - R.Size.ContentSpaceSmall*2))}default:diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOption.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOption.swiftindex f1f78bc6..3014c85c 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOption.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOption.swift@@ -78,7 +78,8 @@ enum GameOption: Int, CaseIterable {rewind,netplay,symbianDevice,- wiiControllerMode+ wiiControllerMode,+ coverScraping//When adding a new option, make sure to add it at the end; otherwise, it might affect the existing Prefference configurations@@ -86,7 +87,7 @@ enum GameOption: Int, CaseIterable {switch self {case .rename:.symbolImage(R.image.renameRegular_iconSymbols())- case .cover:+ case .cover, .coverScraping:.symbolImage(R.image.cover_iconSymbols())case .skins:.symbolImage(R.image.skin_iconSymbols())@@ -365,6 +366,8 @@ enum GameOption: Int, CaseIterable {R.string.localizable.netplay()case .symbianDevice:R.string.localizable.symbianFirmwareChoosing()+ case .coverScraping:+ R.string.localizable.coverScraping()}}@@ -446,6 +449,7 @@ enum GameOption: Int, CaseIterable {[.rename,.cover,+ .coverScraping,.skins],[@@ -945,7 +949,8 @@ enum GameOption: Int, CaseIterable {.simBlowing,.reload,.quit,- .gameShortcut:+ .gameShortcut,+ .coverScraping:break}return .chevron(nil)@@ -967,7 +972,7 @@ enum GameOption: Int, CaseIterable {.quit,]case .gameInfo:- return disableOptionsForScene(.common) + [.rename, .genHomeMenu]+ return disableOptionsForScene(.common) + [.rename, .genHomeMenu, .coverScraping]case .gaming:return [@@ -1000,6 +1005,7 @@ enum GameOption: Int, CaseIterable {.clownMDTvStandard,.snesVRAM,.symbianDevice,+ .coverScraping]}}@@ -1243,7 +1249,9 @@ enum GameOption: Int, CaseIterable {guard games.count > 0 else { return [] }if games.count == 1 {- return availableOptions(game: games.first!, scene: scene)+ var options = availableOptions(game: games.first!, scene: scene)+ options.removeAll(where: { $0 == .coverScraping })+ return options} else {guard let firstGame = games.first else { return [] }diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swiftindex ab4713d4..30506e8b 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift@@ -237,8 +237,10 @@ extension GameOption {UIPasteboard.general.string = R.URLs.MeloNXGameLaunch(gameId: firstGame.id).absoluteString} else if firstGame.gameType == .xbox360 {UIPasteboard.general.string = R.URLs.XeniOSGameLaunch(gameId: firstGame.id).absoluteString- } else if firstGame.gameType == .xbox360 {+ } else if firstGame.gameType == .xbox {UIPasteboard.general.string = R.URLs.DukeXGameLaunch(gameId: firstGame.id).absoluteString+ } else if firstGame.gameType == .ps2 {+ UIPasteboard.general.string = R.URLs.ARMSX2GameLaunch(gameId: firstGame.id).absoluteString} else {UIPasteboard.general.string = "manicemu://launch/\(firstGame.id)"}@@ -1069,6 +1071,8 @@ extension GameOption {case .wiiControllerMode:performStringAction(with: games, accessoryChange: accessoryChange)+ case .coverScraping:+ GameCoverScrapingView.show(games: games)}}@@ -1507,8 +1511,19 @@ extension GameOption {})if PlayViewController.isGaming {let wiiController = firstGame.getExtraInt(key: ExtraKey.wiiController.rawValue) ?? 0- LibretroCore.sharedInstance().setWiiRemote(wiiController != 0)- WiiEmulatorBridge.shared.isWiiremoteSideways = wiiController == 2+ let controllerType = LibretroWiiController(rawValue: wiiController) ?? .classicPro+ let realm = Database.realm+ if let currentSkinID = PlayViewController.currentSkinID,+ let skin = realm.object(ofType: Skin.self, forPrimaryKey: currentSkinID) {+ if controllerType == .classicPro, skin.skinType != .default {+ PlayViewController.updateSkin()+ } else if controllerType != .classicPro, skin.skinType == .default {+ PlayViewController.updateSkin()+ }++ }+ LibretroCore.sharedInstance().setWiiController(controllerType)+ WiiEmulatorBridge.shared.controllerType = controllerTyperesumeEmulationIfNeed()}}diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swiftindex 6540e5e6..43a4271c 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift@@ -325,6 +325,8 @@ class GameCoverView: BaseView {image = style == .style2 ? R.image.c64_cover_v() : R.image.c64_cover_h()} else if gameType == .amiga {image = style == .style2 ? R.image.amiga_cover_v() : R.image.amiga_cover_h()+ } else if gameType == .ps2 {+ image = style == .style2 ? R.image.ps2_cover_v() : R.image.ps2_cover_h()}if UIDevice.isPhone, !UIDevice.isLandscape, scalePlatform, R.Style.GamesPerRow != 2, let unwrapImage = image {image = unwrapImage.scaled(toWidth: unwrapImage.size.width * (1/(R.Style.GamesPerRow-1)))diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameLandscapeCarouselCell.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameLandscapeCarouselCell.swiftindex 6b435905..fee74b40 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameLandscapeCarouselCell.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameLandscapeCarouselCell.swift@@ -228,6 +228,7 @@ class GameLandscapeCarouselCell: UICollectionViewCell {emptyContentStack.isHidden = truecoverView.isHidden = falsecardView.snp.updateConstraints { make in+ make.centerY.equalToSuperview().offset(-Self.infoPanelReserve/2)make.size.equalTo(cardSize.height)}coverView.setData(game: game, coverSize: cardSize, style: R.Style.GameCoverStyle)@@ -248,6 +249,7 @@ class GameLandscapeCarouselCell: UICollectionViewCell {emptyCardView.isHidden = falseemptyContentStack.isHidden = falsecardView.snp.updateConstraints { make in+ make.centerY.equalToSuperview().offset(-((R.Size.NavigationHeight + R.Size.ContentInsetTop)/2))make.size.equalTo(cardSize.height)}emptyCardView.snp.updateConstraints { make indiff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swiftindex 97f86f14..a664137c 100644--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListLandscapeView.swift@@ -67,32 +67,12 @@ class GameListLandscapeView: BaseView {return view}()- ///主题:切换轮播样式+ /// Theme: carousel style, background music, and sound effectsprivate lazy var themeButton: ASButtonView = {let view = ASButtonView(.iconOnlyWithSmallSize(icon: .symbol(.paintpalette)).enableGlass(true))view.didTapButton = { [weak self] inguard let self else { return }-- ChevronSheetView.show(icon: .symbolImage(R.image.themeRegular_iconSymbols()),- title: R.string.localizable.themeSettingTitle(),- cellOptions: [- .iconTitleChevronCell(icon: .symbolImage(R.image.advance_shader_iconSymbols()),- title: R.string.localizable.dynamicBackground(),- chevronTitle: ShaderToy.getUsingShaderToy().title),- .iconTitleChevronCell(icon: .symbol(.squareStack),- title: R.string.localizable.carouselStyle()),- .iconTitleChevronCell(icon: .symbolImage(R.image.themeRegular_iconSymbols()),- title: R.string.localizable.moreSettingTitle()),- ], completion: { [weak self] index in- guard let self, let index else { return }- if index == 0 {- self.showDynamicBackgroundSheet()- } else if index == 1 {- self.showCarouselStyleSheet()- } else if index == 2 {- ThemeSettingView.show()- }- })+ self.showThemeSheet()}return view}()@@ -243,6 +223,7 @@ class GameListLandscapeView: BaseView {setupViews()setupDatas()setupNotifications()+ BackgroundMusicKit.shared.setLandscapeHomeVisible(true)}required init?(coder: NSCoder) {@@ -254,8 +235,9 @@ class GameListLandscapeView: BaseView {notificationTokens.forEach { NotificationCenter.default.removeObserver($0) }}- /// 横竖屏切换销毁前调用,避免 collectionView 在 bounds 动画期间仍触发异步 batch update+ /// Call before tearing down on rotation so collectionView cannot batch-update during the bounds animation.func prepareForRemoval() {+ BackgroundMusicKit.shared.setLandscapeHomeVisible(false)carouselView.dataSource = nilcarouselView.delegate = nil}@@ -688,6 +670,39 @@ class GameListLandscapeView: BaseView {object: background)}+ private func showThemeSheet() {+ ChevronSheetView.show(icon: .symbolImage(R.image.themeRegular_iconSymbols()),+ title: R.string.localizable.themeSettingTitle(),+ cellOptions: [+ .iconTitleChevronCell(icon: .symbolImage(R.image.advance_shader_iconSymbols()),+ title: R.string.localizable.dynamicBackground(),+ chevronTitle: ShaderToy.getUsingShaderToy().title),+ .iconTitleChevronCell(icon: .symbol(.squareStack),+ title: R.string.localizable.carouselStyle()),+ .iconTitleChevronCell(icon: .symbol(.musicNote),+ title: R.string.localizable.backgroundMusic(),+ chevronTitle: BackgroundMusicKit.shared.displayName),+ .iconTitleChevronCell(icon: .symbol(.speakerWave2),+ title: R.string.localizable.soundEffects(),+ chevronTitle: FocusSoundEffects.shared.displayName),+ .iconTitleChevronCell(icon: .symbolImage(R.image.themeRegular_iconSymbols()),+ title: R.string.localizable.moreSettingTitle()),+ ], completion: { [weak self] index in+ guard let self, let index else { return }+ if index == 0 {+ self.showDynamicBackgroundSheet()+ } else if index == 1 {+ self.showCarouselStyleSheet()+ } else if index == 2 {+ self.showBackgroundMusicSheet()+ } else if index == 3 {+ self.showSoundEffectsSheet()+ } else if index == 4 {+ ThemeSettingView.show()+ }+ })+ }+private func showDynamicBackgroundSheet() {let usingShaderToy = ShaderToy.getUsingShaderToy()var sections = [ASListPage.Section]()@@ -704,7 +719,7 @@ class GameListLandscapeView: BaseView {return .iconTitleDetailRadioCell(icon: $0.icon,iconSize: R.Size.ButtonSmall,title: $0.title,- detail: "@" + ($0.author ?? "Unknown"),+ detail: $0.author == nil ? nil : "@\($0.author!)",isSelected: isSelected)}), header: .texts([.smallText(R.string.localizable.dynamicBackgroundDesc(), numberOfLines: 0)], pin: false)))@@ -733,6 +748,12 @@ class GameListLandscapeView: BaseView {ASSheetView.show(.init(style: .listPage(listPage)), action: { [weak self] action, updation inguard let self else { return .dismiss() }++ if action.isTapBackground || action.listPageValue?.navigationValue?.isTapClose == true {+ self.showThemeSheet()+ return .dismiss()+ }+if let indexPath = action.listPageValue?.normalItemValue?.indexPath {if indexPath.section == 0 {//build in@@ -761,6 +782,8 @@ class GameListLandscapeView: BaseView {try? FileManager.safeCopyItem(at: $0, to: toUrl, shouldReplace: true)})self.showDynamicBackgroundSheet()+ }, cancelHandle: { [weak self] in+ self?.showDynamicBackgroundSheet()})})}@@ -769,6 +792,109 @@ class GameListLandscapeView: BaseView {}+ private func showBackgroundMusicSheet() {+ let builtInTracks = BackgroundMusicKit.shared.builtInTracks+ let customTracks = BackgroundMusicKit.shared.customTracks+ let selectedTitle = BackgroundMusicKit.shared.selectedTitle++ func radioCell(for track: BackgroundMusicKit.Track) -> ASListPage.Cell {+ .iconTitleDetailRadioCell(title: track.title,+ detail: track.author.isEmpty ? nil : "@\(track.author) · CC0",+ isSelected: selectedTitle == track.title)+ }++ var sections = [ASListPage.Section]()+ var builtInCells = [ASListPage.Cell]()+ builtInCells.append(.iconTitleDetailRadioCell(title: R.string.localizable.off(),+ isSelected: selectedTitle == nil))+ builtInCells.append(contentsOf: builtInTracks.map { radioCell(for: $0) })+ sections.append(.init(cells: builtInCells,+ header: .texts([.smallText(R.string.localizable.backgroundMusicDesc(), numberOfLines: 0)], pin: false)))+ if !customTracks.isEmpty {+ sections.append(.init(cells: customTracks.map { radioCell(for: $0) }))+ }++ let listPage = ASListPage(navigation: .defaultNavigation(title: R.string.localizable.backgroundMusic(),+ titleIcon: .symbol(.musicNote)),+ sections: sections,+ bottom: .large(title: R.string.localizable.addBackgroundMusic(),+ titleColor: R.Color.LabelPrimary.forceStyle(.dark),+ titleAlignment: .center,+ background: R.Color.Main),+ backgroundColor: .clear)++ ASSheetView.show(.init(style: .listPage(listPage)), action: { [weak self] action, _ in+ guard let self else { return .dismiss() }++ if action.isTapBackground || action.listPageValue?.navigationValue?.isTapClose == true {+ self.showThemeSheet()+ return .dismiss()+ }++ if let indexPath = action.listPageValue?.normalItemValue?.indexPath {+ if indexPath.section == 0 {+ if indexPath.row == 0 {+ BackgroundMusicKit.shared.select(title: nil)+ } else if builtInTracks.indices.contains(indexPath.row - 1) {+ BackgroundMusicKit.shared.select(title: builtInTracks[indexPath.row - 1].title)+ }+ } else if indexPath.section == 1, customTracks.indices.contains(indexPath.row) {+ BackgroundMusicKit.shared.select(title: customTracks[indexPath.row].title)+ }+ } else if action.listPageValue?.isBottom == true {+ return .dismiss(completion: { [weak self] in+ guard let self else { return }+ FilesImporter.shared.presentImportController(supportedTypes: BackgroundMusicKit.importTypes, manualHandle: { [weak self] urls in+ guard let self else { return }+ try? FileManager.default.createDirectory(atPath: R.Path.Assets, withIntermediateDirectories: true)+ urls.forEach {+ let fileName = BackgroundMusicKit.resolvedImportFileName(for: $0)+ let toUrl = URL(fileURLWithPath: R.Path.Assets.appendingPathComponent(fileName))+ try? FileManager.safeCopyItem(at: $0, to: toUrl, shouldReplace: true)+ }+ self.showBackgroundMusicSheet()+ }, cancelHandle: { [weak self] in+ self?.showBackgroundMusicSheet()+ })+ })+ }+ return .dismiss()+ })+ }++ private func showSoundEffectsSheet() {+ let packs = FocusSoundEffects.shared.packs+ let selectedName = FocusSoundEffects.shared.selectedPackName+ var cells = [ASListPage.Cell]()+ cells.append(.iconTitleDetailRadioCell(title: R.string.localizable.off(),+ isSelected: selectedName == nil))+ cells.append(contentsOf: packs.map { pack in+ .iconTitleDetailRadioCell(title: pack.name,+ detail: FocusSoundEffects.licenseDetail,+ isSelected: selectedName == pack.name)+ })+ let listPage = ASListPage(navigation: .defaultNavigation(title: R.string.localizable.soundEffects(),+ titleIcon: .symbol(.speakerWave2)),+ sections: [.init(cells: cells)],+ backgroundColor: .clear)+ ASSheetView.show(.init(style: .listPage(listPage)), action: { action, _ in+ if action.listPageValue?.navigationValue?.isTapClose == true {+ return .dismiss()+ }+ guard let indexPath = action.listPageValue?.normalItemValue?.indexPath else {+ return .dismiss()+ }+ if indexPath.row == 0 {+ FocusSoundEffects.shared.select(packName: nil)+ } else if packs.indices.contains(indexPath.row - 1) {+ FocusSoundEffects.shared.select(packName: packs[indexPath.row - 1].name)+ }+ return .dismiss()+ }, dismiss: { [weak self] in+ self?.showThemeSheet()+ })+ }+//MARK: - 主题(轮播样式切换)private func showCarouselStyleSheet() {@@ -811,7 +937,8 @@ class GameListLandscapeView: BaseView {ASSheetView.show(.init(style: .listPage(listPage)), action: { [weak self] action, _ inguard let self else { return .dismiss() }- if action.listPageValue?.navigationValue?.isTapClose == true {+ if action.listPageValue?.navigationValue?.isTapClose == true || action.isTapBackground {+ self.showThemeSheet()return .dismiss()}@@ -923,6 +1050,8 @@ class GameListLandscapeView: BaseView {default:return .none}+ }, dismiss: { [weak self] in+ self?.showCarouselStyleSheet()})}diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swiftindex 3287838b..d5064aef 100644--- a/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift@@ -35,6 +35,7 @@ class ImportServiceListView: BaseView {R.string.localizable.fetchGamesFromMeloNX(),R.string.localizable.fetchGamesFromXeniOS(),R.string.localizable.fetchGamesFromDukeX(),+ R.string.localizable.fetchGamesFromARMSX2(),], completion: { [weak self] index inguard let self else { return }if let index {@@ -45,6 +46,8 @@ class ImportServiceListView: BaseView {type = .xeniOS} else if index == 2 {type = .dukeX+ } else if index == 3 {+ type = .armsx2}if let type {EmulatorInteractionKit.fetchGames(type: type)diff --git a/ManicEmu/ManicEmu/Sources/Business/OnlinePlay/Views/LibretroNetplayView.swift b/ManicEmu/ManicEmu/Sources/Business/OnlinePlay/Views/LibretroNetplayView.swiftindex 1f6bb9f2..990ff921 100644--- a/ManicEmu/ManicEmu/Sources/Business/OnlinePlay/Views/LibretroNetplayView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/OnlinePlay/Views/LibretroNetplayView.swift@@ -397,7 +397,7 @@ class LibretroNetplayView: BaseView {} else if let index = navigationValue.tapToolsValue {if index == 0 {//info- let desc = EmulationCore.libretroCores.reduce("", { result, core in+ let desc = EmulationCore.libretroCores.filter({ $0.supportNetplay }).reduce("", { result, core invar gameTypesString: String = ""if let gameTypes = core.gameTypes {gameTypesString = "(\(gameTypes.reduce("", { $0 + ($0.isEmpty ? "" : " ") + $1.localizedShortName })))"diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swiftindex df4bc9a4..0bc64009 100644--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift@@ -154,6 +154,9 @@ class PlayViewController: GameViewController {} else if game.gameType == .xbox {EmulatorInteractionKit.startGame(type: .dukeX, id: game.id)return+ } else if game.gameType == .ps2 {+ EmulatorInteractionKit.startGame(type: .armsx2, id: game.id)+ return}game.ensurePS1BinCueSheet()@@ -913,7 +916,7 @@ class PlayViewController: GameViewController {self.view.setNeedsLayout()}) { [weak self] _ inguard let self = self else { return }- // Preference lookup and traits are based on the post-rotation size.+ self.updateAzaharMotionRotation()self.updateSkin()self.view.setNeedsLayout()self.resumeEmulationAndHandleAudio()@@ -1800,9 +1803,10 @@ extension PlayViewController {updateLibretroCoreConfigs(core: .Azahar, configs: [.citra_use_cpu_jit: "disabled",.citra_use_default_aes_key: manicGame.isAzaharArticBase || manicGame.isArticBaseHomeMenu || manicGame.is3DSHomeMenuGame ? "enabled" : "disabled",- .citra_required_online_lle_modules: manicGame.isArticBaseHomeMenu ? "enabled" : "disabled"+ .citra_required_online_lle_modules: manicGame.isArticBaseHomeMenu ? "enabled" : "disabled",+ .citra_motion_rotation: Self.citraMotionRotationValue()], safeMode: true)- //Azahar核心每次启动都不进行加速,免得闪退+ // Never start Azahar with fast-forward; it can crash on boot.Game.change { realm inself.manicGame.speed = .one}@@ -2088,9 +2092,10 @@ extension PlayViewController {updateLibretroCoreConfigs(core: .Azahar, configs: [.citra_use_cpu_jit: enableJIT ? "enabled" : "disabled",.citra_use_default_aes_key: manicGame.isAzaharArticBase || manicGame.isArticBaseHomeMenu || manicGame.is3DSHomeMenuGame ? "enabled" : "disabled",- .citra_required_online_lle_modules: enableLLE ? "enabled" : "disabled"+ .citra_required_online_lle_modules: enableLLE ? "enabled" : "disabled",+ .citra_motion_rotation: Self.citraMotionRotationValue()])- //Azahar核心每次启动都不进行加速,免得闪退+ // Never start Azahar with fast-forward; it can crash on boot.Game.change { realm inself.manicGame.speed = .one}@@ -2139,25 +2144,9 @@ extension PlayViewController {if enableJIT {setupUniversalScript(gameType: manicGame.gameType)}- var isNGCBiosExists = false- if manicGame.gameType == .ngc,- let bios = manicGame.gameType.biosItems.first {- let biosInLib = R.Path.System.appendingPathComponent(bios.fileName)- let biosInDoc = R.Path.BIOS.appendingPathComponent(bios.fileName)- if FileManager.default.fileExists(atPath: biosInLib) {- isNGCBiosExists = true- } else if FileManager.default.fileExists(atPath: biosInDoc) {- do {- try FileManager.safeCopyItem(at: URL(fileURLWithPath: biosInDoc),- to: URL(fileURLWithPath: biosInLib))- isNGCBiosExists = true- } catch {}- }- }//4: JITARM64 5: Cached InterpreterupdateLibretroCoreConfigs(core: .Dolphin, configs: [.dolphin_cpu_core: enableJIT ? "4" : "5",- .dolphin_skip_gc_bios: isNGCBiosExists ? "disabled" : "enabled",.dolphin_cheats_enabled: isHardcoreMode ? "disabled" : "enabled"])} else if manicGame.gameType == .amiga {@@ -2318,9 +2307,24 @@ extension PlayViewController {if manicGame.supportSwapScreen {controllerSkin.isSwapScreen = manicGame.swapScreen}- controllerView.controllerSkin = controllerSkin+ if manicGame.gameType == .wii,+ let controllerType = LibretroWiiController(rawValue: manicGame.getExtraInt(key: ExtraKey.wiiController.rawValue) ?? 0),+ controllerType != .classicPro,+ let wiimoteSkin = Database.realm.objects(Skin.self).where({+ $0.identifier == R.Strings.WiimoteSkinIdentifier }).first,+ let wiimoteControllerSkin = ControllerSkin(fileURL: wiimoteSkin.fileURL) {+ //If the user has set up a Wiimote controller and hasn't specifically picked a preferred skin, then assign the Wiimote skin to them.+ controllerView.controllerSkin = wiimoteControllerSkin+ } else {+ controllerView.controllerSkin = controllerSkin+ }// Same dual-orientation skin may only be stored under the other orientation key.controllerView.updateControllerSkin()++ if let identifier = controllerView.controllerSkin?.identifier,+ let skin = Database.realm.objects(Skin.self).where({ $0.identifier == identifier }).first {+ currentSkinID = skin.id+ }}}@@ -2374,7 +2378,33 @@ extension PlayViewController {}}- /// 按照配置开始强制旋转屏幕+ /// Android Surface.ROTATION_* value for Azahar `citra_motion_rotation`.+ private static func citraMotionRotationValue(+ for orientation: UIInterfaceOrientation = UIDevice.currentOrientation+ ) -> String {+ switch orientation {+ case .portrait:+ return "0"+ case .landscapeLeft:+ return "1"+ case .portraitUpsideDown:+ return "2"+ case .landscapeRight:+ return "3"+ default:+ return "3"+ }+ }++ private func updateAzaharMotionRotation() {+ guard manicGame.isAzahar3DS else { return }+ LibretroCore.sharedInstance().updateRunningCoreConfigs(+ [SpecialCoreOption.citra_motion_rotation.rawValue: Self.citraMotionRotationValue()],+ flush: false+ )+ }++ /// Rotate to the orientation selected in game options.private func startOrientation() {if #available(iOS 16.0, tvOS 16.0, *) {self.setNeedsUpdateOfSupportedInterfaceOrientations()@@ -2850,9 +2880,9 @@ extension PlayViewController {}} else if manicGame.gameType == .wii {let wiiController = manicGame.getExtraInt(key: ExtraKey.wiiController.rawValue) ?? 0- LibretroCore.sharedInstance().setWiiRemote(wiiController != 0)- //Wiiremote Sideways- WiiEmulatorBridge.shared.isWiiremoteSideways = wiiController == 2+ let controllerType = LibretroWiiController(rawValue: wiiController) ?? .classicPro+ LibretroCore.sharedInstance().setWiiController(controllerType)+ WiiEmulatorBridge.shared.controllerType = controllerType}DispatchQueue.main.asyncAfter(delay: 2.5) {self.updateFastforward(speed: self.manicGame.speed)diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/SettingItem.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/SettingItem.swiftindex aa47038a..40c31d3d 100644--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/SettingItem.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/SettingItem.swift@@ -10,7 +10,7 @@struct SettingItem {enum ItemType: String {- case appearance, theme, quickGame, autoSaveState, skin, airPlay, iCloud, fullScreenWhenConnectController, bios, respectSilentMode, onlinePlay, rumble, skinSound, retro, triggerPro, jit, shaders, globalCoreSwitch, FAQ, feedback, qq, telegram, discord, about, shareApp, clearCache, language, userAgreement, privacyPolicy, featuredItems+ case appearance, theme, quickGame, autoSaveState, skin, airPlay, iCloud, fullScreenWhenConnectController, bios, respectSilentMode, onlinePlay, rumble, skinSound, retro, triggerPro, jit, shaders, globalCoreSwitch, FAQ, feedback, qq, telegram, discord, about, shareApp, clearCache, language, userAgreement, privacyPolicy, featuredItems, coverScraping}var type: ItemType@@ -105,7 +105,7 @@ struct SettingItem {[R.Color.Green]case .skin, .skinSound, .about:[R.Color.Pink]- case .airPlay, .qq, .telegram, .shareApp:+ case .airPlay, .qq, .telegram, .shareApp, .coverScraping:[R.Color.Indigo]case .quickGame, .iCloud, .triggerPro, .clearCache:[R.Color.Yellow]@@ -180,6 +180,8 @@ struct SettingItem {ASIcon.symbolImage(R.image.skin_iconSymbols(), colors: iconColors)case .globalCoreSwitch:ASIcon.symbolImage(R.image.core_iconSymbols(), colors: iconColors)+ case .coverScraping:+ ASIcon.symbolImage(R.image.cover_iconSymbols(), colors: iconColors)}}@@ -245,6 +247,8 @@ struct SettingItem {R.string.localizable.skinSoundEffects()case .globalCoreSwitch:R.string.localizable.globalCoreSwitch()+ case .coverScraping:+ R.string.localizable.coverScraping()}}diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swiftindex 206c0351..8729465e 100644--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift@@ -98,6 +98,8 @@ class BIOSSelectionView: BaseView {}} else if gameType == .symbian {SymbianFirmwareView.show()+ } else if gameType == .ngc {+ self.showGamecubeIPLSheet(desc: gameType.biosItems.first?.desc)} else {self.importBios(gameType: gameType)}@@ -190,7 +192,9 @@ class BIOSSelectionView: BaseView {} else {importTitle = R.string.localizable.tabbarTitleImport()}- if item.fileName == R.string.localizable.symbianOSFirmware() || item.fileName == "nand.zip" {+ if item.fileName == R.string.localizable.symbianOSFirmware() ||+ item.fileName == "nand.zip" ||+ item.fileName == "IPL.bin" {styles.append(.chevron(.init()))} else {styles.append(.button(.large(title: importTitle,@@ -224,7 +228,12 @@ class BIOSSelectionView: BaseView {guard var biosItems = self.biosItemMaps[gameType] else { return }for (index, bios) in biosItems.enumerated() {var biosInLib = R.Path.System.appendingPathComponent(bios.fileName)- if gameType == .dc {+ if gameType == .ngc {+ let imported = [R.Path.GamecubeUserEUR, R.Path.GamecubeUserJAP, R.Path.GamecubeUserUSA]+ .contains { fileManager.fileExists(atPath: $0.appendingPathComponent("IPL.bin")) }+ biosItems[index].imported = imported+ continue+ } else if gameType == .dc {biosInLib = R.Path.Flycast.appendingPathComponent("dc/\(bios.fileName)")} else if gameType == .c64 {biosInLib = R.Path.System.appendingPathComponent("vice/\(bios.fileName)")@@ -251,6 +260,83 @@ class BIOSSelectionView: BaseView {}}+ private func showGamecubeIPLSheet(desc: String?) {+ let iplFileName = "IPL.bin"+ let regions: [(title: String, directory: String)] = [+ ("EUR IPL.bin", R.Path.GamecubeUserEUR),+ ("JAP IPL.bin", R.Path.GamecubeUserJAP),+ ("USA IPL.bin", R.Path.GamecubeUserUSA)+ ]++ func makeCell(title: String, directory: String) -> ASListPage.Cell {+ let imported = FileManager.default.fileExists(atPath: directory.appendingPathComponent(iplFileName))+ let importTitle = imported ? R.string.localizable.biosImported() : R.string.localizable.tabbarTitleImport()+ var button = ASButton.large(title: importTitle,+ titleColor: imported ? R.Color.Green : R.Color.Red,+ background: .clear)+ button.state = .disabled+ return .normal([+ .title(.largeText(title)),+ .button(button)+ ])+ }++ var detailText: ASText? = nil+ if let desc {+ detailText = .smallText(desc, numberOfLines: 0)+ }++ var sheetStyle: ASSheet.Style = .simpleList(icon: .symbolImage(R.image.bios_iconSymbols()),+ title: "GameCube BIOS",+ detail: detailText,+ options: regions.map { [makeCell(title: $0.title, directory: $0.directory)] })++ ASSheetView.show(.init(style: sheetStyle), action: { [weak self] action, updation in+ if let indexPath = action.listPageValue?.normalItemValue?.indexPath,+ indexPath.section < regions.count {+ let region = regions[indexPath.section]+ FilesImporter.shared.presentImportController(supportedTypes: UTType.binTypes, allowsMultipleSelection: false) { urls in+ UIView.makeLoading()+ DispatchQueue.global().async {+ // Match IPL.bin case-insensitively; always write as IPL.bin.+ let matched = urls.first(where: { $0.lastPathComponent.lowercased() == iplFileName.lowercased() })+ var success = false+ if let matched {+ let destURL = URL(fileURLWithPath: region.directory.appendingPathComponent(iplFileName))+ do {+ try FileManager.safeCopyItem(at: matched, to: destURL, shouldReplace: true)+ success = FileManager.default.fileExists(atPath: destURL.path)+ } catch {+ success = false+ }+ }+ DispatchQueue.main.async {+ UIView.hideLoading()+ if success {+ UIView.makeToast(message: R.string.localizable.biosImportSuccess(iplFileName))+ if case let .simpleList(icon, title, detail, options, cancelEnable) = sheetStyle {+ var cells = options+ cells[indexPath.section][0] = makeCell(title: region.title, directory: region.directory)+ sheetStyle = .simpleList(icon: icon,+ title: title,+ detail: detail,+ options: cells,+ cancelEnable: cancelEnable)+ updation?(sheetStyle)+ }+ self?.reloadImportState(gameType: .ngc, updateViews: false)+ } else {+ UIView.makeToast(message: R.string.localizable.biosImportFailed())+ }+ }+ }+ }+ return .none+ }+ return .dismiss()+ })+ }+private func importBios(gameType: GameType) {func importFromFiles() {FilesImporter.shared.presentImportController(supportedTypes: UTType.binTypes, allowsMultipleSelection: true) { urls indiff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swiftindex db1a830b..bfaed9d6 100644--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift@@ -67,7 +67,8 @@ class SettingsListView: BaseView {.init(type: .theme),.init(type: .quickGame),.init(type: .autoSaveState),- .init(type: .skin)]+ .init(type: .skin),+ .init(type: .coverScraping)]} else if section == .advance {#if SIDE_LOAD@@ -445,6 +446,13 @@ class SettingsListView: BaseView {let value = upateSwitchSettings(extraValue: subActions?.extraValue, cellData: cellData, indexPath: indexPath)Settings.defalut.updateExtra(key: ExtraKey.skinSoundEffects.rawValue, value: value)+ case .coverScraping:+ if UIDevice.isPad {+ didTapDetailView?(GameCoverScrapingView(showClose: false))+ } else {+ GameCoverScrapingView.show()+ }+default:break}diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swiftindex 1e9cb759..7c249269 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/Wii.swift@@ -38,6 +38,8 @@ extension GameType {case rightThumbstickDowncase rightThumbstickLeftcase rightThumbstickRight+ case c+ case zcase flexcase menu@@ -71,6 +73,8 @@ extension GameType {else if stringValue == "rightThumbstickDown" { self = .rightThumbstickDown}else if stringValue == "rightThumbstickLeft" { self = .rightThumbstickLeft}else if stringValue == "rightThumbstickRight" { self = .rightThumbstickRight}+ else if stringValue == "c" { self = .c}+ else if stringValue == "z" { self = .z}else { return nil }}}@@ -112,7 +116,7 @@ class WiiEmulatorBridge : EmulatorBridgeBase {private var thumbstickPosition: CGPoint = .zero- var isWiiremoteSideways: Bool = false+ var controllerType: LibretroWiiController = .classicProoverride func activateInput(_ input: Int, value: Double, playerIndex: Int) {guard playerIndex >= 0 else { return }@@ -140,22 +144,71 @@ Log.debug("🎮 \(objectInfo(self)) 点击了:\(gameInput)")}func gameInputToCoreInput(gameInput: WiiGameInput) -> LibretroButton? {- if gameInput == .a { return .A }- else if gameInput == .b { return .B }- else if gameInput == .x { return .X }- else if gameInput == .y { return .Y }- else if gameInput == .start { return .start }- else if gameInput == .select { return .select }- else if gameInput == .up { return isWiiremoteSideways ? .right : .up }- else if gameInput == .down { return isWiiremoteSideways ? .left : .down }- else if gameInput == .left { return isWiiremoteSideways ? .up : .left }- else if gameInput == .right { return isWiiremoteSideways ? .down : .right }- else if gameInput == .l1 { return .L1 }- else if gameInput == .r1 { return .R1 }- else if gameInput == .l2 { return .L2 }- else if gameInput == .r2 { return .R2 }- else if gameInput == .l3 { return .L3 }- else if gameInput == .r3 { return .R3 }+ switch controllerType {+ case .wiimote:+ if gameInput == .a { return .A }+ else if gameInput == .b { return .B }+ else if gameInput == .x { return .Y }+ else if gameInput == .y { return .X }+ else if gameInput == .start { return .start }+ else if gameInput == .select { return .select }+ else if gameInput == .up { return .up }+ else if gameInput == .down { return .down }+ else if gameInput == .left { return .left }+ else if gameInput == .right { return .right }+ else if gameInput == .c { return .R2 } //shake+ else if gameInput == .z { return .R3 } //home++ case .wiimoteSideways:+ if gameInput == .a { return .X }+ else if gameInput == .b { return .Y }+ else if gameInput == .x { return .A }+ else if gameInput == .y { return .B }+ else if gameInput == .start { return .start }+ else if gameInput == .select { return .select }+ else if gameInput == .up { return .up }+ else if gameInput == .down { return .down }+ else if gameInput == .left { return .left }+ else if gameInput == .right { return .right }+ else if gameInput == .c { return .R2 } //shake+ else if gameInput == .z { return .R3 } //home++ case .wiimoteNunchuk:+ if gameInput == .a { return .A }+ else if gameInput == .b { return .B }+ else if gameInput == .x { return .select }+ else if gameInput == .y { return .start }+ else if gameInput == .start { return .L1 }+ else if gameInput == .select { return .R1 }+ else if gameInput == .up { return .up }+ else if gameInput == .down { return .down }+ else if gameInput == .left { return .left }+ else if gameInput == .right { return .right }+ else if gameInput == .c { return .X }+ else if gameInput == .z { return .Y }+ else if gameInput == .l2 { return .L2 } //Shake Nunchuk+ else if gameInput == .r2 { return .R2 } //Shake Wiimote+ else if gameInput == .r3 { return .R3 } //home++ default:+ if gameInput == .a { return .A }+ else if gameInput == .b { return .B }+ else if gameInput == .x { return .X }+ else if gameInput == .y { return .Y }+ else if gameInput == .start { return .start }+ else if gameInput == .select { return .select }+ else if gameInput == .up { return .up }+ else if gameInput == .down { return .down }+ else if gameInput == .left { return .left }+ else if gameInput == .right { return .right }+ else if gameInput == .l1 { return .L1 }+ else if gameInput == .r1 { return .R1 }+ else if gameInput == .l2 { return .L2 }+ else if gameInput == .r2 { return .R2 }+ else if gameInput == .l3 { return .L3 }+ else if gameInput == .r3 { return .R3 }+ }+return nil}diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swiftindex 6bc08921..a755164c 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift@@ -184,6 +184,8 @@ extension GameType {self = .pm} else if shortName.uppercased() == "PS1" {self = .ps1+ } else if shortName.uppercased() == "PS2" {+ self = .ps2} else if shortName.uppercased() == "DC" {self = .dc} else if shortName.uppercased() == "DOOM" {@@ -253,6 +255,7 @@ extension GameType {case .vb: return "Virtual Boy"case .pm: return "Pokémon Mini"case .ps1: return "PlayStation"+ case .ps2: return "PlayStation 2"case .dc: return "Dreamcast"case .doom: return "DOOM"case .arcade: return "Arcade"@@ -307,6 +310,7 @@ extension GameType {case .vb: return NSLocalizedString("VB", comment: "")case .pm: return NSLocalizedString("PM", comment: "")case .ps1: return NSLocalizedString("PS1", comment: "")+ case .ps2: return NSLocalizedString("PS2", comment: "")case .dc: return NSLocalizedString("DC", comment: "")case .doom: return NSLocalizedString("DOOM", comment: "")case .arcade: return NSLocalizedString("Arcade", comment: "")@@ -362,6 +366,7 @@ extension GameType {case .vb: return 1995case .pm: return 2001case .ps1: return 1995+ case .ps2: return 2000case .dc: return 1998case .doom: return 1993case .arcade: return 1971@@ -624,7 +629,7 @@ extension GameType {switch self {case ._3ds, .ds, .gb, .gba, .gbc, .nes, .fds, .snes, .vb, .pm, .n64, .ns, .ngc, .wii:return .nintendo- case .ps1, .psp:+ case .ps1, .ps2, .psp:return .sonycase .md, .mcd, ._32x, .sg1000, .gg, .ms, .ss, .dc:return .sega@@ -787,6 +792,8 @@ extension GameType {image = R.image.c64_group_brand()} else if self == .amiga {image = R.image.amiga_group_brand()+ } else if self == .ps2 {+ image = R.image.ps2_group_brand()}Self.brandImageCaches[key] = imagereturn image@@ -796,7 +803,8 @@ extension GameType {var externalType: Bool {if self == .ns ||self == .xbox360 ||- self == .xbox {+ self == .xbox ||+ self == .ps2 {return true}return falsediff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swiftindex 613845ac..836bd947 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift@@ -15,6 +15,13 @@ import ARKitimport Metalimport Device+enum PerformanceTier {+ case low // A10 and below (iPhone 7 / iPad 6th gen, iPhone9,x / iPad7,x)+ case normal // A11–A14/M1 (iPhone 8–12 / iPad Air 4–Pro 2021, iPhone13,x / iPad13,x)+ case high // A15–A18 / M2–M3 (below iPhone 17 / iPad Pro M4)+ case ultra // A19 / M4 and newer (iPhone18,x / iPad16,x)+}+extension UIDevice {static func generateHaptic(style: HapticFeedbackStyle = .soft) {if supportsHaptics {@@ -181,6 +188,73 @@ extension UIDevice {return true}}++ /// `uname` / simulator model id, e.g. `iPhone18,2`.+ private static var machineIdentifier: String {+ #if targetEnvironment(simulator)+ if let id = ProcessInfo.processInfo.environment["SIMULATOR_MODEL_IDENTIFIER"] {+ return id+ }+ #endif+ var systemInfo = utsname()+ uname(&systemInfo)+ return withUnsafePointer(to: &systemInfo.machine) {+ $0.withMemoryRebound(to: CChar.self, capacity: 1) {+ String(cString: $0)+ }+ }+ }++ static var performanceTier: PerformanceTier {+ if isMac {+ return .ultra+ }++ let id = machineIdentifier+ let family: String+ let digits: Substring+ if id.hasPrefix("iPhone") {+ family = "iPhone"+ digits = id.dropFirst(6)+ } else if id.hasPrefix("iPad") {+ family = "iPad"+ digits = id.dropFirst(4)+ } else if id.hasPrefix("iPod") {+ return .low+ } else {+ return performanceTierFromMetal+ }++ guard let comma = digits.firstIndex(of: ","),+ let major = Int(digits[..<comma]) else {+ return performanceTierFromMetal+ }++ if family == "iPhone" {+ if major <= 9 { return .low }+ if major <= 13 { return .normal }+ if major < 18 { return .high }+ return .ultra+ }++ // iPad16,1–2 = mini (A17 Pro); 16,3+ = M4 Pro/Air+ if major <= 7 { return .low }+ if major <= 13 { return .normal }+ if major < 16 { return .high }+ if major == 16 {+ let minor = Int(digits[digits.index(after: comma)...]) ?? 0+ return minor >= 3 ? .ultra : .high+ }+ return .ultra+ }++ /// Used when `hw.machine` is missing or unparseable (simulator host, unknown id).+ private static var performanceTierFromMetal: PerformanceTier {+ guard let mtlDevice else { return .low }+ if mtlDevice.supportsFamily(.apple8) { return .high }+ if mtlDevice.supportsFamily(.apple4) { return .normal }+ return .low+ }}extension Device {diff --git a/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSoundEffects.swift b/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSoundEffects.swiftnew file mode 100644index 00000000..ec1facd7--- /dev/null+++ b/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSoundEffects.swift@@ -0,0 +1,144 @@+//+// FocusSoundEffects.swift+// ManicEmu+//+// Created by Daiuno on 2026/8/28.+// Copyright © 2026 Manic EMU. All rights reserved.+//++import AudioToolbox+import UIKit++/// FocusKit navigation cues. Mixes with other audio and follows the hardware mute switch.+final class FocusSoundEffects {+ static let shared = FocusSoundEffects()++ static let defaultPackName = "zen"+ static let directoryName = "sounds/effects"+ static let licenseDetail = "@UI SFX · CC0"+ private static let disabledStoredValue = ""++ enum Cue: Hashable {+ case hover+ case focus+ case cancel++ var fileName: String {+ switch self {+ case .hover: return "hover.caf"+ case .focus: return "focus.caf"+ case .cancel: return "cancel.caf"+ }+ }+ }++ struct Pack {+ let name: String+ let directoryURL: URL+ }++ private var soundIDs: [Cue: SystemSoundID] = [:]+ private var loadedPackName: String?+ private var didStartMonitoring = false++ private init() {}++ var directoryPath: String {+ R.Path.Resource.appendingPathComponent(Self.directoryName)+ }++ var packs: [Pack] {+ let urls: [URL]+ do {+ urls = try FileManager.default.contentsOfDirectory(+ at: URL(fileURLWithPath: directoryPath),+ includingPropertiesForKeys: [.isDirectoryKey],+ options: [.skipsHiddenFiles]+ )+ } catch {+ return []+ }+ return urls.compactMap { url -> Pack? in+ let isDirectory = (try? url.resourceValues(forKeys: [.isDirectoryKey]).isDirectory) ?? false+ guard isDirectory else { return nil }+ let cues: [Cue] = [.hover, .focus, .cancel]+ let hasAll = cues.allSatisfy { FileManager.default.fileExists(atPath: url.appendingPathComponent($0.fileName).path) }+ guard hasAll else { return nil }+ return Pack(name: url.lastPathComponent, directoryURL: url)+ }+ .sorted { $0.name.localizedStandardCompare($1.name) == .orderedAscending }+ }++ /// `nil` means sound effects are turned off.+ var selectedPackName: String? {+ guard let stored = Settings.defalut.getExtraString(key: ExtraKey.landscapeSoundEffects.rawValue) else {+ return Self.defaultPackName+ }+ if stored == Self.disabledStoredValue {+ return nil+ }+ return stored+ }++ var selectedPack: Pack? {+ guard let name = selectedPackName else { return nil }+ return packs.first(where: { $0.name == name })+ }++ var displayName: String {+ selectedPackName ?? R.string.localizable.off()+ }++ func startMonitoring() {+ guard !didStartMonitoring else {+ reloadIfNeeded()+ return+ }+ didStartMonitoring = true+ reloadIfNeeded()+ }++ func select(packName: String?) {+ Settings.defalut.updateExtra(key: ExtraKey.landscapeSoundEffects.rawValue, value: packName ?? Self.disabledStoredValue)+ reloadIfNeeded()+ }++ func play(_ cue: Cue) {+ guard FocusSystem.shared.isEnabled else { return }+ guard FocusSystem.shared.currentContext != nil else { return }+ guard !UIAccessibility.isVoiceOverRunning else { return }+ guard selectedPackName != nil else { return }+ reloadIfNeeded()+ guard let soundID = soundIDs[cue], soundID != 0 else { return }+ AudioServicesPlaySystemSound(soundID)+ }++ // MARK: - Private++ private func reloadIfNeeded() {+ let packName = selectedPackName+ if packName == loadedPackName, packName == nil || !soundIDs.isEmpty {+ return+ }+ disposeSounds()+ loadedPackName = packName+ guard let pack = selectedPack else { return }+ for cue: Cue in [.hover, .focus, .cancel] {+ let url = pack.directoryURL.appendingPathComponent(cue.fileName) as CFURL+ var soundID: SystemSoundID = 0+ let status = AudioServicesCreateSystemSoundID(url, &soundID)+ if status == kAudioServicesNoError, soundID != 0 {+ soundIDs[cue] = soundID+ } else {+ Log.error("[FocusSoundEffects] failed to load \(cue.fileName) in \(pack.name) (\(status))")+ }+ }+ }++ private func disposeSounds() {+ for soundID in soundIDs.values {+ AudioServicesDisposeSystemSoundID(soundID)+ }+ soundIDs.removeAll()+ }+}diff --git a/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSystem.swift b/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSystem.swiftindex 331cf211..5c63ed1f 100644--- a/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSystem.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/FocusKit/FocusSystem.swift@@ -312,29 +312,51 @@ final class FocusSystem {send(key)}- /// 一次完整短按(没有按压相位的输入源可直接调用)+ /// One complete tap. Input sources without press phases can call this directly.func send(_ key: FocusKey) {guard isEnabled, let context = currentContext else { return }validateFocusState(in: context)- // 命令链:焦点视图 → 容器 → 页面 → 全局,先消费先停止- if dispatchCommands(for: key, pressType: .tap, in: context) { return }+ let previousFocus = focusedView ?? (focusedContainer as UIView?)- // 默认行为+ // Command chain: focused view → container → page → global; first consumer wins.+ if dispatchCommands(for: key, pressType: .tap, in: context) {+ playFocusSound(for: key, previousFocus: previousFocus)+ return+ }++ // Default behaviorif let direction = key.direction {moveFocus(direction, in: context)+ playFocusSound(for: key, previousFocus: previousFocus)} else if key == .a {+ playFocusSound(for: key, previousFocus: previousFocus)performConfirm()} else if key == .b {- // 有焦点:先取消焦点(记忆位置,方向键可随时恢复);无焦点才执行页面关闭+ playFocusSound(for: key, previousFocus: previousFocus)+ // Has focus: clear it (position remembered, D-pad can restore). Otherwise close the page.if focusedView != nil || focusedContainer != nil {rememberAndClearCurrentFocus()} else {context.performCancel()}}- // 自定义键无默认行为+ // Custom keys have no default behavior+ }++ /// Hover only when focus actually moved; confirm/cancel fire for A/B regardless of the handler.+ private func playFocusSound(for key: FocusKey, previousFocus: UIView?) {+ if key.direction != nil {+ let current = focusedView ?? (focusedContainer as UIView?)+ if current !== previousFocus {+ FocusSoundEffects.shared.play(.hover)+ }+ } else if key == .a {+ FocusSoundEffects.shared.play(.focus)+ } else if key == .b {+ FocusSoundEffects.shared.play(.cancel)+ }}// MARK: - 长按与连发diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/BackgroundMusicKit.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/BackgroundMusicKit.swiftnew file mode 100644index 00000000..5ab130f4--- /dev/null+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/BackgroundMusicKit.swift@@ -0,0 +1,293 @@+//+// BackgroundMusicKit.swift+// ManicEmu+//+// Created by Daiuno on 2026/8/28.+// Copyright © 2026 Manic EMU. All rights reserved.+//++import AVFoundation+import UniformTypeIdentifiers+import UIKit++/// Landscape-only looping BGM. Yields to the user's other music, the mute switch, gameplay, and the background.+final class BackgroundMusicKit {+ static let shared = BackgroundMusicKit()++ static let defaultTrackTitle = "BGM 1"+ static let directoryName = "sounds/bgm"+ private static let disabledStoredValue = ""+ static let allowedExtensions: Set<String> = ["m4a", "aac", "mp3", "wav"]++ static var importTypes: [UTType] {+ var types: [UTType] = [.mpeg4Audio, .mp3, .wav]+ if let aac = UTType(filenameExtension: "aac") {+ types.append(aac)+ }+ return types+ }++ struct Track {+ let title: String+ let author: String+ let fileURL: URL+ let isCustom: Bool+ }++ private var player: AVAudioPlayer?+ private var playingFileURL: URL?+ private var isAppActive = true+ private var landscapeHomeVisible = false+ private var didStartMonitoring = false++ private init() {}++ var directoryPath: String {+ R.Path.Resource.appendingPathComponent(Self.directoryName)+ }++ var builtInTracks: [Track] {+ tracks(in: directoryPath, isCustom: false)+ }++ var customTracks: [Track] {+ tracks(in: R.Path.Assets, isCustom: true)+ }++ var tracks: [Track] {+ builtInTracks + customTracks+ }++ /// `nil` means BGM is turned off.+ var selectedTitle: String? {+ guard let stored = Settings.defalut.getExtraString(key: ExtraKey.landscapeBackgroundMusic.rawValue) else {+ return Self.defaultTrackTitle+ }+ if stored == Self.disabledStoredValue {+ return nil+ }+ return stored+ }++ var selectedTrack: Track? {+ guard let title = selectedTitle else { return nil }+ if let exact = tracks.first(where: { $0.title == title }) {+ return exact+ }+ return tracks.first(where: {+ $0.fileURL.deletingPathExtension().lastPathComponent.hasPrefix(title)+ })+ }++ var displayName: String {+ selectedTitle ?? R.string.localizable.off()+ }++ func startMonitoring() {+ guard !didStartMonitoring else {+ schedulePlaybackUpdate()+ return+ }+ didStartMonitoring = true+ let center = NotificationCenter.default+ center.addObserver(forName: UIApplication.willResignActiveNotification, object: nil, queue: .main) { [weak self] _ in+ self?.isAppActive = false+ self?.updatePlayback()+ }+ center.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: .main) { [weak self] _ in+ self?.isAppActive = true+ self?.updatePlayback()+ }+ center.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: .main) { [weak self] _ in+ self?.isAppActive = false+ self?.updatePlayback()+ }+ center.addObserver(forName: R.NotificationName.StartPlayGame, object: nil, queue: .main) { [weak self] _ in+ self?.updatePlayback()+ }+ center.addObserver(forName: R.NotificationName.StopPlayGame, object: nil, queue: .main) { [weak self] _ in+ self?.updatePlayback()+ }+ center.addObserver(forName: R.NotificationName.ViewAlongsideTransition, object: nil, queue: .main) { [weak self] _ in+ self?.updatePlayback()+ }+ center.addObserver(forName: R.NotificationName.ViewDidTransition, object: nil, queue: .main) { [weak self] _ in+ self?.updatePlayback()+ }+ center.addObserver(forName: AVAudioSession.silenceSecondaryAudioHintNotification, object: nil, queue: .main) { [weak self] _ in+ self?.updatePlayback()+ }+ center.addObserver(forName: AVAudioSession.interruptionNotification, object: nil, queue: .main) { [weak self] notification in+ self?.handleInterruption(notification)+ }+ isAppActive = UIApplication.shared.applicationState != .background+ schedulePlaybackUpdate()+ }++ func setLandscapeHomeVisible(_ visible: Bool) {+ landscapeHomeVisible = visible+ schedulePlaybackUpdate()+ }++ func select(title: String?) {+ Settings.defalut.updateExtra(key: ExtraKey.landscapeBackgroundMusic.rawValue, value: title ?? Self.disabledStoredValue)+ updatePlayback()+ }++ func updatePlayback() {+ guard canPlay, let track = selectedTrack else {+ if selectedTitle == nil {+ stopPlayer()+ } else {+ pausePlayback()+ }+ return+ }+ play(track)+ }++ static func parseFileName(_ fileName: String) -> (title: String, author: String) {+ let stem = (fileName as NSString).deletingPathExtension+ if let parsed = parseAuthorSuffix(stem, open: "(", close: ")") {+ return parsed+ }+ if let parsed = parseAuthorSuffix(stem, open: "(", close: ")") {+ return parsed+ }+ return (stem, "")+ }++ /// `Song Title(Author)` or `Song Title(Author)`. Uses the last matching pair so a title can contain other parentheses.+ private static func parseAuthorSuffix(_ stem: String, open: Character, close: Character) -> (title: String, author: String)? {+ guard let closeIndex = stem.lastIndex(of: close), closeIndex == stem.index(before: stem.endIndex) else {+ return nil+ }+ guard let openIndex = stem[..<closeIndex].lastIndex(of: open), openIndex != stem.startIndex else {+ return nil+ }+ let title = stem[..<openIndex].trimmingCharacters(in: .whitespaces)+ let author = stem[stem.index(after: openIndex)..<closeIndex].trimmingCharacters(in: .whitespaces)+ guard !title.isEmpty, !author.isEmpty else { return nil }+ return (title, author)+ }++ // MARK: - Private++ private var canPlay: Bool {+ guard landscapeHomeVisible, isAppActive else { return false }+ guard !PlayViewController.isGaming else { return false }+ guard selectedTitle != nil, selectedTrack != nil else { return false }+ return true+ }++ private func tracks(in directory: String, isCustom: Bool) -> [Track] {+ guard let names = try? FileManager.default.contentsOfDirectory(atPath: directory) else { return [] }+ return names.compactMap { name -> Track? in+ guard Self.allowedExtensions.contains(name.pathExtension.lowercased()) else { return nil }+ let parsed = Self.parseFileName(name)+ return Track(title: parsed.title,+ author: parsed.author,+ fileURL: URL(fileURLWithPath: directory.appendingPathComponent(name)),+ isCustom: isCustom)+ }+ .sorted { $0.title.localizedStandardCompare($1.title) == .orderedAscending }+ }++ private func schedulePlaybackUpdate() {+ DispatchQueue.main.async { [weak self] in+ self?.updatePlayback()+ }+ }++ private func play(_ track: Track) {+ activateAmbientSession()+ // Ambient mixes and does not interrupt. After the session is up, yield if another app is the primary mix.+ if AVAudioSession.sharedInstance().secondaryAudioShouldBeSilencedHint {+ pausePlayback()+ return+ }+ if let player, playingFileURL == track.fileURL {+ if !player.isPlaying {+ player.play()+ }+ return+ }+ stopPlayer()+ do {+ let player = try makePlayer(url: track.fileURL)+ player.numberOfLoops = -1+ player.volume = 0.35+ player.prepareToPlay()+ player.play()+ self.player = player+ playingFileURL = track.fileURL+ } catch {+ Log.error("[BackgroundMusicKit] failed to play \(track.fileURL.lastPathComponent): \(error)")+ self.player = nil+ playingFileURL = nil+ }+ }++ /// `.aac` is ADTS. Many exports are MPEG-4/M4A with a wrong `.aac` suffix;+ /// Core Audio then refuses to open them unless we hint `m4a`.+ private func makePlayer(url: URL) throws -> AVAudioPlayer {+ if Self.isMPEG4Container(url) {+ let data = try Data(contentsOf: url)+ return try AVAudioPlayer(data: data, fileTypeHint: AVFileType.m4a.rawValue)+ }+ return try AVAudioPlayer(contentsOf: url)+ }++ static func resolvedImportFileName(for url: URL) -> String {+ let name = url.lastPathComponent+ if url.pathExtension.lowercased() == "aac", isMPEG4Container(url) {+ return url.deletingPathExtension().lastPathComponent + ".m4a"+ }+ return name+ }++ static func isMPEG4Container(_ url: URL) -> Bool {+ guard let handle = try? FileHandle(forReadingFrom: url) else { return false }+ defer { try? handle.close() }+ guard let header = try? handle.read(upToCount: 12), header.count >= 8 else { return false }+ return header[4..<8] == Data("ftyp".utf8)+ }++ private func pausePlayback() {+ player?.pause()+ }++ private func stopPlayer() {+ player?.stop()+ player = nil+ playingFileURL = nil+ }++ private func activateAmbientSession() {+ let session = AVAudioSession.sharedInstance()+ do {+ try session.setCategory(.ambient, mode: .default)+ try session.setActive(true)+ } catch {+ Log.error("[BackgroundMusicKit] failed to activate ambient session: \(error)")+ }+ }++ private func handleInterruption(_ notification: Notification) {+ guard let info = notification.userInfo,+ let typeValue = info[AVAudioSessionInterruptionTypeKey] as? UInt,+ let type = AVAudioSession.InterruptionType(rawValue: typeValue) else { return }+ switch type {+ case .began:+ pausePlayback()+ case .ended:+ let optionsValue = info[AVAudioSessionInterruptionOptionKey] as? UInt+ let options = AVAudioSession.InterruptionOptions(rawValue: optionsValue ?? 0)+ if options.contains(.shouldResume) {+ updatePlayback()+ }+ @unknown default:+ break+ }+ }+}diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swiftindex cc312782..acadfa39 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/Database.swift@@ -12,61 +12,27 @@ import IceCreamimport ZIPFoundationstruct Database {+ /// Independent of marketing version. Bump only when Realm object schema changes; never decrease.+ /// Existing 2.0.0 databases already store this as 200 (`"2.0.0"` with dots stripped).+ private static let schemaVersion: UInt64 = 200+static func setup(completion: (()->Void)? = nil) {do {let realm = Database.realm- //init Prefference- let prefference = realm.object(ofType: Prefference.self, forPrimaryKey: Prefference.defaultName)- if prefference == nil {+ if realm.object(ofType: Prefference.self, forPrimaryKey: Prefference.defaultName) == nil {try? realm.write {realm.add(Prefference())}}- //If the setting has already been initialized, it won't be initialized again.- let oldSettings = realm.object(ofType: Settings.self, forPrimaryKey: Settings.defaultName)- if oldSettings == nil {- Log.debug("设置不存在 初始化设置")- let settings = Settings()-+ if realm.object(ofType: Settings.self, forPrimaryKey: Settings.defaultName) == nil {+ Log.debug("Settings missing; initializing")try realm.write {- realm.add(generateDefaultSkins())- realm.add(settings)- }- } else if let _ = oldSettings {- //The setting already exists. Check whether the number of skins matches the number of emulators. If they don't match, you'll need to update the default skin.- let defaultSkins = realm.objects(Skin.self).where { $0.skinType == .default }- let defaultSkinsCount = defaultSkins.count- if defaultSkinsCount != System.allCases.filter({ !$0.gameType.externalType }).count {- Log.debug("更新设置 新增皮肤")- //Regenerate the default skin list- let genDefaultSkins = generateDefaultSkins()-- //Check if the Preference has configured a default skin. If so, it needs to be updated to the new skin ID.- defaultSkins.forEach({ oldSkin in- genDefaultSkins.forEach({ newSkin in- if newSkin.identifier == oldSkin.identifier && newSkin.id != oldSkin.id {- Prefference.defalut.replaceValue(kind: .skin, value: oldSkin.id, replace: newSkin.id)- }- })- })-- //Remove the old default skin.- try? realm.write {- realm.delete(defaultSkins)- }-- //Add new default skin- try? realm.write {- realm.add(genDefaultSkins)- }+ realm.add(Settings())}}- //新增其他皮肤- addEmbedSkins()-//处理主题let theme = realm.object(ofType: Theme.self, forPrimaryKey: Theme.defaultName)if theme == nil {@@ -110,8 +76,8 @@ struct Database {}if let systemCoreVersion = UserDefaults.standard.string(forKey: R.DefaultKey.SystemCoreVersion) {- //如果存在版本记录,说明是旧版本升级到新版本,需要处理一下- let systemCoreVersionNumber = UInt64(systemCoreVersion.replacingOccurrences(ofPattern: "\\.", withTemplate: ""))!+ // Existing version record means this is an upgrade; run data migrations.+ let systemCoreVersionNumber = parseVersionNumber(systemCoreVersion)if systemCoreVersionNumber < 141 {//调整1.4.0的gameType问题@@ -251,7 +217,7 @@ struct Database {var needsUpdate: Bool = systemCoreVersionNumber < 173if !needsUpdate {let systemCoreBuildVersion = UserDefaults.standard.integer(forKey: R.DefaultKey.SystemCoreBuildVersion)- let appBuildVersion = Int(R.Config.AppBuildVersion)!+ let appBuildVersion = Int(R.Config.AppBuildVersion) ?? 0if appBuildVersion > systemCoreBuildVersion {needsUpdate = true}@@ -392,6 +358,10 @@ struct Database {}}+ // After data migrations so Game.portraitSkin still points at live Skin objects.+ syncDefaultSkins(realm: realm)+ addEmbedSkins()+//Prevent the game from not being removed after Articbase finishes its work due to an error.if let articbase = realm.object(ofType: Game.self, forPrimaryKey: R.Strings.AzaharArticBaseGameID) {try? realm.write {@@ -406,146 +376,379 @@ struct Database {}static var realm: Realm {+ let config = defaultConfigdo {- return try Realm(configuration: defaultConfig)+ return try Realm(configuration: config)} catch {- Log.error("生成数据库失败")+ Log.error("生成数据库失败 \(error)")+ }+ if let realm = try? Realm(configuration: config) {+ return realm+ }+ // Unreadable file (corruption / schema mismatch). Wipe so launch can continue; game data in this file is already inaccessible.+ Log.error("Retry opening Realm failed; resetting on-disk file so the app can launch")+ removeRealmFiles(config)+ if let realm = try? Realm(configuration: config) {+ return realm+ }+ Log.error("Reset Realm still failed; using in-memory fallback")+ var memoryConfig = config+ memoryConfig.fileURL = nil+ memoryConfig.inMemoryIdentifier = "ManicEmu.LaunchFallback"+ return try! Realm(configuration: memoryConfig)+ }++ private static func parseVersionNumber(_ version: String) -> UInt64 {+ let digits = version.replacingOccurrences(ofPattern: "\\D", withTemplate: "")+ return UInt64(digits) ?? 0+ }++ private static func removeRealmFiles(_ config: Realm.Configuration) {+ guard let fileURL = config.fileURL else { return }+ let folder = fileURL.deletingLastPathComponent()+ let name = fileURL.lastPathComponent+ let extras = [+ fileURL,+ URL(fileURLWithPath: fileURL.path + ".lock"),+ URL(fileURLWithPath: fileURL.path + ".note"),+ folder.appendingPathComponent("\(name).management")+ ]+ for url in extras {+ try? FileManager.default.removeItem(at: url)}- return try! Realm()}private static var defaultConfig: Realm.Configuration {var config = Realm.Configuration.defaultConfiguration- //Configure the database path.if !FileManager.default.fileExists(atPath: R.Path.Realm) {try? FileManager.default.createDirectory(atPath: R.Path.Realm, withIntermediateDirectories: true)}config.fileURL = URL(fileURLWithPath: R.Path.RealmFilePath)- //Configure the database version, and use the app version for control.- config.schemaVersion = UInt64(R.Config.AppVersion.replacingOccurrences(ofPattern: "\\.", withTemplate: ""))!+ config.schemaVersion = schemaVersion+ // Additive changes (new types/optional properties) apply automatically when this+ // version increases. Put property renames or destructive transforms inside.+ config.migrationBlock = { _, oldSchemaVersion in+ if oldSchemaVersion < 200 {+ // Prefference is a new type; Realm creates its table automatically.+ }+ }return config}+ /// Insert missing default skins. Prefer defaults over local copies of the same skin.+ private static func syncDefaultSkins(realm: Realm) {+ let wanted = generateDefaultSkins()+ Log.debug("[Skin] syncDefaultSkins: wanted \(wanted.count) default skins")+ guard !wanted.isEmpty else { return }++ var toDelete: [Skin] = []+ var toAdd: [Skin] = []+ var deletingIds = Set<String>()++ func markDelete(_ skin: Skin) {+ guard !skin.isInvalidated, !deletingIds.contains(skin.id) else { return }+ deletingIds.insert(skin.id)+ toDelete.append(skin)+ }++ var unchangedDefaults = 0+ for newSkin in wanted {+ if let existing = realm.object(ofType: Skin.self, forPrimaryKey: newSkin.id),+ !existing.isInvalidated {+ if existing.skinType == .default {+ unchangedDefaults += 1+ continue+ }+ // Same file as a default skin; drop the local copy.+ logSkin("update (replace local with default)", existing, extra: "-> \(describeSkin(newSkin))")+ remapSkinPreference(from: existing.id, to: newSkin.id)+ markDelete(existing)+ toAdd.append(newSkin)+ continue+ }++ let sameIdentity = Array(realm.objects(Skin.self).where {+ $0.identifier == newSkin.identifier && $0.gameType == newSkin.gameType+ })+ var needsAdd = true+ for old in sameIdentity where !old.isInvalidated {+ if old.skinType == .default && old.id == newSkin.id {+ needsAdd = false+ unchangedDefaults += 1+ continue+ }+ if old.skinType == .default {+ logSkin("update (default hash changed)", old, extra: "-> \(describeSkin(newSkin))")+ } else {+ logSkin("update (replace local with default)", old, extra: "-> \(describeSkin(newSkin))")+ }+ remapSkinPreference(from: old.id, to: newSkin.id)+ markDelete(old)+ }+ if needsAdd {+ toAdd.append(newSkin)+ }+ }++ Log.debug("[Skin] syncDefaultSkins: unchanged \(unchangedDefaults), will delete \(toDelete.count), add \(toAdd.count)")+ if toDelete.isEmpty && toAdd.isEmpty {+ return+ }++ do {+ try realm.write {+ deleteSkinFilesAndObjects(toDelete, realm: realm)+ addSkinsIfAbsent(toAdd, realm: realm)+ }+ } catch {+ Log.error("[Skin] syncDefaultSkins failed: \(error)")+ }+ }+private static func generateDefaultSkins() -> [Skin] {- //Add default skinvar defaultSkins = [Skin]()- System.allCores.forEach { core in+ var usedIds = Set<String>()+ for core in System.allCores {let gameType = core.gameType- if let controllerSkin = ControllerSkin.standardControllerSkin(for: gameType),- let hash = FileHashUtil.truncatedHash(url: controllerSkin.fileURL) {- let skin = Skin()- skin.id = hash- skin.identifier = controllerSkin.identifier- skin.name = controllerSkin.name- skin.fileName = controllerSkin.fileURL.lastPathComponent- skin.gameType = controllerSkin.gameType- skin.skinType = .default- defaultSkins.append(skin)+ guard let controllerSkin = ControllerSkin.standardControllerSkin(for: gameType),+ let hash = FileHashUtil.truncatedHash(url: controllerSkin.fileURL),+ let skinId = availableSkinId(hash: hash, usedIds: &usedIds, gameType: gameType) else {+ Log.debug("[Skin] skip default for \(core.name): file missing")+ continue}+ if skinId != hash {+ Log.debug("[Skin] default id collision for \(core.name): hash=\(hash) id=\(skinId)")+ }+ let skin = Skin()+ skin.id = skinId+ skin.identifier = controllerSkin.identifier+ skin.name = controllerSkin.name+ skin.fileName = "\(core.name).manicskin"+ skin.gameType = gameType+ skin.skinType = .default+ defaultSkins.append(skin)}return defaultSkins}+ /// File hash is the normal PK. Reuse skins (C64/Amiga/…) may hash to the same file; keep a unique id so every platform still gets a default row.+ private static func availableSkinId(hash: String, usedIds: inout Set<String>, gameType: GameType, realm: Realm? = nil) -> String? {+ func isFree(_ id: String) -> Bool {+ !usedIds.contains(id) && realm?.object(ofType: Skin.self, forPrimaryKey: id) == nil+ }+ var candidates = [hash, "\(hash).\(gameType.rawValue)"]+ for n in 1...5 {+ candidates.append("\(hash).\(gameType.rawValue).\(n)")+ }+ for id in candidates {+ if isFree(id) {+ usedIds.insert(id)+ return id+ }+ }+ return nil+ }++ private static func describeSkin(_ skin: Skin) -> String {+ if skin.isInvalidated {+ return "<invalidated>"+ }+ return "\(skin.name) file=\(skin.fileName) id=\(skin.id) identifier=\(skin.identifier) gameType=\(skin.gameType.localizedShortName) type=\(skin.skinType)"+ }++ private static func logSkin(_ action: String, _ skin: Skin, extra: String = "") {+ let suffix = extra.isEmpty ? "" : " \(extra)"+ Log.debug("[Skin] \(action): \(describeSkin(skin))\(suffix)")+ }++ /// `realm.add` with the default `.error` policy raises an ObjC NSException on duplicate PK; Swift `catch` cannot handle it.+ private static func addSkinsIfAbsent(_ skins: [Skin], realm: Realm) {+ var seen = Set<String>()+ for skin in skins {+ guard !skin.id.isEmpty, seen.insert(skin.id).inserted else { continue }+ if realm.object(ofType: Skin.self, forPrimaryKey: skin.id) != nil {+ logSkin("skip add (primary key exists)", skin)+ continue+ }+ realm.add(skin)+ logSkin("added", skin)+ }+ }++ private static func deleteSkinFilesAndObjects(_ skins: [Skin], realm: Realm) {+ for skin in skins where !skin.isInvalidated {+ logSkin("deleted", skin)+ if let asset = skin.skinData, !asset.isInvalidated {+ try? FileManager.safeRemoveItem(at: asset.filePath)+ realm.delete(asset)+ }+ realm.delete(skin)+ }+ }++ private static func remapSkinPreference(from oldId: String, to newId: String) {+ guard oldId != newId else { return }+ Log.debug("[Skin] remap preference \(oldId) -> \(newId)")+ let apply = {+ Prefference.defalut.replaceValue(kind: .skin, value: oldId, replace: newId)+ }+ if Thread.isMainThread {+ apply()+ } else {+ DispatchQueue.main.async(execute: apply)+ }+ }+private static func addEmbedSkins() {DispatchQueue.global().async {+ Log.debug("[Skin] addEmbedSkins: start")let realm = Database.realmlet fileManager = FileManager.defaultlet resourcePath = R.Path.Resource- //处理内置Manic皮肤+ let standardDefaultFileNames = Set(System.allCores.map { "\($0.name).manicskin" })if let contents = try? fileManager.contentsOfDirectory(atPath: resourcePath) {let skinNames = contents.filter { $0.hasSuffix(".manicskin") }+ Log.debug("[Skin] addEmbedSkins: found \(skinNames.count) .manicskin files")var embedSkins = [Skin]()+ var embedIds = Set<String>()+ var preferenceRemaps: [(String, String)] = []+ var unchangedCount = 0+ var skippedDefaultCount = 0for skinName in skinNames {- if let controllerSkin = ControllerSkin(fileURL: URL(fileURLWithPath: resourcePath.appendingPathComponent(skinName))),- let hash = FileHashUtil.truncatedHash(url: controllerSkin.fileURL) {- if let skin = realm.object(ofType: Skin.self, forPrimaryKey: hash) {- Log.debug("皮肤:\(skin.name)已存在")- } else {- //有可能是更新了皮肤- var newSkinType = SkinType.buildIn- let oldSkins = realm.objects(Skin.self).where { $0.identifier == controllerSkin.identifier }- if oldSkins.count > 0 {- newSkinType = oldSkins.first!.skinType- Log.debug("\(controllerSkin.name) 皮肤进行了更新,移除旧的皮肤")- oldSkins.forEach {- if let filePath = $0.skinData?.filePath {- try? FileManager.safeRemoveItem(at: filePath)- }- }- let assets = oldSkins.compactMap({ $0.skinData })- try? realm.write {- if assets.count > 0 {- realm.delete(assets)- }- realm.delete(oldSkins)- }- }-- let skin = Skin()- skin.id = hash- skin.identifier = controllerSkin.identifier- skin.name = controllerSkin.name- skin.fileName = controllerSkin.fileURL.lastPathComponent- skin.gameType = controllerSkin.gameType- skin.skinType = newSkinType- if newSkinType != .default {- skin.skinData = CreamAsset.create(objectID: skin.id, propName: "skinData", url: controllerSkin.fileURL)- }- embedSkins.append(skin)-- //The skin file has been updated, so I'm trying to update the skin ID configured in Preferences.- oldSkins.forEach({- Prefference.defalut.replaceValue(kind: .skin, value: $0.id, replace: skin.id)- })-+ // Standard per-core files are inserted by syncDefaultSkins.+ if standardDefaultFileNames.contains(skinName) {+ continue+ }+ guard let controllerSkin = ControllerSkin(fileURL: URL(fileURLWithPath: resourcePath.appendingPathComponent(skinName))),+ let hash = FileHashUtil.truncatedHash(url: controllerSkin.fileURL) else {+ Log.debug("[Skin] skip embed \(skinName): unreadable")+ continue+ }+ let matchesDefault = realm.objects(Skin.self).where {+ $0.identifier == controllerSkin.identifier &&+ $0.gameType == controllerSkin.gameType &&+ $0.skinType == .default+ }.count > 0+ if matchesDefault {+ skippedDefaultCount += 1+ continue+ }++ var newSkinType = SkinType.buildIn+ let oldSkins = Array(realm.objects(Skin.self).where {+ $0.identifier == controllerSkin.identifier &&+ $0.gameType == controllerSkin.gameType &&+ $0.skinType != .default+ })+ // Same file is already stored (id is the hash, or a collision suffix of that hash).+ if oldSkins.contains(where: { $0.id == hash || $0.id.hasPrefix("\(hash).") }) {+ unchangedCount += 1+ continue+ }+ let oldSkinIds = oldSkins.map(\.id)+ let isUpdate = !oldSkins.isEmpty+ if isUpdate {+ newSkinType = oldSkins.first!.skinType+ for old in oldSkins {+ logSkin("update (embed file hash changed)", old, extra: "-> file=\(skinName) hash=\(hash)")+ }+ try? realm.write {+ deleteSkinFilesAndObjects(oldSkins, realm: realm)}}++ guard let skinId = availableSkinId(hash: hash, usedIds: &embedIds, gameType: controllerSkin.gameType, realm: realm) else {+ Log.debug("[Skin] skip embed \(skinName): no free primary key")+ continue+ }++ let skin = Skin()+ skin.id = skinId+ skin.identifier = controllerSkin.identifier+ skin.name = controllerSkin.name+ skin.fileName = controllerSkin.fileURL.lastPathComponent+ skin.gameType = controllerSkin.gameType+ skin.skinType = newSkinType+ if newSkinType != .default {+ skin.skinData = CreamAsset.create(objectID: skin.id, propName: "skinData", url: controllerSkin.fileURL)+ }+ embedSkins.append(skin)+ for oldId in oldSkinIds {+ preferenceRemaps.append((oldId, skin.id))+ }}- if embedSkins.count > 0 {- try? realm.write({- realm.add(embedSkins)- })+ Log.debug("[Skin] addEmbedSkins: unchanged \(unchangedCount), skipped default identity \(skippedDefaultCount), will add \(embedSkins.count)")+ if !embedSkins.isEmpty {+ try? realm.write {+ addSkinsIfAbsent(embedSkins, realm: realm)+ }+ }+ for remap in preferenceRemaps {+ remapSkinPreference(from: remap.0, to: remap.1)}+ } else {+ Log.debug("[Skin] addEmbedSkins: resource directory unreadable")}- //PlayCase皮肤#if !SIDE_LOADif !UserDefaults.standard.bool(forKey: R.DefaultKey.HasImportedPlayCaseSkin) {+ Log.debug("[Skin] PlayCase: first import")if let contents = try? fileManager.contentsOfDirectory(atPath: resourcePath.appendingPathComponent("PlayCase")) {let skinNames = contents.filter { $0.hasSuffix(".playcase") }+ Log.debug("[Skin] PlayCase: found \(skinNames.count) files")var embedSkins = [Skin]()+ var playcaseIds = Set<String>()for skinName in skinNames {- if let controllerSkin = ControllerSkin(fileURL: URL(fileURLWithPath: resourcePath.appendingPathComponent("PlayCase").appendingPathComponent(skinName))),- let hash = FileHashUtil.truncatedHash(url: controllerSkin.fileURL) {- let skins = realm.objects(Skin.self)-- if let skin = skins.first(where: { $0.identifier == controllerSkin.identifier }) {- Log.debug("PlayCase皮肤:\(skin.name)已存在")- if skin.skinType != .playcase {- Log.debug("用户自行导入过PlayCase皮肤,现在对其进行更新")- _ = try? realm.write({- skin.skinType == .playcase- })+ guard let controllerSkin = ControllerSkin(fileURL: URL(fileURLWithPath: resourcePath.appendingPathComponent("PlayCase").appendingPathComponent(skinName))),+ let hash = FileHashUtil.truncatedHash(url: controllerSkin.fileURL) else {+ continue+ }+ if let existing = realm.object(ofType: Skin.self, forPrimaryKey: hash),+ existing.identifier == controllerSkin.identifier {+ logSkin("unchanged PlayCase", existing)+ continue+ }+ if let skin = realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier && $0.skinType != .default }) {+ if skin.skinType != .playcase {+ logSkin("update (mark PlayCase type)", skin)+ try? realm.write {+ skin.skinType = .playcase}} else {- let skin = Skin()- skin.id = hash- skin.identifier = controllerSkin.identifier- skin.name = controllerSkin.name- skin.fileName = controllerSkin.fileURL.lastPathComponent- skin.gameType = controllerSkin.gameType- skin.skinType = .playcase- skin.skinData = CreamAsset.create(objectID: skin.id, propName: "skinData", url: controllerSkin.fileURL)- embedSkins.append(skin)- Log.debug("开始集成PlayCase皮肤:\(skin.name)")+ logSkin("unchanged PlayCase", skin)}+ continue+ }+ if realm.objects(Skin.self).where({+ $0.identifier == controllerSkin.identifier && $0.skinType == .default+ }).count > 0 {+ Log.debug("[Skin] skip PlayCase \(controllerSkin.name): identifier belongs to a default skin")+ continue+ }+ guard let skinId = availableSkinId(hash: hash, usedIds: &playcaseIds, gameType: controllerSkin.gameType, realm: realm) else {+ Log.debug("[Skin] skip PlayCase \(skinName): no free primary key")+ continue}+ let skin = Skin()+ skin.id = skinId+ skin.identifier = controllerSkin.identifier+ skin.name = controllerSkin.name+ skin.fileName = controllerSkin.fileURL.lastPathComponent+ skin.gameType = controllerSkin.gameType+ skin.skinType = .playcase+ skin.skinData = CreamAsset.create(objectID: skin.id, propName: "skinData", url: controllerSkin.fileURL)+ embedSkins.append(skin)}- if embedSkins.count > 0 {- try? realm.write({- realm.add(embedSkins)- })+ if !embedSkins.isEmpty {+ Log.debug("[Skin] PlayCase: will add \(embedSkins.count)")+ try? realm.write {+ addSkinsIfAbsent(embedSkins, realm: realm)+ }+ } else {+ Log.debug("[Skin] PlayCase: nothing to add")}+ } else {+ Log.debug("[Skin] PlayCase: directory missing")}UserDefaults.standard.set(true, forKey: R.DefaultKey.HasImportedPlayCaseSkin)}diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swiftindex 5e95aca7..e9f2ec2f 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift@@ -13,11 +13,12 @@ extension GameType {static let ns = GameType("public.aoshuang.game.ns")static let xbox360 = GameType("public.aoshuang.game.xbox360")static let xbox = GameType("public.aoshuang.game.xbox")+ static let ps2 = GameType("public.aoshuang.game.ps2")}struct EmulatorInteractionKit {enum EmulatorType {- case meloNX, xeniOS, dukeX+ case meloNX, xeniOS, dukeX, armsx2}static func isInstalled(type: EmulatorType) -> Bool {@@ -28,6 +29,10 @@ struct EmulatorInteractionKit {return UIApplication.shared.canOpenURL(R.URLs.FetchXeniOSGames)case .dukeX:return UIApplication.shared.canOpenURL(R.URLs.FetchDukeXGames)+ case .armsx2:+ return UIApplication.shared.canOpenURL(R.URLs.FetchARMSX2Games)+ || UIApplication.shared.canOpenURL(URL(string: "\(R.Strings.ARMSX2Scheme)-ios://library")!)+ || UIApplication.shared.canOpenURL(URL(string: "\(R.Strings.ARMSX2Scheme)ios://library")!)}}@@ -40,6 +45,8 @@ struct EmulatorInteractionKit {UIApplication.shared.open(R.URLs.XeniOSGameLaunch(gameId: id))case .dukeX:UIApplication.shared.open(R.URLs.DukeXGameLaunch(gameId: id))+ case .armsx2:+ UIApplication.shared.open(R.URLs.ARMSX2GameLaunch(gameId: id))}} else {DispatchQueue.main.asyncAfter(delay: 0.35) {@@ -50,6 +57,8 @@ struct EmulatorInteractionKit {UIView.makeToast(message: R.string.localizable.notInstall("XeniOS"))case .dukeX:UIView.makeToast(message: R.string.localizable.notInstall("DukeX"))+ case .armsx2:+ UIView.makeToast(message: R.string.localizable.notInstall("ARMSX2"))}}}@@ -64,6 +73,8 @@ struct EmulatorInteractionKit {UIApplication.shared.open(R.URLs.FetchXeniOSGames)case .dukeX:UIApplication.shared.open(R.URLs.FetchDukeXGames)+ case .armsx2:+ UIApplication.shared.open(R.URLs.FetchARMSX2Games)}} else {@@ -74,6 +85,8 @@ struct EmulatorInteractionKit {UIView.makeToast(message: R.string.localizable.notInstall("XeniOS"))case .dukeX:UIView.makeToast(message: R.string.localizable.notInstall("DukeX"))+ case .armsx2:+ UIView.makeToast(message: R.string.localizable.notInstall("ARMSX2"))}}}@@ -104,6 +117,10 @@ struct EmulatorInteractionKit {case .dukeX:game.fileExtension = "xiso"game.gameType = .xbox+ case .armsx2:+ let ext = URL(fileURLWithPath: mg.titleId).pathExtension.lowercased()+ game.fileExtension = ext.isEmpty ? "iso" : ext+ game.gameType = .ps2}game.id = mg.titleIdgame.name = mg.titleName@@ -111,7 +128,7 @@ struct EmulatorInteractionKit {if let icon = mg.iconData {game.gameCover = CreamAsset.create(objectID: game.id, propName: "gameCover", data: icon)} else {-+ OnlineCoverManager.shared.addCoverMatch(.init(game: game))}games.append(game)}@@ -128,6 +145,8 @@ struct EmulatorInteractionKit {UIView.makeToast(message: R.string.localizable.biosImportSuccess("Xenios Games"))case .dukeX:UIView.makeToast(message: R.string.localizable.biosImportSuccess("DukeX Games"))+ case .armsx2:+ UIView.makeToast(message: R.string.localizable.biosImportSuccess("ARMSX2 Games"))}}}@@ -146,11 +165,17 @@ struct GameScheme: Codable, Identifiable, Equatable, Hashable, Sendable {static func pullFromURL(_ url: URL) -> [GameScheme] {if let components = URLComponents(url: url, resolvingAgainstBaseURL: true) {- if let text = components.queryItems?.first(where: { $0.name == "games" })?.value,- let data = GameScheme.base64URLDecode(text) {- if let decoded = try? JSONDecoder().decode([GameScheme].self, from: data) {- return decoded- }+ let items = components.queryItems ?? []+ if let text = items.first(where: { $0.name == "games" })?.value,+ let data = GameScheme.base64URLDecode(text),+ let decoded = try? JSONDecoder().decode([GameScheme].self, from: data) {+ return decoded+ }+ // ARMSX2 sends `payload` wrapping `{ games: [{ title, fileName, ... }] }`.+ if let text = items.first(where: { $0.name == "payload" })?.value,+ let data = GameScheme.base64URLDecode(text),+ let library = try? JSONDecoder().decode(ARMSX2Library.self, from: data) {+ return library.gameSchemes}}return []@@ -166,3 +191,36 @@ struct GameScheme: Codable, Identifiable, Equatable, Hashable, Sendable {return Data(base64Encoded: base64)}}++/// ARMSX2 `com.armsx2.library.v1` callback body. Launch key is `fileName`.+private struct ARMSX2Library: Decodable {+ let games: [ARMSX2Game]++ var gameSchemes: [GameScheme] {+ games.compactMap(\.gameScheme)+ }+}++private struct ARMSX2Game: Decodable {+ let title: String?+ let fileName: String?+ let serial: String?++ var gameScheme: GameScheme? {+ guard let fileName, !fileName.isEmpty else {+ return nil+ }+ let trimmedTitle = title?.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""+ let titleName = trimmedTitle.isEmpty+ ? URL(fileURLWithPath: fileName).deletingPathExtension().lastPathComponent+ : trimmedTitle+ return GameScheme(+ id: fileName,+ titleName: titleName,+ titleId: fileName,+ developer: serial ?? "",+ version: "1.0",+ iconData: nil+ )+ }+}diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swiftindex cc67d04d..72bf88ae 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift@@ -19,6 +19,7 @@ struct ImageFetcher {case steamGridDB(Game, preferredAssetType: SteamGridDBContentsView.AssetType)case editImage(UIImage)case editImageUrl(URL)+ case delete}private static func defaultEditorConfiguration() -> EditorConfiguration {@@ -160,6 +161,10 @@ struct ImageFetcher {case .editImage, .editImageUrl:return ASListPage.Cell.iconTitleChevronCell(icon: .symbolImage(R.image.edit_iconSymbols()),title: R.string.localizable.editTitle())+ case .delete:+ return ASListPage.Cell.iconTitleChevronCell(icon: .symbolImage(R.image.delete_iconSymbols(), colors: [R.Color.Red]),+ title: R.string.localizable.removeTitle(),+ titleColor: R.Color.Red)}})@@ -230,6 +235,8 @@ struct ImageFetcher {}}}+ case .delete:+ completion?(nil, .delete)}})}diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swiftindex ecc4ac7f..0aeec2ba 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift@@ -141,6 +141,8 @@ class OnlineCoverManager {boxArtUrl = host.appendingPathComponent("DOS/Named_Boxarts")case .xbox:boxArtUrl = host.appendingPathComponent("Microsoft - Xbox/Named_Boxarts")+ case .ps2:+ boxArtUrl = host.appendingPathComponent("Sony - PlayStation 2/Named_Boxarts")case .ngc:boxArtUrl = host.appendingPathComponent("Nintendo - GameCube/Named_Boxarts")case .wii:@@ -355,7 +357,7 @@ class OnlineCoverManager {request.addValue("Bearer \(R.Cipher.DeepSeek)", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Content-Type")request.addValue("application/json", forHTTPHeaderField: "Accept")- request.httpBody = ["frequency_penalty": 0.7, "max_tokens": 2048, "model": "deepseek-chat", "presence_penalty": 0.7, "stream" : false, "temperature" : 1.3, "top_p" : 0.9, "response_format" : ["type": "json_object"], "messages": [["content": "\(content)", "role":"user"]]].jsonData()+ request.httpBody = ["frequency_penalty": 0.7, "max_tokens": 2048, "model": "deepseek-v4-flash", "presence_penalty": 0.7, "stream" : false, "temperature" : 1.3, "top_p" : 0.9, "response_format" : ["type": "json_object"], "messages": [["content": "\(content)", "role":"user"]]].jsonData()let task = URLSession.shared.dataTask(with: request) { data, response, error inif let _ = error {completion?(name)diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/System.swiftindex fe830c47..a9b9bd67 100644--- a/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift@@ -11,6 +11,7 @@enum System: CaseIterable{+ case ps2case amigacase c64case ngp@@ -163,6 +164,7 @@ extension System {case .ngp: return .ngpcase .c64: return .c64case .amiga: return .amiga+ case .ps2: return .ps2}}}diff --git a/System.core/Wiimote.manicskin b/System.core/Wiimote.manicskinnew file mode 100644index 00000000..09f493d8--- /dev/null+++ b/System.core/Wiimote.manicskin@@ -0,0 +1,3 @@+version https://git-lfs.github.com/spec/v1+oid sha256:f711dd3994f9d7531f19bcc43fa4a842fc6161917185c57edc03f99137a71e66+size 1444640diff --git a/System.core/sounds/bgm/BGM 1(rahulsawla_).m4a b/System.core/sounds/bgm/BGM 1(rahulsawla_).m4anew file mode 100644index 00000000..4d297d29Binary files /dev/null and b/System.core/sounds/bgm/BGM 1(rahulsawla_).m4a differdiff --git a/System.core/sounds/bgm/Lost SoulZ The Labyrinth(naomuhibu).m4a b/System.core/sounds/bgm/Lost SoulZ The Labyrinth(naomuhibu).m4anew file mode 100644index 00000000..68dca380Binary files /dev/null and b/System.core/sounds/bgm/Lost SoulZ The Labyrinth(naomuhibu).m4a differdiff --git a/System.core/sounds/bgm/Tactic(Scriptel).m4a b/System.core/sounds/bgm/Tactic(Scriptel).m4anew file mode 100644index 00000000..0097189fBinary files /dev/null and b/System.core/sounds/bgm/Tactic(Scriptel).m4a differdiff --git a/System.core/sounds/bgm/Theme Loop(naomuhibu).m4a b/System.core/sounds/bgm/Theme Loop(naomuhibu).m4anew file mode 100644index 00000000..118e4020Binary files /dev/null and b/System.core/sounds/bgm/Theme Loop(naomuhibu).m4a differdiff --git a/System.core/sounds/bgm/backgroundsounds(naomuhibu).m4a b/System.core/sounds/bgm/backgroundsounds(naomuhibu).m4anew file mode 100644index 00000000..16421c70Binary files /dev/null and b/System.core/sounds/bgm/backgroundsounds(naomuhibu).m4a differdiff --git a/System.core/sounds/bgm/duskwalkin(supervanz).m4a b/System.core/sounds/bgm/duskwalkin(supervanz).m4anew file mode 100644index 00000000..669b66a4Binary files /dev/null and b/System.core/sounds/bgm/duskwalkin(supervanz).m4a differdiff --git a/System.core/sounds/effects/arcade/cancel.caf b/System.core/sounds/effects/arcade/cancel.cafnew file mode 100644index 00000000..153b797eBinary files /dev/null and b/System.core/sounds/effects/arcade/cancel.caf differdiff --git a/System.core/sounds/effects/arcade/focus.caf b/System.core/sounds/effects/arcade/focus.cafnew file mode 100644index 00000000..6fcb4f91Binary files /dev/null and b/System.core/sounds/effects/arcade/focus.caf differdiff --git a/System.core/sounds/effects/arcade/hover.caf b/System.core/sounds/effects/arcade/hover.cafnew file mode 100644index 00000000..11083deeBinary files /dev/null and b/System.core/sounds/effects/arcade/hover.caf differdiff --git a/System.core/sounds/effects/cinematic/cancel.caf b/System.core/sounds/effects/cinematic/cancel.cafnew file mode 100644index 00000000..95856b0aBinary files /dev/null and b/System.core/sounds/effects/cinematic/cancel.caf differdiff --git a/System.core/sounds/effects/cinematic/focus.caf b/System.core/sounds/effects/cinematic/focus.cafnew file mode 100644index 00000000..f13a0a9eBinary files /dev/null and b/System.core/sounds/effects/cinematic/focus.caf differdiff --git a/System.core/sounds/effects/cinematic/hover.caf b/System.core/sounds/effects/cinematic/hover.cafnew file mode 100644index 00000000..94355b9bBinary files /dev/null and b/System.core/sounds/effects/cinematic/hover.caf differdiff --git a/System.core/sounds/effects/dreamy/cancel.caf b/System.core/sounds/effects/dreamy/cancel.cafnew file mode 100644index 00000000..e9fb070fBinary files /dev/null and b/System.core/sounds/effects/dreamy/cancel.caf differdiff --git a/System.core/sounds/effects/dreamy/focus.caf b/System.core/sounds/effects/dreamy/focus.cafnew file mode 100644index 00000000..0441f5a7Binary files /dev/null and b/System.core/sounds/effects/dreamy/focus.caf differdiff --git a/System.core/sounds/effects/dreamy/hover.caf b/System.core/sounds/effects/dreamy/hover.cafnew file mode 100644index 00000000..83d5ec96Binary files /dev/null and b/System.core/sounds/effects/dreamy/hover.caf differdiff --git a/System.core/sounds/effects/glass/cancel.caf b/System.core/sounds/effects/glass/cancel.cafnew file mode 100644index 00000000..349be655Binary files /dev/null and b/System.core/sounds/effects/glass/cancel.caf differdiff --git a/System.core/sounds/effects/glass/focus.caf b/System.core/sounds/effects/glass/focus.cafnew file mode 100644index 00000000..5dc1c188Binary files /dev/null and b/System.core/sounds/effects/glass/focus.caf differdiff --git a/System.core/sounds/effects/glass/hover.caf b/System.core/sounds/effects/glass/hover.cafnew file mode 100644index 00000000..8e7cc92bBinary files /dev/null and b/System.core/sounds/effects/glass/hover.caf differdiff --git a/System.core/sounds/effects/mechanical/cancel.caf b/System.core/sounds/effects/mechanical/cancel.cafnew file mode 100644index 00000000..1f48e005Binary files /dev/null and b/System.core/sounds/effects/mechanical/cancel.caf differdiff --git a/System.core/sounds/effects/mechanical/focus.caf b/System.core/sounds/effects/mechanical/focus.cafnew file mode 100644index 00000000..800f89a7Binary files /dev/null and b/System.core/sounds/effects/mechanical/focus.caf differdiff --git a/System.core/sounds/effects/mechanical/hover.caf b/System.core/sounds/effects/mechanical/hover.cafnew file mode 100644index 00000000..2f4ecec1Binary files /dev/null and b/System.core/sounds/effects/mechanical/hover.caf differdiff --git a/System.core/sounds/effects/minimal/cancel.caf b/System.core/sounds/effects/minimal/cancel.cafnew file mode 100644index 00000000..58b4e8eaBinary files /dev/null and b/System.core/sounds/effects/minimal/cancel.caf differdiff --git a/System.core/sounds/effects/minimal/focus.caf b/System.core/sounds/effects/minimal/focus.cafnew file mode 100644index 00000000..fb6b05c5Binary files /dev/null and b/System.core/sounds/effects/minimal/focus.caf differdiff --git a/System.core/sounds/effects/minimal/hover.caf b/System.core/sounds/effects/minimal/hover.cafnew file mode 100644index 00000000..e58caaffBinary files /dev/null and b/System.core/sounds/effects/minimal/hover.caf differdiff --git a/System.core/sounds/effects/organic/cancel.caf b/System.core/sounds/effects/organic/cancel.cafnew file mode 100644index 00000000..9023f9faBinary files /dev/null and b/System.core/sounds/effects/organic/cancel.caf differdiff --git a/System.core/sounds/effects/organic/focus.caf b/System.core/sounds/effects/organic/focus.cafnew file mode 100644index 00000000..26bffff7Binary files /dev/null and b/System.core/sounds/effects/organic/focus.caf differdiff --git a/System.core/sounds/effects/organic/hover.caf b/System.core/sounds/effects/organic/hover.cafnew file mode 100644index 00000000..8a2326b6Binary files /dev/null and b/System.core/sounds/effects/organic/hover.caf differdiff --git a/System.core/sounds/effects/rubber/cancel.caf b/System.core/sounds/effects/rubber/cancel.cafnew file mode 100644index 00000000..afebd978Binary files /dev/null and b/System.core/sounds/effects/rubber/cancel.caf differdiff --git a/System.core/sounds/effects/rubber/focus.caf b/System.core/sounds/effects/rubber/focus.cafnew file mode 100644index 00000000..ceb61337Binary files /dev/null and b/System.core/sounds/effects/rubber/focus.caf differdiff --git a/System.core/sounds/effects/rubber/hover.caf b/System.core/sounds/effects/rubber/hover.cafnew file mode 100644index 00000000..bf1608f9Binary files /dev/null and b/System.core/sounds/effects/rubber/hover.caf differdiff --git a/System.core/sounds/effects/scifi/cancel.caf b/System.core/sounds/effects/scifi/cancel.cafnew file mode 100644index 00000000..63d3ee70Binary files /dev/null and b/System.core/sounds/effects/scifi/cancel.caf differdiff --git a/System.core/sounds/effects/scifi/focus.caf b/System.core/sounds/effects/scifi/focus.cafnew file mode 100644index 00000000..ef314275Binary files /dev/null and b/System.core/sounds/effects/scifi/focus.caf differdiff --git a/System.core/sounds/effects/scifi/hover.caf b/System.core/sounds/effects/scifi/hover.cafnew file mode 100644index 00000000..44fc95a4Binary files /dev/null and b/System.core/sounds/effects/scifi/hover.caf differdiff --git a/System.core/sounds/effects/soft/cancel.caf b/System.core/sounds/effects/soft/cancel.cafnew file mode 100644index 00000000..7625b93dBinary files /dev/null and b/System.core/sounds/effects/soft/cancel.caf differdiff --git a/System.core/sounds/effects/soft/focus.caf b/System.core/sounds/effects/soft/focus.cafnew file mode 100644index 00000000..64e7ae42Binary files /dev/null and b/System.core/sounds/effects/soft/focus.caf differdiff --git a/System.core/sounds/effects/soft/hover.caf b/System.core/sounds/effects/soft/hover.cafnew file mode 100644index 00000000..a8db6318Binary files /dev/null and b/System.core/sounds/effects/soft/hover.caf differdiff --git a/System.core/sounds/effects/studio/cancel.caf b/System.core/sounds/effects/studio/cancel.cafnew file mode 100644index 00000000..9800ff3eBinary files /dev/null and b/System.core/sounds/effects/studio/cancel.caf differdiff --git a/System.core/sounds/effects/studio/focus.caf b/System.core/sounds/effects/studio/focus.cafnew file mode 100644index 00000000..2337b030Binary files /dev/null and b/System.core/sounds/effects/studio/focus.caf differdiff --git a/System.core/sounds/effects/studio/hover.caf b/System.core/sounds/effects/studio/hover.cafnew file mode 100644index 00000000..aefcbab0Binary files /dev/null and b/System.core/sounds/effects/studio/hover.caf differdiff --git a/System.core/sounds/effects/zen/cancel.caf b/System.core/sounds/effects/zen/cancel.cafnew file mode 100644index 00000000..7767876fBinary files /dev/null and b/System.core/sounds/effects/zen/cancel.caf differdiff --git a/System.core/sounds/effects/zen/focus.caf b/System.core/sounds/effects/zen/focus.cafnew file mode 100644index 00000000..c1fa6fceBinary files /dev/null and b/System.core/sounds/effects/zen/focus.caf differdiff --git a/System.core/sounds/effects/zen/hover.caf b/System.core/sounds/effects/zen/hover.cafnew file mode 100644index 00000000..061e1989Binary files /dev/null and b/System.core/sounds/effects/zen/hover.caf differ