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

v1.8.3

Daiunoe0a3cd7e1d5b
diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme
index c03c91b3..afc6f72d 100644
--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme
+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme
@@ -82,7 +82,7 @@
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
- buildConfiguration = "SideloadRelease"
+ buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
diff --git a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
index bbd36f84..95c3e0a4 100644
--- a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
+++ b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
@@ -11,5 +11,5 @@
// https://help.apple.com/xcode/#/dev745c5c974
APP_BUNDLE_IDENTIFIER = com.aoshuang.manicemu
-APP_BUILD_VERSION = 0
+APP_BUILD_VERSION = 2
APP_VERSION = 1.8.3
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift
index a32dfb8c..121ba63c 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift
@@ -275,7 +275,7 @@ extension JGenesisView {
try {
console.log('🔄 开始加载 Sega CD 文件: \(fileName)');
- // 加载 ROM 文件
+ // 加载 ROM 文件(直接保持为 Uint8Array,避免 Array.from() 导致的内存膨胀)
const romResponse = await fetch('\(romURL)');
if (!romResponse.ok) {
console.log('ROM Download error:' + romResponse.status);
@@ -285,7 +285,7 @@ extension JGenesisView {
const romBytes = new Uint8Array(romBuffer);
console.log('📦 ROM 文件大小:', romBytes.length, 'bytes');
- // 加载 BIOS 文件
+ // 加载 BIOS 文件(BIOS 文件较小,使用 Uint8Array)
let americasBiosBytes = null;
let japanBiosBytes = null;
let europeBiosBytes = null;
@@ -339,19 +339,14 @@ extension JGenesisView {
throw new Error('No Sega CD BIOS available');
}
- // 调用 WASM 端的方法来加载 Sega CD ROM 和 BIOS
- const romVec = Array.from(romBytes);
- const americasBiosVec = americasBiosBytes ? Array.from(americasBiosBytes) : null;
- const japanBiosVec = japanBiosBytes ? Array.from(japanBiosBytes) : null;
- const europeBiosVec = europeBiosBytes ? Array.from(europeBiosBytes) : null;
-
- console.log('✅ 调用 channel.load_sega_cd_file');
- window.jgenesisAPI.channel.load_sega_cd_file(
- romVec,
+ // 调用 openSegaCdFile API(ROM 直接传递 Uint8Array,避免内存膨胀)
+ console.log('✅ 调用 window.jgenesisAPI.openSegaCdFile');
+ window.jgenesisAPI.openSegaCdFile(
+ romBytes,
'\(fileName)',
- americasBiosVec,
- japanBiosVec,
- europeBiosVec
+ americasBiosBytes,
+ japanBiosBytes,
+ europeBiosBytes
);
console.log('✅ Sega CD 文件加载成功: \(fileName)');
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
index 226a7f7b..ad7e0c6e 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
@@ -3490,7 +3490,7 @@ extension PlayViewController {
}
}
} else if self.manicGame.gameType == .mcd {
- DispatchQueue.main.asyncAfter(delay: 4) {
+ DispatchQueue.main.asyncAfter(delay: 3) {
let biosPaths = Constants.BIOS.MegaCDBios.map({ Constants.Path.System.appendingPathComponent($0.fileName) })
self.jGenesisCore?.openSegaCdFile(filePath: self.manicGame.romUrl.path, americasBiosPath: biosPaths[1], japanBiosPath: biosPaths[2], europeBiosPath: biosPaths[0])
DispatchQueue.main.asyncAfter(delay: 5) {
diff --git a/ManicSupport/Resources/System.core b/ManicSupport/Resources/System.core
index 1a3c8a22..fc240995 100644
--- a/ManicSupport/Resources/System.core
+++ b/ManicSupport/Resources/System.core
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:0ca365cfbcf4e0dec8404d24a45d26b453695eccd7bee94db36fe3ec8b81859b
-size 59302197
+oid sha256:4632ff0f1ff2c8693357bea096dd964abf4e90626c16952cf55479001b7ac013
+size 59303666