Skip to content

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

Swift

Optimize 3DS; add external import from MeloCafe;

Daiuno6fc4a97c9114
diff --git a/Cores/azahar.libretro.framework/azahar.libretro b/Cores/azahar.libretro.framework/azahar.libretro
index 2d118c00..495fc0bf 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:183159290d777d42a68c17f5f4d90d8b88f7aa0281e4788bad4e5954a6df940c
-size 27797040
+oid sha256:f0312ef76681480cc23e3709f9318b3a6b86e17ebe30d8241401e8fa5c9330c5
+size 28725104
diff --git a/Dependencies/Libretro b/Dependencies/Libretro
index b3af6035..d08135f3 160000
--- a/Dependencies/Libretro
+++ b/Dependencies/Libretro
@@ -1 +1 @@
-Subproject commit b3af60359f3b180a9cad88366221fa55d04bb49a
+Subproject commit d08135f3dded8d11a1e6a09fe0db6040be4b4be9
diff --git a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
index 07048447..48116094 100644
--- a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
+++ b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
@@ -2221,6 +2221,10 @@
E524FB073088C9BD009885DA /* ShortcutButtonContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FB053088C9BB009885DA /* ShortcutButtonContainerView.swift */; };
E524FB083088C9BD009885DA /* ShortcutButtonContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FB053088C9BB009885DA /* ShortcutButtonContainerView.swift */; };
E524FB093088C9BD009885DA /* ShortcutButtonContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FB053088C9BB009885DA /* ShortcutButtonContainerView.swift */; };
+ E524FBC8308F2B41009885DA /* WiiU.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FBC7308F2B38009885DA /* WiiU.swift */; };
+ E524FBC9308F2B41009885DA /* WiiU.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FBC7308F2B38009885DA /* WiiU.swift */; };
+ E524FBCA308F2B41009885DA /* WiiU.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FBC7308F2B38009885DA /* WiiU.swift */; };
+ E524FBCB308F2B41009885DA /* WiiU.swift in Sources */ = {isa = PBXBuildFile; fileRef = E524FBC7308F2B38009885DA /* WiiU.swift */; };
E5385955E04D43598CAC5694 /* vice.x64sc.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 6A6021052A14459DA6F729AB /* vice.x64sc.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
E5A00BB23080B2CC00E99223 /* ProHUDExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A00BB13080B2C200E99223 /* ProHUDExtensions.swift */; };
E5A00BB33080B2CC00E99223 /* ProHUDExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5A00BB13080B2C200E99223 /* ProHUDExtensions.swift */; };
@@ -7124,7 +7128,6 @@
57BA854D30356A620039E284 /* 7800.keymapping */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = 7800.keymapping; sourceTree = "<group>"; };
57BA854E30356A620039E284 /* 7800.manicskin */ = {isa = PBXFileReference; lastKnownFileType = file; path = 7800.manicskin; sourceTree = "<group>"; };
57BA854F30356A620039E284 /* 7800_FLEX.manicskin */ = {isa = PBXFileReference; lastKnownFileType = file; path = 7800_FLEX.manicskin; sourceTree = "<group>"; };
- 57BA855030356A620039E284 /* aes_keys.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = aes_keys.txt; sourceTree = "<group>"; };
57BA855130356A620039E284 /* Arcade.keymapping */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Arcade.keymapping; sourceTree = "<group>"; };
57BA855230356A620039E284 /* Arcade.manicskin */ = {isa = PBXFileReference; lastKnownFileType = file; path = Arcade.manicskin; sourceTree = "<group>"; };
57BA855330356A620039E284 /* Arcade_FLEX.manicskin */ = {isa = PBXFileReference; lastKnownFileType = file; path = Arcade_FLEX.manicskin; sourceTree = "<group>"; };
@@ -7495,6 +7498,7 @@
E524FAAE30886516009885DA /* DuoTabletopKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuoTabletopKit.swift; sourceTree = "<group>"; };
E524FABA308866D4009885DA /* DuoHingeKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuoHingeKit.swift; sourceTree = "<group>"; };
E524FB053088C9BB009885DA /* ShortcutButtonContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShortcutButtonContainerView.swift; sourceTree = "<group>"; };
+ E524FBC7308F2B38009885DA /* WiiU.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WiiU.swift; sourceTree = "<group>"; };
E5A00BB13080B2C200E99223 /* ProHUDExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProHUDExtensions.swift; sourceTree = "<group>"; };
E5D10A010000000000000001 /* DuoLayoutKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DuoLayoutKit.swift; sourceTree = "<group>"; };
F0C500000000000000000101 /* FocusTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusTypes.swift; sourceTree = "<group>"; };
@@ -13297,7 +13301,6 @@
57BA854D30356A620039E284 /* 7800.keymapping */,
57BA854E30356A620039E284 /* 7800.manicskin */,
57BA854F30356A620039E284 /* 7800_FLEX.manicskin */,
- 57BA855030356A620039E284 /* aes_keys.txt */,
57BA855130356A620039E284 /* Arcade.keymapping */,
57BA855230356A620039E284 /* Arcade.manicskin */,
57BA855330356A620039E284 /* Arcade_FLEX.manicskin */,
@@ -13708,6 +13711,7 @@
57F0D8402DE2CD7500760F57 /* Cores */ = {
isa = PBXGroup;
children = (
+ E524FBC7308F2B38009885DA /* WiiU.swift */,
6809D2DE31034EF5B9135498 /* FLASH.swift */,
16B86ECC930242969A108735 /* WSC.swift */,
B93489E15EFD47F2AE825436 /* Amiga.swift */,
@@ -14800,6 +14804,7 @@
00000000000051A1000000B1 /* CloudDriveConnetor.swift in Sources */,
00000000000051A1000000B2 /* GamesSelectionView.swift in Sources */,
00000000000051A1000000B3 /* FlexBackground.swift in Sources */,
+ E524FBCB308F2B41009885DA /* WiiU.swift in Sources */,
00000000000051A1000000B4 /* SectionIndexView.swift in Sources */,
00000000000051A1000000B5 /* EmulatorBridgingBase.swift in Sources */,
00000000000051A1000000B6 /* LibretroNetplayAnalogDpad.swift in Sources */,
@@ -15244,6 +15249,7 @@
5790941B303C7D9100A53656 /* CloudDriveConnetor.swift in Sources */,
5790941C303C7D9100A53656 /* GamesSelectionView.swift in Sources */,
5790941D303C7D9100A53656 /* FlexBackground.swift in Sources */,
+ E524FBC9308F2B41009885DA /* WiiU.swift in Sources */,
5790941E303C7D9100A53656 /* SectionIndexView.swift in Sources */,
5790941F303C7D9100A53656 /* EmulatorBridgingBase.swift in Sources */,
57C81DAF2FD6082600A8D0A1 /* LibretroNetplayAnalogDpad.swift in Sources */,
@@ -15725,6 +15731,7 @@
57CDCDFC2FD5CBD3005BA4C8 /* CloudDriveConnetor.swift in Sources */,
57CDCDFE2FD5CBD3005BA4C8 /* GamesSelectionView.swift in Sources */,
57CDCDFF2FD5CBD3005BA4C8 /* FlexBackground.swift in Sources */,
+ E524FBC8308F2B41009885DA /* WiiU.swift in Sources */,
57CDCE002FD5CBD3005BA4C8 /* SectionIndexView.swift in Sources */,
57CDCE052FD5CBD3005BA4C8 /* EmulatorBridgingBase.swift in Sources */,
57C81DB02FD6082600A8D0A1 /* LibretroNetplayAnalogDpad.swift in Sources */,
@@ -16080,6 +16087,7 @@
57D482B33019D3330030A771 /* ASListCustomCollectionCell.swift in Sources */,
57C79DE22FE3EC49003C737F /* ASSheetView.swift in Sources */,
57D942E5302F72CE00C06208 /* CitraAdvancedSettingView.swift in Sources */,
+ E524FBCA308F2B41009885DA /* WiiU.swift in Sources */,
578F28832F3780BC00D2D998 /* WFCSettingView.swift in Sources */,
579076F02D8AAC2900ED90FB /* TransparentHoleView.swift in Sources */,
5742E1B52FDA9A330031A726 /* ASLabelView.swift in Sources */,
diff --git a/ManicEmu/ManicEmu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ManicEmu/ManicEmu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 86099f3c..908ae68f 100644
--- a/ManicEmu/ManicEmu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/ManicEmu/ManicEmu.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -1,5 +1,5 @@
{
- "originHash" : "8131579a26fdd7e12a346ab9de23e4bd1e54e7d72c06ca478e2214a3aa08bd06",
+ "originHash" : "72a2ab0a463e3f154de6e82416d737a273b094475465dbded94e4a88b6561aef",
"pins" : [
{
"identity" : "attributedstring",
diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme
index d127904b..d844db88 100644
--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme
+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuDebug.xcscheme
@@ -31,7 +31,7 @@
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
- buildConfiguration = "Debug"
+ buildConfiguration = "SideloadRelease"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme
index a10926dd..fad547de 100644
--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme
+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmuSideload.xcscheme
@@ -31,7 +31,7 @@
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
- buildConfiguration = "Debug"
+ buildConfiguration = "SideloadRelease"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/Contents.json
new file mode 100644
index 00000000..a000fcf3
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "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/Brand/wiiu_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..1be59f38
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..7589cefe
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Brand/wiiu_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/Contents.json
new file mode 100644
index 00000000..e55f74c7
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "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/Cover/wiiu_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..d8769557
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..3434e298
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/Contents.json
new file mode 100644
index 00000000..7df4b423
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/Contents.json
@@ -0,0 +1,22 @@
+{
+ "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/Cover/wiiu_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..1e017ee6
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..9156e77f
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Cover/wiiu_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
index 354b145e..892b67b8 100644
--- a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
+++ b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
@@ -11,7 +11,7 @@
// https://help.apple.com/xcode/#/dev745c5c974
APP_BUNDLE_IDENTIFIER = com.aoshuang.manicemu
-APP_BUILD_VERSION = 1
+APP_BUILD_VERSION = 2
APP_VERSION = 2.0.2
// Prebuilt cores under ProjectManicEMU/Cores (Citra.framework, *.libretro.framework, …)
diff --git a/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings
index e9f06b46..dd5b5ebc 100644
--- a/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings
@@ -1200,3 +1200,9 @@ Press the controller button to complete mapping...";
"WhatsNew" = "What’s New in v%@";
"TabletopModeDetected" = "Fold the device and rotate to portrait to enter Tabletop Mode.";
+
+"AzaharEncryptedRomUnsupported" = "Azahar does not support encrypted ROMs. Only the Citra core can run them.";
+"AesKeysTxtDesc" = "Required to play encrypted 3DS ROMs with the Citra core.";
+"game3DSEncryptedTips" = "Import the correct aes_keys.txt to read encrypted ROMs. Only the Citra core can run them.";
+
+"FetchGamesFromMeloCafe" = "Import Games from MeloCafe";
diff --git a/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings
index 302c2be8..4c54a329 100644
--- a/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings
@@ -1195,3 +1195,9 @@
"ICloudROMTransferLimitDesc" = "这两项限制仅作用于 ROM 文件。游戏存档、即时存档、皮肤和设置会在任意网络、任意大小下继续同步。打开游戏时始终会下载对应 ROM,即使限制本会阻止同步。";
"TabletopModeDetected" = "折叠并将屏幕转为竖屏,即可进入 Tabletop 模式。";
+
+"AzaharEncryptedRomUnsupported" = "Azahar 不支持加密 ROM,仅 Citra 核心可以运行。";
+"AesKeysTxtDesc" = "Citra 核心运行加密 3DS ROM 时需要此文件。";
+"game3DSEncryptedTips" = "请导入正确的 aes_keys.txt 以读取加密 ROM。仅 Citra 核心可以运行此类 ROM。";
+
+"FetchGamesFromMeloCafe" = "从 MeloCafe 导入游戏";
diff --git a/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift b/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift
index add72b52..f331b9c0 100644
--- a/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/AppDelegate.swift
@@ -1,4 +1,3 @@
-
//
// AppDelegate.swift
// ManicEmu
diff --git a/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift b/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift
index 8e35c666..2a7f67ec 100644
--- a/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift
@@ -209,6 +209,8 @@ class ApplicationSceneDelegate: UIResponder, UIWindowSceneDelegate {
EmulatorInteractionKit.processGames(type: .dukeX, callbackUrl: url)
} else if let host = url.host, host == R.Strings.ARMSX2Scheme {
EmulatorInteractionKit.processGames(type: .armsx2, callbackUrl: url)
+ } else if let host = url.host, host == R.Strings.MeloCafeScheme {
+ EmulatorInteractionKit.processGames(type: .melocafe, callbackUrl: url)
} else {
Self.launchGameID = url.lastPathComponent
}
diff --git a/ManicEmu/ManicEmu/Sources/Base/Constants.swift b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
index e0c0e93c..270a1aff 100644
--- a/ManicEmu/ManicEmu/Sources/Base/Constants.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
@@ -87,6 +87,7 @@ extension _R {
case .c64: return 0.7146
case .amiga: return 0.7052
case .flash: return 1.375
+ case .wiiu: return 0.714
default: return 1.0
}
case .style2:
@@ -580,7 +581,7 @@ extension _R {
static let EKA2L1DriveENGage = EKA2L1DriveE.appendingPathComponent("n-gage")
static let Dolphin = Document.appendingPathComponent(EmulationCore.Dolphin.name)
static let DolphinGameSettings = Dolphin.appendingPathComponent("User/GameSettings")
- static let NimbusPath = Resource.appendingPathComponent("Nimbus210")
+ static let NimbusPath = Resource.appendingPathComponent("Nimbus220")
static let Nimbus3DSPath = NimbusPath.appendingPathComponent("3ds")
static let NimbusCiaPath = NimbusPath.appendingPathComponent("cias/nimbus.cia")
static let GamecubeUser = Dolphin.appendingPathComponent("/User/GC")
@@ -669,6 +670,7 @@ extension _R {
static let XeniOSScheme = "xenios"
static let DukeXScheme = "dukex"
static let ARMSX2Scheme = "armsx2"
+ static let MeloCafeScheme = "melocafe"
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"
@@ -1333,6 +1335,10 @@ extension _R {
components.queryItems = [URLQueryItem(name: "game", value: gameId)]
return components.url!
}
+ /// `melocafe://gameInfo?scheme=manicemu` — MeloCafe opens `manicemu://melocafe?games=`.
+ static let FetchMeloCafeGames = URL(string: "\(R.Strings.MeloCafeScheme)://gameInfo?scheme=\(R.Strings.ManicScheme)")!
+ /// `melocafe://game?id=` matches `GamesManager.handleDeepLink` (`UInt64` title id).
+ static func MeloCafeGameLaunch(gameId: String) -> URL { URL(string: "\(R.Strings.MeloCafeScheme)://game?id=\(gameId)")! }
#if SIDE_LOAD
static let EnableJITUrl = URL(string: "stikjit://enable-jit?bundle-id=com.aoshuang.manicemu&script-name=universal.js")!
#endif
@@ -1412,7 +1418,8 @@ extension _R {
]
static let ThreeDSBios = [
- BIOSItem(fileName: "nand.zip", imported: false, desc: "The internal storage of 3DS ", required: false)
+ BIOSItem(fileName: "nand.zip", imported: false, desc: "The internal storage of 3DS ", required: false),
+ BIOSItem(fileName: "aes_keys.txt", imported: false, desc: R.string.localizable.aesKeysTxtDesc(), required: false)
]
static let WiiBios = [
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ImportError.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ImportError.swift
index 90ed8fb9..785b4288 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ImportError.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ImportError.swift
@@ -58,7 +58,7 @@ enum ImportError: Error, LocalizedError {
case .badFile(let string):
R.string.localizable.gameImportBadFile(string)
case .decryptFailed(let string):
- R.string.localizable.game3DSDecryptFailed(string)
+ R.string.localizable.game3DSDecryptFailed(string) + "\n\n" + R.string.localizable.game3DSEncryptedTips()
case .ciaGameNotExist(let string):
R.string.localizable.game3DSGameNotExist(string)
case .saveNoMatchGames(let url):
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift
index 90c07172..8ab76ed1 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/Models/SpecialCoreOption.swift
@@ -128,7 +128,6 @@ enum SpecialCoreOption: String {
case mame_cheats_enable
//isAzahar3DS
case citra_use_cpu_jit
- case citra_use_default_aes_key
case citra_required_online_lle_modules
case citra_touch_touchscreen
case citra_input_type
@@ -138,6 +137,7 @@ enum SpecialCoreOption: String {
case citra_large_screen_proportion
case citra_custom_layout_config
case citra_motion_rotation
+ case citra_use_fastinterp
//a2600
case stella_crop_hoverscan
//a5200
@@ -356,7 +356,6 @@ enum SpecialCoreOption: String {
} else if game.isAzahar3DS {
return [
.citra_use_cpu_jit,
- .citra_use_default_aes_key,
.citra_layout_option,
.citra_layout_option,
.citra_swap_screen,
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift
index c278357d..37ab9213 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Models/GameOptionPerform.swift
@@ -11,6 +11,7 @@ import IceCream
import Kingfisher
import RealmSwift
import Haptica
+import ProHUD
extension GameOption {
func performAction(with games: [Game],
@@ -1051,9 +1052,7 @@ extension GameOption {
case .quit:
PlayViewController.quit()
- if !firstGame.isAzaharArticBase {
- hideSheetInGaming()
- }
+ hideSheetInGaming(hideAll: !firstGame.isAzaharArticBase)
case .gameShortcut:
pauseEmulationIfNeed()
@@ -1766,9 +1765,15 @@ extension GameOption {
}
}
- private func hideSheetInGaming() {
+ private func hideSheetInGaming(hideAll: Bool = true) {
if PlayViewController.isGaming {
- UIView.hideAllAlert()
+ if hideAll {
+ UIView.hideAllAlert()
+ } else {
+ if GameOptionsView.hasShownInstance {
+ SheetProvider.findAll().last?.pop()
+ }
+ }
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift
index 1bf1e0b9..8dfbf8bc 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift
@@ -349,6 +349,8 @@ class GameCoverView: BaseView {
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()
+ } else if gameType == .wiiu {
+ image = style == .style2 ? R.image.wiiu_cover_v() : R.image.wiiu_cover_h()
}
if scalePlatform,
coverSize != .zero,
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift
index f95f8fb4..75d67cdb 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift
@@ -40,7 +40,8 @@ class ImportServiceListView: BaseView {
.iconTitleChevronCell(title: R.string.localizable.fetchGamesFromMeloNX()),
.iconTitleChevronCell(title: R.string.localizable.fetchGamesFromXeniOS()),
.iconTitleChevronCell(title: R.string.localizable.fetchGamesFromDukeX()),
- .iconTitleChevronCell(title: R.string.localizable.fetchGamesFromARMSX2())
+ .iconTitleChevronCell(title: R.string.localizable.fetchGamesFromARMSX2()),
+ .iconTitleChevronCell(title: R.string.localizable.fetchGamesFromMeloCafe())
])
], completion: { indexPath in
guard let indexPath else { return }
@@ -48,7 +49,7 @@ class ImportServiceListView: BaseView {
AddUrlGameView.show()
return
}
- let types: [EmulatorInteractionKit.EmulatorType] = [.meloNX, .xeniOS, .dukeX, .armsx2]
+ let types: [EmulatorInteractionKit.EmulatorType] = [.meloNX, .xeniOS, .dukeX, .armsx2, .melocafe]
if types.indices.contains(indexPath.row) {
EmulatorInteractionKit.fetchGames(type: types[indexPath.row])
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
index 4af831a5..7eb7bb76 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
@@ -163,7 +163,7 @@ class PlayViewController: GameViewController {
game.handleTapAction(forceQuick: true, in: scene)
return
}
- if game.gameType == .ns || game.gameType == .xbox360 || game.gameType == .xbox || game.gameType == .ps2 {
+ if game.gameType == .ns || game.gameType == .xbox360 || game.gameType == .xbox || game.gameType == .ps2 || game.gameType == .wiiu {
holdTabletopPause = true
if #available(iOS 27.1, *) {
DuoTabletopKit.markTabletopResumeWhenActive()
@@ -174,8 +174,10 @@ class PlayViewController: GameViewController {
EmulatorInteractionKit.startGame(type: .xeniOS, id: game.id)
} else if game.gameType == .xbox {
EmulatorInteractionKit.startGame(type: .dukeX, id: game.id)
- } else {
+ } else if game.gameType == .ps2 {
EmulatorInteractionKit.startGame(type: .armsx2, id: game.id)
+ } else if game.gameType == .wiiu {
+ EmulatorInteractionKit.startGame(type: .melocafe, id: game.id)
}
return
}
@@ -183,6 +185,16 @@ class PlayViewController: GameViewController {
game.ensurePS1BinCueSheet()
if game.isRomExtsts || game.isNDSHomeMenuGame || game.isDOSHomeMenuGame {
func showPlayView() {
+ if game.gameType == ._3ds, ThreeDS.isEncryptedROM(at: game.romUrl) {
+ if game.isAzahar3DS {
+ UIView.makeToast(message: R.string.localizable.azaharEncryptedRomUnsupported())
+ return
+ }
+ if !ThreeDS.hasAesKeys {
+ BIOSSelectionView.show(gameType: game.gameType)
+ return
+ }
+ }
if game.isBIOSMissing() {
//检查是否缺失BIOS
BIOSSelectionView.show(gameType: game.gameType)
@@ -774,46 +786,7 @@ class PlayViewController: GameViewController {
//添加功能按钮容器按钮
shortcutsButtonContainer.isHidden = true
view.addSubview(shortcutsButtonContainer)
-// shortcutsButtonContainer.snp.makeConstraints { make in
-// if manicGame.gameType == .n64 && UIDevice.isPad {
-// make.top.equalTo(gameView.snp.bottom).offset(-9)
-// } else if manicGame.gameType == .j2me ||
-// manicGame.gameType == .gba || manicGame.gameType == .wsc {
-// make.top.equalTo(gameView.snp.bottom).offset(3)
-// } else if manicGame.gameType.usesDOSSkinLayout {
-// if UIDevice.isStandardPhone {
-// make.top.equalTo(gameView.snp.bottom).offset(17)
-// } else if UIDevice.isProMaxPhone {
-// make.top.equalTo(gameView.snp.bottom).offset(22)
-// } else {
-// make.top.equalTo(gameView.snp.bottom).offset(19)
-// }
-// } else if manicGame.gameType == .symbian, UIDevice.isPhone {
-// make.top.equalTo(gameView.snp.bottom).offset(4)
-// } else if manicGame.isDolphinCore || manicGame.gameType == .flash {
-// make.top.equalTo(gameView.snp.bottom).offset(5)
-// } else if manicGame.gameType == .pce {
-// make.top.equalTo(gameView.snp.bottom).offset(R.Size.ContentSpaceMedium)
-// } else {
-// make.top.equalTo(gameView.snp.bottom)
-// }
-//
-// make.leading.trailing.equalTo(gameView)
-//
-// if manicGame.gameType == .j2me ||
-// manicGame.gameType.usesDOSSkinLayout ||
-// (manicGame.gameType == .symbian && UIDevice.isPhone) ||
-// manicGame.gameType == .pce ||
-// manicGame.gameType == .gba ||
-// manicGame.gameType == .wsc {
-// make.height.equalTo(R.Size.ItemHeightMicro)
-// } else if manicGame.gameType == .ngp {
-// make.height.equalTo(R.Size.ItemHeightTiny)
-// } else {
-// make.height.equalTo(R.Size.ItemHeightMedium)
-// }
-//
-// }
+
//设置外设控制器
updateExternalGameController()
// Load default core config after JIT is ready (sideload waits for CS_DEBUGGED first).
@@ -1958,7 +1931,6 @@ extension PlayViewController {
if manicGame.isAzahar3DS {
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_motion_rotation: Self.motionRotationValue()
], safeMode: true)
@@ -2259,12 +2231,12 @@ extension PlayViewController {
if enableJIT {
setupUniversalScript(gameType: ._3ds)
}
- let enableLLE = (manicGame.isArticBaseHomeMenu || (manicGame.getExtraInt(key: ExtraKey.emulationAccuracy.rawValue) ?? 0 == 1)) ? true : false
+ let enableLLE = manicGame.isAzaharArticBase || (manicGame.getExtraInt(key: ExtraKey.emulationAccuracy.rawValue) ?? 0 == 1) ? true : false
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_motion_rotation: Self.motionRotationValue()
+ .citra_motion_rotation: Self.motionRotationValue(),
+ .citra_use_fastinterp: enableLLE ? "disabled" : "enabled"
])
// Never start Azahar with fast-forward; it can crash on boot.
Game.change { realm in
@@ -2732,173 +2704,6 @@ extension PlayViewController {
}
}
-// private func updateShortcutsButton() {
-// shortcutsButtonContainer.subviews.forEach { $0.removeFromSuperview() }
-// if (manicGame.gameType == ._3ds && UIDevice.isPad) || manicGame.isAzaharArticBase {
-// return
-// }
-// if let hostingWindow, UIDevice.isWindowAppIPad(window: hostingWindow) {
-// return
-// }
-// if let controllerSkin = controllerView.controllerSkin {
-// if let skin = Database.realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier }) {
-// if skin.supportShortcut {
-// //当前使用的是默认皮肤 则添加功能按钮
-// var shortcuts = Prefference.defalut.getPrefference(kind: .gameShortcut,
-// storeKey: .game(gameId: manicGame.id),
-// bestEfforts: true)?.gameShortcutValue ?? GameOption.defaultShortcutOptions(for: manicGame)
-// let availableOptions = Set(GameOption.availableOptions(game: manicGame, scene: .gaming))
-// shortcuts = shortcuts.filter({ availableOptions.contains($0) })
-//
-//
-// guard shortcuts.count > 0 else { return }
-// let functionButtonCount = shortcuts.count
-// for (index, shortcut) in shortcuts.enumerated() {
-// var iconColor = UIColor.white.withAlphaComponent(0.25)
-// if (manicGame.gameType == .ds && UIDevice.isPad) ||
-// manicGame.gameType == .wii ||
-// manicGame.gameType == .ngc ||
-// (manicGame.gameType == .pce && view.preferredLayoutStyle == .portrait) ||
-// manicGame.gameType.usesDOSSkinLayout ||
-// manicGame.gameType == .wsc {
-// iconColor = .black.withAlphaComponent(0.25)
-// }
-// let buttonContainerView = UIView()
-// let button = ASButtonView(.iconOnlyWithSmallSize(icon: shortcut.icon.updateColorsIfNeed(colors: [iconColor], forceUpdate: true),
-// background: .clear))
-// button.didTapButton = { [weak self] in
-// guard let self, shortcut != .rewind else { return }
-// shortcut.showSecondPromptIfNeed(continued: {
-// shortcut.performAction(with: [self.manicGame],
-// in: self.hostingWindowScene,
-// performImmediately: true)
-// })
-// }
-// button.didLongPressButton = { [weak self] state in
-// guard let self else { return }
-// var mapping: MappingOption? = nil
-// if shortcut == .fastForward {
-// mapping = .fastForward2x
-// } else if shortcut == .rewind {
-// mapping = .rewind
-// } else {
-// mapping = MappingOption.GameOptionMappings.key(forValue: shortcut)
-// }
-// guard let mapping else { return }
-// let input = AnyInput(stringValue: mapping.rawValue,
-// intValue: 1,
-// type: .controller(.controllerSkin))
-// if state == .began {
-// self.gameController(self.controllerView,
-// didActivate:input,
-// value: 1)
-// } else if state == .cancelled || state == .ended {
-// self.gameController(self.controllerView,
-// didDeactivate: input)
-// }
-// }
-// buttonContainerView.addSubview(button)
-// button.snp.makeConstraints { make in
-// make.center.equalToSuperview()
-// }
-// shortcutsButtonContainer.addSubview(buttonContainerView)
-// buttonContainerView.snp.makeConstraints { make in
-// if manicGame.gameType == .ds || manicGame.gameType == ._3ds {
-// if UIDevice.isPhone {
-// make.width.equalTo(31)
-// make.height.equalToSuperview().dividedBy(2)
-// if index == 0 {
-// make.leading.equalToSuperview()
-// make.top.equalToSuperview()
-// } else if index == 1 {
-// make.leading.equalToSuperview()
-// make.top.equalTo(shortcutsButtonContainer.subviews[index - 1].snp.bottom)
-// } else if index == 2 {
-// make.trailing.equalToSuperview()
-// make.top.equalToSuperview()
-// } else if index == 3 {
-// make.trailing.equalToSuperview()
-// make.top.equalTo(shortcutsButtonContainer.subviews[index - 1].snp.bottom)
-// }
-// } else {
-// make.width.equalTo(50)
-// make.top.bottom.equalToSuperview()
-// if index == 0 {
-// make.leading.equalToSuperview()
-// } else if index == 1 {
-// make.leading.equalTo(shortcutsButtonContainer.subviews[index-1].snp.trailing)
-// } else if index == 2 {
-// make.trailing.equalToSuperview().inset(50)
-// } else if index == 3 {
-// make.trailing.equalToSuperview()
-// }
-// }
-// } else {
-// if index == 0 {
-// make.leading.equalToSuperview()
-// } else {
-// make.leading.equalTo(shortcutsButtonContainer.subviews[index-1].snp.trailing)
-// }
-// make.top.bottom.equalToSuperview()
-// if index == functionButtonCount-1 && functionButtonCount == R.Numbers.GameFunctionButtonCount {
-// make.trailing.equalToSuperview()
-// }
-// make.width.equalToSuperview().dividedBy(R.Numbers.GameFunctionButtonCount)
-// }
-// }
-//
-// }
-// }
-// }
-// }
-// }
-
-// private func updateShortcutButtonContainer() {
-// if (manicGame.gameType == .ds || (UIDevice.isPhone && manicGame.gameType == ._3ds)) && UIDevice.isPhone {
-// shortcutsButtonContainer.snp.remakeConstraints { make in
-// if gameViews.count > 1 {
-// //iPhone ds布局比较特殊
-// if view.preferredLayoutStyle == .landscape {
-// make.leading.equalTo(gameViews[0]).inset(-33)
-// make.trailing.equalTo(gameViews[1]).inset(-33)
-// make.top.equalToSuperview()
-// } else {
-// make.leading.trailing.equalTo(gameViews[1]).inset(-33)
-// make.top.equalTo(gameViews[1])
-// }
-//
-// if manicGame.gameType == ._3ds {
-// if let displayType = controllerView.controllerSkinTraits?.displayType, displayType == .standard {
-// //小屏幕
-// make.height.equalTo(80)
-// } else {
-// //大屏幕
-// make.height.equalTo(96)
-// }
-// } else {
-// if let displayType = controllerView.controllerSkinTraits?.displayType, displayType == .standard, view.preferredLayoutStyle == .portrait {
-// make.height.equalTo(87)
-// } else {
-// make.height.equalTo(113)
-// }
-// }
-// }
-// }
-// } else if manicGame.gameType.usesDOSSkinLayout, UIDevice.isPad {
-// shortcutsButtonContainer.snp.updateConstraints { make in
-// make.top.equalTo(gameView.snp.bottom).offset(view.preferredLayoutStyle == .landscape ? 30 : 40)
-// }
-// } else if manicGame.gameType == .ds, UIDevice.isPad {
-// shortcutsButtonContainer.snp.updateConstraints { make in
-// make.top.equalTo(gameView.snp.bottom).offset(view.preferredLayoutStyle == .landscape ? 25 : 40)
-// }
-// } else if manicGame.gameType == .pm && view.preferredLayoutStyle == .portrait {
-// shortcutsButtonContainer.snp.updateConstraints { make in
-// make.leading.trailing.equalTo(gameView).inset(50)
-// }
-// }
-// }
-
private func updateCitra3DSViews() {
#if !SIMULATOR
guard manicGame.isCitra3DS else { return }
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift
index 38555733..da956e0f 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift
@@ -350,11 +350,10 @@ class BIOSCollectionViewCell: UICollectionViewCell {
guard fileManager.fileExists(atPath: path, isDirectory: &isDirectory) else { return }
- if path.pathExtension.lowercased() == "app", let tid = pathToTid(path) {
- if R.Numbers.ThreeDSHomeMenuIdentifiers.contains(where: { $0 == tid }) {
- //识别到了3dS的home menu
- FilesImporter.importFiles(urls: [URL(fileURLWithPath: path)], silentMode: true, in: hostingWindowScene)
- }
+ if path.pathExtension.lowercased() == "app", let tid = pathToTid(path),
+ R.Numbers.ThreeDSHomeMenuIdentifiers.contains(where: { $0 == tid }) {
+ // Leave the .app in NAND. Importing it as a ROM copies onto the same path and deletes it.
+ ThreeDS.registerInstalledHomeMenu(at: URL(fileURLWithPath: path), identifier: tid)
}
if isDirectory.boolValue {
@@ -365,7 +364,7 @@ class BIOSCollectionViewCell: UICollectionViewCell {
import3DSHomeMenu(at: fullPath)
}
} catch {
- print("无法读取目录: \(path), 错误: \(error)")
+ Log.debug("Failed to read NAND directory \(path): \(error)")
}
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift
index a9c76ed1..5e020d32 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift
@@ -100,6 +100,11 @@ class BIOSSelectionView: BaseView {
SymbianFirmwareView.show()
} else if gameType == .ngc {
self.showGamecubeIPLSheet(desc: gameType.biosItems.first?.desc)
+ } else if gameType == ._3ds,
+ let items = self.biosItemMaps[gameType],
+ indexPath.row < items.count,
+ items[indexPath.row].fileName.lowercased() == "aes_keys.txt" {
+ self.importAesKeys()
} else {
self.importBios(gameType: gameType)
}
@@ -225,6 +230,10 @@ class BIOSSelectionView: BaseView {
let fileManager = FileManager.default
guard var biosItems = self.biosItemMaps[gameType] else { return }
for (index, bios) in biosItems.enumerated() {
+ if bios.fileName.lowercased() == "aes_keys.txt" {
+ biosItems[index].imported = fileManager.fileExists(atPath: R.Path.ThreeDSSystemData.appendingPathComponent("aes_keys.txt"))
+ continue
+ }
var biosInLib = R.Path.System.appendingPathComponent(bios.fileName)
if gameType == .ngc {
let imported = [R.Path.GamecubeUserEUR, R.Path.GamecubeUserJAP, R.Path.GamecubeUserUSA]
@@ -341,6 +350,37 @@ class BIOSSelectionView: BaseView {
})
}
+ private func importAesKeys() {
+ var types = UTType.binTypes
+ types.append(.plainText)
+ FilesImporter.shared.presentImportController(supportedTypes: types, allowsMultipleSelection: false, manualHandle: { urls in
+ UIView.makeLoading()
+ DispatchQueue.global().async {
+ let fileName = "aes_keys.txt"
+ let matched = urls.first { $0.lastPathComponent.lowercased() == fileName }
+ var success = false
+ if let matched {
+ let destination = URL(fileURLWithPath: R.Path.ThreeDSSystemData.appendingPathComponent(fileName))
+ do {
+ try FileManager.safeCopyItem(at: matched, to: destination, shouldReplace: true)
+ success = FileManager.default.fileExists(atPath: destination.path)
+ } catch {
+ success = false
+ }
+ }
+ DispatchQueue.main.async { [weak self] in
+ UIView.hideLoading()
+ if success {
+ UIView.makeToast(message: R.string.localizable.biosImportSuccess(fileName))
+ self?.reloadImportState(gameType: ._3ds, updateViews: true)
+ } else {
+ UIView.makeToast(message: R.string.localizable.biosImportFailed())
+ }
+ }
+ }
+ }, in: hostingWindowScene)
+ }
+
private func importBios(gameType: GameType) {
func importFromFiles() {
FilesImporter.shared.presentImportController(supportedTypes: UTType.binTypes, allowsMultipleSelection: true, manualHandle: { [weak self] urls in
@@ -496,11 +536,10 @@ class BIOSSelectionView: BaseView {
guard fileManager.fileExists(atPath: path, isDirectory: &isDirectory) else { return }
- if path.pathExtension.lowercased() == "app", let tid = pathToTid(path) {
- if R.Numbers.ThreeDSHomeMenuIdentifiers.contains(where: { $0 == tid }) {
- //识别到了3dS的home menu
- FilesImporter.importFiles(urls: [URL(fileURLWithPath: path)], silentMode: true, in: hostingWindowScene)
- }
+ if path.pathExtension.lowercased() == "app", let tid = pathToTid(path),
+ R.Numbers.ThreeDSHomeMenuIdentifiers.contains(where: { $0 == tid }) {
+ // Leave the .app in NAND. Importing it as a ROM copies onto the same path and deletes it.
+ ThreeDS.registerInstalledHomeMenu(at: URL(fileURLWithPath: path), identifier: tid)
}
if isDirectory.boolValue {
@@ -511,7 +550,7 @@ class BIOSSelectionView: BaseView {
import3DSHomeMenu(at: fullPath)
}
} catch {
- print("无法读取目录: \(path), 错误: \(error)")
+ Log.debug("Failed to read NAND directory \(path): \(error)")
}
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
index 1297cefb..1fabe347 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
@@ -101,6 +101,44 @@ extension GameType
}
struct ThreeDS: DeltaCoreProtocol {
+ /// Library entry for a Home Menu that already lives in NAND.
+ /// `.app` romUrl points at that NAND content, so copying it with replacement deletes the source.
+ static func registerInstalledHomeMenu(at fileURL: URL, identifier: UInt64) {
+ let titleLow = String(format: "%08x", UInt32(identifier & 0xFFFFFFFF))
+ let regionByTitle = [
+ "00008202": "JPN",
+ "00008f02": "USA",
+ "00009802": "EUR",
+ "0000a102": "CHN",
+ "0000a902": "KOR",
+ "0000b102": "TWN"
+ ]
+ guard let region = regionByTitle[titleLow] else { return }
+ guard let hash = FileHashUtil.truncatedHash(url: fileURL) else { return }
+ let realm = Database.realm
+ if let game = realm.object(ofType: Game.self, forPrimaryKey: hash) {
+ if game.isDeleted {
+ try? realm.write { game.isDeleted = false }
+ }
+ return
+ }
+ let game = Game()
+ game.id = hash
+ game.name = fileURL.deletingPathExtension().lastPathComponent
+ game.fileExtension = fileURL.pathExtension
+ game.gameType = ._3ds
+ game.extras = [
+ ExtraKey.identifier.rawValue: identifier,
+ ExtraKey.regions.rawValue: region
+ ].jsonData()
+ game.aliasName = "Home Menu (\(region))"
+ game.importDate = Date()
+ if let index = GlobalCoreSwitch.getConfig(realm: realm).getUsingCoreIndex(gameType: ._3ds) {
+ game.defaultCore = index
+ }
+ try? realm.write { realm.add(game) }
+ }
+
static func generate3DSHomeMenu() {
let homeMenus = [
"JPN": "/00008202/",
@@ -225,6 +263,139 @@ struct ThreeDS: DeltaCoreProtocol {
return Cheat(name: title, code: code)
}
}
+
+ /// User-supplied key file Citra reads from sysdata. A copy left by an older build counts.
+ static var hasAesKeys: Bool {
+ FileManager.default.fileExists(atPath: R.Path.ThreeDSSystemData.appendingPathComponent("aes_keys.txt"))
+ }
+
+ /// Header-only. `.3dsx` and anything that is not an NCCH, NCSD, or CIA is reported as not encrypted.
+ static func isEncryptedROM(at url: URL) -> Bool {
+ let accessed = url.startAccessingSecurityScopedResource()
+ defer {
+ if accessed {
+ url.stopAccessingSecurityScopedResource()
+ }
+ }
+ guard let handle = try? FileHandle(forReadingFrom: url) else { return false }
+ defer { try? handle.close() }
+ if url.pathExtension.lowercased() == "cia" {
+ return isEncryptedCIA(handle)
+ }
+ return ncchIsEncrypted(handle, at: 0)
+ }
+
+ /// `no_crypto` (NCCH flags bit 2) clear means ExHeader/ExeFS/RomFS are still ciphertext.
+ private static func ncchIsEncrypted(_ handle: FileHandle, at offset: UInt64) -> Bool {
+ guard let header = read(handle, at: offset, count: 0x200), header.count == 0x200 else { return false }
+ let magic = header.subdata(in: 0x100..<0x104)
+ if magic == Data("NCSD".utf8) {
+ // Only the file start is an NCSD. Partition 0 holds the game NCCH.
+ guard offset == 0 else { return false }
+ let partition = UInt64(u32LE(header, 0x120)) * 0x200
+ guard partition != 0 else { return false }
+ return ncchIsEncrypted(handle, at: partition)
+ }
+ guard magic == Data("NCCH".utf8) else { return false }
+ return (header[0x18F] & 0x04) == 0
+ }
+
+ /// CIA content encryption (TMD type bit 0) or an inner NCCH that is still encrypted.
+ private static func isEncryptedCIA(_ handle: FileHandle) -> Bool {
+ guard let header = read(handle, at: 0, count: 0x2020), header.count == 0x2020 else { return false }
+ let headerSize = UInt64(u32LE(header, 0x00))
+ let certSize = UInt64(u32LE(header, 0x08))
+ let ticketSize = UInt64(u32LE(header, 0x0C))
+ let tmdSize = UInt64(u32LE(header, 0x10))
+ guard headerSize >= 0x20, tmdSize > 0 else { return false }
+
+ let certificateOffset = align64(headerSize)
+ let ticketOffset = align64(certificateOffset + certSize)
+ let tmdOffset = align64(ticketOffset + ticketSize)
+ guard let signature = read(handle, at: tmdOffset, count: 4), signature.count == 4 else { return false }
+ let signatureSize: UInt64
+ switch u32BE(signature, 0) {
+ case 0x10000, 0x10003: signatureSize = 0x200
+ case 0x10001, 0x10004: signatureSize = 0x100
+ case 0x10002, 0x10005: signatureSize = 0x3C
+ default: return false
+ }
+ let body = align64(4 + signatureSize)
+ guard let countData = read(handle, at: tmdOffset + body + 0x9E, count: 2), countData.count == 2 else { return false }
+ let contentCount = Int(u16BE(countData, 0))
+ // Retail titles have a handful of contents. A huge count is a bad header, not an encrypted ROM.
+ guard contentCount > 0, contentCount <= 256 else { return false }
+ let chunksOffset = tmdOffset + body + 0x9C4
+ let chunksSize = contentCount * 0x30
+ guard chunksOffset + UInt64(chunksSize) <= tmdOffset + tmdSize,
+ let chunks = read(handle, at: chunksOffset, count: chunksSize),
+ chunks.count == chunksSize else { return false }
+
+ var contentOffset = align64(tmdOffset + tmdSize)
+ for index in 0..<contentCount {
+ let base = index * 0x30
+ let contentIndex = Int(u16BE(chunks, base + 4))
+ let type = u16BE(chunks, base + 6)
+ let size = u64BE(chunks, base + 8)
+ if ciaContains(header, contentIndex), (type & 1) != 0 {
+ return true
+ }
+ // Absent slots contribute no bytes, matching CIAContainer::GetContentOffset.
+ let slotSize = ciaContains(header, index) ? size : 0
+ if slotSize > 0, ncchIsEncrypted(handle, at: contentOffset) {
+ return true
+ }
+ contentOffset += slotSize
+ }
+ return false
+ }
+
+ /// CIA `content_present`: index 0 is the high bit of the first byte.
+ private static func ciaContains(_ header: Data, _ index: Int) -> Bool {
+ guard index >= 0, index < 0x10000 else { return false }
+ let byte = header[0x20 + (index >> 3)]
+ return (byte & UInt8(0x80 >> (index & 7))) != 0
+ }
+
+ private static func align64(_ value: UInt64) -> UInt64 {
+ (value + 0x3F) & ~0x3F
+ }
+
+ private static func read(_ handle: FileHandle, at offset: UInt64, count: Int) -> Data? {
+ guard count > 0 else { return Data() }
+ do {
+ try handle.seek(toOffset: offset)
+ return try handle.read(upToCount: count)
+ } catch {
+ return nil
+ }
+ }
+
+ private static func u16BE(_ data: Data, _ offset: Int) -> UInt16 {
+ (UInt16(data[offset]) << 8) | UInt16(data[offset + 1])
+ }
+
+ private static func u32LE(_ data: Data, _ offset: Int) -> UInt32 {
+ UInt32(data[offset])
+ | (UInt32(data[offset + 1]) << 8)
+ | (UInt32(data[offset + 2]) << 16)
+ | (UInt32(data[offset + 3]) << 24)
+ }
+
+ private static func u32BE(_ data: Data, _ offset: Int) -> UInt32 {
+ (UInt32(data[offset]) << 24)
+ | (UInt32(data[offset + 1]) << 16)
+ | (UInt32(data[offset + 2]) << 8)
+ | UInt32(data[offset + 3])
+ }
+
+ private static func u64BE(_ data: Data, _ offset: Int) -> UInt64 {
+ var value: UInt64 = 0
+ for byte in data[offset..<(offset + 8)] {
+ value = (value << 8) | UInt64(byte)
+ }
+ return value
+ }
}
class ThreeDSEmulatorBridge : EmulatorBridgeBase {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/WiiU.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/WiiU.swift
new file mode 100644
index 00000000..49cbdc4e
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/WiiU.swift
@@ -0,0 +1,11 @@
+//
+// WiiU.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/10/26.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+extension GameType {
+ static let wiiu = GameType("public.aoshuang.game.wiiu")
+}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift
index ade92bd0..4c06aac7 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift
@@ -238,6 +238,8 @@ extension GameType {
self = .ws
} else if shortName.uppercased() == "FLASH" {
self = .flash
+ } else if shortName.uppercased() == "WiiU".uppercased() {
+ self = .wiiu
} else {
return nil
}
@@ -297,6 +299,7 @@ extension GameType {
case .wsc: return "WonderSwan Color"
case .ws: return "WonderSwan"
case .flash: return "Adobe Flash"
+ case .wiiu: return "Nintendo WiiU"
default: return ""
}
}
@@ -355,6 +358,7 @@ extension GameType {
case .wsc: return NSLocalizedString("WSC", comment: "")
case .ws: return NSLocalizedString("WS", comment: "")
case .flash: return NSLocalizedString("Flash", comment: "")
+ case .wiiu: return NSLocalizedString("WiiU", comment: "")
case .unknown: return R.string.localizable.unknownPlatform()
default: return ""
}
@@ -414,6 +418,7 @@ extension GameType {
case .wsc: return 2000
case .ws: return 1999
case .flash: return 1996
+ case .wiiu: return 2012
default: return 0
}
}
@@ -651,7 +656,7 @@ extension GameType {
var manufacturer: Manufacturer {
switch self {
- case ._3ds, .ds, .gb, .gba, .gbc, .nes, .fds, .snes, .vb, .pm, .n64, .ns, .ngc, .wii:
+ case ._3ds, .ds, .gb, .gba, .gbc, .nes, .fds, .snes, .vb, .pm, .n64, .ns, .ngc, .wii, .wiiu:
return .nintendo
case .ps1, .ps2, .psp:
return .sony
@@ -828,6 +833,8 @@ extension GameType {
image = R.image.flash_group_brand()
} else if self == .ps2 {
image = R.image.ps2_group_brand()
+ } else if self == .wiiu{
+ image = R.image.wiiu_group_brand()
}
Self.brandImageCaches[key] = image
return image
@@ -838,7 +845,8 @@ extension GameType {
if self == .ns ||
self == .xbox360 ||
self == .xbox ||
- self == .ps2 {
+ self == .ps2 ||
+ self == .wiiu {
return true
}
return false
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift
index e6a661c4..9268849a 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/EmulatorInteractionKit.swift
@@ -18,7 +18,7 @@ extension GameType {
struct EmulatorInteractionKit {
enum EmulatorType {
- case meloNX, xeniOS, dukeX, armsx2
+ case meloNX, xeniOS, dukeX, armsx2, melocafe
}
/// Display name plus the public URL scheme. Extra ARMSX2 aliases stay in `supportedLaunchSchemes`.
@@ -102,6 +102,8 @@ struct EmulatorInteractionKit {
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")!)
+ case .melocafe:
+ return UIApplication.shared.canOpenURL(R.URLs.FetchMeloCafeGames)
}
}
@@ -116,6 +118,8 @@ struct EmulatorInteractionKit {
UIApplication.shared.open(R.URLs.DukeXGameLaunch(gameId: id))
case .armsx2:
UIApplication.shared.open(R.URLs.ARMSX2GameLaunch(gameId: id))
+ case .melocafe:
+ UIApplication.shared.open(R.URLs.MeloCafeGameLaunch(gameId: id))
}
} else {
DispatchQueue.main.asyncAfter(delay: 0.35) {
@@ -128,6 +132,8 @@ struct EmulatorInteractionKit {
UIView.makeToast(message: R.string.localizable.notInstall("DukeX"))
case .armsx2:
UIView.makeToast(message: R.string.localizable.notInstall("ARMSX2"))
+ case .melocafe:
+ UIView.makeToast(message: R.string.localizable.notInstall("MeloCafe"))
}
}
}
@@ -144,6 +150,8 @@ struct EmulatorInteractionKit {
UIApplication.shared.open(R.URLs.FetchDukeXGames)
case .armsx2:
UIApplication.shared.open(R.URLs.FetchARMSX2Games)
+ case .melocafe:
+ UIApplication.shared.open(R.URLs.FetchMeloCafeGames)
}
} else {
@@ -156,6 +164,8 @@ struct EmulatorInteractionKit {
UIView.makeToast(message: R.string.localizable.notInstall("DukeX"))
case .armsx2:
UIView.makeToast(message: R.string.localizable.notInstall("ARMSX2"))
+ case .melocafe:
+ UIView.makeToast(message: R.string.localizable.notInstall("MeloCafe"))
}
}
}
@@ -173,7 +183,7 @@ struct EmulatorInteractionKit {
let realm = Database.realm
for mg in fromGames {
if let _ = realm.object(ofType: Game.self, forPrimaryKey: mg.titleId) {
- Log.debug("MeloNX游戏已存在:\(mg.titleId) \(mg.titleName)")
+ Log.debug("External game already exists: \(mg.titleId) \(mg.titleName)")
} else {
let game = Game()
switch type {
@@ -190,6 +200,11 @@ struct EmulatorInteractionKit {
let ext = URL(fileURLWithPath: mg.titleId).pathExtension.lowercased()
game.fileExtension = ext.isEmpty ? "iso" : ext
game.gameType = .ps2
+ case .melocafe:
+ // Launch key is the decimal title id. Extension is only for the library row.
+ let ext = mg.fileExtension.lowercased()
+ game.fileExtension = ext.isEmpty ? "wua" : ext
+ game.gameType = .wiiu
}
game.id = mg.titleId
game.name = mg.titleName
@@ -216,6 +231,8 @@ struct EmulatorInteractionKit {
UIView.makeToast(message: R.string.localizable.biosImportSuccess("DukeX Games"))
case .armsx2:
UIView.makeToast(message: R.string.localizable.biosImportSuccess("ARMSX2 Games"))
+ case .melocafe:
+ UIView.makeToast(message: R.string.localizable.biosImportSuccess("MeloCafe Games"))
}
}
}
@@ -231,14 +248,25 @@ struct GameScheme: Codable, Identifiable, Equatable, Hashable, Sendable {
var developer: String
var version: String
var iconData: Data?
+ /// Set when the callback is MeloCafe's `GameInfoSwift` list. Not part of the shared JSON.
+ var fileExtension: String = ""
+
+ enum CodingKeys: String, CodingKey {
+ case id, titleName, titleId, developer, version, iconData
+ }
static func pullFromURL(_ url: URL) -> [GameScheme] {
if let components = URLComponents(url: url, resolvingAgainstBaseURL: true) {
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
+ let data = GameScheme.base64URLDecode(text) {
+ if let decoded = try? JSONDecoder().decode([GameScheme].self, from: data) {
+ return decoded
+ }
+ // MeloCafe sends `[GameInfoSwift]` (`id`, `title`, `path`, `icon`).
+ if let library = try? JSONDecoder().decode([MeloCafeGame].self, from: data) {
+ return library.map(\.gameScheme)
+ }
}
// ARMSX2 sends `payload` wrapping `{ games: [{ title, fileName, ... }] }`.
if let text = items.first(where: { $0.name == "payload" })?.value,
@@ -261,6 +289,31 @@ struct GameScheme: Codable, Identifiable, Equatable, Hashable, Sendable {
}
}
+/// MeloCafe `GameInfoSwift`. Launch key is the decimal `id` (`melocafe://game?id=`).
+private struct MeloCafeGame: Decodable {
+ let id: UInt64
+ let title: String
+ let path: String
+ let icon: Data
+
+ var gameScheme: GameScheme {
+ let trimmedTitle = title.trimmingCharacters(in: .whitespacesAndNewlines)
+ let fileURL = URL(fileURLWithPath: path)
+ let titleName = trimmedTitle.isEmpty
+ ? fileURL.deletingPathExtension().lastPathComponent
+ : trimmedTitle
+ return GameScheme(
+ id: String(id),
+ titleName: titleName,
+ titleId: String(id),
+ developer: "",
+ version: "1.0",
+ iconData: icon.isEmpty ? nil : icon,
+ fileExtension: fileURL.pathExtension
+ )
+ }
+}
+
/// ARMSX2 `com.armsx2.library.v1` callback body. Launch key is `fileName`.
private struct ARMSX2Library: Decodable {
let games: [ARMSX2Game]
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift
index 6bce0e34..5cf4db2a 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift
@@ -473,9 +473,20 @@ extension FilesImporter {
var ciaTitleUrl: URL? = nil
let originalUrl = url
var url = url
+ var encrypted3DSROM = false
#if !SIMULATOR
var threeDSGameInfo: CitraGameInformation? = nil
if FileType.get3DSExtensions().contains([url.pathExtension.lowercased()]) {
+ if ThreeDS.isEncryptedROM(at: url) {
+ // Azahar cannot run encrypted ROMs, so this import stays on Citra.
+ encrypted3DSROM = true
+ }
+ if encrypted3DSROM, !ThreeDS.hasAesKeys {
+ Log.debug("Encrypted 3DS ROM imported without aes_keys.txt")
+ Self.discardRommPending(fileName: originalUrl.lastPathComponent)
+ completion?(nil, nil, .decryptFailed(fileName: url.lastPathComponent))
+ return
+ }
if url.pathExtension.lowercased() == "cia" {
Log.debug("开始安装")
let status = CitraCore.shared().importGame(at: url)
@@ -677,6 +688,9 @@ extension FilesImporter {
Log.debug("[FilesImporter] using \(globalCoreSwitch.getUsingCoreName(gameType: gameType) ?? "Unknown")(\(index)) core for \(gameType.localizedShortName)")
game.defaultCore = index
}
+ if encrypted3DSROM {
+ game.defaultCore = 0
+ }
//j2me
if game.gameType == .j2me, let j2MEManifest = J2MEManifest.read(from: url.path) {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift
index 69cdd6e55..886e493b 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift
@@ -186,6 +186,8 @@ class OnlineCoverManager {
boxArtUrl = host.appendingPathComponent("Commodore - 64/Named_Boxarts")
case .amiga:
boxArtUrl = host.appendingPathComponent("Commodore - Amiga/Named_Boxarts")
+ case .wiiu:
+ boxArtUrl = host.appendingPathComponent("Nintendo - Wii U/Named_Boxarts")
default:
boxArtUrl = nil
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/ResourcesKit.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/ResourcesKit.swift
index fd0c1a48..69290e79 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/ResourcesKit.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/ResourcesKit.swift
@@ -118,7 +118,6 @@ struct ResourcesKit {
Log.debug("资源解压结束:\(Date.now.timeIntervalSince1970ms)")
completion?(isSuccess)
if isSuccess {
- try? FileManager.safeCopyItem(at: URL(fileURLWithPath: R.Path.Resource.appendingPathComponent("aes_keys.txt")), to: URL(fileURLWithPath: R.Path.ThreeDSSystemData.appendingPathComponent("aes_keys.txt")), shouldReplace: true)
try? FileManager.safeCopyItem(at: URL(fileURLWithPath: R.Path.Resource.appendingPathComponent("seeddb.bin")), to: URL(fileURLWithPath: R.Path.ThreeDSSystemData.appendingPathComponent("seeddb.bin")), shouldReplace: true)
try? FileManager.safeCopyItem(at: URL(fileURLWithPath: R.Path.Resource.appendingPathComponent("shared_font.bin")), to: URL(fileURLWithPath: R.Path.ThreeDSSystemData.appendingPathComponent("shared_font.bin")), shouldReplace: true)
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift
index 0557ae6c..e8a7a936 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 wiiu
case flash
case wsc
case ps2
@@ -171,6 +172,7 @@ extension System {
case .ps2: return .ps2
case .wsc: return .wsc
case .flash: return .flash
+ case .wiiu: return .wiiu
}
}
}
diff --git a/System.core/3DS.ini b/System.core/3DS.ini
index 7f09f9ac..d72d42de 100644
--- a/System.core/3DS.ini
+++ b/System.core/3DS.ini
@@ -3,6 +3,10 @@
# 0(default): Interpreter (slow), 1: JIT (fast)
use_cpu_jit=0
+# Interpreter used when use_cpu_jit is 0
+# 0: DynCom, 1 (default): FastInterp
+use_fastinterp=1
+
# Change the Clock Frequency of the emulated 3DS CPU.
# Underclocking can increase the performance of the game at the risk of freezing.
# Overclocking may fix lag that happens on console, but also comes with the risk of freezing.
@@ -193,4 +197,4 @@ camera_outer_left_flip=0
# The image flip to apply
# 0: None (default), 1: Horizontal, 2: Vertical, 3: Reverse
-camera_inner_flip=0
\ No newline at end of file
+camera_inner_flip=0
diff --git a/System.core/Nimbus210/cias/nimbus.cia b/System.core/Nimbus210/cias/nimbus.cia
deleted file mode 100644
index e410f699..00000000
Binary files a/System.core/Nimbus210/cias/nimbus.cia and /dev/null differ
diff --git a/System.core/Nimbus210/3ds/nimbus/update/000400300000BC02.ips b/System.core/Nimbus220/3ds/nimbus/update/000400300000BC02.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/000400300000BC02.ips
rename to System.core/Nimbus220/3ds/nimbus/update/000400300000BC02.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/000400300000BD02.ips b/System.core/Nimbus220/3ds/nimbus/update/000400300000BD02.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/000400300000BD02.ips
rename to System.core/Nimbus220/3ds/nimbus/update/000400300000BD02.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/000400300000BE02.ips b/System.core/Nimbus220/3ds/nimbus/update/000400300000BE02.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/000400300000BE02.ips
rename to System.core/Nimbus220/3ds/nimbus/update/000400300000BE02.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/0004013000002902.ips b/System.core/Nimbus220/3ds/nimbus/update/0004013000002902.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/0004013000002902.ips
rename to System.core/Nimbus220/3ds/nimbus/update/0004013000002902.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/0004013000002E02.ips b/System.core/Nimbus220/3ds/nimbus/update/0004013000002E02.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/0004013000002E02.ips
rename to System.core/Nimbus220/3ds/nimbus/update/0004013000002E02.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/0004013000002F02.ips b/System.core/Nimbus220/3ds/nimbus/update/0004013000002F02.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/0004013000002F02.ips
rename to System.core/Nimbus220/3ds/nimbus/update/0004013000002F02.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/0004013000003202.ips b/System.core/Nimbus220/3ds/nimbus/update/0004013000003202.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/0004013000003202.ips
rename to System.core/Nimbus220/3ds/nimbus/update/0004013000003202.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/0004013000003802.ips b/System.core/Nimbus220/3ds/nimbus/update/0004013000003802.ips
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/0004013000003802.ips
rename to System.core/Nimbus220/3ds/nimbus/update/0004013000003802.ips
diff --git a/System.core/Nimbus210/3ds/nimbus/update/juxt-prod.pem b/System.core/Nimbus220/3ds/nimbus/update/juxt-prod.pem
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/juxt-prod.pem
rename to System.core/Nimbus220/3ds/nimbus/update/juxt-prod.pem
diff --git a/System.core/Nimbus210/3ds/nimbus/update/nimbus.3gx b/System.core/Nimbus220/3ds/nimbus/update/nimbus.3gx
similarity index 50%
rename from System.core/Nimbus210/3ds/nimbus/update/nimbus.3gx
rename to System.core/Nimbus220/3ds/nimbus/update/nimbus.3gx
index f4ca927a..daea7b7b 100644
Binary files a/System.core/Nimbus210/3ds/nimbus/update/nimbus.3gx and b/System.core/Nimbus220/3ds/nimbus/update/nimbus.3gx differ
diff --git a/System.core/Nimbus210/3ds/nimbus/update/update.txt b/System.core/Nimbus220/3ds/nimbus/update/update.txt
similarity index 100%
rename from System.core/Nimbus210/3ds/nimbus/update/update.txt
rename to System.core/Nimbus220/3ds/nimbus/update/update.txt
diff --git a/System.core/Nimbus220/cias/nimbus.cia b/System.core/Nimbus220/cias/nimbus.cia
new file mode 100644
index 00000000..69ebf285
Binary files /dev/null and b/System.core/Nimbus220/cias/nimbus.cia differ
diff --git a/System.core/aes_keys.txt b/System.core/aes_keys.txt
deleted file mode 100644
index e6f53c67..00000000
--- a/System.core/aes_keys.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-generator=1FF9E9AAC5FE0408024591DC5D52768A
-# load encryption game
-slot0x18KeyX=82E9C9BEBFB8BDB875ECC0A07D474374
-slot0x1BKeyX=45AD04953992C7C893724A9A7BCE6182
-slot0x1BKeyN=5DDD4739037BC6A870E620B70F673504
-slot0x25KeyX=CEE7D8AB30C00DAE850EF5E382AC5AF3
-slot0x2CKeyX=B98E95CECA3E4D171F76A94DE934C053
-# share Mii via QR code between Citra and 3DS
-slot0x2DKeyX=B98E95CECA3E4D171F76A94DE934C053
-slot0x2DKeyY=80C4E824F2FA5FD515CC2D96F44A2681
-slot0x2DKeyN=3ED6F5CF2CC37C54655000B7C8B52E0D
-# generate accurate UDS data frames
-slot0x31KeyX=C66E23128F289133F04CDB877A3749F2
-slot0x31KeyY=7462553F9E5A7904B8647CCA736DA1F5
-slot0x31KeyN=59FC817E6446EA6190347B20E9BDCE52
-# install encrypted CIA
-slot0x3DKeyX=617085719B7CFB316DF4DF2E8362C6E2
-# Friend
-slot0x36KeyX=6FBB01F872CAF9C01834EEC04065EE53
-slot0x36KeyN=28C0D59B736657BCDF50FF174979958A
-# StreetPass
-slot0x2EKeyX=B98E95CECA3E4D171F76A94DE934C053
-slot0x2EKeyY=7462553F9E5A7904B8647CCA736DA1F5
-slot0x2EKeyN=3ED6F5CF2CC37C54655000B7C8B52E0D
-# BOSS
-slot0x38KeyX=B529221CDDB5DB5A1BF26EFF2041E875
-slot0x38KeyN=6E78A3BE9BDDDA09BFD569483F24FCE0
-# ssl cert
-slot0x0DKeyN=E7C9FF9D4F5B6F4DC5E2F50E856F0AB2
-# common
-common0=D07B337F9CA4385932A2E25723232EB9
-common1=0C767230F0998F1C46828202FAACBE4C
-common2=C475CB3AB8C788BB575E12A10907B8A4
-common3=E486EEE3D0C09C902F6686D4C06F649F
-common4=ED31BA9C04B067506C4497A35B7804FC
-common5=5E66998AB4E8931606850FD7A16DD755
-common0N=64C5FD55DD3AD988325BAAEC5243DB98
-common1N=4AAA3D0E27D4D728D0B1B433F0F9CBC8
-common2N=FBB0EF8CDBB0D8E453CD99344371697F
-common3N=25959B7AD0409F72684198BA2ECD7DC6
-common4N=7ADA22CAFFC476CC8297A0C7CEEEEEBE
-common5N=A5051CA1B37DCF3AFBCF8CC1EDD9CE02
\ No newline at end of file