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

Added Atari console support; new core for CD 32X; improved 3DS drivers; added DeSmume core support for NDS; optimized cheat code and shaders.

Daiunof976b2445738
diff --git a/.gitignore b/.gitignore
index d3e96836..5fd7a115 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,11 @@ xcuserdata/
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout
+Cores/jgenesis
+Cores/libretro-desmume
+Cores/libretro-melondsds
+Cores/libretro-ppsspp
+Cores/libretro-azahar
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
diff --git a/Cores/Citra/Core/audio_core/input_details.cpp b/Cores/Citra/Core/audio_core/input_details.cpp
index e98310d3..ee110808 100644
--- a/Cores/Citra/Core/audio_core/input_details.cpp
+++ b/Cores/Citra/Core/audio_core/input_details.cpp
@@ -9,6 +9,9 @@
#include "audio_core/input_details.h"
#include "audio_core/null_input.h"
#include "audio_core/static_input.h"
+#if defined(__LIBRETRO__) || defined(HAVE_LIBRETRO)
+#include "citra_libretro/audio/libretro_input.h"
+#endif
#ifdef HAVE_CUBEB
#include "audio_core/cubeb_input.h"
#endif
@@ -22,7 +25,18 @@ namespace AudioCore {
namespace {
// input_details is ordered in terms of desirability, with the best choice at the top.
constexpr std::array input_details = {
-#ifdef HAVE_CUBEB
+#if defined(__LIBRETRO__) || defined(HAVE_LIBRETRO)
+ InputDetails{InputType::Cubeb, "Real Device (LibRetro)", true,
+ [](Core::System& system, std::string_view device_id) -> std::unique_ptr<Input> {
+ if (!system.HasMicPermission()) {
+ LOG_WARNING(Audio,
+ "Microphone permission denied, falling back to null input.");
+ return std::make_unique<NullInput>();
+ }
+ return std::make_unique<LibRetro::Audio::LibRetroInput>();
+ },
+ [] { return std::vector<std::string>{"Default"}; }},
+#elif defined(HAVE_CUBEB)
InputDetails{InputType::Cubeb, "Real Device (Cubeb)", true,
[](Core::System& system, std::string_view device_id) -> std::unique_ptr<Input> {
if (!system.HasMicPermission()) {
diff --git a/Cores/Citra/Core/audio_core/openal_input.cpp b/Cores/Citra/Core/audio_core/openal_input.mm
similarity index 52%
rename from Cores/Citra/Core/audio_core/openal_input.cpp
rename to Cores/Citra/Core/audio_core/openal_input.mm
index 935b1645..0c349228 100644
--- a/Cores/Citra/Core/audio_core/openal_input.cpp
+++ b/Cores/Citra/Core/audio_core/openal_input.mm
@@ -11,6 +11,42 @@
#include "audio_core/sink.h"
#include "common/logging/log.h"
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <AVFoundation/AVFoundation.h>
+
+// iOS 特定的音频会话配置
+static bool ConfigureIOSAudioSessionForCapture() {
+ @autoreleasepool {
+ AVAudioSession* session = [AVAudioSession sharedInstance];
+ NSError* error = nil;
+
+ // 设置音频会话类别为 PlayAndRecord,这是捕获音频所必需的
+ BOOL success = [session setCategory:AVAudioSessionCategoryPlayAndRecord
+ mode:AVAudioSessionModeDefault
+ options:AVAudioSessionCategoryOptionDefaultToSpeaker |
+ AVAudioSessionCategoryOptionAllowBluetooth
+ error:&error];
+ if (!success || error) {
+ NSLog(@"Failed to set audio session category: %@", error);
+ return false;
+ }
+
+ // 激活音频会话
+ success = [session setActive:YES error:&error];
+ if (!success || error) {
+ NSLog(@"Failed to activate audio session: %@", error);
+ return false;
+ }
+
+ NSLog(@"Successfully configured iOS audio session for capture");
+ return true;
+ }
+}
+#endif
+#endif
+
namespace AudioCore {
struct OpenALInput::Impl {
@@ -30,6 +66,16 @@ void OpenALInput::StartSampling(const InputParameters& params) {
return;
}
+#ifdef __APPLE__
+#if TARGET_OS_IOS || TARGET_OS_TV
+ // iOS 必须在打开捕获设备之前配置音频会话
+ if (!ConfigureIOSAudioSessionForCapture()) {
+ LOG_CRITICAL(Audio, "Failed to configure iOS audio session for capture");
+ return;
+ }
+#endif
+#endif
+
// OpenAL supports unsigned 8-bit and signed 16-bit PCM.
// TODO: Re-sample the stream.
if ((params.sample_size == 8 && params.sign == Signedness::Signed) ||
@@ -42,12 +88,49 @@ void OpenALInput::StartSampling(const InputParameters& params) {
impl->sample_size_in_bytes = params.sample_size / 8;
auto format = params.sample_size == 16 ? AL_FORMAT_MONO16 : AL_FORMAT_MONO8;
+
+ // iOS 特殊处理:列出可用的捕获设备并记录调试信息
+ const char* default_device = nullptr;
+ if (alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT") != AL_FALSE) {
+ default_device = alcGetString(nullptr, ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER);
+ LOG_INFO(Audio, "Default capture device: {}", default_device ? default_device : "null");
+
+ const char* devices_str = alcGetString(nullptr, ALC_CAPTURE_DEVICE_SPECIFIER);
+ if (devices_str && *devices_str != '\0') {
+ LOG_INFO(Audio, "Available capture devices:");
+ while (*devices_str != '\0') {
+ LOG_INFO(Audio, " - {}", devices_str);
+ devices_str += strlen(devices_str) + 1;
+ }
+ } else {
+ LOG_WARNING(Audio, "No capture devices enumerated");
+ }
+ } else {
+ LOG_WARNING(Audio, "ALC_ENUMERATION_EXT not present");
+ }
+
+ // 对于 iOS,强制使用默认设备(nullptr)而不是 "auto" 字符串
+ // iOS 上的 OpenAL Soft 不接受任何设备名称字符串,必须使用 nullptr
+ const char* device_name = nullptr;
+ #if !defined(__APPLE__) || defined(__MACOSX)
+ // 仅在非 iOS 平台上使用指定的设备名称
+ if (device_id != auto_device_name && !device_id.empty()) {
+ device_name = device_id.c_str();
+ }
+ #endif
+
+ LOG_INFO(Audio, "Attempting to open capture device with name: {}, sample_rate: {}, format: {}, buffer_size: {}",
+ device_name ? device_name : "nullptr (default)",
+ params.sample_rate,
+ format == AL_FORMAT_MONO16 ? "MONO16" : "MONO8",
+ params.buffer_size);
+
impl->device = alcCaptureOpenDevice(
- device_id != auto_device_name && !device_id.empty() ? device_id.c_str() : nullptr,
+ device_name,
params.sample_rate, format, static_cast<ALsizei>(params.buffer_size));
auto open_error = alcGetError(impl->device);
if (impl->device == nullptr || open_error != ALC_NO_ERROR) {
- LOG_CRITICAL(Audio, "alcCaptureOpenDevice failed: {}", open_error);
+ LOG_CRITICAL(Audio, "alcCaptureOpenDevice failed: error code {:#x}", open_error);
StopSampling();
return;
}
@@ -55,10 +138,12 @@ void OpenALInput::StartSampling(const InputParameters& params) {
alcCaptureStart(impl->device);
auto capture_error = alcGetError(impl->device);
if (capture_error != ALC_NO_ERROR) {
- LOG_CRITICAL(Audio, "alcCaptureStart failed: {}", capture_error);
+ LOG_CRITICAL(Audio, "alcCaptureStart failed: error code {:#x}", capture_error);
StopSampling();
return;
}
+
+ LOG_INFO(Audio, "Successfully started audio capture");
}
void OpenALInput::StopSampling() {
diff --git a/Cores/DeltaCore/DeltaCore/Model/ControllerSkin.swift b/Cores/DeltaCore/DeltaCore/Model/ControllerSkin.swift
index d3154351..cf241bfb 100644
--- a/Cores/DeltaCore/DeltaCore/Model/ControllerSkin.swift
+++ b/Cores/DeltaCore/DeltaCore/Model/ControllerSkin.swift
@@ -99,9 +99,9 @@ public struct ControllerSkin: ControllerSkinBase
let representationsDictionary = info["representations"] as? RepresentationDictionary
else { return nil }
- #if FRAMEWORK || SWIFT_PACKAGE
+#if FRAMEWORK || SWIFT_PACKAGE
guard let gameType = info["gameTypeIdentifier"] as? GameType else { return nil }
- #else
+#else
guard var gameTypeString = info["gameTypeIdentifier"] as? String else { return nil }
var gameType: GameType
if gameTypeString == "com.rileytestut.delta.game.genesis" {
@@ -118,7 +118,7 @@ public struct ControllerSkin: ControllerSkinBase
}
}
- #endif
+#endif
self.name = name
self.identifier = identifier
@@ -297,14 +297,14 @@ public extension ControllerSkin
case .medium:
// First, attempt to load a medium image
if let image = self.image(for: representation, assetSize: AssetSize(size: .medium)) { returnedImage = image }
-
- // If a medium image doesn't exist, fallback to trying to load a medium resizable image
+
+ // If a medium image doesn't exist, fallback to trying to load a medium resizable image
else if let image = self.image(for: representation, assetSize: AssetSize(size: .medium, resizable: true)) { returnedImage = image }
-
- // If neither medium nor resizable exists, check for a large image (because downscaling large is better than upscaling small)
+
+ // If neither medium nor resizable exists, check for a large image (because downscaling large is better than upscaling small)
else if let image = self.image(for: representation, assetSize: AssetSize(size: .large)) { returnedImage = image }
-
- // If still no images exist, finally check the small image size
+
+ // If still no images exist, finally check the small image size
else if let image = self.image(for: representation, assetSize: AssetSize(size: .small)) { returnedImage = image }
case .large:
@@ -390,6 +390,44 @@ public extension ControllerSkin
guard let representation = self.representation(for: traits) else { return nil }
return representation.menuInsets
}
+
+ public func switchView(for item: Item, traits: Traits, onImageSize: CGSize, offImageSize: CGSize) -> (UIImage?, UIImage?)? {
+ guard let representation = self.representation(for: traits) else { return nil }
+ var onImage: UIImage? = nil
+ var offImage: UIImage? = nil
+ var animation: ControllerSkin.Item.Animation? = nil
+
+ if case let .switch(onImageStr, offImageStr) = item.asset {
+ if let onImageStr, let entry = self.archive[onImageStr], let data = try? self.archive.extract(entry) {
+ switch (onImageStr as NSString).pathExtension.lowercased() {
+ case "pdf":
+ onImage = UIImage.image(withPDFData: data, targetSize: onImageSize)
+
+ default:
+ onImage = UIImage(data: data, scale: 1.0)
+ }
+ }
+
+ if let offImageStr, let entry = self.archive[offImageStr], let data = try? self.archive.extract(entry) {
+ switch (offImageStr as NSString).pathExtension.lowercased() {
+ case "pdf":
+ offImage = UIImage.image(withPDFData: data, targetSize: offImageSize)
+
+ default:
+ offImage = UIImage(data: data, scale: 1.0)
+ }
+ }
+ }
+ if onImage == nil, offImage == nil {
+ return nil
+ } else if onImage == nil {
+ return (offImage, offImage)
+ } else if offImage == nil {
+ return (onImage, onImage)
+ } else {
+ return (onImage, offImage)
+ }
+ }
}
private extension ControllerSkin
@@ -456,6 +494,7 @@ extension ControllerSkin
case dPad
case thumbstick
case touchScreen
+ case switchButton
}
public enum Inputs
@@ -463,6 +502,7 @@ extension ControllerSkin
case standard([Input])
case directional(up: Input, down: Input, left: Input, right: Input)
case touch(x: Input, y: Input)
+ case `switch`(Input)
public var allInputs: [Input] {
switch self
@@ -470,6 +510,7 @@ extension ControllerSkin
case .standard(let inputs): return inputs
case let .directional(up, down, left, right): return [up, down, left, right]
case let .touch(x, y): return [x, y]
+ case .switch(let input): return [input]
}
}
}
@@ -477,7 +518,18 @@ extension ControllerSkin
public enum Asset {
case button(normal: String?, selected: String?)
case dpad(normal: String?)
+ case `switch`(on: String?, off: String?)
+ }
+
+ public struct Animation {
+ var type: String
+ var begin: CGRect
+ var end: CGRect
}
+ public var animation: Animation?
+
+ //switch
+ public var selfRetracting: Bool = true
public var asset: Asset?
@@ -505,7 +557,7 @@ extension ControllerSkin
if let inputs = dictionary["inputs"] as? [String]
{
self.kind = .button
- self.inputs = .standard(inputs.map { SomeInput(stringValue: $0, intValue: nil, type: .controller(.controllerSkin)) })
+ self.inputs = .standard(inputs.map { SomeInput(stringValue: $0, intValue: nil, type: .controller(.controllerSkin), itemID: id) })
}
else if let inputs = dictionary["inputs"] as? [String: String]
{
@@ -531,27 +583,43 @@ extension ControllerSkin
isContinuous = false
}
- self.inputs = .directional(up: SomeInput(stringValue: up, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous),
- down: SomeInput(stringValue: down, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous),
- left: SomeInput(stringValue: left, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous),
- right: SomeInput(stringValue: right, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous))
+ self.inputs = .directional(up: SomeInput(stringValue: up, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous, itemID: id),
+ down: SomeInput(stringValue: down, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous, itemID: id),
+ left: SomeInput(stringValue: left, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous, itemID: id),
+ right: SomeInput(stringValue: right, intValue: nil, type: .controller(.controllerSkin), isContinuous: isContinuous, itemID: id))
}
else if let x = inputs["x"], let y = inputs["y"]
{
self.kind = .touchScreen
- self.inputs = .touch(x: SomeInput(stringValue: x, intValue: nil, type: .controller(.controllerSkin), isContinuous: true),
- y: SomeInput(stringValue: y, intValue: nil, type: .controller(.controllerSkin), isContinuous: true))
+ self.inputs = .touch(x: SomeInput(stringValue: x, intValue: nil, type: .controller(.controllerSkin), isContinuous: true, itemID: id),
+ y: SomeInput(stringValue: y, intValue: nil, type: .controller(.controllerSkin), isContinuous: true, itemID: id))
}
else
{
return nil
}
}
+ else if let input = dictionary["inputs"] as? String {
+ self.kind = .switchButton
+ self.inputs = .switch(SomeInput(stringValue: input, intValue: nil, type: .controller(.controllerSkin), itemID: id))
+ self.selfRetracting = (dictionary["selfRetracting"] as? Bool) ?? true
+ }
else
{
return nil
}
+ //获取动画配置
+ var tempAnimation: Animation? = nil
+ if let animation = dictionary["animation"] as? [String: Any],
+ let type = animation["type"] as? String,
+ let begin = animation["begin"] as? [String: CGFloat],
+ let beginRect = CGRect(dictionary: begin),
+ let end = animation["end"] as? [String: CGFloat],
+ let endRect = CGRect(dictionary: end) {
+ tempAnimation = Animation(type: type, begin: beginRect, end: endRect)
+ }
+
let overrideExtendedEdges = ExtendedEdges(dictionary: dictionary["extendedEdges"] as? [String: CGFloat])
var extendedEdges = extendedEdges
@@ -583,11 +651,17 @@ extension ControllerSkin
let scaleTransform = CGAffineTransform(scaleX: 1.0 / mappingSize.width, y: 1.0 / mappingSize.height)
self.frame = frame.applying(scaleTransform)
self.extendedFrame = extendedFrame.applying(scaleTransform)
+ if var tempAnimation {
+ tempAnimation.begin = tempAnimation.begin.applying(scaleTransform)
+ tempAnimation.end = tempAnimation.end.applying(scaleTransform)
+ self.animation = tempAnimation
+ }
case .app:
// `app` placement already uses relative values.
self.frame = frame
self.extendedFrame = extendedFrame
+ self.animation = tempAnimation
}
}
}
@@ -617,6 +691,7 @@ extension ControllerSkin.Item: Hashable
case .dPad: hasher.combine(1)
case .thumbstick: hasher.combine(2)
case .touchScreen: hasher.combine(3)
+ case .switchButton: hasher.combine(4)
}
hasher.combine(self.thumbstickImageName)
@@ -853,12 +928,14 @@ private extension ControllerSkin
let itemID = ControllerSkin.itemID(forSkinID: skinID, traits: traits, index: index)
if var item = Item(id: itemID, dictionary: dictionary, extendedEdges: extendedEdges, mappingSize: mappingSize)
{
- //添加按压效果的素材
if let assetDic = dictionary["asset"] as? [String: String] {
+ //添加按压效果的素材
if item.kind == .button {
item.asset = .button(normal: assetDic["normal"] ?? nil, selected: assetDic["selected"] ?? nil)
} else if item.kind == .dPad {
item.asset = .dpad(normal: assetDic["normal"] ?? nil)
+ } else if item.kind == .switchButton {
+ item.asset = .switch(on: assetDic["selected"], off: assetDic["normal"])
}
}
items.append(item)
@@ -994,7 +1071,7 @@ private extension ControllerSkin
let value = NSValue(cgAffineTransform: transform)
mappedValue = value
-
+
default: continue
}
diff --git a/Cores/DeltaCore/DeltaCore/Model/Inputs/SomeInput.swift b/Cores/DeltaCore/DeltaCore/Model/Inputs/SomeInput.swift
index 01aca3b8..00a4a269 100644
--- a/Cores/DeltaCore/DeltaCore/Model/Inputs/SomeInput.swift
+++ b/Cores/DeltaCore/DeltaCore/Model/Inputs/SomeInput.swift
@@ -12,19 +12,21 @@ public struct SomeInput: Input, Codable, Hashable
{
public let stringValue: String
public let intValue: Int?
+ public var itemID: String? = nil
public var type: InputType
public var isContinuous: Bool
public init(_ input: Input)
{
- self.init(stringValue: input.stringValue, intValue: input.intValue, type: input.type, isContinuous: input.isContinuous)
+ self.init(stringValue: input.stringValue, intValue: input.intValue, type: input.type, isContinuous: input.isContinuous, itemID: (input as? SomeInput)?.itemID )
}
- public init(stringValue: String, intValue: Int?, type: InputType, isContinuous: Bool? = nil)
+ public init(stringValue: String, intValue: Int?, type: InputType, isContinuous: Bool? = nil, itemID: String? = nil)
{
self.stringValue = stringValue
self.intValue = intValue
+ self.itemID = itemID
self.type = type
self.isContinuous = false
diff --git a/Cores/DeltaCore/DeltaCore/Model/Inputs/StandardGameControllerInput.swift b/Cores/DeltaCore/DeltaCore/Model/Inputs/StandardGameControllerInput.swift
index 14dbdb9d..2c2404f1 100644
--- a/Cores/DeltaCore/DeltaCore/Model/Inputs/StandardGameControllerInput.swift
+++ b/Cores/DeltaCore/DeltaCore/Model/Inputs/StandardGameControllerInput.swift
@@ -22,8 +22,8 @@ public enum StandardGameControllerInput: String, Codable
case quickLoad
case fastForward
case toggleFastForward
- case reverseScreens
- case volume
+ case reverseScreens //bindable
+ case volume //bindable
case saveStates
case cheatCodes
case skins
@@ -39,19 +39,22 @@ public enum StandardGameControllerInput: String, Codable
case amiibo
case homeMenu
case airplay
- case toggleControlls
+ case toggleControlls //bindable
case blowing
case palette
case swapDisk
case retroAchievements
case airPlayScaling
case airPlayLayout
- case toggleAnalog
+ case toggleAnalog //bindable
case gameplayManuals
case triggerPro
case fastForward2x
case fastForward3x
case fastForward4x
+ case tvType//Color or BW bindable
+ case leftDifficulty // A or B bindable
+ case rightDifficulty //A or B bindable
case up
case down
diff --git a/Cores/DeltaCore/DeltaCore/Protocols/Model/ControllerSkinBase.swift b/Cores/DeltaCore/DeltaCore/Protocols/Model/ControllerSkinBase.swift
index d3bce5cf..e28100fc 100644
--- a/Cores/DeltaCore/DeltaCore/Protocols/Model/ControllerSkinBase.swift
+++ b/Cores/DeltaCore/DeltaCore/Protocols/Model/ControllerSkinBase.swift
@@ -33,6 +33,8 @@ public protocol ControllerSkinBase
func menuInsets(for traits: ControllerSkin.Traits) -> UIEdgeInsets?
func supportedTraits(for traits: ControllerSkin.Traits) -> ControllerSkin.Traits?
+
+ func switchView(for item: ControllerSkin.Item, traits: ControllerSkin.Traits, onImageSize: CGSize, offImageSize: CGSize) -> (UIImage?, UIImage?)?
}
public extension ControllerSkinBase
diff --git a/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsDynamicEffectView.swift b/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsDynamicEffectView.swift
index 9fc606a0..ae8b3586 100644
--- a/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsDynamicEffectView.swift
+++ b/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsDynamicEffectView.swift
@@ -148,14 +148,20 @@ public class ButtonsDynamicEffectView: UIView {
//通过input查找到对应的视图
private func findItemView(with input: SomeInput) -> DynamicEffectView? {
+ var result = [DynamicEffectView]()
for itemView in itemViews {
if case .standard(let inputs) = itemView.item.inputs, inputs.contains(where: { $0 == input }) {
- return itemView
+ result.append(itemView)
} else if case .directional(let up, let down, let left, let right) = itemView.item.inputs, ((up == input) || (down == input) || (left == input) || (right == input)) {
- return itemView
+ result.append(itemView)
}
}
- return nil
+
+ if result.count > 1, let itemID = input.itemID {
+ return result.first(where: { $0.item.id == itemID })
+ }
+
+ return result.first
}
}
diff --git a/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsInputView.swift b/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsInputView.swift
index e7e536f8..b447b3c5 100644
--- a/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsInputView.swift
+++ b/Cores/DeltaCore/DeltaCore/UI/Controller/ButtonsInputView.swift
@@ -8,6 +8,8 @@
import UIKit
+var ButtonInputsPointMapping = [SomeInput: CGPoint]()
+
class ButtonsInputView: UIView
{
var isHapticEnabled = true
@@ -126,6 +128,7 @@ class ButtonsInputView: UIView
// Don't return inputs for thumbsticks or touch screens since they're handled separately.
case .directional where item.kind == .thumbstick: break
case .touch: break
+ case .switch: break
case .standard(let itemInputs):
inputs.append(contentsOf: itemInputs)
diff --git a/Cores/DeltaCore/DeltaCore/UI/Controller/ControllerView.swift b/Cores/DeltaCore/DeltaCore/UI/Controller/ControllerView.swift
index 73f733ab..4ecb0d17 100644
--- a/Cores/DeltaCore/DeltaCore/UI/Controller/ControllerView.swift
+++ b/Cores/DeltaCore/DeltaCore/UI/Controller/ControllerView.swift
@@ -76,7 +76,7 @@ public class ControllerView: UIView, GameController
guard let supportedTraits = controllerSkin.supportedTraits(for: traits) else { return traits }
return supportedTraits
}
-
+
public var controllerSkinSize: ControllerSkin.Size! {
let size = customControllerSkinSize ?? UIScreen.main.defaultSkinSize
return size
@@ -96,6 +96,7 @@ public class ControllerView: UIView, GameController
public var isThumbstickHaptic = true {
didSet {
thumbstickViews.values.forEach { $0.isHapticEnabled = isThumbstickHaptic }
+ switchViews.values.forEach{ $0.isHapticEnabled = isThumbstickHaptic }
}
}
@@ -104,6 +105,20 @@ public class ControllerView: UIView, GameController
didSet {
buttonsView.hapticFeedbackStyle = hapticFeedbackStyle
thumbstickViews.values.forEach { $0.hapticFeedbackStyle = hapticFeedbackStyle }
+ switchViews.values.forEach { $0.hapticFeedbackStyle = hapticFeedbackStyle }
+ }
+ }
+
+ public var isIncludeSwitch: Bool { switchViews.count > 0 }
+ public func updateSwitchState(_ inputs: [String: Bool]) {
+ if switchViews.count > 0 {
+ inputs.forEach { inputString, on in
+ self.switchViews.forEach { itemID, switchView in
+ if switchView.input.stringValue == inputString {
+ switchView.state = on
+ }
+ }
+ }
}
}
@@ -152,6 +167,7 @@ public class ControllerView: UIView, GameController
private let buttonsView = ButtonsInputView(frame: CGRect.zero)
private var thumbstickViews = [ControllerSkin.Item.ID: ThumbstickInputView]()
private var touchViews = [ControllerSkin.Item.ID: TouchInputView]()
+ private var switchViews = [ControllerSkin.Item.ID: SwitchView]()
private var initialLayout = false
private var delayedUpdatingSkin = false
@@ -271,6 +287,13 @@ public class ControllerView: UIView, GameController
let frame = item.frame.scaled(to: containingFrame)
+ var animation: ControllerSkin.Item.Animation? = nil
+ if var a = item.animation {
+ a.begin = a.begin.scaled(to: containingFrame)
+ a.end = a.end.scaled(to: containingFrame)
+ animation = a
+ }
+
switch item.kind
{
case .button, .dPad: break
@@ -290,6 +313,17 @@ public class ControllerView: UIView, GameController
case .touchScreen:
guard let touchView = touchViews[item.id] else { continue }
touchView.frame = frame
+
+ case .switchButton:
+ //添加switch控件
+ guard let switchView = switchViews[item.id] else { continue }
+ if (switchView.onImage == nil || switchView.offImage == nil),
+ let (onImage, offImage) = controllerSkin.switchView(for: item, traits: traits, onImageSize: animation?.end.size ?? frame.size, offImageSize: animation?.begin.size ?? frame.size) {
+ switchView.onImage = onImage
+ switchView.offImage = offImage
+ }
+ switchView.animation = animation
+ switchView.frame = frame
}
}
@@ -317,11 +351,11 @@ public class ControllerView: UIView, GameController
guard thumbstickView.frame.contains(point) else { continue }
return thumbstickView
}
-
+
for (_, touchView) in touchViews
{
guard touchView.frame.contains(point) else { continue }
-
+
if let inputs = buttonsView.inputs(at: point)
{
// No other inputs at this position, so return touchView.
@@ -332,6 +366,12 @@ public class ControllerView: UIView, GameController
}
}
+ for (_, switchView) in switchViews
+ {
+ guard switchView.frame.contains(point) else { continue }
+ return switchView
+ }
+
return buttonsView
}
@@ -435,7 +475,7 @@ public class ControllerView: UIView, GameController
delayedUpdatingSkin = true
return
}
-
+
if let isDebugModeEnabled = controllerSkin?.isDebugMode
{
debugView.isHidden = !isDebugModeEnabled
@@ -446,7 +486,7 @@ public class ControllerView: UIView, GameController
if let traits = controllerSkinTraits
{
var items = controllerSkin?.items(for: traits)
-
+
if traits.displayType == .splitView
{
if isControllerInputView
@@ -514,6 +554,9 @@ public class ControllerView: UIView, GameController
var touchViews = [ControllerSkin.Item.ID: TouchInputView]()
var previousTouchViews = self.touchViews
+ var switchViews = [ControllerSkin.Item.ID: SwitchView]()
+ var previousSwitchViews = self.switchViews
+
for item in items ?? []
{
switch item.kind
@@ -565,6 +608,27 @@ public class ControllerView: UIView, GameController
}
touchViews[item.id] = touchView
+
+ case .switchButton:
+ guard case .switch(let input) = item.inputs else { continue }
+ let switchView: SwitchView
+ if let previousSwitchView = previousSwitchViews[item.id] {
+ switchView = previousSwitchView
+ previousSwitchViews[item.id] = nil
+ } else {
+ switchView = SwitchView(input: input, selfRetracting: item.selfRetracting)
+ contentView.addSubview(switchView)
+ }
+ switchView.valueChangedHandler = { [weak self] input in
+ guard let self else { return }
+ activate(input)
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
+ self.deactivate(input)
+ })
+ }
+
+ switchView.isHapticEnabled = isThumbstickHaptic
+ switchViews[item.id] = switchView
}
}
@@ -573,6 +637,9 @@ public class ControllerView: UIView, GameController
previousTouchViews.values.forEach { $0.removeFromSuperview() }
self.touchViews = touchViews
+
+ previousSwitchViews.values.forEach { $0.removeFromSuperview() }
+ self.switchViews = switchViews
}
else
{
@@ -584,6 +651,9 @@ public class ControllerView: UIView, GameController
touchViews.values.forEach { $0.removeFromSuperview() }
touchViews = [:]
+
+ switchViews.values.forEach { $0.removeFromSuperview() }
+ switchViews = [:]
}
updateGameViews()
@@ -638,7 +708,7 @@ public class ControllerView: UIView, GameController
let gameView = previousGameViews[screen.id] ?? GameView(frame: .zero)
gameView.update(for: screen)
-
+
previousGameViews[screen.id] = nil
gameViews[screen.id] = gameView
}
@@ -710,16 +780,16 @@ public class ControllerView: UIView, GameController
func presentInputView()
{
guard !isControllerInputView else { return }
-
+
guard let controllerSkin = controllerSkin, let traits = controllerSkinTraits else { return }
-
+
if self.controllerInputView == nil
{
let inputControllerView = ControllerInputView(frame: CGRect(x: 0, y: 0, width: 1024, height: 300))
inputControllerView.controllerView.addReceiver(self, inputMapping: nil)
controllerInputView = inputControllerView
}
-
+
if controllerSkin.supports(traits)
{
controllerInputView?.controllerView.controllerSkin = controllerSkin
@@ -849,11 +919,11 @@ extension ControllerView: ControllerReceiverProtocol
// public var hasText: Bool {
// return false
// }
-//
+//
// public func insertText(_ text: String)
// {
// }
-//
+//
// public func deleteBackward()
// {
// }
diff --git a/Cores/DeltaCore/DeltaCore/UI/Controller/SwitchView.swift b/Cores/DeltaCore/DeltaCore/UI/Controller/SwitchView.swift
new file mode 100644
index 00000000..02fca129
--- /dev/null
+++ b/Cores/DeltaCore/DeltaCore/UI/Controller/SwitchView.swift
@@ -0,0 +1,85 @@
+//
+// SwitchView.swift
+// Pods
+//
+// Created by Daiuno on 2026/1/24.
+//
+
+class SwitchView: UIView {
+ var state: Bool = false {
+ didSet {
+ if let animation {
+ if animation.type == "spring" {
+ UIView.animate(withDuration: 0.5, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, animations: {
+ self.imageView.frame = (self.state ? animation.end : animation.begin) ?? self.bounds
+ self.imageView.image = self.state ? self.onImage : self.offImage
+ }, completion: { _ in
+ if self.state, self.selfRetracting {
+ self.state = false
+ }
+ })
+ }
+ }
+ }
+ }
+ var isHapticEnabled = true
+
+ var valueChangedHandler: ((_ inputString: Input) -> Void)?
+
+ var onImage: UIImage? {
+ didSet {
+ if state {
+ imageView.image = onImage
+ }
+ }
+ }
+
+ var offImage: UIImage?{
+ didSet {
+ if !state {
+ imageView.image = offImage
+ }
+ }
+ }
+
+ var input: Input
+ var selfRetracting: Bool
+
+ var animation: ControllerSkin.Item.Animation? {
+ didSet {
+ imageView.frame = (state ? animation?.end : animation?.begin) ?? bounds
+ }
+ }
+
+ private lazy var imageView: UIImageView = {
+ let view = UIImageView(frame: self.animation?.begin ?? bounds)
+ view.contentMode = .center
+ return view
+ }()
+
+ private var feedbackGenerator = UIImpactFeedbackGenerator(style: .soft)
+ //添加震感的样式
+ var hapticFeedbackStyle: UIImpactFeedbackGenerator.FeedbackStyle = .soft {
+ didSet {
+ feedbackGenerator = UIImpactFeedbackGenerator(style: hapticFeedbackStyle)
+ }
+ }
+
+ init(input: Input, selfRetracting: Bool) {
+ self.input = input
+ self.selfRetracting = selfRetracting
+ super.init(frame: .zero)
+ addSubview(imageView)
+ addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(handleTapGesture(_:))))
+ }
+
+ required init?(coder aDecoder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+ @objc func handleTapGesture(_ gestureRecognizer: UITapGestureRecognizer) {
+ feedbackGenerator.impactOccurred()
+ state = !state
+ valueChangedHandler?(input)
+ }
+}
diff --git a/Cores/DeltaCore/DeltaCore/UI/Controller/TouchControllerSkin.swift b/Cores/DeltaCore/DeltaCore/UI/Controller/TouchControllerSkin.swift
index 3024f790..53d008f5 100644
--- a/Cores/DeltaCore/DeltaCore/UI/Controller/TouchControllerSkin.swift
+++ b/Cores/DeltaCore/DeltaCore/UI/Controller/TouchControllerSkin.swift
@@ -128,4 +128,8 @@ extension TouchControllerSkin: ControllerSkinBase
public func menuInsets(for traits: ControllerSkin.Traits) -> UIEdgeInsets? {
return nil
}
+
+ public func switchView(for item: ControllerSkin.Item, traits: ControllerSkin.Traits, onImageSize: CGSize, offImageSize: CGSize) -> (UIImage?, UIImage?)? {
+ return nil
+ }
}
diff --git a/Cores/Libretro/audio/drivers_microphone/coreaudio_mic.m b/Cores/Libretro/audio/drivers_microphone/coreaudio_mic.m
index d6fdecf6..4c82a4fd 100644
--- a/Cores/Libretro/audio/drivers_microphone/coreaudio_mic.m
+++ b/Cores/Libretro/audio/drivers_microphone/coreaudio_mic.m
@@ -30,6 +30,8 @@ typedef struct coreaudio_microphone
bool nonblock; /// Non-blocking mode flag
int sample_rate; /// Current sample rate
bool use_float; /// Whether to use float format
+ void *render_buffer; /// Reusable buffer for AudioUnitRender
+ size_t render_buffer_size; /// Size of render buffer
} coreaudio_microphone_t;
/// Callback for receiving audio samples
@@ -44,7 +46,6 @@ static OSStatus coreaudio_input_callback(
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)inRefCon;
AudioBufferList bufferList;
OSStatus status;
- void *tempBuffer = NULL;
/// Calculate required buffer size
size_t bufferSize = inNumberFrames * microphone->format.mBytesPerFrame;
@@ -53,17 +54,24 @@ static OSStatus coreaudio_input_callback(
return kAudio_ParamError;
}
- /// Allocate temporary buffer
- tempBuffer = malloc(bufferSize);
- if (!tempBuffer) {
- RARCH_ERR("[CoreAudio]: Failed to allocate temporary buffer\n");
- return kAudio_MemFullError;
+ /// Ensure render buffer is large enough (resize if needed)
+ if (microphone->render_buffer_size < bufferSize) {
+ if (microphone->render_buffer) {
+ free(microphone->render_buffer);
+ }
+ microphone->render_buffer = calloc(1, bufferSize);
+ microphone->render_buffer_size = bufferSize;
+ if (!microphone->render_buffer) {
+ RARCH_ERR("[CoreAudio]: Failed to allocate render buffer\n");
+ return kAudio_MemFullError;
+ }
}
- /// Set up buffer list
+ /// Set up buffer list with reusable buffer
bufferList.mNumberBuffers = 1;
+ bufferList.mBuffers[0].mNumberChannels = 1;
bufferList.mBuffers[0].mDataByteSize = (UInt32)bufferSize;
- bufferList.mBuffers[0].mData = tempBuffer;
+ bufferList.mBuffers[0].mData = microphone->render_buffer;
/// Render audio data
status = AudioUnitRender(microphone->audio_unit,
@@ -74,6 +82,16 @@ static OSStatus coreaudio_input_callback(
&bufferList);
if (status == noErr) {
+ /// Check FIFO buffer space before writing
+ size_t avail_write = FIFO_WRITE_AVAIL(microphone->sample_buffer);
+ size_t bytes_to_write = bufferList.mBuffers[0].mDataByteSize;
+
+ /// Warn if FIFO buffer overflow is about to occur
+ if (avail_write < bytes_to_write) {
+ RARCH_WARN("[CoreAudio]: FIFO buffer overflow! Available: %zu, need: %zu\n",
+ avail_write, bytes_to_write);
+ }
+
/// Write to FIFO buffer
fifo_write(microphone->sample_buffer,
bufferList.mBuffers[0].mData,
@@ -82,8 +100,6 @@ static OSStatus coreaudio_input_callback(
RARCH_ERR("[CoreAudio]: Failed to render audio: %d\n", status);
}
- /// Clean up temporary buffer
- free(tempBuffer);
return status;
}
@@ -130,9 +146,6 @@ static int coreaudio_microphone_read(void *driver_context,
if (read_amt > 0) {
fifo_read(microphone->sample_buffer, buf, read_amt);
-#if DEBUG
- RARCH_LOG("[CoreAudio]: Read %zu bytes from microphone\n", read_amt);
-#endif
}
return (int)read_amt;
@@ -141,14 +154,15 @@ static int coreaudio_microphone_read(void *driver_context,
/// Set non-blocking state
static void coreaudio_microphone_set_nonblock_state(void *driver_context, bool state)
{
- /// This method sets non-blocking state for all microphones created by this driver
- /// For CoreAudio implementation, we don't maintain driver-level state
- /// Non-blocking behavior is handled per-microphone
+ /// For CoreAudio, we need to set nonblock for all open microphones
+ /// Since we only support one microphone at a time, we don't track a list
(void)driver_context;
(void)state;
- /// Note: Individual microphone non-blocking state should be set via
- /// individual microphone context, not driver context
+ /// Note: Nonblocking state is now set per-microphone in open_mic
+ /// and can be toggled via the microphone context if needed
+ RARCH_LOG("[CoreAudio]: Set nonblock state to %s (applies to future microphones)\n",
+ state ? "true" : "false");
}
/// Helper method to set audio format
@@ -190,6 +204,7 @@ static void *coreaudio_microphone_open_mic(void *driver_context,
/// Initialize handle fields
microphone->sample_rate = rate;
microphone->use_float = false; /// Default to integer format
+ microphone->nonblock = true; /// Default to non-blocking mode for game usage
/// Validate requested sample rate
if (rate != 44100 && rate != 48000) {
@@ -350,6 +365,8 @@ static void coreaudio_microphone_close_mic(void *driver_context, void *microphon
}
if (microphone->sample_buffer)
fifo_free(microphone->sample_buffer);
+ if (microphone->render_buffer)
+ free(microphone->render_buffer);
free(microphone);
} else {
RARCH_ERR("[CoreAudio]: Failed to close microphone\n");
diff --git a/Cores/Libretro/runloop.c b/Cores/Libretro/runloop.c
index 3a152142..06b85084 100644
--- a/Cores/Libretro/runloop.c
+++ b/Cores/Libretro/runloop.c
@@ -356,6 +356,12 @@ void set_azahar_custom_layout(const char *layout) {
g_azahar_custom_layout = strdup(layout);
}
+//定义DeSmuME的布局信息
+static const char *g_desmume_custom_layout = NULL;
+void set_desmume_custom_layout(const char *layout) {
+ g_desmume_custom_layout = strdup(layout);
+}
+
//定义Shutdown通知
static LogCallback g_log_callback = NULL;
void log_register_callback(LogCallback callback) {
@@ -1472,6 +1478,11 @@ bool runloop_environment_cb(unsigned cmd, void *data)
var->value = strdup(g_azahar_custom_layout);
break;
}
+
+ if (g_desmume_custom_layout && string_is_equal(var->key, "desmume_custom_layout_config")) {
+ var->value = strdup(g_desmume_custom_layout);
+ break;
+ }
if (core_option_manager_get_idx(runloop_st->core_options,
var->key, &opt_idx))
diff --git a/Cores/Libretro/runloop.h b/Cores/Libretro/runloop.h
index bc6c683b..c1fee616 100644
--- a/Cores/Libretro/runloop.h
+++ b/Cores/Libretro/runloop.h
@@ -325,6 +325,9 @@ void set_melonds_wfc_dns(const char *dns);
//定义3DS的布局信息
void set_azahar_custom_layout(const char *layout);
+//定义DeSmuME的布局信息
+void set_desmume_custom_layout(const char *layout);
+
//定义日志回调
typedef void (*LogCallback)(enum retro_log_level level, const char *fmt, va_list args);
void log_register_callback(LogCallback callback);
diff --git a/Cores/Libretro/ui/drivers/LibretroCore.m b/Cores/Libretro/ui/drivers/LibretroCore.m
index 0e4aa889..05fc3050 100644
--- a/Cores/Libretro/ui/drivers/LibretroCore.m
+++ b/Cores/Libretro/ui/drivers/LibretroCore.m
@@ -64,6 +64,7 @@ NSString * const MAMEGameFileMissingNotification = @"MAMEGameFileMissingNotifica
@interface LibretroCore()
@property (assign) BOOL isRunning;
+@property (assign) unsigned keyboardMods;
@end
@@ -176,6 +177,34 @@ NSString * const MAMEGameFileMissingNotification = @"MAMEGameFileMissingNotifica
[[self getRetroArch] releaseButton:(unsigned)button playerIndex:playerIndex];
}
+- (void)pressKeyboard:(LibretroKeyboardCode *_Nonnull)keyboardCode {
+ // 先更新修饰键状态
+ if (keyboardCode.code == RETROK_LSHIFT || keyboardCode.code == RETROK_RSHIFT) {
+ _keyboardMods |= RETROKMOD_SHIFT;
+ } else if (keyboardCode.code == RETROK_LCTRL || keyboardCode.code == RETROK_RCTRL) {
+ _keyboardMods |= RETROKMOD_CTRL;
+ } else if (keyboardCode.code == RETROK_LALT || keyboardCode.code == RETROK_RALT) {
+ _keyboardMods |= RETROKMOD_ALT;
+ }
+
+ // 再发送键盘事件(包含更新后的修饰键状态)
+ apple_direct_input_keyboard_event(true, keyboardCode.code, 0, _keyboardMods, RETRO_DEVICE_KEYBOARD);
+}
+
+- (void)releaseKeyboard:(LibretroKeyboardCode *_Nonnull)keyboardCode {
+ // 先清除修饰键状态(使用按位取反)
+ if (keyboardCode.code == RETROK_LSHIFT || keyboardCode.code == RETROK_RSHIFT) {
+ _keyboardMods &= ~RETROKMOD_SHIFT;
+ } else if (keyboardCode.code == RETROK_LCTRL || keyboardCode.code == RETROK_RCTRL) {
+ _keyboardMods &= ~RETROKMOD_CTRL;
+ } else if (keyboardCode.code == RETROK_LALT || keyboardCode.code == RETROK_RALT) {
+ _keyboardMods &= ~RETROKMOD_ALT;
+ }
+
+ // 再发送键盘事件(包含更新后的修饰键状态)
+ apple_direct_input_keyboard_event(false, keyboardCode.code, 0, _keyboardMods, RETRO_DEVICE_KEYBOARD);
+}
+
- (void)moveStick:(BOOL)isLeft x:(CGFloat)x y:(CGFloat)y playerIndex:(unsigned)playerIndex {
[[self getRetroArch] moveStick:isLeft x:x y:y playerIndex:playerIndex];
}
@@ -567,10 +596,12 @@ static void libretroLogCallback(enum retro_log_level level, const char *fmt, va_
if (layout) {
if ([layout componentsSeparatedByString:@","].count == 10) {
set_melonds_custom_layout([layout cStringUsingEncoding:NSUTF8StringEncoding]);
+ set_desmume_custom_layout([layout cStringUsingEncoding:NSUTF8StringEncoding]);
[self setCoreOptionNeedsUpdate];
}
} else {
set_melonds_custom_layout(NULL);
+ set_desmume_custom_layout(NULL);
[self setCoreOptionNeedsUpdate];
}
}
@@ -758,4 +789,34 @@ static void azahar_keyboard_request_callback(const struct retro_keyboard_config_
#endif
}
++ (NSString *_Nullable)getPSPGameIDWithRomPath:(NSString *_Nonnull)romPath {
+ NSString *corePath = [[NSBundle mainBundle] pathForResource:@"ppsspp.libretro" ofType:@"framework" inDirectory:@"Frameworks"];
+ if (!corePath) {
+ return nil;
+ }
+
+ NSString *dylibPath = [corePath stringByAppendingPathComponent:@"ppsspp.libretro"];
+ dylib_t lib = dylib_load([dylibPath UTF8String]);
+ if (!lib) {
+ return nil;
+ }
+
+ typedef const char* (*retro_get_psp_gameid_t)(const char*);
+ retro_get_psp_gameid_t get_psp_gameid = (retro_get_psp_gameid_t)dylib_proc(lib, "retro_get_psp_gameid");
+ if (!get_psp_gameid) {
+ dylib_close(lib);
+ return nil;
+ }
+
+ const char *romPath_cstr = [romPath UTF8String];
+ const char* gameid = get_psp_gameid(romPath_cstr);
+ NSString *result = nil;
+ if (gameid) {
+ result = [NSString stringWithUTF8String:gameid];
+ }
+ dylib_close(lib);
+
+ return result;
+}
+
@end
diff --git a/Cores/Libretro/ui/drivers/cocoa/LibretroCore.h b/Cores/Libretro/ui/drivers/cocoa/LibretroCore.h
index 19af00d4..e656abdc 100644
--- a/Cores/Libretro/ui/drivers/cocoa/LibretroCore.h
+++ b/Cores/Libretro/ui/drivers/cocoa/LibretroCore.h
@@ -11,6 +11,7 @@
#import "CheevosBridge.h"
#import "AzaharKeyboardConfig.h"
#import "LibretroShaders.h"
+#import "LibretroKeyboardCode.h"
NS_ASSUME_NONNULL_BEGIN
@@ -58,6 +59,8 @@ extern NSString * const RetroAchievementsNotification;
- (void)sendEvent:(UIEvent * _Nonnull)event;
- (void)pressButton:(LibretroButton)button playerIndex:(unsigned)playerIndex;
- (void)releaseButton:(LibretroButton)button playerIndex:(unsigned)playerIndex;
+- (void)pressKeyboard:(LibretroKeyboardCode *_Nonnull)keyboardCode;
+- (void)releaseKeyboard:(LibretroKeyboardCode *_Nonnull)keyboardCode;
///x,y取值范围 -1~1
- (void)moveStick:(BOOL)isLeft x:(CGFloat)x y:(CGFloat)y playerIndex:(unsigned)playerIndex;
- (void)updatePSPCheat:(NSString *_Nonnull)cheatCode cheatFilePath:(NSString *_Nonnull)cheatFilePath reloadGame:(BOOL)reloadGame;
@@ -103,6 +106,7 @@ extern NSString * const RetroAchievementsNotification;
- (BOOL)isSearchingAmiibo;
- (void)registerAzaharKeyboard:(void(^ _Nullable)(AzaharKeyboardConfig *_Nonnull config))callback;
- (void)inputAzaharKeyboard:(NSString *_Nullable)text buttonType:(AzaharButtonType)buttonType;
++ (NSString *_Nullable)getPSPGameIDWithRomPath:(NSString *_Nonnull)romPath;
@end
diff --git a/Cores/Libretro/ui/drivers/ui_cocoatouch.m b/Cores/Libretro/ui/drivers/ui_cocoatouch.m
index fc29e8d7..96f9dab3 100644
--- a/Cores/Libretro/ui/drivers/ui_cocoatouch.m
+++ b/Cores/Libretro/ui/drivers/ui_cocoatouch.m
@@ -1123,46 +1123,8 @@ static BOOL RespectSilentMode = false;
core_info_t *core_info = NULL;
core_info_get_current_core(&core_info);
- //核心选项 开启PSP内部作弊码支持
- if (strcmp(core_info->core_name, "PPSSPP") == 0 && completion) {
- core_options_flush();//生成核心配置
- //获取PSP的游戏信息
- dispatch_async(dispatch_get_global_queue(0, 0), ^{
- NSFileManager *fileManager = [NSFileManager defaultManager];
- NSString *savePath = [[NSString stringWithCString:runloop_state_get_ptr()->savefile_dir encoding:NSUTF8StringEncoding] stringByAppendingPathComponent:@"PSP/Cheats"];
- NSError *error = nil;
- NSArray *files = [fileManager contentsOfDirectoryAtPath:savePath error:&error];
- if (error) {
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(nil);
- });
- return;
- }
- NSString *latestFileName = nil;
- NSDate *latestDate = [NSDate distantPast];
- for (NSString *fileName in files) {
- if ([[fileName pathExtension] isEqualToString:@"ini"]) {
- NSString *fullPath = [savePath stringByAppendingPathComponent:fileName];
- NSDictionary *attributes = [fileManager attributesOfItemAtPath:fullPath error:&error];
- if (error) {
- continue;
- }
-
- NSDate *creationDate = attributes[NSFileCreationDate];
- if ([creationDate compare:latestDate] == NSOrderedDescending) {
- latestDate = creationDate;
- latestFileName = fileName;
- }
- }
- }
- dispatch_async(dispatch_get_main_queue(), ^{
- completion(latestFileName == nil ? nil : @{@"PSPGameCode": [latestFileName stringByDeletingPathExtension]});
- });
- });
- } else {
- if (completion) {
- completion(nil);
- }
+ if (completion) {
+ completion(nil);
}
return YES;
}
diff --git a/Cores/atari800.libretro.framework/Info.plist b/Cores/atari800.libretro.framework/Info.plist
new file mode 100644
index 00000000..29234868
--- /dev/null
+++ b/Cores/atari800.libretro.framework/Info.plist
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0771155ac0fb746d33d94eabeebbf3edea44d9b8f38e4ccf707b7fde981d7384
+size 721
diff --git a/Cores/atari800.libretro.framework/_CodeSignature/CodeResources b/Cores/atari800.libretro.framework/_CodeSignature/CodeResources
new file mode 100644
index 00000000..4721c6e0
--- /dev/null
+++ b/Cores/atari800.libretro.framework/_CodeSignature/CodeResources
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:381c8a6a65f364bc30ff4a5968a0852a03243c7422b78b6a2012e2bb7232c9cc
+size 1798
diff --git a/Cores/atari800.libretro.framework/atari800.libretro b/Cores/atari800.libretro.framework/atari800.libretro
new file mode 100755
index 00000000..d1d969e6
--- /dev/null
+++ b/Cores/atari800.libretro.framework/atari800.libretro
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6c714dece387777e1422191bfbbd6c4cc8fe0cf0491339f29f93d2a5f526c396
+size 874208
diff --git a/Cores/azahar.libretro.framework/Info.plist b/Cores/azahar.libretro.framework/Info.plist
index 2fe13f6a..4f31ffe5 100644
--- a/Cores/azahar.libretro.framework/Info.plist
+++ b/Cores/azahar.libretro.framework/Info.plist
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:bf1d97b13f7c27395bbb64f6e6fdb5f6619f41de268eeabb48fe3b35263590d6
-size 715
+oid sha256:bf0e341eaf990c20ce7f6cc51d30240905102d18b17e77f4f8d60d9a1c1b7cd3
+size 1006
diff --git a/Cores/azahar.libretro.framework/_CodeSignature/CodeResources b/Cores/azahar.libretro.framework/_CodeSignature/CodeResources
index f1c6928f..b1795273 100644
--- a/Cores/azahar.libretro.framework/_CodeSignature/CodeResources
+++ b/Cores/azahar.libretro.framework/_CodeSignature/CodeResources
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:9f300a698d3bf0da13c5e4f91d1c44df9f65dcc78437efc590a87f19612c46aa
+oid sha256:203ba94b59517d3fe7c203ea18bbe5033c3a1591736e75b5231184035dae5d64
size 1798
diff --git a/Cores/azahar.libretro.framework/azahar.libretro b/Cores/azahar.libretro.framework/azahar.libretro
index 1123f8a7..a80d4c9f 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:b6bd47ead6175f8a0bb884dba0334cedb54e49f348e26164f9ff19a2c5c4df43
-size 27202016
+oid sha256:b6075444e91bec6caa452777c865e4930bc981167a982fc43b9c577c0ed051ce
+size 28214432
diff --git a/Cores/desmume.libretro.framework/Info.plist b/Cores/desmume.libretro.framework/Info.plist
new file mode 100644
index 00000000..65222b21
--- /dev/null
+++ b/Cores/desmume.libretro.framework/Info.plist
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:6463eba3d9c319376f5513f3b2dd7038db80b55b308d8136c05fabec3e0d3d8d
+size 1010
diff --git a/Cores/desmume.libretro.framework/_CodeSignature/CodeResources b/Cores/desmume.libretro.framework/_CodeSignature/CodeResources
new file mode 100644
index 00000000..12986529
--- /dev/null
+++ b/Cores/desmume.libretro.framework/_CodeSignature/CodeResources
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:aa40345954395b1b9702184bd8156e3fe1d21cde100a6399881f41619569b682
+size 1798
diff --git a/Cores/desmume.libretro.framework/desmume.libretro b/Cores/desmume.libretro.framework/desmume.libretro
new file mode 100755
index 00000000..578d7202
--- /dev/null
+++ b/Cores/desmume.libretro.framework/desmume.libretro
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:bc7f1ff0919637e44f6b28f06edab31022d4f014e688e64d17e63da66c047019
+size 3474336
diff --git a/Cores/holani.libretro.framework/Info.plist b/Cores/holani.libretro.framework/Info.plist
new file mode 100644
index 00000000..8b0bb540
--- /dev/null
+++ b/Cores/holani.libretro.framework/Info.plist
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:0897f0d78d946d31e646f88775dce4663a8ffaf46d0d1680261b2fbf0379539b
+size 715
diff --git a/Cores/holani.libretro.framework/_CodeSignature/CodeResources b/Cores/holani.libretro.framework/_CodeSignature/CodeResources
new file mode 100644
index 00000000..e73c7782
--- /dev/null
+++ b/Cores/holani.libretro.framework/_CodeSignature/CodeResources
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d1d1c46bd04f6b81c58e7ec464c99f054729324413c943c92f57ee8feee0fc91
+size 1798
diff --git a/Cores/holani.libretro.framework/holani.libretro b/Cores/holani.libretro.framework/holani.libretro
new file mode 100755
index 00000000..21e0adc2
--- /dev/null
+++ b/Cores/holani.libretro.framework/holani.libretro
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:b7dafc4ccf93dc797df98d35b1a3f11daff7a76f202601748b67fd221dc7d642
+size 1329520
diff --git a/Cores/mame.libretro.framework/Info.plist b/Cores/mame.libretro.framework/Info.plist
index 96646802..e3434d93 100644
--- a/Cores/mame.libretro.framework/Info.plist
+++ b/Cores/mame.libretro.framework/Info.plist
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:3eb718d71d2f15bc02674e3e976f2adbd3d3429fa8d8feaf57251f8ae2cb2971
-size 709
+oid sha256:a5c272e304989a4e97b183c15543e3bf0122aa89ec99bf6ebe1d6e6248bdf01e
+size 1057
diff --git a/Cores/mame.libretro.framework/_CodeSignature/CodeResources b/Cores/mame.libretro.framework/_CodeSignature/CodeResources
index b88b90ea..bfce507a 100644
--- a/Cores/mame.libretro.framework/_CodeSignature/CodeResources
+++ b/Cores/mame.libretro.framework/_CodeSignature/CodeResources
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:72ce3cbeaa1b455a96a17b225187c486b52acab42b04035c2b1f97bfd61aa7fb
+oid sha256:4150c57c4b80c4bdc98f586bdc2716e3bde9e9b4c0c5f5c0e4c06f4bb84a5715
size 1798
diff --git a/Cores/mame.libretro.framework/mame.libretro b/Cores/mame.libretro.framework/mame.libretro
index 01cd0815..3ff917c0 100755
--- a/Cores/mame.libretro.framework/mame.libretro
+++ b/Cores/mame.libretro.framework/mame.libretro
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2fa5de8b962ca60f3b2838ac9ecf023b53a67f247c8f59e1e3eb21f999f6672b
-size 368212096
+oid sha256:ede8b95b25fe4351d3e8b8ecc1398e589459d84b68650dfbda535c54f697638b
+size 218096848
diff --git a/Cores/melondsds.libretro.framework/Info.plist b/Cores/melondsds.libretro.framework/Info.plist
index 8ca37a8b..437c0cf1 100644
--- a/Cores/melondsds.libretro.framework/Info.plist
+++ b/Cores/melondsds.libretro.framework/Info.plist
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:4d3e469a625e681b1c8535161b80173bb5fa0198a8a74a19922437b6e836c1eb
-size 724
+oid sha256:1a54704fbf25bddfe5c575bc993294269c213660be0a41ad0e491f43805481a8
+size 1016
diff --git a/Cores/melondsds.libretro.framework/_CodeSignature/CodeResources b/Cores/melondsds.libretro.framework/_CodeSignature/CodeResources
index 4ca39f09..167b176a 100644
--- a/Cores/melondsds.libretro.framework/_CodeSignature/CodeResources
+++ b/Cores/melondsds.libretro.framework/_CodeSignature/CodeResources
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d1826630b82505d74058a72e1ebd40a1db34a841bb06fa79fce8d97c34df3849
+oid sha256:bf35ffe31e74005629cf9bca2e15c2452b2e2f6a33efce436163174d0a38b2e8
size 1798
diff --git a/Cores/melondsds.libretro.framework/melondsds.libretro b/Cores/melondsds.libretro.framework/melondsds.libretro
index fd156345..741c4f69 100755
--- a/Cores/melondsds.libretro.framework/melondsds.libretro
+++ b/Cores/melondsds.libretro.framework/melondsds.libretro
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:a88e6af835302fb2244524a95e805bd3a9db1a97fba747a7de97fef478a4c6e1
-size 4648448
+oid sha256:a8c6b65c6c706a8739505406d5c5adc8daee4446f114d11db5461e66f3e491cf
+size 4603296
diff --git a/Cores/ppsspp.libretro.framework/Info.plist b/Cores/ppsspp.libretro.framework/Info.plist
index 534d75be..89a03a2d 100644
--- a/Cores/ppsspp.libretro.framework/Info.plist
+++ b/Cores/ppsspp.libretro.framework/Info.plist
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:900ed913a8af8cdc2b9616ab0f11326e5a3bf8059a6c0d222cd8b2025f0a3c9c
-size 715
+oid sha256:7ded6bf441be9963d18d3f38183c360bc17bd536c698a30e4a4588f2176de6f6
+size 1006
diff --git a/Cores/ppsspp.libretro.framework/_CodeSignature/CodeResources b/Cores/ppsspp.libretro.framework/_CodeSignature/CodeResources
index 8597a232..c4f9366d 100644
--- a/Cores/ppsspp.libretro.framework/_CodeSignature/CodeResources
+++ b/Cores/ppsspp.libretro.framework/_CodeSignature/CodeResources
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:168666d5162a1a7bface19c534397bb64491cc7470e0067b1a80a6ed48a08e10
+oid sha256:6a5868bebad75e501bec283e87f8d060957e04992aaca5b23e6683307b138669
size 1798
diff --git a/Cores/ppsspp.libretro.framework/ppsspp.libretro b/Cores/ppsspp.libretro.framework/ppsspp.libretro
index 7c8cc3cb..4b6973c3 100755
--- a/Cores/ppsspp.libretro.framework/ppsspp.libretro
+++ b/Cores/ppsspp.libretro.framework/ppsspp.libretro
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:ffe6e7ded6efc5e05b40de2d353a3fc207387d90f83b5de4943fb7281cbcfbc3
-size 16583072
+oid sha256:a6823d30ff396e3d1fa44ddf233e198f3f2e055f11e78f0cb9395be4b84f7917
+size 16933008
diff --git a/Cores/prosystem.libretro.framework/Info.plist b/Cores/prosystem.libretro.framework/Info.plist
new file mode 100644
index 00000000..86ae767c
--- /dev/null
+++ b/Cores/prosystem.libretro.framework/Info.plist
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a20156352e615dcac0093807f19971902fdfe6888a21698af65c5911d1777756
+size 724
diff --git a/Cores/prosystem.libretro.framework/_CodeSignature/CodeResources b/Cores/prosystem.libretro.framework/_CodeSignature/CodeResources
new file mode 100644
index 00000000..40cbae7f
--- /dev/null
+++ b/Cores/prosystem.libretro.framework/_CodeSignature/CodeResources
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:01368b0fec99995ab2e4fc2b0ce3d1b9c969b74311e45abb3b4b47bdbcac6043
+size 1798
diff --git a/Cores/prosystem.libretro.framework/prosystem.libretro b/Cores/prosystem.libretro.framework/prosystem.libretro
new file mode 100755
index 00000000..9e8290a2
--- /dev/null
+++ b/Cores/prosystem.libretro.framework/prosystem.libretro
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:189eeaee6a3a8affc826a938aa30f893d39809811e9525d55bb8958ace06b535
+size 244400
diff --git a/Cores/stella.libretro.framework/Info.plist b/Cores/stella.libretro.framework/Info.plist
new file mode 100644
index 00000000..f4c5d26b
--- /dev/null
+++ b/Cores/stella.libretro.framework/Info.plist
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a3a0c816731a48360c23cdd44ccce496ddc688fbe117fc4a762fad195a5e5db7
+size 715
diff --git a/Cores/stella.libretro.framework/_CodeSignature/CodeResources b/Cores/stella.libretro.framework/_CodeSignature/CodeResources
new file mode 100644
index 00000000..e47a3582
--- /dev/null
+++ b/Cores/stella.libretro.framework/_CodeSignature/CodeResources
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:3cb792f20977311b872f53d866b47c198fef368b1ee726d0196e8009a22763ec
+size 1798
diff --git a/Cores/stella.libretro.framework/stella.libretro b/Cores/stella.libretro.framework/stella.libretro
new file mode 100755
index 00000000..ed8b8360
--- /dev/null
+++ b/Cores/stella.libretro.framework/stella.libretro
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:953469f2e3c262a3dfd582d7c5b3f3f15762a190d0f135177b2bcdc114f0c53b
+size 3201184
diff --git a/Cores/virtualjaguar.libretro.framework/Info.plist b/Cores/virtualjaguar.libretro.framework/Info.plist
new file mode 100644
index 00000000..3f8b181c
--- /dev/null
+++ b/Cores/virtualjaguar.libretro.framework/Info.plist
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:7882bb27f2cdf90915b5ef7963cdca4edb3c8347716a4b5b589949884957e34c
+size 736
diff --git a/Cores/virtualjaguar.libretro.framework/_CodeSignature/CodeResources b/Cores/virtualjaguar.libretro.framework/_CodeSignature/CodeResources
new file mode 100644
index 00000000..0a8e6677
--- /dev/null
+++ b/Cores/virtualjaguar.libretro.framework/_CodeSignature/CodeResources
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e6f759dbc8533b56ba5767ad45b4c78f083f6632b65a32f9c8287e9b1bacf89b
+size 1798
diff --git a/Cores/virtualjaguar.libretro.framework/virtualjaguar.libretro b/Cores/virtualjaguar.libretro.framework/virtualjaguar.libretro
new file mode 100755
index 00000000..e8708d41
--- /dev/null
+++ b/Cores/virtualjaguar.libretro.framework/virtualjaguar.libretro
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:888b17fc65f57862cd1f6909f34a73289383d83f1d2077653ea1dc77facf22ea
+size 2430000
diff --git a/ManicEmu/Libretro/LibretroConfig.xcconfig b/ManicEmu/Libretro/LibretroConfig.xcconfig
index 3ccc606c..4b0f7177 100644
--- a/ManicEmu/Libretro/LibretroConfig.xcconfig
+++ b/ManicEmu/Libretro/LibretroConfig.xcconfig
@@ -118,7 +118,7 @@ OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_ONLINE_UPDATER
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_OPENGLES
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DHAVE_OPENGLES3
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DIOS
-OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DPACKAGE_VERSION=\"1.8.1\"
+OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DPACKAGE_VERSION=\"1.8.2\"
OTHER_CFLAGS_IOS_TVOS_SHARE = $(inherited) -DRARCH_MOBILE
OTHER_CFLAGS[sdk=iphoneos*] = $(inherited) $(OTHER_CFLAGS_IOS_TVOS_SHARE)
diff --git a/ManicEmu/Libretro/LibretroKeyboardCode.h b/ManicEmu/Libretro/LibretroKeyboardCode.h
new file mode 100644
index 00000000..34fa230c
--- /dev/null
+++ b/ManicEmu/Libretro/LibretroKeyboardCode.h
@@ -0,0 +1,107 @@
+//
+// LibretroKeyboardCode.h
+// Libretro
+//
+// Created by Daiuno on 2026/1/24.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+/**
+ "1" RETROK_1
+ "2" RETROK_2
+ "3" RETROK_3
+ "4" RETROK_4
+ "5" RETROK_5
+ "Q" RETROK_q
+ "W" RETROK_w
+ "E" RETROK_e
+ "R" RETROK_r
+ "T" RETROK_t
+ "A" RETROK_a
+ "S" RETROK_s
+ "D" RETROK_d
+ "F" RETROK_f
+ "G" RETROK_g
+ "Z" RETROK_z
+ "X" RETROK_x
+ "C" RETROK_c
+ "V" RETROK_v
+ "B" RETROK_b
+ "FN" 9000
+ "LSHIFT" RETROK_LSHIFT
+ "LCTRL" RETROK_LCTRL
+ "LALT" RETROK_LALT
+ "F1" RETROK_F1
+ "F2" RETROK_F2
+ "F3" RETROK_F3
+ "F4" RETROK_F4
+ "F5" RETROK_F5
+ "-" RETROK_MINUS
+ "=" RETROK_EQUALS
+ "/" RETROK_SLASH
+ "[" RETROK_LEFTBRACKET
+ "]" RETROK_RIGHTBRACKET
+ ";" RETROK_SEMICOLON
+ "~" RETROK_TILDE
+ ":" RETROK_COLON
+ "?" RETROK_QUESTION
+ "!" RETROK_EXCLAIM
+ "RSHIFT" RETROK_RSHIFT
+ "RCTRL" RETROK_RCTRL
+ "RALT" RETROK_RALT
+ "6" RETROK_6
+ "7" RETROK_7
+ "8" RETROK_8
+ "9" RETROK_9
+ "0" RETROK_0
+ "Y" RETROK_y
+ "U" RETROK_u
+ "I" RETROK_i
+ "O" RETROK_o
+ "P" RETROK_p
+ "H" RETROK_h
+ "J" RETROK_j
+ "K" RETROK_k
+ "L" RETROK_l
+ "'" RETROK_QUOTE
+ "N" RETROK_n
+ "M" RETROK_m
+ "," RETROK_COMMA
+ "." RETROK_PERIOD
+ "BKSPC" RETROK_BACKSPACE
+ "TAB" RETROK_TAB
+ "RETURN" RETROK_RETURN
+ "F6" RETROK_F6
+ "F7" RETROK_F7
+ "F8" RETROK_F8
+ "F9" RETROK_F9
+ "F10" RETROK_F10
+ "PAGEUP" RETROK_PAGEUP
+ "HOME" RETROK_HOME
+ "INS" RETROK_INSERT
+ "END" RETROK_END
+ "PAGEDWN" RETROK_PAGEDOWN
+ "F11" RETROK_F11
+ "⬆️" RETROK_UP
+ "F12" RETROK_F12
+ "⬅️" RETROK_LEFT
+ "⬇️" RETROK_DOWN
+ "➡️" RETROK_RIGHT
+ "DEL" RETROK_DELETE
+ "SPACE" RETROK_SPACE
+ "ESC" RETROK_ESCAPE
+ "RETURN" RETROK_RETURN
+ */
+
+@interface LibretroKeyboardCode : NSObject
+
+@property(assign, readonly) unsigned code;
+
++ (instancetype)createCodeWithLabel:(NSString *_Nonnull)label;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/ManicEmu/Libretro/LibretroKeyboardCode.m b/ManicEmu/Libretro/LibretroKeyboardCode.m
new file mode 100644
index 00000000..b74697fd
--- /dev/null
+++ b/ManicEmu/Libretro/LibretroKeyboardCode.m
@@ -0,0 +1,116 @@
+//
+// LibretroKeyboardCode.m
+// Libretro
+//
+// Created by Daiuno on 2026/1/24.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+#import "LibretroKeyboardCode.h"
+#include "../../libretro-common/include/libretro.h"
+
+@interface LibretroKeyboardCode()
+
+@property(nonatomic, copy) NSString *label;
+@property(assign) unsigned code;
+
+@end
+
+@implementation LibretroKeyboardCode
+
++ (instancetype)createCodeWithLabel:(NSString *)label code:(unsigned)code {
+ LibretroKeyboardCode *keyboardCode = [LibretroKeyboardCode new];
+ keyboardCode.label = label;
+ keyboardCode.code = code;
+ return keyboardCode;
+}
+
++ (instancetype)createCodeWithLabel:(NSString *_Nonnull)label {
+ if ([label isEqualToString:@"1"]) { return [self createCodeWithLabel:label code:RETROK_1]; }
+ else if ([label isEqualToString:@"2"]) { return [self createCodeWithLabel:label code:RETROK_2]; }
+ else if ([label isEqualToString:@"3"]) { return [self createCodeWithLabel:label code:RETROK_3]; }
+ else if ([label isEqualToString:@"4"]) { return [self createCodeWithLabel:label code:RETROK_4]; }
+ else if ([label isEqualToString:@"5"]) { return [self createCodeWithLabel:label code:RETROK_5]; }
+ else if ([label isEqualToString:@"Q"]) { return [self createCodeWithLabel:label code:RETROK_q]; }
+ else if ([label isEqualToString:@"W"]) { return [self createCodeWithLabel:label code:RETROK_w]; }
+ else if ([label isEqualToString:@"E"]) { return [self createCodeWithLabel:label code:RETROK_e]; }
+ else if ([label isEqualToString:@"R"]) { return [self createCodeWithLabel:label code:RETROK_r]; }
+ else if ([label isEqualToString:@"T"]) { return [self createCodeWithLabel:label code:RETROK_t]; }
+ else if ([label isEqualToString:@"A"]) { return [self createCodeWithLabel:label code:RETROK_a]; }
+ else if ([label isEqualToString:@"S"]) { return [self createCodeWithLabel:label code:RETROK_s]; }
+ else if ([label isEqualToString:@"D"]) { return [self createCodeWithLabel:label code:RETROK_d]; }
+ else if ([label isEqualToString:@"F"]) { return [self createCodeWithLabel:label code:RETROK_f]; }
+ else if ([label isEqualToString:@"G"]) { return [self createCodeWithLabel:label code:RETROK_g]; }
+ else if ([label isEqualToString:@"Z"]) { return [self createCodeWithLabel:label code:RETROK_z]; }
+ else if ([label isEqualToString:@"X"]) { return [self createCodeWithLabel:label code:RETROK_x]; }
+ else if ([label isEqualToString:@"C"]) { return [self createCodeWithLabel:label code:RETROK_c]; }
+ else if ([label isEqualToString:@"V"]) { return [self createCodeWithLabel:label code:RETROK_v]; }
+ else if ([label isEqualToString:@"B"]) { return [self createCodeWithLabel:label code:RETROK_b]; }
+ else if ([label isEqualToString:@"FN"]) { return [self createCodeWithLabel:label code:9000]; }
+ else if ([label isEqualToString:@"LSHIFT"]) { return [self createCodeWithLabel:label code:RETROK_LSHIFT]; }
+ else if ([label isEqualToString:@"LCTRL"]) { return [self createCodeWithLabel:label code:RETROK_LCTRL]; }
+ else if ([label isEqualToString:@"LALT"]) { return [self createCodeWithLabel:label code:RETROK_LALT]; }
+ else if ([label isEqualToString:@"F1"]) { return [self createCodeWithLabel:label code:RETROK_F1]; }
+ else if ([label isEqualToString:@"F2"]) { return [self createCodeWithLabel:label code:RETROK_F2]; }
+ else if ([label isEqualToString:@"F3"]) { return [self createCodeWithLabel:label code:RETROK_F3]; }
+ else if ([label isEqualToString:@"F4"]) { return [self createCodeWithLabel:label code:RETROK_F4]; }
+ else if ([label isEqualToString:@"F5"]) { return [self createCodeWithLabel:label code:RETROK_F5]; }
+ else if ([label isEqualToString:@"-"]) { return [self createCodeWithLabel:label code:RETROK_MINUS]; }
+ else if ([label isEqualToString:@"="]) { return [self createCodeWithLabel:label code:RETROK_EQUALS]; }
+ else if ([label isEqualToString:@"/"]) { return [self createCodeWithLabel:label code:RETROK_SLASH]; }
+ else if ([label isEqualToString:@"["]) { return [self createCodeWithLabel:label code:RETROK_LEFTBRACKET]; }
+ else if ([label isEqualToString:@"]"]) { return [self createCodeWithLabel:label code:RETROK_RIGHTBRACKET]; }
+ else if ([label isEqualToString:@";"]) { return [self createCodeWithLabel:label code:RETROK_SEMICOLON]; }
+ else if ([label isEqualToString:@"~"]) { return [self createCodeWithLabel:label code:RETROK_TILDE]; }
+ else if ([label isEqualToString:@":"]) { return [self createCodeWithLabel:label code:RETROK_COLON]; }
+ else if ([label isEqualToString:@"?"]) { return [self createCodeWithLabel:label code:RETROK_QUESTION]; }
+ else if ([label isEqualToString:@"!"]) { return [self createCodeWithLabel:label code:RETROK_EXCLAIM]; }
+ else if ([label isEqualToString:@"RSHIFT"]) { return [self createCodeWithLabel:label code:RETROK_RSHIFT]; }
+ else if ([label isEqualToString:@"RCTRL"]) { return [self createCodeWithLabel:label code:RETROK_RCTRL]; }
+ else if ([label isEqualToString:@"RALT"]) { return [self createCodeWithLabel:label code:RETROK_RALT]; }
+ else if ([label isEqualToString:@"6"]) { return [self createCodeWithLabel:label code:RETROK_6]; }
+ else if ([label isEqualToString:@"7"]) { return [self createCodeWithLabel:label code:RETROK_7]; }
+ else if ([label isEqualToString:@"8"]) { return [self createCodeWithLabel:label code:RETROK_8]; }
+ else if ([label isEqualToString:@"9"]) { return [self createCodeWithLabel:label code:RETROK_9]; }
+ else if ([label isEqualToString:@"0"]) { return [self createCodeWithLabel:label code:RETROK_0]; }
+ else if ([label isEqualToString:@"Y"]) { return [self createCodeWithLabel:label code:RETROK_y]; }
+ else if ([label isEqualToString:@"U"]) { return [self createCodeWithLabel:label code:RETROK_u]; }
+ else if ([label isEqualToString:@"I"]) { return [self createCodeWithLabel:label code:RETROK_i]; }
+ else if ([label isEqualToString:@"O"]) { return [self createCodeWithLabel:label code:RETROK_o]; }
+ else if ([label isEqualToString:@"P"]) { return [self createCodeWithLabel:label code:RETROK_p]; }
+ else if ([label isEqualToString:@"H"]) { return [self createCodeWithLabel:label code:RETROK_h]; }
+ else if ([label isEqualToString:@"J"]) { return [self createCodeWithLabel:label code:RETROK_j]; }
+ else if ([label isEqualToString:@"K"]) { return [self createCodeWithLabel:label code:RETROK_k]; }
+ else if ([label isEqualToString:@"L"]) { return [self createCodeWithLabel:label code:RETROK_l]; }
+ else if ([label isEqualToString:@"'"]) { return [self createCodeWithLabel:label code:RETROK_QUOTE]; }
+ else if ([label isEqualToString:@"N"]) { return [self createCodeWithLabel:label code:RETROK_n]; }
+ else if ([label isEqualToString:@"M"]) { return [self createCodeWithLabel:label code:RETROK_m]; }
+ else if ([label isEqualToString:@","]) { return [self createCodeWithLabel:label code:RETROK_COMMA]; }
+ else if ([label isEqualToString:@"."]) { return [self createCodeWithLabel:label code:RETROK_PERIOD]; }
+ else if ([label isEqualToString:@"BKSPC"]) { return [self createCodeWithLabel:label code:RETROK_BACKSPACE]; }
+ else if ([label isEqualToString:@"TAB"]) { return [self createCodeWithLabel:label code:RETROK_TAB]; }
+ else if ([label isEqualToString:@"RETURN"]) { return [self createCodeWithLabel:label code:RETROK_RETURN]; }
+ else if ([label isEqualToString:@"F6"]) { return [self createCodeWithLabel:label code:RETROK_F6]; }
+ else if ([label isEqualToString:@"F7"]) { return [self createCodeWithLabel:label code:RETROK_F7]; }
+ else if ([label isEqualToString:@"F8"]) { return [self createCodeWithLabel:label code:RETROK_F8]; }
+ else if ([label isEqualToString:@"F9"]) { return [self createCodeWithLabel:label code:RETROK_F9]; }
+ else if ([label isEqualToString:@"F10"]) { return [self createCodeWithLabel:label code:RETROK_F10]; }
+ else if ([label isEqualToString:@"PAGEUP"]) { return [self createCodeWithLabel:label code:RETROK_PAGEUP]; }
+ else if ([label isEqualToString:@"HOME"]) { return [self createCodeWithLabel:label code:RETROK_HOME]; }
+ else if ([label isEqualToString:@"INS"]) { return [self createCodeWithLabel:label code:RETROK_INSERT]; }
+ else if ([label isEqualToString:@"END"]) { return [self createCodeWithLabel:label code:RETROK_END]; }
+ else if ([label isEqualToString:@"PAGEDWN"]) { return [self createCodeWithLabel:label code:RETROK_PAGEDOWN]; }
+ else if ([label isEqualToString:@"F11"]) { return [self createCodeWithLabel:label code:RETROK_F11]; }
+ else if ([label isEqualToString:@"⬆️"]) { return [self createCodeWithLabel:label code:RETROK_UP]; }
+ else if ([label isEqualToString:@"F12"]) { return [self createCodeWithLabel:label code:RETROK_F12]; }
+ else if ([label isEqualToString:@"⬅️"]) { return [self createCodeWithLabel:label code:RETROK_LEFT]; }
+ else if ([label isEqualToString:@"⬇️"]) { return [self createCodeWithLabel:label code:RETROK_DOWN]; }
+ else if ([label isEqualToString:@"➡️"]) { return [self createCodeWithLabel:label code:RETROK_RIGHT]; }
+ else if ([label isEqualToString:@"DEL"]) { return [self createCodeWithLabel:label code:RETROK_DELETE]; }
+ else if ([label isEqualToString:@"SPACE"]) { return [self createCodeWithLabel:label code:RETROK_SPACE]; }
+ else if ([label isEqualToString:@"ESC"]) { return [self createCodeWithLabel:label code:RETROK_ESCAPE]; }
+ else if ([label isEqualToString:@"RETURN"]) { return [self createCodeWithLabel:label code:RETROK_RETURN]; }
+ return nil;
+}
+
+@end
diff --git a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
index 054c403d..d3a826bd 100644
--- a/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
+++ b/ManicEmu/ManicEmu.xcodeproj/project.pbxproj
@@ -89,6 +89,22 @@
57399B192E42EDEA00AB73DD /* DeadZoneControl.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57399B182E42EDE800AB73DD /* DeadZoneControl.swift */; };
5739D1BE2DA79D2A0090409D /* DataExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5739D1BD2DA79D220090409D /* DataExtension.swift */; };
573BECBD2D1D3F6B008AD18D /* HomeTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573BECBC2D1D3F6B008AD18D /* HomeTabBar.swift */; };
+ 573CED7E2F1CE2D900EA24F1 /* desmume.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 573CED7C2F1CE2C100EA24F1 /* desmume.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 573CEE0E2F20D05800EA24F1 /* RomPatcherView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE0C2F20D05100EA24F1 /* RomPatcherView.swift */; };
+ 573CEE122F20D46D00EA24F1 /* LocalWebServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE112F20D46B00EA24F1 /* LocalWebServer.swift */; };
+ 573CEE2B2F21036800EA24F1 /* MultiDiscAddCollectionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE292F21035800EA24F1 /* MultiDiscAddCollectionCell.swift */; };
+ 573CEE3D2F21431300EA24F1 /* FlexBackground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE392F21430D00EA24F1 /* FlexBackground.swift */; };
+ 573CEE6D2F224FB300EA24F1 /* ShaderConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE6B2F224FAE00EA24F1 /* ShaderConfig.swift */; };
+ 573CEE812F2338BC00EA24F1 /* A2600.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE7F2F2338B700EA24F1 /* A2600.swift */; };
+ 573CEE872F2338D100EA24F1 /* A5200.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE822F2338C000EA24F1 /* A5200.swift */; };
+ 573CEE8C2F2338D800EA24F1 /* A7800.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE882F2338D500EA24F1 /* A7800.swift */; };
+ 573CEE912F23396400EA24F1 /* Jaguar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE902F23396200EA24F1 /* Jaguar.swift */; };
+ 573CEE962F23396D00EA24F1 /* Lynx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 573CEE952F23396C00EA24F1 /* Lynx.swift */; };
+ 573CEE9F2F23404B00EA24F1 /* stella.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 573CEE9C2F23403100EA24F1 /* stella.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 573CEEA22F23405800EA24F1 /* atari800.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 573CEE992F23403100EA24F1 /* atari800.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 573CEEA52F23405F00EA24F1 /* prosystem.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 573CEE9B2F23403100EA24F1 /* prosystem.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 573CEEA82F23407500EA24F1 /* holani.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 573CEE9A2F23403100EA24F1 /* holani.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 573CEEAB2F23408400EA24F1 /* virtualjaguar.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 573CEE9D2F23403100EA24F1 /* virtualjaguar.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
5744C6622E34D6E20088081A /* KeyboardKit in Frameworks */ = {isa = PBXBuildFile; productRef = 5744C6612E34D6E20088081A /* KeyboardKit */; };
5744C6CF2E360AF00088081A /* UIControllerKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5744C6CE2E360AD50088081A /* UIControllerKit.swift */; };
5744C6FF2E368BB40088081A /* NoControllCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5744C6FE2E368BA50088081A /* NoControllCollectionView.swift */; };
@@ -106,6 +122,7 @@
574ABEBC2E609FE60045F76E /* GBA.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574ABEBB2E609FE30045F76E /* GBA.swift */; };
574ABEC42E60A3C30045F76E /* vbam.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 574ABE952E6020880045F76E /* vbam.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
574ABEC52E60A3C90045F76E /* mgba.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 574ABE942E6020880045F76E /* mgba.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
+ 574BCC742F324C92009BD74E /* Cipher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 574BCC732F324C8E009BD74E /* Cipher.swift */; };
57526B7E2EADEED0003F91BD /* FDS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57526B7D2EADEECD003F91BD /* FDS.swift */; };
5754D8882E274AA5001EA5ED /* OnlinePlaySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5754D8872E274A9D001EA5ED /* OnlinePlaySettingViewController.swift */; };
5754D88B2E274AC7001EA5ED /* OnlinePlaySettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5754D88A2E274AB9001EA5ED /* OnlinePlaySettingView.swift */; };
@@ -119,6 +136,8 @@
575A39D02DCD2B3E00B28FC2 /* UIImageViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575A39CF2DCD2B3500B28FC2 /* UIImageViewExtensions.swift */; };
575A39D22DCD2F9C00B28FC2 /* GameCoverSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575A39D12DCD2F9000B28FC2 /* GameCoverSearchViewController.swift */; };
575A39D42DCD9C7100B28FC2 /* GameCoverSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575A39D32DCD9C7000B28FC2 /* GameCoverSearchView.swift */; };
+ 575AD5832F24902F00C2B7E4 /* LibretroKeyboardCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 575AD5812F24902F00C2B7E4 /* LibretroKeyboardCode.h */; };
+ 575AD5842F24902F00C2B7E4 /* LibretroKeyboardCode.m in Sources */ = {isa = PBXBuildFile; fileRef = 575AD5822F24902F00C2B7E4 /* LibretroKeyboardCode.m */; };
575DD2C72DDB809600EB1DBB /* Libretro.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 57BFBE172DD32F7700AABF98 /* Libretro.framework */; };
575FF8E82D34A6DF0043B2F3 /* System.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575FF8E72D34A6DF0043B2F3 /* System.swift */; };
575FF91D2D350F210043B2F3 /* PlayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575FF91C2D350F170043B2F3 /* PlayViewController.swift */; };
@@ -150,7 +169,7 @@
5768FCC32DAE00B4009974D1 /* seed_db.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768F88E2DAE00B4009974D1 /* seed_db.cpp */; };
5768FCC42DAE00B4009974D1 /* CameraInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5768FC1A2DAE00B4009974D1 /* CameraInterface.mm */; };
5768FCC52DAE00B4009974D1 /* arm_dyncom_thumb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768F8652DAE00B4009974D1 /* arm_dyncom_thumb.cpp */; };
- 5768FCC62DAE00B4009974D1 /* openal_input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768F83C2DAE00B4009974D1 /* openal_input.cpp */; };
+ 5768FCC62DAE00B4009974D1 /* openal_input.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5768F83C2DAE00B4009974D1 /* openal_input.mm */; };
5768FCC72DAE00B4009974D1 /* am.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768F8CB2DAE00B4009974D1 /* am.cpp */; };
5768FCC82DAE00B4009974D1 /* perf_stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768F97E2DAE00B4009974D1 /* perf_stats.cpp */; };
5768FCC92DAE00B4009974D1 /* nim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5768F92F2DAE00B4009974D1 /* nim.cpp */; };
@@ -600,7 +619,8 @@
5781F4992EEE71B500916D8B /* ShaderOrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5781F4972EEE71A800916D8B /* ShaderOrderView.swift */; };
5781F49E2EEE957200916D8B /* ShaderOrderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5781F49C2EEE956900916D8B /* ShaderOrderCell.swift */; };
5781F4EB2EEFE44F00916D8B /* NumbersExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5781F4E92EEFE44800916D8B /* NumbersExtensions.swift */; };
- 5781F5462EF1384500916D8B /* MelonNXKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5781F5442EF1383F00916D8B /* MelonNXKit.swift */; };
+ 5781F5462EF1384500916D8B /* MeloNXKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5781F5442EF1383F00916D8B /* MeloNXKit.swift */; };
+ 5781F5AE2EF45C8200916D8B /* JGenesisView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5781F5AB2EF45C6900916D8B /* JGenesisView.swift */; };
579076E32D8A990700ED90FB /* FunctionButtonContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579076E22D8A98FC00ED90FB /* FunctionButtonContainerView.swift */; };
579076F02D8AAC2900ED90FB /* TransparentHoleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 579076EF2D8AAC2800ED90FB /* TransparentHoleView.swift */; };
57913AF52D5D89CF004D51AA /* TouchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57913AF42D5D89CC004D51AA /* TouchController.swift */; };
@@ -623,6 +643,7 @@
57A4816A2E7F05D2001D4598 /* NDS.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57A481692E7F05CD001D4598 /* NDS.swift */; };
57AD35EA2D7DEB9D0092FD03 /* WebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57AD35E92D7DEB900092FD03 /* WebViewController.swift */; };
57AD35EC2D7DEF360092FD03 /* SheerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57AD35EB2D7DEF2E0092FD03 /* SheerExtensions.swift */; };
+ 57AEB9DC2F2614C6005CB496 /* NavigationBlurView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57AEB9DA2F2614BF005CB496 /* NavigationBlurView.swift */; };
57B5E3142ECC625E00DE17E9 /* Arcade.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B5E3122ECC625600DE17E9 /* Arcade.swift */; };
57B5E31B2ECC738500DE17E9 /* mame.libretro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 57B5E3192ECC735D00DE17E9 /* mame.libretro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
57B5E3242ECCCD0800DE17E9 /* MAMEKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57B5E3222ECCCD0100DE17E9 /* MAMEKit.swift */; };
@@ -860,6 +881,12 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
+ 573CEEAB2F23408400EA24F1 /* virtualjaguar.libretro.framework in Embed Frameworks */,
+ 573CEEA82F23407500EA24F1 /* holani.libretro.framework in Embed Frameworks */,
+ 573CEEA52F23405F00EA24F1 /* prosystem.libretro.framework in Embed Frameworks */,
+ 573CEEA22F23405800EA24F1 /* atari800.libretro.framework in Embed Frameworks */,
+ 573CEE9F2F23404B00EA24F1 /* stella.libretro.framework in Embed Frameworks */,
+ 573CED7E2F1CE2D900EA24F1 /* desmume.libretro.framework in Embed Frameworks */,
571F835A2ECF485500D52663 /* azahar.libretro.framework in Embed Frameworks */,
57B5E34A2ECE0A2800DE17E9 /* fbneo.libretro.framework in Embed Frameworks */,
57B5E31B2ECC738500DE17E9 /* mame.libretro.framework in Embed Frameworks */,
@@ -998,6 +1025,22 @@
57399B182E42EDE800AB73DD /* DeadZoneControl.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeadZoneControl.swift; sourceTree = "<group>"; };
5739D1BD2DA79D220090409D /* DataExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataExtension.swift; sourceTree = "<group>"; };
573BECBC2D1D3F6B008AD18D /* HomeTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeTabBar.swift; sourceTree = "<group>"; };
+ 573CED7C2F1CE2C100EA24F1 /* desmume.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = desmume.libretro.framework; path = ../Cores/desmume.libretro.framework; sourceTree = SOURCE_ROOT; };
+ 573CEE0C2F20D05100EA24F1 /* RomPatcherView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RomPatcherView.swift; sourceTree = "<group>"; };
+ 573CEE112F20D46B00EA24F1 /* LocalWebServer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalWebServer.swift; sourceTree = "<group>"; };
+ 573CEE292F21035800EA24F1 /* MultiDiscAddCollectionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiDiscAddCollectionCell.swift; sourceTree = "<group>"; };
+ 573CEE392F21430D00EA24F1 /* FlexBackground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlexBackground.swift; sourceTree = "<group>"; };
+ 573CEE6B2F224FAE00EA24F1 /* ShaderConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShaderConfig.swift; sourceTree = "<group>"; };
+ 573CEE7F2F2338B700EA24F1 /* A2600.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = A2600.swift; sourceTree = "<group>"; };
+ 573CEE822F2338C000EA24F1 /* A5200.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = A5200.swift; sourceTree = "<group>"; };
+ 573CEE882F2338D500EA24F1 /* A7800.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = A7800.swift; sourceTree = "<group>"; };
+ 573CEE902F23396200EA24F1 /* Jaguar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Jaguar.swift; sourceTree = "<group>"; };
+ 573CEE952F23396C00EA24F1 /* Lynx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Lynx.swift; sourceTree = "<group>"; };
+ 573CEE992F23403100EA24F1 /* atari800.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = atari800.libretro.framework; path = ../Cores/atari800.libretro.framework; sourceTree = SOURCE_ROOT; };
+ 573CEE9A2F23403100EA24F1 /* holani.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = holani.libretro.framework; path = ../Cores/holani.libretro.framework; sourceTree = SOURCE_ROOT; };
+ 573CEE9B2F23403100EA24F1 /* prosystem.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = prosystem.libretro.framework; path = ../Cores/prosystem.libretro.framework; sourceTree = SOURCE_ROOT; };
+ 573CEE9C2F23403100EA24F1 /* stella.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = stella.libretro.framework; path = ../Cores/stella.libretro.framework; sourceTree = SOURCE_ROOT; };
+ 573CEE9D2F23403100EA24F1 /* virtualjaguar.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = virtualjaguar.libretro.framework; path = ../Cores/virtualjaguar.libretro.framework; sourceTree = SOURCE_ROOT; };
5744C6CE2E360AD50088081A /* UIControllerKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIControllerKit.swift; sourceTree = "<group>"; };
5744C6FE2E368BA50088081A /* NoControllCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoControllCollectionView.swift; sourceTree = "<group>"; };
5744C7172E375BF00088081A /* PM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PM.swift; sourceTree = "<group>"; };
@@ -1014,6 +1057,7 @@
574ABE952E6020880045F76E /* vbam.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = vbam.libretro.framework; path = ../Cores/vbam.libretro.framework; sourceTree = SOURCE_ROOT; };
574ABE982E6021520045F76E /* GBC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GBC.swift; sourceTree = "<group>"; };
574ABEBB2E609FE30045F76E /* GBA.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GBA.swift; sourceTree = "<group>"; };
+ 574BCC732F324C8E009BD74E /* Cipher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cipher.swift; sourceTree = "<group>"; };
57526B7D2EADEECD003F91BD /* FDS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FDS.swift; sourceTree = "<group>"; };
5754D8872E274A9D001EA5ED /* OnlinePlaySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlinePlaySettingViewController.swift; sourceTree = "<group>"; };
5754D88A2E274AB9001EA5ED /* OnlinePlaySettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlinePlaySettingView.swift; sourceTree = "<group>"; };
@@ -1027,6 +1071,8 @@
575A39D12DCD2F9000B28FC2 /* GameCoverSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameCoverSearchViewController.swift; sourceTree = "<group>"; };
575A39D32DCD9C7000B28FC2 /* GameCoverSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameCoverSearchView.swift; sourceTree = "<group>"; };
575A3A422DCEE9F300B28FC2 /* Config-SideloadRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Config-SideloadRelease.xcconfig"; sourceTree = "<group>"; };
+ 575AD5812F24902F00C2B7E4 /* LibretroKeyboardCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LibretroKeyboardCode.h; sourceTree = "<group>"; };
+ 575AD5822F24902F00C2B7E4 /* LibretroKeyboardCode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LibretroKeyboardCode.m; sourceTree = "<group>"; };
575F03A62DD59AED00950399 /* manic_joypad.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = manic_joypad.m; path = ../Cores/Libretro/input/drivers_joypad/manic_joypad.m; sourceTree = SOURCE_ROOT; };
575F03BA2DD5E46B00950399 /* platform_darwin.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = platform_darwin.m; path = ../Cores/Libretro/frontend/drivers/platform_darwin.m; sourceTree = SOURCE_ROOT; };
575FF8E72D34A6DF0043B2F3 /* System.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = System.swift; sourceTree = "<group>"; };
@@ -1056,7 +1102,7 @@
5768F8392DAE00B4009974D1 /* dsp_interface.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = dsp_interface.cpp; sourceTree = "<group>"; };
5768F83A2DAE00B4009974D1 /* input_details.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = input_details.cpp; sourceTree = "<group>"; };
5768F83B2DAE00B4009974D1 /* interpolate.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = interpolate.cpp; sourceTree = "<group>"; };
- 5768F83C2DAE00B4009974D1 /* openal_input.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = openal_input.cpp; sourceTree = "<group>"; };
+ 5768F83C2DAE00B4009974D1 /* openal_input.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = openal_input.mm; sourceTree = "<group>"; };
5768F83D2DAE00B4009974D1 /* openal_sink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = openal_sink.cpp; sourceTree = "<group>"; };
5768F83E2DAE00B4009974D1 /* sdl3_sink.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sdl3_sink.cpp; sourceTree = "<group>"; };
5768F83F2DAE00B4009974D1 /* sink_details.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = sink_details.cpp; sourceTree = "<group>"; };
@@ -1676,7 +1722,8 @@
5781F4972EEE71A800916D8B /* ShaderOrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShaderOrderView.swift; sourceTree = "<group>"; };
5781F49C2EEE956900916D8B /* ShaderOrderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShaderOrderCell.swift; sourceTree = "<group>"; };
5781F4E92EEFE44800916D8B /* NumbersExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumbersExtensions.swift; sourceTree = "<group>"; };
- 5781F5442EF1383F00916D8B /* MelonNXKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MelonNXKit.swift; sourceTree = "<group>"; };
+ 5781F5442EF1383F00916D8B /* MeloNXKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeloNXKit.swift; sourceTree = "<group>"; };
+ 5781F5AB2EF45C6900916D8B /* JGenesisView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JGenesisView.swift; sourceTree = "<group>"; };
579076E22D8A98FC00ED90FB /* FunctionButtonContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FunctionButtonContainerView.swift; sourceTree = "<group>"; };
579076EF2D8AAC2800ED90FB /* TransparentHoleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransparentHoleView.swift; sourceTree = "<group>"; };
57913AF42D5D89CC004D51AA /* TouchController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchController.swift; sourceTree = "<group>"; };
@@ -1702,6 +1749,7 @@
57AD35EB2D7DEF2E0092FD03 /* SheerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SheerExtensions.swift; sourceTree = "<group>"; };
57ADFED92D94F52500502E5C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
57ADFEDA2D94F52500502E5C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
+ 57AEB9DA2F2614BF005CB496 /* NavigationBlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBlurView.swift; sourceTree = "<group>"; };
57B5E3122ECC625600DE17E9 /* Arcade.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Arcade.swift; sourceTree = "<group>"; };
57B5E3192ECC735D00DE17E9 /* mame.libretro.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = mame.libretro.framework; path = ../Cores/mame.libretro.framework; sourceTree = SOURCE_ROOT; };
57B5E3222ECCCD0100DE17E9 /* MAMEKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MAMEKit.swift; sourceTree = "<group>"; };
@@ -2140,6 +2188,14 @@
path = Models;
sourceTree = "<group>";
};
+ 573CEE362F2142CF00EA24F1 /* Models */ = {
+ isa = PBXGroup;
+ children = (
+ 573CEE392F21430D00EA24F1 /* FlexBackground.swift */,
+ );
+ path = Models;
+ sourceTree = "<group>";
+ };
574789B82D4F8760006F0D99 /* SectionIndexView */ = {
isa = PBXGroup;
children = (
@@ -2287,7 +2343,7 @@
5768F8392DAE00B4009974D1 /* dsp_interface.cpp */,
5768F83A2DAE00B4009974D1 /* input_details.cpp */,
5768F83B2DAE00B4009974D1 /* interpolate.cpp */,
- 5768F83C2DAE00B4009974D1 /* openal_input.cpp */,
+ 5768F83C2DAE00B4009974D1 /* openal_input.mm */,
5768F83D2DAE00B4009974D1 /* openal_sink.cpp */,
5768F83E2DAE00B4009974D1 /* sdl3_sink.cpp */,
5768F83F2DAE00B4009974D1 /* sink_details.cpp */,
@@ -3712,6 +3768,7 @@
577006562D410D7F00762E8F /* BrowserItemCollectionViewCell.swift */,
576C46302E16D8F20008D087 /* MultiDiscDescCollectionCell.swift */,
576C46342E16DA0D0008D087 /* MultiDiscItemCollectionCell.swift */,
+ 573CEE292F21035800EA24F1 /* MultiDiscAddCollectionCell.swift */,
);
path = Views;
sourceTree = "<group>";
@@ -3719,6 +3776,7 @@
5770069F2D44CB6900762E8F /* Skin */ = {
isa = PBXGroup;
children = (
+ 573CEE362F2142CF00EA24F1 /* Models */,
57CCB3A72D66CE4D0036476B /* Views */,
577006A02D44CB7400762E8F /* ViewControllers */,
);
@@ -3738,6 +3796,7 @@
5781F46B2EED6DB600916D8B /* Models */ = {
isa = PBXGroup;
children = (
+ 573CEE6B2F224FAE00EA24F1 /* ShaderConfig.swift */,
5781F46D2EED6DBC00916D8B /* Shader.swift */,
);
path = Models;
@@ -3871,6 +3930,8 @@
570CF8332EEA58DE00696C1B /* AzaharKeyboardConfig.m */,
5781F4542EECF7CF00916D8B /* LibretroShaders.h */,
5781F4552EECF7CF00916D8B /* LibretroShaders.m */,
+ 575AD5812F24902F00C2B7E4 /* LibretroKeyboardCode.h */,
+ 575AD5822F24902F00C2B7E4 /* LibretroKeyboardCode.m */,
57BFBE642DD3330900AABF98 /* keyboard_event_apple.h */,
57BFBE622DD332FF00AABF98 /* input_keymaps.h */,
575F03A62DD59AED00950399 /* manic_joypad.m */,
@@ -3896,6 +3957,12 @@
57BFBE702DD335FD00AABF98 /* Cores */ = {
isa = PBXGroup;
children = (
+ 573CEE992F23403100EA24F1 /* atari800.libretro.framework */,
+ 573CEE9A2F23403100EA24F1 /* holani.libretro.framework */,
+ 573CEE9B2F23403100EA24F1 /* prosystem.libretro.framework */,
+ 573CEE9C2F23403100EA24F1 /* stella.libretro.framework */,
+ 573CEE9D2F23403100EA24F1 /* virtualjaguar.libretro.framework */,
+ 573CED7C2F1CE2C100EA24F1 /* desmume.libretro.framework */,
571F83582ECF484700D52663 /* azahar.libretro.framework */,
57B5E3482ECE0A1A00DE17E9 /* fbneo.libretro.framework */,
57B5E3192ECC735D00DE17E9 /* mame.libretro.framework */,
@@ -4129,6 +4196,11 @@
57F0D8402DE2CD7500760F57 /* Cores */ = {
isa = PBXGroup;
children = (
+ 573CEE952F23396C00EA24F1 /* Lynx.swift */,
+ 573CEE902F23396200EA24F1 /* Jaguar.swift */,
+ 573CEE882F2338D500EA24F1 /* A7800.swift */,
+ 573CEE822F2338C000EA24F1 /* A5200.swift */,
+ 573CEE7F2F2338B700EA24F1 /* A2600.swift */,
57B5E3122ECC625600DE17E9 /* Arcade.swift */,
57526B7D2EADEECD003F91BD /* FDS.swift */,
57A481692E7F05CD001D4598 /* NDS.swift */,
@@ -4233,6 +4305,9 @@
A561F94D257DCB5200E800A8 /* Views */ = {
isa = PBXGroup;
children = (
+ 57AEB9DA2F2614BF005CB496 /* NavigationBlurView.swift */,
+ 573CEE0C2F20D05100EA24F1 /* RomPatcherView.swift */,
+ 5781F5AB2EF45C6900916D8B /* JGenesisView.swift */,
57EED0752ECB8172003971BD /* IconView.swift */,
A392D5B22E9796B800F920E7 /* ServiceIconView.swift */,
A392D5632E96682600F920E7 /* DisabledTapSwitch.swift */,
@@ -4296,6 +4371,7 @@
579C114A2D1D0B1900CFD1F5 /* ApplicationSceneDelegate.swift */,
57F1A9332D7D6D7C00D0CC93 /* ExternalSceneDelegate.swift */,
A58C3F4A248E3DB50099E068 /* Constants.swift */,
+ 574BCC732F324C8E009BD74E /* Cipher.swift */,
A58C3F4C248E43B30099E068 /* Bridging-Header.h */,
);
path = Base;
@@ -4367,7 +4443,8 @@
A5A69BA9256E56FF00D51C09 /* Others */ = {
isa = PBXGroup;
children = (
- 5781F5442EF1383F00916D8B /* MelonNXKit.swift */,
+ 573CEE112F20D46B00EA24F1 /* LocalWebServer.swift */,
+ 5781F5442EF1383F00916D8B /* MeloNXKit.swift */,
57B5E3222ECCCD0100DE17E9 /* MAMEKit.swift */,
5771C1A72E6207650062EDE0 /* MobyGamesKit.swift */,
5744C6CE2E360AD50088081A /* UIControllerKit.swift */,
@@ -4517,6 +4594,7 @@
buildActionMask = 2147483647;
files = (
57BFBE5B2DD332A100AABF98 /* LibretroCore.h in Headers */,
+ 575AD5832F24902F00C2B7E4 /* LibretroKeyboardCode.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -4775,7 +4853,7 @@
5768FCC32DAE00B4009974D1 /* seed_db.cpp in Sources */,
5768FCC42DAE00B4009974D1 /* CameraInterface.mm in Sources */,
5768FCC52DAE00B4009974D1 /* arm_dyncom_thumb.cpp in Sources */,
- 5768FCC62DAE00B4009974D1 /* openal_input.cpp in Sources */,
+ 5768FCC62DAE00B4009974D1 /* openal_input.mm in Sources */,
5768FCC72DAE00B4009974D1 /* am.cpp in Sources */,
5768FCC82DAE00B4009974D1 /* perf_stats.cpp in Sources */,
5768FCC92DAE00B4009974D1 /* nim.cpp in Sources */,
@@ -5146,6 +5224,7 @@
files = (
57BFBE6B2DD3331A00AABF98 /* griffin_glslang.cpp in Sources */,
5781F4572EECF7CF00916D8B /* LibretroShaders.m in Sources */,
+ 575AD5842F24902F00C2B7E4 /* LibretroKeyboardCode.m in Sources */,
57BFBE6C2DD3331A00AABF98 /* griffin_cpp.cpp in Sources */,
57BFBE6E2DD3331A00AABF98 /* griffin_objc.m in Sources */,
57BFBE5F2DD332DA00AABF98 /* LibretroCore.m in Sources */,
@@ -5244,6 +5323,7 @@
574ABEBC2E609FE60045F76E /* GBA.swift in Sources */,
5754D8932E2751CA001EA5ED /* WFC.swift in Sources */,
5770055F2D3CC40400762E8F /* Skin.swift in Sources */,
+ 573CEE8C2F2338D800EA24F1 /* A7800.swift in Sources */,
57913B492D5ED7D7004D51AA /* SaveItemCollectionViewCell.swift in Sources */,
577005D42D3F2F8E00762E8F /* WebServer.swift in Sources */,
B2F4B7B02A138C74003B0E07 /* PhotoSaver.swift in Sources */,
@@ -5251,6 +5331,7 @@
B278BA812A32DA9000D0458D /* PurchaseManager.swift in Sources */,
57DF840C2D61B3D500AA0AAB /* BlankSlateCollectionView.swift in Sources */,
575FF8E82D34A6DF0043B2F3 /* System.swift in Sources */,
+ 573CEE962F23396D00EA24F1 /* Lynx.swift in Sources */,
57DE104E2D6088BE00CDD82A /* BlankPlaceholderView.swift in Sources */,
57E962F82D6AB4540022914C /* PlayHistoryItemCollectionCell.swift in Sources */,
57CCB33B2D6584BC0036476B /* ObjectUpdatable.swift in Sources */,
@@ -5264,6 +5345,7 @@
5770061B2D4089ED00762E8F /* CloudDriveConnetor.swift in Sources */,
57AD35EC2D7DEF360092FD03 /* SheerExtensions.swift in Sources */,
57B6EBDB2D758819002E619C /* GameSaveMatchGameView.swift in Sources */,
+ 573CEE3D2F21431300EA24F1 /* FlexBackground.swift in Sources */,
574789BC2D4F8769006F0D99 /* SectionIndexView.swift in Sources */,
57D7CF9D2EA9D23500F41540 /* TriggerProListBlankSlateView.swift in Sources */,
57913B402D5ED4C1004D51AA /* GameInfoViewController.swift in Sources */,
@@ -5282,6 +5364,7 @@
57A480E72E74030E001D4598 /* CheevosChallengeView.swift in Sources */,
57B5E3142ECC625E00DE17E9 /* Arcade.swift in Sources */,
5720E7AA2E541F2000EC0DA5 /* RadialGradientView.swift in Sources */,
+ 573CEE0E2F20D05800EA24F1 /* RomPatcherView.swift in Sources */,
57B6ECC22D796B97002E619C /* CheatCodeCollectionViewCell.swift in Sources */,
A52C1D89257F96C90029B15B /* UIViewControllerExtensions.swift in Sources */,
57DE0FF82D5F456700CDD82A /* CheatCodeViewController.swift in Sources */,
@@ -5304,6 +5387,7 @@
577005612D3CD3AC00762E8F /* UTTypeExtensions.swift in Sources */,
57D7CF952EA8E7EE00F41540 /* TriggerProView.swift in Sources */,
5706B0372DFBEC1E0066122E /* SG1000.swift in Sources */,
+ 573CEE2B2F21036800EA24F1 /* MultiDiscAddCollectionCell.swift in Sources */,
57EED02C2EC8D7C8003971BD /* iCloudSettingView.swift in Sources */,
57CCB3CD2D6775080036476B /* Database.swift in Sources */,
5726FED82D71B63E00041AD5 /* CacheManager.swift in Sources */,
@@ -5330,6 +5414,7 @@
57E8B18D2E2553CE00F93E60 /* HomeMenuImage.swift in Sources */,
57DCE7FF2E0D9F300079E3AA /* NavigationRow.swift in Sources */,
57DCE8002E0D9F300079E3AA /* TapActionRow.swift in Sources */,
+ 573CEE872F2338D100EA24F1 /* A5200.swift in Sources */,
57D7CF4B2EA736C900F41540 /* TriggerProListCell.swift in Sources */,
57DCE8012E0D9F300079E3AA /* DetailText.swift in Sources */,
5720E7ED2E547FE100EC0DA5 /* AchievementsProfile.swift in Sources */,
@@ -5346,6 +5431,7 @@
57DCE8072E0D9F300079E3AA /* Icon.swift in Sources */,
57DCE8082E0D9F300079E3AA /* Configurable.swift in Sources */,
57DCE8092E0D9F300079E3AA /* SwitchCell.swift in Sources */,
+ 574BCC742F324C92009BD74E /* Cipher.swift in Sources */,
57DCE80A2E0D9F300079E3AA /* Section.swift in Sources */,
57DCE80B2E0D9F300079E3AA /* Subtitle.swift in Sources */,
57DCE80C2E0D9F300079E3AA /* Row.swift in Sources */,
@@ -5354,6 +5440,7 @@
57DCE80E2E0D9F300079E3AA /* RadioSection.swift in Sources */,
57DCE80F2E0D9F300079E3AA /* TapActionCell.swift in Sources */,
57F0D81A2DE1C2D700760F57 /* GameListStyleCollectionViewCell.swift in Sources */,
+ 573CEE122F20D46D00EA24F1 /* LocalWebServer.swift in Sources */,
5706AFBD2DF7D8AF0066122E /* BIOSSelectionViewController.swift in Sources */,
570CF8872EEB0AD200696C1B /* ShadersListViewController.swift in Sources */,
5770064F2D40E45F00762E8F /* CloudDriveBrowserViewController.swift in Sources */,
@@ -5375,6 +5462,7 @@
5706B0FD2DFFED170066122E /* menu_pipeline.metal in Sources */,
570F59BE2DC91FD9007BFD92 /* ColorPickerViewController.swift in Sources */,
57478A712D52037F006F0D99 /* RandomGameCollectionReusableView.swift in Sources */,
+ 573CEE6D2F224FB300EA24F1 /* ShaderConfig.swift in Sources */,
5720E8112E559EE600EC0DA5 /* RetroAchievementCountView.swift in Sources */,
577005B92D3E71BC00762E8F /* ImportService.swift in Sources */,
570622EC2D7BD2FE004F09E7 /* ShaderManager.swift in Sources */,
@@ -5404,6 +5492,7 @@
577006092D3F980400762E8F /* LowestHaderReusableView.swift in Sources */,
570F592E2DC885EF007BFD92 /* ThemeViewController.swift in Sources */,
57B5E3242ECCCD0800DE17E9 /* MAMEKit.swift in Sources */,
+ 573CEE912F23396400EA24F1 /* Jaguar.swift in Sources */,
57DA89322D8328510074052A /* CKAccountStatusExtensions.swift in Sources */,
5720E7652E540F7200EC0DA5 /* RetroAchievementsLoginView.swift in Sources */,
5781F4EB2EEFE44F00916D8B /* NumbersExtensions.swift in Sources */,
@@ -5426,6 +5515,7 @@
57047A142D856DBD00C62FF6 /* PriceView.swift in Sources */,
A392D5B32E9796B900F920E7 /* ServiceIconView.swift in Sources */,
5706AFCF2DF7FC730066122E /* SettingDescriptionCollectionViewCell.swift in Sources */,
+ 573CEE812F2338BC00EA24F1 /* A2600.swift in Sources */,
575FF91D2D350F210043B2F3 /* PlayViewController.swift in Sources */,
5781F4842EEE586000916D8B /* ShaderInfoInputCell.swift in Sources */,
5706B0452DFBF7DF0066122E /* MCD.swift in Sources */,
@@ -5445,7 +5535,7 @@
A392D5652E96682C00F920E7 /* DisabledTapSwitch.swift in Sources */,
57F632852D6EB485007270E8 /* UIScreenExtensions.swift in Sources */,
57B6ECC92D797CA3002E619C /* AddCheatCodeTitleCell.swift in Sources */,
- 5781F5462EF1384500916D8B /* MelonNXKit.swift in Sources */,
+ 5781F5462EF1384500916D8B /* MeloNXKit.swift in Sources */,
5706B0402DFBEC300066122E /* MS.swift in Sources */,
A5A001F324555A5F006E0F0E /* AppDelegate.swift in Sources */,
575A39CE2DCD011500B28FC2 /* OnlineCoverManager.swift in Sources */,
@@ -5464,6 +5554,7 @@
57D029192E6C9C5200BF1F9D /* CheevosProgressView.swift in Sources */,
57047A0A2D85217C00C62FF6 /* PurchaseView.swift in Sources */,
57EC6AB82D803810002920F0 /* PlayHistoryBlankSlateView.swift in Sources */,
+ 5781F5AE2EF45C8200916D8B /* JGenesisView.swift in Sources */,
B23E3DF22A0C9D9B0068EADA /* GradientView.swift in Sources */,
57EC6AC82D8119D9002920F0 /* SyncManager.swift in Sources */,
57655C1B2DF6AD04003E4A6E /* MD.swift in Sources */,
@@ -5475,6 +5566,7 @@
57E0CC532D8EACC70027FB8C /* ResourcesKit.swift in Sources */,
570CF88C2EEB0AE000696C1B /* ShadersListView.swift in Sources */,
571F837B2ECFFE4900D52663 /* AzaharAdvancedSettingViewController.swift in Sources */,
+ 57AEB9DC2F2614C6005CB496 /* NavigationBlurView.swift in Sources */,
5770069A2D44B9B500762E8F /* GamesNavigationView.swift in Sources */,
577006A22D44CB9C00762E8F /* SkinSettingsViewController.swift in Sources */,
5770069E2D44C01800762E8F /* GamesCollectionReusableView.swift in Sources */,
@@ -5805,7 +5897,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 575A3A422DCEE9F300B28FC2 /* Config-SideloadRelease.xcconfig */;
buildSettings = {
- ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32";
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -6022,7 +6114,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "STATIC_LIBRARY SIDE_LOAD";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
@@ -6163,7 +6255,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 579AB9D52E6C1118000868CB /* Config-SideloadDebug.xcconfig */;
buildSettings = {
- ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32";
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -6291,7 +6383,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "STATIC_LIBRARY SIDE_LOAD CRASH_COLLECT";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
@@ -6693,7 +6785,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 57E0363F2DBBE17100B222E1 /* Config-DebugSimulator.xcconfig */;
buildSettings = {
- ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32";
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -7028,7 +7120,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "STATIC_LIBRARY DEBUG";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
@@ -7171,7 +7263,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 57F456CF2DA98BB8007203AF /* Config-DevRelease.xcconfig */;
buildSettings = {
- ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32";
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -7403,7 +7495,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "STATIC_LIBRARY DEBUG";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
@@ -7610,7 +7702,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = B2C97B562A0A420E00053A4C /* Config-Debug.xcconfig */;
buildSettings = {
- ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32";
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -7842,7 +7934,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "STATIC_LIBRARY DEBUG";
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
@@ -7855,7 +7947,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = B2C97B572A0A423B00053A4C /* Config-Release.xcconfig */;
buildSettings = {
- ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32";
+ ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES = "AppIcon_Dark AppIcon_Retro AppIcon_Color AppIcon_Halloween AppIcon_Xmas AppIcon_Pixel32 AppIcon_ChineseNewYear";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
@@ -8072,7 +8164,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
- SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
+ SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = STATIC_LIBRARY;
SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/ManicEmu/Sources/Base/Bridging-Header.h";
diff --git a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme
index d20dd810..c03c91b3 100644
--- a/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme
+++ b/ManicEmu/ManicEmu.xcodeproj/xcshareddata/xcschemes/ManicEmu.xcscheme
@@ -31,9 +31,9 @@
</Testables>
</TestAction>
<LaunchAction
- buildConfiguration = "Release"
- selectedDebuggerIdentifier = ""
- selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+ buildConfiguration = "Debug"
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -82,7 +82,7 @@
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
- buildConfiguration = "Release"
+ buildConfiguration = "SideloadRelease"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/AppIcon_ChineseNewYear.appiconset/AppIcon_ChineseNewYear.png b/ManicEmu/ManicEmu/Resources/Assets.xcassets/AppIcon_ChineseNewYear.appiconset/AppIcon_ChineseNewYear.png
new file mode 100644
index 00000000..ec2ef2ce
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/AppIcon_ChineseNewYear.appiconset/AppIcon_ChineseNewYear.png differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/AppIcon_ChineseNewYear.appiconset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/AppIcon_ChineseNewYear.appiconset/Contents.json
new file mode 100644
index 00000000..88523dca
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/AppIcon_ChineseNewYear.appiconset/Contents.json
@@ -0,0 +1,14 @@
+{
+ "images" : [
+ {
+ "filename" : "AppIcon_ChineseNewYear.png",
+ "idiom" : "universal",
+ "platform" : "ios",
+ "size" : "1024x1024"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/Contents.json
new file mode 100644
index 00000000..c2d2cbbd
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.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/Images/appicon_chinesenewyear.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/[email protected]
new file mode 100644
index 00000000..c264ca69
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/[email protected]
new file mode 100644
index 00000000..c264ca69
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/appicon_chinesenewyear.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/Contents.json
new file mode 100644
index 00000000..3d194974
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.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/Images/atari_highlight.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected]
new file mode 100644
index 00000000..b6fe26a8
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected]
new file mode 100644
index 00000000..702fe067
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected]
new file mode 100644
index 00000000..b6fe26a8
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected]
new file mode 100644
index 00000000..25f095b6
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_highlight.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/Contents.json
new file mode 100644
index 00000000..5f2f66a5
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.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/Images/atari_normal.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected]
new file mode 100644
index 00000000..28ffc31b
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected]
new file mode 100644
index 00000000..45dafe5e
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected]
new file mode 100644
index 00000000..280b781a
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected]
new file mode 100644
index 00000000..606a8609
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/atari_normal.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/Contents.json
new file mode 100644
index 00000000..eec57bc5
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_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/Images/brand/a2600_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..44cbc7c2
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..6a5015b9
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a2600_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/Contents.json
new file mode 100644
index 00000000..a0fb448c
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_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/Images/brand/a5200_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..d5306121
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..5946e4ef
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a5200_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/Contents.json
new file mode 100644
index 00000000..c11fee4b
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_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/Images/brand/a7800_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..4c8b0374
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..1b994347
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..64a0af60
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..6bd7fcb5
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/a7800_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/Contents.json
new file mode 100644
index 00000000..b3e63e95
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_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/Images/brand/jaguar_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..271afda3
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..deccb62b
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/jaguar_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/Contents.json
new file mode 100644
index 00000000..7fccbd45
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_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/Images/brand/lynx_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..de8a6bc2
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/[email protected]
new file mode 100644
index 00000000..c76ebaaf
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/brand/lynx_group_brand.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/Contents.json
new file mode 100644
index 00000000..84b9bac0
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_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/Images/cover/a2600_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..aa8b84e4
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..9d0c02f1
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/Contents.json
new file mode 100644
index 00000000..cc2d6177
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_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/Images/cover/a2600_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..43e6616b
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..3bfbf643
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a2600_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/Contents.json
new file mode 100644
index 00000000..5462fcc0
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_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/Images/cover/a5200_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..f2054ca9
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..4e3b72b8
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/Contents.json
new file mode 100644
index 00000000..24a9bfe7
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_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/Images/cover/a5200_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..1bca9e01
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..0d7cfddd
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a5200_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/Contents.json
new file mode 100644
index 00000000..53e4141a
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_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/Images/cover/a7800_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..144a3282
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..eb11c59d
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/Contents.json
new file mode 100644
index 00000000..bf497491
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_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/Images/cover/a7800_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..6de9c48c
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..01ae612e
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/a7800_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/Contents.json
new file mode 100644
index 00000000..85e4a8ab
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_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/Images/cover/jaguar_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..c08bdb86
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..7aab40b2
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/Contents.json
new file mode 100644
index 00000000..206b6a1a
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_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/Images/cover/jaguar_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..ecb664cf
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..e08997ad
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/jaguar_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/Contents.json
new file mode 100644
index 00000000..cdaf92c8
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_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/Images/cover/lynx_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..df28b0dd
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/[email protected]
new file mode 100644
index 00000000..f7ec2ba9
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_h.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/Contents.json
new file mode 100644
index 00000000..7090093e
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_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/Images/cover/lynx_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..5ddca68f
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/[email protected]
new file mode 100644
index 00000000..d5f861b7
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/cover/lynx_cover_v.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected]
index d94957be..24972e12 100644
Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected]
index fc90ec94..3976fed9 100644
Binary files a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected] and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/import_rom_patcher.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/Contents.json b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/Contents.json
new file mode 100644
index 00000000..caf863e4
--- /dev/null
+++ b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.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/Images/rompatcher_logo.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/[email protected]
new file mode 100644
index 00000000..d8b2e269
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/[email protected] b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/[email protected]
new file mode 100644
index 00000000..5a62b6f5
Binary files /dev/null and b/ManicEmu/ManicEmu/Resources/Assets.xcassets/Images/rompatcher_logo.imageset/[email protected] differ
diff --git a/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig b/ManicEmu/ManicEmu/Resources/Config-Base.xcconfig
index acaff5fc..42baf944 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 = 3
-APP_VERSION = 1.8.1
+APP_BUILD_VERSION = 7
+APP_VERSION = 1.8.2
diff --git a/ManicEmu/ManicEmu/Resources/Info.plist b/ManicEmu/ManicEmu/Resources/Info.plist
index abb433fe..7c4ef3ae 100644
--- a/ManicEmu/ManicEmu/Resources/Info.plist
+++ b/ManicEmu/ManicEmu/Resources/Info.plist
@@ -272,6 +272,66 @@
<string>public.aoshuang.game.arcade</string>
</array>
</dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>2600 Game</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSHandlerRank</key>
+ <string>Owner</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>public.aoshuang.game.2600</string>
+ </array>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>5200 Game</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSHandlerRank</key>
+ <string>Owner</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>public.aoshuang.game.5200</string>
+ </array>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>7800 Game</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSHandlerRank</key>
+ <string>Owner</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>public.aoshuang.game.7800</string>
+ </array>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>JAGUAR Game</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSHandlerRank</key>
+ <string>Owner</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>public.aoshuang.game.jaguar</string>
+ </array>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>LYNX Game</string>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ <key>LSHandlerRank</key>
+ <string>Owner</string>
+ <key>LSItemContentTypes</key>
+ <array>
+ <string>public.aoshuang.game.lynx</string>
+ </array>
+ </dict>
<dict>
<key>CFBundleTypeName</key>
<string>Manic EMU Controller Skin</string>
@@ -1039,6 +1099,122 @@
</array>
</dict>
</dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>2600 Game</string>
+ <key>UTTypeIconFiles</key>
+ <array>
+ <string>file_icon.png</string>
+ </array>
+ <key>UTTypeIdentifier</key>
+ <string>public.aoshuang.game.2600</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>a26</string>
+ <string>bin</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>5200 Game</string>
+ <key>UTTypeIconFiles</key>
+ <array>
+ <string>file_icon.png</string>
+ </array>
+ <key>UTTypeIdentifier</key>
+ <string>public.aoshuang.game.5200</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>a52</string>
+ <string>bin</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>7800 Game</string>
+ <key>UTTypeIconFiles</key>
+ <array>
+ <string>file_icon.png</string>
+ </array>
+ <key>UTTypeIdentifier</key>
+ <string>public.aoshuang.game.7800</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>a78</string>
+ <string>bin</string>
+ <string>cdf</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>JAGUAR Game</string>
+ <key>UTTypeIconFiles</key>
+ <array>
+ <string>file_icon.png</string>
+ </array>
+ <key>UTTypeIdentifier</key>
+ <string>public.aoshuang.game.jaguar</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>j64</string>
+ <string>jag</string>
+ <string>rom</string>
+ <string>abs</string>
+ <string>cof</string>
+ <string>bin</string>
+ <string>prg</string>
+ </array>
+ </dict>
+ </dict>
+ <dict>
+ <key>UTTypeConformsTo</key>
+ <array>
+ <string>public.data</string>
+ </array>
+ <key>UTTypeDescription</key>
+ <string>LYNX Game</string>
+ <key>UTTypeIconFiles</key>
+ <array>
+ <string>file_icon.png</string>
+ </array>
+ <key>UTTypeIdentifier</key>
+ <string>public.aoshuang.game.lynx</string>
+ <key>UTTypeTagSpecification</key>
+ <dict>
+ <key>public.filename-extension</key>
+ <array>
+ <string>lnx</string>
+ <string>o</string>
+ </array>
+ </dict>
+ </dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
@@ -1139,6 +1315,7 @@
<string>rom</string>
<string>min</string>
<string>zip</string>
+ <string>img</string>
</array>
</dict>
</dict>
diff --git a/ManicEmu/ManicEmu/Resources/ar.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ar.lproj/Localizable.strings
index af474713..728e7e38 100644
--- a/ManicEmu/ManicEmu/Resources/ar.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ar.lproj/Localizable.strings
@@ -801,3 +801,25 @@
"FetchGamesFromMeloNX" = "استيراد الألعاب من MeloNX";
"ChangeAlert" = "تم تعديل المحتوى. سيؤدي الإغلاق الآن إلى فقدان جميع التعديلات. متابعة الإغلاق؟";
+
+"JGenesisAlert" = "عذرًا، نواة JGenesis تدعم فقط ملفات ROM ذات الصيغة .chd.";
+"RedeemOfferCode" = "استبدال العرض";
+"CheatImportFailed" = "فشل الاستيراد. تعذر تحليل الملف أو لم يتم العثور على رموز الغش المطابقة.";
+"RemoveAllCheats" = "إزالة جميع رموز الغش";
+"RemoveAllCheatsAlert" = "هل أنت متأكد من أنك تريد إزالة جميع رموز الغش؟ لا يمكن التراجع عن هذا الإجراء.";
+"CheatCodeStatus" = "مفعل";
+"Background" = "خلفية";
+"AddBackgroundForLandscape" = "إضافة خلفية أفقية";
+"AddBackgroundForPortrait" = "إضافة خلفية عمودية";
+"UpdateBackground" = "تعيين الخلفية";
+"UpdateBackgroundForGame" = "تعيين لهذه اللعبة";
+"UpdateBackgroundForConsole" = "تعيين لمنصة %@";
+"UpdateBackgroundForGlobal" = "تعيين عالميًا";
+"RemoveBackgroundForGame" = "إزالة خلفية اللعبة";
+"RemoveBackgroundForConsole" = "إزالة خلفية منصة %@";
+"RemoveBackgroundForGlobal" = "إزالة الخلفية العالمية";
+"ShaderConfigAlert" = "تم التعيين لـ %@.";
+"Global" = "عالمي";
+"RemoveShaderForGlobal" = "إزالة الشادر العالمي";
+"FeaturedItems" = "العناصر المميزة";
+"ReUpload" = "إعادة التحميل";
diff --git a/ManicEmu/ManicEmu/Resources/ca.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ca.lproj/Localizable.strings
index 2a5d7f16..4187fb8d 100644
--- a/ManicEmu/ManicEmu/Resources/ca.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ca.lproj/Localizable.strings
@@ -828,3 +828,25 @@ Si voleu millorar la vostra configuració, PlayCase és el complement perfecte p
"NotInstallMeloNX" = "MeloNX no està instal·lat";
"FetchGamesFromMeloNX" = "Importa jocs des de MeloNX";
"ChangeAlert" = "El contingut s'ha canviat. Tancar ara suposarà perdre tots els canvis. Continuar tancant?";
+
+"JGenesisAlert" = "Ho sentim, el nucli JGenesis només admet fitxers ROM .chd.";
+"RedeemOfferCode" = "Canviat Oferta";
+"CheatImportFailed" = "Importació fallida. No s'ha pogut analitzar el fitxer o no s'han trobat codis de truc coincidents.";
+"RemoveAllCheats" = "Eliminar Tots els Trucs";
+"RemoveAllCheatsAlert" = "Esteu segur que voleu eliminar tots els codis de truc? Aquesta acció no es pot desfer.";
+"CheatCodeStatus" = "Habilitat";
+"Background" = "Fons";
+"AddBackgroundForLandscape" = "Afegir Fons Horizontal";
+"AddBackgroundForPortrait" = "Afegir Fons Vertical";
+"UpdateBackground" = "Establir Fons";
+"UpdateBackgroundForGame" = "Establir per a Aquest Joc";
+"UpdateBackgroundForConsole" = "Establir per a la Plataforma %@";
+"UpdateBackgroundForGlobal" = "Establir Globalment";
+"RemoveBackgroundForGame" = "Eliminar Fons del Joc";
+"RemoveBackgroundForConsole" = "Eliminar Fons de la Plataforma %@";
+"RemoveBackgroundForGlobal" = "Eliminar Fons Global";
+"ShaderConfigAlert" = "Establert per a %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Eliminar Shader Global";
+"FeaturedItems" = "Articles Destacats";
+"ReUpload" = "Pujar de Nou";
diff --git a/ManicEmu/ManicEmu/Resources/cs.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/cs.lproj/Localizable.strings
index 68da2317..896ae3c7 100644
--- a/ManicEmu/ManicEmu/Resources/cs.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/cs.lproj/Localizable.strings
@@ -824,3 +824,25 @@ Pokud chcete vylepšit své nastavení, PlayCase je perfektním doplňkem tohoto
"NotInstallMeloNX" = "MeloNX není nainstalováno";
"FetchGamesFromMeloNX" = "Importovat hry z MeloNX";
"ChangeAlert" = "Obsah byl změněn. Zavření nyní povede ke ztrátě všech změn. Pokračovat v zavírání?";
+
+"JGenesisAlert" = "Omlouváme se, jádro JGenesis podporuje pouze .chd ROM soubory.";
+"RedeemOfferCode" = "Uplatnit Nabídku";
+"CheatImportFailed" = "Import se nezdařil. Soubor nelze analyzovat nebo nebyly nalezeny odpovídající cheaty.";
+"RemoveAllCheats" = "Odstranit Všechny Cheaty";
+"RemoveAllCheatsAlert" = "Opravdu chcete odstranit všechny cheaty? Tuto akci nelze vrátit zpět.";
+"CheatCodeStatus" = "Povoleno";
+"Background" = "Pozadí";
+"AddBackgroundForLandscape" = "Přidat Pozadí na Výšku";
+"AddBackgroundForPortrait" = "Přidat Pozadí na Šířku";
+"UpdateBackground" = "Nastavit Pozadí";
+"UpdateBackgroundForGame" = "Nastavit pro Tuto Hru";
+"UpdateBackgroundForConsole" = "Nastavit pro Platformu %@";
+"UpdateBackgroundForGlobal" = "Nastavit Globálně";
+"RemoveBackgroundForGame" = "Odstranit Pozadí Hry";
+"RemoveBackgroundForConsole" = "Odstranit Pozadí Platformy %@";
+"RemoveBackgroundForGlobal" = "Odstranit Globální Pozadí";
+"ShaderConfigAlert" = "Nastaveno pro %@.";
+"Global" = "Globální";
+"RemoveShaderForGlobal" = "Odstranit Globální Shader";
+"FeaturedItems" = "Doporučené Položky";
+"ReUpload" = "Znovu Nahrát";
diff --git a/ManicEmu/ManicEmu/Resources/da.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/da.lproj/Localizable.strings
index 7360c1e3..b2efe4df 100644
--- a/ManicEmu/ManicEmu/Resources/da.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/da.lproj/Localizable.strings
@@ -826,3 +826,25 @@ Hvis du vil forbedre dit setup, er PlayCase et perfekt match til dette skin.";
"NotInstallMeloNX" = "MeloNX er ikke installeret";
"FetchGamesFromMeloNX" = "Importer spil fra MeloNX";
"ChangeAlert" = "Indholdet er blevet ændret. Hvis du lukker nu, går alle ændringer tabt. Fortsæt med at lukke?";
+
+"JGenesisAlert" = "Beklager, JGenesis-kernen understøtter kun .chd ROM-filer.";
+"RedeemOfferCode" = "Indløs Tilbud";
+"CheatImportFailed" = "Import fejlede. Filen kunne ikke parses eller der blev ikke fundet matchende snydekoder.";
+"RemoveAllCheats" = "Fjern Alle Snydekoder";
+"RemoveAllCheatsAlert" = "Er du sikker på, at du vil fjerne alle snydekoder? Denne handling kan ikke fortrydes.";
+"CheatCodeStatus" = "Aktiveret";
+"Background" = "Baggrund";
+"AddBackgroundForLandscape" = "Tilføj Vandret Baggrund";
+"AddBackgroundForPortrait" = "Tilføj Lodret Baggrund";
+"UpdateBackground" = "Indstil Baggrund";
+"UpdateBackgroundForGame" = "Indstil for Dette Spil";
+"UpdateBackgroundForConsole" = "Indstil for %@ Platform";
+"UpdateBackgroundForGlobal" = "Indstil Globalt";
+"RemoveBackgroundForGame" = "Fjern Spilbaggrund";
+"RemoveBackgroundForConsole" = "Fjern %@ Platformbaggrund";
+"RemoveBackgroundForGlobal" = "Fjern Global Baggrund";
+"ShaderConfigAlert" = "Indstillet for %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Fjern Global Shader";
+"FeaturedItems" = "Fremhævede Emner";
+"ReUpload" = "Genupload";
diff --git a/ManicEmu/ManicEmu/Resources/de.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/de.lproj/Localizable.strings
index ef3c2709..320ad405 100644
--- a/ManicEmu/ManicEmu/Resources/de.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/de.lproj/Localizable.strings
@@ -830,3 +830,25 @@ Wenn Sie Ihr Setup verbessern möchten, ist PlayCase die perfekte Ergänzung zu
"NotInstallMeloNX" = "MeloNX ist nicht installiert";
"FetchGamesFromMeloNX" = "Spiele von MeloNX importieren";
"ChangeAlert" = "Der Inhalt wurde geändert. Wenn Sie jetzt schließen, gehen alle Änderungen verloren. Trotzdem schließen?";
+
+"JGenesisAlert" = "Entschuldigung, der JGenesis-Kern unterstützt nur .chd-ROM-Dateien.";
+"RedeemOfferCode" = "Angebot einlösen";
+"CheatImportFailed" = "Import fehlgeschlagen. Die Datei konnte nicht geparst werden oder es wurden keine passenden Cheat-Codes gefunden.";
+"RemoveAllCheats" = "Alle Cheats entfernen";
+"RemoveAllCheatsAlert" = "Sind Sie sicher, dass Sie alle Cheat-Codes entfernen möchten? Diese Aktion kann nicht rückgängig gemacht werden.";
+"CheatCodeStatus" = "Aktiviert";
+"Background" = "Hintergrund";
+"AddBackgroundForLandscape" = "Hintergrund für Querformat hinzufügen";
+"AddBackgroundForPortrait" = "Hintergrund für Hochformat hinzufügen";
+"UpdateBackground" = "Hintergrund festlegen";
+"UpdateBackgroundForGame" = "Für dieses Spiel festlegen";
+"UpdateBackgroundForConsole" = "Für %@-Plattform festlegen";
+"UpdateBackgroundForGlobal" = "Global festlegen";
+"RemoveBackgroundForGame" = "Spielhintergrund entfernen";
+"RemoveBackgroundForConsole" = "%@-Plattform-Hintergrund entfernen";
+"RemoveBackgroundForGlobal" = "Globalen Hintergrund entfernen";
+"ShaderConfigAlert" = "Für %@ festgelegt.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Globalen Shader entfernen";
+"FeaturedItems" = "Ausgewählte Artikel";
+"ReUpload" = "Erneut hochladen";
diff --git a/ManicEmu/ManicEmu/Resources/el.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/el.lproj/Localizable.strings
index ec806716..817052b4 100644
--- a/ManicEmu/ManicEmu/Resources/el.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/el.lproj/Localizable.strings
@@ -829,3 +829,25 @@
"NotInstallMeloNX" = "Το MeloNX δεν είναι εγκατεστημένο";
"FetchGamesFromMeloNX" = "Εισαγωγή παιχνιδιών από το MeloNX";
"ChangeAlert" = "Το περιεχόμενο έχει αλλάξει. Αν κλείσετε τώρα, θα χαθούν όλες οι αλλαγές. Συνέχεια κλεισίματος;";
+
+"JGenesisAlert" = "Συγγνώμη, ο πυρήνας JGenesis υποστηρίζει μόνο αρχεία ROM .chd.";
+"RedeemOfferCode" = "Εξαργύρωση Προσφοράς";
+"CheatImportFailed" = "Αποτυχία εισαγωγής. Δεν ήταν δυνατή η ανάλυση του αρχείου ή δεν βρέθηκαν αντίστοιχοι κωδικοί cheat.";
+"RemoveAllCheats" = "Αφαίρεση Όλων των Cheat";
+"RemoveAllCheatsAlert" = "Είστε σίγουροι ότι θέλετε να αφαιρέσετε όλους τους κωδικούς cheat; Αυτή η ενέργεια δεν μπορεί να αναιρεθεί.";
+"CheatCodeStatus" = "Ενεργοποιημένο";
+"Background" = "Φόντο";
+"AddBackgroundForLandscape" = "Προσθήκη Οριζόντιου Φόντο";
+"AddBackgroundForPortrait" = "Προσθήκη Κατακόρυφου Φόντο";
+"UpdateBackground" = "Ορισμός Φόντο";
+"UpdateBackgroundForGame" = "Ορισμός για Αυτό το Παιχνίδι";
+"UpdateBackgroundForConsole" = "Ορισμός για Πλατφόρμα %@";
+"UpdateBackgroundForGlobal" = "Ορισμός Παγκοσμίως";
+"RemoveBackgroundForGame" = "Αφαίρεση Φόντο Παιχνιδιού";
+"RemoveBackgroundForConsole" = "Αφαίρεση Φόντο Πλατφόρμας %@";
+"RemoveBackgroundForGlobal" = "Αφαίρεση Παγκόσμιου Φόντο";
+"ShaderConfigAlert" = "Ορίστηκε για %@.";
+"Global" = "Παγκόσμιο";
+"RemoveShaderForGlobal" = "Αφαίρεση Παγκόσμιου Shader";
+"FeaturedItems" = "Προτεινόμενα Αντικείμενα";
+"ReUpload" = "Επαναφόρτωση";
diff --git a/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings
index 37dd0645..8006a537 100644
--- a/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/en.lproj/Localizable.strings
@@ -843,3 +843,25 @@ Press the controller button to complete mapping...";
"FetchGamesFromMeloNX" = "Import Games from MeloNX";
"ChangeAlert" = "The content has been changed. Closing now will lose all changes. Continue closing?";
+
+"JGenesisAlert" = "Sorry, the JGenesis core only supports .chd ROM files.";
+"RedeemOfferCode" = "Redeem Offer";
+"CheatImportFailed" = "Import failed. The file could not be parsed or no matching cheat codes were found.";
+"RemoveAllCheats" = "Remove All Cheats";
+"RemoveAllCheatsAlert" = "Are you sure you want to remove all cheat codes? This action cannot be undone.";
+"CheatCodeStatus" = "Enabled";
+"Background" = "Background";
+"AddBackgroundForLandscape" = "Add Landscape Background";
+"AddBackgroundForPortrait" = "Add Portrait Background";
+"UpdateBackground" = "Set Background";
+"UpdateBackgroundForGame" = "Set for This Game";
+"UpdateBackgroundForConsole" = "Set for %@ Platform";
+"UpdateBackgroundForGlobal" = "Set Globally";
+"RemoveBackgroundForGame" = "Remove Game Background";
+"RemoveBackgroundForConsole" = "Remove %@ Platform Background";
+"RemoveBackgroundForGlobal" = "Remove Global Background";
+"ShaderConfigAlert" = "Set for %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Remove Global Shader";
+"FeaturedItems" = "Featured Items";
+"ReUpload" = "Re-upload";
diff --git a/ManicEmu/ManicEmu/Resources/es-419.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/es-419.lproj/Localizable.strings
index 0afa433d..af648851 100644
--- a/ManicEmu/ManicEmu/Resources/es-419.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/es-419.lproj/Localizable.strings
@@ -828,3 +828,25 @@ Si quieres mejorar tu experiencia, PlayCase combina perfecto con esta funda.";
"NotInstallMeloNX" = "MeloNX no está instalado";
"FetchGamesFromMeloNX" = "Importar juegos desde MeloNX";
"ChangeAlert" = "El contenido ha cambiado. Cerrar ahora hará que pierdas los cambios. ¿Continuar cerrando?";
+
+"JGenesisAlert" = "Lo sentimos, el núcleo JGenesis solo admite archivos ROM .chd.";
+"RedeemOfferCode" = "Canjear Oferta";
+"CheatImportFailed" = "Importación fallida. No se pudo analizar el archivo o no se encontraron códigos de truco coincidentes.";
+"RemoveAllCheats" = "Eliminar Todos los Trucos";
+"RemoveAllCheatsAlert" = "¿Estás seguro de que quieres eliminar todos los códigos de truco? Esta acción no se puede deshacer.";
+"CheatCodeStatus" = "Habilitado";
+"Background" = "Fondo";
+"AddBackgroundForLandscape" = "Agregar Fondo Horizontal";
+"AddBackgroundForPortrait" = "Agregar Fondo Vertical";
+"UpdateBackground" = "Establecer Fondo";
+"UpdateBackgroundForGame" = "Establecer para Este Juego";
+"UpdateBackgroundForConsole" = "Establecer para la Plataforma %@";
+"UpdateBackgroundForGlobal" = "Establecer Globalmente";
+"RemoveBackgroundForGame" = "Eliminar Fondo del Juego";
+"RemoveBackgroundForConsole" = "Eliminar Fondo de la Plataforma %@";
+"RemoveBackgroundForGlobal" = "Eliminar Fondo Global";
+"ShaderConfigAlert" = "Establecido para %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Eliminar Shader Global";
+"FeaturedItems" = "Artículos Destacados";
+"ReUpload" = "Volver a Subir";
diff --git a/ManicEmu/ManicEmu/Resources/es.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/es.lproj/Localizable.strings
index 262eff24..ebf894c3 100644
--- a/ManicEmu/ManicEmu/Resources/es.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/es.lproj/Localizable.strings
@@ -803,3 +803,25 @@ Si quieres mejorar tu configuración, PlayCase es el complemento perfecto para e
"NotInstallMeloNX" = "MeloNX no está instalado";
"FetchGamesFromMeloNX" = "Importar juegos desde MeloNX";
"ChangeAlert" = "El contenido ha cambiado. Si cierra ahora, perderá todos los cambios. ¿Continuar cerrando?";
+
+"JGenesisAlert" = "Lo sentimos, el núcleo JGenesis solo admite archivos ROM .chd.";
+"RedeemOfferCode" = "Canjear Oferta";
+"CheatImportFailed" = "Importación fallida. No se pudo analizar el archivo o no se encontraron códigos de truco coincidentes.";
+"RemoveAllCheats" = "Eliminar Todos los Trucos";
+"RemoveAllCheatsAlert" = "¿Estás seguro de que quieres eliminar todos los códigos de truco? Esta acción no se puede deshacer.";
+"CheatCodeStatus" = "Habilitado";
+"Background" = "Fondo";
+"AddBackgroundForLandscape" = "Añadir Fondo Horizontal";
+"AddBackgroundForPortrait" = "Añadir Fondo Vertical";
+"UpdateBackground" = "Establecer Fondo";
+"UpdateBackgroundForGame" = "Establecer para Este Juego";
+"UpdateBackgroundForConsole" = "Establecer para la Plataforma %@";
+"UpdateBackgroundForGlobal" = "Establecer Globalmente";
+"RemoveBackgroundForGame" = "Eliminar Fondo del Juego";
+"RemoveBackgroundForConsole" = "Eliminar Fondo de la Plataforma %@";
+"RemoveBackgroundForGlobal" = "Eliminar Fondo Global";
+"ShaderConfigAlert" = "Establecido para %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Eliminar Shader Global";
+"FeaturedItems" = "Artículos Destacados";
+"ReUpload" = "Volver a Subir";
diff --git a/ManicEmu/ManicEmu/Resources/fi.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/fi.lproj/Localizable.strings
index 26ff5218..4ac76786 100644
--- a/ManicEmu/ManicEmu/Resources/fi.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/fi.lproj/Localizable.strings
@@ -829,3 +829,25 @@ Jos haluat parantaa kokoonpanoasi, PlayCase on täydellinen lisä tälle skinill
"NotInstallMeloNX" = "MeloNX ei ole asennettu";
"FetchGamesFromMeloNX" = "Tuo pelejä MeloNX:stä";
"ChangeAlert" = "Sisältöä on muutettu. Sulkeminen nyt johtaa kaikkien muutosten menettämiseen. Jatka sulkemista?";
+
+"JGenesisAlert" = "Valitettavasti JGenesis-ydin tukee vain .chd ROM-tiedostoja.";
+"RedeemOfferCode" = "Lunasta Tarjous";
+"CheatImportFailed" = "Tuonti epäonnistui. Tiedostoa ei voitu jäsentää tai sopivia huijauskoodeja ei löytynyt.";
+"RemoveAllCheats" = "Poista Kaikki Huijaukset";
+"RemoveAllCheatsAlert" = "Haluatko varmasti poistaa kaikki huijauskoodit? Tätä toimintoa ei voi kumota.";
+"CheatCodeStatus" = "Käytössä";
+"Background" = "Tausta";
+"AddBackgroundForLandscape" = "Lisää Vaakatausta";
+"AddBackgroundForPortrait" = "Lisää Pystytusta";
+"UpdateBackground" = "Aseta Tausta";
+"UpdateBackgroundForGame" = "Aseta Tälle Pelille";
+"UpdateBackgroundForConsole" = "Aseta %@-alustalle";
+"UpdateBackgroundForGlobal" = "Aseta Globaalisti";
+"RemoveBackgroundForGame" = "Poista Pelin Tausta";
+"RemoveBackgroundForConsole" = "Poista %@-alustan Tausta";
+"RemoveBackgroundForGlobal" = "Poista Globaali Tausta";
+"ShaderConfigAlert" = "Asetettu kohteelle %@.";
+"Global" = "Globaali";
+"RemoveShaderForGlobal" = "Poista Globaali Shader";
+"FeaturedItems" = "Suositellut Tuotteet";
+"ReUpload" = "Lataa Uudelleen";
diff --git a/ManicEmu/ManicEmu/Resources/fr-CA.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/fr-CA.lproj/Localizable.strings
index d3322c10..f429a0da 100644
--- a/ManicEmu/ManicEmu/Resources/fr-CA.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/fr-CA.lproj/Localizable.strings
@@ -830,3 +830,25 @@ Si vous voulez améliorer votre installation, PlayCase est le complément parfai
"NotInstallMeloNX" = "MeloNX n’est pas installé";
"FetchGamesFromMeloNX" = "Importer des jeux de MeloNX";
"ChangeAlert" = "Le contenu a été modifié. Fermer maintenant entraînera la perte des modifications. Continuer la fermeture ?";
+
+"JGenesisAlert" = "Désolé, le cœur JGenesis ne prend en charge que les fichiers ROM .chd.";
+"RedeemOfferCode" = "Échanger l'Offre";
+"CheatImportFailed" = "Échec de l'importation. Le fichier n'a pas pu être analysé ou aucun code de triche correspondant n'a été trouvé.";
+"RemoveAllCheats" = "Supprimer Toutes les Triches";
+"RemoveAllCheatsAlert" = "Êtes-vous sûr de vouloir supprimer tous les codes de triche ? Cette action ne peut pas être annulée.";
+"CheatCodeStatus" = "Activé";
+"Background" = "Arrière-plan";
+"AddBackgroundForLandscape" = "Ajouter un Arrière-plan Paysage";
+"AddBackgroundForPortrait" = "Ajouter un Arrière-plan Portrait";
+"UpdateBackground" = "Définir l'Arrière-plan";
+"UpdateBackgroundForGame" = "Définir pour Ce Jeu";
+"UpdateBackgroundForConsole" = "Définir pour la Plateforme %@";
+"UpdateBackgroundForGlobal" = "Définir Globalement";
+"RemoveBackgroundForGame" = "Supprimer l'Arrière-plan du Jeu";
+"RemoveBackgroundForConsole" = "Supprimer l'Arrière-plan de la Plateforme %@";
+"RemoveBackgroundForGlobal" = "Supprimer l'Arrière-plan Global";
+"ShaderConfigAlert" = "Défini pour %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Supprimer le Shader Global";
+"FeaturedItems" = "Articles en Vedette";
+"ReUpload" = "Téléverser à Nouveau";
diff --git a/ManicEmu/ManicEmu/Resources/fr.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/fr.lproj/Localizable.strings
index ea639e5d..3706cbfe 100644
--- a/ManicEmu/ManicEmu/Resources/fr.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/fr.lproj/Localizable.strings
@@ -830,3 +830,25 @@ Si vous souhaitez améliorer votre configuration, PlayCase est le complément id
"NotInstallMeloNX" = "MeloNX n’est pas installé";
"FetchGamesFromMeloNX" = "Importer des jeux depuis MeloNX";
"ChangeAlert" = "Le contenu a été modifié. Fermer maintenant entraînera la perte des modifications. Continuer la fermeture ?";
+
+"JGenesisAlert" = "Désolé, le cœur JGenesis ne prend en charge que les fichiers ROM .chd.";
+"RedeemOfferCode" = "Échanger l'Offre";
+"CheatImportFailed" = "Échec de l'importation. Le fichier n'a pas pu être analysé ou aucun code de triche correspondant n'a été trouvé.";
+"RemoveAllCheats" = "Supprimer Toutes les Triches";
+"RemoveAllCheatsAlert" = "Êtes-vous sûr de vouloir supprimer tous les codes de triche ? Cette action ne peut pas être annulée.";
+"CheatCodeStatus" = "Activé";
+"Background" = "Arrière-plan";
+"AddBackgroundForLandscape" = "Ajouter un Arrière-plan Paysage";
+"AddBackgroundForPortrait" = "Ajouter un Arrière-plan Portrait";
+"UpdateBackground" = "Définir l'Arrière-plan";
+"UpdateBackgroundForGame" = "Définir pour Ce Jeu";
+"UpdateBackgroundForConsole" = "Définir pour la Plateforme %@";
+"UpdateBackgroundForGlobal" = "Définir Globalement";
+"RemoveBackgroundForGame" = "Supprimer l'Arrière-plan du Jeu";
+"RemoveBackgroundForConsole" = "Supprimer l'Arrière-plan de la Plateforme %@";
+"RemoveBackgroundForGlobal" = "Supprimer l'Arrière-plan Global";
+"ShaderConfigAlert" = "Défini pour %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Supprimer le Shader Global";
+"FeaturedItems" = "Articles en Vedette";
+"ReUpload" = "Téléverser à Nouveau";
diff --git a/ManicEmu/ManicEmu/Resources/he.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/he.lproj/Localizable.strings
index 23c792af..6f12b16b 100644
--- a/ManicEmu/ManicEmu/Resources/he.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/he.lproj/Localizable.strings
@@ -829,3 +829,25 @@ PlayCase מתמקדת במעטפות iPhone איכותיות, המיוצרות
"NotInstallMeloNX" = "MeloNX לא מותקן";
"FetchGamesFromMeloNX" = "ייבא משחקים מ־MeloNX";
"ChangeAlert" = "התוכן השתנה. סגירה כעת תגרום לאובדן כל השינויים. להמשיך בסגירה?";
+
+"JGenesisAlert" = "מצטערים, ליבת JGenesis תומכת רק בקבצי ROM מסוג .chd.";
+"RedeemOfferCode" = "פדיון הצעה";
+"CheatImportFailed" = "ייבוא נכשל. לא ניתן לנתח את הקובץ או שלא נמצאו קודי רמאות תואמים.";
+"RemoveAllCheats" = "הסר את כל הרמאויות";
+"RemoveAllCheatsAlert" = "האם אתה בטוח שברצונך להסיר את כל קודי הרמאות? פעולה זו אינה ניתנת לביטול.";
+"CheatCodeStatus" = "מופעל";
+"Background" = "רקע";
+"AddBackgroundForLandscape" = "הוסף רקע לרוחב";
+"AddBackgroundForPortrait" = "הוסף רקע לאורך";
+"UpdateBackground" = "הגדר רקע";
+"UpdateBackgroundForGame" = "הגדר עבור משחק זה";
+"UpdateBackgroundForConsole" = "הגדר עבור פלטפורמת %@";
+"UpdateBackgroundForGlobal" = "הגדר באופן גלובלי";
+"RemoveBackgroundForGame" = "הסר רקע משחק";
+"RemoveBackgroundForConsole" = "הסר רקע פלטפורמת %@";
+"RemoveBackgroundForGlobal" = "הסר רקע גלובלי";
+"ShaderConfigAlert" = "הוגדר עבור %@.";
+"Global" = "גלובלי";
+"RemoveShaderForGlobal" = "הסר Shader גלובלי";
+"FeaturedItems" = "פריטים מומלצים";
+"ReUpload" = "העלה מחדש";
diff --git a/ManicEmu/ManicEmu/Resources/hi.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/hi.lproj/Localizable.strings
index 6586b176..befc00f6 100644
--- a/ManicEmu/ManicEmu/Resources/hi.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/hi.lproj/Localizable.strings
@@ -830,3 +830,25 @@ PlayCase हाई-क्वालिटी iPhone केसों पर के
"NotInstallMeloNX" = "MeloNX इंस्टॉल नहीं है";
"FetchGamesFromMeloNX" = "MeloNX से गेम आयात करें";
"ChangeAlert" = "सामग्री बदल दी गई है। अब बंद करने से सभी परिवर्तन खो जाएंगे। बंद करना जारी रखें?";
+
+"JGenesisAlert" = "क्षमा करें, JGenesis कोर केवल .chd ROM फ़ाइलों का समर्थन करता है।";
+"RedeemOfferCode" = "ऑफ़र रिडीम करें";
+"CheatImportFailed" = "आयात विफल। फ़ाइल को पार्स नहीं किया जा सका या कोई मेल खाता चीट कोड नहीं मिला।";
+"RemoveAllCheats" = "सभी चीट हटाएं";
+"RemoveAllCheatsAlert" = "क्या आप वाकई सभी चीट कोड हटाना चाहते हैं? यह कार्य पूर्ववत नहीं किया जा सकता।";
+"CheatCodeStatus" = "सक्षम";
+"Background" = "पृष्ठभूमि";
+"AddBackgroundForLandscape" = "लैंडस्केप पृष्ठभूमि जोड़ें";
+"AddBackgroundForPortrait" = "पोर्ट्रेट पृष्ठभूमि जोड़ें";
+"UpdateBackground" = "पृष्ठभूमि सेट करें";
+"UpdateBackgroundForGame" = "इस गेम के लिए सेट करें";
+"UpdateBackgroundForConsole" = "%@ प्लेटफ़ॉर्म के लिए सेट करें";
+"UpdateBackgroundForGlobal" = "वैश्विक रूप से सेट करें";
+"RemoveBackgroundForGame" = "गेम पृष्ठभूमि हटाएं";
+"RemoveBackgroundForConsole" = "%@ प्लेटफ़ॉर्म पृष्ठभूमि हटाएं";
+"RemoveBackgroundForGlobal" = "वैश्विक पृष्ठभूमि हटाएं";
+"ShaderConfigAlert" = "%@ के लिए सेट किया गया।";
+"Global" = "वैश्विक";
+"RemoveShaderForGlobal" = "वैश्विक शेडर हटाएं";
+"FeaturedItems" = "फ़ीचर्ड आइटम्स";
+"ReUpload" = "पुनः अपलोड करें";
diff --git a/ManicEmu/ManicEmu/Resources/hr.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/hr.lproj/Localizable.strings
index 175e74f5..16ab0f2a 100644
--- a/ManicEmu/ManicEmu/Resources/hr.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/hr.lproj/Localizable.strings
@@ -826,3 +826,25 @@ Ako želite unaprijediti svoju postavu, PlayCase je savršen dodatak ovom skinu.
"NotInstallMeloNX" = "MeloNX nije instaliran";
"FetchGamesFromMeloNX" = "Uvezi igre iz MeloNXa";
"ChangeAlert" = "Sadržaj je promijenjen. Zatvaranje sada će uzrokovati gubitak svih promjena. Nastaviti zatvaranje?";
+
+"JGenesisAlert" = "Žao nam je, JGenesis jezgra podržava samo .chd ROM datoteke.";
+"RedeemOfferCode" = "Iskoristi Ponudu";
+"CheatImportFailed" = "Uvoz nije uspio. Datoteku nije bilo moguće raščlaniti ili nisu pronađeni odgovarajući cheat kodovi.";
+"RemoveAllCheats" = "Ukloni Sve Cheatove";
+"RemoveAllCheatsAlert" = "Jeste li sigurni da želite ukloniti sve cheat kodove? Ova radnja se ne može poništiti.";
+"CheatCodeStatus" = "Omogućeno";
+"Background" = "Pozadina";
+"AddBackgroundForLandscape" = "Dodaj Pejzažnu Pozadinu";
+"AddBackgroundForPortrait" = "Dodaj Portretnu Pozadinu";
+"UpdateBackground" = "Postavi Pozadinu";
+"UpdateBackgroundForGame" = "Postavi za Ovu Igru";
+"UpdateBackgroundForConsole" = "Postavi za %@ Platformu";
+"UpdateBackgroundForGlobal" = "Postavi Globalno";
+"RemoveBackgroundForGame" = "Ukloni Pozadinu Igre";
+"RemoveBackgroundForConsole" = "Ukloni Pozadinu Platforme %@";
+"RemoveBackgroundForGlobal" = "Ukloni Globalnu Pozadinu";
+"ShaderConfigAlert" = "Postavljeno za %@.";
+"Global" = "Globalno";
+"RemoveShaderForGlobal" = "Ukloni Globalni Shader";
+"FeaturedItems" = "Istaknute Stavke";
+"ReUpload" = "Ponovno Učitaj";
diff --git a/ManicEmu/ManicEmu/Resources/hu.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/hu.lproj/Localizable.strings
index 6fc7c061..a1618b5d 100644
--- a/ManicEmu/ManicEmu/Resources/hu.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/hu.lproj/Localizable.strings
@@ -828,3 +828,25 @@ Ha fejleszteni szeretnéd a beállításod, a PlayCase tökéletes kiegészítő
"NotInstallMeloNX" = "A MeloNX nincs telepítve";
"FetchGamesFromMeloNX" = "Játékok importálása a MeloNX-ből";
"ChangeAlert" = "A tartalom megváltozott. A bezárás az összes módosítás elvesztéséhez vezet. Folytatja a bezárást?";
+
+"JGenesisAlert" = "Sajnáljuk, a JGenesis mag csak .chd ROM fájlokat támogat.";
+"RedeemOfferCode" = "Ajánlat Beváltása";
+"CheatImportFailed" = "Importálás sikertelen. A fájl nem elemezhető, vagy nem találhatók megfelelő csaláskódok.";
+"RemoveAllCheats" = "Összes Csalás Eltávolítása";
+"RemoveAllCheatsAlert" = "Biztosan el szeretné távolítani az összes csaláskódot? Ez a művelet nem visszavonható.";
+"CheatCodeStatus" = "Engedélyezve";
+"Background" = "Háttér";
+"AddBackgroundForLandscape" = "Fekvő Háttér Hozzáadása";
+"AddBackgroundForPortrait" = "Álló Háttér Hozzáadása";
+"UpdateBackground" = "Háttér Beállítása";
+"UpdateBackgroundForGame" = "Beállítás ehhez a Játékhoz";
+"UpdateBackgroundForConsole" = "Beállítás a(z) %@ Platformhoz";
+"UpdateBackgroundForGlobal" = "Globális Beállítás";
+"RemoveBackgroundForGame" = "Játék Háttér Eltávolítása";
+"RemoveBackgroundForConsole" = "%@ Platform Háttér Eltávolítása";
+"RemoveBackgroundForGlobal" = "Globális Háttér Eltávolítása";
+"ShaderConfigAlert" = "Beállítva a(z) %@ számára.";
+"Global" = "Globális";
+"RemoveShaderForGlobal" = "Globális Shader Eltávolítása";
+"FeaturedItems" = "Kiemelt Tételek";
+"ReUpload" = "Újrafeltöltés";
diff --git a/ManicEmu/ManicEmu/Resources/id.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/id.lproj/Localizable.strings
index a3da7cab..fcf6cc51 100644
--- a/ManicEmu/ManicEmu/Resources/id.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/id.lproj/Localizable.strings
@@ -821,3 +821,25 @@ Jika Anda ingin meningkatkan setup Anda, PlayCase adalah pasangan sempurna untuk
"NotInstallMeloNX" = "MeloNX Belum Terpasang";
"FetchGamesFromMeloNX" = "Impor Game dari MeloNX";
"ChangeAlert" = "Konten telah diubah. Menutup sekarang akan menghapus semua perubahan. Lanjutkan menutup?";
+
+"JGenesisAlert" = "Maaf, inti JGenesis hanya mendukung file ROM .chd.";
+"RedeemOfferCode" = "Tukar Penawaran";
+"CheatImportFailed" = "Impor gagal. File tidak dapat diurai atau tidak ditemukan kode curang yang cocok.";
+"RemoveAllCheats" = "Hapus Semua Curang";
+"RemoveAllCheatsAlert" = "Apakah Anda yakin ingin menghapus semua kode curang? Tindakan ini tidak dapat dibatalkan.";
+"CheatCodeStatus" = "Diaktifkan";
+"Background" = "Latar Belakang";
+"AddBackgroundForLandscape" = "Tambahkan Latar Belakang Lanskap";
+"AddBackgroundForPortrait" = "Tambahkan Latar Belakang Potret";
+"UpdateBackground" = "Atur Latar Belakang";
+"UpdateBackgroundForGame" = "Atur untuk Game Ini";
+"UpdateBackgroundForConsole" = "Atur untuk Platform %@";
+"UpdateBackgroundForGlobal" = "Atur Secara Global";
+"RemoveBackgroundForGame" = "Hapus Latar Belakang Game";
+"RemoveBackgroundForConsole" = "Hapus Latar Belakang Platform %@";
+"RemoveBackgroundForGlobal" = "Hapus Latar Belakang Global";
+"ShaderConfigAlert" = "Diatur untuk %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Hapus Shader Global";
+"FeaturedItems" = "Item Unggulan";
+"ReUpload" = "Unggah Ulang";
diff --git a/ManicEmu/ManicEmu/Resources/it.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/it.lproj/Localizable.strings
index a075b22c..6fab1fd3 100644
--- a/ManicEmu/ManicEmu/Resources/it.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/it.lproj/Localizable.strings
@@ -832,3 +832,25 @@ Se vuoi migliorare il tuo setup, PlayCase è l’abbinamento perfetto per questa
"NotInstallMeloNX" = "MeloNX non installato";
"FetchGamesFromMeloNX" = "Importa giochi da MeloNX";
"ChangeAlert" = "Il contenuto è stato modificato. Chiudendo ora andranno perse tutte le modifiche. Continuare a chiudere?";
+
+"JGenesisAlert" = "Spiacenti, il core JGenesis supporta solo file ROM .chd.";
+"RedeemOfferCode" = "Riscatta Offerta";
+"CheatImportFailed" = "Importazione fallita. Impossibile analizzare il file o non sono stati trovati codici cheat corrispondenti.";
+"RemoveAllCheats" = "Rimuovi Tutti i Cheat";
+"RemoveAllCheatsAlert" = "Sei sicuro di voler rimuovere tutti i codici cheat? Questa azione non può essere annullata.";
+"CheatCodeStatus" = "Abilitato";
+"Background" = "Sfondo";
+"AddBackgroundForLandscape" = "Aggiungi Sfondo Orizzontale";
+"AddBackgroundForPortrait" = "Aggiungi Sfondo Verticale";
+"UpdateBackground" = "Imposta Sfondo";
+"UpdateBackgroundForGame" = "Imposta per Questo Gioco";
+"UpdateBackgroundForConsole" = "Imposta per la Piattaforma %@";
+"UpdateBackgroundForGlobal" = "Imposta Globalmente";
+"RemoveBackgroundForGame" = "Rimuovi Sfondo del Gioco";
+"RemoveBackgroundForConsole" = "Rimuovi Sfondo della Piattaforma %@";
+"RemoveBackgroundForGlobal" = "Rimuovi Sfondo Globale";
+"ShaderConfigAlert" = "Impostato per %@.";
+"Global" = "Globale";
+"RemoveShaderForGlobal" = "Rimuovi Shader Globale";
+"FeaturedItems" = "Articoli in Evidenza";
+"ReUpload" = "Carica di Nuovo";
diff --git a/ManicEmu/ManicEmu/Resources/ja.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ja.lproj/Localizable.strings
index b41aac52..7eb9238d 100644
--- a/ManicEmu/ManicEmu/Resources/ja.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ja.lproj/Localizable.strings
@@ -825,3 +825,25 @@ PlayCaseは、アクセサリーやスキンとの互換性を考慮して作ら
"NotInstallMeloNX" = "MeloNXがインストールされていません";
"FetchGamesFromMeloNX" = "MeloNXからゲームをインポート";
"ChangeAlert" = "内容が変更されました。閉じると変更は失われます。閉じてもよろしいですか?";
+
+"JGenesisAlert" = "申し訳ありませんが、JGenesisコアは.chd ROMファイルのみをサポートしています。";
+"RedeemOfferCode" = "オファーを引き換える";
+"CheatImportFailed" = "インポートに失敗しました。ファイルを解析できなかったか、一致するチートコードが見つかりませんでした。";
+"RemoveAllCheats" = "すべてのチートを削除";
+"RemoveAllCheatsAlert" = "すべてのチートコードを削除してもよろしいですか?この操作は元に戻せません。";
+"CheatCodeStatus" = "有効";
+"Background" = "背景";
+"AddBackgroundForLandscape" = "横画面の背景を追加";
+"AddBackgroundForPortrait" = "縦画面の背景を追加";
+"UpdateBackground" = "背景を設定";
+"UpdateBackgroundForGame" = "このゲーム用に設定";
+"UpdateBackgroundForConsole" = "%@ プラットフォーム用に設定";
+"UpdateBackgroundForGlobal" = "グローバルに設定";
+"RemoveBackgroundForGame" = "ゲーム背景を削除";
+"RemoveBackgroundForConsole" = "%@ プラットフォーム背景を削除";
+"RemoveBackgroundForGlobal" = "グローバル背景を削除";
+"ShaderConfigAlert" = "%@ 用に設定されました。";
+"Global" = "グローバル";
+"RemoveShaderForGlobal" = "グローバルシェーダーを削除";
+"FeaturedItems" = "おすすめアイテム";
+"ReUpload" = "再アップロード";
diff --git a/ManicEmu/ManicEmu/Resources/ko.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ko.lproj/Localizable.strings
index de29ea9d..1b48d391 100644
--- a/ManicEmu/ManicEmu/Resources/ko.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ko.lproj/Localizable.strings
@@ -832,3 +832,25 @@ PlayCase는 액세서리 및 스킨 호환성을 고려하여 제작된 고품
"NotInstallMeloNX" = "MeloNX가 설치되지 않았습니다";
"FetchGamesFromMeloNX" = "MeloNX에서 게임 가져오기";
"ChangeAlert" = "내용이 변경되었습니다. 닫으면 모든 변경 사항이 손실됩니다. 계속 닫으시겠습니까?";
+
+"JGenesisAlert" = "죄송합니다, JGenesis 코어는 .chd ROM 파일만 지원합니다.";
+"RedeemOfferCode" = "오퍼 교환";
+"CheatImportFailed" = "가져오기 실패. 파일을 구문 분석할 수 없거나 일치하는 치트 코드를 찾을 수 없습니다.";
+"RemoveAllCheats" = "모든 치트 제거";
+"RemoveAllCheatsAlert" = "모든 치트 코드를 제거하시겠습니까? 이 작업은 취소할 수 없습니다.";
+"CheatCodeStatus" = "활성화됨";
+"Background" = "배경";
+"AddBackgroundForLandscape" = "가로 모드 배경 추가";
+"AddBackgroundForPortrait" = "세로 모드 배경 추가";
+"UpdateBackground" = "배경 설정";
+"UpdateBackgroundForGame" = "이 게임에 설정";
+"UpdateBackgroundForConsole" = "%@ 플랫폼에 설정";
+"UpdateBackgroundForGlobal" = "전역으로 설정";
+"RemoveBackgroundForGame" = "게임 배경 제거";
+"RemoveBackgroundForConsole" = "%@ 플랫폼 배경 제거";
+"RemoveBackgroundForGlobal" = "전역 배경 제거";
+"ShaderConfigAlert" = "%@에 설정되었습니다.";
+"Global" = "전역";
+"RemoveShaderForGlobal" = "전역 셰이더 제거";
+"FeaturedItems" = "추천 아이템";
+"ReUpload" = "다시 업로드";
diff --git a/ManicEmu/ManicEmu/Resources/ms.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ms.lproj/Localizable.strings
index 8a28d8b7..2ba91335 100644
--- a/ManicEmu/ManicEmu/Resources/ms.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ms.lproj/Localizable.strings
@@ -802,3 +802,25 @@ Jika anda ingin meningkatkan persediaan anda, PlayCase adalah padanan sempurna u
"NotInstallMeloNX" = "MeloNX Tidak Dipasang";
"FetchGamesFromMeloNX" = "Import Permainan daripada MeloNX";
"ChangeAlert" = "Kandungan telah berubah. Menutup sekarang akan menghilangkan semua perubahan. Teruskan menutup?";
+
+"JGenesisAlert" = "Maaf, teras JGenesis hanya menyokong fail ROM .chd.";
+"RedeemOfferCode" = "Tebus Tawaran";
+"CheatImportFailed" = "Import gagal. Fail tidak dapat dihuraikan atau tiada kod curi yang sepadan ditemui.";
+"RemoveAllCheats" = "Buang Semua Curi";
+"RemoveAllCheatsAlert" = "Adakah anda pasti mahu membuang semua kod curi? Tindakan ini tidak dapat dibatalkan.";
+"CheatCodeStatus" = "Dihidupkan";
+"Background" = "Latar Belakang";
+"AddBackgroundForLandscape" = "Tambah Latar Belakang Landskap";
+"AddBackgroundForPortrait" = "Tambah Latar Belakang Potret";
+"UpdateBackground" = "Set Latar Belakang";
+"UpdateBackgroundForGame" = "Set untuk Permainan Ini";
+"UpdateBackgroundForConsole" = "Set untuk Platform %@";
+"UpdateBackgroundForGlobal" = "Set Secara Global";
+"RemoveBackgroundForGame" = "Buang Latar Belakang Permainan";
+"RemoveBackgroundForConsole" = "Buang Latar Belakang Platform %@";
+"RemoveBackgroundForGlobal" = "Buang Latar Belakang Global";
+"ShaderConfigAlert" = "Ditentukan untuk %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Buang Shader Global";
+"FeaturedItems" = "Item Terpilih";
+"ReUpload" = "Muat Naik Semula";
diff --git a/ManicEmu/ManicEmu/Resources/nb.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/nb.lproj/Localizable.strings
index 43a59da9..558663e5 100644
--- a/ManicEmu/ManicEmu/Resources/nb.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/nb.lproj/Localizable.strings
@@ -820,3 +820,25 @@ Hvis du vil forbedre oppsettet ditt, er PlayCase et perfekt tilbehør til dette
"NotInstallMeloNX" = "MeloNX er ikke installert";
"FetchGamesFromMeloNX" = "Importer spill fra MeloNX";
"ChangeAlert" = "Innholdet er endret. Hvis du lukker nå, vil alle endringer gå tapt. Fortsette å lukke?";
+
+"JGenesisAlert" = "Beklager, JGenesis-kjernen støtter kun .chd ROM-filer.";
+"RedeemOfferCode" = "Løs Inn Tilbud";
+"CheatImportFailed" = "Import mislyktes. Filen kunne ikke analyseres eller ingen matchende jukkekoder ble funnet.";
+"RemoveAllCheats" = "Fjern Alle Jukkekoder";
+"RemoveAllCheatsAlert" = "Er du sikker på at du vil fjerne alle jukkekoder? Denne handlingen kan ikke angres.";
+"CheatCodeStatus" = "Aktivert";
+"Background" = "Bakgrunn";
+"AddBackgroundForLandscape" = "Legg Til Landskapsbakgrunn";
+"AddBackgroundForPortrait" = "Legg Til Portrettbakgrunn";
+"UpdateBackground" = "Sett Bakgrunn";
+"UpdateBackgroundForGame" = "Sett for Dette Spillet";
+"UpdateBackgroundForConsole" = "Sett for %@ Plattform";
+"UpdateBackgroundForGlobal" = "Sett Globalt";
+"RemoveBackgroundForGame" = "Fjern Spillbakgrunn";
+"RemoveBackgroundForConsole" = "Fjern %@ Plattformbakgrunn";
+"RemoveBackgroundForGlobal" = "Fjern Global Bakgrunn";
+"ShaderConfigAlert" = "Satt for %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Fjern Global Shader";
+"FeaturedItems" = "Utvalgte Gjenstander";
+"ReUpload" = "Last Opp På Nytt";
diff --git a/ManicEmu/ManicEmu/Resources/nl.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/nl.lproj/Localizable.strings
index 00b1cc1c..555bcbcc 100644
--- a/ManicEmu/ManicEmu/Resources/nl.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/nl.lproj/Localizable.strings
@@ -829,3 +829,25 @@ Als je je setup naar een hoger niveau wilt tillen, is PlayCase de perfecte match
"NotInstallMeloNX" = "MeloNX is niet geïnstalleerd";
"FetchGamesFromMeloNX" = "Games importeren vanuit MeloNX";
"ChangeAlert" = "De inhoud is gewijzigd. Sluiten nu zal alle wijzigingen verwijderen. Doorgaan met sluiten?";
+
+"JGenesisAlert" = "Sorry, de JGenesis-kern ondersteunt alleen .chd ROM-bestanden.";
+"RedeemOfferCode" = "Aanbieding Inwisselen";
+"CheatImportFailed" = "Importeren mislukt. Het bestand kon niet worden geparseerd of er zijn geen bijpassende cheatcodes gevonden.";
+"RemoveAllCheats" = "Alle Cheats Verwijderen";
+"RemoveAllCheatsAlert" = "Weet je zeker dat je alle cheatcodes wilt verwijderen? Deze actie kan niet ongedaan worden gemaakt.";
+"CheatCodeStatus" = "Ingeschakeld";
+"Background" = "Achtergrond";
+"AddBackgroundForLandscape" = "Landschap Achtergrond Toevoegen";
+"AddBackgroundForPortrait" = "Portret Achtergrond Toevoegen";
+"UpdateBackground" = "Achtergrond Instellen";
+"UpdateBackgroundForGame" = "Instellen voor Dit Spel";
+"UpdateBackgroundForConsole" = "Instellen voor %@ Platform";
+"UpdateBackgroundForGlobal" = "Globaal Instellen";
+"RemoveBackgroundForGame" = "Spel Achtergrond Verwijderen";
+"RemoveBackgroundForConsole" = "%@ Platform Achtergrond Verwijderen";
+"RemoveBackgroundForGlobal" = "Globale Achtergrond Verwijderen";
+"ShaderConfigAlert" = "Ingesteld voor %@.";
+"Global" = "Globaal";
+"RemoveShaderForGlobal" = "Globale Shader Verwijderen";
+"FeaturedItems" = "Uitgelichte Items";
+"ReUpload" = "Opnieuw Uploaden";
diff --git a/ManicEmu/ManicEmu/Resources/pl.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/pl.lproj/Localizable.strings
index 7edb8041..2a39c64d 100644
--- a/ManicEmu/ManicEmu/Resources/pl.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/pl.lproj/Localizable.strings
@@ -803,3 +803,25 @@ Jeśli chcesz ulepszyć swoją konfigurację, PlayCase jest idealnym uzupełnien
"NotInstallMeloNX" = "MeloNX nie jest zainstalowany";
"FetchGamesFromMeloNX" = "Importuj gry z MeloNX";
"ChangeAlert" = "Treść została zmieniona. Zamknięcie spowoduje utratę zmian. Kontynuować zamykanie?";
+
+"JGenesisAlert" = "Przepraszamy, rdzeń JGenesis obsługuje tylko pliki ROM .chd.";
+"RedeemOfferCode" = "Zrealizuj Ofertę";
+"CheatImportFailed" = "Import nie powiódł się. Nie można przeanalizować pliku lub nie znaleziono pasujących kodów oszustw.";
+"RemoveAllCheats" = "Usuń Wszystkie Oszustwa";
+"RemoveAllCheatsAlert" = "Czy na pewno chcesz usunąć wszystkie kody oszustw? Tej czynności nie można cofnąć.";
+"CheatCodeStatus" = "Włączone";
+"Background" = "Tło";
+"AddBackgroundForLandscape" = "Dodaj Tło Poziome";
+"AddBackgroundForPortrait" = "Dodaj Tło Pionowe";
+"UpdateBackground" = "Ustaw Tło";
+"UpdateBackgroundForGame" = "Ustaw dla tej Gry";
+"UpdateBackgroundForConsole" = "Ustaw dla Platformy %@";
+"UpdateBackgroundForGlobal" = "Ustaw Globalnie";
+"RemoveBackgroundForGame" = "Usuń Tło Gry";
+"RemoveBackgroundForConsole" = "Usuń Tło Platformy %@";
+"RemoveBackgroundForGlobal" = "Usuń Globalne Tło";
+"ShaderConfigAlert" = "Ustawiono dla %@.";
+"Global" = "Globalny";
+"RemoveShaderForGlobal" = "Usuń Globalny Shader";
+"FeaturedItems" = "Wyróżnione Elementy";
+"ReUpload" = "Prześlij Ponownie";
diff --git a/ManicEmu/ManicEmu/Resources/pt-BR.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/pt-BR.lproj/Localizable.strings
index ce68e41d..30d455d0 100644
--- a/ManicEmu/ManicEmu/Resources/pt-BR.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/pt-BR.lproj/Localizable.strings
@@ -829,3 +829,25 @@ Se você deseja aprimorar sua configuração, a PlayCase é o complemento perfei
"NotInstallMeloNX" = "MeloNX não está instalado";
"FetchGamesFromMeloNX" = "Importar jogos do MeloNX";
"ChangeAlert" = "O conteúdo foi alterado. Fechar agora resultará na perda das alterações. Continuar fechando?";
+
+"JGenesisAlert" = "Desculpe, o núcleo JGenesis só suporta arquivos ROM .chd.";
+"RedeemOfferCode" = "Resgatar Oferta";
+"CheatImportFailed" = "Falha na importação. O arquivo não pôde ser analisado ou nenhum código de trapaça correspondente foi encontrado.";
+"RemoveAllCheats" = "Remover Todas as Trapaças";
+"RemoveAllCheatsAlert" = "Tem certeza de que deseja remover todos os códigos de trapaça? Esta ação não pode ser desfeita.";
+"CheatCodeStatus" = "Ativado";
+"Background" = "Fundo";
+"AddBackgroundForLandscape" = "Adicionar Fundo Paisagem";
+"AddBackgroundForPortrait" = "Adicionar Fundo Retrato";
+"UpdateBackground" = "Definir Fundo";
+"UpdateBackgroundForGame" = "Definir para Este Jogo";
+"UpdateBackgroundForConsole" = "Definir para a Plataforma %@";
+"UpdateBackgroundForGlobal" = "Definir Globalmente";
+"RemoveBackgroundForGame" = "Remover Fundo do Jogo";
+"RemoveBackgroundForConsole" = "Remover Fundo da Plataforma %@";
+"RemoveBackgroundForGlobal" = "Remover Fundo Global";
+"ShaderConfigAlert" = "Definido para %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Remover Shader Global";
+"FeaturedItems" = "Itens em Destaque";
+"ReUpload" = "Fazer Upload Novamente";
diff --git a/ManicEmu/ManicEmu/Resources/pt-PT.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/pt-PT.lproj/Localizable.strings
index fc1b6013..aa310b4d 100644
--- a/ManicEmu/ManicEmu/Resources/pt-PT.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/pt-PT.lproj/Localizable.strings
@@ -830,3 +830,25 @@ Se pretende melhorar a sua configuração, a PlayCase é o complemento perfeito
"NotInstallMeloNX" = "O MeloNX não está instalado";
"FetchGamesFromMeloNX" = "Importar jogos do MeloNX";
"ChangeAlert" = "O conteúdo foi alterado. Fechar agora resultará na perda das alterações. Continuar a fechar?";
+
+"JGenesisAlert" = "Desculpe, o núcleo JGenesis só suporta ficheiros ROM .chd.";
+"RedeemOfferCode" = "Resgatar Oferta";
+"CheatImportFailed" = "Falha na importação. O ficheiro não pôde ser analisado ou não foram encontrados códigos de batota correspondentes.";
+"RemoveAllCheats" = "Remover Todas as Batotas";
+"RemoveAllCheatsAlert" = "Tem a certeza de que deseja remover todos os códigos de batota? Esta ação não pode ser desfeita.";
+"CheatCodeStatus" = "Ativado";
+"Background" = "Fundo";
+"AddBackgroundForLandscape" = "Adicionar Fundo Horizontal";
+"AddBackgroundForPortrait" = "Adicionar Fundo Vertical";
+"UpdateBackground" = "Definir Fundo";
+"UpdateBackgroundForGame" = "Definir para Este Jogo";
+"UpdateBackgroundForConsole" = "Definir para a Plataforma %@";
+"UpdateBackgroundForGlobal" = "Definir Globalmente";
+"RemoveBackgroundForGame" = "Remover Fundo do Jogo";
+"RemoveBackgroundForConsole" = "Remover Fundo da Plataforma %@";
+"RemoveBackgroundForGlobal" = "Remover Fundo Global";
+"ShaderConfigAlert" = "Definido para %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Remover Shader Global";
+"FeaturedItems" = "Itens em Destaque";
+"ReUpload" = "Carregar Novamente";
diff --git a/ManicEmu/ManicEmu/Resources/ro.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ro.lproj/Localizable.strings
index f432027a..a063ab9f 100644
--- a/ManicEmu/ManicEmu/Resources/ro.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ro.lproj/Localizable.strings
@@ -828,3 +828,25 @@ Dacă vrei să îți îmbunătățești setup-ul, PlayCase este potrivirea perfe
"NotInstallMeloNX" = "MeloNX nu este instalat";
"FetchGamesFromMeloNX" = "Importă jocuri din MeloNX";
"ChangeAlert" = "Conținutul a fost modificat. Închiderea acum va duce la pierderea tuturor modificărilor. Continuați închiderea?";
+
+"JGenesisAlert" = "Ne pare rău, nucleul JGenesis suportă doar fișiere ROM .chd.";
+"RedeemOfferCode" = "Răscumpărare Ofertă";
+"CheatImportFailed" = "Import eșuat. Fișierul nu a putut fi analizat sau nu au fost găsite coduri de cheat potrivite.";
+"RemoveAllCheats" = "Elimină Toate Cheat-urile";
+"RemoveAllCheatsAlert" = "Sigur doriți să eliminați toate codurile de cheat? Această acțiune nu poate fi anulată.";
+"CheatCodeStatus" = "Activat";
+"Background" = "Fundal";
+"AddBackgroundForLandscape" = "Adăugare Fundal Peisaj";
+"AddBackgroundForPortrait" = "Adăugare Fundal Portret";
+"UpdateBackground" = "Setează Fundal";
+"UpdateBackgroundForGame" = "Setează pentru Acest Joc";
+"UpdateBackgroundForConsole" = "Setează pentru Platforma %@";
+"UpdateBackgroundForGlobal" = "Setează Global";
+"RemoveBackgroundForGame" = "Elimină Fundalul Jocului";
+"RemoveBackgroundForConsole" = "Elimină Fundalul Platformei %@";
+"RemoveBackgroundForGlobal" = "Elimină Fundalul Global";
+"ShaderConfigAlert" = "Setat pentru %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Elimină Shader Global";
+"FeaturedItems" = "Articole Recomandate";
+"ReUpload" = "Reîncărcare";
diff --git a/ManicEmu/ManicEmu/Resources/ru.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/ru.lproj/Localizable.strings
index 0bdb6065..9f809f64 100644
--- a/ManicEmu/ManicEmu/Resources/ru.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/ru.lproj/Localizable.strings
@@ -824,3 +824,25 @@ PlayCase специализируется на высококачественн
"NotInstallMeloNX" = "MeloNX не установлен";
"FetchGamesFromMeloNX" = "Импортировать игры из MeloNX";
"ChangeAlert" = "Содержимое было изменено. Закрытие приведёт к потере изменений. Продолжить закрытие?";
+
+"JGenesisAlert" = "Извините, ядро JGenesis поддерживает только ROM-файлы .chd.";
+"RedeemOfferCode" = "Использовать предложение";
+"CheatImportFailed" = "Ошибка импорта. Файл не может быть проанализирован или не найдены соответствующие чит-коды.";
+"RemoveAllCheats" = "Удалить все читы";
+"RemoveAllCheatsAlert" = "Вы уверены, что хотите удалить все чит-коды? Это действие нельзя отменить.";
+"CheatCodeStatus" = "Включено";
+"Background" = "Фон";
+"AddBackgroundForLandscape" = "Добавить фон для альбомной ориентации";
+"AddBackgroundForPortrait" = "Добавить фон для портретной ориентации";
+"UpdateBackground" = "Установить фон";
+"UpdateBackgroundForGame" = "Установить для этой игры";
+"UpdateBackgroundForConsole" = "Установить для платформы %@";
+"UpdateBackgroundForGlobal" = "Установить глобально";
+"RemoveBackgroundForGame" = "Удалить фон игры";
+"RemoveBackgroundForConsole" = "Удалить фон платформы %@";
+"RemoveBackgroundForGlobal" = "Удалить глобальный фон";
+"ShaderConfigAlert" = "Установлено для %@.";
+"Global" = "Глобальный";
+"RemoveShaderForGlobal" = "Удалить глобальный шейдер";
+"FeaturedItems" = "Рекомендуемые товары";
+"ReUpload" = "Повторная загрузка";
diff --git a/ManicEmu/ManicEmu/Resources/sk.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/sk.lproj/Localizable.strings
index e997970d..6cfabfc1 100644
--- a/ManicEmu/ManicEmu/Resources/sk.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/sk.lproj/Localizable.strings
@@ -828,3 +828,25 @@ Ak chcete vylepšiť svoje nastavenie, PlayCase je perfektným doplnkom tohto sk
"NotInstallMeloNX" = "MeloNX nie je nainštalovaný";
"FetchGamesFromMeloNX" = "Importovať hry z MeloNX";
"ChangeAlert" = "Obsah bol zmenený. Zatvorením teraz stratíte všetky zmeny. Pokračovať v zatváraní?";
+
+"JGenesisAlert" = "Ľutujeme, jadro JGenesis podporuje iba .chd ROM súbory.";
+"RedeemOfferCode" = "Uplatniť Ponuku";
+"CheatImportFailed" = "Import zlyhal. Súbor nebolo možné analyzovať alebo neboli nájdené zodpovedajúce cheat kódy.";
+"RemoveAllCheats" = "Odstrániť Všetky Cheaty";
+"RemoveAllCheatsAlert" = "Ste si istí, že chcete odstrániť všetky cheat kódy? Túto akciu nie je možné vrátiť späť.";
+"CheatCodeStatus" = "Povolené";
+"Background" = "Pozadie";
+"AddBackgroundForLandscape" = "Pridať Pozadie na Šírku";
+"AddBackgroundForPortrait" = "Pridať Pozadie na Výšku";
+"UpdateBackground" = "Nastaviť Pozadie";
+"UpdateBackgroundForGame" = "Nastaviť pre Túto Hru";
+"UpdateBackgroundForConsole" = "Nastaviť pre Platformu %@";
+"UpdateBackgroundForGlobal" = "Nastaviť Globálne";
+"RemoveBackgroundForGame" = "Odstrániť Pozadie Hry";
+"RemoveBackgroundForConsole" = "Odstrániť Pozadie Platformy %@";
+"RemoveBackgroundForGlobal" = "Odstrániť Globálne Pozadie";
+"ShaderConfigAlert" = "Nastavené pre %@.";
+"Global" = "Globálne";
+"RemoveShaderForGlobal" = "Odstrániť Globálny Shader";
+"FeaturedItems" = "Odporúčané Položky";
+"ReUpload" = "Znova Nahrať";
diff --git a/ManicEmu/ManicEmu/Resources/sv.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/sv.lproj/Localizable.strings
index 34310d7b..4f830d41 100644
--- a/ManicEmu/ManicEmu/Resources/sv.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/sv.lproj/Localizable.strings
@@ -822,3 +822,25 @@ Om du vill höja din upplevelse är PlayCase en perfekt match för detta skin.";
"NotInstallMeloNX" = "MeloNX är inte installerat";
"FetchGamesFromMeloNX" = "Importera spel från MeloNX";
"ChangeAlert" = "Innehållet har ändrats. Om du stänger nu kommer alla ändringar att gå förlorade. Fortsätta stänga?";
+
+"JGenesisAlert" = "Tyvärr stöder JGenesis-kärnan endast .chd ROM-filer.";
+"RedeemOfferCode" = "Lös In Erbjudande";
+"CheatImportFailed" = "Import misslyckades. Filen kunde inte parsas eller inga matchande fuskkoder hittades.";
+"RemoveAllCheats" = "Ta Bort Alla Fusk";
+"RemoveAllCheatsAlert" = "Är du säker på att du vill ta bort alla fuskkoder? Denna åtgärd kan inte ångras.";
+"CheatCodeStatus" = "Aktiverad";
+"Background" = "Bakgrund";
+"AddBackgroundForLandscape" = "Lägg Till Landskapsbakgrund";
+"AddBackgroundForPortrait" = "Lägg Till Porträttbakgrund";
+"UpdateBackground" = "Ställ In Bakgrund";
+"UpdateBackgroundForGame" = "Ställ In för Detta Spel";
+"UpdateBackgroundForConsole" = "Ställ In för %@ Plattform";
+"UpdateBackgroundForGlobal" = "Ställ In Globalt";
+"RemoveBackgroundForGame" = "Ta Bort Spelbakgrund";
+"RemoveBackgroundForConsole" = "Ta Bort %@ Plattformsbakgrund";
+"RemoveBackgroundForGlobal" = "Ta Bort Global Bakgrund";
+"ShaderConfigAlert" = "Inställd för %@.";
+"Global" = "Global";
+"RemoveShaderForGlobal" = "Ta Bort Global Shader";
+"FeaturedItems" = "Utvalda Föremål";
+"ReUpload" = "Ladda Upp Igen";
diff --git a/ManicEmu/ManicEmu/Resources/th.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/th.lproj/Localizable.strings
index 9aca3b11..f8decccc 100644
--- a/ManicEmu/ManicEmu/Resources/th.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/th.lproj/Localizable.strings
@@ -818,3 +818,25 @@ PlayCase มุ่งเน้นที่เคส iPhone คุณภาพส
"NotInstallMeloNX" = "ยังไม่ได้ติดตั้ง MeloNX";
"FetchGamesFromMeloNX" = "นำเข้าจาก MeloNX";
"ChangeAlert" = "เนื้อหาได้รับการเปลี่ยนแปลง หากปิดตอนนี้จะสูญเสียการเปลี่ยนแปลงทั้งหมด ยังคงปิดต่อหรือไม่?";
+
+"JGenesisAlert" = "ขออภัย JGenesis core รองรับเฉพาะไฟล์ ROM .chd เท่านั้น";
+"RedeemOfferCode" = "แลกข้อเสนอ";
+"CheatImportFailed" = "นำเข้าไม่สำเร็จ ไม่สามารถแยกวิเคราะห์ไฟล์หรือไม่พบรหัสชีตที่ตรงกัน";
+"RemoveAllCheats" = "ลบชีตทั้งหมด";
+"RemoveAllCheatsAlert" = "คุณแน่ใจหรือไม่ว่าต้องการลบรหัสชีตทั้งหมด? การดำเนินการนี้ไม่สามารถยกเลิกได้";
+"CheatCodeStatus" = "เปิดใช้งาน";
+"Background" = "พื้นหลัง";
+"AddBackgroundForLandscape" = "เพิ่มพื้นหลังแนวนอน";
+"AddBackgroundForPortrait" = "เพิ่มพื้นหลังแนวตั้ง";
+"UpdateBackground" = "ตั้งค่าพื้นหลัง";
+"UpdateBackgroundForGame" = "ตั้งค่าสำหรับเกมนี้";
+"UpdateBackgroundForConsole" = "ตั้งค่าสำหรับแพลตฟอร์ม %@";
+"UpdateBackgroundForGlobal" = "ตั้งค่าแบบทั่วโลก";
+"RemoveBackgroundForGame" = "ลบพื้นหลังเกม";
+"RemoveBackgroundForConsole" = "ลบพื้นหลังแพลตฟอร์ม %@";
+"RemoveBackgroundForGlobal" = "ลบพื้นหลังทั่วโลก";
+"ShaderConfigAlert" = "ตั้งค่าสำหรับ %@";
+"Global" = "ทั่วโลก";
+"RemoveShaderForGlobal" = "ลบชาเดอร์ทั่วโลก";
+"FeaturedItems" = "รายการแนะนำ";
+"ReUpload" = "อัปโหลดอีกครั้ง";
diff --git a/ManicEmu/ManicEmu/Resources/tr.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/tr.lproj/Localizable.strings
index 5071e8a6..643dd7b9 100644
--- a/ManicEmu/ManicEmu/Resources/tr.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/tr.lproj/Localizable.strings
@@ -828,3 +828,25 @@ Kurulumunuzu bir üst seviyeye taşımak istiyorsanız, PlayCase bu kaplama içi
"NotInstallMeloNX" = "MeloNX Yüklü Değil";
"FetchGamesFromMeloNX" = "MeloNX'ten Oyunları İçe Aktar";
"ChangeAlert" = "İçerik değiştirildi. Şimdi kapatmak tüm değişiklikleri kaybedecektir. Kapatmaya devam edilsin mi?";
+
+"JGenesisAlert" = "Üzgünüz, JGenesis çekirdeği yalnızca .chd ROM dosyalarını destekler.";
+"RedeemOfferCode" = "Teklifi Kullan";
+"CheatImportFailed" = "İçe aktarma başarısız. Dosya ayrıştırılamadı veya eşleşen hile kodu bulunamadı.";
+"RemoveAllCheats" = "Tüm Hileleri Kaldır";
+"RemoveAllCheatsAlert" = "Tüm hile kodlarını kaldırmak istediğinizden emin misiniz? Bu işlem geri alınamaz.";
+"CheatCodeStatus" = "Etkin";
+"Background" = "Arka Plan";
+"AddBackgroundForLandscape" = "Yatay Arka Plan Ekle";
+"AddBackgroundForPortrait" = "Dikey Arka Plan Ekle";
+"UpdateBackground" = "Arka Planı Ayarla";
+"UpdateBackgroundForGame" = "Bu Oyun İçin Ayarla";
+"UpdateBackgroundForConsole" = "%@ Platformu İçin Ayarla";
+"UpdateBackgroundForGlobal" = "Genel Olarak Ayarla";
+"RemoveBackgroundForGame" = "Oyun Arka Planını Kaldır";
+"RemoveBackgroundForConsole" = "%@ Platform Arka Planını Kaldır";
+"RemoveBackgroundForGlobal" = "Genel Arka Planı Kaldır";
+"ShaderConfigAlert" = "%@ için ayarlandı.";
+"Global" = "Genel";
+"RemoveShaderForGlobal" = "Genel Shader'ı Kaldır";
+"FeaturedItems" = "Öne Çıkan Öğeler";
+"ReUpload" = "Yeniden Yükle";
diff --git a/ManicEmu/ManicEmu/Resources/uk.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/uk.lproj/Localizable.strings
index 0981fde9..db970ae6 100644
--- a/ManicEmu/ManicEmu/Resources/uk.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/uk.lproj/Localizable.strings
@@ -828,3 +828,25 @@ PlayCase спеціалізується на високоякісних чохл
"NotInstallMeloNX" = "MeloNX не встановлено";
"FetchGamesFromMeloNX" = "Імпортувати ігри з MeloNX";
"ChangeAlert" = "Вміст було змінено. Закриття призведе до втрати всіх змін. Продовжити закриття?";
+
+"JGenesisAlert" = "Вибачте, ядро JGenesis підтримує лише ROM-файли .chd.";
+"RedeemOfferCode" = "Використати пропозицію";
+"CheatImportFailed" = "Помилка імпорту. Файл не вдалося проаналізувати або не знайдено відповідних чит-кодів.";
+"RemoveAllCheats" = "Видалити всі чити";
+"RemoveAllCheatsAlert" = "Ви впевнені, що хочете видалити всі чит-коди? Цю дію не можна скасувати.";
+"CheatCodeStatus" = "Увімкнено";
+"Background" = "Фон";
+"AddBackgroundForLandscape" = "Додати фон для альбомної орієнтації";
+"AddBackgroundForPortrait" = "Додати фон для книжної орієнтації";
+"UpdateBackground" = "Встановити фон";
+"UpdateBackgroundForGame" = "Встановити для цієї гри";
+"UpdateBackgroundForConsole" = "Встановити для платформи %@";
+"UpdateBackgroundForGlobal" = "Встановити глобально";
+"RemoveBackgroundForGame" = "Видалити фон гри";
+"RemoveBackgroundForConsole" = "Видалити фон платформи %@";
+"RemoveBackgroundForGlobal" = "Видалити глобальний фон";
+"ShaderConfigAlert" = "Встановлено для %@.";
+"Global" = "Глобальний";
+"RemoveShaderForGlobal" = "Видалити глобальний шейдер";
+"FeaturedItems" = "Рекомендовані товари";
+"ReUpload" = "Повторне завантаження";
diff --git a/ManicEmu/ManicEmu/Resources/vi.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/vi.lproj/Localizable.strings
index f40f4d89..19b68482 100644
--- a/ManicEmu/ManicEmu/Resources/vi.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/vi.lproj/Localizable.strings
@@ -822,3 +822,25 @@ Nếu bạn muốn nâng cấp thiết lập của mình, PlayCase là sự kế
"NotInstallMeloNX" = "Chưa cài đặt MeloNX";
"FetchGamesFromMeloNX" = "Nhập trò chơi từ MeloNX";
"ChangeAlert" = "Nội dung đã thay đổi. Đóng ngay bây giờ sẽ mất mọi thay đổi. Tiếp tục đóng?";
+
+"JGenesisAlert" = "Xin lỗi, lõi JGenesis chỉ hỗ trợ tệp ROM .chd.";
+"RedeemOfferCode" = "Đổi Ưu Đãi";
+"CheatImportFailed" = "Nhập thất bại. Không thể phân tích tệp hoặc không tìm thấy mã cheat phù hợp.";
+"RemoveAllCheats" = "Xóa Tất Cả Cheat";
+"RemoveAllCheatsAlert" = "Bạn có chắc chắn muốn xóa tất cả mã cheat không? Hành động này không thể hoàn tác.";
+"CheatCodeStatus" = "Đã Bật";
+"Background" = "Nền";
+"AddBackgroundForLandscape" = "Thêm Nền Ngang";
+"AddBackgroundForPortrait" = "Thêm Nền Dọc";
+"UpdateBackground" = "Đặt Nền";
+"UpdateBackgroundForGame" = "Đặt cho Trò Chơi Này";
+"UpdateBackgroundForConsole" = "Đặt cho Nền Tảng %@";
+"UpdateBackgroundForGlobal" = "Đặt Toàn Cục";
+"RemoveBackgroundForGame" = "Xóa Nền Trò Chơi";
+"RemoveBackgroundForConsole" = "Xóa Nền Nền Tảng %@";
+"RemoveBackgroundForGlobal" = "Xóa Nền Toàn Cục";
+"ShaderConfigAlert" = "Đã đặt cho %@.";
+"Global" = "Toàn Cục";
+"RemoveShaderForGlobal" = "Xóa Shader Toàn Cục";
+"FeaturedItems" = "Mục Nổi Bật";
+"ReUpload" = "Tải Lên Lại";
diff --git a/ManicEmu/ManicEmu/Resources/zh-HK.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/zh-HK.lproj/Localizable.strings
index 1fa26e23..2379a5ee 100644
--- a/ManicEmu/ManicEmu/Resources/zh-HK.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/zh-HK.lproj/Localizable.strings
@@ -834,3 +834,25 @@ PlayCase 專注於製造高品質 iPhone 手機殼,設計時已充分考慮配
"NotInstallMeloNX" = "尚未安裝 MeloNX";
"FetchGamesFromMeloNX" = "從 MeloNX 匯入遊戲";
"ChangeAlert" = "內容已變更,關閉視窗將遺失所有變更。是否繼續關閉?";
+
+"JGenesisAlert" = "抱歉,JGenesis 核心僅支援 .chd 格式嘅 ROM 檔案。";
+"RedeemOfferCode" = "兌換優惠";
+"CheatImportFailed" = "導入失敗,檔案解析出錯或未搵到匹配嘅作弊碼。";
+"RemoveAllCheats" = "清空作弊碼";
+"RemoveAllCheatsAlert" = "確定要移除所有作弊碼嗎?此操作無法恢復。";
+"CheatCodeStatus" = "啟用狀態";
+"Background" = "背景";
+"AddBackgroundForLandscape" = "添加橫屏背景";
+"AddBackgroundForPortrait" = "添加豎屏背景";
+"UpdateBackground" = "設定背景";
+"UpdateBackgroundForGame" = "為當前遊戲設定";
+"UpdateBackgroundForConsole" = "為 %@ 平台設定";
+"UpdateBackgroundForGlobal" = "設為全局";
+"RemoveBackgroundForGame" = "移除當前遊戲背景";
+"RemoveBackgroundForConsole" = "移除 %@ 平台背景";
+"RemoveBackgroundForGlobal" = "移除全局背景";
+"ShaderConfigAlert" = "該着色器已為 %@ 設定。";
+"Global" = "全局";
+"RemoveShaderForGlobal" = "移除全局着色器";
+"FeaturedItems" = "精選周邊";
+"ReUpload" = "重新上傳";
diff --git a/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings
index 55774631..38117130 100644
--- a/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/zh-Hans.lproj/Localizable.strings
@@ -837,3 +837,25 @@
"NotInstallMeloNX" = "尚未安装 MeloNX";
"FetchGamesFromMeloNX" = "从 MeloNX 导入游戏";
"ChangeAlert" = "内容已变更,关闭页面将会丢失已变更内容,是否继续关闭?";
+
+"JGenesisAlert" = "抱歉,JGenesis 核心仅支持 .chd 格式的 ROM 文件。";
+"RedeemOfferCode" = "兑换优惠";
+"CheatImportFailed" = "导入失败,文件解析出错或未找到匹配的作弊码。";
+"RemoveAllCheats" = "清空作弊码";
+"RemoveAllCheatsAlert" = "确定要移除所有作弊码吗?此操作无法恢复。";
+"CheatCodeStatus" = "启用状态";
+"Background" = "背景";
+"AddBackgroundForLandscape" = "添加横屏背景";
+"AddBackgroundForPortrait" = "添加竖屏背景";
+"UpdateBackground" = "设定背景";
+"UpdateBackgroundForGame" = "为当前游戏设定";
+"UpdateBackgroundForConsole" = "为 %@ 平台设定";
+"UpdateBackgroundForGlobal" = "设为全局";
+"RemoveBackgroundForGame" = "移除当前游戏背景";
+"RemoveBackgroundForConsole" = "移除 %@ 平台背景";
+"RemoveBackgroundForGlobal" = "移除全局背景";
+"ShaderConfigAlert" = "该着色器已为 %@ 设定。";
+"Global" = "全局";
+"RemoveShaderForGlobal" = "移除全局着色器";
+"FeaturedItems" = "精选周边";
+"ReUpload" = "重新上传";
diff --git a/ManicEmu/ManicEmu/Resources/zh-Hant.lproj/Localizable.strings b/ManicEmu/ManicEmu/Resources/zh-Hant.lproj/Localizable.strings
index 55092934..3a6e2a3a 100644
--- a/ManicEmu/ManicEmu/Resources/zh-Hant.lproj/Localizable.strings
+++ b/ManicEmu/ManicEmu/Resources/zh-Hant.lproj/Localizable.strings
@@ -834,3 +834,25 @@ PlayCase 專注於高品質 iPhone 保護殼,設計時充分考慮了配件與
"NotInstallMeloNX" = "尚未安裝 MeloNX";
"FetchGamesFromMeloNX" = "從 MeloNX 匯入遊戲";
"ChangeAlert" = "內容已變更,關閉將導致變更遺失。是否繼續關閉?";
+
+"JGenesisAlert" = "抱歉,JGenesis 核心僅支援 .chd 格式的 ROM 檔案。";
+"RedeemOfferCode" = "兌換優惠";
+"CheatImportFailed" = "導入失敗,檔案解析出錯或未找到匹配的作弊碼。";
+"RemoveAllCheats" = "清空作弊碼";
+"RemoveAllCheatsAlert" = "確定要移除所有作弊碼嗎?此操作無法恢復。";
+"CheatCodeStatus" = "啟用狀態";
+"Background" = "背景";
+"AddBackgroundForLandscape" = "添加橫屏背景";
+"AddBackgroundForPortrait" = "添加豎屏背景";
+"UpdateBackground" = "設定背景";
+"UpdateBackgroundForGame" = "為當前遊戲設定";
+"UpdateBackgroundForConsole" = "為 %@ 平台設定";
+"UpdateBackgroundForGlobal" = "設為全局";
+"RemoveBackgroundForGame" = "移除當前遊戲背景";
+"RemoveBackgroundForConsole" = "移除 %@ 平台背景";
+"RemoveBackgroundForGlobal" = "移除全局背景";
+"ShaderConfigAlert" = "該著色器已為 %@ 設定。";
+"Global" = "全局";
+"RemoveShaderForGlobal" = "移除全局著色器";
+"FeaturedItems" = "精選周邊";
+"ReUpload" = "重新上傳";
diff --git a/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift b/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift
index ac183494..c74b39a5 100644
--- a/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/ApplicationSceneDelegate.swift
@@ -75,7 +75,7 @@ class ApplicationSceneDelegate: UIResponder, UIWindowSceneDelegate {
OAuthSwift.handle(url: url)
} else if scheme == Constants.Strings.ManicScheme {
if let host = url.host, host == Constants.Strings.MeloNXScheme {
- MelonNXKit.processGames(callbackUrl: url)
+ MeloNXKit.processGames(callbackUrl: url)
} else {
Self.launchGameID = url.lastPathComponent
}
diff --git a/ManicEmu/ManicEmu/Sources/Base/Cipher.swift b/ManicEmu/ManicEmu/Sources/Base/Cipher.swift
new file mode 100644
index 00000000..2a555a96
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Base/Cipher.swift
@@ -0,0 +1,25 @@
+//
+// Cipher.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/2/3.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+extension Constants {
+ struct Cipher {
+ static let BaiduYunAppKey = ""
+ static let BaiduYunSecretKey = ""
+ static let DropboxAppKey = ""
+ static let DropboxAppSecret = ""
+ static let GoogleDriveAppId = ""
+ static let OneDriveAppId = ""
+ static let OneDriveSecrectKey = ""
+ static let AliYunAppId = ""
+ static let AliYunSecrectKey = ""
+ static let UMAppKey = ""
+ static let ManicKey = ""
+ static let DeepSeek = ""
+ static let RetroAPI = ""
+ }
+}
diff --git a/ManicEmu/ManicEmu/Sources/Base/Constants.swift b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
index 3e35ffa9..e33cbd70 100644
--- a/ManicEmu/ManicEmu/Sources/Base/Constants.swift
+++ b/ManicEmu/ManicEmu/Sources/Base/Constants.swift
@@ -96,6 +96,11 @@ struct Constants {
case .mcd: return (Locale.prefersUS ? 0.5864 : 1.1)
case .arcade: return 0.731
case .ns: return 0.611
+ case .a2600: return 0.735
+ case .a5200: return 0.732
+ case .a7800: return 0.709
+ case .jaguar: return 0.724
+ case .lynx: return 1.118
default: return 1.0
}
case .style2:
@@ -246,22 +251,6 @@ struct Constants {
dark: UIColor(hexString: "#FB89DE")!)
}
- struct Cipher {
- static let BaiduYunAppKey = ""
- static let BaiduYunSecretKey = ""
- static let DropboxAppKey = ""
- static let DropboxAppSecret = ""
- static let GoogleDriveAppId = ""
- static let OneDriveAppId = ""
- static let OneDriveSecrectKey = ""
- static let AliYunAppId = ""
- static let AliYunSecrectKey = ""
- static let UMAppKey = ""
- static let ManicKey = ""
- static let DeepSeek = ""
- static let RetroAPI = ""
- }
-
struct Path {
static let Document = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
static var Data: String {
@@ -318,6 +307,11 @@ struct Constants {
static let Flycast = Document.appendingPathComponent(LibretroCore.Cores.Flycast.name)
static let bsnes = Document.appendingPathComponent(LibretroCore.Cores.bsnes.name)
static let MAME = Document.appendingPathComponent(LibretroCore.Cores.MAME.name)
+ static let Stella = Document.appendingPathComponent(LibretroCore.Cores.Stella.name)
+ static let Atari800 = Document.appendingPathComponent(LibretroCore.Cores.Atari800.name)
+ static let ProSystem = Document.appendingPathComponent(LibretroCore.Cores.ProSystem.name)
+ static let VirtualJaguar = Document.appendingPathComponent(LibretroCore.Cores.VirtualJaguar.name)
+ static let Holani = Document.appendingPathComponent(LibretroCore.Cores.Holani.name)
static let LibretroSavePath = Document
static let GamesDB = Resource.appendingPathComponent("Games.db")
static let MAMEDB = Resource.appendingPathComponent("MAME.db")
@@ -340,6 +334,8 @@ struct Constants {
static let ShaderRetroArchSlang = ShaderRetroArch.appendingPathComponent("slang")
static let ShaderImported = Shaders.appendingPathComponent("imported")
static let ShaderImportedInDocument = Document.appendingPathComponent("Shaders")
+ static let JGenesis = Resource.appendingPathComponent("jgenesis")
+ static let RomPatcher = Resource.appendingPathComponent("RomPatcher")
}
struct DefaultKey {
@@ -426,7 +422,7 @@ struct Constants {
static let PSPConsoleLanguage = ["Automatic", "English", "日本語", "Français", "Español", "Deutsch", "Italiano", "Nederlands", "Português", "Русский", "한국어", "繁體中文", "简体中文"]
static let ThreeDSConsoleLanguage = ["Automatic", "Japan", "USA" , "Europe", "Australia", "China", "Korea", "Taiwan"]
static let SaturnConsoleLanguage = ["Auto Detect", "Japan", "North America", "Europe", "South Korea", "Asia (NTSC)", "Asia (PAL)", "Brazil", "Latin America"]
- static let DSConsoleLanguage = ["Automatic", "Japanese", "English", "French", "German", "Italian", "Spanish"]
+ static let DSConsoleLanguage = ["Auto", "Japanese", "English", "French", "German", "Italian", "Spanish"]
static let DCConsoleLanguage = ["Default", "Japanese", "English", "German", "French", "Spanish", "Italian"]
static let ManicScheme = "manicemu"
static var PSXController = "PlayStation Controller"
@@ -600,6 +596,7 @@ struct Constants {
case .vb: return URL(string: "\(deltastyles)/systems/virtualboy")!
case .ps1: return URL(string: "\(deltastyles)/systems/ps1")!
case .dc: return URL(string: "\(deltastyles)/systems/dreamcast")!
+ case .arcade: return URL(string: "\(deltastyles)/systems/arcade")!
default: return URL(string: deltastyles)!
}
}
@@ -617,7 +614,6 @@ struct Constants {
}
static let Retro = URL(string: "https://retroachievements.org")!
static let MobyGames = URL(string: "https://www.mobygames.com")!
- static let RomPatcher = URL(string: "https://www.marcrobledo.com/RomPatcher.js")!
static let InstallSideload = URL(string: "sidestore://source?url=apps.manicemu.site/altstore")!
static let SideStore = URL(string: "https://sidestore.io")!
static let GLSLShaders = URL(string: "https://buildbot.libretro.com/assets/frontend/shaders_glsl.zip")!
@@ -693,6 +689,7 @@ struct Constants {
]
static var MAMEBiosMap: [String: String] {
+ //Source: MAME 0.282 (arcade).dat
["3dobios.zip" : "3DO BIOS",
"airlbios.zip" : "NAOMI Airline Pilots (deluxe) BIOS",
"aleck64.zip" : "Aleck64 PIF BIOS",
@@ -774,5 +771,17 @@ struct Constants {
"triforce.zip" : "Triforce BIOS",
"v4bios.zip" : "MPU4 Video Firmware"]
}
+
+ static let A5200Bios = [
+ BIOSItem(fileName: "5200.rom", imported: false, desc: "5200 BIOS", required: false)
+ ]
+
+ static let A7800Bios = [
+ BIOSItem(fileName: "7800 BIOS (U).rom", imported: false, desc: "7800 BIOS", required: false)
+ ]
+
+ static let LynxBios = [
+ BIOSItem(fileName: "lynxboot.img", imported: false, desc: "Lynx Boot Image", required: false)
+ ]
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/AddCheatCodeView.swift b/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/AddCheatCodeView.swift
index 3e679b5f..ef1e67dd 100644
--- a/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/AddCheatCodeView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/AddCheatCodeView.swift
@@ -13,8 +13,8 @@ import ProHUD
class AddCheatCodeView: BaseView {
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -47,27 +47,10 @@ class AddCheatCodeView: BaseView {
var isValid = false
if CheatType(cheatCodeType) == .autoDetect {
//自动检测模式下需要帮用户做一下检查
- for cheatFormat in supportedCheatFormats.filter({ $0.type != .autoDetect }) {
- let formatString: String
- if cheatFormat.type == .cwCheat {
- formatString = formattedCWCheat(code: cheatCode)
- } else {
- formatString = cheatCode.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: ":", with: "").components(separatedBy: .whitespacesAndNewlines).joined().formatted(with: cheatFormat)
- }
-
- var isMatchThisFormat = true
- for subString in formatString.lines() {
- if !isCodeMatchingFormat(format: cheatFormat.format, code: subString) {
- isMatchThisFormat = false
- break
- }
- }
- if isMatchThisFormat {
- isValid = true
- cheatCode = formatString
- cheatCodeType = cheatFormat.type.rawValue
- break
- }
+ if let result = Self.checkCheat(cheatCode: cheatCode, supportedCheatFormats: supportedCheatFormats) {
+ isValid = true
+ cheatCode = result.formatString
+ cheatCodeType = result.cheatFormat.type.rawValue
}
} else {
//指定了作弊码类型 且已经通过校验
@@ -116,7 +99,6 @@ class AddCheatCodeView: BaseView {
return view
}()
-
private var game: Game
private let autoDetectCheatFormat = CheatFormat(name: R.string.localizable.autoDetectCheatTypeName(), format: R.string.localizable.autoDetectFormat(), type: .autoDetect)
private lazy var supportedCheatFormats: [CheatFormat] = {
@@ -165,7 +147,8 @@ class AddCheatCodeView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -232,29 +215,16 @@ class AddCheatCodeView: BaseView {
} else {
let cheatType = CheatType(rawValue: cheatCodeType)
if cheatType != .autoDetect {
- let formatString: String
- if currentCheatFormat.type == .cwCheat {
- formatString = formattedCWCheat(code: cheatCode)
- } else {
- formatString = cheatCode.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: ":", with: "").components(separatedBy: .whitespacesAndNewlines).joined().formatted(with: currentCheatFormat)
- }
-
- for subString in formatString.lines() {
- if !isCodeMatchingFormat(format: currentCheatFormat.format, code: subString) {
- isValid = false
- break
- }
- }
- if isValid {
- cheatCode = formatString
- cheatCodeType = currentCheatFormat.type.rawValue
+ if let result = Self.checkCheat(cheatCode: cheatCode, currentCheatFormat: currentCheatFormat) {
+ cheatCode = result.formatString
+ cheatCodeType = result.cheatFormat.type.rawValue
}
}
}
updateConfirmButton(enable: isValid)
}
- private func formattedCWCheat(code: String) -> String {
+ private static func formattedCWCheat(code: String) -> String {
var index = 0
let codes = code.trimmingCharacters(in: .whitespacesAndNewlines).components(separatedBy: .whitespacesAndNewlines)
return codes.reduce("", {
@@ -266,7 +236,7 @@ class AddCheatCodeView: BaseView {
})
}
- private func isCodeMatchingFormat(format: String, code: String) -> Bool {
+ private static func isCodeMatchingFormat(format: String, code: String) -> Bool {
// 将 format 和 code 按空格分割成数组
let formatComponents = format.components(separatedBy: " ")
let codeComponents = code.components(separatedBy: " ")
@@ -321,6 +291,54 @@ class AddCheatCodeView: BaseView {
}
}
+
+ static func checkCheat(cheatCode: String,
+ currentCheatFormat: CheatFormat? = nil,
+ supportedCheatFormats: [CheatFormat] = []) -> (formatString: String, cheatFormat: CheatFormat)? {
+ if let currentCheatFormat {
+ //指定作弊码类型的检查
+ var isValid = true
+ let formatString: String
+ if currentCheatFormat.type == .cwCheat {
+ formatString = Self.formattedCWCheat(code: cheatCode)
+ } else {
+ formatString = cheatCode.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: ":", with: "").components(separatedBy: .whitespacesAndNewlines).joined().formatted(with: currentCheatFormat)
+ }
+
+ for subString in formatString.lines() {
+ if !Self.isCodeMatchingFormat(format: currentCheatFormat.format, code: subString) {
+ return nil
+ }
+ }
+
+ return (formatString, currentCheatFormat)
+
+ } else {
+ //未指定作弊码类型的检查
+ for cheatFormat in supportedCheatFormats.filter({ $0.type != .autoDetect }) {
+ let formatString: String
+ if cheatFormat.type == .cwCheat {
+ formatString = formattedCWCheat(code: cheatCode)
+ } else {
+ formatString = cheatCode.replacingOccurrences(of: "-", with: "").replacingOccurrences(of: ":", with: "").components(separatedBy: .whitespacesAndNewlines).joined().formatted(with: cheatFormat)
+ }
+
+ var isMatchThisFormat = true
+ for subString in formatString.lines() {
+ if !isCodeMatchingFormat(format: cheatFormat.format, code: subString) {
+ isMatchThisFormat = false
+ break
+ }
+ }
+ if isMatchThisFormat {
+ return (formatString, cheatFormat)
+ } else {
+ return nil
+ }
+ }
+ }
+ return nil
+ }
}
extension AddCheatCodeView: UICollectionViewDataSource {
diff --git a/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/CheatCodeListView.swift b/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/CheatCodeListView.swift
index f802cd50..9fb35590 100644
--- a/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/CheatCodeListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/CheatCodeListView.swift
@@ -10,11 +10,13 @@
import SwipeCellKit
import RealmSwift
import ProHUD
+import UniformTypeIdentifiers
+import ManicEmuCore
class CheatCodeListView: BaseView {
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -33,9 +35,54 @@ class CheatCodeListView: BaseView {
return view
}()
- private var howToButton: HowToButton = {
- let view = HowToButton(title: R.string.localizable.howToFetch(), enableGlass: true) {
+ private lazy var moreContextMenuButton: ContextMenuButton = {
+ var actions: [UIMenuElement] = []
+ actions.append(UIMenu(title: R.string.localizable.gameSortType(),
+ image: UIImage(symbol: .arrowUpArrowDown),
+ options: .singleSelection,
+ children: GameCheatSortType.allCases.map({ type in
+ let currentType = GameCheatSortType(rawValue: Settings.defalut.getExtraInt(key: ExtraKey.cheatSort.rawValue) ?? 0) ?? .dateAscending
+ return UIAction(title: type.title,
+ state: currentType == type ? .on : .off,
+ handler: { [weak self] _ in
+ guard let self = self else { return }
+ Settings.defalut.updateExtra(key: ExtraKey.cheatSort.rawValue, value: type.rawValue)
+ self.reloadCheats()
+ self.tableView.reloadData()
+ })
+ })))
+ actions.append((UIAction(title: R.string.localizable.removeAllCheats(), image: UIImage(symbol: .trash)) { [weak self] _ in
+ guard let self = self else { return }
+ //移除所有作弊码
+ UIView.makeAlert(detail: R.string.localizable.removeAllCheatsAlert(),
+ confirmTitle: R.string.localizable.removeTitle(),
+ confirmAction: {
+ Game.change { realm in
+ if Settings.defalut.iCloudSyncEnable {
+ self.gameCheatsResults.forEach({ $0.isDeleted = true })
+ } else {
+ realm.delete(self.gameCheatsResults)
+ }
+ }
+ self.reloadCheats()
+ self.tableView.reloadData()
+ })
+
+ }))
+ actions.append((UIAction(title: R.string.localizable.howToFetch(), image: UIImage(symbol: .book)) { [weak self] _ in
+ guard let self = self else { return }
+ //如何获取
topViewController()?.present(WebViewController(url: Constants.URLs.CheatCodesGuide), animated: true)
+ }))
+ let view = ContextMenuButton(image: nil, menu: UIMenu(children: actions))
+ return view
+ }()
+
+ private lazy var moreButton: SymbolButton = {
+ let view = SymbolButton(symbol: .ellipsis, enableGlass: true)
+ view.enableRoundCorner = true
+ view.addTapGesture { [weak self] gesture in
+ self?.moreContextMenuButton.triggerTapGesture()
}
return view
}()
@@ -68,8 +115,34 @@ class CheatCodeListView: BaseView {
return view
}()
+ private lazy var appendButton: SymbolButton = {
+ var cheatFileExtension = ""
+ var supportFileExtensions: [UTType] = []
+ if game.gameType == ._3ds {
+ cheatFileExtension = ".txt"
+ supportFileExtensions.append(UTType(filenameExtension: "txt")!)
+ } else if game.gameType == .psp {
+ cheatFileExtension = ".db .ini"
+ supportFileExtensions.append(UTType(filenameExtension: "db")!)
+ supportFileExtensions.append(UTType(filenameExtension: "ini")!)
+ }
+ let view = SymbolButton(image: nil, title: R.string.localizable.tabbarTitleImport() + " \(cheatFileExtension)", titleFont: Constants.Font.body(size: .l, weight: .medium), titleColor: Constants.Color.LabelPrimary.forceStyle(.dark), horizontalContian: true, titlePosition: .right)
+ view.enableRoundCorner = true
+ view.backgroundColor = Constants.Color.Red
+ view.addTapGesture { [weak self] gesture in
+ guard let self else { return }
+ FilesImporter.shared.presentImportController(supportedTypes: supportFileExtensions) { [weak self] urls in
+ guard let self else { return }
+ self.parseImportCheatFiles(urls: urls)
+ }
+ }
+ return view
+ }()
+
///游戏
- private var gameCheats: Results<GameCheat>
+ private var gameCheatsResults: Results<GameCheat>
+ private var gameCheats: [GameCheat] = []
+ private var game: Game
var didTapAdd: (()->Void)? = nil
var didTapClose: (()->Void)? = nil
@@ -81,16 +154,18 @@ class CheatCodeListView: BaseView {
private var gamesCheatsUpdateToken: NotificationToken? = nil
init(game: Game) {
- self.gameCheats = game.gameCheats.where({ !$0.isDeleted })
+ self.game = game
+ self.gameCheatsResults = game.gameCheats.where({ !$0.isDeleted })
super.init(frame: .zero)
Log.debug("\(String(describing: Self.self)) init")
- gamesCheatsUpdateToken = gameCheats.observe { [weak self] changes in
+ gamesCheatsUpdateToken = gameCheatsResults.observe { [weak self] changes in
guard let self = self else { return }
switch changes {
- case .update(_, let deletions, let insertions, _):
- if !deletions.isEmpty || !insertions.isEmpty {
+ case .update(_, let deletions, let insertions, let modifications):
+ if !deletions.isEmpty || !insertions.isEmpty || !modifications.isEmpty {
Log.debug("作弊码列表更新")
+ reloadCheats()
DispatchQueue.main.asyncAfter(delay: 0.4) {
self.tableView.reloadData()
}
@@ -100,6 +175,8 @@ class CheatCodeListView: BaseView {
}
}
+ reloadCheats()
+
addSubview(tableView)
tableView.snp.makeConstraints { make in
make.edges.equalToSuperview()
@@ -107,7 +184,8 @@ class CheatCodeListView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -135,17 +213,142 @@ class CheatCodeListView: BaseView {
make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
}
- navigationBlurView.addSubview(howToButton)
- howToButton.snp.makeConstraints { make in
- make.height.equalTo(Constants.Size.ItemHeightUltraTiny)
- make.trailing.equalTo(closeButton.snp.leading).offset(-Constants.Size.ContentSpaceTiny)
+ navigationBlurView.addSubview(moreContextMenuButton)
+ navigationBlurView.addSubview(moreButton)
+ moreButton.snp.makeConstraints { make in
+ make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
+ make.trailing.equalTo(closeButton.snp.leading).offset(-Constants.Size.ContentSpaceMid)
make.centerY.equalTo(closeButton)
}
+ moreContextMenuButton.snp.makeConstraints { make in
+ make.edges.equalTo(moreButton)
+ }
+
+ if game.gameType == ._3ds || game.gameType == .psp {
+ //table底部缩进
+ var tableContentInset = tableView.contentInset
+ tableContentInset.bottom = tableContentInset.bottom + Constants.Size.ItemHeightMid + Constants.Size.ContentSpaceMid
+ tableView.contentInset = tableContentInset
+
+ addSubview(appendButton)
+ appendButton.snp.makeConstraints { make in
+ make.leading.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceHuge)
+ make.bottom.equalToSuperview().inset(Constants.Size.ContentInsetBottom)
+ make.height.equalTo(Constants.Size.ItemHeightMid)
+ }
+ }
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
+
+ private func reloadCheats() {
+ let sortType = GameCheatSortType(rawValue: Settings.defalut.getExtraInt(key: ExtraKey.cheatSort.rawValue) ?? 0) ?? .dateAscending
+ gameCheats = gameCheatsResults.sorted(by: {
+ switch sortType {
+ case .nameAscending:
+ return $0.name <= $1.name
+ case .nameDescending:
+ return $0.name > $1.name
+ case .dateAscending:
+ return $0.id <= $1.id
+ case .dateDescending:
+ return $0.id > $1.id
+ case .status:
+ if $0.activate, !$1.activate {
+ return true
+ } else {
+ return false
+ }
+ }
+ })
+ }
+
+ private func parseImportCheatFiles(urls: [URL]) {
+ if game.gameType == ._3ds {
+ UIView.makeLoading()
+ //解析txt
+ var newCheats: [GameCheat] = []
+ let supportedCheatFormats = Array(game.gameType.manicEmuCore?.supportCheatFormats ?? Set())
+ var index: Int = 0
+ for url in urls {
+ if let txt = try? String(contentsOf: url, encoding: .utf8) {
+ let cheats = ThreeDS.parseCheatFile(txt)
+ for cheat in cheats {
+ if !gameCheats.contains(where: { $0.code == cheat.code }),
+ !newCheats.contains(where: { $0.code == cheat.code }),
+ let result = AddCheatCodeView.checkCheat(cheatCode: cheat.code, supportedCheatFormats: supportedCheatFormats) {
+ let gameCheat = GameCheat()
+ gameCheat.id += index
+ gameCheat.name = cheat.name
+ gameCheat.code = result.formatString
+ gameCheat.type = result.cheatFormat.type.rawValue
+ newCheats.append(gameCheat)
+ index += 1
+ }
+ }
+ }
+ }
+ DispatchQueue.main.async {
+ UIView.hideLoading()
+ }
+ if newCheats.count > 0 {
+ Game.change { realm in
+ game.gameCheats.append(objectsIn: newCheats)
+ }
+ } else {
+ UIView.makeToast(message: R.string.localizable.cheatImportFailed())
+ }
+
+ } else if game.gameType == .psp {
+ guard let gameCodeForPSP = game.gameCodeForPSP else {
+ UIView.makeToast(message: R.string.localizable.cheatImportFailed())
+ return
+ }
+ UIView.makeLoading()
+ var cheats: [PSP.GameCheat] = []
+ for url in urls {
+ if let txt = try? String(contentsOf: url, encoding: .utf8) {
+ cheats.append(contentsOf: PSP.parseCheatFiles(content: txt))
+ }
+ }
+ if cheats.count > 0 {
+ for cheat in cheats {
+ if cheat.gameCode.trimedExceptNumberAndLetters() == gameCodeForPSP {
+ var newCheats: [GameCheat] = []
+ var index = 0
+ for c in cheat.cheats {
+ if !gameCheats.contains(where: { $0.code == c.code }),
+ !newCheats.contains(where: { $0.code == c.code }) {
+ let gameCheat = GameCheat()
+ gameCheat.id += index
+ gameCheat.name = c.name
+ gameCheat.code = c.code
+ gameCheat.type = CheatType.cwCheat.rawValue
+ newCheats.append(gameCheat)
+ index += 1
+ }
+ }
+ if newCheats.count > 0 {
+ Game.change { realm in
+ game.gameCheats.append(objectsIn: newCheats)
+ }
+ }
+
+ break
+ }
+ }
+ }
+
+ DispatchQueue.main.async {
+ UIView.hideLoading()
+ }
+ if cheats.count == 0 {
+ UIView.makeToast(message: R.string.localizable.cheatImportFailed())
+ }
+ }
+ }
}
extension CheatCodeListView: SwipeTableViewCellDelegate {
diff --git a/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/FBNeoCheatCodeListView.swift b/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/FBNeoCheatCodeListView.swift
index 541d40fc..4864d62d 100644
--- a/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/FBNeoCheatCodeListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/CheatCode/Views/FBNeoCheatCodeListView.swift
@@ -9,8 +9,8 @@ import ProHUD
class FBNeoCheatCodeListView: BaseView {
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -89,7 +89,8 @@ class FBNeoCheatCodeListView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift
index 2d484ed2..2d895359 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/ExtraKey.swift
@@ -34,8 +34,18 @@ enum ExtraKey: String {
case pspTexture
case manualPage
case manualFileName
+ case manualScaleFactor
+ case manulDestination
case nesPalette
case triggerProID
case forceFullSkin
case enableManufacturerFilter
+ case PSPGameCode
+ case cheatSort
+ case flexBackground
+ case shaderConfig
+ case tvType
+ case leftDifficulty
+ case rightDifficulty
+ case ignoreShaderConfig
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Models/Manufacturer.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Models/Manufacturer.swift
index f5b8a9e1..4bb3da98 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Models/Manufacturer.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Models/Manufacturer.swift
@@ -9,7 +9,15 @@
import ManicEmuCore
enum Manufacturer: Int, CaseIterable {
- case nintendo, sony, sega, arcade
+ case nintendo, sony, sega, arcade, atari
+
+ static var allCases: [Manufacturer] {
+ if Locale.prefersUS {
+ [.nintendo, .sony, .sega, .atari, .arcade]
+ } else {
+ [.nintendo, .sony, .sega, .arcade, .atari]
+ }
+ }
var title: String {
switch self {
@@ -21,6 +29,8 @@ enum Manufacturer: Int, CaseIterable {
"SEGA"
case .arcade:
"Arcade"
+ case .atari:
+ "Atari"
}
}
@@ -38,6 +48,8 @@ enum Manufacturer: Int, CaseIterable {
R.image.sega_normal()!
case .arcade:
R.image.arcade_normal()!
+ case .atari:
+ R.image.atari_normal()!
}
}
@@ -51,6 +63,8 @@ enum Manufacturer: Int, CaseIterable {
R.image.sega_highlight()!
case .arcade:
R.image.arcade_highlight()!
+ case .atari:
+ R.image.atari_highlight()!
}
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ObjectUpdatable.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ObjectUpdatable.swift
index 8af890dd..a71e2848 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ObjectUpdatable.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Protocols/ObjectUpdatable.swift
@@ -12,11 +12,11 @@ import RealmSwift
protocol ObjectUpdatable {
static func change(action: ((_ realm: Realm) throws ->Void))
static func getExtra(extras: Any, key: String) -> Any?
- static func updateExtra(extras: Any, key: String, value: Any) -> Data?
+ static func updateExtra(extras: Any, key: String, value: Any?) -> Data?
func getExtra(key: String) -> Any?
func getExtraString(key: String) -> String?
func getExtraInt(key: String) -> Int?
- func updateExtra(key: String, value: Any)
+ func updateExtra(key: String, value: Any?)
}
extension ObjectUpdatable {
@@ -45,7 +45,7 @@ extension ObjectUpdatable {
return nil
}
- static func updateExtra(extras: Any, key: String, value: Any) -> Data? {
+ static func updateExtra(extras: Any, key: String, value: Any?) -> Data? {
var extraData: Data? = nil
if extras is Data {
extraData = extras as? Data
@@ -81,9 +81,9 @@ extension ObjectUpdatable {
return nil
}
- func getExtraFloat(key: String) -> Float? {
- if let float = self.getExtra(key: key) as? Float {
- return float
+ func getExtraDouble(key: String) -> Double? {
+ if let double = self.getExtra(key: key) as? Double {
+ return double
}
return nil
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/ViewControllers/WebViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Common/ViewControllers/WebViewController.swift
index 0d6e3306..e05cbe7b 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/ViewControllers/WebViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/ViewControllers/WebViewController.swift
@@ -13,138 +13,16 @@ import MessageUI
class WebViewController: BaseViewController {
static var isShow = false
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
- private var isRomPatcher = false
private let url: URL
private lazy var webView: WKWebView = {
let view: WKWebView
- if isRomPatcher {
- let config = WKWebViewConfiguration()
- let userContentController = WKUserContentController()
- let js = """
- // 拦截blob下载并获取文件名
- var originalCreateObjectURL = URL.createObjectURL;
- var romFileName = '';
- var patchFileName = '';
-
- function removeFileRestrictions() {
- // 移除ROM文件上传限制
- var romInput = document.getElementById('rom-patcher-input-file-rom');
- if (romInput) {
- romInput.removeAttribute('accept');
- console.log('ROM文件限制已移除');
-
- // 监听ROM文件选择,获取文件名
- romInput.addEventListener('change', function(e) {
- if (e.target.files && e.target.files[0]) {
- romFileName = e.target.files[0].name;
- console.log('ROM文件名:', romFileName);
- }
- });
- }
-
- // 移除补丁文件上传限制
- var patchInput = document.getElementById('rom-patcher-input-file-patch');
- if (patchInput) {
- patchInput.removeAttribute('accept');
- console.log('补丁文件限制已移除');
-
- // 监听补丁文件选择,获取文件名
- patchInput.addEventListener('change', function(e) {
- if (e.target.files && e.target.files[0]) {
- patchFileName = e.target.files[0].name;
- console.log('补丁文件名:', patchFileName);
- }
- });
- }
- }
-
- // 重写URL.createObjectURL来拦截blob下载
- URL.createObjectURL = function(blob) {
- console.log('Blob下载被拦截:', blob);
-
- // 生成下载文件名
- var downloadFileName = generatePatchedFileName(romFileName, patchFileName);
-
- // 读取blob内容
- var reader = new FileReader();
- reader.onload = function(e) {
- var base64Data = e.target.result;
- // 发送给iOS
- window.webkit.messageHandlers.downloadHandler.postMessage({
- type: 'blob_download',
- data: base64Data,
- size: blob.size,
- mimeType: blob.type,
- fileName: downloadFileName,
- romFileName: romFileName,
- patchFileName: patchFileName
- });
- };
- reader.readAsDataURL(blob);
-
- // 继续原始下载流程
- return originalCreateObjectURL.call(this, blob);
- };
-
- // 生成补丁后的文件名
- function generatePatchedFileName(romName, patchName) {
- if (!romName) return 'patched_rom.bin';
-
- // 移除扩展名
- var nameWithoutExt = romName.replace(/\\.[^/.]+$/, '');
- var romExt = romName.split('.').pop() || 'bin';
-
- // 如果有补丁文件名,尝试从中提取描述信息
- var patchInfo = '';
- if (patchName) {
- // 移除补丁文件扩展名
- var patchWithoutExt = patchName.replace(/\\.[^/.]+$/, '');
- // 如果补丁名不包含在ROM名中,添加到文件名
- if (!nameWithoutExt.toLowerCase().includes(patchWithoutExt.toLowerCase())) {
- patchInfo = '_' + patchWithoutExt;
- }
- }
-
- return nameWithoutExt + patchInfo + '_patched.' + romExt;
- }
-
- // 立即执行一次
- removeFileRestrictions();
-
- // DOM完全加载后再执行一次
- document.addEventListener('DOMContentLoaded', removeFileRestrictions);
-
- // 使用MutationObserver监听DOM变化
- var observer = new MutationObserver(function(mutations) {
- removeFileRestrictions();
- });
- observer.observe(document.body || document.documentElement, {
- childList: true,
- subtree: true
- });
-
- // 延时执行,确保页面完全加载
- setTimeout(removeFileRestrictions, 1000);
- setTimeout(removeFileRestrictions, 3000);
- """
- let script = WKUserScript(source: js, injectionTime: .atDocumentStart, forMainFrameOnly: true)
- userContentController.addUserScript(script)
-
- // 添加消息处理器来接收JS消息
- userContentController.add(self, name: "downloadHandler")
-
- config.userContentController = userContentController
- view = WKWebView(frame: CGRect.zero, configuration: config)
- } else {
- view = WKWebView(frame: CGRect.zero)
- }
-
+ view = WKWebView(frame: CGRect.zero)
view.navigationDelegate = self
view.uiDelegate = self
view.isOpaque = false
@@ -230,9 +108,6 @@ class WebViewController: BaseViewController {
deinit {
webView.navigationDelegate = nil
- if isRomPatcher {
- webView.configuration.userContentController.removeScriptMessageHandler(forName: "downloadHandler")
- }
}
init(url: URL = URL(string: Constants.URLs.ManicEMU)!, showClose: Bool = true, isShow: Bool? = nil, bottomInset: CGFloat? = nil) {
@@ -244,9 +119,6 @@ class WebViewController: BaseViewController {
}
super.init(nibName: nil, bundle: nil)
self.bottomInset = bottomInset
- if url == Constants.URLs.RomPatcher {
- isRomPatcher = true
- }
}
init(searchGame: Game) {
@@ -272,7 +144,8 @@ class WebViewController: BaseViewController {
view.addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -310,7 +183,6 @@ class WebViewController: BaseViewController {
make.centerY.equalTo(self.backButton)
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax-Constants.Size.ContentSpaceUltraTiny)
})
- closeButton.backgroundColor = Constants.Color.BackgroundPrimary
}
}
@@ -443,73 +315,3 @@ extension WebViewController: MFMailComposeViewControllerDelegate {
}
}
-
-extension WebViewController: WKScriptMessageHandler {
- func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
- if message.name == "downloadHandler" {
- if let messageDict = message.body as? [String: Any] {
- if let type = messageDict["type"] as? String {
- switch type {
- case "blob_download":
- handleBlobDownload(messageDict)
- default:
- break
- }
- }
- }
- }
- }
-
-
- private func handleBlobDownload(_ messageDict: [String: Any]) {
- guard let base64Data = messageDict["data"] as? String,
- let size = messageDict["size"] as? Int else {
- Log.debug("无效的blob下载数据")
- return
- }
-
- Log.debug("接收到blob下载,大小: \(size) bytes")
-
- // 移除data:前缀并解码base64
- guard let commaRange = base64Data.range(of: ","),
- let data = Data(base64Encoded: String(base64Data[commaRange.upperBound...])) else {
- Log.debug("base64数据解码失败")
- return
- }
-
- // 从JS获取生成的文件名
- let romFileName = messageDict["romFileName"] as? String ?? ""
- let patchFileName = messageDict["patchFileName"] as? String ?? ""
-
- // 保存文件
- saveDownloadedFile(data: data, fileName: romFileName.deletingPathExtension + " (\(patchFileName.deletingPathExtension))." + romFileName.pathExtension)
- }
-
-
- private func saveDownloadedFile(data: Data, fileName: String) {
- let fileUrl = URL(fileURLWithPath: Constants.Path.Cache.appendingPathComponent(fileName))
-
-
- if FileManager.default.fileExists(atPath: fileUrl.path) {
- try? FileManager.default.removeItem(at: fileUrl)
- }
-
- do {
- try data.write(to: fileUrl)
- DispatchQueue.main.async {
- UIView.makeAlert(title: R.string.localizable.downloadCompletion(), detail: fileName, cancelTitle: R.string.localizable.gamesShareRom(), confirmTitle: R.string.localizable.m3uFileImport(), cancelAction: {
- //分享
- ShareManager.shareFile(fileUrl: fileUrl)
- }, confirmAction: {
- //导入
- FilesImporter.importFiles(urls: [fileUrl])
- })
- }
- } catch {
- DispatchQueue.main.async {
- UIView.makeToast(message: "文件保存失败: \(error.localizedDescription)")
- }
- Log.debug("文件保存失败: \(error)")
- }
- }
-}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Views/DeadZoneControl.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Views/DeadZoneControl.swift
index 55b95be6..a5b6e930 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Common/Views/DeadZoneControl.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Views/DeadZoneControl.swift
@@ -51,7 +51,7 @@ class DeadZoneControl: UIView, UITextFieldDelegate {
// MARK: - Init
init(initialValue: Float = 0.0) {
super.init(frame: .zero)
- internalValue = Settings.defalut.getExtraFloat(key: ExtraKey.deadZone.rawValue) ?? 0
+ internalValue = (Settings.defalut.getExtraDouble(key: ExtraKey.deadZone.rawValue) ?? 0).float
setupUI()
}
@@ -86,7 +86,7 @@ class DeadZoneControl: UIView, UITextFieldDelegate {
textField.keyboardType = .decimalPad
textField.textAlignment = .center
textField.delegate = self
- textField.text = String(format: "%.2f", Settings.defalut.getExtraFloat(key: ExtraKey.deadZone.rawValue) ?? 0)
+ textField.text = String(format: "%.2f", Settings.defalut.getExtraDouble(key: ExtraKey.deadZone.rawValue) ?? 0)
// Layout
let stack = UIStackView(arrangedSubviews: [minusButton, textField, plusButton])
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift
new file mode 100644
index 00000000..a32dfb8c
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Views/JGenesisView.swift
@@ -0,0 +1,845 @@
+//
+// JGenesisView.swift
+// ManicEmu
+//
+// Created by Daiuno on 2025/12/19.
+// Copyright © 2025 Manic EMU. All rights reserved.
+//
+import WebKit
+
+// MARK: - JGenesis 配置枚举
+enum JGenesisAspectRatio: String {
+ case auto = "Auto"
+ case ntsc = "Ntsc"
+ case pal = "Pal"
+ case squarePixels = "SquarePixels"
+}
+
+enum JGenesisFilterMode: String {
+ case nearest = "Nearest"
+ case linear = "Linear"
+}
+
+enum JGenesisBlendShader: String {
+ case none = "None"
+ case horizontalBlurTwoPixels = "HorizontalBlurTwoPixels"
+ case horizontalBlurThreePixels = "HorizontalBlurThreePixels"
+ case antiDitherWeak = "AntiDitherWeak"
+ case antiDitherStrong = "AntiDitherStrong"
+}
+
+/// Genesis/Sega CD/32X 6键手柄按钮映射
+/// 这些值对应 KeyboardEvent.code 字符串,用于与 JGenesis 核心通信
+enum JGenesisButton: String, CaseIterable {
+ // 方向键
+ case up = "ArrowUp"
+ case down = "ArrowDown"
+ case left = "ArrowLeft"
+ case right = "ArrowRight"
+
+ // 6键手柄按钮(默认键盘映射)
+ case a = "KeyA"
+ case b = "KeyS"
+ case c = "KeyD"
+ case x = "KeyQ"
+ case y = "KeyW"
+ case z = "KeyE"
+
+ // 功能键
+ case start = "Enter"
+ case mode = "ShiftRight"
+
+ /// 返回用于 JavaScript KeyboardEvent 的 code 值(用于 DOM 事件模式)
+ var keyCode: String {
+ return self.rawValue
+ }
+
+ /// 返回按钮名称(用于直接输入模式)
+ var buttonName: String {
+ switch self {
+ case .up: return "Up"
+ case .down: return "Down"
+ case .left: return "Left"
+ case .right: return "Right"
+ case .a: return "A"
+ case .b: return "B"
+ case .c: return "C"
+ case .x: return "X"
+ case .y: return "Y"
+ case .z: return "Z"
+ case .start: return "Start"
+ case .mode: return "Mode"
+ }
+ }
+}
+
+class JGenesisView: BaseView {
+ /// 导出 Save State 完成回调(内部使用)
+ private var onExportSaveStateComplete: ((_ data: Data?, _ success: Bool) -> Void)?
+ /// 导入 Save State 完成回调(内部使用)
+ private var onImportSaveStateComplete: ((_ success: Bool, _ error: String?) -> Void)?
+
+ /// 初始化完成回调
+ var didFinishedInit: (()->Void)? = nil
+
+ /// ROM路径
+ var romPath: String? = nil
+
+ /// 转义 JavaScript 字符串中的特殊字符
+ /// - Parameter string: 原始字符串
+ /// - Returns: 转义后的字符串,可安全用于 JavaScript 单引号字符串
+ private func escapeJSString(_ string: String) -> String {
+ var result = string
+ result = result.replacingOccurrences(of: "\\", with: "\\\\") // 反斜杠
+ result = result.replacingOccurrences(of: "'", with: "\\'") // 单引号
+ result = result.replacingOccurrences(of: "\"", with: "\\\"") // 双引号
+ result = result.replacingOccurrences(of: "\n", with: "\\n") // 换行
+ result = result.replacingOccurrences(of: "\r", with: "\\r") // 回车
+ result = result.replacingOccurrences(of: "\t", with: "\\t") // 制表符
+ return result
+ }
+
+ private lazy var webView: WKWebView = {
+ let configuration = WKWebViewConfiguration()
+ configuration.allowsInlineMediaPlayback = true
+ configuration.mediaTypesRequiringUserActionForPlayback = []
+
+ // 添加消息处理器
+ let contentController = WKUserContentController()
+ let proxy = WeakScriptMessageHandler(target: self)
+ contentController.add(proxy, name: "console")
+ contentController.add(proxy, name: "jgenesis")
+ configuration.userContentController = contentController
+
+ let view = WKWebView(frame: .zero, configuration: configuration)
+ view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
+ view.navigationDelegate = self
+ view.uiDelegate = self
+ view.allowsBackForwardNavigationGestures = false
+ view.scrollView.isScrollEnabled = false
+
+ let consoleHookJS = """
+ (function () {
+ function wrap(type) {
+ const original = console[type];
+ console[type] = function () {
+ window.webkit.messageHandlers.console.postMessage({
+ type: type,
+ message: Array.from(arguments).join(' ')
+ });
+ original.apply(console, arguments);
+ };
+ }
+
+ ['log', 'warn', 'error', 'info', 'debug'].forEach(wrap);
+ })();
+ """
+ let script = WKUserScript(
+ source: consoleHookJS,
+ injectionTime: .atDocumentStart,
+ forMainFrameOnly: false
+ )
+ view.configuration.userContentController.addUserScript(script)
+
+ return view
+ }()
+
+ private lazy var localServer: LocalWebServer = {
+ let server = LocalWebServer()
+ try? server.start(serverType: .JGenesis)
+ return server
+ }()
+
+ deinit {
+ Log.debug("\(String(describing: Self.self)) deinit")
+ localServer.stop()
+ }
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+
+ addSubview(webView)
+ webView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+ if let url = localServer.getURL() {
+ webView.load(URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData))
+ }
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+}
+
+// MARK: - 公开接口
+extension JGenesisView {
+
+ // MARK: 文件操作
+
+ /// 打开 ROM 文件(通过文件路径)
+ /// - Parameters:
+ /// - filePath: ROM 文件路径
+ /// - fileName: 文件名(包含扩展名,如 "game.32x")
+ func openFile(filePath: String) {
+ let saveFilePath = filePath.deletingPathExtension + ".srm"
+ if FileManager.default.fileExists(atPath: saveFilePath) {
+ loadSave(path: saveFilePath)
+ }
+
+ romPath = filePath
+ let fileName = escapeJSString(filePath.lastPathComponent)
+
+ // 注册文件到本地服务器
+ let fileId = localServer.registerFile(filePath: filePath)
+ let romURL = "http://localhost:8080/file/\(fileId)"
+
+ let script = """
+ (async () => {
+ try {
+ console.log('🔄 开始加载文件: \(fileName)');
+
+ const response = await fetch('\(romURL)');
+ if (!response.ok) {
+ console.log('Download error:' + response.status);
+ throw new Error('HTTP ' + response.status);
+ }
+ const buffer = await response.arrayBuffer();
+ const bytes = new Uint8Array(buffer);
+
+ window.jgenesisAPI.openFile(bytes, '\(fileName)');
+ console.log('✅ 文件加载成功: \(fileName)');
+ } catch (error) {
+ console.error('❌ 文件加载失败:', error);
+ }
+ })();
+
+ null;
+ """
+
+ webView.evaluateJavaScript(script) { _, error in
+ if let error = error {
+ Log.debug("❌ 执行 JavaScript 失败: \(error)")
+ } else {
+ Log.debug("✅ JavaScript 注入成功")
+ }
+ }
+ }
+
+ /// 打开 Sega CD ROM 文件(同时传入 ROM 和 BIOS 文件)
+ /// - Parameters:
+ /// - filePath: ROM 文件路径(CHD 格式)
+ /// - americasBiosPath: 美版 BIOS 文件路径(可选)
+ /// - japanBiosPath: 日版 BIOS 文件路径(可选)
+ /// - europeBiosPath: 欧版 BIOS 文件路径(可选)
+ func openSegaCdFile(filePath: String, americasBiosPath: String?, japanBiosPath: String?, europeBiosPath: String?) {
+ let saveFilePath = filePath.deletingPathExtension + ".srm"
+ if FileManager.default.fileExists(atPath: saveFilePath) {
+ loadSave(path: saveFilePath)
+ }
+
+ romPath = filePath
+ let fileName = escapeJSString(filePath.lastPathComponent)
+
+ // 注册 ROM 文件到本地服务器
+ let romFileId = localServer.registerFile(filePath: filePath)
+ let romURL = "http://localhost:8080/file/\(romFileId)"
+
+ // 注册 BIOS 文件(如果存在)
+ var americasBiosURL: String? = nil
+ var japanBiosURL: String? = nil
+ var europeBiosURL: String? = nil
+
+ if let path = americasBiosPath, FileManager.default.fileExists(atPath: path) {
+ let fileId = localServer.registerFile(filePath: path)
+ americasBiosURL = "http://localhost:8080/file/\(fileId)"
+ }
+
+ if let path = japanBiosPath, FileManager.default.fileExists(atPath: path) {
+ let fileId = localServer.registerFile(filePath: path)
+ japanBiosURL = "http://localhost:8080/file/\(fileId)"
+ }
+
+ if let path = europeBiosPath, FileManager.default.fileExists(atPath: path) {
+ let fileId = localServer.registerFile(filePath: path)
+ europeBiosURL = "http://localhost:8080/file/\(fileId)"
+ }
+
+ // 构建 JavaScript 代码中的 BIOS URL 参数
+ let americasBiosURLJS = americasBiosURL.map { "'\($0)'" } ?? "null"
+ let japanBiosURLJS = japanBiosURL.map { "'\($0)'" } ?? "null"
+ let europeBiosURLJS = europeBiosURL.map { "'\($0)'" } ?? "null"
+
+ let script = """
+ (async () => {
+ try {
+ console.log('🔄 开始加载 Sega CD 文件: \(fileName)');
+
+ // 加载 ROM 文件
+ const romResponse = await fetch('\(romURL)');
+ if (!romResponse.ok) {
+ console.log('ROM Download error:' + romResponse.status);
+ throw new Error('HTTP ' + romResponse.status);
+ }
+ const romBuffer = await romResponse.arrayBuffer();
+ const romBytes = new Uint8Array(romBuffer);
+ console.log('📦 ROM 文件大小:', romBytes.length, 'bytes');
+
+ // 加载 BIOS 文件
+ let americasBiosBytes = null;
+ let japanBiosBytes = null;
+ let europeBiosBytes = null;
+
+ const americasBiosURL = \(americasBiosURLJS);
+ const japanBiosURL = \(japanBiosURLJS);
+ const europeBiosURL = \(europeBiosURLJS);
+
+ if (americasBiosURL) {
+ try {
+ const response = await fetch(americasBiosURL);
+ if (response.ok) {
+ const buffer = await response.arrayBuffer();
+ americasBiosBytes = new Uint8Array(buffer);
+ console.log('📦 Americas BIOS 大小:', americasBiosBytes.length, 'bytes');
+ }
+ } catch (e) {
+ console.warn('⚠️ 加载 Americas BIOS 失败:', e);
+ }
+ }
+
+ if (japanBiosURL) {
+ try {
+ const response = await fetch(japanBiosURL);
+ if (response.ok) {
+ const buffer = await response.arrayBuffer();
+ japanBiosBytes = new Uint8Array(buffer);
+ console.log('📦 Japan BIOS 大小:', japanBiosBytes.length, 'bytes');
+ }
+ } catch (e) {
+ console.warn('⚠️ 加载 Japan BIOS 失败:', e);
+ }
+ }
+
+ if (europeBiosURL) {
+ try {
+ const response = await fetch(europeBiosURL);
+ if (response.ok) {
+ const buffer = await response.arrayBuffer();
+ europeBiosBytes = new Uint8Array(buffer);
+ console.log('📦 Europe BIOS 大小:', europeBiosBytes.length, 'bytes');
+ }
+ } catch (e) {
+ console.warn('⚠️ 加载 Europe BIOS 失败:', e);
+ }
+ }
+
+ // 检查是否至少有一个 BIOS 可用
+ if (!americasBiosBytes && !japanBiosBytes && !europeBiosBytes) {
+ console.error('❌ 没有可用的 Sega CD BIOS 文件');
+ 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,
+ '\(fileName)',
+ americasBiosVec,
+ japanBiosVec,
+ europeBiosVec
+ );
+
+ console.log('✅ Sega CD 文件加载成功: \(fileName)');
+ } catch (error) {
+ console.error('❌ Sega CD 文件加载失败:', error);
+ }
+ })();
+
+ null;
+ """
+
+ webView.evaluateJavaScript(script) { _, error in
+ if let error = error {
+ Log.debug("❌ 执行 JavaScript 失败: \(error)")
+ } else {
+ Log.debug("✅ JavaScript 注入成功")
+ }
+ }
+ }
+
+ // MARK: 模拟器控制
+
+ /// 重置模拟器
+ func reset() {
+ let script = "window.jgenesisAPI.reset();"
+ webView.evaluateJavaScript(script)
+ }
+
+ // MARK: - 存档操作 (SRAM Save)
+
+ /// 保存 SRAM 存档到文件
+ /// - Parameters:
+ /// - path: 保存路径
+ /// - completion: 完成回调
+ func save(to path: String, completion: ((_ isSucess: Bool)->Void)? = nil) {
+ // 通过 JavaScript 获取当前 SRAM 数据
+ let script = """
+ (function() {
+ if (window.jgenesisAPI && window.jgenesisAPI.getSaveData) {
+ return window.jgenesisAPI.getSaveData();
+ }
+ return null;
+ })();
+ """
+ webView.evaluateJavaScript(script) { [weak self] result, error in
+ guard let self = self else {
+ return
+ }
+
+ if let error = error {
+ Log.debug("❌ 获取存档数据失败: \(error)")
+ return
+ }
+
+ let downloadScript = "window.jgenesisAPI.downloadSave();"
+ self.webView.evaluateJavaScript(downloadScript)
+ }
+ }
+
+ /// 从文件加载 SRAM 存档
+ /// - Parameter path: 存档文件路径
+ func loadSave(path: String) {
+ guard FileManager.default.fileExists(atPath: path) else {
+ Log.debug("❌ 存档文件不存在: \(path)")
+ return
+ }
+
+ do {
+ let data = try Data(contentsOf: URL(fileURLWithPath: path))
+
+ let base64 = data.base64EncodedString()
+ let script = "window.jgenesisAPI.uploadSave('\(base64)');"
+ webView.evaluateJavaScript(script) { _, error in
+ if let error = error {
+ Log.debug("❌ 加载存档失败: \(error)")
+ } else {
+ Log.debug("✅ 存档已加载: \(path)")
+ }
+ }
+ } catch {
+ Log.debug("❌ 读取存档文件失败: \(error)")
+ }
+ }
+
+ // MARK: - 即时存档操作 (Save State)
+
+ /// 保存即时存档到文件
+ /// - Parameters:
+ /// - completion: 完成回调
+ func saveState(completion: ((_ data: Data?)->Void)? = nil) {
+
+ // 临时保存回调
+ let previousCallback = onExportSaveStateComplete
+
+ onExportSaveStateComplete = { [weak self] data, success in
+ // 恢复之前的回调
+ self?.onExportSaveStateComplete = previousCallback
+
+ guard success, let data = data else {
+ Log.debug("❌ 导出即时存档失败")
+ completion?(nil)
+ return
+ }
+
+ Log.debug("✅ 即时存档已生成")
+ completion?(data)
+ }
+
+ // 触发导出
+ let script = "window.jgenesisAPI.exportSaveState();"
+ webView.evaluateJavaScript(script) { [weak self] _, error in
+ if let error = error {
+ Log.debug("❌ 导出即时存档调用失败: \(error)")
+ self?.onExportSaveStateComplete = previousCallback
+ completion?(nil)
+ }
+ }
+ }
+
+ /// 从文件加载即时存档
+ /// - Parameter path: 即时存档文件路径
+ func loadSaveState(path: String, completion: ((_ isSuccess: Bool)->Void)? = nil) {
+ guard FileManager.default.fileExists(atPath: path) else {
+ Log.debug("❌ 即时存档文件不存在: \(path)")
+ completion?(false)
+ return
+ }
+
+ do {
+ let data = try Data(contentsOf: URL(fileURLWithPath: path))
+
+ // 保存回调,等待 importSaveStateComplete 消息
+ let previousCallback = onImportSaveStateComplete
+ onImportSaveStateComplete = { [weak self] success, error in
+ // 恢复之前的回调
+ self?.onImportSaveStateComplete = previousCallback
+
+ if success {
+ Log.debug("✅ 即时存档已加载: \(path)")
+ } else {
+ Log.debug("❌ 加载即时存档失败: \(error ?? "未知错误")")
+ }
+ completion?(success)
+ }
+
+ let base64String = data.base64EncodedString()
+ let script = "window.jgenesisAPI.importSaveState('\(base64String)');"
+ webView.evaluateJavaScript(script) { [weak self] _, error in
+ if let error = error {
+ Log.debug("❌ 加载即时存档失败: \(error)")
+ // 恢复回调并通知失败
+ self?.onImportSaveStateComplete = previousCallback
+ completion?(false)
+ }
+ }
+ } catch {
+ Log.debug("❌ 读取即时存档文件失败: \(error)")
+ completion?(false)
+ }
+ }
+
+ // MARK: Genesis/MCD/32X 配置
+
+ /// 设置纵横比
+ func setAspectRatio(_ ratio: JGenesisAspectRatio) {
+ let script = "window.jgenesisAPI.setGenesisAspectRatio('\(ratio.rawValue)');"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置主 CPU 速度(7=100%, 6=117%, 5=140%, 4=175%, 3=233%)
+ func setM68kDivider(_ divider: Int) {
+ let script = "window.jgenesisAPI.setGenesisM68kDivider(\(divider));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置是否模拟非线性 VDP 颜色缩放
+ func setNonLinearColorScale(_ enabled: Bool) {
+ let script = "window.jgenesisAPI.setGenesisNonLinearColorScale(\(enabled));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置是否移除精灵限制
+ func setRemoveSpriteLimits(_ enabled: Bool) {
+ let script = "window.jgenesisAPI.setGenesisRemoveSpriteLimits(\(enabled));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置是否模拟 3.39 KHz 低通滤波器
+ func setEmulateLowPass(_ enabled: Bool) {
+ let script = "window.jgenesisAPI.setGenesisEmulateLowPass(\(enabled));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置是否渲染垂直边框
+ func setRenderVerticalBorder(_ enabled: Bool) {
+ let script = "window.jgenesisAPI.setGenesisRenderVerticalBorder(\(enabled));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置是否渲染水平边框
+ func setRenderHorizontalBorder(_ enabled: Bool) {
+ let script = "window.jgenesisAPI.setGenesisRenderHorizontalBorder(\(enabled));"
+ webView.evaluateJavaScript(script)
+ }
+
+ // MARK: 通用配置
+
+ /// 设置图像滤镜模式
+ func setFilterMode(_ mode: JGenesisFilterMode) {
+ let script = "window.jgenesisAPI.setFilterMode('\(mode.rawValue)');"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置混合着色器
+ func setBlendShader(_ shader: JGenesisBlendShader) {
+ let script = "window.jgenesisAPI.setPreprocessShader('\(shader.rawValue)');"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 设置预缩放因子(1-4)
+ func setPrescaleFactor(_ factor: Int) {
+ let script = "window.jgenesisAPI.setPrescaleFactor(\(factor));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 恢复默认配置
+ func restoreDefaults() {
+ let script = "window.jgenesisAPI.restoreDefaults();"
+ webView.evaluateJavaScript(script)
+ }
+
+ // MARK: 输入控制
+
+ // MARK: 直接输入(推荐,更低延迟)
+
+ /// 直接设置按键状态(绕过 DOM 事件,更低延迟)
+ /// - Parameters:
+ /// - button: Genesis/Sega CD/32X 按钮
+ /// - pressed: true 表示按下,false 表示释放
+ /// - player: 玩家编号(1 或 2),默认为 1
+ func pressButton(_ button: JGenesisButton, pressed: Bool, player: Int = 1) {
+ let script = "window.jgenesisAPI.setGenesisButton('\(button.buttonName)', \(player), \(pressed));"
+ webView.evaluateJavaScript(script)
+ }
+
+ // MARK: 获取配置
+
+ /// 获取当前纵横比设置
+ func getAspectRatio(completion: @escaping (String?) -> Void) {
+ let script = "window.jgenesisAPI.getGenesisAspectRatio();"
+ webView.evaluateJavaScript(script) { result, error in
+ completion(result as? String)
+ }
+ }
+
+ /// 获取当前 M68k 分频器设置
+ func getM68kDivider(completion: @escaping (Int?) -> Void) {
+ let script = "window.jgenesisAPI.getGenesisM68kDivider();"
+ webView.evaluateJavaScript(script) { result, error in
+ completion(result as? Int)
+ }
+ }
+
+ /// 设置是否静音
+ /// - Note: 通过暂停/恢复 WebView 的 AudioContext 来实现静音
+ func setMute(_ mute: Bool) {
+ let script = "window.jgenesisAPI.setMute(\(mute));"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 获取截图
+ /// - Note: 通过 WebView 截图获取当前画面
+ func snapShot() -> UIImage? {
+ // 使用 WebView 的截图能力
+ let renderer = UIGraphicsImageRenderer(bounds: webView.bounds)
+ let image = renderer.image { _ in
+ webView.drawHierarchy(in: webView.bounds, afterScreenUpdates: true)
+ }
+ return image
+ }
+
+ /// 快进 - 设置模拟器运行速度
+ /// - Parameter speed: 速度倍率 (1.0 = 正常速度, 2.0 = 2倍速, 等等)
+ func fastForward(speed: Float) {
+ let clampedSpeed = max(0.25, min(16.0, Double(speed)))
+ let script = "window.jgenesisAPI.setSpeedMultiplier(\(clampedSpeed));"
+ webView.evaluateJavaScript(script) { _, error in
+ if let error = error {
+ Log.debug("❌ 设置快进速度失败: \(error)")
+ }
+ }
+ }
+
+ /// 开启快进(默认 2 倍速)
+ func enableFastForward(multiplier: Float = 2.0) {
+ fastForward(speed: multiplier)
+ }
+
+ /// 关闭快进,恢复正常速度
+ func disableFastForward() {
+ fastForward(speed: 1.0)
+ }
+
+ /// 重置金手指
+ /// - Note: JGenesis 核心架构不支持运行时内存修改(Game Genie / Pro Action Replay 等金手指功能)
+ /// 这是因为 jgenesis 的设计目标是精准模拟,不包含金手指等修改游戏内存的功能
+ /// 如需使用金手指,建议使用其他支持此功能的模拟器核心
+ func resetCheatCode() {
+ // JGenesis 核心不支持金手指功能
+ // EmulatorTrait 接口中没有提供金手指相关的方法
+ Log.debug("⚠️ JGenesis 核心不支持金手指功能")
+ }
+
+ /// 添加金手指
+ /// - Parameter code: 金手指代码(Game Genie 或 Pro Action Replay 格式)
+ /// - Note: JGenesis 核心架构不支持运行时内存修改(Game Genie / Pro Action Replay 等金手指功能)
+ /// 这是因为 jgenesis 的设计目标是精准模拟,不包含金手指等修改游戏内存的功能
+ /// 如需使用金手指,建议使用其他支持此功能的模拟器核心
+ func addCheatCode(code: String) {
+ // JGenesis 核心不支持金手指功能
+ // EmulatorTrait 接口中没有提供金手指相关的方法
+ Log.debug("⚠️ JGenesis 核心不支持金手指功能: \(code)")
+ }
+
+ /// 暂停模拟器
+ func pause() {
+ let script = "window.jgenesisAPI.pause();"
+ webView.evaluateJavaScript(script) { _, error in
+ if let error = error {
+ print("❌ 暂停失败: \(error)")
+ } else {
+ print("⏸️ 模拟器已暂停")
+ }
+ }
+ }
+
+ /// 恢复模拟器
+ func resume() {
+ let script = "window.jgenesisAPI.resume();"
+ webView.evaluateJavaScript(script) { _, error in
+ if let error = error {
+ print("❌ 恢复失败: \(error)")
+ } else {
+ print("▶️ 模拟器已恢复")
+ }
+ }
+ }
+
+ /// 切换暂停状态
+ func togglePause() {
+ let script = "window.jgenesisAPI.togglePause();"
+ webView.evaluateJavaScript(script)
+ }
+
+ /// 获取当前暂停状态
+ func isPaused(completion: @escaping (Bool) -> Void) {
+ let script = "window.jgenesisAPI.isPaused();"
+ webView.evaluateJavaScript(script) { result, _ in
+ completion(result as? Bool ?? false)
+ }
+ }
+
+}
+
+final class WeakScriptMessageHandler: NSObject, WKScriptMessageHandler {
+
+ weak var target: WKScriptMessageHandler?
+
+ init(target: WKScriptMessageHandler) {
+ self.target = target
+ super.init()
+ }
+
+ func userContentController(
+ _ userContentController: WKUserContentController,
+ didReceive message: WKScriptMessage
+ ) {
+ target?.userContentController(userContentController, didReceive: message)
+ }
+}
+
+// MARK: - WKScriptMessageHandler
+extension JGenesisView: WKScriptMessageHandler {
+ func decodeUnicodeString(_ str: String) -> String {
+ let quoted = "\"\(str)\""
+ let data = quoted.data(using: .utf8)!
+
+ if let result = try? PropertyListSerialization.propertyList(
+ from: data,
+ options: [],
+ format: nil
+ ) as? String {
+ return result
+ }
+
+ return str
+ }
+
+ func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
+ if message.name == "console" {
+ if let body = message.body as? Dictionary<String, String> {
+ Log.debug("JS: type=\(body["type"]!) message=\(decodeUnicodeString(body["message"]!))")
+ }
+ }
+
+
+ guard message.name == "jgenesis",
+ let body = message.body as? [String: Any],
+ let type = body["type"] as? String else {
+ return
+ }
+
+ switch type {
+// case "saveData":
+// // 手动获取SRAM 存档数据回调
+// if let base64Data = body["data"] as? String,
+// let _ = Data(base64Encoded: base64Data) {
+// // 如果有待处理的保存请求,保存到文件
+// }
+//
+// case "saveNotFound":
+// Log.debug("手动获取存档数据失败 ⚠️ 无存档数据可保存")
+
+ case "saveDataWritten":
+ // 游戏自动写入 SRAM 存档通知
+ if let romPath,
+ let base64Data = body["data"] as? String,
+ let data = Data(base64Encoded: base64Data) {
+ let savePath = romPath.deletingPathExtension + ".srm"
+ try? data.writeWithCompletePath(to: URL(fileURLWithPath: savePath))
+ Log.debug("更新存档")
+ }
+
+ case "exportSaveStateComplete":
+ // 即时存档导出完成
+ let success = body["success"] as? Bool ?? false
+ if success, let base64Data = body["data"] as? String, let data = Data(base64Encoded: base64Data) {
+ let size = body["size"] as? Int ?? data.count
+ Log.debug("📦 导出即时存档完成: 大小 \(size) bytes")
+ onExportSaveStateComplete?(data, true)
+ } else {
+ Log.debug("❌ 导出即时存档失败")
+ onExportSaveStateComplete?(nil, false)
+ }
+
+ case "importSaveStateComplete":
+ // 即时存档导入完成
+ let success = body["success"] as? Bool ?? false
+ let error = body["error"] as? String
+ if success {
+ Log.debug("📦 导入即时存档完成")
+ } else {
+ Log.debug("❌ 导入即时存档失败: \(error ?? "未知错误")")
+ }
+ onImportSaveStateComplete?(success, error)
+
+ default:
+ break
+ }
+ }
+}
+
+// MARK: - WKNavigationDelegate
+extension JGenesisView: WKNavigationDelegate {
+ func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
+ Log.debug("✅ WebView 加载完成")
+ checkInitStatus()
+ }
+
+ func checkInitStatus() {
+ // 检查 jgenesisAPI 是否可用
+ webView.evaluateJavaScript("typeof window.jgenesisAPI !== 'undefined'") { [weak self] result, error in
+ guard let self else { return }
+ if let isAvailable = result as? Bool, isAvailable {
+ Log.debug("✅ jgenesisAPI 已就绪")
+ self.didFinishedInit?()
+ } else {
+ Log.debug("⚠️ jgenesisAPI 尚未就绪,等待初始化...")
+ DispatchQueue.main.asyncAfter(delay: 1) {
+ self.checkInitStatus()
+ }
+ }
+ }
+ }
+}
+
+// MARK: - WKUIDelegate
+extension JGenesisView: WKUIDelegate {
+
+}
+
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Views/NavigationBlurView.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Views/NavigationBlurView.swift
new file mode 100644
index 00000000..983c2303
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Views/NavigationBlurView.swift
@@ -0,0 +1,11 @@
+//
+// NavigationBlurView.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/25.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+class NavigationBlurView: UIView {
+
+}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Common/Views/RomPatcherView.swift b/ManicEmu/ManicEmu/Sources/Business/Common/Views/RomPatcherView.swift
new file mode 100644
index 00000000..fa891562
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Common/Views/RomPatcherView.swift
@@ -0,0 +1,383 @@
+//
+// RomPatcherView.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/21.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+import WebKit
+
+class RomPatcherViewController: BaseViewController {
+ private lazy var romPatcherView: RomPatcherView = {
+ let view = RomPatcherView()
+ view.didTapClose = {[weak self] in
+ self?.dismiss(animated: true)
+ }
+ return view
+ }()
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+
+ view.addSubview(romPatcherView)
+ romPatcherView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+ }
+
+}
+
+class RomPatcherView: BaseView {
+ /// 充当导航条
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
+ return view
+ }()
+
+ private lazy var closeButton: SymbolButton = {
+ let view = SymbolButton(image: UIImage(symbol: .xmark, font: Constants.Font.body(weight: .bold)), enableGlass: true)
+ view.enableRoundCorner = true
+ view.addTapGesture { [weak self] gesture in
+ guard let self = self else { return }
+ self.didTapClose?()
+ }
+ return view
+ }()
+
+ private lazy var webView: WKWebView = {
+ let view: WKWebView
+ let js = """
+ // 拦截blob下载并获取文件名
+ var originalCreateObjectURL = URL.createObjectURL;
+ var romFileName = '';
+ var patchFileName = '';
+ var originalFileName = '';
+ var modifiedFileName = '';
+ var patchFileExtension = 'ips';
+ var mode = 'patch';
+
+ function removeFileRestrictions() {
+ // 移除ROM文件上传限制
+ var romInput = document.getElementById('rom-patcher-input-file-rom');
+ if (romInput) {
+ romInput.removeAttribute('accept');
+
+ // 监听ROM文件选择,获取文件名
+ romInput.addEventListener('change', function(e) {
+ if (e.target.files && e.target.files[0]) {
+ romFileName = e.target.files[0].name;
+ }
+ });
+ }
+
+ // 移除补丁文件上传限制
+ var patchInput = document.getElementById('rom-patcher-input-file-patch');
+ if (patchInput) {
+ patchInput.removeAttribute('accept');
+
+ patchInput.addEventListener('change', function(e) {
+ if (e.target.files && e.target.files[0]) {
+ patchFileName = e.target.files[0].name;
+ }
+ });
+ }
+
+ //移除创建补丁Original Rom上传限制
+ var originalInput = document.getElementById('patch-builder-input-file-original');
+ if (originalInput) {
+ originalInput.removeAttribute('accept');
+
+ // 监听ROM文件选择,获取文件名
+ originalInput.addEventListener('change', function(e) {
+ if (e.target.files && e.target.files[0]) {
+ originalFileName = e.target.files[0].name;
+ }
+ });
+ }
+
+ //移除创建补丁Modified Rom上传限制
+ var modifiedInput = document.getElementById('patch-builder-input-file-modified');
+ if (modifiedInput) {
+ modifiedInput.removeAttribute('accept');
+
+ // 监听ROM文件选择,获取文件名
+ modifiedInput.addEventListener('change', function(e) {
+ if (e.target.files && e.target.files[0]) {
+ modifiedFileName = e.target.files[0].name;
+ }
+ });
+ }
+
+ //监听Patch后缀
+ var patchTypeSelect = document.getElementById('patch-builder-select-patch-type');
+ if (patchTypeSelect) {
+ patchTypeSelect.addEventListener('change', function (e) {
+ patchFileExtension = e.target.value;
+ });
+ }
+
+ //监听Segment的切换
+ var switchContainer = document.getElementById('switch-create-button');
+ if (switchContainer) {
+ switchContainer.addEventListener('click', function (e) {
+ var btn = e.target.closest('.mode-segment');
+ if (!btn) return;
+
+ // 当前模式
+ mode = btn.dataset.mode; // "patch" / "creator"
+ });
+ }
+
+
+
+ }
+
+ // 重写URL.createObjectURL来拦截blob下载
+ URL.createObjectURL = function(blob) {
+ console.log('Blob下载被拦截:', blob);
+
+ // 生成下载文件名
+ var downloadFileName = generatePatchedFileName(romFileName, patchFileName);
+
+ // 读取blob内容
+ var reader = new FileReader();
+ reader.onload = function(e) {
+ var base64Data = e.target.result;
+ // 发送给iOS
+ window.webkit.messageHandlers.downloadHandler.postMessage({
+ type: 'blob_download',
+ data: base64Data,
+ size: blob.size,
+ mimeType: blob.type,
+ fileName: downloadFileName,
+ romFileName: romFileName,
+ patchFileName: patchFileName,
+ originalFileName: originalFileName,
+ modifiedFileName: modifiedFileName,
+ patchFileExtension: patchFileExtension,
+ mode: mode
+ });
+ };
+ reader.readAsDataURL(blob);
+
+ // 继续原始下载流程
+ return originalCreateObjectURL.call(this, blob);
+ };
+
+ // 生成补丁后的文件名
+ function generatePatchedFileName(romName, patchName) {
+ if (!romName) return 'patched_rom.bin';
+
+ // 移除扩展名
+ var nameWithoutExt = romName.replace(/\\.[^/.]+$/, '');
+ var romExt = romName.split('.').pop() || 'bin';
+
+ // 如果有补丁文件名,尝试从中提取描述信息
+ var patchInfo = '';
+ if (patchName) {
+ // 移除补丁文件扩展名
+ var patchWithoutExt = patchName.replace(/\\.[^/.]+$/, '');
+ // 如果补丁名不包含在ROM名中,添加到文件名
+ if (!nameWithoutExt.toLowerCase().includes(patchWithoutExt.toLowerCase())) {
+ patchInfo = '_' + patchWithoutExt;
+ }
+ }
+
+ return nameWithoutExt + patchInfo + '_patched.' + romExt;
+ }
+
+ // 立即执行一次
+ removeFileRestrictions();
+
+ // DOM完全加载后再执行一次
+ document.addEventListener('DOMContentLoaded', removeFileRestrictions);
+
+ // 使用MutationObserver监听DOM变化
+ var observer = new MutationObserver(function(mutations) {
+ removeFileRestrictions();
+ });
+ observer.observe(document.body || document.documentElement, {
+ childList: true,
+ subtree: true
+ });
+
+ // 延时执行,确保页面完全加载
+ setTimeout(removeFileRestrictions, 1000);
+ setTimeout(removeFileRestrictions, 3000);
+ """
+
+
+ let userContentController = WKUserContentController()
+ let proxy = WeakScriptMessageHandler(target: self)
+ let script = WKUserScript(source: js, injectionTime: .atDocumentStart, forMainFrameOnly: true)
+ userContentController.addUserScript(script)
+ userContentController.add(proxy, name: "downloadHandler")
+
+ let config = WKWebViewConfiguration()
+ config.userContentController = userContentController
+
+ view = WKWebView(frame: CGRect.zero, configuration: config)
+ view.navigationDelegate = self
+ view.isOpaque = false
+ view.backgroundColor = Constants.Color.Background
+ view.scrollView.backgroundColor = Constants.Color.Background
+
+ return view
+ }()
+
+ var didTapClose: (()->Void)? = nil
+
+ private lazy var localServer: LocalWebServer = {
+ let server = LocalWebServer()
+ try? server.start(serverType: .RomPatcher)
+ return server
+ }()
+
+ deinit {
+ webView.navigationDelegate = nil
+ localServer.stop()
+ }
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+
+ addSubview(webView)
+ webView.snp.makeConstraints { make in
+ make.leading.trailing.equalToSuperview()
+ make.top.equalTo(Constants.Size.ItemHeightMid)
+ make.bottom.equalTo(-Constants.Size.ContentInsetBottom)
+ }
+ if let url = localServer.getURL() {
+ webView.load(URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData))
+ }
+
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
+ make.height.equalTo(Constants.Size.ItemHeightMid)
+ }
+
+ let icon = IconView()
+ icon.image = R.image.rompatcher_logo()
+ navigationBlurView.addSubview(icon)
+ icon.snp.makeConstraints { make in
+ make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
+ make.size.equalTo(Constants.Size.IconSizeMin)
+ make.centerY.equalToSuperview()
+ }
+
+ let titleLabel = UILabel()
+ titleLabel.font = Constants.Font.title(size: .s)
+ titleLabel.textColor = Constants.Color.LabelPrimary
+ titleLabel.text = "RomPatcher"
+ navigationBlurView.addSubview(titleLabel)
+ titleLabel.snp.makeConstraints { make in
+ make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceTiny)
+ make.centerY.equalToSuperview()
+ }
+
+ navigationBlurView.addSubview(closeButton)
+ closeButton.snp.makeConstraints { make in
+ make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
+ make.centerY.equalToSuperview()
+ make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
+ }
+ }
+
+ @MainActor required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+}
+
+extension RomPatcherView: WKNavigationDelegate {
+ func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping @MainActor (WKNavigationActionPolicy) -> Void) {
+ if let url = navigationAction.request.url, let host = url.host, host != "localhost" {
+ UIApplication.shared.open(url)
+ decisionHandler(.cancel)
+ } else {
+ decisionHandler(.allow)
+ }
+ }
+}
+
+extension RomPatcherView: WKScriptMessageHandler {
+ func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
+ if message.name == "downloadHandler" {
+ if let messageDict = message.body as? [String: Any] {
+ if let type = messageDict["type"] as? String {
+ switch type {
+ case "blob_download":
+ handleBlobDownload(messageDict)
+ default:
+ break
+ }
+ }
+ }
+ }
+ }
+
+ private func handleBlobDownload(_ messageDict: [String: Any]) {
+ guard let base64Data = messageDict["data"] as? String,
+ let size = messageDict["size"] as? Int else {
+ Log.debug("无效的blob下载数据")
+ return
+ }
+
+ Log.debug("接收到blob下载,大小: \(size) bytes")
+
+ // 移除data:前缀并解码base64
+ guard let commaRange = base64Data.range(of: ","),
+ let data = Data(base64Encoded: String(base64Data[commaRange.upperBound...])) else {
+ Log.debug("base64数据解码失败")
+ return
+ }
+
+ let mode = messageDict["mode"] as? String ?? "patch"
+ if mode == "patch" {
+ // 从JS获取生成的文件名
+ let romFileName = messageDict["romFileName"] as? String ?? ""
+ let patchFileName = messageDict["patchFileName"] as? String ?? ""
+ // 保存文件
+ saveDownloadedFile(data: data, fileName: romFileName.deletingPathExtension + " (\(patchFileName.deletingPathExtension))." + romFileName.pathExtension, isPatch: false)
+ } else {
+ // 从JS获取生成的文件名
+ let patchFileExtension = messageDict["patchFileExtension"] as? String ?? "ips"
+ var patchFileName = messageDict["modifiedFileName"] as? String ?? messageDict["originalFileName"] as? String ?? "\(Date.now.timeIntervalSince1970)"
+ patchFileName = patchFileName.deletingPathExtension + ".\(patchFileExtension)"
+ // 保存文件
+ saveDownloadedFile(data: data, fileName: patchFileName, isPatch: true)
+ }
+
+
+ }
+
+ private func saveDownloadedFile(data: Data, fileName: String, isPatch: Bool) {
+ let fileUrl = URL(fileURLWithPath: Constants.Path.Cache.appendingPathComponent(fileName))
+
+
+ if FileManager.default.fileExists(atPath: fileUrl.path) {
+ try? FileManager.default.removeItem(at: fileUrl)
+ }
+
+ do {
+ try data.writeWithCompletePath(to: fileUrl)
+ DispatchQueue.main.async {
+ UIView.makeAlert(title: R.string.localizable.downloadCompletion(), detail: fileName, cancelTitle: R.string.localizable.gamesShareRom(), confirmTitle: isPatch ? nil : R.string.localizable.m3uFileImport(), cancelAction: {
+ //分享
+ ShareManager.shareFile(fileUrl: fileUrl)
+ }, confirmAction: {
+ //导入
+ FilesImporter.importFiles(urls: [fileUrl])
+ })
+ }
+ } catch {
+ DispatchQueue.main.async {
+ UIView.makeToast(message: "文件保存失败: \(error.localizedDescription)")
+ }
+ Log.debug("文件保存失败: \(error)")
+ }
+ }
+}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Controllers/Models/ControllerMapping.swift b/ManicEmu/ManicEmu/Sources/Business/Controllers/Models/ControllerMapping.swift
index 8b3ea91a..4f578787 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Controllers/Models/ControllerMapping.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Controllers/Models/ControllerMapping.swift
@@ -38,7 +38,7 @@ class ControllerMapping: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllerMappingView.swift b/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllerMappingView.swift
index dd22a086..8d6be143 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllerMappingView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllerMappingView.swift
@@ -11,8 +11,8 @@ import RealmSwift
class ControllerMappingView: UIView {
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
return view
}()
@@ -309,7 +309,7 @@ class ControllerMappingView: UIView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(Constants.Size.SafeAera.top)
- make.leading.trailing.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(44)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllersSettingView.swift b/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllersSettingView.swift
index e5f5dabd..6563adad 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllersSettingView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Controllers/Views/ControllersSettingView.swift
@@ -16,8 +16,8 @@ class ControllersSettingView: BaseView {
private let asSideMenu: Bool
private let initGameType: GameType
- var topBlurView: UIView = {
- let view = UIView()
+ var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
if UIDevice.isPad {
view.backgroundColor = UIColor(.dm, light: .white, dark: .black)
} else {
@@ -95,9 +95,10 @@ class ControllersSettingView: BaseView {
}
if asSideMenu {
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ContentInsetTop)
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverSearchView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverSearchView.swift
index 73cf17c2..c467d53a 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverSearchView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameCoverSearchView.swift
@@ -14,8 +14,8 @@ import Kingfisher
class GameCoverSearchView: BaseView {
static var GameCoverHeight: CGFloat = 0
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -74,13 +74,14 @@ class GameCoverSearchView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid + Constants.Size.ItemHeightMin + Constants.Size.ContentSpaceMin )
}
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.top.equalToSuperview().offset(Constants.Size.ContentSpaceMid)
@@ -88,8 +89,8 @@ class GameCoverSearchView: BaseView {
}
let textFieldContainer = RoundAndBorderView(roundCorner: .allCorners, radius: Constants.Size.CornerRadiusMid)
- textFieldContainer.backgroundColor = Constants.Color.BackgroundSecondary
- topBlurView.addSubview(textFieldContainer)
+ textFieldContainer.backgroundColor = Constants.Color.BackgroundPrimary
+ navigationBlurView.addSubview(textFieldContainer)
textFieldContainer.snp.makeConstraints { make in
make.top.equalToSuperview().offset(Constants.Size.ItemHeightMid)
make.leading.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceMax)
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoDetailReusableView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoDetailReusableView.swift
index 38e48cf8..3eec7d65 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoDetailReusableView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoDetailReusableView.swift
@@ -1182,7 +1182,7 @@ class GameInfoDetailReusableView: UICollectionReusableView {
updateDSFunctionButton()
} else if game.gameType == .n64 {
updateN64FunctionButton()
- } else if game.gameType == .vb || game.gameType == .pm {
+ } else if game.gameType == .vb || game.gameType == .pm || game.isJGenesisCore {
updateVBOrPMFunctionButton()
} else if game.gameType == .ps1 {
updatePS1FunctionButton()
@@ -1194,6 +1194,8 @@ class GameInfoDetailReusableView: UICollectionReusableView {
updateSNESFunctionButton()
} else if game.gameType == .ns {
updateNSFunctionButton()
+ } else if game.isAtari {
+ updateAtariFunctionButton()
}
addManualsButton()
hasSetupViews = true
@@ -1507,6 +1509,7 @@ class GameInfoDetailReusableView: UICollectionReusableView {
ndsSystemTypeButton.removeFromSuperview()
gbaSlotContextMenuButton.removeFromSuperview()
gbaSlotButton.removeFromSuperview()
+ let isMelonDS = (game?.defaultCore ?? 0) == 0
if let lastView = functionButtonContainerView.subviews.last {
//语言选择按钮
functionButtonContainerView.addSubview(languageContextMenuButton)
@@ -1532,38 +1535,40 @@ class GameInfoDetailReusableView: UICollectionReusableView {
make.edges.equalTo(microphoneButton)
}
- var enableGBASlot = true
- if let game, let mode = game.getExtraString(key: ExtraKey.ndsSystemMode.rawValue), mode == "DSi" {
- enableGBASlot = false
- }
-
- //系统类型
- functionButtonContainerView.addSubview(ndsSystemTypeContextMenuButton)
- functionButtonContainerView.addSubview(ndsSystemTypeButton)
- ndsSystemTypeButton.snp.makeConstraints { make in
- make.leading.equalTo(microphoneButton.snp.trailing).offset(Constants.Size.ContentSpaceMin)
- make.centerY.equalToSuperview()
- make.size.equalTo(Constants.Size.IconSizeHuge)
- if !enableGBASlot {
- make.trailing.equalToSuperview()
+ if isMelonDS {
+ var enableGBASlot = true
+ if let game, let mode = game.getExtraString(key: ExtraKey.ndsSystemMode.rawValue), mode == "DSi" {
+ enableGBASlot = false
}
- }
- ndsSystemTypeContextMenuButton.snp.makeConstraints { make in
- make.edges.equalTo(ndsSystemTypeButton)
- }
-
- if enableGBASlot {
- //GBA Slot
- functionButtonContainerView.addSubview(gbaSlotContextMenuButton)
- functionButtonContainerView.addSubview(gbaSlotButton)
- gbaSlotButton.snp.makeConstraints { make in
- make.leading.equalTo(ndsSystemTypeButton.snp.trailing).offset(Constants.Size.ContentSpaceMin)
+
+ //系统类型
+ functionButtonContainerView.addSubview(ndsSystemTypeContextMenuButton)
+ functionButtonContainerView.addSubview(ndsSystemTypeButton)
+ ndsSystemTypeButton.snp.makeConstraints { make in
+ make.leading.equalTo(microphoneButton.snp.trailing).offset(Constants.Size.ContentSpaceMin)
make.centerY.equalToSuperview()
make.size.equalTo(Constants.Size.IconSizeHuge)
- make.trailing.equalToSuperview()
+ if !enableGBASlot {
+ make.trailing.equalToSuperview()
+ }
+ }
+ ndsSystemTypeContextMenuButton.snp.makeConstraints { make in
+ make.edges.equalTo(ndsSystemTypeButton)
}
- gbaSlotContextMenuButton.snp.makeConstraints { make in
- make.edges.equalTo(gbaSlotButton)
+
+ if enableGBASlot {
+ //GBA Slot
+ functionButtonContainerView.addSubview(gbaSlotContextMenuButton)
+ functionButtonContainerView.addSubview(gbaSlotButton)
+ gbaSlotButton.snp.makeConstraints { make in
+ make.leading.equalTo(ndsSystemTypeButton.snp.trailing).offset(Constants.Size.ContentSpaceMin)
+ make.centerY.equalToSuperview()
+ make.size.equalTo(Constants.Size.IconSizeHuge)
+ make.trailing.equalToSuperview()
+ }
+ gbaSlotContextMenuButton.snp.makeConstraints { make in
+ make.edges.equalTo(gbaSlotButton)
+ }
}
}
}
@@ -1760,6 +1765,21 @@ class GameInfoDetailReusableView: UICollectionReusableView {
functionButtonContainerView.subviews.forEach({ $0.removeFromSuperview() })
}
+ private func updateAtariFunctionButton() {
+ cheatCodeButton.removeFromSuperview()
+
+ retroButton.snp.makeConstraints { make in
+ make.leading.centerY.equalToSuperview()
+ make.size.equalTo(Constants.Size.IconSizeHuge)
+ }
+
+ skinButton.snp.makeConstraints { make in
+ make.leading.equalTo(retroButton.snp.trailing).offset(Constants.Size.ContentSpaceMin)
+ make.size.equalTo(Constants.Size.IconSizeHuge)
+ make.trailing.equalToSuperview()
+ }
+ }
+
private func addManualsButton() {
//添加游戏手册按钮
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift
index b1de1154..f343fa38 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/VIews/GameInfoView.swift
@@ -13,8 +13,8 @@ import IceCream
class GameInfoView: BaseView {
/// 充当导航条 内部会加入一个游戏封面缩略图 当collectionView网上滑动时才会展示出来
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
view.alpha = 0
return view
@@ -184,7 +184,8 @@ class GameInfoView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMax)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/AzaharAdvancedSettingViewController.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/AzaharAdvancedSettingViewController.swift
index 39adaa6a..da0d6dfd 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/AzaharAdvancedSettingViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/AzaharAdvancedSettingViewController.swift
@@ -21,8 +21,8 @@ class AzaharAdvancedSettingViewController: QuickTableViewController {
private var isFirstInit = true
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -89,7 +89,8 @@ class AzaharAdvancedSettingViewController: QuickTableViewController {
view.addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/CitraAdvancedSettingViewController.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/CitraAdvancedSettingViewController.swift
index 6c226872..23c3e10d 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/CitraAdvancedSettingViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/CitraAdvancedSettingViewController.swift
@@ -19,8 +19,8 @@ class CitraAdvancedSettingViewController: QuickTableViewController {
private let defaultConfig = try? INIFile(fileName: Constants.Path.CitraDefaultConfig)
private var isModified = false
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -84,7 +84,8 @@ class CitraAdvancedSettingViewController: QuickTableViewController {
view.addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/PSXSBIImportViewController.swift b/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/PSXSBIImportViewController.swift
index e903596d..331879c3 100644
--- a/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/PSXSBIImportViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/GameInfo/ViewControllers/PSXSBIImportViewController.swift
@@ -15,8 +15,8 @@ class PSXSBIImportViewController: BaseViewController {
private let game: Game
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -66,14 +66,15 @@ class PSXSBIImportViewController: BaseViewController {
make.edges.equalToSuperview()
}
- view.addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ view.addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .lockRectangleStack))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -83,7 +84,7 @@ class PSXSBIImportViewController: BaseViewController {
headerTitleLabel.text = R.string.localizable.sbiImport()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
index 2fc04672..84598792 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/ViewControllers/GamesViewController.swift
@@ -18,8 +18,8 @@ class GamesViewController: BaseViewController {
return view
}()
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -247,14 +247,14 @@ class GamesViewController: BaseViewController {
let image = UIImage(contentsOfFile: Constants.Path.GameListBackground) {
self.backgroundImageView.image = image
self.enableBackground = true
- self.topBlurView.setBlurVisble(false)
+ self.navigationBlurView.setBlurVisble(false)
self.gamesListView.enableBackground = self.enableBackground
self.gamesToolView.enableBackground = self.enableBackground
} else {
//移除了背景
self.backgroundImageView.image = nil
self.enableBackground = false
- self.topBlurView.setBlurVisble(true)
+ self.navigationBlurView.setBlurVisble(true)
self.gamesListView.enableBackground = self.enableBackground
self.gamesToolView.enableBackground = self.enableBackground
}
@@ -276,9 +276,11 @@ class GamesViewController: BaseViewController {
override func viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
if UIDevice.isPad {
- hideSideMenu { [weak self] in
- self?.updateViews()
- }
+ DispatchQueue.main.asyncAfter(delay: UIDevice.isIOS15 ? 0.35 : 0, execute: { [weak self] in
+ self?.hideSideMenu { [weak self] in
+ self?.updateViews()
+ }
+ })
} else if UIDevice.isPhone {
self.gamesToolView.stopSearch()
self.gamesToolView.stopSelect()
@@ -302,7 +304,7 @@ class GamesViewController: BaseViewController {
make.edges.equalToSuperview()
}
- view.addSubview(topBlurView)
+ view.addSubview(navigationBlurView)
view.addSubview(gamesNavigationView)
gamesNavigationView.snp.makeConstraints { make in
@@ -319,7 +321,7 @@ class GamesViewController: BaseViewController {
}
- topBlurView.snp.makeConstraints { make in
+ navigationBlurView.snp.makeConstraints { make in
make.leading.top.trailing.equalToSuperview()
make.bottom.equalTo(gamesNavigationView)
}
@@ -350,7 +352,7 @@ class GamesViewController: BaseViewController {
}
}
- view.addSubview(topBlurView)
+ view.addSubview(navigationBlurView)
view.addSubview(gamesNavigationView)
@@ -372,7 +374,7 @@ class GamesViewController: BaseViewController {
}
- topBlurView.snp.makeConstraints { make in
+ navigationBlurView.snp.makeConstraints { make in
make.leading.top.trailing.equalTo(gamesListView)
make.bottom.equalTo(gamesNavigationView)
}
@@ -431,7 +433,7 @@ class GamesViewController: BaseViewController {
}
}
- topBlurView.setBlurVisble(!enableBackground)
+ navigationBlurView.setBlurVisble(!enableBackground)
gamesListView.enableBackground = enableBackground
gamesToolView.enableBackground = enableBackground
}
@@ -486,7 +488,7 @@ class GamesViewController: BaseViewController {
///更新顶部的模糊视图 如果编辑模式 则toolView不会隐藏 所以需要将blurView加大 反之则需要减小
private func updateTopBlurView() {
- topBlurView.snp.updateConstraints { make in
+ navigationBlurView.snp.updateConstraints { make in
make.bottom.equalTo(self.gamesNavigationView).offset((gamesListView.isSelectionMode || gamesListView.isSearchMode) ? Constants.Size.GamesToolViewHeight : 0)
}
}
@@ -554,7 +556,7 @@ class GamesViewController: BaseViewController {
make.top.equalToSuperview().offset(0)
}
gamesToolView.isHidden = true
- topBlurView.snp.updateConstraints { make in
+ navigationBlurView.snp.updateConstraints { make in
make.leading.equalToSuperview().inset(-Constants.Size.SafeAera.left)
make.trailing.equalToSuperview().inset(-Constants.Size.SafeAera.right)
}
@@ -563,7 +565,7 @@ class GamesViewController: BaseViewController {
make.top.equalToSuperview().offset(Constants.Size.ContentInsetTop)
}
gamesToolView.isHidden = false
- topBlurView.snp.updateConstraints { make in
+ navigationBlurView.snp.updateConstraints { make in
make.leading.equalToSuperview()
make.trailing.equalToSuperview()
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift
index d6af2e3f..5aee6020 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameCoverView.swift
@@ -85,7 +85,10 @@ class GameCoverView: UIView {
func setData(game: Game, coverSize: CGSize, style: CoverStyle, scalePlatform: Bool = true) {
if height > 0 {
autoCornerRadius = false
- layerCornerRadius = Constants.Size.GameCoverCornerRatio * style.maxCornerRadius(frameHeight: height)
+ let gameCoverCornerRatio = Constants.Size.GameCoverCornerRatio
+ let maxCornerRadius = style.maxCornerRadius(frameHeight: coverSize.height)
+ let cornerRadius = gameCoverCornerRatio * maxCornerRadius
+ layerCornerRadius = cornerRadius
} else {
autoCornerRadius = true
}
@@ -218,6 +221,16 @@ class GameCoverView: UIView {
image = style == .style2 ? R.image.arcade_cover_v() : R.image.arcade_cover_h()
} else if gameType == .ns {
image = style == .style2 ? R.image.ns_cover_v() : R.image.ns_cover_h()
+ } else if gameType == .a2600 {
+ image = style == .style2 ? R.image.a2600_cover_v() : R.image.a2600_cover_h()
+ } else if gameType == .a5200 {
+ image = style == .style2 ? R.image.a5200_cover_v() : R.image.a5200_cover_h()
+ } else if gameType == .a7800 {
+ image = style == .style2 ? R.image.a7800_cover_v() : R.image.a7800_cover_h()
+ } else if gameType == .jaguar {
+ image = style == .style2 ? R.image.jaguar_cover_v() : R.image.jaguar_cover_h()
+ } else if gameType == .lynx {
+ image = style == .style2 ? R.image.lynx_cover_v() : R.image.lynx_cover_h()
}
if UIDevice.isPhone, !UIDevice.isLandscape, scalePlatform, Constants.Size.GamesPerRow != 2, let unwrapImage = image {
image = unwrapImage.scaled(toWidth: unwrapImage.size.width * (1/(Constants.Size.GamesPerRow-1)))
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListView.swift
index b0a44faf..452f7c99 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameListView.swift
@@ -78,7 +78,12 @@ class GameListView: BaseView {
///搜索模式数据源
private lazy var searchDatas: [GameType: [Game]] = [:]
- private var coverSizes = [GameType: CGSize]()
+ struct CoverSizeIdentifier: Hashable {
+ var gameType: GameType
+ var isLandscape: Bool = UIDevice.isLandscape
+ }
+
+ private var coverSizes = [CoverSizeIdentifier: CGSize]()
///选择模式
var isSelectionMode: Bool { selectionMode != .normalMode }
@@ -86,6 +91,9 @@ class GameListView: BaseView {
didSet {
guard selectionMode != oldValue else { return }
for (gameTypeIndex, gameType) in self.sortDatasKeys().enumerated() {
+ if foldedGameTypes[gameType] ?? false {
+ continue
+ }
if let games = (isSearchMode ? searchDatas : normalDatas)[gameType] {
for (gameIndex, _) in games.enumerated() {
switch selectionMode {
@@ -444,14 +452,14 @@ class GameListView: BaseView {
let coverWidth = coverHeight*Constants.Size.GameCoverRatio(gameType: gameType)
let itemEstimatedWidth = coverWidth + Constants.Size.GamesListSelectionEdge*2
let coverSize = CGSize(width: coverWidth, height: coverHeight)
- if let size = self.coverSizes[gameType] {
+ if let size = self.coverSizes[CoverSizeIdentifier(gameType: gameType)] {
//尺寸存在
if size != coverSize {
- self.coverSizes[gameType] = coverSize
+ self.coverSizes[CoverSizeIdentifier(gameType: gameType)] = coverSize
}
} else {
//尺寸不存在
- self.coverSizes[gameType] = coverSize
+ self.coverSizes[CoverSizeIdentifier(gameType: gameType)] = coverSize
}
let newItem = NSCollectionLayoutItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .fractionalHeight(1)))
@@ -473,14 +481,14 @@ class GameListView: BaseView {
//一个item的高度 = 间距 + 封面高度 + 间距 + title高度 + 间距
let itemEstimatedHeight = Constants.Size.GamesListSelectionEdge + coverHeight + (self.isSearchMode || !Constants.Size.GamesHideTitle ? Constants.Size.ContentSpaceMin + Constants.Font.body().lineHeight : 0) + Constants.Size.GamesListSelectionEdge
let coverSize = CGSize(width: coverWidth, height: coverHeight)
- if let size = self.coverSizes[gameType] {
+ if let size = self.coverSizes[CoverSizeIdentifier(gameType: gameType)] {
//尺寸存在
if size != coverSize {
- self.coverSizes[gameType] = coverSize
+ self.coverSizes[CoverSizeIdentifier(gameType: gameType)] = coverSize
}
} else {
//尺寸不存在
- self.coverSizes[gameType] = coverSize
+ self.coverSizes[CoverSizeIdentifier(gameType: gameType)] = coverSize
}
let item = NSCollectionLayoutItem(layoutSize: NSCollectionLayoutSize(widthDimension: widthDimension,
@@ -848,7 +856,12 @@ extension GameListView: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withClass: GameCollectionViewCell.self, for: indexPath)
if let game = getGame(at: indexPath) {
- cell.setData(game: game, isSelect: isSelectionMode, highlightString: searchString, coverSize: coverSizes[game.gameType] ?? .zero, showTitle: !Constants.Size.GamesHideTitle || isSearchMode, indexPath: indexPath)
+ cell.setData(game: game,
+ isSelect: isSelectionMode,
+ highlightString: searchString,
+ coverSize: coverSizes[CoverSizeIdentifier(gameType: game.gameType)] ?? .zero,
+ showTitle: !Constants.Size.GamesHideTitle || isSearchMode,
+ indexPath: indexPath)
}
return cell
}
@@ -1087,9 +1100,21 @@ extension GameListView: UICollectionViewDelegate {
return false
}
- //长按弹出可交互菜单
+ //长按弹出可交互菜单 (iOS 15兼容)
+ func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //长按弹出可交互菜单 (iOS 16+)
+ @available(iOS 16.0, *)
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemsAt indexPaths: [IndexPath], point: CGPoint) -> UIContextMenuConfiguration? {
- guard selectionMode == .normalMode, let indexPath = indexPaths.first else { return nil }
+ guard let indexPath = indexPaths.first else { return nil }
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //统一的上下文菜单配置逻辑
+ private func contextMenuConfiguration(for collectionView: UICollectionView, at indexPath: IndexPath) -> UIContextMenuConfiguration? {
+ guard selectionMode == .normalMode else { return nil }
if let game = getGame(at: indexPath), let imageView = (collectionView.cellForItem(at: indexPath) as? GameCollectionViewCell)?.imageView {
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameplayManualsView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameplayManualsView.swift
index 884733b3..5036e390 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameplayManualsView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GameplayManualsView.swift
@@ -7,13 +7,14 @@
//
import PDFKit
import ProHUD
+import UniformTypeIdentifiers
class GameplayManualsView: UIView {
var didTapClose: (()->Void)? = nil
private var game: Game
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -25,6 +26,53 @@ class GameplayManualsView: UIView {
return view
}()
+ private lazy var moreContextMenuButton: ContextMenuButton = {
+ var actions: [UIMenuElement] = []
+ actions.append((UIAction(title: R.string.localizable.removeTitle()) { [weak self] _ in
+ guard let self = self else { return }
+ //移除
+ if let manualsPath = game.manualsPath {
+ try? FileManager.safeRemoveItem(at: URL(fileURLWithPath: Constants.Path.GameplayManuals.appendingPathComponent(manualsPath)))
+ self.game.updateExtra(key: ExtraKey.manualPage.rawValue, value: nil)
+ self.game.updateExtra(key: ExtraKey.manualFileName.rawValue, value: nil)
+ self.game.updateExtra(key: ExtraKey.manualScaleFactor.rawValue, value: nil)
+ self.pdfView.document = PDFDocument()
+ }
+ }))
+ actions.append(UIAction(title: R.string.localizable.reUpload()) { [weak self] _ in
+ guard let self = self else { return }
+ //重新上传
+ FilesImporter.shared.presentImportController(supportedTypes: [UTType.pdf],
+ allowsMultipleSelection: false,
+ manualHandle: { [weak self] urls in
+ guard let self else { return }
+ if let pdfUrl = urls.first {
+ do {
+ let pdfName = pdfUrl.lastPathComponent
+ let manualsPath = URL(fileURLWithPath: Constants.Path.GameplayManuals.appendingPathComponent(pdfName))
+ try FileManager.safeCopyItem(at: pdfUrl, to: manualsPath, shouldReplace: true)
+ self.game.updateExtra(key: ExtraKey.manualPage.rawValue, value: nil)
+ self.game.updateExtra(key: ExtraKey.manualScaleFactor.rawValue, value: nil)
+ self.game.updateExtra(key: ExtraKey.manualFileName.rawValue, value: pdfName)
+ self.pdfView.document = PDFDocument(url: manualsPath)
+ self.pdfView.autoScales = true
+ } catch {}
+ }
+ })
+ })
+ let view = ContextMenuButton(image: nil, menu: UIMenu(children: actions))
+ return view
+ }()
+
+ private lazy var moreButton: SymbolButton = {
+ let view = SymbolButton(symbol: .ellipsis, enableGlass: true)
+ view.enableRoundCorner = true
+ view.addTapGesture { [weak self] gesture in
+ self?.moreContextMenuButton.triggerTapGesture()
+ }
+ return view
+ }()
+
private lazy var closeButton: SymbolButton = {
let view = SymbolButton(image: UIImage(symbol: .xmark, font: Constants.Font.body(weight: .bold)), enableGlass: true)
view.enableRoundCorner = true
@@ -36,6 +84,8 @@ class GameplayManualsView: UIView {
let pageIndex = document.index(for: currentPage)
game.updateExtra(key: ExtraKey.manualPage.rawValue, value: pageIndex)
}
+ // 记录当前的缩放比例
+ game.updateExtra(key: ExtraKey.manualScaleFactor.rawValue, value: pdfView.scaleFactor)
}
return view
}()
@@ -47,7 +97,8 @@ class GameplayManualsView: UIView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -58,7 +109,24 @@ class GameplayManualsView: UIView {
make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
}
+ navigationBlurView.addSubview(moreContextMenuButton)
+ moreContextMenuButton.snp.makeConstraints { make in
+ make.trailing.equalTo(closeButton.snp.leading).offset(-Constants.Size.ContentSpaceMid)
+ make.centerY.equalToSuperview()
+ make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
+ }
+
+ navigationBlurView.addSubview(moreButton)
+ moreButton.snp.makeConstraints { make in
+ make.edges.equalTo(moreContextMenuButton)
+ }
+
+ let lastScaleFactor = game.getExtraDouble(key: ExtraKey.manualScaleFactor.rawValue)
+
addSubview(pdfView)
+ if lastScaleFactor != nil {
+ pdfView.autoScales = false
+ }
pdfView.snp.makeConstraints { make in
make.top.equalTo(navigationBlurView.snp.bottom)
make.leading.trailing.equalToSuperview()
@@ -69,15 +137,30 @@ class GameplayManualsView: UIView {
pdfView.document = PDFDocument(url: URL(fileURLWithPath: manualsPath))
}
- // 加载到上一次读取的位置
+ // 加载到上一次读取的位置和缩放比例
if let lastReadPage = game.getExtraInt(key: ExtraKey.manualPage.rawValue),
let document = pdfView.document,
lastReadPage < document.pageCount,
let page = document.page(at: lastReadPage) {
- DispatchQueue.main.asyncAfter(delay: 1, execute: { [weak self] in
+ pdfView.isHidden = true
+ DispatchQueue.main.asyncAfter(delay: 0.5, execute: { [weak self] in
guard let self else { return }
+ self.pdfView.isHidden = false
self.pdfView.go(to: page)
+
+ // 恢复上一次的缩放比例
+ if let lastScaleFactor {
+ self.pdfView.scaleFactor = CGFloat(lastScaleFactor)
+ }
})
+ } else {
+ // 如果没有保存的页数,但有保存的缩放比例,也要恢复
+ if let lastScaleFactor {
+ DispatchQueue.main.asyncAfter(delay: 0.5, execute: { [weak self] in
+ guard let self else { return }
+ self.pdfView.scaleFactor = CGFloat(lastScaleFactor)
+ })
+ }
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GamesCollectionReusableView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GamesCollectionReusableView.swift
index f15cf911..68b8d232 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/GamesCollectionReusableView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/GamesCollectionReusableView.swift
@@ -202,6 +202,16 @@ class GamesCollectionReusableView: UICollectionReusableView {
image = R.image.arcade_group_brand(compatibleWith: traitCollection)
} else if gameType == .ns {
image = R.image.ns_group_brand(compatibleWith: traitCollection)
+ } else if gameType == .a2600 {
+ image = R.image.a2600_group_brand(compatibleWith: traitCollection)
+ } else if gameType == .a5200 {
+ image = R.image.a5200_group_brand(compatibleWith: traitCollection)
+ } else if gameType == .a7800 {
+ image = R.image.a7800_group_brand(compatibleWith: traitCollection)
+ } else if gameType == .jaguar {
+ image = R.image.jaguar_group_brand(compatibleWith: traitCollection)
+ } else if gameType == .lynx {
+ image = R.image.lynx_group_brand(compatibleWith: traitCollection)
}
Self.brandImageCaches[key] = image
return image
diff --git a/ManicEmu/ManicEmu/Sources/Business/Games/Views/ManufacturerCategoryView.swift b/ManicEmu/ManicEmu/Sources/Business/Games/Views/ManufacturerCategoryView.swift
index 08d3d04f..961af7c7 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Games/Views/ManufacturerCategoryView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Games/Views/ManufacturerCategoryView.swift
@@ -103,13 +103,13 @@ class ManufacturerCategoryView: BaseView {
private func createLayout() -> UICollectionViewLayout {
let layout = UICollectionViewCompositionalLayout { sectionIndex, env in
//item布局
- let item = NSCollectionLayoutItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.25),
+ let item = NSCollectionLayoutItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .fractionalHeight(1)))
//group布局
- let group = NSCollectionLayoutGroup.horizontal(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1)), subitems: [item])
+ let group = NSCollectionLayoutGroup.horizontal(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(UIDevice.isPhone ? 1/4 : 1/5), heightDimension: .fractionalHeight(1)), subitem: item, count: 1)
//section布局
let section = NSCollectionLayoutSection(group: group)
section.orthogonalScrollingBehavior = .continuous
diff --git a/ManicEmu/ManicEmu/Sources/Business/History/Views/PlayHistoryView.swift b/ManicEmu/ManicEmu/Sources/Business/History/Views/PlayHistoryView.swift
index 725f0172..ae577e4e 100644
--- a/ManicEmu/ManicEmu/Sources/Business/History/Views/PlayHistoryView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/History/Views/PlayHistoryView.swift
@@ -14,8 +14,8 @@ import VisualEffectView
class PlayHistoryView: BaseView {
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
if UIDevice.isPad {
view.backgroundColor = UIColor(.dm, light: .white, dark: .black)
} else {
@@ -64,9 +64,10 @@ class PlayHistoryView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ContentInsetTop + Constants.Size.ItemHeightMid)
}
@@ -74,7 +75,7 @@ class PlayHistoryView: BaseView {
headerTitleLabel.text = R.string.localizable.historyHeaderTitle()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalToSuperview().inset(Constants.Size.ContentSpaceMax)
make.top.equalToSuperview().offset(Constants.Size.ContentInsetTop)
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Models/ImportService.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Models/ImportService.swift
index 3d4fa72c..79653ee4 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/Models/ImportService.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Models/ImportService.swift
@@ -207,7 +207,7 @@ class ImportService: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data.string(encoding: .utf8)
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/LanServiceEditViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/LanServiceEditViewController.swift
index b60ac4cf..4f7ca774 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/LanServiceEditViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/LanServiceEditViewController.swift
@@ -25,8 +25,8 @@ class LanServiceEditViewController: BaseViewController {
let returnKeyType: UIReturnKeyType
}
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -162,14 +162,15 @@ class LanServiceEditViewController: BaseViewController {
make.edges.equalToSuperview()
}
- view.addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ view.addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
- topBlurView.addSubview(confirmButton)
+ navigationBlurView.addSubview(confirmButton)
confirmButton.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.height.equalTo(Constants.Size.ItemHeightUltraTiny)
@@ -181,7 +182,7 @@ class LanServiceEditViewController: BaseViewController {
headerTitleLabel.text = service.title
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.center.equalToSuperview()
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/MultiDiscBuilderViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/MultiDiscBuilderViewController.swift
index 7f0565a0..a8612b2a 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/MultiDiscBuilderViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/ViewControllers/MultiDiscBuilderViewController.swift
@@ -58,8 +58,8 @@ class MultiDiscBuilderViewController: BaseViewController {
}
}
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -70,6 +70,7 @@ class MultiDiscBuilderViewController: BaseViewController {
view.contentInsetAdjustmentBehavior = .never
view.register(cellWithClass: MultiDiscDescCollectionCell.self)
view.register(cellWithClass: MultiDiscItemCollectionCell.self)
+ view.register(cellWithClass: MultiDiscAddCollectionCell.self)
view.showsVerticalScrollIndicator = false
view.dataSource = self
view.delegate = self
@@ -92,10 +93,6 @@ class MultiDiscBuilderViewController: BaseViewController {
UIView.makeToast(message: R.string.localizable.generateM3uFailed())
}
}))
- actions.append(UIAction(title: R.string.localizable.m3uFileImport()) { [weak self] _ in
- guard let self = self else { return }
- self.importGame()
- })
let view = ContextMenuButton(image: nil, menu: UIMenu(children: actions))
return view
}()
@@ -109,81 +106,13 @@ class MultiDiscBuilderViewController: BaseViewController {
return view
}()
- private lazy var addFileButton: SymbolButton = {
- let view = SymbolButton(image: nil, title: R.string.localizable.multiDiscAddFile("ROM"), titleFont: Constants.Font.body(size: .l, weight: .medium), titleColor: Constants.Color.LabelPrimary.forceStyle(.dark), horizontalContian: true, titlePosition: .right)
+ private lazy var addToLibraryButton: SymbolButton = {
+ let view = SymbolButton(image: nil, title: R.string.localizable.m3uFileImport(), titleFont: Constants.Font.body(size: .l, weight: .medium), titleColor: Constants.Color.LabelPrimary.forceStyle(.dark), horizontalContian: true, titlePosition: .right)
view.enableRoundCorner = true
view.backgroundColor = Constants.Color.Main
view.addTapGesture { [weak self] gesture in
guard let self else { return }
- let supportedType: [UTType]
- if let cue = UTType(filenameExtension: "cue"), let bin = UTType(filenameExtension: "bin"), let chd = UTType(filenameExtension: "chd"), let cdi = UTType(filenameExtension: "cdi") {
- switch self.fileType {
- case .undetermined:
- supportedType = [cue, bin, chd, cdi]
- case .cue:
- supportedType = [cue, bin]
- case .chd:
- supportedType = [chd]
- case .cdi:
- supportedType = [cdi]
- }
- FilesImporter.shared.presentImportController(supportedTypes: supportedType) { [weak self] urls in
- guard let self else { return }
- let isCue = urls.contains(where: { $0.url?.pathExtension.lowercased() == "cue" })
- let isChd = urls.contains(where: { $0.url?.pathExtension.lowercased() == "chd" })
- let isCdi = urls.contains(where: { $0.url?.pathExtension.lowercased() == "cdi" })
- if (isCue || urls.contains(where: { $0.url?.pathExtension.lowercased() == "bin" })) && (isChd || isCdi) {
- UIView.makeToast(message: R.string.localizable.multiDiscImportErrorConflict())
- return
- }
- let urls = urls.sorted(by: { $0.path < $1.path })
- if isCue {
- let (_, errors, cueItems) = FilesImporter.handleMultiFiles(urls: urls)
- if errors.count > 0 {
- UIView.makeAlert(detail: errors.reduce("", { $0 + $1.localizedDescription + "\n"}))
- }
- var cues = [CUE]()
- if cueItems.count > 0 {
- for item in cueItems {
- let tempCueUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(item.url.lastPathComponent))
- try? FileManager.safeCopyItem(at: item.url, to: tempCueUrl)
- var bins = [URL]()
- for binUrl in item.files {
- let tempBinUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(binUrl.lastPathComponent))
- try? FileManager.safeCopyItem(at: binUrl, to: tempBinUrl, shouldReplace: true)
- bins.append(tempBinUrl)
- }
- cues.append(CUE(url: tempCueUrl, files: bins))
- }
- self.datas.append(contentsOf: cues)
- self.collectionView.reloadData()
- }
- self.addFileButton.titleLabel.text = R.string.localizable.multiDiscAddFile(".cue .bin")
- } else if isChd {
- var chds = [CHD]()
- for url in urls {
- let tempChdUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(url.lastPathComponent))
- try? FileManager.safeCopyItem(at: url, to: tempChdUrl, shouldReplace: true)
- chds.append(CHD(url: tempChdUrl, files: []))
- }
- self.datas.append(contentsOf: chds)
- self.collectionView.reloadData()
- self.addFileButton.titleLabel.text = R.string.localizable.multiDiscAddFile(".chd")
- } else if isCdi {
- var cdis = [CDI]()
- for url in urls {
- let tempChdUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(url.lastPathComponent))
- try? FileManager.safeCopyItem(at: url, to: tempChdUrl, shouldReplace: true)
- cdis.append(CDI(url: tempChdUrl, files: []))
- }
- self.datas.append(contentsOf: cdis)
- self.collectionView.reloadData()
- self.addFileButton.titleLabel.text = R.string.localizable.multiDiscAddFile(".cdi")
- } else {
- UIView.makeToast(message: R.string.localizable.multiDiscImportErrorMissing())
- }
- }
- }
+ self.importGame()
}
return view
}()
@@ -197,6 +126,10 @@ class MultiDiscBuilderViewController: BaseViewController {
return view
}()
+ private var addItemText = R.string.localizable.multiDiscAddFile("ROM")
+
+ private var hasAddToLibrary = false;
+
deinit {
Log.debug("\(String(describing: Self.self)) deinit")
}
@@ -218,14 +151,15 @@ class MultiDiscBuilderViewController: BaseViewController {
make.edges.equalToSuperview()
}
- view.addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ view.addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(view.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .opticaldisc))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -235,7 +169,7 @@ class MultiDiscBuilderViewController: BaseViewController {
headerTitleLabel.text = R.string.localizable.multiDiscBuilder()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
@@ -243,7 +177,7 @@ class MultiDiscBuilderViewController: BaseViewController {
addCloseButton { [weak self] in
guard let self else { return }
- guard self.datas.count > 0 else {
+ guard self.datas.count > 0, !self.hasAddToLibrary else {
self.dismiss(animated: true)
return
}
@@ -261,28 +195,28 @@ class MultiDiscBuilderViewController: BaseViewController {
})
}
- topBlurView.addSubview(moreContextMenuButton)
+ navigationBlurView.addSubview(moreContextMenuButton)
moreContextMenuButton.snp.makeConstraints { make in
make.trailing.equalTo(closeButton.snp.leading).offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalTo(closeButton)
make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
}
- topBlurView.addSubview(moreButton)
+ navigationBlurView.addSubview(moreButton)
moreButton.snp.makeConstraints { make in
make.edges.equalTo(moreContextMenuButton)
}
view.addSubview(bottomBlurView)
- view.addSubview(addFileButton)
- addFileButton.snp.makeConstraints { make in
+ view.addSubview(addToLibraryButton)
+ addToLibraryButton.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceHuge)
make.height.equalTo(Constants.Size.ItemHeightMid)
make.bottom.equalToSuperview().offset(-Constants.Size.ContentInsetBottom-Constants.Size.ContentSpaceMid)
}
bottomBlurView.snp.makeConstraints { make in
make.leading.trailing.bottom.equalToSuperview()
- make.top.equalTo(addFileButton.snp.centerY)
+ make.top.equalTo(addToLibraryButton.snp.centerY)
}
}
@@ -301,7 +235,7 @@ class MultiDiscBuilderViewController: BaseViewController {
let name = self.datas.first!.url.lastPathComponent.deletingPathExtension + ".m3u"
let m3uUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(name))
try? FileManager.safeRemoveItem(at: m3uUrl)
- try? m3uContent.write(to: m3uUrl, atomically: true, encoding: .utf8)
+ try? m3uContent.writeWithCompletePath(to: m3uUrl)
return m3uUrl
}
@@ -320,18 +254,29 @@ class MultiDiscBuilderViewController: BaseViewController {
}
}
FilesImporter.importFiles(urls: urls)
+ hasAddToLibrary = true
} else {
UIView.makeToast(message: R.string.localizable.generateM3uFailed())
}
}
private func createLayout() -> UICollectionViewLayout {
- let layout = UICollectionViewCompositionalLayout { sectionIndex, env in
+ let layout = UICollectionViewCompositionalLayout { [weak self] sectionIndex, env in
+ guard let self else { return nil }
//item布局
let item = NSCollectionLayoutItem(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .fractionalHeight(1)))
//group布局
- let group = NSCollectionLayoutGroup.horizontal(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: sectionIndex == 0 ? .estimated(100) : .absolute(MultiDiscItemCollectionCell.CellHeight(itemCount: self.datas[sectionIndex-1].files.count))), subitems: [item])
+ let height: NSCollectionLayoutDimension
+ if sectionIndex == 0 {
+ height = .estimated(100)
+ } else if sectionIndex == self.datas.count + 1 {
+ height = .estimated(Constants.Size.ItemHeightMax)
+ } else {
+ height = .absolute(MultiDiscItemCollectionCell.CellHeight(itemCount: self.datas[sectionIndex-1].files.count))
+ }
+
+ let group = NSCollectionLayoutGroup.horizontal(layoutSize: NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: height), subitems: [item])
group.contentInsets = NSDirectionalEdgeInsets(top: 0,
leading: Constants.Size.ContentSpaceMid,
bottom: 0,
@@ -348,7 +293,7 @@ class MultiDiscBuilderViewController: BaseViewController {
extension MultiDiscBuilderViewController: UICollectionViewDataSource {
func numberOfSections(in collectionView: UICollectionView) -> Int {
- return 1 + datas.count
+ return 1 + datas.count + 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
@@ -359,6 +304,11 @@ extension MultiDiscBuilderViewController: UICollectionViewDataSource {
if indexPath.section == 0 {
let cell = collectionView.dequeueReusableCell(withClass: MultiDiscDescCollectionCell.self, for: indexPath)
return cell
+ } else if indexPath.section == datas.count + 1 {
+ //添加文件按钮
+ let cell = collectionView.dequeueReusableCell(withClass: MultiDiscAddCollectionCell.self, for: indexPath)
+ cell.titleLabel.text = addItemText
+ return cell
} else {
let cell = collectionView.dequeueReusableCell(withClass: MultiDiscItemCollectionCell.self, for: indexPath)
cell.setData(index: indexPath.section, item: datas[indexPath.section-1])
@@ -367,7 +317,7 @@ extension MultiDiscBuilderViewController: UICollectionViewDataSource {
self.datas.remove(at: indexPath.section-1)
self.collectionView.reloadData()
if self.datas.count == 0 {
- self.addFileButton.titleLabel.text = R.string.localizable.multiDiscAddFile("ROM")
+ self.addItemText = R.string.localizable.multiDiscAddFile("ROM")
}
}
return cell
@@ -377,12 +327,92 @@ extension MultiDiscBuilderViewController: UICollectionViewDataSource {
}
extension MultiDiscBuilderViewController: UICollectionViewDelegate {
+ func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool {
+ return indexPath.section == datas.count + 1
+ }
+ func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+ if indexPath.section == datas.count + 1 {
+ let supportedType: [UTType]
+ if let cue = UTType(filenameExtension: "cue"), let bin = UTType(filenameExtension: "bin"), let chd = UTType(filenameExtension: "chd"), let cdi = UTType(filenameExtension: "cdi") {
+ switch self.fileType {
+ case .undetermined:
+ supportedType = [cue, bin, chd, cdi]
+ case .cue:
+ supportedType = [cue, bin]
+ case .chd:
+ supportedType = [chd]
+ case .cdi:
+ supportedType = [cdi]
+ }
+ FilesImporter.shared.presentImportController(supportedTypes: supportedType) { [weak self] urls in
+ guard let self else { return }
+ let isCue = urls.contains(where: { $0.url?.pathExtension.lowercased() == "cue" })
+ let isChd = urls.contains(where: { $0.url?.pathExtension.lowercased() == "chd" })
+ let isCdi = urls.contains(where: { $0.url?.pathExtension.lowercased() == "cdi" })
+ if (isCue || urls.contains(where: { $0.url?.pathExtension.lowercased() == "bin" })) && (isChd || isCdi) {
+ UIView.makeToast(message: R.string.localizable.multiDiscImportErrorConflict())
+ return
+ }
+ let urls = urls.sorted(by: { $0.path < $1.path })
+ if isCue {
+ let (_, errors, cueItems) = FilesImporter.handleMultiFiles(urls: urls)
+ if errors.count > 0 {
+ UIView.makeAlert(detail: errors.reduce("", { $0 + $1.localizedDescription + "\n"}))
+ }
+ var cues = [CUE]()
+ if cueItems.count > 0 {
+ for item in cueItems {
+ let tempCueUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(item.url.lastPathComponent))
+ try? FileManager.safeCopyItem(at: item.url, to: tempCueUrl)
+ var bins = [URL]()
+ for binUrl in item.files {
+ let tempBinUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(binUrl.lastPathComponent))
+ try? FileManager.safeCopyItem(at: binUrl, to: tempBinUrl, shouldReplace: true)
+ bins.append(tempBinUrl)
+ }
+ cues.append(CUE(url: tempCueUrl, files: bins))
+ }
+ self.addItemText = R.string.localizable.multiDiscAddFile(".cue .bin")
+ self.datas.append(contentsOf: cues)
+ self.collectionView.reloadData()
+ }
+ } else if isChd {
+ var chds = [CHD]()
+ for url in urls {
+ let tempChdUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(url.lastPathComponent))
+ try? FileManager.safeCopyItem(at: url, to: tempChdUrl, shouldReplace: true)
+ chds.append(CHD(url: tempChdUrl, files: []))
+ }
+ self.datas.append(contentsOf: chds)
+ self.addItemText = R.string.localizable.multiDiscAddFile(".chd")
+ self.collectionView.reloadData()
+ } else if isCdi {
+ var cdis = [CDI]()
+ for url in urls {
+ let tempChdUrl = URL(fileURLWithPath: Constants.Path.Temp.appendingPathComponent(url.lastPathComponent))
+ try? FileManager.safeCopyItem(at: url, to: tempChdUrl, shouldReplace: true)
+ cdis.append(CDI(url: tempChdUrl, files: []))
+ }
+ self.datas.append(contentsOf: cdis)
+ self.addItemText = R.string.localizable.multiDiscAddFile(".cdi")
+ self.collectionView.reloadData()
+ } else {
+ UIView.makeToast(message: R.string.localizable.multiDiscImportErrorMissing())
+ }
+ }
+ }
+ }
+ }
}
extension MultiDiscBuilderViewController: UICollectionViewDragDelegate, UICollectionViewDropDelegate {
+ func enableDragAndDrop(indexPath: IndexPath) -> Bool {
+ return indexPath.section > 0 && indexPath.section < datas.count + 1
+ }
+
func collectionView(_ collectionView: UICollectionView, itemsForBeginning session: any UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
- guard indexPath.section > 0 else { return [] }
+ guard enableDragAndDrop(indexPath: indexPath) else { return [] }
let item = datas[indexPath.section-1]
let itemProvider = NSItemProvider(object: item.url.path as NSString)
let dragItem = UIDragItem(itemProvider: itemProvider)
@@ -393,11 +423,11 @@ extension MultiDiscBuilderViewController: UICollectionViewDragDelegate, UICollec
func collectionView(_ collectionView: UICollectionView,
performDropWith coordinator: UICollectionViewDropCoordinator) {
guard let destinationIndexPath = coordinator.destinationIndexPath,
- destinationIndexPath.section > 0 else { return }
+ enableDragAndDrop(indexPath: destinationIndexPath) else { return }
coordinator.items.forEach { dropItem in
guard let sourceIndexPath = dropItem.sourceIndexPath,
- sourceIndexPath.section > 0 else { return }
+ enableDragAndDrop(indexPath: sourceIndexPath) else { return }
datas.swapAt(sourceIndexPath.section-1, destinationIndexPath.section-1)
collectionView.reloadSections([sourceIndexPath.section, destinationIndexPath.section])
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Views/AddImportServiceView.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Views/AddImportServiceView.swift
index 0962a454..7550eae7 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/Views/AddImportServiceView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Views/AddImportServiceView.swift
@@ -13,8 +13,8 @@ import RealmSwift
class AddImportServiceView: BaseView {
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur(blurColor: UIColor(.dm, light: .white, dark: .black))
return view
}()
@@ -69,14 +69,15 @@ class AddImportServiceView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ContentInsetTop + Constants.Size.ItemHeightMid)
}
let cloudIcon = UIImageView(image: UIImage(symbol: .cloudFill))
- topBlurView.addSubview(cloudIcon)
+ navigationBlurView.addSubview(cloudIcon)
cloudIcon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -86,7 +87,7 @@ class AddImportServiceView: BaseView {
headerTitleLabel.text = R.string.localizable.addImportServiceHeaderTitle()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(cloudIcon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceMax)
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Views/DownloadManageView.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Views/DownloadManageView.swift
index ffbf6798..351ed141 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/Views/DownloadManageView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Views/DownloadManageView.swift
@@ -12,8 +12,8 @@ import Tiercel
class DownloadManageView: BaseView {
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -47,14 +47,15 @@ class DownloadManageView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .arrowDownCircle))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -64,7 +65,7 @@ class DownloadManageView: BaseView {
headerTitleLabel.text = R.string.localizable.cloudDriveBrowserDownload()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
@@ -72,7 +73,7 @@ class DownloadManageView: BaseView {
let closeButton = SymbolButton(image: UIImage(symbol: .xmark, font: Constants.Font.body(weight: .bold)), enableGlass: true)
closeButton.enableRoundCorner = true
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.addTapGesture { [weak self] gesture in
self?.didTapClose?()
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift
index 12bc386d..af39a258 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Views/ImportServiceListView.swift
@@ -12,8 +12,8 @@ import RealmSwift
class ImportServiceListView: BaseView {
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -33,7 +33,7 @@ class ImportServiceListView: BaseView {
}))
actions.append((UIAction(title: R.string.localizable.fetchGamesFromMeloNX(), image: UIImage(symbol: .gamecontroller)) { [weak self] _ in
guard let self = self else { return }
- MelonNXKit.fetchGames()
+ MeloNXKit.fetchGames()
}))
let view = ContextMenuButton(image: nil, menu: UIMenu(children: actions))
return view
@@ -131,9 +131,10 @@ class ImportServiceListView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
if UIDevice.isPhone, UIDevice.isLandscape {
make.height.equalTo(Constants.Size.ItemHeightMid)
} else {
@@ -142,7 +143,7 @@ class ImportServiceListView: BaseView {
}
let navigationContainer = UIView()
- topBlurView.addSubview(navigationContainer)
+ navigationBlurView.addSubview(navigationContainer)
navigationContainer.snp.makeConstraints { make in
make.leading.bottom.trailing.equalToSuperview()
make.height.equalTo(Constants.Size.ItemHeightMid)
@@ -176,7 +177,7 @@ class ImportServiceListView: BaseView {
func updateViews() {
if UIDevice.isPhone {
- topBlurView.snp.updateConstraints { make in
+ navigationBlurView.snp.updateConstraints { make in
if UIDevice.isLandscape {
make.height.equalTo(Constants.Size.ItemHeightMid)
} else {
@@ -372,15 +373,27 @@ extension ImportServiceListView: UICollectionViewDelegate {
topViewController()?.present(MultiDiscBuilderViewController(), animated: true)
case .romPatcher:
//RomPatcher
- topViewController()?.present(WebViewController(url: Constants.URLs.RomPatcher), animated: true)
+ topViewController()?.present(RomPatcherViewController(), animated: true)
}
}
- //长按弹出可交互菜单
+ //长按弹出可交互菜单 (iOS 15兼容)
+ func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //长按弹出可交互菜单 (iOS 16+)
+ @available(iOS 16.0, *)
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemsAt indexPaths: [IndexPath], point: CGPoint) -> UIContextMenuConfiguration? {
- guard let indexPath = indexPaths.first, indexPath.section == 1 else { return nil }
+ guard let indexPath = indexPaths.first else { return nil }
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //统一的上下文菜单配置逻辑
+ private func contextMenuConfiguration(for collectionView: UICollectionView, at indexPath: IndexPath) -> UIContextMenuConfiguration? {
+ guard indexPath.section == 1 else { return nil }
let service = services[indexPath.row]
- guard service.type != .wifi && service.type != .paste else { return nil }
+ guard service.type != .wifi && service.type != .paste && service.type != .multiDisc && service.type != .romPatcher else { return nil }
return UIContextMenuConfiguration(actionProvider: { _ in
UIMenu(children: [UIAction(title: R.string.localizable.importServiceDelete(), image: UIImage(systemSymbol: .trash), attributes: .destructive, handler: { _ in
ImportService.change { realm in
diff --git a/ManicEmu/ManicEmu/Sources/Business/Import/Views/MultiDiscAddCollectionCell.swift b/ManicEmu/ManicEmu/Sources/Business/Import/Views/MultiDiscAddCollectionCell.swift
new file mode 100644
index 00000000..2e25f61c
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Import/Views/MultiDiscAddCollectionCell.swift
@@ -0,0 +1,50 @@
+//
+// MultiDiscAddCollectionCell.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/21.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+class MultiDiscAddCollectionCell: UICollectionViewCell {
+
+ var titleLabel: UILabel = {
+ let view = UILabel()
+ view.font = Constants.Font.body(size: .l, weight: .semibold)
+ view.textColor = Constants.Color.LabelPrimary
+ return view
+ }()
+
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ enableInteractive = true
+ delayInteractiveTouchEnd = true
+ layerCornerRadius = Constants.Size.CornerRadiusMax
+ backgroundColor = Constants.Color.BackgroundPrimary
+
+ let containerView = UIView()
+ addSubview(containerView)
+ containerView.snp.makeConstraints { make in
+ make.center.equalToSuperview()
+ }
+
+ let icon = IconView()
+ icon.image = UIImage(systemSymbol: .plusCircleFill).applySymbolConfig(size: 22, weight: .medium, color: Constants.Color.LabelPrimary)
+ containerView.addSubview(icon)
+ icon.snp.makeConstraints { make in
+ make.size.equalTo(24)
+ make.centerY.leading.top.bottom.equalToSuperview()
+ }
+
+ containerView.addSubview(titleLabel)
+ titleLabel.snp.makeConstraints { make in
+ make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceTiny)
+ make.centerY.equalToSuperview()
+ make.trailing.equalToSuperview()
+ }
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift
index e4ce2168..ef1ea29c 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Game.swift
@@ -177,6 +177,21 @@ class Game: Object, ObjectUpdatable {
return URL(fileURLWithPath: Constants.Path.BeetlePSXHW.appendingPathComponent("\(name).srm"))
} else if gameType == .arcade {
return URL(fileURLWithPath: Constants.Path.MAME.appendingPathComponent("\(name).srm"))
+ } else if gameType == .a2600 {
+ return URL(fileURLWithPath: Constants.Path.Stella.appendingPathComponent("\(name).srm"))
+ } else if gameType == .a5200 {
+ return URL(fileURLWithPath: Constants.Path.Atari800.appendingPathComponent("\(name).srm"))
+ } else if gameType == .a7800 {
+ return URL(fileURLWithPath: Constants.Path.ProSystem.appendingPathComponent("\(name).srm"))
+ } else if gameType == .jaguar {
+ let srmPath = Constants.Path.Holani.appendingPathComponent("\(name).srm")
+ if FileManager.default.fileExists(atPath: srmPath) {
+ return URL(fileURLWithPath: srmPath)
+ } else {
+ return URL(fileURLWithPath: Constants.Path.Holani.appendingPathComponent("\(name).cdrom.srm"))
+ }
+ } else if gameType == .lynx {
+ return URL(fileURLWithPath: Constants.Path.Holani.appendingPathComponent("\(name).srm"))
}
let localUrl = URL(fileURLWithPath: Constants.Path.Data.appendingPathComponent("\(name).\(gameType.manicEmuCore?.gameSaveExtension ?? "")"))
@@ -194,11 +209,8 @@ class Game: Object, ObjectUpdatable {
}
var gameCodeForPSP: String? {
- if gameType == .psp,
- let extras,
- let extraInfos = try? extras.jsonObject() as? [String: Any],
- let gameTitle = extraInfos["PSPGameCode"] as? String {
- return gameTitle
+ if gameType == .psp {
+ return getExtraString(key: ExtraKey.PSPGameCode.rawValue)
} else {
return nil
}
@@ -230,12 +242,7 @@ class Game: Object, ObjectUpdatable {
func isBIOSMissing(required: Bool = true) -> Bool {
let requireBIOS: [BIOSItem]
if gameType == .mcd {
-#if SIDE_LOAD
requireBIOS = Constants.BIOS.MegaCDBios.filter({ required ? $0.required : true })
-#else
- //AppStore不需要检查MCD的BIOS
- return false
-#endif
} else if gameType == .ss {
if defaultCore == 0 {
requireBIOS = Array(Constants.BIOS.SaturnBios[1...2]).filter({ required ? $0.required : true })
@@ -359,7 +366,11 @@ class Game: Object, ObjectUpdatable {
}
}
} else if gameType == .ds {
- return Bundle.main.path(forResource: "melondsds.libretro", ofType: "framework", inDirectory: "Frameworks")
+ if defaultCore == 0 {
+ return Bundle.main.path(forResource: "melondsds.libretro", ofType: "framework", inDirectory: "Frameworks")
+ } else {
+ return Bundle.main.path(forResource: "desmume.libretro", ofType: "framework", inDirectory: "Frameworks")
+ }
} else if gameType == .arcade {
if defaultCore == 0 {
return Bundle.main.path(forResource: "mame.libretro", ofType: "framework", inDirectory: "Frameworks")
@@ -368,14 +379,31 @@ class Game: Object, ObjectUpdatable {
}
} else if gameType == ._3ds, defaultCore == 1 {
return Bundle.main.path(forResource: "azahar.libretro", ofType: "framework", inDirectory: "Frameworks")
+ } else if gameType == .a2600 {
+ return Bundle.main.path(forResource: "stella.libretro", ofType: "framework", inDirectory: "Frameworks")
+ } else if gameType == .a5200 {
+ return Bundle.main.path(forResource: "atari800.libretro", ofType: "framework", inDirectory: "Frameworks")
+ } else if gameType == .a7800 {
+ return Bundle.main.path(forResource: "prosystem.libretro", ofType: "framework", inDirectory: "Frameworks")
+ } else if gameType == .jaguar {
+ return Bundle.main.path(forResource: "virtualjaguar.libretro", ofType: "framework", inDirectory: "Frameworks")
+ } else if gameType == .lynx {
+ return Bundle.main.path(forResource: "holani.libretro", ofType: "framework", inDirectory: "Frameworks")
}
return nil
}
var isPicodriveCore: Bool {
- if gameType == ._32x || gameType == .mcd {
+#if SIDE_LOAD
+ if (gameType == ._32x || gameType == .mcd) && defaultCore == 0 {
return true
}
+#else
+ if gameType == ._32x || gameType == .mcd {
+ return false
+ }
+#endif
+
if (gameType == .md || gameType == .sg1000 || gameType == .gg || gameType == .ms) && defaultCore == 1 {
return true
}
@@ -436,7 +464,7 @@ class Game: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
@@ -472,6 +500,9 @@ class Game: Object, ObjectUpdatable {
if gameType == .arcade, defaultCore == 0 {
return false
}
+ if isJGenesisCore {
+ return false
+ }
return true
}
@@ -629,6 +660,9 @@ class Game: Object, ObjectUpdatable {
if gameType == ._3ds, defaultCore == 0 {
return false
}
+ if (gameType == ._32x || gameType == .mcd) && defaultCore == 1 {
+ return false
+ }
return true
}
@@ -639,6 +673,26 @@ class Game: Object, ObjectUpdatable {
var isAzahar3DS: Bool {
return gameType == ._3ds && defaultCore == 1
}
+
+ var isJGenesisCore: Bool {
+#if SIDE_LOAD
+ return ((gameType == ._32x || gameType == .mcd) && defaultCore == 1)
+#else
+ return gameType == ._32x || gameType == .mcd
+#endif
+
+ }
+
+ var coreNameForMultiSupport: String {
+ if gameType.supportCores.count > 0, defaultCore < gameType.supportCores.count {
+ return "(\(gameType.supportCores[defaultCore]))"
+ }
+ return ""
+ }
+
+ var isAtari: Bool {
+ return gameType == .a2600 || gameType == .a5200 || gameType == .a7800 || gameType == .jaguar || gameType == .lynx
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameCheat.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameCheat.swift
index a5b2b88d..c2e4e8ca 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameCheat.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameCheat.swift
@@ -12,6 +12,24 @@ import IceCream
extension GameCheat: CKRecordConvertible & CKRecordRecoverable {}
+enum GameCheatSortType: Int, CaseIterable {
+ case dateAscending, dateDescending, nameAscending, nameDescending, status
+ var title: String {
+ switch self {
+ case .dateAscending:
+ R.string.localizable.gameSortAddTime() + R.string.localizable.ascending()
+ case .dateDescending:
+ R.string.localizable.gameSortAddTime() + R.string.localizable.descending()
+ case .nameAscending:
+ R.string.localizable.gameSortTitleType() + R.string.localizable.ascending()
+ case .nameDescending:
+ R.string.localizable.gameSortTitleType() + R.string.localizable.descending()
+ case .status:
+ R.string.localizable.cheatCodeStatus()
+ }
+ }
+}
+
class GameCheat: Object, ObjectUpdatable {
///主键 由创建时间戳ms来生成
@Persisted(primaryKey: true) var id: Int = PersistedKit.incrementID
@@ -35,7 +53,7 @@ class GameCheat: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSaveState.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSaveState.swift
index cafd270c..242497ff 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSaveState.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSaveState.swift
@@ -56,7 +56,7 @@ class GameSaveState: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSetting.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSetting.swift
index 8a74a1ac..9e042ae4 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSetting.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/GameSetting.swift
@@ -656,6 +656,19 @@ struct GameSetting: SettingCellItem {
}
switch gameType {
+ case .a2600, .a5200, .a7800, .lynx, .jaguar:
+ if gameType == .a5200, type == .retro {
+ return false
+ }
+
+ if gameType == .jaguar && (type == .saveState || type == .quickLoadState || type == .stateList) {
+ return false
+ }
+
+ if type == .cheatCode || type == .swapScreen || type == .resolution || type == .consoleHome || type == .amiibo || type == .simBlowing || type == .palette || type == .swapDisk || type == .airPlayLayout || type == .toggleAnalog {
+ return false
+ }
+ return true
case ._3ds:
if defaultCore == 0 {
if type == .fastForward || type == .filter || type == .palette || type == .swapDisk || type == .retro || type == .airPlayScaling {
@@ -668,7 +681,7 @@ struct GameSetting: SettingCellItem {
}
return true
case .ds:
- if type == .resolution || type == .consoleHome || type == .amiibo || type == .palette || type == .swapDisk {
+ if (type == .resolution && defaultCore == 0) || type == .consoleHome || type == .amiibo || type == .palette || type == .swapDisk {
return false
}
return true
@@ -677,6 +690,19 @@ struct GameSetting: SettingCellItem {
return true
}
+ if gameType == ._32x || gameType == .mcd {
+ let notEnableForJGenesis = (type == .cheatCode || type == .filter || type == .retro || type == .swapDisk)
+#if SIDE_LOAD
+ if defaultCore == 1 && notEnableForJGenesis {
+ return false
+ }
+#else
+ if notEnableForJGenesis {
+ return false
+ }
+#endif
+ }
+
if (gameType == .mcd || gameType == .ss || gameType == .fds) && type == .swapDisk {
return true
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift
index 8af90b6d..c4b14622 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Models/Skin.swift
@@ -61,7 +61,7 @@ class Skin: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
index 814ea553..af362dff 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/VIewControllers/PlayViewController.swift
@@ -63,6 +63,8 @@ class PlayViewController: GameViewController {
guard Settings.defalut.autoSaveState, let self = self else { return }
if self.manicGame.isLibretroType {
self.saveStateForLibretro(type: .autoSaveState)
+ } else if self.manicGame.isJGenesisCore {
+ self.saveStateForJGenesis(type: .autoSaveState)
}
}
}
@@ -82,10 +84,17 @@ class PlayViewController: GameViewController {
static weak var currentPlayViewController: PlayViewController? = nil
//屏幕上的功能按钮容器
private var functionButtonContainer = FunctionButtonContainerView()
- //除了delta之外的渲染视图
+ //渲染视图
private var gameMetalView: UIView? = nil
//3DS核心
private var threeDSCore: ThreeDSEmulatorBridge? = nil
+ //JGenesis核心
+ private var jGenesisCore: JGenesisView? {
+ if manicGame.isJGenesisCore {
+ return gameMetalView as? JGenesisView
+ }
+ return nil
+ }
//监听静音键变化
private lazy var muteSwitchMonitor = DLTAMuteSwitchMonitor()
//kvo监听
@@ -104,6 +113,10 @@ class PlayViewController: GameViewController {
private var challengeAchievements: [CheevosAchievement] = []
///TriggerProView
private var triggerProView: TriggerProView?
+ ///背景图片
+ private var backgroundImageView: UIImageView? = nil
+ private var background: FlexBackground? = nil
+ private var backgroundType: FlexBackground.BackgroundType? = nil
deinit {
Log.debug("\(String(describing: Self.self)) deinit")
@@ -191,20 +204,17 @@ class PlayViewController: GameViewController {
///是否是首次设置GB的调色盘
private var isFirstTimeSetGBPalette = true;
+ private var aiplayScaledDimensions: CGSize = .zero
+
+ //皮肤中的Switch绑定数据
+ private var skinSwitchBindDatas = [String: Bool]()
+
static func startGame(game: Game, saveState: GameSaveState? = nil) {
if game.gameType == .ns {
- MelonNXKit.startGame(id: game.id)
+ MeloNXKit.startGame(id: game.id)
return
}
-#if !SIDE_LOAD
- //AppStore版本禁用MCD和32X
- if game.gameType == .mcd || game.gameType == ._32x {
- UIView.makeAlert(detail: R.string.localizable.gameTypeLicensingError(game.gameType.localizedShortName), cancelTitle: R.string.localizable.confirmTitle())
- return
- }
-#endif
-
if game.isRomExtsts || game.isNDSHomeMenuGame {
UIView.hideLoadingToast(forceHide: true)
func showPlayView() {
@@ -216,7 +226,7 @@ class PlayViewController: GameViewController {
if game.gameType == .unknown {
PlatformSelectionView.show(game: game)
return
- }
+ }
func launchGameByDismissOtherVC() {
//游戏控制器和rootVC之间存在控制器则会导致游戏卡顿异常 估计是iOS的bug,导致了Main Run Loop调度异常
if game.isLibretroType {
@@ -255,6 +265,8 @@ class PlayViewController: GameViewController {
} else {
launchGameByDismissOtherVC()
}
+ } else if game.isJGenesisCore, game.gameType == .mcd, game.fileExtension.lowercased() != "chd" {
+ UIView.makeToast(message: R.string.localizable.jGenesisAlert())
} else {
launchGameByDismissOtherVC()
}
@@ -407,7 +419,7 @@ class PlayViewController: GameViewController {
//监听WFC连接
wfcConnectNotification = NotificationCenter.default.addObserver(forName: Notification.Name(rawValue: "DidConnectToWFCNotification"), object: nil, queue: .main) { [weak self] notification in
guard let self else { return }
-// //在线游戏 禁用加速 禁用金手指
+ // //在线游戏 禁用加速 禁用金手指
UIView.makeToast(message: R.string.localizable.wfcConnectDesc())
self.isWFCConnect = true
self.updateFastforward(speed: .one)
@@ -495,8 +507,8 @@ class PlayViewController: GameViewController {
} else {
//获得成就
self.showRetroAchievements(badgeUrl: achievement.unlockedBadgeUrl,
- title: R.string.localizable.achievementUnlocked(),
- message: achievement.title) { [weak self] in
+ title: R.string.localizable.achievementUnlocked(),
+ message: achievement.title) { [weak self] in
guard let self else { return }
//尝试读取缓存中的解锁进度
if achievement.measuredProgress == nil,
@@ -520,7 +532,7 @@ class PlayViewController: GameViewController {
self.showRetroAchievements(badgeUrl: summary.badgeUrl,
title: summary.title ?? R.string.localizable.achievementsGo() + " (\(self.isHardcoreMode ? R.string.localizable.hardcore() : R.string.localizable.softcore()))",
message: R.string.localizable.achievementsSummary(summary.unlockedAchievementsNum, summary.coreAchievementsNum),
- hideIcon: true);
+ hideIcon: true);
} else if let _ = notification.object as? CheevosCompletion {
//解锁完成
var message: String = ""
@@ -553,7 +565,7 @@ class PlayViewController: GameViewController {
leaderboard.image = UIImage.tryDataImageOrPlaceholder(tryData: data, preferenceSize: .init(40))
}
self.leaderboards.append(leaderboard)
-
+
} else if let message = notification.object as? String {
UIView.makeToast(message: message)
}
@@ -635,8 +647,8 @@ class PlayViewController: GameViewController {
if property.name == "volume" || property.name == "haptic" {
let settings = Settings.defalut
if let controllerSkin = controllerView.controllerSkin,
- let skin = Database.realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier }),
- skin.skinType == .default,
+ let skin = Database.realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier }),
+ skin.skinType == .default,
settings.displayGamesFunctionCount > 0 {
if property.name == "volume", settings.gameFunctionList.prefix(settings.displayGamesFunctionCount).contains(where: { $0 == GameSetting.ItemType.volume.rawValue }) {
self.updateFunctionButton()
@@ -730,13 +742,15 @@ class PlayViewController: GameViewController {
super.viewDidDisappear(animated)
repeatTimer.suspend()
//清理AirPlay画面
- if let airPlayViewController = ExternalSceneDelegate.airPlayViewController, let airPlayGameView = airPlayViewController.libretroView, manicGame.isLibretroType {
- airPlayGameView.parentViewController?.removeFromParent()
- airPlayGameView.removeFromSuperview()
- airPlayViewController.libretroView = nil
+ if let airPlayViewController = ExternalSceneDelegate.airPlayViewController, let airPlayGameView = airPlayViewController.libretroView {
+ if manicGame.isLibretroType || manicGame.isJGenesisCore {
+ airPlayGameView.parentViewController?.removeFromParent()
+ airPlayGameView.removeFromSuperview()
+ airPlayViewController.libretroView = nil
+ }
}
- #if !SIDE_LOAD
+#if !SIDE_LOAD
if manicGame.totalPlayDuration > 30 * 60 * 1000 { //玩超过30分钟 尝试弹起评价
if let scene = ApplicationSceneDelegate.applicationScene {
if let showDate = UserDefaults.standard.date(forKey: Constants.DefaultKey.ShowRequestReviewDate), showDate.isInToday {
@@ -747,7 +761,7 @@ class PlayViewController: GameViewController {
}
}
}
- #endif
+#endif
if manicGame.isCitra3DS {
threeDSCore?.destory()
@@ -763,7 +777,7 @@ class PlayViewController: GameViewController {
//通知游戏列表更新
if let gameSortType = GameSortType(rawValue: Theme.defalut.getExtraInt(key: ExtraKey.gameSortType.rawValue) ?? 0),
- (gameSortType == .latestPlayed || gameSortType == .playTime) {
+ (gameSortType == .latestPlayed || gameSortType == .playTime) {
NotificationCenter.default.post(name: Constants.NotificationName.GameSortChange, object: nil)
}
//Libretro已经停止,不要在这里进行注销事项,应该在stop()函数中完成
@@ -796,7 +810,7 @@ class PlayViewController: GameViewController {
UIView.hideAllAlert()
super.viewWillTransition(to: size, with: coordinator)
guard UIApplication.shared.applicationState != .background else { return }
-
+
coordinator.animate(alongsideTransition: { [weak self] (context) in
guard let self = self else { return }
self.updateSkin()
@@ -816,189 +830,7 @@ class PlayViewController: GameViewController {
override func gameController(_ gameController: any GameController, didActivate input: any Input, value: Double) {
super.gameController(gameController, didActivate: input, value: value)
- //点击menu弹出菜单
- if input.stringValue == "menu" {
- if GameSettingView.isShow {
- UIView.hideAllAlert { [weak self] in
- self?.resumeEmulationAndHandleAudio()
- }
- } else {
- pauseEmulation()
- if manicGame.supportSwapDisc {
- manicGame.totalDiskCount = LibretroCore.sharedInstance().getDiskCount()
- manicGame.currentDiskIndex = LibretroCore.sharedInstance().getCurrentDiskIndex()
- }
- GameSettingView.show(game: manicGame,
- didSelectItem: { [weak self] item, sheet in
- //点击菜单选项
- guard let self = self else { return true }
- return self.handleMenuGameSetting(item, sheet)
- }, hideCompletion: { [weak self] in
- //隐藏菜单回调
- guard let self = self else { return }
- self.resumeEmulationAndHandleAudio()
- })
- }
- } else if input.stringValue == "flex" {
- //缩放游戏画面
- guard gameViews.count > 0 else {
- UIView.makeToast(message: R.string.localizable.flexSkinSettingError())
- return
- }
-
- pauseEmulation()
-
- func updateFlex(images: [UIImage?]) {
- if let controllerSkin = controllerView.controllerSkin, let traits = controllerView.controllerSkinTraits,
- let skin = Database.realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier }) {
- fixedOrientationConfig()
- let vc = FlexSkinSettingViewController(skin: skin, traits: traits, images: images)
- vc.didCompletion = { [weak self] in
- guard let self = self else { return }
- self.resumeEmulationAndHandleAudio()
- self.setOrientationConfig()
- self.setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
- //更新皮肤
- self.updateSkin()
- //更新声音
- self.updateAudio()
- if !manicGame.isCitra3DS {
- //设置速度
- self.updateFastforward(speed: self.manicGame.speed)
- }
- }
- topViewController()?.present(vc, animated: true)
- }
- }
-
- var images = [UIImage?]()
- if manicGame.isCitra3DS, let snapShots = snapShotFor3DS() {
- images = snapShots
- updateFlex(images: images)
- } else if manicGame.isLibretroType {
- LibretroCore.sharedInstance().snapshot { [weak self] image in
- guard let self else { return }
- if self.manicGame.gameType == .ds || self.manicGame.isAzahar3DS {
- if let image {
- updateFlex(images: self.snapShotForDualScreen(source: image) ?? [])
- } else {
- updateFlex(images: [])
- }
- } else {
- updateFlex(images: [image])
- }
- }
- } else {
- let mainGameView = gameViews.first!
- let secondGameView: GameView? = gameViews.count > 1 ? gameViews[1] : nil
- images.append(mainGameView.snapshot())
- if let secondGameView {
- images.append(secondGameView.snapshot())
- }
- updateFlex(images: images)
- }
- } else if input.stringValue == "quickSave" {
- handleMenuGameSetting(GameSetting(type: .saveState), nil)
- } else if input.stringValue == "quickLoad" {
- handleMenuGameSetting(GameSetting(type: .quickLoadState), nil)
- } else if input.stringValue == "fastForward" ||
- input.stringValue == "fastForward2x" ||
- input.stringValue == "fastForward3x" ||
- input.stringValue == "fastForward4x" {
- if !PurchaseManager.isMember {
- updateFastforward(speed: .two)
- } else {
- if manicGame.speed.rawValue < GameSetting.FastForwardSpeed.five.rawValue {
- let speed: GameSetting.FastForwardSpeed
- if input.stringValue == "fastForward2x" {
- speed = .two
- } else if input.stringValue == "fastForward3x" {
- speed = .three
- } else if input.stringValue == "fastForward4x" {
- speed = .four
- } else {
- speed = .five
- }
- Log.debug("长按速度: \(speed.rawValue)x")
- updateFastforward(speed: speed)
- }
- }
- } else if input.stringValue == "toggleFastForward" {
- handleMenuGameSetting(GameSetting(type: .fastForward, fastForwardSpeed: manicGame.speed.next), nil)
- } else if input.stringValue == "reverseScreens" {
- handleMenuGameSetting(GameSetting(type: .swapScreen), nil)
- } else if input.stringValue == "volume" {
- handleMenuGameSetting(GameSetting(type: .volume, volumeOn: !manicGame.volume), nil)
- } else if input.stringValue == "saveStates" {
- handleMenuGameSetting(GameSetting(type: .stateList), nil)
- } else if input.stringValue == "cheatCodes" {
- handleMenuGameSetting(GameSetting(type: .cheatCode), nil)
- } else if input.stringValue == "skins" {
- handleMenuGameSetting(GameSetting(type: .skins), nil)
- } else if input.stringValue == "filters" {
- handleMenuGameSetting(GameSetting(type: .filter), nil)
- } else if input.stringValue == "screenshot" {
- handleMenuGameSetting(GameSetting(type: .screenShot), nil)
- } else if input.stringValue == "haptics" {
- handleMenuGameSetting(GameSetting(type: .haptic, hapticType: manicGame.haptic.next), nil)
- } else if input.stringValue == "controllers" {
- handleMenuGameSetting(GameSetting(type: .controllerSetting), nil)
- } else if input.stringValue == "orientation" {
- handleMenuGameSetting(GameSetting(type: .orientation, orientation: manicGame.orientation.next), nil)
- } else if input.stringValue == "functionLayout" {
- handleMenuGameSetting(GameSetting(type: .functionSort), nil)
- } else if input.stringValue == "restart" {
- handleMenuGameSetting(GameSetting(type: .reload), nil)
- } else if input.stringValue == "resolution" {
- handleMenuGameSetting(GameSetting(type: .resolution, resolution: manicGame.resolution.next), nil)
- } else if input.stringValue == "quit" {
- UIView.makeAlert(detail: R.string.localizable.quitGameAlert(), confirmTitle: R.string.localizable.confirmTitle(), confirmAction: { [weak self] in
- self?.handleMenuGameSetting(GameSetting(type: .quit), nil)
- })
- } else if input.stringValue == "amiibo" {
- handleMenuGameSetting(GameSetting(type: .amiibo), nil)
- } else if input.stringValue == "homeMenu" {
- handleMenuGameSetting(GameSetting(type: .consoleHome), nil)
- } else if input.stringValue == "airplay" {
- handleMenuGameSetting(GameSetting(type: .airplay), nil)
- } else if input.stringValue == "toggleControlls" {
- handleMenuGameSetting(GameSetting(type: .toggleFullscreen, isFullScreen: !manicGame.forceFullSkin), nil)
- } else if input.stringValue == "blowing" {
- handleMenuGameSetting(GameSetting(type: .simBlowing), nil)
- } else if input.stringValue == "palette" {
- if manicGame.gameType == .nes || manicGame.gameType == .fds {
- handleMenuGameSetting(GameSetting(type: .palette, nesPalette: manicGame.nextNesPalette), nil)
- } else {
- handleMenuGameSetting(GameSetting(type: .palette, palette: manicGame.pallete.next), nil)
- }
- } else if input.stringValue == "swapDisk" {
- if manicGame.gameType == .fds {
- handleMenuGameSetting(GameSetting(type: .swapDisk, currentDiskIndex: 0), nil)
- } else {
- let currentIndex = LibretroCore.sharedInstance().getCurrentDiskIndex()
- let totalCount = LibretroCore.sharedInstance().getDiskCount()
- let nextIndex = currentIndex + 1 < totalCount ? currentIndex + 1 : 0
- handleMenuGameSetting(GameSetting(type: .swapDisk, currentDiskIndex: nextIndex), nil)
- }
- } else if input.stringValue == "toggleAnalog" {
- handleMenuGameSetting(GameSetting(type: .toggleAnalog), nil)
- } else if input.stringValue == "retroAchievements" {
- handleMenuGameSetting(GameSetting(type: .retro), nil)
- } else if input.stringValue == "airPlayScaling" {
- handleMenuGameSetting(GameSetting(type: .retro, airPlayScaling: Settings.defalut.airPlayScaling.next), nil)
- } else if input.stringValue == "airPlayLayout" {
- handleMenuGameSetting(GameSetting(type: .retro, airPlayLayout: Settings.defalut.airPlayLayout.next), nil)
- } else if input.stringValue == "gameplayManuals" {
- handleMenuGameSetting(GameSetting(type: .gameplayManuals), nil)
- } else if input.stringValue == "triggerPro" {
- var id: Int?
- if let currentID = manicGame.getExtraInt(key: ExtraKey.triggerProID.rawValue), currentID != -1 {
- id = Trigger.nextTriggerID(gameType: manicGame.gameType, currentID: currentID)
- } else {
- id = Trigger.nextTriggerID(gameType: manicGame.gameType, currentID: nil)
- }
- handleMenuGameSetting(GameSetting(type: .triggerPro, triggerProID: id), nil)
- }
+ handleGameInput(input.stringValue)
}
override func gameController(_ gameController: any GameController, didDeactivate input: any Input) {
@@ -1023,6 +855,9 @@ class PlayViewController: GameViewController {
} else if manicGame.isLibretroType {
LibretroCore.sharedInstance().pause()
return true
+ } else if manicGame.isJGenesisCore {
+ jGenesisCore?.pause()
+ return true
} else {
return super.pauseEmulation()
}
@@ -1051,7 +886,7 @@ extension PlayViewController {
UIView.makeToast(message: R.string.localizable.saveStateTooFrequent(), identifier: "saveStateTooFrequent")
return
}
-
+
if let threeDSCore = self.threeDSCore {
let now = Date()
//存档 并获取存档路径
@@ -1142,52 +977,329 @@ extension PlayViewController {
if submitSuccess && type != .autoSaveState {
UIView.makeToast(message: R.string.localizable.gameSaveStateSuccess(), identifier: "gameSaveStateSuccess")
}
- }
- }
-
- private func quickLoadStateFor3DS(_ state: GameSaveState?) {
- let now = Date.now
- if let lastLoadDate = lastLoadDate, now.timeIntervalSince1970ms - lastLoadDate.timeIntervalSince1970ms < 5000 {
- UIView.makeToast(message: R.string.localizable.loadStateTooFrequent(), identifier: "loadStateTooFrequent")
- return
- }
- //如果传入即时存档就尝试去加载 如果没有传入则选最新的手动即时存档进行读取
- if let state = state ?? manicGame.gameSaveStates.last(where: { $0.type == .manualSaveState }),
- let threeDSCore = self.threeDSCore,
- let slot = UInt32(state.name.deletingPathExtension.pathExtension) {
- //现将存档移到模拟器工作目录
- if let fileUrl = state.stateData?.filePath {
- threeDSCore.addSaveState(fileUrl: fileUrl, slot: slot)
+ }
+ }
+
+ private func saveStateForJGenesis(type: GameSaveStateType) {
+ let now = Date.now
+ if type == .manualSaveState, let lastSaveDate = lastSaveDate, now.timeIntervalSince1970ms - lastSaveDate.timeIntervalSince1970ms < 3000 {
+ UIView.makeToast(message: R.string.localizable.saveStateTooFrequent(), identifier: "saveStateTooFrequent")
+ return
+ }
+
+ let image = jGenesisCore?.snapShot()
+ jGenesisCore?.saveState { [weak self] data in
+ guard let self else { return }
+ if let data {
+ let now = Date.now
+ let state = GameSaveState()
+ state.name = "\(now.string(withFormat: Constants.Strings.FileNameTimeFormat))_" + self.manicGame.fileName
+ state.type = type
+ state.date = now
+ if let imageData = image?.scaled(toHeight: 150)?.jpegData(compressionQuality: 0.7) {
+ state.stateCover = CreamAsset.create(objectID: state.name, propName: "stateCover", data: imageData)
+ }
+
+ state.stateData = CreamAsset.create(objectID: state.name, propName: "stateData", data: data)
+ let autoSaveStates = self.manicGame.gameSaveStates.where({ $0.type == .autoSaveState }).sorted(by: \GameSaveState.date)
+ Game.change { realm in
+ //自动保存的数量最多只能保存AutoSaveGameCount个
+ if autoSaveStates.count >= Constants.Numbers.AutoSaveGameCount {
+ let needToDeletes = autoSaveStates.prefix(autoSaveStates.count - Constants.Numbers.AutoSaveGameCount + 1)
+ CreamAsset.batchDeleteAndClean(assets: needToDeletes.compactMap({ $0.stateCover }), realm: realm)
+ CreamAsset.batchDeleteAndClean(assets: needToDeletes.compactMap({ $0.stateData }), realm: realm)
+ if Settings.defalut.iCloudSyncEnable {
+ needToDeletes.forEach { $0.isDeleted = true }
+ } else {
+ realm.delete(needToDeletes)
+ }
+ }
+ self.manicGame.gameSaveStates.append(state)
+ }
+ state.updateExtra(key: ExtraKey.saveStateCore.rawValue, value: self.manicGame.defaultCore)
+ if type == .manualSaveState {
+ self.lastSaveDate = Date.now
+ }
+ Log.debug("保存即时存档")
+ if type != .autoSaveState {
+ UIView.makeToast(message: R.string.localizable.gameSaveStateSuccess(), identifier: "gameSaveStateSuccess")
+ }
+ }
+ }
+ }
+
+ private func quickLoadStateForCitra3DS(_ state: GameSaveState?) {
+ let now = Date.now
+ if let lastLoadDate = lastLoadDate, now.timeIntervalSince1970ms - lastLoadDate.timeIntervalSince1970ms < 5000 {
+ UIView.makeToast(message: R.string.localizable.loadStateTooFrequent(), identifier: "loadStateTooFrequent")
+ return
+ }
+ //如果传入即时存档就尝试去加载 如果没有传入则选最新的手动即时存档进行读取
+ if let state = state ?? manicGame.gameSaveStates.last(where: { $0.type == .manualSaveState }),
+ let threeDSCore = self.threeDSCore,
+ let slot = UInt32(state.name.deletingPathExtension.pathExtension) {
+ //现将存档移到模拟器工作目录
+ if let fileUrl = state.stateData?.filePath {
+ threeDSCore.addSaveState(fileUrl: fileUrl, slot: slot)
+ }
+ threeDSCore.loadState(slot)
+ UIView.makeToast(message: R.string.localizable.gameSaveStateLoadSuccess())
+ lastLoadDate = Date.now
+ updateCheatCodes()
+ } else {
+ UIView.makeToast(message: R.string.localizable.gameSaveStateQuickLoadFailed())
+ }
+ }
+
+ private func quickLoadStateForLibretro(_ state: GameSaveState?) {
+ let now = Date.now
+ if let lastLoadDate = lastLoadDate, now.timeIntervalSince1970ms - lastLoadDate.timeIntervalSince1970ms < 1000 {
+ UIView.makeToast(message: R.string.localizable.loadStateTooFrequent(), identifier: "loadStateTooFrequent")
+ return
+ }
+ //如果传入即时存档就尝试去加载 如果没有传入则选最新的手动即时存档进行读取
+ if let state = state ?? manicGame.gameSaveStates.last(where: { $0.type == .manualSaveState }),
+ let statePath = state.stateData?.filePath.path,
+ LibretroCore.sharedInstance().loadState(statePath) {
+ if manicGame.gameType != .dc, (state.getExtraInt(key: ExtraKey.saveStateCore.rawValue) ?? 0) != manicGame.defaultCore {
+ UIView.makeToast(message: R.string.localizable.latestSaveStateUnCompatible())
+ } else {
+ resumeEmulationAndHandleAudio()
+ UIView.makeToast(message: R.string.localizable.gameSaveStateLoadSuccess())
+ lastLoadDate = Date.now
+ updateCheatCodes()
+ }
+ } else {
+ UIView.makeToast(message: R.string.localizable.gameSaveStateQuickLoadFailed())
+ }
+ }
+
+ private func quickLoadStateForJGenesis(_ state: GameSaveState?) {
+ let now = Date.now
+ if let lastLoadDate = lastLoadDate, now.timeIntervalSince1970ms - lastLoadDate.timeIntervalSince1970ms < 1000 {
+ UIView.makeToast(message: R.string.localizable.loadStateTooFrequent(), identifier: "loadStateTooFrequent")
+ return
+ }
+ //如果传入即时存档就尝试去加载 如果没有传入则选最新的手动即时存档进行读取
+ if let state = state ?? manicGame.gameSaveStates.last(where: { $0.type == .manualSaveState }),
+ let statePath = state.stateData?.filePath.path {
+ jGenesisCore?.loadSaveState(path: statePath) { [weak self] isSuccess in
+ guard let self else { return }
+ if isSuccess {
+ if (state.getExtraInt(key: ExtraKey.saveStateCore.rawValue) ?? 0) != self.manicGame.defaultCore {
+ UIView.makeToast(message: R.string.localizable.latestSaveStateUnCompatible())
+ } else {
+ self.resumeEmulationAndHandleAudio()
+ UIView.makeToast(message: R.string.localizable.gameSaveStateLoadSuccess())
+ self.lastLoadDate = Date.now
+ self.updateCheatCodes()
+ }
+ } else {
+ UIView.makeToast(message: R.string.localizable.gameSaveStateQuickLoadFailed())
+ }
+ }
+
+ }
+ }
+
+ private func handleGameInput(_ inputStringValue: String) {
+ let input = SomeInput(stringValue: inputStringValue, intValue: nil, type: .controller(.controllerSkin))
+ //点击menu弹出菜单
+ if input.stringValue == "menu" {
+ if GameSettingView.isShow {
+ UIView.hideAllAlert { [weak self] in
+ self?.resumeEmulationAndHandleAudio()
+ }
+ } else {
+ pauseEmulation()
+ if manicGame.supportSwapDisc {
+ manicGame.totalDiskCount = LibretroCore.sharedInstance().getDiskCount()
+ manicGame.currentDiskIndex = LibretroCore.sharedInstance().getCurrentDiskIndex()
+ }
+ GameSettingView.show(game: manicGame,
+ didSelectItem: { [weak self] item, sheet in
+ //点击菜单选项
+ guard let self = self else { return true }
+ return self.handleMenuGameSetting(item, sheet)
+ }, hideCompletion: { [weak self] in
+ //隐藏菜单回调
+ guard let self = self else { return }
+ self.resumeEmulationAndHandleAudio()
+ })
+ }
+ } else if input.stringValue == "flex" {
+ //缩放游戏画面
+ guard gameViews.count > 0 else {
+ UIView.makeToast(message: R.string.localizable.flexSkinSettingError())
+ return
+ }
+
+ pauseEmulation()
+
+ func updateFlex(images: [UIImage?]) {
+ if let controllerSkin = controllerView.controllerSkin, let traits = controllerView.controllerSkinTraits,
+ let skin = Database.realm.objects(Skin.self).first(where: { $0.identifier == controllerSkin.identifier }) {
+ fixedOrientationConfig()
+ let vc = FlexSkinSettingViewController(skin: skin,
+ traits: traits,
+ images: images,
+ game: manicGame,
+ background: background,
+ backgroundImage: backgroundImageView?.image,
+ backgroundType: backgroundType)
+ vc.didCompletion = { [weak self] in
+ guard let self = self else { return }
+ self.setOrientationConfig()
+ self.setNeedsUpdateOfScreenEdgesDeferringSystemGestures()
+ //更新皮肤
+ self.updateSkin()
+ //更新声音
+ self.updateAudio()
+ if !self.manicGame.isCitra3DS {
+ //设置速度
+ self.updateFastforward(speed: self.manicGame.speed)
+ }
+ self.resumeEmulationAndHandleAudio()
+ }
+ topViewController()?.present(vc, animated: true)
+ }
+ }
+
+ var images = [UIImage?]()
+ if manicGame.isCitra3DS, let snapShots = snapShotFor3DS() {
+ images = snapShots
+ updateFlex(images: images)
+ } else if manicGame.isLibretroType {
+ LibretroCore.sharedInstance().snapshot { [weak self] image in
+ guard let self else { return }
+ if self.manicGame.gameType == .ds || self.manicGame.isAzahar3DS {
+ if let image {
+ updateFlex(images: self.snapShotForDualScreen(source: image) ?? [])
+ } else {
+ updateFlex(images: [])
+ }
+ } else {
+ updateFlex(images: [image])
+ }
+ }
+ } else if manicGame.isJGenesisCore {
+ updateFlex(images: [jGenesisCore?.snapShot()])
+ } else {
+ let mainGameView = gameViews.first!
+ let secondGameView: GameView? = gameViews.count > 1 ? gameViews[1] : nil
+ images.append(mainGameView.snapshot())
+ if let secondGameView {
+ images.append(secondGameView.snapshot())
+ }
+ updateFlex(images: images)
+ }
+ } else if input.stringValue == "quickSave" {
+ handleMenuGameSetting(GameSetting(type: .saveState), nil)
+ } else if input.stringValue == "quickLoad" {
+ handleMenuGameSetting(GameSetting(type: .quickLoadState), nil)
+ } else if input.stringValue == "fastForward" ||
+ input.stringValue == "fastForward2x" ||
+ input.stringValue == "fastForward3x" ||
+ input.stringValue == "fastForward4x" {
+ if !PurchaseManager.isMember {
+ updateFastforward(speed: .two)
+ } else {
+ if manicGame.speed.rawValue < GameSetting.FastForwardSpeed.five.rawValue {
+ let speed: GameSetting.FastForwardSpeed
+ if input.stringValue == "fastForward2x" {
+ speed = .two
+ } else if input.stringValue == "fastForward3x" {
+ speed = .three
+ } else if input.stringValue == "fastForward4x" {
+ speed = .four
+ } else {
+ speed = .five
+ }
+ Log.debug("长按速度: \(speed.rawValue)x")
+ updateFastforward(speed: speed)
+ }
+ }
+ } else if input.stringValue == "toggleFastForward" {
+ handleMenuGameSetting(GameSetting(type: .fastForward, fastForwardSpeed: manicGame.speed.next), nil)
+ } else if input.stringValue == "reverseScreens" {
+ handleMenuGameSetting(GameSetting(type: .swapScreen), nil)
+ } else if input.stringValue == "volume" {
+ handleMenuGameSetting(GameSetting(type: .volume, volumeOn: !manicGame.volume), nil)
+ } else if input.stringValue == "saveStates" {
+ handleMenuGameSetting(GameSetting(type: .stateList), nil)
+ } else if input.stringValue == "cheatCodes" {
+ handleMenuGameSetting(GameSetting(type: .cheatCode), nil)
+ } else if input.stringValue == "skins" {
+ handleMenuGameSetting(GameSetting(type: .skins), nil)
+ } else if input.stringValue == "filters" {
+ handleMenuGameSetting(GameSetting(type: .filter), nil)
+ } else if input.stringValue == "screenshot" {
+ handleMenuGameSetting(GameSetting(type: .screenShot), nil)
+ } else if input.stringValue == "haptics" {
+ handleMenuGameSetting(GameSetting(type: .haptic, hapticType: manicGame.haptic.next), nil)
+ } else if input.stringValue == "controllers" {
+ handleMenuGameSetting(GameSetting(type: .controllerSetting), nil)
+ } else if input.stringValue == "orientation" {
+ handleMenuGameSetting(GameSetting(type: .orientation, orientation: manicGame.orientation.next), nil)
+ } else if input.stringValue == "functionLayout" {
+ handleMenuGameSetting(GameSetting(type: .functionSort), nil)
+ } else if input.stringValue == "restart" {
+ handleMenuGameSetting(GameSetting(type: .reload), nil)
+ } else if input.stringValue == "resolution" {
+ handleMenuGameSetting(GameSetting(type: .resolution, resolution: manicGame.resolution.next), nil)
+ } else if input.stringValue == "quit" {
+ UIView.makeAlert(detail: R.string.localizable.quitGameAlert(), confirmTitle: R.string.localizable.confirmTitle(), confirmAction: { [weak self] in
+ self?.handleMenuGameSetting(GameSetting(type: .quit), nil)
+ })
+ } else if input.stringValue == "amiibo" {
+ handleMenuGameSetting(GameSetting(type: .amiibo), nil)
+ } else if input.stringValue == "homeMenu" {
+ handleMenuGameSetting(GameSetting(type: .consoleHome), nil)
+ } else if input.stringValue == "airplay" {
+ handleMenuGameSetting(GameSetting(type: .airplay), nil)
+ } else if input.stringValue == "toggleControlls" {
+ handleMenuGameSetting(GameSetting(type: .toggleFullscreen, isFullScreen: !manicGame.forceFullSkin), nil)
+ } else if input.stringValue == "blowing" {
+ handleMenuGameSetting(GameSetting(type: .simBlowing), nil)
+ } else if input.stringValue == "palette" {
+ if manicGame.gameType == .nes || manicGame.gameType == .fds {
+ handleMenuGameSetting(GameSetting(type: .palette, nesPalette: manicGame.nextNesPalette), nil)
+ } else {
+ handleMenuGameSetting(GameSetting(type: .palette, palette: manicGame.pallete.next), nil)
+ }
+ } else if input.stringValue == "swapDisk" {
+ if manicGame.gameType == .fds {
+ handleMenuGameSetting(GameSetting(type: .swapDisk, currentDiskIndex: 0), nil)
+ } else {
+ let currentIndex = LibretroCore.sharedInstance().getCurrentDiskIndex()
+ let totalCount = LibretroCore.sharedInstance().getDiskCount()
+ let nextIndex = currentIndex + 1 < totalCount ? currentIndex + 1 : 0
+ handleMenuGameSetting(GameSetting(type: .swapDisk, currentDiskIndex: nextIndex), nil)
}
- threeDSCore.loadState(slot)
- UIView.makeToast(message: R.string.localizable.gameSaveStateLoadSuccess())
- lastLoadDate = Date.now
- updateCheatCodes()
- } else {
- UIView.makeToast(message: R.string.localizable.gameSaveStateQuickLoadFailed())
- }
- }
-
- private func quickLoadStateForLibretro(_ state: GameSaveState?) {
- let now = Date.now
- if let lastLoadDate = lastLoadDate, now.timeIntervalSince1970ms - lastLoadDate.timeIntervalSince1970ms < 1000 {
- UIView.makeToast(message: R.string.localizable.loadStateTooFrequent(), identifier: "loadStateTooFrequent")
- return
- }
- //如果传入即时存档就尝试去加载 如果没有传入则选最新的手动即时存档进行读取
- if let state = state ?? manicGame.gameSaveStates.last(where: { $0.type == .manualSaveState }),
- let statePath = state.stateData?.filePath.path,
- LibretroCore.sharedInstance().loadState(statePath) {
- if manicGame.gameType != .dc, (state.getExtraInt(key: ExtraKey.saveStateCore.rawValue) ?? 0) != manicGame.defaultCore {
- UIView.makeToast(message: R.string.localizable.latestSaveStateUnCompatible())
+ } else if input.stringValue == "toggleAnalog" {
+ handleMenuGameSetting(GameSetting(type: .toggleAnalog), nil)
+ } else if input.stringValue == "retroAchievements" {
+ handleMenuGameSetting(GameSetting(type: .retro), nil)
+ } else if input.stringValue == "airPlayScaling" {
+ handleMenuGameSetting(GameSetting(type: .retro, airPlayScaling: Settings.defalut.airPlayScaling.next), nil)
+ } else if input.stringValue == "airPlayLayout" {
+ handleMenuGameSetting(GameSetting(type: .retro, airPlayLayout: Settings.defalut.airPlayLayout.next), nil)
+ } else if input.stringValue == "gameplayManuals" {
+ handleMenuGameSetting(GameSetting(type: .gameplayManuals), nil)
+ } else if input.stringValue == "triggerPro" {
+ var id: Int?
+ if let currentID = manicGame.getExtraInt(key: ExtraKey.triggerProID.rawValue), currentID != -1 {
+ id = Trigger.nextTriggerID(gameType: manicGame.gameType, currentID: currentID)
} else {
- resumeEmulationAndHandleAudio()
- UIView.makeToast(message: R.string.localizable.gameSaveStateLoadSuccess())
- lastLoadDate = Date.now
- updateCheatCodes()
+ id = Trigger.nextTriggerID(gameType: manicGame.gameType, currentID: nil)
}
- } else {
- UIView.makeToast(message: R.string.localizable.gameSaveStateQuickLoadFailed())
+ handleMenuGameSetting(GameSetting(type: .triggerPro, triggerProID: id), nil)
+ } else if input.stringValue == "tvType" {
+ update2600TvColor(isInit: false)
+ } else if input.stringValue == "leftDifficulty" {
+ update2600LeftDifficulty(isInit: false)
+ } else if input.stringValue == "rightDifficulty" {
+ update2600RightDifficulty(isInit: false)
}
}
@@ -1202,7 +1314,7 @@ extension PlayViewController {
}
guard item.enable(for: manicGame.gameType, defaultCore: manicGame.defaultCore) else {
- UIView.makeToast(message: R.string.localizable.notSupportGameSetting(manicGame.gameType.localizedShortName))
+ UIView.makeToast(message: R.string.localizable.notSupportGameSetting(manicGame.gameType.localizedShortName + manicGame.coreNameForMultiSupport))
return false
}
switch item.type {
@@ -1237,6 +1349,8 @@ extension PlayViewController {
saveStateFor3DS(type: .manualSaveState)
} else if manicGame.isLibretroType {
saveStateForLibretro(type: .manualSaveState)
+ } else if manicGame.isJGenesisCore {
+ saveStateForJGenesis(type: .manualSaveState)
}
case .quickLoadState:
//MARK: handleMenuGameSetting.quickLoadState
@@ -1250,9 +1364,11 @@ extension PlayViewController {
}
//快速读档
if manicGame.isCitra3DS {
- quickLoadStateFor3DS(item.loadState)
+ quickLoadStateForCitra3DS(item.loadState)
} else if manicGame.isLibretroType {
quickLoadStateForLibretro(item.loadState)
+ } else if manicGame.isJGenesisCore {
+ quickLoadStateForJGenesis(item.loadState)
}
case .volume:
//MARK: handleMenuGameSetting.volume
@@ -1261,6 +1377,7 @@ extension PlayViewController {
Game.change { realm in
manicGame.volume = item.volumeOn
}
+ skinSwitchBindDatas["volume"] = manicGame.volume
prefersVolumeEnable = item.volumeOn
if menuSheet == nil {
//说明这里不是由menu菜单进行设置的 则不存在恢复游戏的过程 所以需要手动更新声音
@@ -1333,10 +1450,12 @@ extension PlayViewController {
if self.manicGame.isCitra3DS {
DispatchQueue.main.asyncAfter(delay: 1) {
self.resumeEmulationAndHandleAudio()
- self.quickLoadStateFor3DS(saveState)
+ self.quickLoadStateForCitra3DS(saveState)
}
} else if self.manicGame.isLibretroType {
self.quickLoadStateForLibretro(saveState)
+ } else if self.manicGame.isJGenesisCore {
+ self.quickLoadStateForJGenesis(saveState)
}
}
if menuSheet == nil {
@@ -1408,11 +1527,16 @@ extension PlayViewController {
pauseEmulation()
}
if manicGame.isLibretroType {
- ShadersListView.show(game: self.manicGame, hideCompletion: { [weak self] in
+ ShadersListView.show(game: self.manicGame,
+ ignoreShaderConfig: manicGame.getExtraBool(key: ExtraKey.ignoreShaderConfig.rawValue) ?? false,
+ hideCompletion: { [weak self] in
if menuSheet == nil {
self?.resumeEmulationAndHandleAudio()
}
- }, didSelectShader: { shader in
+ }, didSelectShader: { [weak self] shader in
+ guard let self else { return }
+ //该游戏是否需要忽略核心和全局着色器的配置
+ self.manicGame.updateExtra(key: ExtraKey.ignoreShaderConfig.rawValue, value: shader.isOriginal)
Game.change { [weak self] realm in
guard let self = self else { return }
if shader.isOriginal {
@@ -1421,6 +1545,23 @@ extension PlayViewController {
self.manicGame.filterName = shader.relativePath
}
}
+ }, didUpdateShaderConfig: { [weak self] type in
+ guard let self else { return }
+ switch type {
+ case .setGlobal:
+ self.manicGame.updateExtra(key: ExtraKey.ignoreShaderConfig.rawValue, value: false)
+ case .removeGlobal:
+ self.manicGame.updateExtra(key: ExtraKey.ignoreShaderConfig.rawValue, value: false)
+ case .setCore(let coreName):
+ if self.manicGame.gameType.localizedShortName == coreName {
+ self.manicGame.updateExtra(key: ExtraKey.ignoreShaderConfig.rawValue, value: false)
+ }
+ case .removeCore(let coreName):
+ if self.manicGame.gameType.localizedShortName == coreName {
+ self.manicGame.updateExtra(key: ExtraKey.ignoreShaderConfig.rawValue, value: false)
+ }
+ }
+ self.updateFilter()
})
}
return false
@@ -1461,6 +1602,11 @@ extension PlayViewController {
}
}
})
+ } else if manicGame.isJGenesisCore {
+ if let image = jGenesisCore?.snapShot() {
+ PhotoSaver.save(image: image)
+ }
+ return false
} else {
PhotoSaver.save(datas: gameViews.compactMap { $0.snapshot()?.processGameSnapshop() })
return false
@@ -1544,6 +1690,8 @@ extension PlayViewController {
} else if manicGame.isLibretroType {
LibretroCore.sharedInstance().reload()
updateFilter()
+ } else if manicGame.isJGenesisCore {
+ jGenesisCore?.reset()
}
case .quit:
//MARK: handleMenuGameSetting.quit
@@ -1558,10 +1706,15 @@ extension PlayViewController {
DispatchQueue.main.asyncAfter(delay: 0.5) {
self.dismiss(animated: true)
}
+ } else if manicGame.isJGenesisCore {
+ gameMetalView = nil
+ DispatchQueue.main.asyncAfter(delay: 0.5) {
+ self.dismiss(animated: true)
+ }
}
case .resolution:
//MARK: handleMenuGameSetting.resolution
- guard manicGame.gameType == ._3ds || manicGame.gameType == .psp || manicGame.gameType == .n64 || manicGame.gameType == .ps1 || manicGame.gameType == .dc else { return true }
+ guard manicGame.gameType == ._3ds || manicGame.gameType == .psp || manicGame.gameType == .n64 || manicGame.gameType == .ps1 || manicGame.gameType == .dc || (manicGame.gameType == .ds && manicGame.defaultCore == 1) else { return true }
Log.debug("设置分辨率")
if manicGame.resolution != item.resolution {
Game.change { realm in
@@ -1582,6 +1735,11 @@ extension PlayViewController {
LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.BeetlePSXHW.name, key: "beetle_psx_hw_internal_resolution", value: item.resolution.resolutionTitleForPS1, reload: true)
} else if manicGame.gameType == .dc {
updateDCResolution(item.resolution, reload: true)
+ } else if manicGame.gameType == .ds {
+ let scale = UInt32(item.resolution == .undefine ? 1 : item.resolution.rawValue)
+ let option = "\(256*scale)x\(192*scale)"
+ LibretroCore.sharedInstance().updateRunningCoreConfigs(["desmume_internal_resolution": option], flush: false)
+ DSEmulatorBridge.shared.touchScale = CGFloat(scale)*0.25
}
}
let message: String
@@ -1600,6 +1758,7 @@ extension PlayViewController {
Game.change { realm in
manicGame.swapScreen = !manicGame.swapScreen
}
+ skinSwitchBindDatas["reverseScreens"] = manicGame.swapScreen
updateSkin()
}
case .consoleHome:
@@ -1653,6 +1812,7 @@ extension PlayViewController {
case .toggleFullscreen:
//MARK: handleMenuGameSetting.toggleFullscreen
manicGame.forceFullSkin = item.isFullScreen
+ skinSwitchBindDatas["toggleControlls"] = manicGame.forceFullSkin
manicGame.updateExtra(key: ExtraKey.forceFullSkin.rawValue, value: item.isFullScreen)
updateSkin()
@@ -1671,14 +1831,26 @@ extension PlayViewController {
}
}
} else if manicGame.gameType == .ds {
- LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_mic_input": "blow"], flush: false)
- DispatchQueue.main.asyncAfter(delay: 5) { [weak self] in
- var restoreInput = "silence"
- if self?.manicGame.getExtraBool(key: ExtraKey.microphone.rawValue) ?? false {
- restoreInput = "microphone"
+ if manicGame.defaultCore == 0 {
+ //melonDSDS
+ LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_mic_input": "blow"], flush: false)
+ DispatchQueue.main.asyncAfter(delay: 5) { [weak self] in
+ var restoreInput = "silence"
+ if self?.manicGame.getExtraBool(key: ExtraKey.microphone.rawValue) ?? false {
+ restoreInput = "microphone"
+ }
+ LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_mic_input": restoreInput], flush: false)
+ }
+ } else {
+ //DeSmuME
+ DispatchQueue.main.asyncAfter(delay: 1) {
+ LibretroCore.sharedInstance().press(.L3, playerIndex: 0)
+ DispatchQueue.main.asyncAfter(delay: 5) {
+ LibretroCore.sharedInstance().release(.L3, playerIndex: 0)
+ }
}
- LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_mic_input": restoreInput], flush: false)
}
+
} else if manicGame.gameType == .nes || manicGame.gameType == .fds {
DispatchQueue.main.asyncAfter(delay: 1) {
LibretroCore.sharedInstance().press(.L3, playerIndex: 0)
@@ -1781,7 +1953,7 @@ extension PlayViewController {
}
topViewController()?.present(vc, animated: true)
}
-
+
return false
case .airPlayScaling:
@@ -1857,7 +2029,7 @@ extension PlayViewController {
UIView.makeToast(message: R.string.localizable.noTriggerPro())
return false
}
-
+
if let fromID = item.triggerProID {
manicGame.updateExtra(key: ExtraKey.triggerProID.rawValue, value: fromID)
} else {
@@ -1918,6 +2090,9 @@ extension PlayViewController {
} else if manicGame.isLibretroType {
LibretroCore.sharedInstance().resume()
updateAudio()
+ } else if manicGame.isJGenesisCore {
+ jGenesisCore?.resume()
+ updateAudio()
}
}
@@ -1938,26 +2113,53 @@ extension PlayViewController {
} else {
LibretroCore.sharedInstance().mute(manicGame.volume)
}
+ } else if manicGame.isJGenesisCore {
+ if Settings.defalut.respectSilentMode, muteSwitchMonitor.isMonitoring, muteSwitchMonitor.isMuted {
+ jGenesisCore?.setMute(true)
+ } else {
+ jGenesisCore?.setMute(!manicGame.volume)
+ }
}
}
private func updateCheatCodes(firstInit: Bool = false) {
guard !isWFCConnect else { return }
guard !isHardcoreMode else { return }
- if manicGame.isCitra3DS {
- let identifier = manicGame.identifierFor3DS
- if identifier != 0 {
- var cheatsTxt = ""
- var enableCheats: [String] = []
- for cheatCode in manicGame.gameCheats {
- cheatsTxt += "[\(cheatCode.name)]\n\(cheatCode.code)\n"
- if cheatCode.activate {
- enableCheats.append("[\(cheatCode.name)]")
+ if manicGame.gameType == ._3ds {
+ if manicGame.isCitra3DS {
+ let identifier = manicGame.identifierFor3DS
+ if identifier != 0 {
+ var cheatsTxt = ""
+ var enableCheats: [String] = []
+ for cheatCode in manicGame.gameCheats {
+ cheatsTxt += "[\(cheatCode.name)]\n\(cheatCode.code)\n"
+ if cheatCode.activate {
+ enableCheats.append("\(cheatCode.name)")
+ }
+ }
+ if !cheatsTxt.isEmpty {
+ ThreeDS.setupCheats(identifier: identifier, cheatsTxt: cheatsTxt, enableCheats: enableCheats)
+ if enableCheats.count > 0 {
+ UIView.makeToast(message: R.string.localizable.gameCheatActivateSuccess(String.successMessage(from: enableCheats)))
+ }
}
}
- if !cheatsTxt.isEmpty {
- ThreeDS.setupCheats(identifier: identifier, cheatsTxt: cheatsTxt, enableCheats: enableCheats)
- if enableCheats.count > 0 {
+ } else if manicGame.isAzahar3DS {
+ let identifier = manicGame.identifierFor3DS
+ if identifier != 0 {
+ var cheatsTxt = ""
+ var enableCheats: [String] = []
+ for cheatCode in manicGame.gameCheats {
+ if cheatCode.activate {
+ cheatsTxt += "[\(cheatCode.name)]\n*manic_enabled\n\(cheatCode.code)\n\n"
+ enableCheats.append("\(cheatCode.name)")
+ }
+ }
+ let cheatFilePath = Constants.Path.ThreeDS.appendingPathComponent("cheats/\(String(format: "%016llX.txt", identifier))")
+ if cheatsTxt.isEmpty {
+ try? FileManager.safeRemoveItem(at: URL(fileURLWithPath: cheatFilePath))
+ } else {
+ try? cheatsTxt.write(toFile: cheatFilePath, atomically: true, encoding: .utf8)
UIView.makeToast(message: R.string.localizable.gameCheatActivateSuccess(String.successMessage(from: enableCheats)))
}
}
@@ -2006,7 +2208,7 @@ extension PlayViewController {
for (index, cheatCode) in self.manicGame.gameCheats.enumerated() {
if cheatCode.activate {
if CheatType(cheatCode.type) == .actionReplay16, self.manicGame.isPicodriveCore, cheatCode.code.count > 6 {
- //MD不支持0123456789格式的作弊码,需要转换成012345:6789格式
+ //MD不支持0123456789格式的作弊码,需要转换成012345:6789格式
let processedCode = cheatCode.code[...5] + ":" + cheatCode.code[6...]
LibretroCore.sharedInstance().addCheatCode(String(processedCode), index: UInt32(index), enable: true)
} else {
@@ -2017,15 +2219,31 @@ extension PlayViewController {
}
}
+ } else if manicGame.isJGenesisCore {
+
}
}
private func updateFilter() {
- guard !manicGame.isCitra3DS else { return }
+ guard !manicGame.isCitra3DS, !manicGame.isJGenesisCore else { return }
if manicGame.isLibretroType {
//Libretro filterName是滤镜的路径
- LibretroCore.sharedInstance().setShader(manicGame.libretroShaderPath)
+ var shaderPath: String?
+ if manicGame.getExtraBool(key: ExtraKey.ignoreShaderConfig.rawValue) ?? false {
+ shaderPath = nil
+ } else {
+ shaderPath = manicGame.libretroShaderPath
+ if shaderPath == nil, let shaderConfig = ShaderConfig.getConfig() {
+ if let coreShaderPath = shaderConfig.coreConfigs[manicGame.gameType.localizedShortName] {
+ shaderPath = Constants.Path.Shaders.appendingPathComponent(coreShaderPath)
+ } else if let globalShaderPath = shaderConfig.globalConfig {
+ shaderPath = Constants.Path.Shaders.appendingPathComponent(globalShaderPath)
+ }
+ }
+ }
+ LibretroCore.sharedInstance().setShader(shaderPath)
+ updateDualScreenViews()
}
}
@@ -2043,7 +2261,7 @@ extension PlayViewController {
//模拟器如果没有加载好 直接加载存档可能会导致闪退
if self.manicGame.isCitra3DS {
DispatchQueue.main.asyncAfter(delay: 5) {
- self.quickLoadStateFor3DS(saveState)
+ self.quickLoadStateForCitra3DS(saveState)
}
} else if self.manicGame.isLibretroType {
var delay = 0.0
@@ -2100,44 +2318,67 @@ extension PlayViewController {
LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.BeetleSaturn.name, key: "beetle_saturn_region", value: Constants.Strings.SaturnConsoleLanguage[manicGame.region], reload: false)
LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.BeetleSaturn.name, key: "beetle_saturn_horizontal_overscan", value: "20", reload: false)
} else if manicGame.gameType == .ds {
- //语言选项
- let dsLanguageOptions = ["auto", "ja", "en", "fr", "de", "it", "es"]
- let dsLanguageOption: String
- if manicGame.region >= 0,
- manicGame.region < dsLanguageOptions.count {
- dsLanguageOption = dsLanguageOptions[manicGame.region]
- } else {
- dsLanguageOption = dsLanguageOptions.first!
- }
-
- //systemType
- let systemType: String
- if manicGame.isDSHomeMenuGame {
- systemType = "ds"
- } else if manicGame.isDSiHomeMenuGame {
- systemType = "dsi"
- } else if let mode = manicGame.getExtraString(key: ExtraKey.ndsSystemMode.rawValue), mode == "DSi" {
- systemType = "dsi"
+ if manicGame.defaultCore == 0 {
+ //语言选项
+ let dsLanguageOptions = ["auto", "ja", "en", "fr", "de", "it", "es"]
+ let dsLanguageOption: String
+ if manicGame.region >= 0,
+ manicGame.region < dsLanguageOptions.count {
+ dsLanguageOption = dsLanguageOptions[manicGame.region]
+ } else {
+ dsLanguageOption = dsLanguageOptions.first!
+ }
+
+ //systemType
+ let systemType: String
+ if manicGame.isDSHomeMenuGame {
+ systemType = "ds"
+ } else if manicGame.isDSiHomeMenuGame {
+ systemType = "dsi"
+ } else if let mode = manicGame.getExtraString(key: ExtraKey.ndsSystemMode.rawValue), mode == "DSi" {
+ systemType = "dsi"
+ } else {
+ systemType = "ds"
+ }
+
+ //麦克风
+ let microphone = manicGame.getExtraBool(key: ExtraKey.microphone.rawValue) ?? false
+
+ //设置配置
+ LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.melonDSDS.name,
+ configs: ["melonds_firmware_language": dsLanguageOption,
+ "melonds_console_mode": systemType,
+ "melonds_mic_input": microphone ? "microphone" : "silence",
+ "melonds_mic_input_active": "always",
+ "melonds_number_of_screen_layouts": "1",
+ "melonds_screen_layout1": "custom",
+ "melonds_show_cursor": "disabled"],
+ reload: false)
+ //wfc
+ LibretroCore.sharedInstance().setNDSWFCDNS( WFC.currentDNS());
+ DSEmulatorBridge.shared.isDeSmuMECore = false
+ DSEmulatorBridge.shared.touchScale = 1
} else {
- systemType = "ds"
+ //DeSmuME
+ let languageOptions = Constants.Strings.DSConsoleLanguage
+ var languageOption = languageOptions.first!
+ if manicGame.region > 0 && manicGame.region < languageOptions.count {
+ languageOption = languageOptions[manicGame.region]
+ }
+ let scale = UInt32(manicGame.resolution == .undefine ? 1 : manicGame.resolution.rawValue)
+ let option = "\(256*scale)x\(192*scale)"
+ let microphone = manicGame.getExtraBool(key: ExtraKey.microphone.rawValue) ?? false
+ LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.DeSmuME.name,
+ configs: ["desmume_pointer_type": "touch",
+ "desmume_internal_resolution": option,
+ "desmume_firmware_language": languageOption,
+ "desmume_pointer_device_l": "emulated",
+ "desmume_pointer_device_r": "emulated",
+ "desmume_mic_mode": microphone ? "physical" : "pattern"],
+ reload: false)
+ DSEmulatorBridge.shared.isDeSmuMECore = true
+ DSEmulatorBridge.shared.touchScale = CGFloat(scale)*0.25
}
-
- //麦克风
- let microphone = manicGame.getExtraBool(key: ExtraKey.microphone.rawValue) ?? false
-
- //设置配置
- LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.melonDSDS.name,
- configs: ["melonds_firmware_language": dsLanguageOption,
- "melonds_console_mode": systemType,
- "melonds_mic_input": microphone ? "microphone" : "silence",
- "melonds_mic_input_active": "always",
- "melonds_number_of_screen_layouts": "1",
- "melonds_screen_layout1": "custom",
- "melonds_show_cursor": "disabled"],
- reload: false)
- //wfc
- LibretroCore.sharedInstance().setNDSWFCDNS( WFC.currentDNS());
-
} else if manicGame.gameType == .gba {
if manicGame.defaultCore == 1 {
LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.VBAM.name, configs: [
@@ -2235,6 +2476,35 @@ extension PlayViewController {
self.manicGame.speed = .one
}
}
+ } else if manicGame.gameType == ._32x {
+ S2X.isJGenesisCore = manicGame.defaultCore == 1
+ } else if manicGame.gameType == .mcd {
+ MCD.isJGenesisCore = manicGame.defaultCore == 1
+ } else if manicGame.gameType == .a2600 {
+ LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.Stella.name, configs: ["stella_crop_hoverscan": "enabled"], reload: false)
+ self.update2600TvColor(isInit: true)
+ self.update2600LeftDifficulty(isInit: true)
+ self.update2600RightDifficulty(isInit: true)
+ self.updateSkin()
+ } else if manicGame.gameType == .a5200 {
+ LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.Atari800.name, configs: ["atari800_system": "5200"], reload: false)
+ } else if manicGame.gameType == .jaguar {
+ LibretroCore.sharedInstance().updateConfig(LibretroCore.Cores.VirtualJaguar.name,
+ configs: ["virtualjaguar_alt_inputs": "enabled",
+ "virtualjaguar_bios": "enabled",
+ "virtualjaguar_doom_res_hack": "enabled",
+ "virtualjaguar_p1_retropad_analog_lu": "num_7",
+ "virtualjaguar_p1_retropad_analog_ld": "num_8",
+ "virtualjaguar_p1_retropad_analog_ll": "num_9",
+ "virtualjaguar_p1_retropad_analog_lr": "star",
+ "virtualjaguar_p1_retropad_analog_ru": "hash",
+ "virtualjaguar_p2_retropad_analog_lu": "num_7",
+ "irtualjaguar_p2_retropad_analog_ld": "num_8",
+ "virtualjaguar_p2_retropad_analog_ll": "num_9",
+ "virtualjaguar_p2_retropad_analog_lr": "star",
+ "virtualjaguar_p2_retropad_analog_ru": "hash"
+ ],
+ reload: false)
}
//配置静音模式
@@ -2259,10 +2529,10 @@ extension PlayViewController {
if manicGame.isLibretroType {
var enableLibretroLog = "false"
var libretroLogLevel = "1"
- #if DEBUG
+#if DEBUG
enableLibretroLog = "true"
libretroLogLevel = "0"
- #endif
+#endif
let enableMircophone = (manicGame.gameType == .ds && (manicGame.getExtraBool(key: ExtraKey.microphone.rawValue) ?? false)) || manicGame.isAzahar3DS
LibretroCore.sharedInstance().updateLibretroConfigs([
"fastforward_frameskip": "false",
@@ -2328,15 +2598,19 @@ extension PlayViewController {
}
//配置控制器死区,
- ExternalGameControllerUtils.shared.deadZone = Settings.defalut.getExtraFloat(key: ExtraKey.deadZone.rawValue) ?? 0
+ ExternalGameControllerUtils.shared.deadZone = (Settings.defalut.getExtraDouble(key: ExtraKey.deadZone.rawValue) ?? 0).float
if !manicGame.gameType.supportAnalogInput {
//对于没有摇杆输入的平台,如果使用外置控制器的摇杆来映射按键的时候,会有很多不可预见的问题
- let settingDeadzone = Settings.defalut.getExtraFloat(key: ExtraKey.deadZone.rawValue) ?? 0
+ let settingDeadzone = Settings.defalut.getExtraDouble(key: ExtraKey.deadZone.rawValue) ?? 0
if settingDeadzone < 0.4 {
//强制设置0.4以上可以避免摇杆细微变动输入带来的错误
ExternalGameControllerUtils.shared.deadZone = 0.4
}
}
+
+ skinSwitchBindDatas["reverseScreens"] = manicGame.swapScreen
+ skinSwitchBindDatas["volume"] = manicGame.volume
+ skinSwitchBindDatas["toggleControlls"] = manicGame.forceFullSkin
}
//更新皮肤
@@ -2403,7 +2677,9 @@ extension PlayViewController {
#else
setPreferredSkin()
#endif
-
+ //更新背景
+ updateBackground()
+
//设置皮肤控制器的玩家角色
controllerView.playerIndex = PlayViewController.skinControllerPlayerIndex
//更新Libretro的画面
@@ -2417,6 +2693,12 @@ extension PlayViewController {
}
//更新3DS画面视图
updateCitra3DSViews()
+ //更新JGenesis画面
+ updateJGenesisView()
+
+ if controllerView.isIncludeSwitch {
+ controllerView.updateSwitchState(skinSwitchBindDatas)
+ }
}
/// 按照配置开始强制旋转屏幕
@@ -2442,7 +2724,7 @@ extension PlayViewController {
/// 设置游戏页面的旋转配置
-
+
private func setOrientationConfig() {
AppDelegate.orientation = {
if manicGame.orientation == .landscape {
@@ -2510,7 +2792,7 @@ extension PlayViewController {
private func updateAirPlay() {
guard !manicGame.isCitra3DS else { return }
- if manicGame.isLibretroType {
+ if manicGame.isLibretroType || manicGame.isJGenesisCore {
if PurchaseManager.isMember, Settings.defalut.airPlay, ExternalSceneDelegate.isAirPlaying {
//执行全屏投屏
if let airPlayViewController = ExternalSceneDelegate.airPlayViewController, let gameMetalView {
@@ -2519,8 +2801,8 @@ extension PlayViewController {
if manicGame.gameType == .ds || manicGame.isAzahar3DS {
dimensions.height = dimensions.height/2
}
- let scaledDimensions = airPlayViewController.addLibretroView(gameMetalView, dimensions: dimensions, scalingType: Settings.defalut.airPlayScaling)
- updateDualScreenViews(dimensions: scaledDimensions)
+ aiplayScaledDimensions = airPlayViewController.addLibretroView(gameMetalView, dimensions: dimensions, scalingType: Settings.defalut.airPlayScaling)
+ updateDualScreenViews()
updateNDSCursor()
}
} else {
@@ -2726,7 +3008,14 @@ extension PlayViewController {
if gameMetalView.superview == view {
gameMetalView.snp.remakeConstraints { make in
if self.manicGame.gameType == .ds || self.manicGame.isAzahar3DS {
- make.edges.equalTo(controllerView)
+ if let dualScreenViewFrame = getDualScreenViewFrame() {
+ make.left.equalTo(dualScreenViewFrame.minX)
+ make.top.equalTo(dualScreenViewFrame.minY)
+ make.width.equalTo(dualScreenViewFrame.width)
+ make.height.equalTo(dualScreenViewFrame.height)
+ } else {
+ make.edges.equalTo(controllerView)
+ }
} else {
make.edges.equalTo(gameView)
}
@@ -2763,7 +3052,14 @@ extension PlayViewController {
self.view.insertSubview(gameMetalView, belowSubview: controllerView)
gameMetalView.snp.makeConstraints { make in
if self.manicGame.gameType == .ds || self.manicGame.isAzahar3DS {
- make.edges.equalTo(self.controllerView)
+ if let dualScreenViewFrame = self.getDualScreenViewFrame() {
+ make.left.equalTo(dualScreenViewFrame.minX)
+ make.top.equalTo(dualScreenViewFrame.minY)
+ make.width.equalTo(dualScreenViewFrame.width)
+ make.height.equalTo(dualScreenViewFrame.height)
+ } else {
+ make.edges.equalTo(self.controllerView)
+ }
} else {
make.edges.equalTo(self.gameView)
}
@@ -2771,14 +3067,7 @@ extension PlayViewController {
gameMetalView.isHidden = true
if let corePath = self.manicGame.libretroCorePath {
var compltion: (([AnyHashable: Any]?)-> Void)? = nil
- if manicGame.gameType == .psp, manicGame.gameCodeForPSP == nil {
- compltion = { [weak self] gameInfo in
- guard let self = self else { return }
- if let gameInfo {
- self.manicGame.setExtras(gameInfo)
- }
- }
- } else if manicGame.isAzahar3DS {
+ if manicGame.isAzahar3DS {
//注册azahar的键盘
compltion = { _ in
LibretroCore.sharedInstance().registerAzaharKeyboard { config in
@@ -2805,7 +3094,9 @@ extension PlayViewController {
if self.manicGame.gameType == .ps1 {
self.updateAnalogMode(toastAllow: false, toggle: false)
} else if manicGame.gameType == .ds {
- LibretroCore.sharedInstance().startWFCStatusMonitor()
+ if manicGame.defaultCore == 0 {
+ LibretroCore.sharedInstance().startWFCStatusMonitor()
+ }
}
DispatchQueue.main.asyncAfter(delay: 2.5) {
self.updateFastforward(speed: self.manicGame.speed)
@@ -2816,15 +3107,64 @@ extension PlayViewController {
}
}
- private func updateDualScreenViews(dimensions: CGSize = CGSize(width: 480, height: 360)) {
+ private func updateJGenesisView() {
+ guard manicGame.isJGenesisCore else { return }
+ if let gameMetalView {
+ if gameMetalView.superview == view {
+ gameMetalView.snp.remakeConstraints { make in
+ make.edges.equalTo(gameView)
+ }
+ }
+ } else {
+ let jGenesisView = JGenesisView()
+ gameMetalView = jGenesisView
+ guard let gameMetalView else { return }
+ self.view.insertSubview(gameMetalView, belowSubview: controllerView)
+ gameMetalView.snp.makeConstraints { make in
+ make.edges.equalTo(self.gameView)
+ }
+ gameMetalView.isHidden = true
+
+ jGenesisView.didFinishedInit = { [weak self] in
+ guard let self = self else { return }
+ if self.manicGame.gameType == ._32x {
+ self.jGenesisCore?.openFile(filePath: self.manicGame.romUrl.path)
+ DispatchQueue.main.asyncAfter(delay: 2) {
+ self.updateFastforward(speed: self.manicGame.speed)
+ self.updateAudio()
+ if let loadSaveState = self.loadSaveState {
+ self.quickLoadStateForJGenesis(loadSaveState)
+ }
+ }
+ } else if self.manicGame.gameType == .mcd {
+ 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) {
+ self.updateFastforward(speed: self.manicGame.speed)
+ self.updateAudio()
+ if let loadSaveState = self.loadSaveState {
+ self.quickLoadStateForJGenesis(loadSaveState)
+ }
+ }
+ }
+ }
+
+ self.gameMetalView?.isHidden = false
+ self.updateAirPlay()
+ }
+ }
+ }
+
+ private func updateDualScreenViews() {
guard manicGame.gameType == .ds || manicGame.isAzahar3DS else { return }
-
+
if ExternalSceneDelegate.isAirPlaying {
let layoutType = Settings.defalut.airPlayLayout
var layout: String = ""
let ratio = 0.3
- let scale = UIScreen.main.scale
- let dimensions = dimensions.applying(CGAffineTransform(scaleX: scale, y: scale))
+ let scale = manicGame.filterName == nil ? UIScreen.main.scale : 1.25
+ let dimensions = aiplayScaledDimensions.applying(CGAffineTransform(scaleX: scale, y: scale))
let bufferSize = "\(dimensions.width),\(dimensions.height)"
let bottomRatio = 0.75 //NDS和3DS的bottom屏幕都是3:4
switch layoutType {
@@ -2908,19 +3248,48 @@ extension PlayViewController {
} else {
//屏幕需要跟随gameViews的更新而更新
guard let controllerSkin = controllerView.controllerSkin as? ControllerSkin else { return }
- guard let frames = controllerSkin.getFrames(scale: UIScreen.main.scale) else { return }
+ guard let frames = controllerSkin.getFrames() else { return }
+ guard let libretroViewFrame = getDualScreenViewFrame() else { return }
let skinframe = frames.skinFrame
- let topFrame = frames.mainGameViewFrame
- let bottomFrame = frames.touchGameViewFrame ?? .zero
- Log.debug("更新双屏的layout skin:\(frames.skinFrame) top:\(topFrame) bottom:\(bottomFrame)")
- let layout = "\(topFrame.minX),\(topFrame.minY),\(topFrame.width),\(topFrame.height),\(bottomFrame.minX),\(bottomFrame.minY),\(bottomFrame.width),\(bottomFrame.height),\(skinframe.width),\(skinframe.height)"
- Log.debug(">>>>>传入核心的Layout:\(layout)")
+ var topFrame = frames.mainGameViewFrame
+ var layout = ""
+ let absX = abs(skinframe.minX - libretroViewFrame.minX)
+ let absY = abs(skinframe.minY - libretroViewFrame.minY)
+ let scale = manicGame.filterName == nil ? UIScreen.main.scale : 1.25
+ let scaleTransform = CGAffineTransform(scaleX: scale, y: scale)
+ var touchGameViewFrame = CGRect.zero
+ if var bottomFrame = frames.touchGameViewFrame {
+ //双屏幕
+ topFrame = CGRect(x: max(topFrame.minX - absX, 0), y: max(topFrame.minY - absY, 0), width: topFrame.width, height: topFrame.height)
+ bottomFrame = CGRect(x: max(bottomFrame.minX - absX, 0), y: max(bottomFrame.minY - absY, 0), width: bottomFrame.width, height: bottomFrame.height)
+ touchGameViewFrame = bottomFrame
+
+ let bufferframe = libretroViewFrame.applying(scaleTransform)
+ let scaleTopFrame = topFrame.applying(scaleTransform)
+ let scaleBottomFrame = bottomFrame.applying(scaleTransform)
+
+ if manicGame.filterName != nil, manicGame.gameType == ._3ds, UIDevice.isLandscape {
+ //fix 3DS Scale
+ let fixScale = UIScreen.main.scale-scale
+ layout = "\(scaleTopFrame.minX),\(scaleTopFrame.minY),\(scaleTopFrame.width),\(scaleTopFrame.height*fixScale),\(scaleBottomFrame.minX),\(scaleBottomFrame.minY),\(scaleBottomFrame.width),\(scaleBottomFrame.height*fixScale),\(bufferframe.width),\(bufferframe.height*fixScale)"
+ } else {
+ layout = "\(scaleTopFrame.minX),\(scaleTopFrame.minY),\(scaleTopFrame.width),\(scaleTopFrame.height),\(scaleBottomFrame.minX),\(scaleBottomFrame.minY),\(scaleBottomFrame.width),\(scaleBottomFrame.height),\(bufferframe.width),\(bufferframe.height)"
+ }
+ Log.debug("更新双屏的layout libretroViewFrame:\(libretroViewFrame) top:\(topFrame) bottom:\(bottomFrame) layout: \(layout)")
+ } else {
+ //单屏幕
+ let bufferframe = libretroViewFrame.applying(scaleTransform)
+
+ layout = "\(max(bufferframe.minX, 0)),\(max(bufferframe.minY, 0)),\(bufferframe.width),\(bufferframe.height),\(0),\(0),\(0),\(0),\(bufferframe.width),\(bufferframe.height)"
+ Log.debug("更新单屏的layout libretroViewFrame:\(libretroViewFrame) layout: \(layout)")
+ }
+
if manicGame.gameType == .ds {
LibretroCore.sharedInstance().setNDSCustomLayout(layout)
- DSEmulatorBridge.shared.touchInputFrame = controllerSkin.getFrames()?.touchGameViewFrame ?? .zero
+ DSEmulatorBridge.shared.touchInputFrame = touchGameViewFrame
} else {
LibretroCore.sharedInstance().set3DSCustomLayout(layout)
- AzaharEmulatorBridge.shared.touchInputFrame = controllerSkin.getFrames()?.touchGameViewFrame ?? .zero
+ AzaharEmulatorBridge.shared.touchInputFrame = touchGameViewFrame
}
}
}
@@ -2944,14 +3313,23 @@ extension PlayViewController {
private func snapShotForDualScreen(topOnly: Bool = false, source: UIImage) -> [UIImage]? {
guard let controllerSkin = controllerView.controllerSkin as? ControllerSkin else { return nil }
guard let frames = controllerSkin.getFrames() else { return nil }
+ guard let libretroViewFrame = getDualScreenViewFrame() else { return nil }
+
var screenImage = source
if screenImage.scale != UIScreen.main.scale, let imageData = screenImage.pngData(), let scaleImage = UIImage(data: imageData, scale: UIScreen.main.scale) {
screenImage = scaleImage
}
- let topImage = screenImage.cropped(to: frames.mainGameViewFrame.adjustSize(add: -1))
- if !topOnly, let bottomRect = frames.touchGameViewFrame {
- let bottomImage = screenImage.cropped(to: bottomRect.adjustSize(add: -1))
+ let skinframe = frames.skinFrame
+ let absX = abs(skinframe.minX - libretroViewFrame.minX)
+ let absY = abs(skinframe.minY - libretroViewFrame.minY)
+ var topFrame = frames.mainGameViewFrame
+ topFrame = CGRect(x: max(topFrame.minX - absX, 0), y: max(topFrame.minY - absY, 0), width: topFrame.width, height: topFrame.height)
+
+ let topImage = screenImage.cropped(to: topFrame.adjustSize(add: -1))
+ if !topOnly, var bottomFrame = frames.touchGameViewFrame {
+ bottomFrame = CGRect(x: max(bottomFrame.minX - absX, 0), y: max(bottomFrame.minY - absY, 0), width: bottomFrame.width, height: bottomFrame.height)
+ let bottomImage = screenImage.cropped(to: bottomFrame.adjustSize(add: -1))
return [topImage, bottomImage]
}
return [topImage]
@@ -3043,11 +3421,13 @@ extension PlayViewController {
if isAnalog {
deviceType = Constants.Strings.PSXDualShock
}
+ skinSwitchBindDatas["toggleAnalog"] = isAnalog
Log.debug("读取数据库 使用\(deviceType)")
} else {
//默认使用DualShock
LibretroCore.sharedInstance().setPSXAnalog(true)
manicGame.updateExtra(key: ExtraKey.isAnalog.rawValue, value: true)
+ skinSwitchBindDatas["toggleAnalog"] = true
Log.debug("加载默认值 使用\(Constants.Strings.PSXDualShock)")
}
if toastAllow {
@@ -3123,8 +3503,8 @@ extension PlayViewController {
if !hideIcon {
let image: UIImage?
image = R.image.trophy_gold()
-// image = R.image.trophy_silver()
-// image = R.image.trophy_bronze()
+ // image = R.image.trophy_silver()
+ // image = R.image.trophy_bronze()
let icon = UIImageView(image: image)
icon.contentMode = .scaleAspectFit
contentView.addSubview(icon)
@@ -3243,11 +3623,13 @@ extension PlayViewController {
private func updateNDSCursor() {
guard manicGame.gameType == .ds else { return }
- if ExternalGameControllerUtils.shared.linkedControllers.count > 0 || ExternalSceneDelegate.isAirPlaying {
- //如果ds模式下连接上外置控制器,支持右摇杆控制光标移动 L3确定
- LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_show_cursor": "always"], flush: false)
- } else {
- LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_show_cursor": "disabled"], flush: false)
+ if manicGame.defaultCore == 0 {
+ if ExternalGameControllerUtils.shared.linkedControllers.count > 0 || ExternalSceneDelegate.isAirPlaying {
+ //如果ds模式下连接上外置控制器,支持右摇杆控制光标移动 L3确定
+ LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_show_cursor": "always"], flush: false)
+ } else {
+ LibretroCore.sharedInstance().updateRunningCoreConfigs(["melonds_show_cursor": "disabled"], flush: false)
+ }
}
}
@@ -3339,27 +3721,138 @@ extension PlayViewController {
}
private func updateFastforward(speed: GameSetting.FastForwardSpeed) {
- guard manicGame.isLibretroType else { return }
- switch speed {
- case .one, .two:
- LibretroCore.sharedInstance().setFastforwardFrameSkip(false)
- default:
- LibretroCore.sharedInstance().setFastforwardFrameSkip(manicGame.gameType == .ps1 ? false : true)
+ if manicGame.isLibretroType {
+ switch speed {
+ case .one, .two:
+ LibretroCore.sharedInstance().setFastforwardFrameSkip(false)
+ default:
+ LibretroCore.sharedInstance().setFastforwardFrameSkip(manicGame.gameType == .ps1 ? false : true)
+ }
+ switch speed {
+ case .one:
+ LibretroCore.sharedInstance().fastForward(0.0)
+ case .two:
+ LibretroCore.sharedInstance().fastForward(1.35)
+ case .three:
+ LibretroCore.sharedInstance().fastForward(3)
+ case .four:
+ LibretroCore.sharedInstance().fastForward(5)
+ case .five:
+ LibretroCore.sharedInstance().fastForward(7)
+ }
+ } else if manicGame.isJGenesisCore {
+ switch speed {
+ case .one:
+ jGenesisCore?.fastForward(speed: 1.0)
+ case .two:
+ jGenesisCore?.fastForward(speed: 1.5)
+ case .three:
+ jGenesisCore?.fastForward(speed: 3)
+ case .four:
+ jGenesisCore?.fastForward(speed: 5)
+ case .five:
+ jGenesisCore?.fastForward(speed: 7)
+ }
+ }
+ }
+
+ private func getDualScreenViewFrame() -> CGRect? {
+ guard let controllerSkin = controllerView.controllerSkin as? ControllerSkin else { return nil }
+ guard let frames = controllerSkin.getFrames() else { return nil }
+ let skinframe = frames.skinFrame
+ let topFrame = frames.mainGameViewFrame
+ if let bottomFrame = frames.touchGameViewFrame {
+ //双屏
+ let minX = min(topFrame.minX, bottomFrame.minX)
+ let minY = min(topFrame.minY, bottomFrame.minY)
+ let x = skinframe.minX + minX
+ let y = skinframe.minY + minY
+ let width = topFrame.maxX > bottomFrame.maxX ? topFrame.maxX - minX : bottomFrame.maxX - minX
+ let height = topFrame.maxY > bottomFrame.maxY ? topFrame.maxY - minY : bottomFrame.maxY - minY
+ return CGRect(x: x, y: y, width: width, height: height)
+ } else {
+ //单屏幕
+ let x = skinframe.minX + topFrame.minX
+ let y = skinframe.minY + topFrame.minY
+ let width = topFrame.width
+ let height = topFrame.height
+ return CGRect(x: x, y: y, width: width, height: height)
+ }
+ }
+
+ private func updateBackground() {
+ guard controllerView.controllerSkin?.identifier.lowercased() == manicGame.gameType.rawValue.lowercased() + ".flex" else {
+ return
+ }
+ if backgroundImageView == nil {
+ let bgView = UIImageView()
+ bgView.contentMode = .scaleAspectFill
+ view.insertSubview(bgView, at: 0)
+ bgView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+ backgroundImageView = bgView
+ }
+
+ if let bg = FlexBackground.getBackground(isLandScape: UIDevice.isLandscape, game: manicGame) {
+ backgroundType = bg.type
+ background = bg.background
+ self.backgroundImageView?.image = try? UIImage(url: bg.background.imageUrl)
+ } else {
+ backgroundType = nil
+ background = nil
+ self.backgroundImageView?.image = nil
+ }
+ }
+
+ private func update2600TvColor(isInit: Bool) {
+ guard manicGame.gameType == .a2600 else { return }
+ var isColor = manicGame.getExtraBool(key: ExtraKey.tvType.rawValue) ?? true
+ if !isInit {
+ isColor = !isColor
+ manicGame.updateExtra(key: ExtraKey.tvType.rawValue, value: isColor)
}
- switch speed {
- case .one:
- LibretroCore.sharedInstance().fastForward(0.0)
- case .two:
- LibretroCore.sharedInstance().fastForward(1.35)
- case .three:
- LibretroCore.sharedInstance().fastForward(3)
- case .four:
- LibretroCore.sharedInstance().fastForward(5)
- case .five:
- LibretroCore.sharedInstance().fastForward(7)
+ skinSwitchBindDatas["tvType"] = !isColor
+ DispatchQueue.main.asyncAfter(delay: isInit ? 2 : 0, execute: {
+ LibretroCore.sharedInstance().press(isColor ? .L3 : .R3, playerIndex: 0)
+ DispatchQueue.main.asyncAfter(delay: 0.1) {
+ LibretroCore.sharedInstance().release(isColor ? .L3 : .R3, playerIndex: 0)
+ }
+ })
+ }
+
+ private func update2600LeftDifficulty(isInit: Bool) {
+ guard manicGame.gameType == .a2600 else { return }
+ var isLeftDifficultyA = manicGame.getExtraBool(key: ExtraKey.leftDifficulty.rawValue) ?? true
+ if !isInit {
+ isLeftDifficultyA = !isLeftDifficultyA
+ manicGame.updateExtra(key: ExtraKey.leftDifficulty.rawValue, value: isLeftDifficultyA)
}
+ skinSwitchBindDatas["leftDifficulty"] = !isLeftDifficultyA
+ DispatchQueue.main.asyncAfter(delay: isInit ? 2 : 0, execute: {
+ LibretroCore.sharedInstance().press(isLeftDifficultyA ? .L1 : .L2, playerIndex: 0)
+ DispatchQueue.main.asyncAfter(delay: 0.1) {
+ LibretroCore.sharedInstance().release(isLeftDifficultyA ? .L1 : .L2, playerIndex: 0)
+ }
+ })
}
+ private func update2600RightDifficulty(isInit: Bool) {
+ guard manicGame.gameType == .a2600 else { return }
+ var isRightDifficultyA = manicGame.getExtraBool(key: ExtraKey.rightDifficulty.rawValue) ?? true
+ if !isInit {
+ isRightDifficultyA = !isRightDifficultyA
+ manicGame.updateExtra(key: ExtraKey.rightDifficulty.rawValue, value: isRightDifficultyA)
+ }
+ skinSwitchBindDatas["rightDifficulty"] = !isRightDifficultyA
+
+ DispatchQueue.main.asyncAfter(delay: isInit ? 2 : 0, execute: {
+ LibretroCore.sharedInstance().press(isRightDifficultyA ? .R1 : .R2, playerIndex: 0)
+ DispatchQueue.main.asyncAfter(delay: 0.1) {
+ LibretroCore.sharedInstance().release(isRightDifficultyA ? .R1 : .R2, playerIndex: 0)
+ }
+ })
+ }
}
//MARK: GameViewControllerDelegate代理
@@ -3417,4 +3910,11 @@ extension PlayViewController {
}
return nil
}
+
+ static var jGenesisView: JGenesisView? {
+ if let currentPlayViewController {
+ return currentPlayViewController.jGenesisCore
+ }
+ return nil
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosPopupView.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosPopupView.swift
index 5f387175..457ac749 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosPopupView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Views/CheevosPopupView.swift
@@ -182,8 +182,8 @@ enum CheevosPopupViewType {
class CheevosPopupView: UIView {
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -252,7 +252,8 @@ class CheevosPopupView: UIView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Play/Views/GameSettingView.swift b/ManicEmu/ManicEmu/Sources/Business/Play/Views/GameSettingView.swift
index 4dd74d42..4e2d3cd7 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Play/Views/GameSettingView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Play/Views/GameSettingView.swift
@@ -20,8 +20,8 @@ class GameSettingView: BaseView {
return (hasGrabber ? 20 : 0) + Constants.Size.ItemHeightMid + Constants.Size.ContentSpaceMin + itemHeight * CGFloat(line) + itemSpacing * CGFloat(line-1) + Constants.Size.ContentInsetBottom
}
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
return view
}()
@@ -159,7 +159,8 @@ class GameSettingView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -480,7 +481,7 @@ extension GameSettingView: UICollectionViewDelegate {
}
var item = gameSettings[indexPath.row]
guard item.enable(for: game.gameType, defaultCore: game.defaultCore) else {
- UIView.makeToast(message: R.string.localizable.notSupportGameSetting(game.gameType.localizedShortName))
+ UIView.makeToast(message: R.string.localizable.notSupportGameSetting(game.gameType.localizedShortName + game.coreNameForMultiSupport))
return
}
@@ -562,9 +563,21 @@ extension GameSettingView: UICollectionViewDelegate {
}
}
- //长按弹出可交互菜单
+ //长按弹出可交互菜单 (iOS 15兼容)
+ func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //长按弹出可交互菜单 (iOS 16+)
+ @available(iOS 16.0, *)
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemsAt indexPaths: [IndexPath], point: CGPoint) -> UIContextMenuConfiguration? {
- guard let indexPath = indexPaths.first, !isEditingMode, !isMappingMode else { return nil }
+ guard let indexPath = indexPaths.first else { return nil }
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //长按弹出可交互菜单
+ private func contextMenuConfiguration(for collectionView: UICollectionView, at indexPath: IndexPath) -> UIContextMenuConfiguration? {
+ guard !isEditingMode, !isMappingMode else { return nil }
var item = gameSettings[indexPath.row]
guard item.enable(for: game.gameType, defaultCore: game.defaultCore) else { return nil }
if item.type == .quickLoadState {
diff --git a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift
index 23232011..15f479a6 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Purchase/Views/PurchaseView.swift
@@ -57,6 +57,35 @@ class PurchaseView: BaseView {
}
}
+ if #available(iOS 16.0, *) {
+ let redeemOfferCode = UILabel()
+ redeemOfferCode.isUserInteractionEnabled = true
+ redeemOfferCode.enableInteractive = true
+ redeemOfferCode.font = Constants.Font.caption(size: .l, weight: .regular)
+ redeemOfferCode.textColor = Constants.Color.LabelPrimary.forceStyle(.dark)
+ redeemOfferCode.text = R.string.localizable.redeemOfferCode()
+ view.addSubview(redeemOfferCode)
+ redeemOfferCode.snp.makeConstraints { make in
+ make.centerY.equalToSuperview()
+ make.trailing.equalTo(restorePurchase.snp.leading).offset(-Constants.Size.ContentSpaceMid)
+ }
+ redeemOfferCode.addTapGesture { [weak self] gesture in
+ guard let self = self else { return }
+ //兑换优惠码
+ PurchaseManager.redeemOfferCode { [weak self] isCompleted, isMember in
+ guard let self else { return }
+ if isMember {
+ self.needToClosePurchaseView?()
+ CheersView.makePurchaseCheers()
+ } else if isCompleted {
+ Log.debug("兑换优惠成功")
+ } else {
+ Log.debug("兑换优惠失败")
+ }
+ }
+ }
+ }
+
return view
}()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/SettingItem.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/SettingItem.swift
index 255d2a9d..2fcccbe0 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 theme, quickGame, airPlay, iCloud, fullScreenWhenConnectController, FAQ, feedback, shareApp, qq, telegram, discord, clearCache, language, userAgreement, privacyPolicy, autoSaveState, bios, respectSilentMode, onlinePlay, about, retro, rumble, appearance, triggerPro, skin, jit, shaders
+ case theme, quickGame, airPlay, iCloud, fullScreenWhenConnectController, FAQ, feedback, shareApp, qq, telegram, discord, clearCache, language, userAgreement, privacyPolicy, autoSaveState, bios, respectSilentMode, onlinePlay, about, retro, rumble, appearance, triggerPro, skin, jit, shaders, featuredItems
}
var type: ItemType
@@ -35,6 +35,8 @@ struct SettingItem {
return Constants.Color.Pink
case .qq, .telegram, .discord, .retro:
return .clear
+ case .featuredItems:
+ return Constants.Color.Background.forceStyle(.dark)
}
}
@@ -102,6 +104,8 @@ struct SettingItem {
UIImage(symbol: .boltFill, font: Constants.Font.body(size: .s, weight: .medium), color: Constants.Color.LabelPrimary.forceStyle(.dark))
case .shaders:
R.image.customAppBackgroundDotted()!.applySymbolConfig(font: Constants.Font.body(size: .m, weight: .medium), color: Constants.Color.LabelPrimary.forceStyle(.dark))
+ case .featuredItems:
+ UIImage(symbol: .shippingboxFill, font: Constants.Font.body(size: .s, weight: .medium), color: Constants.Color.LabelPrimary.forceStyle(.dark))
}
}
@@ -161,6 +165,8 @@ struct SettingItem {
"JIT"
case .shaders:
R.string.localizable.shaders()
+ case .featuredItems:
+ R.string.localizable.featuredItems()
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Settings.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Settings.swift
index 9ac1c82f..722a35b6 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Settings.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Settings.swift
@@ -107,7 +107,7 @@ class Settings: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Theme.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Theme.swift
index 1acfcea7..35487179 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Theme.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Models/Theme.swift
@@ -180,7 +180,7 @@ class Theme: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift
index 48e52da6..c1aa8f81 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSCollectionViewCell.swift
@@ -135,6 +135,12 @@ class BIOSCollectionViewCell: UICollectionViewCell {
biosItems = Constants.BIOS.ThreeDSBios
} else if gameType == .arcade {
biosItems = Constants.BIOS.ArcadeDSBios
+ } else if gameType == .a5200 {
+ biosItems = Constants.BIOS.A5200Bios
+ } else if gameType == .a7800 {
+ biosItems = Constants.BIOS.A7800Bios
+ } else if gameType == .lynx {
+ biosItems = Constants.BIOS.LynxBios
}
let fileManager = FileManager.default
for (index, bios) in biosItems.enumerated() {
@@ -142,7 +148,12 @@ class BIOSCollectionViewCell: UICollectionViewCell {
if gameType == .dc {
biosInLib = Constants.Path.Flycast.appendingPathComponent("dc/\(bios.fileName)")
}
- let isBiosExists = fileManager.fileExists(atPath: biosInLib)
+ let isBiosExists: Bool
+ if gameType == .arcade {
+ isBiosExists = Constants.BIOS.MAMEBiosMap.keys.allSatisfy({ FileManager.default.fileExists(atPath: Constants.Path.Data.appendingPathComponent($0)) })
+ } else {
+ isBiosExists = fileManager.fileExists(atPath: biosInLib)
+ }
if isBiosExists {
biosItems[index].imported = true
} else {
@@ -377,6 +388,12 @@ class BIOSCollectionViewCell: UICollectionViewCell {
itemCount = Constants.BIOS.ThreeDSBios.count
} else if gameType == .arcade {
itemCount = Constants.BIOS.ArcadeDSBios.count
+ } else if gameType == .a5200 {
+ itemCount = Constants.BIOS.A5200Bios.count
+ } else if gameType == .a7800 {
+ itemCount = Constants.BIOS.A7800Bios.count
+ } else if gameType == .lynx {
+ itemCount = Constants.BIOS.LynxBios.count
}
return (Double(itemCount) * Constants.Size.ItemHeightMax) + (Double(itemCount + 1) * Constants.Size.ContentSpaceMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift
index fc42c028..2eea08bb 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/BIOSSelectionView.swift
@@ -14,7 +14,7 @@ import IceCream
class BIOSSelectionView: BaseView {
private enum SectionIndex: Int, CaseIterable {
- case desc, arcade, mcd, ss, ds, ps1, dc, gb, gbc, gba, fds, pm, _3ds
+ case desc, lynx, a7800, a5200, arcade, mcd, ss, ds, ps1, dc, gb, gbc, gba, fds, pm, _3ds
var title: String {
switch self {
case .desc: ""
@@ -30,6 +30,9 @@ class BIOSSelectionView: BaseView {
case .fds: GameType.fds.localizedName
case .pm: GameType.pm.localizedName
case ._3ds: GameType._3ds.localizedName
+ case .lynx: GameType.lynx.localizedName
+ case .a7800: GameType.a7800.localizedName
+ case .a5200: GameType.a5200.localizedName
}
}
@@ -48,14 +51,17 @@ class BIOSSelectionView: BaseView {
case .fds: return .fds
case .pm: return .pm
case ._3ds: return ._3ds
+ case .a5200: return .a5200
+ case .a7800: return .a7800
+ case .lynx: return .lynx
}
}
}
private let datas: [SectionIndex]
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -116,13 +122,14 @@ class BIOSSelectionView: BaseView {
self.datas = [.desc, ._3ds]
} else if let gameType, gameType == .arcade {
self.datas = [.desc, .arcade]
+ } else if let gameType, gameType == .a5200 {
+ self.datas = [.desc, .a5200]
+ } else if let gameType, gameType == .a7800 {
+ self.datas = [.desc, .a7800]
+ } else if let gameType, gameType == .lynx {
+ self.datas = [.desc, .lynx]
} else {
-#if SIDE_LOAD
- self.datas = [.desc, .arcade, ._3ds, .dc, .ps1, .mcd, .ss, .ds, .gb, .gbc, .gba, .fds, .pm]
-#else
- //AppStore版本禁用MCD
- self.datas = [.desc, .arcade, ._3ds, .dc, .ps1, .ss, .ds, .gb, .gbc, .gba, .fds, .pm]
-#endif
+ self.datas = [.desc, .lynx, .a7800, .a5200, .arcade, ._3ds, .dc, .ps1, .mcd, .ss, .ds, .gb, .gbc, .gba, .fds, .pm]
}
super.init(frame: .zero)
Log.debug("\(String(describing: Self.self)) init")
@@ -133,14 +140,15 @@ class BIOSSelectionView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .cpu))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -150,14 +158,14 @@ class BIOSSelectionView: BaseView {
headerTitleLabel.text = "BIOS"
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
}
if showClose {
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ColorPickerView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ColorPickerView.swift
index 0812c494..75825a33 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ColorPickerView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ColorPickerView.swift
@@ -28,8 +28,8 @@ class ColorPickerView: UIView {
view.enableRoundCorner = true
return view
}()
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -172,20 +172,21 @@ class ColorPickerView: UIView {
self.colorView.animatedGradientView.setColors(self.colorPicker.handles.map({ $0.color }))
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
make.size.equalTo(Constants.Size.ItemHeightUltraTiny)
}
- topBlurView.addSubview(saveButton)
+ navigationBlurView.addSubview(saveButton)
saveButton.snp.makeConstraints { make in
make.leading.equalTo(Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/DesktopIconCollectionViewCell.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/DesktopIconCollectionViewCell.swift
index 3330799c..1da03f08 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/DesktopIconCollectionViewCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/DesktopIconCollectionViewCell.swift
@@ -93,7 +93,7 @@ class DesktopIconCollectionViewCell: UICollectionViewCell {
make.height.equalTo(100)
}
- let icons = ["AppIcon", "AppIcon_Xmas", "AppIcon_Pixel32", "AppIcon_Halloween", "AppIcon_Dark", "AppIcon_Retro", "AppIcon_Color"]
+ let icons = ["AppIcon", "AppIcon_ChineseNewYear", "AppIcon_Xmas", "AppIcon_Pixel32", "AppIcon_Halloween", "AppIcon_Dark", "AppIcon_Retro", "AppIcon_Color"]
let theme = Theme.defalut
for (index, icon) in icons.enumerated() {
let iconView = IconView()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/GameListStyleCollectionViewCell.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/GameListStyleCollectionViewCell.swift
index fe512e89..7a6ac181 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/GameListStyleCollectionViewCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/GameListStyleCollectionViewCell.swift
@@ -177,10 +177,7 @@ class GameListStyleCollectionViewCell: UICollectionViewCell {
func saveImage(_ image: UIImage?) {
if let image, let data = image.pngData() {
do {
- if !FileManager.default.fileExists(atPath: Constants.Path.Assets) {
- try FileManager.default.createDirectory(atPath: Constants.Path.Assets, withIntermediateDirectories: true)
- }
- try data.write(to: URL(fileURLWithPath: Constants.Path.GameListBackground))
+ try data.writeWithCompletePath(to: URL(fileURLWithPath: Constants.Path.GameListBackground))
self.backgroundImageView.image = image
self.backgroundImageView.contentMode = .scaleAspectFill
NotificationCenter.default.post(name: Constants.NotificationName.GameListBackgroundChange, object: nil)
@@ -196,17 +193,17 @@ class GameListStyleCollectionViewCell: UICollectionViewCell {
guard let self = self else { return }
if index == 0 {
//拍摄
- ImageFetcher.capture { image in
+ ImageFetcher.capture(preferenceSize: nil) { image in
saveImage(image)
}
} else if index == 1 {
//相册
- ImageFetcher.pick { image in
+ ImageFetcher.pick(preferenceSize: nil) { image in
saveImage(image)
}
} else if index == 2 {
//文件
- ImageFetcher.file{ image in
+ ImageFetcher.file(preferenceSize: nil) { image in
saveImage(image)
}
} else if index == 3 {
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/MAMEBiosView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/MAMEBiosView.swift
index 6942aaf3..5047bf2d 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/MAMEBiosView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/MAMEBiosView.swift
@@ -60,8 +60,8 @@ class MAMEBiosView: BaseView {
}
}
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -105,14 +105,15 @@ class MAMEBiosView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .cpu))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -122,13 +123,13 @@ class MAMEBiosView: BaseView {
headerTitleLabel.text = Constants.Strings.MAMEBiosTitle
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
}
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/OnlinePlaySettingView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/OnlinePlaySettingView.swift
index 88859d2c..b225e09a 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/OnlinePlaySettingView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/OnlinePlaySettingView.swift
@@ -72,8 +72,8 @@ class OnlinePlaySettingView: BaseView {
return WFC.getList()
}()
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -124,15 +124,16 @@ class OnlinePlaySettingView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .person2Wave2, font: Constants.Font.body(weight: .bold)))
icon.contentMode = .scaleAspectFit
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -142,14 +143,14 @@ class OnlinePlaySettingView: BaseView {
headerTitleLabel.text = R.string.localizable.onlinePlaySetting()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
}
if showClose {
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift
index 96f10b81..3213784d 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/SettingsListView.swift
@@ -13,8 +13,8 @@ import MessageUI
class SettingsListView: BaseView {
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -143,7 +143,8 @@ class SettingsListView: BaseView {
SettingItem(type: .clearCache, arrowDetail: CacheManager.totleSize),
SettingItem(type: .language, arrowDetail: Locale.getSystemLanguageDisplayName(preferredLanguage: Settings.defalut.language)),
SettingItem(type: .userAgreement),
- SettingItem(type: .privacyPolicy)]
+ SettingItem(type: .privacyPolicy),
+ SettingItem(type: .featuredItems)]
}
}
return datas
@@ -183,9 +184,10 @@ class SettingsListView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
if UIDevice.isPhone, UIDevice.isLandscape {
make.height.equalTo(Constants.Size.ItemHeightMid)
} else {
@@ -198,7 +200,7 @@ class SettingsListView: BaseView {
headerTitleLabel.text = R.string.localizable.tabbarTitleSettings()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s, weight: .semibold)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview()
make.bottom.equalToSuperview()
@@ -339,7 +341,7 @@ class SettingsListView: BaseView {
func updateViews() {
if UIDevice.isPhone {
- topBlurView.snp.updateConstraints { make in
+ navigationBlurView.snp.updateConstraints { make in
if UIDevice.isLandscape {
make.height.equalTo(Constants.Size.ItemHeightMid)
} else {
@@ -581,6 +583,8 @@ extension SettingsListView: UICollectionViewDelegate {
} else {
topViewController()?.present(vc, animated: true)
}
+ case .featuredItems:
+ UIApplication.shared.open(Constants.URLs.PlayCasePromo)
default:
break
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ThemeSettingView.swift b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ThemeSettingView.swift
index cf060eae..be46365d 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ThemeSettingView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Settings/Views/ThemeSettingView.swift
@@ -30,8 +30,8 @@ class ThemeSettingView: BaseView {
}
}
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -87,14 +87,15 @@ class ThemeSettingView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: UIImage(symbol: .paintpaletteFill))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -104,14 +105,14 @@ class ThemeSettingView: BaseView {
headerTitleLabel.text = R.string.localizable.themeSettingTitle()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
}
if UIDevice.isPhone {
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/Shader.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/Shader.swift
index 9690abf4..834f4397 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/Shader.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/Shader.swift
@@ -31,6 +31,21 @@ struct Shader: Equatable {
var isOriginal: Bool = false
var baseRelativePath: String? = nil
var forceBase: String? = nil
+ var coreConfigs: [String] = []
+ var isGlobalConfig: Bool = false
+ var configAlert: String? {
+ var placeholder = ""
+ if isGlobalConfig {
+ placeholder += R.string.localizable.global()
+ }
+ if coreConfigs.count > 0 {
+ placeholder += "\(placeholder.isEmpty ? "" : " ") \(coreConfigs.reduce("", { $0 + ($0.isEmpty ? "" : " ") + $1}))"
+ }
+ if !placeholder.isEmpty {
+ return R.string.localizable.shaderConfigAlert(placeholder)
+ }
+ return nil
+ }
//计算属性
var filePath: String {
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/ShaderConfig.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/ShaderConfig.swift
new file mode 100644
index 00000000..6ffdf286
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/Models/ShaderConfig.swift
@@ -0,0 +1,73 @@
+//
+// ShaderConfig.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/22.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+import SmartCodable
+
+struct ShaderConfig: SmartCodable {
+ enum SettingType {
+ case setGlobal, removeGlobal, setCore(String), removeCore(String)
+ }
+
+ var coreConfigs: [String: String] = [:] // "NES" : "/xxx/xxx/xxx.glslp"
+ var globalConfig: String?
+
+ static func getConfig() -> ShaderConfig? {
+ if let shaderConfigString = Settings.defalut.getExtraString(key: ExtraKey.shaderConfig.rawValue),
+ let shaderConfig = ShaderConfig.deserialize(from: shaderConfigString) {
+ return shaderConfig
+ }
+ return nil
+ }
+
+ static func setCoreShader(_ relativePath: String?, core: String) {
+ var result: ShaderConfig? = nil
+
+ if let shaderConfig = getConfig() {
+ var newConfig = shaderConfig
+ if let relativePath {
+ //设定
+ newConfig.coreConfigs[core] = relativePath
+ } else {
+ //移除
+ newConfig.coreConfigs.removeAll(keys: [core])
+ }
+ result = newConfig
+ } else {
+ if let relativePath {
+ result = ShaderConfig(coreConfigs: [core: relativePath])
+ }
+ }
+ if let result, let json = result.toJSONString() {
+ Settings.defalut.updateExtra(key: ExtraKey.shaderConfig.rawValue, value: json)
+ }
+ }
+
+ static func setGlobalShader(_ relativePath: String?) {
+ var result: ShaderConfig? = nil
+
+ if let shaderConfig = getConfig() {
+ var newConfig = shaderConfig
+ if let relativePath {
+ //设定
+ newConfig.globalConfig = relativePath
+ } else {
+ //移除
+ newConfig.globalConfig = nil
+ }
+ result = newConfig
+ } else {
+ if let relativePath {
+ result = ShaderConfig(globalConfig: relativePath)
+ }
+ }
+ if let result, let json = result.toJSONString() {
+ Settings.defalut.updateExtra(key: ExtraKey.shaderConfig.rawValue, value: json)
+ }
+ }
+
+}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/ViewControllers/ShadersListViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/ViewControllers/ShadersListViewController.swift
index 47ebd77b..198d9483 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Shaders/ViewControllers/ShadersListViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/ViewControllers/ShadersListViewController.swift
@@ -9,7 +9,7 @@
class ShadersListViewController: BaseViewController {
private lazy var shadersListView: ShadersListView = {
- let view = ShadersListView(showClose: showClose, initType: initType, usingShaderPath: usingShaderPath)
+ let view = ShadersListView(showClose: showClose, initType: initType, ignoreShaderConfig: true, usingShaderPath: usingShaderPath)
view.didTapClose = {[weak self] in
self?.dismiss(animated: true)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderInfoView.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderInfoView.swift
index 2737bf74..27e32fde 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderInfoView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderInfoView.swift
@@ -28,8 +28,8 @@ class ShaderInfoView: BaseView {
}
}
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -119,7 +119,8 @@ class ShaderInfoView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderOrderView.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderOrderView.swift
index 6d72f6cb..3a7c86cf 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderOrderView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShaderOrderView.swift
@@ -47,8 +47,8 @@ class ShaderOrderView: BaseView {
}
}
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -92,7 +92,7 @@ class ShaderOrderView: BaseView {
view.addTapGesture { [weak self] gesture in
guard let self else { return }
let isGlsl = self.shader.relativePath.pathExtension.lowercased() == "glslp"
- ShadersListView.show(initType: .preview, isGlsl: isGlsl, didSelectShader: { [weak self] shader in
+ ShadersListView.show(initType: .preview, isGlsl: isGlsl, ignoreShaderConfig: true, didSelectShader: { [weak self] shader in
guard let self else { return }
self.shader.appendedShaders.append(shader)
self.isShaderModified = true
@@ -126,9 +126,10 @@ class ShaderOrderView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -140,7 +141,7 @@ class ShaderOrderView: BaseView {
}
let icon = UIImageView(image: UIImage(symbol: .sparklesRectangleStackFill))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -150,13 +151,13 @@ class ShaderOrderView: BaseView {
headerTitleLabel.text = R.string.localizable.shadersOrder()
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
}
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListCell.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListCell.swift
index ad3b6b97..76c93f01 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListCell.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListCell.swift
@@ -11,8 +11,6 @@ import SwipeCellKit
class ShadersListCell: SwipeTableViewCell {
private var titleLabel: UILabel = {
let view = UILabel()
- view.font = Constants.Font.body(size: .l)
- view.textColor = Constants.Color.LabelPrimary
return view
}()
@@ -97,7 +95,20 @@ class ShadersListCell: SwipeTableViewCell {
}
func setData(shader: Shader?, initType: ShadersListView.InitType) {
- titleLabel.text = shader?.title
+
+ let matt = NSMutableAttributedString(string: shader?.title ?? "", attributes: [.font: Constants.Font.body(size: .l), .foregroundColor: Constants.Color.LabelPrimary])
+ if let alert = shader?.configAlert {
+ titleLabel.numberOfLines = 2
+ matt.append(NSAttributedString(string: "\n\(alert)", attributes: [.font: Constants.Font.caption(size: .m), .foregroundColor: Constants.Color.LabelSecondary]))
+ let style = NSMutableParagraphStyle()
+ style.lineSpacing = Constants.Size.ContentSpaceUltraTiny/2
+ style.lineBreakMode = .byTruncatingTail
+ titleLabel.attributedText = matt.applying(attributes: [.paragraphStyle: style])
+ } else {
+ titleLabel.numberOfLines = 1
+ titleLabel.attributedText = matt
+ }
+
switch initType {
case .normal:
chevronIconView.isHidden = false
diff --git a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListView.swift b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListView.swift
index 99ce5390..5b526ea3 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Shaders/Views/ShadersListView.swift
@@ -11,6 +11,7 @@ import RealmSwift
import ManicEmuCore
import ProHUD
import BetterSegmentedControl
+import Fuse
typealias ShadersListData = [ShadersListView.ShaderSource: [(sectionTitle: String, shaders: [Shader])]]
@@ -61,8 +62,8 @@ class ShadersListView: BaseView {
private var didSelectIndexSearch: Bool = false
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
return view
}()
@@ -114,7 +115,7 @@ class ShadersListView: BaseView {
let segments = LabelSegment.segments(withTitles: ShaderSource.allCases.map({ $0.title }),
normalFont: Constants.Font.body(),
normalTextColor: Constants.Color.LabelSecondary,
- selectedTextColor: Constants.Color.LabelPrimary)
+ selectedTextColor: Constants.Color.LabelPrimary)
let options: [BetterSegmentedControl.Option] = [
.backgroundColor(Constants.Color.SegmentBackground),
.indicatorViewInset(5),
@@ -159,6 +160,16 @@ class ShadersListView: BaseView {
return view
}()
+ private var searchTextField: UITextField = {
+ let view = UITextField()
+ view.textColor = Constants.Color.LabelPrimary
+ view.font = Constants.Font.body(size: .l)
+ view.clearButtonMode = .whileEditing
+ view.returnKeyType = .search
+ view.attributedPlaceholder = NSAttributedString(string: R.string.localizable.readyEditCoverSearch() + R.string.localizable.shaders(), attributes: [.font: Constants.Font.body(size: .l), .foregroundColor: Constants.Color.LabelSecondary])
+ return view
+ }()
+
private lazy var blankSlateView: ShadersListBlankSlateView = {
let view = ShadersListBlankSlateView()
view.button.addTapGesture { [weak self] gesture in
@@ -212,12 +223,26 @@ class ShadersListView: BaseView {
return view
}()
- private var shaders = ShadersListData()
+ private var isSearch: Bool = false
+
+ private var normalShaders = ShadersListData()
+ private var searchShaders = ShadersListData()
+ private var shaders: ShadersListData {
+ return isSearch ? searchShaders : normalShaders
+ }
+
+ private var shaderConfig: ShaderConfig? = nil
+
+ private var ignoreShaderConfig: Bool
+
+ private var currentCoreName: String?
var didTapClose: (()->Void)? = nil
var didSelectShader: ((Shader)->Void)? = nil
+ var didUpdateShaderConfig: ((ShaderConfig.SettingType)->Void)? = nil
+
private var retroArchShadersDownloadSuccess: Any? = nil
deinit {
@@ -227,14 +252,19 @@ class ShadersListView: BaseView {
}
}
- init(showClose: Bool = true, initType: InitType, isGlsl: Bool = false, usingShaderPath: String? = nil) {
+ init(showClose: Bool = true, initType: InitType, isGlsl: Bool = false, ignoreShaderConfig: Bool, usingShaderPath: String? = nil, currentCoreName: String? = nil) {
self.initType = initType
self.isGlsl = isGlsl
+ self.ignoreShaderConfig = ignoreShaderConfig
super.init(frame: .zero)
+ self.currentCoreName = currentCoreName
Log.debug("\(String(describing: Self.self)) init")
+ shaderConfig = ShaderConfig.getConfig()
+
if let usingShaderPath {
- let shader = ShaderManager.genShader(usingShaderPath, isSelected: true)
+ var shader = ShaderManager.genShader(usingShaderPath, selectedShader: nil, shaderConfig: shaderConfig, ignoreShaderConfig: ignoreShaderConfig, currentCoreName: currentCoreName)
+ shader.isSelected = true
if FileManager.default.fileExists(atPath: shader.filePath) {
self.selectedShader = shader
}
@@ -244,21 +274,54 @@ class ShadersListView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
+ let textFieldContainer = RoundAndBorderView(roundCorner: .allCorners, radius: Constants.Size.CornerRadiusMid)
+ textFieldContainer.backgroundColor = Constants.Color.BackgroundPrimary
+ addSubview(textFieldContainer)
+ textFieldContainer.snp.makeConstraints { make in
+ make.top.equalTo(navigationBlurView.snp.bottom)
+ make.leading.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceMid)
+ make.height.equalTo(Constants.Size.ItemHeightMin)
+ }
+
+ textFieldContainer.addSubview(searchTextField)
+ searchTextField.snp.makeConstraints { make in
+ make.top.bottom.equalToSuperview()
+ make.leading.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceMid)
+ }
+ searchTextField.shouldClear { [weak self] in
+ guard let self = self else { return true }
+ self.stopSearchShaders()
+ return true
+ }
+ searchTextField.onEditingEnded { [weak self] in
+ guard let self = self else { return }
+ if let text = self.searchTextField.text?.trimmed, !text.isEmpty {
+ self.startSearchShaders()
+ } else {
+ self.stopSearchShaders()
+ }
+ }
+ searchTextField.onReturnKeyPress { [weak self] in
+ guard let self = self else { return }
+ self.searchTextField.resignFirstResponder()
+ }
+
let segmentViewContainer = UIView()
addSubview(segmentViewContainer)
segmentViewContainer.snp.makeConstraints { make in
- make.top.equalTo(navigationBlurView.snp.bottom)
+ make.top.equalTo(textFieldContainer.snp.bottom).offset(Constants.Size.ContentSpaceTiny)
make.leading.trailing.equalToSuperview()
make.height.equalTo(Constants.Size.ItemHeightMid + 20)
}
segmentViewContainer.addSubview(segmentView)
segmentView.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview().inset(Constants.Size.ContentSpaceMid)
- make.top.equalTo(navigationBlurView.snp.bottom).offset(10)
+ make.top.equalToSuperview().offset(10)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
@@ -347,12 +410,12 @@ class ShadersListView: BaseView {
break
case .retroarch:
blankSlateView.detailLabel.text = R.string.localizable.downloadRetroArchSahders()
- blankSlateView.button.imageView.image = UIImage(symbol: .arrowDownToLineCircleFill, font: Constants.Font.title(size: .s, weight: .medium))
+ blankSlateView.button.imageView.image = UIImage(symbol: .arrowDownToLineCircleFill, font: Constants.Font.title(size: .s, weight: .medium), color: Constants.Color.LabelPrimary.forceStyle(.dark))
blankSlateView.button.titleLabel.text = R.string.localizable.cloudDriveBrowserDownload()
blankSlateView.button.isHidden = false
case .imported:
blankSlateView.detailLabel.text = R.string.localizable.importShaders()
- blankSlateView.button.imageView.image = UIImage(symbol: .folderFillBadgePlus, font: Constants.Font.title(size: .s, weight: .medium))
+ blankSlateView.button.imageView.image = UIImage(symbol: .folderFillBadgePlus, font: Constants.Font.title(size: .s, weight: .medium), color: Constants.Color.LabelPrimary.forceStyle(.dark))
blankSlateView.button.titleLabel.text = R.string.localizable.tabbarTitleImport()
blankSlateView.button.isHidden = false
case .custom:
@@ -367,7 +430,10 @@ class ShadersListView: BaseView {
}
DispatchQueue.global().async { [weak self] in
guard let self else { return }
- self.shaders = ShaderManager.fetchShaders(isGlsl: self.isGlsl, selectedShader: self.selectedShader, includeOriginal: initType == .gamePlay)
+ self.normalShaders = ShaderManager.fetchShaders(isGlsl: self.isGlsl, selectedShader: self.selectedShader, includeOriginal: initType == .gamePlay, shaderConfig: self.shaderConfig, ignoreShaderConfig: self.ignoreShaderConfig, currentCoreName: currentCoreName)
+ if self.isSearch {
+ startSearchShaders()
+ }
DispatchQueue.main.async {
if showLoading {
UIView.hideLoading()
@@ -407,12 +473,15 @@ class ShadersListView: BaseView {
private func updateShaders(source: ShaderSource? = nil) {
if let source {
- let sourceShaders = ShaderManager.fetchShaders(source: source, isGlsl: self.isGlsl, selectedShader: self.selectedShader, includeOriginal: false)
- shaders[source] = sourceShaders[source]
+ let sourceShaders = ShaderManager.fetchShaders(source: source, isGlsl: self.isGlsl, selectedShader: self.selectedShader, includeOriginal: false, shaderConfig: shaderConfig, ignoreShaderConfig: ignoreShaderConfig, currentCoreName: currentCoreName)
+ normalShaders[source] = sourceShaders[source]
+ if isSearch {
+ startSearchShaders()
+ }
if initType == .gamePlay {
//更新全部的选择状态
refreshSelection()
- } else {
+ } else if !isSearch {
self.tableView.reloadData()
self.reloadIndexView()
}
@@ -438,7 +507,10 @@ class ShadersListView: BaseView {
}
newShaders[source] = newSections
}
- shaders = newShaders
+ normalShaders = newShaders
+ if isSearch {
+ startSearchShaders()
+ }
self.tableView.reloadData()
self.reloadIndexView()
}
@@ -479,9 +551,55 @@ class ShadersListView: BaseView {
self.segmentView.setIndex(ShaderSource.custom.rawValue)
}
self.updateShaders(source: .custom)
- self.didSelectShader?(self.selectedShader ?? ShaderManager.genOriginalShader(isSelected: true))
+ self.didSelectShader?(self.selectedShader ?? ShaderManager.genOriginalShader())
})
}
+
+ private func startSearchShaders() {
+ isSearch = true
+ if let searchWord = searchTextField.text?.trimmed, !searchWord.isEmpty {
+ UIView.makeLoading()
+ DispatchQueue.global().async {
+ let fuse = Fuse()
+ let pattern = fuse.createPattern(from: searchWord)
+
+ var result = ShadersListData()
+ self.normalShaders.forEach { source, list in
+ var listResult = [(String, [Shader])]()
+ list.forEach { item in
+ var shadersResult = [Shader]()
+ item.shaders.forEach { shader in
+ if let score = fuse.search(pattern, in: shader.title)?.score, score < 0.2 {
+ shadersResult.append(shader)
+ }
+ }
+ if shadersResult.count > 0 {
+ listResult.append((item.sectionTitle, shadersResult))
+ }
+ }
+ if listResult.count > 0 {
+ result[source] = listResult
+ }
+ }
+ self.searchShaders = result
+ DispatchQueue.main.async {
+ UIView.hideLoading()
+ self.tableView.reloadData()
+ self.reloadIndexView()
+ }
+ }
+ } else {
+ isSearch = false
+ }
+ }
+
+ private func stopSearchShaders() {
+ isSearch = false
+ searchShaders = ShadersListData()
+ tableView.reloadData()
+ reloadIndexView()
+ }
+
}
extension ShadersListView: SwipeTableViewCellDelegate {
@@ -502,7 +620,7 @@ extension ShadersListView: SwipeTableViewCellDelegate {
guard let self else { return }
UIDevice.generateHaptic()
action.fulfill(with: .reset)
- self.removeShader(shader, indexPath: indexPath)
+ self.removeShader(shader)
}
delete.backgroundColor = .clear
delete.image = self.deleteImage
@@ -575,12 +693,14 @@ extension ShadersListView: UITableViewDataSource, UITableViewDelegate {
return nil
}
- private func removeShader(_ shader: Shader, indexPath: IndexPath) {
+ private func removeShader(_ shader: Shader) {
try? FileManager.safeRemoveItem(at: URL(fileURLWithPath: shader.filePath))
- if let shadersInSource = shaders[currentSource] {
- var datas = shadersInSource[indexPath.section].shaders
- datas.remove(at: indexPath.row)
- shaders[currentSource]?[indexPath.section].shaders = datas
+ if var sources = normalShaders[currentSource] {
+ sources.removeAll(where: { $0.shaders.contains(where: { $0 == shader})})
+ normalShaders[currentSource] = sources
+ if isSearch {
+ startSearchShaders()
+ }
}
tableView.reloadData()
}
@@ -654,6 +774,9 @@ extension ShadersListView: UITableViewDataSource, UITableViewDelegate {
}
func scrollViewDidScroll(_ scrollView: UIScrollView) {
+ if searchTextField.isFirstResponder {
+ searchTextField.resignFirstResponder()
+ }
// indexView变更
guard !didSelectIndexSearch,
!indexView.isTouching,
@@ -667,6 +790,70 @@ extension ShadersListView: UITableViewDataSource, UITableViewDelegate {
self.indexView.deselectCurrentItem()
self.indexView.selectItem(at: currentSection)
}
+
+ func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
+
+ var actions = [UIMenuElement]()
+ if let shader = getShader(at: indexPath) {
+ if shader.isOriginal {
+ return nil
+ }
+ //添加为平台设定
+ actions.append(UIMenu(title: R.string.localizable.updateBackgroundForConsole(""),
+ options: .singleSelection,
+ children: System.allCores.map({
+ let coreName = $0.gameType.localizedShortName
+ let isSelected = shader.coreConfigs.contains(where: { $0 == coreName })
+
+ let action = UIAction(title: coreName,
+ image: isSelected ? .symbolImage(.checkmark) : nil,
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ if isSelected {
+ //移除Core
+ self.ignoreShaderConfig = false
+ ShaderConfig.setCoreShader(nil, core: coreName)
+ self.didUpdateShaderConfig?(.setCore(coreName))
+ } else {
+ //添加Core
+ self.ignoreShaderConfig = false
+ ShaderConfig.setCoreShader(shader.relativePath, core: coreName)
+ self.didUpdateShaderConfig?(.removeCore(coreName))
+ }
+ self.shaderConfig = ShaderConfig.getConfig()
+ self.updateShaders()
+
+ })
+ return action
+ })))
+
+ if shader.isGlobalConfig {
+ //取消全局设定
+ actions.append(UIAction(title: R.string.localizable.removeShaderForGlobal(), handler: { [weak self] _ in
+ guard let self else { return }
+ self.ignoreShaderConfig = false
+ ShaderConfig.setGlobalShader(nil)
+ self.shaderConfig = ShaderConfig.getConfig()
+ self.updateShaders()
+ self.didUpdateShaderConfig?(.removeGlobal)
+ }))
+ } else {
+ //为全局设定
+ actions.append(UIAction(title: R.string.localizable.updateBackgroundForGlobal(), handler: { [weak self] _ in
+ guard let self else { return }
+ self.ignoreShaderConfig = false
+ ShaderConfig.setGlobalShader(shader.relativePath)
+ self.shaderConfig = ShaderConfig.getConfig()
+ self.updateShaders()
+ self.didUpdateShaderConfig?(.setGlobal)
+ }))
+ }
+ }
+ return UIContextMenuConfiguration(actionProvider: { _ in
+ UIMenu(children: actions)
+ })
+ }
}
extension ShadersListView {
@@ -674,7 +861,14 @@ extension ShadersListView {
Sheet.find(identifier: String(describing: ShadersListView.self)).count > 0 ? true : false
}
- static func show(game: Game? = nil, initType: InitType? = nil, isGlsl: Bool = false, hideCompletion: (()->Void)? = nil, didTapClose: (()->Void)? = nil, didSelectShader: ((Shader)->Void)? = nil) {
+ static func show(game: Game? = nil,
+ initType: InitType? = nil,
+ isGlsl: Bool = false,
+ ignoreShaderConfig: Bool,
+ hideCompletion: (()->Void)? = nil,
+ didTapClose: (()->Void)? = nil,
+ didSelectShader: ((Shader)->Void)? = nil,
+ didUpdateShaderConfig: ((ShaderConfig.SettingType)->Void)? = nil) {
guard game != nil || initType != nil else { return }
Sheet.lazyPush(identifier: String(describing: ShadersListView.self) + (isShow ? "\(Int.random(in: 0...10))" : "")) { sheet in
sheet.configGamePlayingStyle(hideCompletion: hideCompletion)
@@ -704,12 +898,12 @@ extension ShadersListView {
})
}
}
-
+
var isGlsl = isGlsl
if let game, game.gameType == .n64, !game.isN64ParaLLEl {
isGlsl = true
}
- let listView = ShadersListView(initType: initType ?? .gamePlay, isGlsl: isGlsl, usingShaderPath: game?.filterName)
+ let listView = ShadersListView(initType: initType ?? .gamePlay, isGlsl: isGlsl, ignoreShaderConfig: ignoreShaderConfig, usingShaderPath: game?.filterName, currentCoreName: game?.gameType.localizedShortName)
listView.didTapClose = { [weak sheet] in
sheet?.pop()
didTapClose?()
@@ -723,6 +917,9 @@ extension ShadersListView {
didTapClose?()
}
}
+ listView.didUpdateShaderConfig = { type in
+ didUpdateShaderConfig?(type)
+ }
containerView.addSubview(listView)
listView.snp.makeConstraints { make in
make.edges.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/Skin/Models/FlexBackground.swift b/ManicEmu/ManicEmu/Sources/Business/Skin/Models/FlexBackground.swift
new file mode 100644
index 00000000..6afeb4e8
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Business/Skin/Models/FlexBackground.swift
@@ -0,0 +1,375 @@
+//
+// FlexBackground.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/22.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+
+import SmartCodable
+
+struct FlexBackground: SmartCodable, Equatable {
+ enum BackgroundType {
+ case game, console, global
+ }
+
+ var name: String = ""
+ var hash: String = ""
+ var games: [String] = []
+ var consoles: [String] = []
+ var global: Bool = false
+
+ var isValid: Bool {
+ return !(games.isEmpty && consoles.isEmpty && !global)
+ }
+
+ var imageUrl: URL {
+ URL(fileURLWithPath: Constants.Path.Assets.appendingPathComponent(name))
+ }
+
+ static func == (lhs: Self, rhs: Self) -> Bool {
+ guard lhs.name == rhs.name, lhs.hash == rhs.hash, lhs.games == rhs.games, lhs.consoles == rhs.consoles, lhs.global == rhs.global else {
+ return false
+ }
+ return true
+ }
+
+ static func flushBackgrounds() {
+ let backgrounds = getAllBackground()
+ var newBackgrounds = [FlexBackground]()
+ if let fileUrls = try? FileManager.default.contentsOfDirectory(at: URL(fileURLWithPath: Constants.Path.Assets), includingPropertiesForKeys: [.isDirectoryKey], options: .skipsHiddenFiles) {
+ for fileUrl in fileUrls {
+ let isDirectory = (try? fileUrl.resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory ?? false
+ if !isDirectory, let validBackground = backgrounds.first(where: { fileUrl.lastPathComponent == $0.name && $0.isValid }) {
+ newBackgrounds.append(validBackground)
+ } else {
+ try? FileManager.safeRemoveItem(at: fileUrl)
+ }
+ }
+ }
+ newBackgrounds.removeAll(where: { !FileManager.default.fileExists(atPath: $0.imageUrl.path) })
+ if newBackgrounds != backgrounds {
+ Settings.defalut.updateExtra(key: ExtraKey.flexBackground.rawValue, value: newBackgrounds.toJSONString() ?? "")
+ }
+ }
+
+ static func getAllBackground(isLandScape: Bool? = nil) -> [FlexBackground] {
+ if let flexBackgroundStr = Settings.defalut.getExtraString(key: ExtraKey.flexBackground.rawValue),
+ let allBackgrounds = [FlexBackground].deserialize(from: flexBackgroundStr) {
+#if DEBUG
+ Log.debug("[FlexBackground]>>>获取所有背景:\(allBackgrounds.toJSONString(prettyPrint: true) ?? "空")")
+#endif
+ return allBackgrounds.filter({
+ if let isLandScape {
+ return $0.name.contains(isLandScape ? "landscape" : "portrait")
+ }
+ return true
+ })
+ }
+ return []
+ }
+
+ static func getBackground(isLandScape: Bool, game: Game) -> (type: BackgroundType, background: FlexBackground)? {
+ let backgrounds = getAllBackground(isLandScape: isLandScape)
+ var firstConsoleBg: FlexBackground? = nil
+ var firstGlobalBg: FlexBackground? = nil
+ for bg in backgrounds {
+ if bg.games.contains(game.id) {
+ return (.game, bg)
+ }
+ if firstConsoleBg == nil, bg.consoles.contains(game.gameType.localizedShortName) {
+ firstConsoleBg = bg
+ }
+ if firstGlobalBg == nil, bg.global {
+ firstGlobalBg = bg
+ }
+ }
+ if let firstConsoleBg {
+ return (.console, firstConsoleBg)
+ }
+ if let firstGlobalBg {
+ return (.global, firstGlobalBg)
+ }
+ return nil
+ }
+
+ static func addBackgound(isLandScape: Bool, image: UIImage, gameID: String) -> FlexBackground? {
+ let allBackgrounds = getAllBackground(isLandScape: isLandScape)
+
+ //获取文件名称的index
+ var currentIndex: Int = 0
+ if let lastBgName = allBackgrounds.last?.name {
+ let regex = try! NSRegularExpression(pattern: "(\\d+)(?=\\.[^.]+$)")
+ if let match = regex.firstMatch(in: lastBgName, range: NSRange(lastBgName.startIndex..., in: lastBgName)),
+ let range = Range(match.range(at: 1), in: lastBgName), let index = Int(lastBgName[range]) {
+ currentIndex = index + 1
+ }
+ }
+
+ var updates = [FlexBackground]()
+ var result: FlexBackground? = nil
+ if let data = image.jpegData(compressionQuality: 0.9) {
+ let imageUrl = URL(fileURLWithPath: Constants.Path.Assets.appendingPathComponent("flex_background_\(isLandScape ? "landscape" : "portrait")_\(currentIndex).jpg"))
+ try? data.writeWithCompletePath(to: imageUrl)
+ if FileManager.default.fileExists(atPath: imageUrl.path) {
+ guard let hash = FileHashUtil.truncatedHash(url: imageUrl) else { return nil }
+ for existBg in allBackgrounds {
+ if existBg.hash == hash {
+ //bg已经 则无需保存新图片了
+ try? FileManager.safeRemoveItem(at: imageUrl)
+ if !existBg.games.contains(gameID) {
+ //更新games列表后直接返回
+ var newBg = existBg
+ newBg.games.append(gameID)
+ updates.append(newBg)
+ result = newBg
+ } else {
+ result = existBg
+ }
+ } else {
+ if existBg.games.contains(gameID) {
+ var removeGameIDBg = existBg
+ removeGameIDBg.games.removeAll(where: { $0 == gameID })
+ updates.append(removeGameIDBg)
+ }
+ }
+ }
+
+ if result == nil {
+ //bg不存在 创建一个新的
+ let newBg = FlexBackground(name: imageUrl.lastPathComponent, hash: hash, games: [gameID])
+ result = newBg
+ updates.append(newBg)
+ }
+ }
+ }
+ writeBackground(updates: updates)
+ return result
+ }
+
+ private static func writeBackground(updates: [FlexBackground]) {
+ var originalAllBackgrounds = getAllBackground()
+ for update in updates {
+ if let index = originalAllBackgrounds.firstIndex(where: { $0.hash == update.hash }) {
+ originalAllBackgrounds[index] = update
+ } else {
+ originalAllBackgrounds.append(update)
+ }
+ }
+ Settings.defalut.updateExtra(key: ExtraKey.flexBackground.rawValue, value: originalAllBackgrounds.toJSONString() ?? "")
+#if DEBUG
+ Log.debug("[FlexBackground]>>>写入背景变更:\(originalAllBackgrounds.toJSONString(prettyPrint: true) ?? "空")")
+#endif
+ }
+
+ func updateForGame(isLandScape: Bool, gameID: String) -> FlexBackground? {
+ if games.contains(gameID) {
+ return self
+ }
+ var result: FlexBackground? = nil
+ var updates = [FlexBackground]()
+ let allBackgrounds = Self.getAllBackground(isLandScape: isLandScape)
+ for existBg in allBackgrounds {
+ if existBg.hash == hash {
+ var newBg = self
+ newBg.games.append(gameID)
+ result = newBg
+ updates.append(newBg)
+ } else {
+ var newBg = existBg
+ if newBg.games.contains(where: { $0 == gameID }) {
+ newBg.games.removeAll(where: { $0 == gameID })
+ updates.append(newBg)
+ }
+ }
+ }
+ Self.writeBackground(updates: updates)
+ return result
+ }
+
+ func updateForConsole(isLandScape: Bool, console: String, gameID: String) -> FlexBackground? {
+ var result: FlexBackground? = nil
+
+ if consoles.contains(console) {
+ return self
+ }
+
+ let allBackgrounds = FlexBackground.getAllBackground()
+ var updates = [FlexBackground]()
+ for existBg in allBackgrounds {
+ if existBg.hash == hash {
+ var newBg = self
+ newBg.games.removeAll(where: { $0 == gameID })
+ newBg.consoles.append(console)
+ result = newBg
+ updates.append(newBg)
+ } else {
+ var newBg = existBg
+ if newBg.consoles.contains(where: { $0 == console }) {
+ newBg.consoles.removeAll(where: { $0 == console })
+ updates.append(newBg)
+ }
+ }
+ }
+
+ Self.writeBackground(updates: updates)
+
+ return result
+ }
+
+ func updateForGlobal(isLandScape: Bool, console: String, gameID: String) -> FlexBackground? {
+ var result: FlexBackground? = nil
+ if global == true {
+ return self
+ }
+
+ let allBackgrounds = FlexBackground.getAllBackground()
+ var updates = [FlexBackground]()
+ for existBg in allBackgrounds {
+ if existBg.hash == hash {
+ var newBg = self
+ newBg.consoles.removeAll(where: { $0 == console })
+ newBg.games.removeAll(where: { $0 == gameID })
+ newBg.global = true
+ result = newBg
+ updates.append(newBg)
+ } else {
+ var newBg = existBg
+ if newBg.global {
+ newBg.global = false
+ updates.append(newBg)
+ }
+ }
+ }
+
+ Self.writeBackground(updates: updates)
+
+ return result
+ }
+
+ func update(image: UIImage) {
+ if let data = image.jpegData(compressionQuality: 0.9) {
+ try? data.writeWithCompletePath(to: imageUrl)
+ }
+ }
+
+ func removeForGame(gameID: String) -> FlexBackground? {
+ var result = self
+ var isKeep = true
+ if result.games.contains(gameID) {
+ result.games.removeAll(where: { $0 == gameID })
+ let originalAllBackgrounds = FlexBackground.getAllBackground()
+ var allBackgrounds = originalAllBackgrounds
+ if result.consoles.isEmpty && !result.global {
+ //需要移除
+ allBackgrounds.removeAll(where: {
+ if $0.hash == result.hash {
+ try? FileManager.safeRemoveItem(at: imageUrl)
+ return true
+ }
+ return false
+ })
+ isKeep = false
+ } else {
+ //仅更新
+ for (index, allBackground) in allBackgrounds.enumerated() {
+ if allBackground.hash == result.hash {
+ allBackgrounds[index] = result
+ break
+ }
+ }
+ }
+ if originalAllBackgrounds != allBackgrounds {
+ Settings.defalut.updateExtra(key: ExtraKey.flexBackground.rawValue, value: allBackgrounds.toJSONString() ?? "")
+ }
+#if DEBUG
+ Log.debug("[FlexBackground]>>>移除游戏背景:\(allBackgrounds.toJSONString() ?? "空")")
+#endif
+ }
+ if isKeep {
+ return result
+ } else {
+ return nil
+ }
+ }
+
+ func removeForConsole(console: String) -> FlexBackground? {
+ var result = self
+ var isKeep = true
+ if result.consoles.contains(console) {
+ result.consoles.removeAll(where: { $0 == console })
+ let originalAllBackgrounds = FlexBackground.getAllBackground()
+ var allBackgrounds = originalAllBackgrounds
+ if result.games.isEmpty && !result.global {
+ //需要移除
+ allBackgrounds.removeAll(where: {
+ if $0.hash == result.hash {
+ try? FileManager.safeRemoveItem(at: imageUrl)
+ return true
+ }
+ return false
+ })
+ isKeep = false
+ } else {
+ //仅更新
+ for (index, allBackground) in allBackgrounds.enumerated() {
+ if allBackground.hash == result.hash {
+ allBackgrounds[index] = result
+ break
+ }
+ }
+ }
+ if originalAllBackgrounds != allBackgrounds {
+ Settings.defalut.updateExtra(key: ExtraKey.flexBackground.rawValue, value: allBackgrounds.toJSONString() ?? "")
+ }
+#if DEBUG
+ Log.debug("[FlexBackground]>>>移除平台背景:\(allBackgrounds.toJSONString() ?? "空")")
+#endif
+ }
+ if isKeep {
+ return result
+ } else {
+ return nil
+ }
+ }
+
+ func removeForGlobal() -> FlexBackground? {
+ var result = self
+ var isKeep = true
+ if result.global {
+ result.global = false
+ let originalAllBackgrounds = FlexBackground.getAllBackground()
+ var allBackgrounds = originalAllBackgrounds
+ if result.games.isEmpty && result.consoles.isEmpty {
+ //需要移除
+ allBackgrounds.removeAll(where: {
+ if $0.hash == result.hash {
+ try? FileManager.safeRemoveItem(at: imageUrl)
+ return true
+ }
+ return false
+ })
+ isKeep = false
+ } else {
+ //仅更新
+ for (index, allBackground) in allBackgrounds.enumerated() {
+ if allBackground.hash == result.hash {
+ allBackgrounds[index] = result
+ break
+ }
+ }
+ }
+ if originalAllBackgrounds != allBackgrounds {
+ Settings.defalut.updateExtra(key: ExtraKey.flexBackground.rawValue, value: allBackgrounds.toJSONString() ?? "")
+ }
+#if DEBUG
+ Log.debug("[FlexBackground]>>>移除全局背景:\(allBackgrounds.toJSONString() ?? "空")")
+#endif
+ }
+ if isKeep {
+ return result
+ } else {
+ return nil
+ }
+ }
+}
diff --git a/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift b/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift
index 1846b5d2..45843a40 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Skin/ViewControllers/FlexSkinSettingViewController.swift
@@ -27,6 +27,23 @@ class FlexSkinSettingViewController: BaseViewController {
private let skin: Skin
private let traits: ControllerSkin.Traits
private let images: [UIImage?]
+ private var initBackground: FlexBackground? = nil
+ private var background: FlexBackground? = nil {
+ didSet {
+ if let background, let image = try? UIImage(url: background.imageUrl) {
+ backgroundImage = image
+ } else {
+ backgroundImage = nil
+ }
+ }
+ }
+ private let game: Game
+ private var backgroundImage: UIImage? = nil {
+ didSet {
+ backgroundImageView.image = backgroundImage
+ }
+ }
+ private var backgroundType: FlexBackground.BackgroundType? = nil
private lazy var firstTimeGuideView: UIView = {
let view = UIView()
@@ -75,6 +92,188 @@ class FlexSkinSettingViewController: BaseViewController {
return view
}()
+ private lazy var backgroundContextMenuButton: ContextMenuButton = {
+ let view = ContextMenuButton(image: nil, menu: nil)
+ return view
+ }()
+
+ private lazy var backgroundImageButton: SymbolButton = {
+ let view = SymbolButton(image: nil,
+ title: R.string.localizable.background(),
+ titleFont: Constants.Font.body(size: .m),
+ edgeInsets: UIEdgeInsets(top: 0, left: Constants.Size.ContentSpaceTiny, bottom: 0, right: Constants.Size.ContentSpaceTiny),
+ titlePosition: .left,
+ enableGlass: true)
+ view.titleLabel.textAlignment = .center
+ view.enableRoundCorner = true
+ view.addTapGesture { [weak self] gesture in
+ guard let self else { return }
+ var actions: [UIMenuElement] = []
+ let isLandScape = self.traits.orientation == .landscape
+
+ let fetchImageActions = [
+ UIAction(title: R.string.localizable.readyEditCoverTakePhoto(),
+ image: .symbolImage(.camera),
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //拍摄
+ ImageFetcher.capture(preferenceSize: nil, isOpenEditor: false, completion: { [weak self] image in
+ guard let self, let image else { return }
+ self.addBackground(isLandScape: isLandScape, image: image)
+ })
+ }),
+ UIAction(title: R.string.localizable.readyEditCoverAlbum(),
+ image: .symbolImage(.photoOnRectangleAngled),
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //相册
+ ImageFetcher.pick(preferenceSize: nil, isOpenEditor: false, completion: { [weak self] image in
+ guard let self, let image else { return }
+ self.addBackground(isLandScape: isLandScape, image: image)
+ })
+ }),
+ UIAction(title: R.string.localizable.readyEditCoverFile(),
+ image: .symbolImage(.folder),
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //文件
+ ImageFetcher.file(preferenceSize: nil, isOpenEditor: false, completion: { [weak self] image in
+ guard let self, let image else { return }
+ self.addBackground(isLandScape: isLandScape, image: image)
+ })
+ }),
+ ]
+
+ if let background = self.background {
+ actions.append(UIMenu(title: isLandScape ? R.string.localizable.addBackgroundForLandscape() : R.string.localizable.addBackgroundForPortrait(), options: .singleSelection, children: fetchImageActions))
+
+ if let backgroundImage {
+ actions.append(UIAction(title: R.string.localizable.editTitle() + R.string.localizable.background()) { [weak self] _ in
+ guard let self else { return }
+ //编辑背景
+ ImageFetcher.edit(image: backgroundImage, preferenceSize: nil) { [weak self] image in
+ guard let self, let image else { return }
+ self.background?.update(image: image)
+ self.backgroundImage = image
+ }
+ })
+ }
+ actions.append(UIMenu(title: R.string.localizable.updateBackground(), options: .singleSelection, children: [
+ UIAction(title: R.string.localizable.updateBackgroundForGame(),
+ state: (self.backgroundType ?? .game) == .game ? .on : .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //为当前游戏设定
+ self.background = background.updateForGame(isLandScape: isLandScape, gameID: self.game.id)
+ self.backgroundType = .game
+
+ }),
+ UIAction(title: R.string.localizable.updateBackgroundForConsole(self.game.gameType.localizedShortName),
+ state: (self.backgroundType ?? .game) == .console ? .on : .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //为平台设定
+ self.background = background.updateForConsole(isLandScape: isLandScape, console: self.game.gameType.localizedShortName, gameID: self.game.id)
+ self.backgroundType = .console
+ }),
+ UIAction(title: R.string.localizable.updateBackgroundForGlobal(),
+ state: (self.backgroundType ?? .game) == .global ? .on : .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //为全局设定
+ self.background = background.updateForGlobal(isLandScape: isLandScape, console: self.game.gameType.localizedShortName, gameID: self.game.id)
+ self.backgroundType = .global
+ }),
+ ]))
+
+ var removeActions = [UIMenuElement]()
+ if background.games.contains(self.game.id) {
+ removeActions.append(UIAction(title: R.string.localizable.removeBackgroundForGame(),
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //移除当前游戏背景
+ if let newBg = background.removeForGame(gameID: self.game.id) {
+ if newBg.consoles.contains(self.game.gameType.localizedShortName) {
+ self.background = newBg
+ self.backgroundType = .console
+ } else if newBg.global {
+ self.background = newBg
+ self.backgroundType = .global
+ } else {
+ self.background = nil
+ self.backgroundType = nil
+ }
+ } else {
+ self.background = nil
+ self.backgroundType = nil
+ }
+ }))
+ }
+ if background.consoles.contains(self.game.gameType.localizedShortName) {
+ removeActions.append(UIAction(title: R.string.localizable.removeBackgroundForConsole(self.game.gameType.localizedShortName),
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //移除平台背景
+ if let newBg = background.removeForConsole(console: self.game.gameType.localizedShortName) {
+ if newBg.games.contains(self.game.id) {
+ self.background = newBg
+ self.backgroundType = .game
+ } else if newBg.global {
+ self.background = newBg
+ self.backgroundType = .global
+ } else {
+ self.background = nil
+ self.backgroundType = nil
+ }
+ } else {
+ self.background = nil
+ self.backgroundType = nil
+ }
+
+ }))
+ }
+ if background.global {
+ removeActions.append(UIAction(title: R.string.localizable.removeBackgroundForGlobal(),
+ state: .off,
+ handler: { [weak self] _ in
+ guard let self else { return }
+ //移除全局背景
+ if let newBg = background.removeForGlobal() {
+ if newBg.games.contains(self.game.id) {
+ self.background = newBg
+ self.backgroundType = .game
+ } else if newBg.consoles.contains(self.game.gameType.localizedShortName) {
+ self.background = newBg
+ self.backgroundType = .console
+ } else {
+ self.background = nil
+ self.backgroundType = nil
+ }
+ } else {
+ self.background = nil
+ self.backgroundType = nil
+ }
+ }))
+ }
+
+ if removeActions.count > 0 {
+ actions.append(UIMenu(title: R.string.localizable.removeTitle() + R.string.localizable.background(), options: .singleSelection, children: removeActions))
+ }
+
+ } else {
+ actions = fetchImageActions
+ }
+ self.backgroundContextMenuButton.menu = UIMenu(children: actions)
+ self.backgroundContextMenuButton.triggerTapGesture()
+ }
+ return view
+ }()
+
private lazy var controlView: ControllerView = {
let view = ControllerView()
view.controllerSkin = ControllerSkin(fileURL: skin.fileURL)
@@ -93,6 +292,12 @@ class FlexSkinSettingViewController: BaseViewController {
let view = UIView()
return view
}()
+
+ private lazy var backgroundImageView: UIImageView = {
+ let view = UIImageView(image: backgroundImage)
+ view.contentMode = .scaleAspectFill
+ return view
+ }()
private var screenBounds: CGRect {
return containerView.frame
@@ -100,10 +305,15 @@ class FlexSkinSettingViewController: BaseViewController {
var didCompletion: (()->Void)? = nil
- init(skin: Skin, traits: ControllerSkin.Traits, images: [UIImage?]) {
+ init(skin: Skin, traits: ControllerSkin.Traits, images: [UIImage?], game: Game, background: FlexBackground? = nil, backgroundImage: UIImage? = nil, backgroundType: FlexBackground.BackgroundType? = nil) {
self.skin = skin
self.traits = traits
self.images = images
+ self.game = game
+ self.initBackground = background
+ self.background = background
+ self.backgroundImage = backgroundImage
+ self.backgroundType = backgroundType
super.init(fullScreen: true)
FlexSkinSettingViewController.isShow = true
}
@@ -116,6 +326,13 @@ class FlexSkinSettingViewController: BaseViewController {
super.viewDidLoad()
view.backgroundColor = .black
+ FlexBackground.flushBackgrounds()
+
+ view.addSubview(backgroundImageView)
+ backgroundImageView.snp.makeConstraints { make in
+ make.edges.equalToSuperview()
+ }
+
if let controllerSkin = controlView.controllerSkin as? ControllerSkin,
let frames = controllerSkin.getFrames(),
let screens = controlView.controllerSkin?.screens(for: traits) {
@@ -154,6 +371,18 @@ class FlexSkinSettingViewController: BaseViewController {
make.width.greaterThanOrEqualTo(44)
}
+ view.addSubview(backgroundContextMenuButton)
+ view.addSubview(backgroundImageButton)
+ backgroundImageButton.snp.makeConstraints { make in
+ make.leading.equalTo(resetButton.snp.trailing).offset(Constants.Size.ContentSpaceMin)
+ make.centerY.equalTo(resetButton)
+ make.height.equalTo(resetButton)
+ make.width.greaterThanOrEqualTo(44)
+ }
+ backgroundContextMenuButton.snp.makeConstraints { make in
+ make.edges.equalTo(backgroundImageButton)
+ }
+
if !UserDefaults.standard.bool(forKey: Constants.DefaultKey.FlexSkinFirstTimeGuide) {
view.addSubview(firstTimeGuideView)
firstTimeGuideView.snp.makeConstraints { make in
@@ -210,6 +439,13 @@ class FlexSkinSettingViewController: BaseViewController {
return container
}
+ private func addBackground(isLandScape: Bool, image: UIImage) {
+ if let bg = FlexBackground.addBackgound(isLandScape: isLandScape, image: image, gameID: game.id) {
+ self.background = bg
+ self.backgroundType = .game
+ }
+ }
+
// MARK: - 设置边缘手柄手势
private func setupEdgeHandleGestures(for container: AuxiliaryLineView) {
let topPan = UIPanGestureRecognizer(target: self, action: #selector(handleEdgePan(_:)))
diff --git a/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift b/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift
index d5483507..26ebc6ec 100644
--- a/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/Skin/Views/SkinSettingsView.swift
@@ -17,8 +17,8 @@ import ProHUD
class SkinSettingsView: BaseView {
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -254,7 +254,8 @@ class SkinSettingsView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(130)
}
@@ -683,7 +684,7 @@ extension SkinSettingsView: UICollectionViewDelegate {
let skins = (isPortraitSkinPage ? portraitSkins : landscapeSkins)
if indexPath.row == skins.count {
//新增皮肤cell
- UIView.makeAlert(title: R.string.localizable.skinAddTitle(), detail: R.string.localizable.newSkinDesc(), cancelTitle: R.string.localizable.visitSite("DELTASTYLES"), confirmTitle: R.string.localizable.openFile(), cancelAction: { [weak self] in
+ UIView.makeAlert(title: R.string.localizable.skinAddTitle(), detail: R.string.localizable.newSkinDesc(), cancelTitle: R.string.localizable.visitSite("DELTASTYLES"), confirmTitle: R.string.localizable.openFile(), confirmAutoHide: PlayViewController.isGaming ? false : true, cancelAction: { [weak self] in
guard let self else { return }
//打开网页
if let vc = SkinSettingsView.skinSettingsViewSheet {
@@ -693,7 +694,7 @@ extension SkinSettingsView: UICollectionViewDelegate {
}
}, confirmAction: {
//打开文件管理器
- FilesImporter.shared.presentImportController(supportedTypes: UTType.skinTypes, appControllerPresent: true)
+ FilesImporter.shared.presentImportController(supportedTypes: UTType.skinTypes, appControllerPresent: PlayViewController.isGaming ? false : true)
})
return false
}
@@ -753,9 +754,20 @@ extension SkinSettingsView: UICollectionViewDelegate {
reloadDataAndSelectSkin()
}
- //长按弹出可交互菜单
+ //长按弹出可交互菜单 (iOS 15兼容)
+ func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //长按弹出可交互菜单 (iOS 16+)
+ @available(iOS 16.0, *)
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemsAt indexPaths: [IndexPath], point: CGPoint) -> UIContextMenuConfiguration? {
guard let indexPath = indexPaths.first else { return nil }
+ return contextMenuConfiguration(for: collectionView, at: indexPath)
+ }
+
+ //统一的上下文菜单配置逻辑
+ private func contextMenuConfiguration(for collectionView: UICollectionView, at indexPath: IndexPath) -> UIContextMenuConfiguration? {
let skins = (isPortraitSkinPage ? portraitSkins : landscapeSkins)
if indexPath.row == skins.count {
//新增皮肤cell 不允许弹
diff --git a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Models/Trigger.swift b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Models/Trigger.swift
index 04a3153a..ce6e0692 100644
--- a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Models/Trigger.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Models/Trigger.swift
@@ -275,7 +275,7 @@ class Trigger: Object, ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {
+ func updateExtra(key: String, value: Any?) {
if let extras, let data = Self.updateExtra(extras: extras, key: key, value: value) {
Self.change { realm in
self.extras = data
diff --git a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonView.swift b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonView.swift
index a885418a..2ef51eee 100644
--- a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/AddTriggerButtonView.swift
@@ -26,8 +26,8 @@ class AddTriggerButtonView: BaseView {
}
}
- private var topBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -92,14 +92,15 @@ class AddTriggerButtonView: BaseView {
make.edges.equalToSuperview()
}
- addSubview(topBlurView)
- topBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ addSubview(navigationBlurView)
+ navigationBlurView.snp.makeConstraints { make in
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
let icon = UIImageView(image: R.image.customXmarkTriangleCircleSquare()?.applySymbolConfig(color: Constants.Color.LabelPrimary))
- topBlurView.addSubview(icon)
+ navigationBlurView.addSubview(icon)
icon.snp.makeConstraints { make in
make.leading.equalToSuperview().offset(Constants.Size.ContentSpaceMax)
make.size.equalTo(Constants.Size.IconSizeMin)
@@ -109,13 +110,13 @@ class AddTriggerButtonView: BaseView {
headerTitleLabel.text = "TriggerPro"
headerTitleLabel.textColor = Constants.Color.LabelPrimary
headerTitleLabel.font = Constants.Font.title(size: .s)
- topBlurView.addSubview(headerTitleLabel)
+ navigationBlurView.addSubview(headerTitleLabel)
headerTitleLabel.snp.makeConstraints { make in
make.leading.equalTo(icon.snp.trailing).offset(Constants.Size.ContentSpaceUltraTiny)
make.centerY.equalTo(icon)
}
- topBlurView.addSubview(closeButton)
+ navigationBlurView.addSubview(closeButton)
closeButton.snp.makeConstraints { make in
make.trailing.equalToSuperview().offset(-Constants.Size.ContentSpaceMax)
make.centerY.equalToSuperview()
diff --git a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/TriggerProListView.swift b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/TriggerProListView.swift
index 35503de4..a5765dfd 100644
--- a/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/TriggerProListView.swift
+++ b/ManicEmu/ManicEmu/Sources/Business/TriggerPro/Views/TriggerProListView.swift
@@ -13,8 +13,8 @@ import ProHUD
class TriggerProListView: BaseView {
/// 充当导航条
- private var navigationBlurView: UIView = {
- let view = UIView()
+ private var navigationBlurView: NavigationBlurView = {
+ let view = NavigationBlurView()
view.makeBlur()
return view
}()
@@ -116,7 +116,8 @@ class TriggerProListView: BaseView {
addSubview(navigationBlurView)
navigationBlurView.snp.makeConstraints { make in
- make.leading.top.trailing.equalToSuperview()
+ make.top.equalToSuperview()
+ make.leading.trailing.equalTo(self.safeAreaLayoutGuide)
make.height.equalTo(Constants.Size.ItemHeightMid)
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/32X.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/32X.swift
index 201d89e0..aa884aa3 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/32X.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/32X.swift
@@ -60,6 +60,8 @@ extension GameType
}
struct S2X: ManicEmuCoreProtocol {
+ static var isJGenesisCore: Bool = false
+
public static let core = S2X()
public var name: String { "32X" }
@@ -114,13 +116,22 @@ class S2XEmulatorBridge : NSObject, EmulatorBase {
func activateInput(_ input: Int, value: Double, playerIndex: Int) {
guard playerIndex >= 0 else { return }
- if let gameInput = S2XGameInput(rawValue: input),
- let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ if let gameInput = S2XGameInput(rawValue: input) {
#if DEBUG
-Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
#endif
- LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ if S2X.isJGenesisCore {
+ if let jGenesisButton = gameInputToJGenesisCoreInput(gameInput: gameInput) {
+ PlayViewController.jGenesisView?.pressButton(jGenesisButton, pressed: true, player: playerIndex-1)
+ }
+ } else {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
}
+
}
func gameInputToCoreInput(gameInput: S2XGameInput) -> LibretroButton? {
@@ -141,10 +152,33 @@ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
return nil
}
+ func gameInputToJGenesisCoreInput(gameInput: S2XGameInput) -> JGenesisButton? {
+ if gameInput == .a { return .a }
+ else if gameInput == .b { return .b }
+ else if gameInput == .c { return .c }
+ else if gameInput == .x { return .x }
+ else if gameInput == .y { return .y }
+ else if gameInput == .z { return .z }
+ else if gameInput == .start { return .start }
+ else if gameInput == .up { return .up }
+ else if gameInput == .down { return .down }
+ else if gameInput == .left { return .left }
+ else if gameInput == .right { return .right }
+ return nil
+ }
+
func deactivateInput(_ input: Int, playerIndex: Int) {
- if let gameInput = S2XGameInput(rawValue: input),
- let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
- LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ if let gameInput = S2XGameInput(rawValue: input) {
+ if S2X.isJGenesisCore {
+ if let jGenesisButton = gameInputToJGenesisCoreInput(gameInput: gameInput) {
+ PlayViewController.jGenesisView?.pressButton(jGenesisButton, pressed: false, player: playerIndex-1)
+ }
+ } else {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/A2600.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/A2600.swift
new file mode 100644
index 00000000..d9897630
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/A2600.swift
@@ -0,0 +1,165 @@
+//
+// A2600.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/23.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+import ManicEmuCore
+import AVFoundation
+
+extension GameType
+{
+ static let a2600 = GameType("public.aoshuang.game.2600")
+}
+
+@objc enum A2600GameInput: Int, Input, CaseIterable {
+ case a //fire
+ case b //fire
+ case start //reset
+ case select //select
+ case up
+ case down
+ case left
+ case right
+ case l1 //Left Difficulty A
+ case r1 //Right Difficulty A
+ case l2 //Left Difficulty B
+ case r2 //Right Difficulty B
+ case l3 //Color
+ case r3 //Black/White
+
+ case flex
+ case menu
+
+ public var type: InputType {
+ return .game(.a2600)
+ }
+
+ init?(stringValue: String) {
+ if stringValue == "a" { self = .a }
+ else if stringValue == "b" { self = .b }
+ else if stringValue == "start" { self = .start }
+ else if stringValue == "select" { self = .select }
+ else if stringValue == "menu" { self = .menu }
+ else if stringValue == "up" { self = .up }
+ else if stringValue == "down" { self = .down }
+ else if stringValue == "left" { self = .left }
+ else if stringValue == "right" { self = .right }
+ else if stringValue == "l1" { self = .l1 }
+ else if stringValue == "r1" { self = .r1 }
+ else if stringValue == "l2" { self = .l2 }
+ else if stringValue == "r2" { self = .r2 }
+ else if stringValue == "l3" { self = .l3 }
+ else if stringValue == "r3" { self = .r3 }
+ else if stringValue == "flex" { self = .flex }
+ else { return nil }
+ }
+}
+
+struct A2600: ManicEmuCoreProtocol {
+ public static let core = A2600()
+
+ public var name: String { "2600" }
+ public var identifier: String { "com.aoshuang.2600Core" }
+
+ public var gameType: GameType { GameType.a2600 }
+ public var gameInputType: Input.Type { A2600GameInput.self }
+ var allInputs: [Input] { A2600GameInput.allCases }
+ public var gameSaveExtension: String { "srm" }
+
+ public let audioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 35112 * 60, channels: 2, interleaved: true)!
+ public let videoFormat = VideoFormat(format: .bitmap(.bgra8), dimensions: CGSize(width: 192, height: 160))
+
+ public var supportCheatFormats: Set<CheatFormat> {
+ return []
+ }
+
+ public var emulatorConnector: EmulatorBase { A2600EmulatorBridge.shared }
+
+ private init() {}
+}
+
+
+class A2600EmulatorBridge : NSObject, EmulatorBase {
+ static let shared = A2600EmulatorBridge()
+
+ var gameURL: URL?
+
+ private(set) var frameDuration: TimeInterval = (1.0 / 60.0)
+
+ var audioRenderer: (any ManicEmuCore.AudioRenderProtocol)?
+
+ var videoRenderer: (any ManicEmuCore.VideoRenderProtocol)?
+
+ var saveUpdateHandler: (() -> Void)?
+
+ private var thumbstickPosition: CGPoint = .zero
+
+ func start(withGameURL gameURL: URL) {}
+
+ func stop() {}
+
+ func pause() {}
+
+ func resume() {}
+
+ func runFrame(processVideo: Bool) {}
+
+ func activateInput(_ input: Int, value: Double, playerIndex: Int) {
+ guard playerIndex >= 0 else { return }
+ if let gameInput = A2600GameInput(rawValue: input),
+ let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+#if DEBUG
+Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+#endif
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
+ func gameInputToCoreInput(gameInput: A2600GameInput) -> LibretroButton? {
+ if gameInput == .a { return .B }
+ else if gameInput == .b { 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 == .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
+ }
+
+ func deactivateInput(_ input: Int, playerIndex: Int) {
+ if let gameInput = A2600GameInput(rawValue: input),
+ let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
+ func resetInputs() {}
+
+ func saveSaveState(to url: URL) {}
+
+ func loadSaveState(from url: URL) {}
+
+ func saveGameSave(to url: URL) {}
+
+ func loadGameSave(from url: URL) {}
+
+ func addCheatCode(_ cheatCode: String, type: String) -> Bool {
+ return false
+ }
+
+ func resetCheats() {}
+
+ func updateCheats() {}
+
+}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/A5200.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/A5200.swift
new file mode 100644
index 00000000..83067e06
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/A5200.swift
@@ -0,0 +1,234 @@
+//
+// A5200.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/23.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+import ManicEmuCore
+import AVFoundation
+
+extension GameType
+{
+ static let a5200 = GameType("public.aoshuang.game.5200")
+}
+
+@objc enum A5200GameInput: Int, Input, CaseIterable {
+ case a //fire 1
+ case b //fire 2
+ case x // *
+ case y // #
+ case start //start
+ case select //pause
+ case up
+ case down
+ case left
+ case right
+ case l1 // num 0
+ case r1 // num 1
+ case l2 // num 2
+ case r2 // num 3
+ case l3 // num 7
+ case r3 //Virtual Keyboard
+ case num0
+ case num1
+ case num2
+ case num3
+ case num4
+ case num5
+ case num6
+ case num7
+ case num8
+ case num9
+ case pound //#
+ case star //*
+ case flex
+ case menu
+
+ public var type: InputType {
+ return .game(.a5200)
+ }
+
+ init?(stringValue: String) {
+ if stringValue == "a" { self = .a }
+ else if stringValue == "b" { self = .b }
+ else if stringValue == "x" { self = .x }
+ else if stringValue == "y" { self = .y }
+ else if stringValue == "start" { self = .start }
+ else if stringValue == "select" { self = .select }
+ else if stringValue == "menu" { self = .menu }
+ else if stringValue == "up" { self = .up }
+ else if stringValue == "down" { self = .down }
+ else if stringValue == "left" { self = .left }
+ else if stringValue == "right" { self = .right }
+ else if stringValue == "l1" { self = .l1 }
+ else if stringValue == "r1" { self = .r1 }
+ else if stringValue == "l2" { self = .l2 }
+ else if stringValue == "r2" { self = .r2 }
+ else if stringValue == "l3" { self = .l3 }
+ else if stringValue == "r3" { self = .r3 }
+ else if stringValue == "num0" { self = .num0 }
+ else if stringValue == "num1" { self = .num1 }
+ else if stringValue == "num2" { self = .num2 }
+ else if stringValue == "num3" { self = .num3 }
+ else if stringValue == "num4" { self = .num4 }
+ else if stringValue == "num5" { self = .num5 }
+ else if stringValue == "num6" { self = .num6 }
+ else if stringValue == "num7" { self = .num7 }
+ else if stringValue == "num8" { self = .num8 }
+ else if stringValue == "num9" { self = .num9 }
+ else if stringValue == "pound" { self = .pound }
+ else if stringValue == "star" { self = .star }
+ else if stringValue == "flex" { self = .flex }
+ else { return nil }
+ }
+}
+
+struct A5200: ManicEmuCoreProtocol {
+ public static let core = A5200()
+
+ public var name: String { "5200" }
+ public var identifier: String { "com.aoshuang.5200Core" }
+
+ public var gameType: GameType { GameType.a5200 }
+ public var gameInputType: Input.Type { A5200GameInput.self }
+ var allInputs: [Input] { A5200GameInput.allCases }
+ public var gameSaveExtension: String { "srm" }
+
+ public let audioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 35112 * 60, channels: 2, interleaved: true)!
+ public let videoFormat = VideoFormat(format: .bitmap(.bgra8), dimensions: CGSize(width: 320, height: 240))
+
+ public var supportCheatFormats: Set<CheatFormat> {
+ return []
+ }
+
+ public var emulatorConnector: EmulatorBase { A5200EmulatorBridge.shared }
+
+ private init() {}
+}
+
+
+class A5200EmulatorBridge : NSObject, EmulatorBase {
+ static let shared = A5200EmulatorBridge()
+
+ var gameURL: URL?
+
+ private(set) var frameDuration: TimeInterval = (1.0 / 60.0)
+
+ var audioRenderer: (any ManicEmuCore.AudioRenderProtocol)?
+
+ var videoRenderer: (any ManicEmuCore.VideoRenderProtocol)?
+
+ var saveUpdateHandler: (() -> Void)?
+
+ private var thumbstickPosition: CGPoint = .zero
+
+ func start(withGameURL gameURL: URL) {}
+
+ func stop() {}
+
+ func pause() {}
+
+ func resume() {}
+
+ func runFrame(processVideo: Bool) {}
+
+ func activateInput(_ input: Int, value: Double, playerIndex: Int) {
+ guard playerIndex >= 0 else { return }
+ if let gameInput = A5200GameInput(rawValue: input) {
+#if DEBUG
+ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+#endif
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ } else {
+ if gameInput == .num4 {
+ LibretroCore.sharedInstance().pressKeyboard(LibretroKeyboardCode.createCode(withLabel: "4"))
+ } else if gameInput == .num5 {
+ LibretroCore.sharedInstance().pressKeyboard(LibretroKeyboardCode.createCode(withLabel: "5"))
+ } else if gameInput == .num6 {
+ LibretroCore.sharedInstance().pressKeyboard(LibretroKeyboardCode.createCode(withLabel: "6"))
+ } else if gameInput == .num8 {
+ LibretroCore.sharedInstance().pressKeyboard(LibretroKeyboardCode.createCode(withLabel: "8"))
+ } else if gameInput == .num9 {
+ LibretroCore.sharedInstance().pressKeyboard(LibretroKeyboardCode.createCode(withLabel: "9"))
+ }
+ }
+ }
+ }
+
+ func gameInputToCoreInput(gameInput: A5200GameInput) -> LibretroButton? {
+ if gameInput == .a { return .B }
+ 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 }
+ else if gameInput == .num0 { return .L1 }
+ else if gameInput == .num1 { return .R1 }
+ else if gameInput == .num2 { return .L2 }
+ else if gameInput == .num3 { return .R2 }
+ else if gameInput == .num4 { return nil }
+ else if gameInput == .num5 { return nil }
+ else if gameInput == .num6 { return nil }
+ else if gameInput == .num7 { return .L3 }
+ else if gameInput == .num8 { return nil }
+ else if gameInput == .num9 { return nil }
+ else if gameInput == .pound { return .Y }
+ else if gameInput == .star { return .X }
+
+ return nil
+ }
+
+ func deactivateInput(_ input: Int, playerIndex: Int) {
+ if let gameInput = A5200GameInput(rawValue: input) {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ } else {
+ if gameInput == .num4 {
+ LibretroCore.sharedInstance().releaseKeyboard(LibretroKeyboardCode.createCode(withLabel: "4"))
+ } else if gameInput == .num5 {
+ LibretroCore.sharedInstance().releaseKeyboard(LibretroKeyboardCode.createCode(withLabel: "5"))
+ } else if gameInput == .num6 {
+ LibretroCore.sharedInstance().releaseKeyboard(LibretroKeyboardCode.createCode(withLabel: "6"))
+ } else if gameInput == .num8 {
+ LibretroCore.sharedInstance().releaseKeyboard(LibretroKeyboardCode.createCode(withLabel: "8"))
+ } else if gameInput == .num9 {
+ LibretroCore.sharedInstance().releaseKeyboard(LibretroKeyboardCode.createCode(withLabel: "9"))
+ }
+ }
+ }
+
+ }
+
+ func resetInputs() {}
+
+ func saveSaveState(to url: URL) {}
+
+ func loadSaveState(from url: URL) {}
+
+ func saveGameSave(to url: URL) {}
+
+ func loadGameSave(from url: URL) {}
+
+ func addCheatCode(_ cheatCode: String, type: String) -> Bool {
+ return false
+ }
+
+ func resetCheats() {}
+
+ func updateCheats() {}
+
+}
+
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/A7800.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/A7800.swift
new file mode 100644
index 00000000..28c4f5a3
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/A7800.swift
@@ -0,0 +1,155 @@
+//
+// A7800.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/23.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+import ManicEmuCore
+import AVFoundation
+
+extension GameType
+{
+ static let a7800 = GameType("public.aoshuang.game.7800")
+}
+
+@objc enum A7800GameInput: Int, Input, CaseIterable {
+ case a //right red button
+ case b //left red button
+ case x //reset
+ case start //pause
+ case select //select
+ case up
+ case down
+ case left
+ case right
+ case l1 //Left Difficulty
+ case r1 //Right Difficulty
+
+ case flex
+ case menu
+
+ public var type: InputType {
+ return .game(.a7800)
+ }
+
+ init?(stringValue: String) {
+ if stringValue == "a" { self = .a }
+ else if stringValue == "b" { self = .b }
+ else if stringValue == "x" { self = .x }
+ else if stringValue == "start" { self = .start }
+ else if stringValue == "select" { self = .select }
+ else if stringValue == "menu" { self = .menu }
+ else if stringValue == "up" { self = .up }
+ else if stringValue == "down" { self = .down }
+ else if stringValue == "left" { self = .left }
+ else if stringValue == "right" { self = .right }
+ else if stringValue == "l1" { self = .l1 }
+ else if stringValue == "r1" { self = .r1 }
+ else if stringValue == "flex" { self = .flex }
+ else { return nil }
+ }
+}
+
+struct A7800: ManicEmuCoreProtocol {
+ public static let core = A7800()
+
+ public var name: String { "7800" }
+ public var identifier: String { "com.aoshuang.7800Core" }
+
+ public var gameType: GameType { GameType.a7800 }
+ public var gameInputType: Input.Type { A7800GameInput.self }
+ var allInputs: [Input] { A7800GameInput.allCases }
+ public var gameSaveExtension: String { "srm" }
+
+ public let audioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 35112 * 60, channels: 2, interleaved: true)!
+ public let videoFormat = VideoFormat(format: .bitmap(.bgra8), dimensions: CGSize(width: 320, height: 240))
+
+ public var supportCheatFormats: Set<CheatFormat> {
+ return []
+ }
+
+ public var emulatorConnector: EmulatorBase { A7800EmulatorBridge.shared }
+
+ private init() {}
+}
+
+
+class A7800EmulatorBridge : NSObject, EmulatorBase {
+ static let shared = A7800EmulatorBridge()
+
+ var gameURL: URL?
+
+ private(set) var frameDuration: TimeInterval = (1.0 / 60.0)
+
+ var audioRenderer: (any ManicEmuCore.AudioRenderProtocol)?
+
+ var videoRenderer: (any ManicEmuCore.VideoRenderProtocol)?
+
+ var saveUpdateHandler: (() -> Void)?
+
+ private var thumbstickPosition: CGPoint = .zero
+
+ func start(withGameURL gameURL: URL) {}
+
+ func stop() {}
+
+ func pause() {}
+
+ func resume() {}
+
+ func runFrame(processVideo: Bool) {}
+
+ func activateInput(_ input: Int, value: Double, playerIndex: Int) {
+ guard playerIndex >= 0 else { return }
+ if let gameInput = A7800GameInput(rawValue: input),
+ let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+#if DEBUG
+Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+#endif
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
+ func gameInputToCoreInput(gameInput: A7800GameInput) -> LibretroButton? {
+ if gameInput == .a { return .B }
+ else if gameInput == .b { return .B }
+ else if gameInput == .x { 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 == .l1 { return .L1 }
+ else if gameInput == .r1 { return .R1 }
+ return nil
+ }
+
+ func deactivateInput(_ input: Int, playerIndex: Int) {
+ if let gameInput = A7800GameInput(rawValue: input),
+ let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
+ func resetInputs() {}
+
+ func saveSaveState(to url: URL) {}
+
+ func loadSaveState(from url: URL) {}
+
+ func saveGameSave(to url: URL) {}
+
+ func loadGameSave(from url: URL) {}
+
+ func addCheatCode(_ cheatCode: String, type: String) -> Bool {
+ return false
+ }
+
+ func resetCheats() {}
+
+ func updateCheats() {}
+
+}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/Jaguar.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/Jaguar.swift
new file mode 100644
index 00000000..48e1854b
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/Jaguar.swift
@@ -0,0 +1,234 @@
+//
+// Jaguar.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/23.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+import ManicEmuCore
+import AVFoundation
+
+extension GameType
+{
+ static let jaguar = GameType("public.aoshuang.game.jaguar")
+}
+
+@objc enum JaguarGameInput: Int, Input, CaseIterable {
+ case a // A 最右边第一个红色按钮
+ case b // B
+ case x // num 0
+ case y // C
+ case start // Option
+ case select // Pause
+ case up
+ case down
+ case left
+ case right
+ case l1 // num 1
+ case r1 // num 2
+ case l2 // num 3
+ case r2 // num 4
+ case l3 // num 5
+ case r3 // num 6
+ case num0
+ case num1
+ case num2
+ case num3
+ case num4
+ case num5
+ case num6
+ case num7
+ case num8
+ case num9
+ case pound //#
+ case star //*
+ case flex
+ case menu
+
+ public var type: InputType {
+ return .game(.jaguar)
+ }
+
+ init?(stringValue: String) {
+ if stringValue == "a" { self = .a }
+ else if stringValue == "b" { self = .b }
+ else if stringValue == "x" { self = .x }
+ else if stringValue == "y" { self = .y }
+ else if stringValue == "start" { self = .start }
+ else if stringValue == "select" { self = .select }
+ else if stringValue == "menu" { self = .menu }
+ else if stringValue == "up" { self = .up }
+ else if stringValue == "down" { self = .down }
+ else if stringValue == "left" { self = .left }
+ else if stringValue == "right" { self = .right }
+ else if stringValue == "l1" { self = .l1 }
+ else if stringValue == "r1" { self = .r1 }
+ else if stringValue == "l2" { self = .l2 }
+ else if stringValue == "r2" { self = .r2 }
+ else if stringValue == "l3" { self = .l3 }
+ else if stringValue == "r3" { self = .r3 }
+ else if stringValue == "num0" { self = .num0 }
+ else if stringValue == "num1" { self = .num1 }
+ else if stringValue == "num2" { self = .num2 }
+ else if stringValue == "num3" { self = .num3 }
+ else if stringValue == "num4" { self = .num4 }
+ else if stringValue == "num5" { self = .num5 }
+ else if stringValue == "num6" { self = .num6 }
+ else if stringValue == "num7" { self = .num7 }
+ else if stringValue == "num8" { self = .num8 }
+ else if stringValue == "num9" { self = .num9 }
+ else if stringValue == "pound" { self = .pound }
+ else if stringValue == "star" { self = .star }
+ else if stringValue == "flex" { self = .flex }
+ else { return nil }
+ }
+}
+
+struct Jaguar: ManicEmuCoreProtocol {
+ public static let core = Jaguar()
+
+ public var name: String { "JAGUAR" }
+ public var identifier: String { "com.aoshuang.JaguarCore" }
+
+ public var gameType: GameType { GameType.jaguar }
+ public var gameInputType: Input.Type { JaguarGameInput.self }
+ var allInputs: [Input] { JaguarGameInput.allCases }
+ public var gameSaveExtension: String { "srm" }
+
+ public let audioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 35112 * 60, channels: 2, interleaved: true)!
+ public let videoFormat = VideoFormat(format: .bitmap(.bgra8), dimensions: CGSize(width: 320, height: 240))
+
+ public var supportCheatFormats: Set<CheatFormat> {
+ return []
+ }
+
+ public var emulatorConnector: EmulatorBase { JaguarEmulatorBridge.shared }
+
+ private init() {}
+}
+
+
+class JaguarEmulatorBridge : NSObject, EmulatorBase {
+ static let shared = JaguarEmulatorBridge()
+
+ var gameURL: URL?
+
+ private(set) var frameDuration: TimeInterval = (1.0 / 60.0)
+
+ var audioRenderer: (any ManicEmuCore.AudioRenderProtocol)?
+
+ var videoRenderer: (any ManicEmuCore.VideoRenderProtocol)?
+
+ var saveUpdateHandler: (() -> Void)?
+
+ private var thumbstickPosition: CGPoint = .zero
+
+ func start(withGameURL gameURL: URL) {}
+
+ func stop() {}
+
+ func pause() {}
+
+ func resume() {}
+
+ func runFrame(processVideo: Bool) {}
+
+ func activateInput(_ input: Int, value: Double, playerIndex: Int) {
+ guard playerIndex >= 0 else { return }
+ if let gameInput = JaguarGameInput(rawValue: input) {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+#if DEBUG
+ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+#endif
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ } else {
+ /**
+ 摇杆坐标
+ 0,1
+
+ -1,0 0,0 1,0
+
+ 0,-1
+ */
+ if gameInput == .num7 {
+ LibretroCore.sharedInstance().moveStick(true, x: 0, y: 1, playerIndex: UInt32(playerIndex))
+ } else if gameInput == .num8 {
+ LibretroCore.sharedInstance().moveStick(true, x: 0, y: -1, playerIndex: UInt32(playerIndex))
+ } else if gameInput == .num9 {
+ LibretroCore.sharedInstance().moveStick(true, x: -1, y: 0, playerIndex: UInt32(playerIndex))
+ } else if gameInput == .pound {
+ LibretroCore.sharedInstance().moveStick(true, x: 1, y: 0, playerIndex: UInt32(playerIndex))
+ } else if gameInput == .star {
+ LibretroCore.sharedInstance().moveStick(false, x: 0, y: 1, playerIndex: UInt32(playerIndex))
+ }
+ }
+ }
+
+
+ }
+
+ func gameInputToCoreInput(gameInput: JaguarGameInput) -> 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 .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 }
+ else if gameInput == .num0 { return .X }
+ else if gameInput == .num1 { return .L1 }
+ else if gameInput == .num2 { return .R1 }
+ else if gameInput == .num3 { return .L2 }
+ else if gameInput == .num4 { return .R2 }
+ else if gameInput == .num5 { return .L3 }
+ else if gameInput == .num6 { return .R3 }
+ else if gameInput == .num7 { return nil }
+ else if gameInput == .num8 { return nil }
+ else if gameInput == .num9 { return nil }
+ else if gameInput == .pound { return nil }
+ else if gameInput == .star { return nil }
+
+ return nil
+ }
+
+ func deactivateInput(_ input: Int, playerIndex: Int) {
+ if let gameInput = JaguarGameInput(rawValue: input) {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ } else {
+ if gameInput == .num7 || gameInput == .num8 || gameInput == .num9 || gameInput == .pound || gameInput == .star {
+ LibretroCore.sharedInstance().moveStick(gameInput == .star ? false : true, x: 0, y: 0, playerIndex: UInt32(playerIndex))
+ }
+ }
+ }
+ }
+
+ func resetInputs() {}
+
+ func saveSaveState(to url: URL) {}
+
+ func loadSaveState(from url: URL) {}
+
+ func saveGameSave(to url: URL) {}
+
+ func loadGameSave(from url: URL) {}
+
+ func addCheatCode(_ cheatCode: String, type: String) -> Bool {
+ return false
+ }
+
+ func resetCheats() {}
+
+ func updateCheats() {}
+
+}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/Lynx.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/Lynx.swift
new file mode 100644
index 00000000..d697c599
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/Lynx.swift
@@ -0,0 +1,149 @@
+//
+// Lynx.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/23.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0-or-later
+import ManicEmuCore
+import AVFoundation
+
+extension GameType
+{
+ static let lynx = GameType("public.aoshuang.game.lynx")
+}
+
+@objc enum LynxGameInput: Int, Input, CaseIterable {
+ case a //A 正面放置的时候 dpad在左边,A按钮是最右边的
+ case b //B
+ case start //Pause
+ case up
+ case down
+ case left
+ case right
+ case l1 //Option 1
+ case r1 //Option 2
+
+ case flex
+ case menu
+
+ public var type: InputType {
+ return .game(.lynx)
+ }
+
+ init?(stringValue: String) {
+ if stringValue == "a" { self = .a }
+ else if stringValue == "b" { self = .b }
+ else if stringValue == "start" { self = .start }
+ else if stringValue == "menu" { self = .menu }
+ else if stringValue == "up" { self = .up }
+ else if stringValue == "down" { self = .down }
+ else if stringValue == "left" { self = .left }
+ else if stringValue == "right" { self = .right }
+ else if stringValue == "l1" { self = .l1 }
+ else if stringValue == "r1" { self = .r1 }
+ else if stringValue == "flex" { self = .flex }
+ else { return nil }
+ }
+}
+
+struct Lynx: ManicEmuCoreProtocol {
+ public static let core = Lynx()
+
+ public var name: String { "LYNX" }
+ public var identifier: String { "com.aoshuang.LynxCore" }
+
+ public var gameType: GameType { GameType.lynx }
+ public var gameInputType: Input.Type { LynxGameInput.self }
+ var allInputs: [Input] { LynxGameInput.allCases }
+ public var gameSaveExtension: String { "srm" }
+
+ public let audioFormat = AVAudioFormat(commonFormat: .pcmFormatInt16, sampleRate: 35112 * 60, channels: 2, interleaved: true)!
+ public let videoFormat = VideoFormat(format: .bitmap(.bgra8), dimensions: CGSize(width: 192, height: 160))
+
+ public var supportCheatFormats: Set<CheatFormat> {
+ return []
+ }
+
+ public var emulatorConnector: EmulatorBase { LynxEmulatorBridge.shared }
+
+ private init() {}
+}
+
+
+class LynxEmulatorBridge : NSObject, EmulatorBase {
+ static let shared = LynxEmulatorBridge()
+
+ var gameURL: URL?
+
+ private(set) var frameDuration: TimeInterval = (1.0 / 60.0)
+
+ var audioRenderer: (any ManicEmuCore.AudioRenderProtocol)?
+
+ var videoRenderer: (any ManicEmuCore.VideoRenderProtocol)?
+
+ var saveUpdateHandler: (() -> Void)?
+
+ private var thumbstickPosition: CGPoint = .zero
+
+ func start(withGameURL gameURL: URL) {}
+
+ func stop() {}
+
+ func pause() {}
+
+ func resume() {}
+
+ func runFrame(processVideo: Bool) {}
+
+ func activateInput(_ input: Int, value: Double, playerIndex: Int) {
+ guard playerIndex >= 0 else { return }
+ if let gameInput = LynxGameInput(rawValue: input),
+ let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+#if DEBUG
+Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+#endif
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
+ func gameInputToCoreInput(gameInput: LynxGameInput) -> LibretroButton? {
+ if gameInput == .a { return .A }
+ else if gameInput == .b { return .B }
+ else if gameInput == .start { return .start }
+ 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 }
+ return nil
+ }
+
+ func deactivateInput(_ input: Int, playerIndex: Int) {
+ if let gameInput = LynxGameInput(rawValue: input),
+ let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
+ func resetInputs() {}
+
+ func saveSaveState(to url: URL) {}
+
+ func loadSaveState(from url: URL) {}
+
+ func saveGameSave(to url: URL) {}
+
+ func loadGameSave(from url: URL) {}
+
+ func addCheatCode(_ cheatCode: String, type: String) -> Bool {
+ return false
+ }
+
+ func resetCheats() {}
+
+ func updateCheats() {}
+
+}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/MCD.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/MCD.swift
index 7833950b..5323d87b 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/MCD.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/MCD.swift
@@ -60,6 +60,8 @@ extension GameType
}
struct MCD: ManicEmuCoreProtocol {
+ static var isJGenesisCore: Bool = false
+
public static let core = MCD()
public var name: String { "MCD" }
@@ -79,7 +81,7 @@ struct MCD: ManicEmuCoreProtocol {
return [gameGenieFormat, proActionReplayFormat]
}
- public var emulatorConnector: EmulatorBase { MDEmulatorBridge.shared }
+ public var emulatorConnector: EmulatorBase { MCDEmulatorBridge.shared }
private init()
{
@@ -114,13 +116,22 @@ class MCDEmulatorBridge : NSObject, EmulatorBase {
func activateInput(_ input: Int, value: Double, playerIndex: Int) {
guard playerIndex >= 0 else { return }
- if let gameInput = MCDGameInput(rawValue: input),
- let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ if let gameInput = MCDGameInput(rawValue: input) {
#if DEBUG
-Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
+ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
#endif
- LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ if MCD.isJGenesisCore {
+ if let jGenesisButton = gameInputToJGenesisCoreInput(gameInput: gameInput) {
+ PlayViewController.jGenesisView?.pressButton(jGenesisButton, pressed: true, player: playerIndex-1)
+ }
+ } else {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().press(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
}
+
}
func gameInputToCoreInput(gameInput: MCDGameInput) -> LibretroButton? {
@@ -141,10 +152,33 @@ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
return nil
}
+ func gameInputToJGenesisCoreInput(gameInput: MCDGameInput) -> JGenesisButton? {
+ if gameInput == .a { return .a }
+ else if gameInput == .b { return .b }
+ else if gameInput == .c { return .c }
+ else if gameInput == .x { return .x }
+ else if gameInput == .y { return .y }
+ else if gameInput == .z { return .z }
+ else if gameInput == .start { return .start }
+ else if gameInput == .up { return .up }
+ else if gameInput == .down { return .down }
+ else if gameInput == .left { return .left }
+ else if gameInput == .right { return .right }
+ return nil
+ }
+
func deactivateInput(_ input: Int, playerIndex: Int) {
- if let gameInput = MCDGameInput(rawValue: input),
- let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
- LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ if let gameInput = MCDGameInput(rawValue: input) {
+ if MCD.isJGenesisCore {
+ if let jGenesisButton = gameInputToJGenesisCoreInput(gameInput: gameInput) {
+ PlayViewController.jGenesisView?.pressButton(jGenesisButton, pressed: false, player: playerIndex-1)
+ }
+ } else {
+ if let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
+ LibretroCore.sharedInstance().release(libretroButton, playerIndex: UInt32(playerIndex))
+ }
+ }
+
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift
index cdacf66b..88dd1d74 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/N64.swift
@@ -106,8 +106,12 @@ class N64EmulatorBridge : NSObject, EmulatorBase {
var saveUpdateHandler: (() -> Void)?
+ enum CStickDirection {
+ case up, down, left, right
+ }
+
private var thumbstickPosition: CGPoint = .zero
- private var cStickPosition: CGPoint = .zero
+ private var cStickPressDirection: CStickDirection? = nil
func start(withGameURL gameURL: URL) {}
@@ -127,12 +131,10 @@ class N64EmulatorBridge : NSObject, EmulatorBase {
} else if input == N64GameInput.analogStickLeft || input == N64GameInput.analogStickRight {
thumbstickPosition.x = input == N64GameInput.analogStickRight ? value : -value
LibretroCore.sharedInstance().moveStick(true, x: thumbstickPosition.x, y: thumbstickPosition.y, playerIndex: UInt32(playerIndex))
- } else if input == N64GameInput.cUp || input == N64GameInput.cDown {
- cStickPosition = CGPoint(x: 0, y: input == N64GameInput.cUp ? value : -value)
- LibretroCore.sharedInstance().moveStick(false, x: cStickPosition.x, y: cStickPosition.y, playerIndex: UInt32(playerIndex))
- } else if input == N64GameInput.cLeft || input == N64GameInput.cRight {
- cStickPosition = CGPoint(x: input == N64GameInput.cRight ? value : -value, y: 0)
- LibretroCore.sharedInstance().moveStick(false, x: cStickPosition.x, y: cStickPosition.y, playerIndex: UInt32(playerIndex))
+ } else if handleCStickInput(input, value: value, playerIndex: playerIndex, press: true) {
+#if DEBUG
+Log.debug("\(String(describing: Self.self))点击了:cStick")
+#endif
} else {
if let gameInput = N64GameInput(rawValue: input),
let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
@@ -165,12 +167,8 @@ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
} else if input == N64GameInput.analogStickLeft || input == N64GameInput.analogStickRight {
thumbstickPosition.x = 0
LibretroCore.sharedInstance().moveStick(true, x: thumbstickPosition.x, y: thumbstickPosition.y, playerIndex: UInt32(playerIndex))
- } else if input == N64GameInput.cUp || input == N64GameInput.cDown {
- cStickPosition.y = 0
- LibretroCore.sharedInstance().moveStick(false, x: cStickPosition.x, y: cStickPosition.y, playerIndex: UInt32(playerIndex))
- } else if input == N64GameInput.cLeft || input == N64GameInput.cRight {
- cStickPosition.x = 0
- LibretroCore.sharedInstance().moveStick(false, x: cStickPosition.x, y: cStickPosition.y, playerIndex: UInt32(playerIndex))
+ } else if handleCStickInput(input, value: 0, playerIndex: playerIndex, press: false) {
+ //释放了cstick
} else {
if let gameInput = N64GameInput(rawValue: input),
let libretroButton = gameInputToCoreInput(gameInput: gameInput) {
@@ -179,6 +177,38 @@ Log.debug("\(String(describing: Self.self))点击了:\(gameInput)")
}
}
+ private func handleCStickInput(_ input: Int, value: Double, playerIndex: Int, press: Bool) -> Bool {
+ var position: CGPoint? = nil
+ if press {
+ if input == N64GameInput.cUp, value > 0.5 {
+ cStickPressDirection = .up
+ position = CGPoint(x: 0, y: 1)
+ } else if input == N64GameInput.cDown, value > 0.5 {
+ cStickPressDirection = .down
+ position = CGPoint(x: 0, y: -1)
+ } else if input == N64GameInput.cLeft, value > 0.5 {
+ cStickPressDirection = .left
+ position = CGPoint(x: -1, y: 0)
+ } else if input == N64GameInput.cRight, value > 0.5 {
+ cStickPressDirection = .right
+ position = CGPoint(x: 1, y: 0)
+ }
+ } else {
+ if (input == N64GameInput.cUp && cStickPressDirection == .up) ||
+ (input == N64GameInput.cDown && cStickPressDirection == .down) ||
+ (input == N64GameInput.cLeft && cStickPressDirection == .left) ||
+ (input == N64GameInput.cRight && cStickPressDirection == .right) {
+ cStickPressDirection = nil
+ position = CGPoint(x: 0, y: 0)
+ }
+ }
+ if let position {
+ LibretroCore.sharedInstance().moveStick(false, x: position.x, y: position.y, playerIndex: UInt32(playerIndex))
+ return true
+ }
+ return false
+ }
+
func resetInputs() {}
func saveSaveState(to url: URL) {}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift
index a4e481a1..a6507b83 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/NDS.swift
@@ -33,10 +33,12 @@ extension GameType
case down
case left
case right
+ ///Thumbstick移动光标
case rightThumbstickUp
case rightThumbstickDown
case rightThumbstickLeft
case rightThumbstickRight
+
case touchScreenX
case touchScreenY
@@ -106,6 +108,8 @@ struct DS: ManicEmuCoreProtocol {
class DSEmulatorBridge : NSObject, EmulatorBase {
static let shared = DSEmulatorBridge()
+ var touchScale: CGFloat = 1
+ var isDeSmuMECore: Bool = false
var gameURL: URL?
@@ -117,7 +121,8 @@ class DSEmulatorBridge : NSObject, EmulatorBase {
var saveUpdateHandler: (() -> Void)?
- private var thumbstickPosition: CGPoint = .zero
+ private var leftThumbstickPosition: CGPoint = .zero
+ private var rightThumbstickPosition: CGPoint = .zero
private var touchPointX: CGFloat? = nil
private var touchPointY: CGFloat? = nil
var touchInputFrame: CGRect = .zero
@@ -136,11 +141,11 @@ class DSEmulatorBridge : NSObject, EmulatorBase {
guard playerIndex >= 0 else { return }
if input == DSGameInput.rightThumbstickUp || input == DSGameInput.rightThumbstickDown {
- thumbstickPosition.y = input == DSGameInput.rightThumbstickUp ? value : -value
- LibretroCore.sharedInstance().moveStick(false, x: thumbstickPosition.x, y: thumbstickPosition.y, playerIndex: UInt32(playerIndex))
+ rightThumbstickPosition.y = input == DSGameInput.rightThumbstickUp ? value : -value
+ LibretroCore.sharedInstance().moveStick(false, x: rightThumbstickPosition.x, y: rightThumbstickPosition.y, playerIndex: UInt32(playerIndex))
} else if input == DSGameInput.rightThumbstickLeft || input == DSGameInput.rightThumbstickRight {
- thumbstickPosition.x = input == DSGameInput.rightThumbstickRight ? value : -value
- LibretroCore.sharedInstance().moveStick(false, x: thumbstickPosition.x, y: thumbstickPosition.y, playerIndex: UInt32(playerIndex))
+ rightThumbstickPosition.x = input == DSGameInput.rightThumbstickRight ? value : -value
+ LibretroCore.sharedInstance().moveStick(false, x: rightThumbstickPosition.x, y: rightThumbstickPosition.y, playerIndex: UInt32(playerIndex))
} else {
if input == DSGameInput.touchScreenX || input == DSGameInput.touchScreenY {
if input == DSGameInput.touchScreenX {
@@ -149,10 +154,10 @@ class DSEmulatorBridge : NSObject, EmulatorBase {
touchPointY = value
}
if let x = touchPointX, let y = touchPointY {
- let touchPoint = CGPoint(x: touchInputFrame.minX + touchInputFrame.width*x, y: touchInputFrame.minY + touchInputFrame.height*y)
+ let touchPoint = CGPoint(x: touchInputFrame.minX + touchInputFrame.width*x*touchScale, y: touchInputFrame.minY + touchInputFrame.height*y*touchScale)
#if DEBUG
- Log.debug("\(String(describing: Self.self)) 触摸屏幕:\(touchPoint)")
+ Log.debug("\(String(describing: Self.self)) 触摸屏幕:\(touchPoint) Ratio:(\(x), \(y))")
#endif
LibretroCore.sharedInstance().sendTouchEventX(touchPoint.x, y: touchPoint.y)
touchPointX = nil
@@ -168,6 +173,7 @@ class DSEmulatorBridge : NSObject, EmulatorBase {
}
}
+ //功能映射以MelonDS为准
func gameInputToCoreInput(gameInput: DSGameInput) -> LibretroButton? {
if gameInput == .a { return .A }
else if gameInput == .b { return .B }
@@ -177,9 +183,9 @@ class DSEmulatorBridge : NSObject, EmulatorBase {
else if gameInput == .r { return .R1 }
else if gameInput == .l1 { return .L1 }
else if gameInput == .r1 { return .R1 }
- else if gameInput == .l2 { return .L2 }
- else if gameInput == .l3 { return .L3 }
- else if gameInput == .r3 { return .R3 }
+ else if gameInput == .l2 { return isDeSmuMECore ? .L3 : .L2 }
+ else if gameInput == .l3 { return isDeSmuMECore ? .L2 : .L3 }
+ else if gameInput == .r3 { return isDeSmuMECore ? .R2 : .R3 }
else if gameInput == .start { return .start }
else if gameInput == .select { return .select }
else if gameInput == .up { return .up }
@@ -191,11 +197,11 @@ class DSEmulatorBridge : NSObject, EmulatorBase {
func deactivateInput(_ input: Int, playerIndex: Int) {
if input == DSGameInput.rightThumbstickUp || input == DSGameInput.rightThumbstickDown {
- thumbstickPosition.y = 0
- LibretroCore.sharedInstance().moveStick(false, x: thumbstickPosition.x, y: thumbstickPosition.y, playerIndex: UInt32(playerIndex))
+ rightThumbstickPosition.y = 0
+ LibretroCore.sharedInstance().moveStick(false, x: rightThumbstickPosition.x, y: rightThumbstickPosition.y, playerIndex: UInt32(playerIndex))
} else if input == DSGameInput.rightThumbstickLeft || input == DSGameInput.rightThumbstickRight {
- thumbstickPosition.x = 0
- LibretroCore.sharedInstance().moveStick(false, x: thumbstickPosition.x, y: thumbstickPosition.y, playerIndex: UInt32(playerIndex))
+ rightThumbstickPosition.x = 0
+ LibretroCore.sharedInstance().moveStick(false, x: rightThumbstickPosition.x, y: rightThumbstickPosition.y, playerIndex: UInt32(playerIndex))
} else {
if input == DSGameInput.touchScreenX || input == DSGameInput.touchScreenY {
if input == DSGameInput.touchScreenX {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift
index ab9791e9..4e7fd38a 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/PSP.swift
@@ -91,6 +91,92 @@ struct PSP: ManicEmuCoreProtocol {
var emulatorConnector: EmulatorBase { PSPEmulatorBridge.shared }
private init() {}
+
+ struct GameCheat {
+ struct Cheat {
+ let name: String
+ let code: String
+ }
+
+ let gameCode: String
+ let gameTitle: String
+ let cheats: [Cheat]
+ }
+
+ static func parseCheatFiles(content: String) -> [GameCheat] {
+ let lines = content
+ .components(separatedBy: .newlines)
+ .map { $0.trimmingCharacters(in: .whitespaces) }
+
+ var results: [GameCheat] = []
+
+ var currentGameCode: String?
+ var currentGameTitle: String?
+ var cheats: [GameCheat.Cheat] = []
+
+ var currentCheatName: String?
+ var currentCheatLines: [String] = []
+
+ func flushCheat() {
+ guard
+ let name = currentCheatName,
+ !currentCheatLines.isEmpty
+ else {
+ currentCheatName = nil
+ currentCheatLines.removeAll()
+ return
+ }
+
+ cheats.append(
+ .init(
+ name: name,
+ code: currentCheatLines.joined(separator: "\n")
+ )
+ )
+
+ currentCheatName = nil
+ currentCheatLines.removeAll()
+ }
+
+ func flushGame() {
+ flushCheat()
+ guard
+ let code = currentGameCode,
+ let title = currentGameTitle,
+ !cheats.isEmpty
+ else {
+ cheats.removeAll()
+ return
+ }
+
+ results.append(
+ .init(
+ gameCode: code,
+ gameTitle: title,
+ cheats: cheats
+ )
+ )
+ cheats.removeAll()
+ }
+
+ for line in lines {
+ if line.hasPrefix("_S ") {
+ flushGame()
+ currentGameCode = String(line.dropFirst(3))
+ currentGameTitle = nil
+ } else if line.hasPrefix("_G "), currentGameTitle == nil {
+ currentGameTitle = String(line.dropFirst(3))
+ } else if line.hasPrefix("_C0 ") || line.hasPrefix("_C1 ") {
+ flushCheat()
+ currentCheatName = String(line.dropFirst(4))
+ } else if line.hasPrefix("_L ") {
+ currentCheatLines.append(line)
+ }
+ }
+
+ flushGame()
+ return results
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift b/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
index dc206bee..48080177 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Cores/ThreeDS.swift
@@ -138,13 +138,12 @@ struct ThreeDS: ManicEmuCoreProtocol {
{
}
+ //For Citra
static func setupCheats(identifier: UInt64, cheatsTxt: String, enableCheats: [String]) {
#if !targetEnvironment(simulator)
let manager = CheatsManager(identifier: identifier)
let path = manager.cheatFilePath()
- try? cheatsTxt.write(to: URL(fileURLWithPath: path),
- atomically: true,
- encoding: .utf8)
+ try? cheatsTxt.writeWithCompletePath(to: URL(fileURLWithPath: path))
manager.loadCheats()
let cheats = manager.getCheats()
for (index, cheat) in cheats.enumerated() {
@@ -158,6 +157,34 @@ struct ThreeDS: ManicEmuCoreProtocol {
manager.saveCheats()
#endif
}
+
+ struct Cheat {
+ let name: String
+ let code: String
+ }
+
+ static func parseCheatFile(_ text: String) -> [Cheat] {
+ let pattern = #"\[(.*?)\]\s*([\s\S]*?)(?=\n\s*\[|$)"#
+
+ let regex = try! NSRegularExpression(pattern: pattern, options: [])
+ let nsText = text as NSString
+ let matches = regex.matches(
+ in: text,
+ options: [],
+ range: NSRange(location: 0, length: nsText.length)
+ )
+
+ return matches.compactMap { match in
+ guard match.numberOfRanges == 3 else { return nil }
+
+ let title = nsText.substring(with: match.range(at: 1))
+
+ let rawCode = nsText.substring(with: match.range(at: 2))
+ let code = rawCode.trimmingCharacters(in: .whitespacesAndNewlines)
+
+ return Cheat(name: title, code: code)
+ }
+ }
}
enum ThreeDSKeyboardType: UInt {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/CreamAssetExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/CreamAssetExtensions.swift
index 22c55fa1..7f08c360 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/CreamAssetExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/CreamAssetExtensions.swift
@@ -33,5 +33,5 @@ extension CreamAsset: ObjectUpdatable {
return nil
}
- func updateExtra(key: String, value: Any) {}
+ func updateExtra(key: String, value: Any?) {}
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/DataExtension.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/DataExtension.swift
index 502ec4a9..dcd8efc4 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/DataExtension.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/DataExtension.swift
@@ -97,4 +97,16 @@ extension Data {
let digest = Insecure.MD5.hash(data: self)
return digest.map { String(format: "%02hhx", $0) }.joined()
}
+
+ func writeWithCompletePath(to path: String) throws {
+ try writeWithCompletePath(to: URL(fileURLWithPath: path))
+ }
+
+ func writeWithCompletePath(to url: URL) throws {
+ let parentUrl = url.deletingLastPathComponent()
+ if !FileManager.default.fileExists(atPath: parentUrl.path) {
+ try FileManager.default.createDirectory(at: parentUrl, withIntermediateDirectories: true)
+ }
+ try write(to: url)
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift
index dc7509bf..68aaa4fc 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/GameTypeExtensions.swift
@@ -23,7 +23,7 @@ extension GameType {
case "iso":
return [.psp, .mcd, .ss]
case "bin":
- return [.md, .gg, .ms, ._32x, .dc]
+ return [.md, .gg, .ms, ._32x, .dc, .a2600, .a5200, .a7800, .jaguar]
case "cue":
return [.ps1, .mcd, .ss, .dc]
case "m3u":
@@ -86,6 +86,16 @@ extension GameType {
self = .dc
} else if ["zip", "7z", "cmd"].contains(ext) {
self = .arcade
+ } else if ["a26", "bin"].contains(ext) {
+ self = .a2600
+ } else if ["a52", "bin"].contains(ext) {
+ self = .a5200
+ } else if ["a78", "bin", "cdf"].contains(ext) {
+ self = .a7800
+ } else if ["j64", "jag", "rom", "abs", "cof", "bin", "prg"].contains(ext) {
+ self = .jaguar
+ } else if ["lnx", "o"].contains(ext) {
+ self = .lynx
} else {
self = .notSupport
}
@@ -148,7 +158,17 @@ extension GameType {
self = .arcade
} else if shortName.uppercased() == "NS" {
self = .ns
- } else {
+ } else if shortName.uppercased() == "2600" {
+ self = .a2600
+ } else if shortName.uppercased() == "5200" {
+ self = .a5200
+ } else if shortName.uppercased() == "7800" {
+ self = .a7800
+ } else if shortName.uppercased() == "JAGUAR" {
+ self = .jaguar
+ } else if shortName.uppercased() == "LYNX" {
+ self = .lynx
+ } else {
return nil
}
}
@@ -179,6 +199,11 @@ extension GameType {
case .dc: return "Dreamcast"
case .arcade: return "Arcade"
case .ns: return "Nintendo Switch"
+ case .a2600: return "Atari 2600"
+ case .a5200: return "Atari 5200 SuperSystem"
+ case .a7800: return "Atari 7800 ProSystem"
+ case .jaguar: return "Atari Jaguar"
+ case .lynx: return "Atari Lynx"
default: return ""
}
}
@@ -209,6 +234,11 @@ extension GameType {
case .dc: return NSLocalizedString("DC", comment: "")
case .arcade: return NSLocalizedString("Arcade", comment: "")
case .ns: return NSLocalizedString("NS", comment: "")
+ case .a2600: return NSLocalizedString("2600", comment: "")
+ case .a5200: return NSLocalizedString("5200", comment: "")
+ case .a7800: return NSLocalizedString("7800", comment: "")
+ case .jaguar: return NSLocalizedString("JAGUAR", comment: "")
+ case .lynx: return NSLocalizedString("LYNX", comment: "")
case .unknown: return R.string.localizable.unknownPlatform()
default: return ""
}
@@ -240,6 +270,11 @@ extension GameType {
case .dc: return 1998
case .arcade: return 1971
case .ns: return 2017
+ case .a2600: return 1977
+ case .a5200: return 1982
+ case .a7800: return 1986
+ case .lynx: return 1989
+ case .jaguar: return 1993
default: return 0
}
}
@@ -269,6 +304,11 @@ extension GameType {
case .ps1: return PS1.core
case .dc: return DC.core
case .arcade: return Arcade.core
+ case .a2600: return A2600.core
+ case .a5200: return A5200.core
+ case .a7800: return A7800.core
+ case .jaguar: return Jaguar.core
+ case .lynx: return Lynx.core
default: return nil
}
}
@@ -299,6 +339,12 @@ extension GameType {
#endif
} else if self == ._3ds {
return [LibretroCore.Cores.Citra.name, LibretroCore.Cores.Azahar.name]
+ } else if self == ._32x || self == .mcd {
+#if SIDE_LOAD
+ return [LibretroCore.Cores.PicoDrive.name, LibretroCore.Cores.JGenesis.name]
+#endif
+ } else if self == .ds {
+ return [LibretroCore.Cores.melonDSDS.name, LibretroCore.Cores.DeSmuME.name]
}
return []
}
@@ -353,6 +399,8 @@ extension GameType {
return .sega
case .arcade:
return .arcade
+ case .a2600, .a5200, .a7800, .jaguar, .lynx:
+ return .atari
default:
return .nintendo
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/LibretroCoreExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/LibretroCoreExtensions.swift
index 68d409df..b4395ba0 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/LibretroCoreExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/LibretroCoreExtensions.swift
@@ -9,7 +9,7 @@
extension LibretroCore {
enum Cores {
- case Nestopia, Snes9x, PicoDrive, Yabause, BeetleSaturn, Mupen64PlushNext, BeetleVB, PokeMini, BeetlePSXHW, bsnes, Gambatte, VBAM, mGBA, Flycast, Gearsystem, ClownMDEmu, bsnesJG, melonDSDS, PPSSPP, MAME, FinalBurnNeo, Citra, Azahar
+ case Nestopia, Snes9x, PicoDrive, Yabause, BeetleSaturn, Mupen64PlushNext, BeetleVB, PokeMini, BeetlePSXHW, bsnes, Gambatte, VBAM, mGBA, Flycast, Gearsystem, ClownMDEmu, bsnesJG, melonDSDS, PPSSPP, MAME, FinalBurnNeo, Citra, Azahar, JGenesis, DeSmuME, Stella, Atari800, ProSystem, VirtualJaguar, Holani
var name: String {
switch self {
@@ -59,6 +59,20 @@ extension LibretroCore {
"Citra"
case .Azahar:
"Azahar"
+ case .JGenesis:
+ "JGenesis"
+ case .DeSmuME:
+ "DeSmuME"
+ case .Stella:
+ "Stella"
+ case .Atari800:
+ "Atari800"
+ case .ProSystem:
+ "ProSystem"
+ case .VirtualJaguar:
+ "Virtual Jaguar"
+ case .Holani:
+ "Holani"
}
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift
index 8227d1fe..bdc40a40 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/StringExtensions.swift
@@ -14,6 +14,7 @@
//
import Foundation
+import CommonCrypto
//模式匹配可用
@@ -197,6 +198,34 @@ extension String {
return !self.unicodeScalars.contains { !allowedCharacterSet.contains($0) }
}
+ /// 高效 SHA256(固定 64 位 hex)
+ @inline(__always)
+ func sha256() -> String {
+ let data = Data(self.utf8)
+
+ var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
+ data.withUnsafeBytes { buffer in
+ _ = CC_SHA256(buffer.baseAddress, CC_LONG(buffer.count), &hash)
+ }
+
+ return hash.map { String(format: "%02x", $0) }.joined()
+ }
+
+ func trimedExceptNumberAndLetters() -> String {
+ return self.filter { ($0 >= "a" && $0 <= "z") || ($0 >= "A" && $0 <= "Z") || ($0 >= "0" && $0 <= "9") }
+ }
+
+ func writeWithCompletePath(to path: String) throws {
+ try writeWithCompletePath(to: URL(fileURLWithPath: path))
+ }
+
+ func writeWithCompletePath(to url: URL) throws {
+ let parentUrl = url.deletingLastPathComponent()
+ if !FileManager.default.fileExists(atPath: parentUrl.path) {
+ try FileManager.default.createDirectory(at: parentUrl, withIntermediateDirectories: true)
+ }
+ try write(to: url, atomically: true, encoding: .utf8)
+ }
}
// 扩展用于识别 emoji 的字符集
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift
index a19a9576..3d65bc28 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIDeviceExtensions.swift
@@ -178,6 +178,14 @@ extension UIDevice {
static var isDarkMode: Bool {
ApplicationSceneDelegate.applicationWindow?.traitCollection.userInterfaceStyle == .dark
}
+
+ static var isIOS15: Bool {
+ if #available(iOS 16, *) {
+ return false
+ } else {
+ return true
+ }
+ }
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIViewControllerExtensions.swift b/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIViewControllerExtensions.swift
index fe864da7..90a59ef5 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIViewControllerExtensions.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Extensions/UIViewControllerExtensions.swift
@@ -41,7 +41,6 @@ extension BaseViewController {
func addCloseButton(onTap: (() -> Void)? = nil, makeConstraints: ((ConstraintMaker) -> Void)? = nil) {
view.addSubview(closeButton)
- closeButton.backgroundColor = Constants.Color.BackgroundSecondary
closeButton.snp.makeConstraints { (maker) in
if makeConstraints != nil {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift
index cebcc5c7..d496afcb 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/FilesImporter.swift
@@ -490,6 +490,11 @@ extension FilesImporter {
game.aliasName = mameInfo.name
}
+#if !SIDE_LOAD
+ if game.isJGenesisCore {
+ game.defaultCore = 1
+ }
+#endif
do {
if ciaTitleUrl == nil {
//cia格式的3DS不需要拷贝了 因为已经安装进游戏目录了
@@ -510,6 +515,13 @@ extension FilesImporter {
SyncManager.upload(localFilePath: game.romUrl.path)
OnlineCoverManager.shared.addCoverMatch(OnlineCoverManager.CoverMatch(game: game))
completion?(game.gameType == ._3ds ? (game.aliasName ?? game.name) : game.name, nil)
+
+ //获取PSP的game code
+ if gameType == .psp,
+ let gameCode = LibretroCore.getPSPGameID(withRomPath: game.romUrl.path) {
+ game.updateExtra(key: ExtraKey.PSPGameCode.rawValue, value: gameCode)
+ }
+
return
} catch {
//写入数据失败
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/INIFile.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/INIFile.swift
index 86999da8..5b3e9b43 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/INIFile.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/INIFile.swift
@@ -359,6 +359,6 @@ class INIFile {
}
lines += thisNote.trimmingCharacters(in: .newlines)
- try lines.write(to: URL(fileURLWithPath: fileName), atomically: true, encoding: encoding)
+ try lines.writeWithCompletePath(to: URL(fileURLWithPath: fileName))
}
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift
index ae19e575..eadf2d64 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/ImageFetcher.swift
@@ -24,14 +24,22 @@ struct ImageFetcher {
return editConfig
}
- static func capture(preferenceSize: CGSize = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
+ static func capture(preferenceSize: CGSize? = .init(Constants.Size.GameCoverMaxSize), isOpenEditor: Bool = true, completion: @escaping (_ image: UIImage?)->Void) {
//拍摄
PermissionKit.requestCamera {
var config = CameraConfiguration()
- config.editor = defaultEditorConfiguration()
+ if isOpenEditor {
+ config.editor = defaultEditorConfiguration()
+ } else {
+ config.allowsEditing = false
+ }
let vc = Photo.capture(config, type: .photo, sender: topViewController()) { result, _, _ in
if case .image(let image) = result {
- completion(image.scaled(toSize: preferenceSize))
+ if let preferenceSize {
+ completion(image.scaled(toSize: preferenceSize))
+ } else {
+ completion(image)
+ }
} else {
completion(nil)
}
@@ -41,19 +49,23 @@ struct ImageFetcher {
}
}
- static func pick(preferenceSize: CGSize = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
+ static func pick(preferenceSize: CGSize? = .init(Constants.Size.GameCoverMaxSize), isOpenEditor: Bool = true, completion: @escaping (_ image: UIImage?)->Void) {
PermissionKit.requestPhoto {
var config = PickerConfiguration.default
config.navigationBackgroundColor = Constants.Color.BackgroundPrimary.forceStyle(.dark)
config.maximumSelectedCount = 1
config.selectMode = .single
config.selectOptions = [.livePhoto, .photo]
- config.photoSelectionTapAction = .openEditor
+ config.photoSelectionTapAction = isOpenEditor ? .openEditor : .quickSelect
config.editor = defaultEditorConfiguration()
let vc = Photo.picker(config, sender: topViewController()) { result, _ in
result.getImage(compressionScale: 1) { image in
if let image = image.first {
- completion(image.scaled(toSize: preferenceSize))
+ if let preferenceSize {
+ completion(image.scaled(toSize: preferenceSize))
+ } else {
+ completion(image)
+ }
} else {
completion(nil)
}
@@ -64,22 +76,30 @@ struct ImageFetcher {
}
}
- static func file(preferenceSize: CGSize = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
+ static func file(preferenceSize: CGSize? = .init(Constants.Size.GameCoverMaxSize), isOpenEditor: Bool = true, completion: @escaping (_ image: UIImage?)->Void) {
ImageFileFetcher.shared.file(preferenceSize: preferenceSize, completion: { image in
if let image {
- edit(image: image, preferenceSize: preferenceSize, completion: completion)
+ if isOpenEditor {
+ edit(image: image, preferenceSize: preferenceSize, completion: completion)
+ } else {
+ completion(image)
+ }
} else {
completion(nil)
}
})
}
- static func edit(image: UIImage, preferenceSize: CGSize = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
+ static func edit(image: UIImage, preferenceSize: CGSize? = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
let vc = Photo.edit(asset: .init(type: .image(image)), config: defaultEditorConfiguration(), finished: { asset, _ in
- if let newImage = asset.result?.image {
- completion(newImage.scaled(toSize: preferenceSize))
+ var result = image
+ if let url = asset.result?.url, let newImage = try? UIImage(url: url) {
+ result = newImage
+ }
+ if let preferenceSize {
+ completion(result.scaled(toSize: preferenceSize))
} else {
- completion(image.scaled(toSize: preferenceSize))
+ completion(result)
}
})
vc.sheetPresentationController?.preferredCornerRadius = Constants.Size.CornerRadiusMax
@@ -88,10 +108,10 @@ struct ImageFetcher {
fileprivate class ImageFileFetcher: NSObject {
static let shared = ImageFileFetcher()
- private var preferenceSize: CGSize = .init(Constants.Size.GameCoverMaxSize)
+ private var preferenceSize: CGSize? = nil
private var completion: ((_ image: UIImage?)->Void)? = nil
- func file(preferenceSize: CGSize = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
+ func file(preferenceSize: CGSize? = .init(Constants.Size.GameCoverMaxSize), completion: @escaping (_ image: UIImage?)->Void) {
self.preferenceSize = preferenceSize
self.completion = completion
let documentPickerViewController = UIDocumentPickerViewController(forOpeningContentTypes: [UTType.image], asCopy: true)
@@ -105,7 +125,11 @@ fileprivate class ImageFileFetcher: NSObject {
extension ImageFileFetcher: UIDocumentPickerDelegate {
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
if let url = urls.first, let image = try? UIImage(url: url) {
- completion?(image.scaled(toSize: preferenceSize))
+ if let preferenceSize {
+ completion?(image.scaled(toSize: preferenceSize))
+ } else {
+ completion?(image)
+ }
} else {
completion?(nil)
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/LocalWebServer.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/LocalWebServer.swift
new file mode 100644
index 00000000..72c5e72b
--- /dev/null
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/LocalWebServer.swift
@@ -0,0 +1,115 @@
+//
+// LocalWebServer.swift
+// ManicEmu
+//
+// Created by Daiuno on 2026/1/21.
+// Copyright © 2026 Manic EMU. All rights reserved.
+//
+import GCDWebServer
+
+class LocalWebServer {
+ enum ServerType {
+ case JGenesis, RomPatcher
+ }
+
+ private var server: GCDWebServer?
+ private let port: UInt = 8080
+ private var files: [String: String] = [:] // fileId -> filePath
+
+ func start(serverType: ServerType) throws {
+ server = GCDWebServer()
+
+ let resourcePath: String
+ switch serverType {
+ case .JGenesis:
+ resourcePath = Constants.Path.JGenesis
+
+ // 首先添加通用的目录处理器(优先级最低)
+ server?.addGETHandler(forBasePath: "/",
+ directoryPath: resourcePath,
+ indexFilename: nil,
+ cacheAge: 0,
+ allowRangeRequests: true)
+
+ // 然后添加特定文件类型的处理器(优先级更高)
+ // HTML 文件处理器
+ server?.addHandler(forMethod: "GET", pathRegex: "/.*\\.html", request: GCDWebServerRequest.self) { request in
+ let response = GCDWebServerDataResponse.init(htmlTemplate: resourcePath.appendingPathComponent(request.path), variables: [:])
+ response?.setValue("same-origin", forAdditionalHeader: "Cross-Origin-Opener-Policy")
+ response?.setValue("require-corp", forAdditionalHeader: "Cross-Origin-Embedder-Policy")
+ return response
+ }
+
+ // WASM 文件处理器,设置正确的 MIME type(优先级最高)
+ server?.addHandler(forMethod: "GET", pathRegex: "/.*\\.wasm", request: GCDWebServerRequest.self) { request in
+ let wasmPath = resourcePath.appendingPathComponent(request.path)
+ guard FileManager.default.fileExists(atPath: wasmPath) else {
+ return GCDWebServerResponse(statusCode: 404)
+ }
+ let response = GCDWebServerFileResponse(file: wasmPath)
+ // 直接设置 contentType 属性,而不是通过 header
+ response?.contentType = "application/wasm"
+ response?.setValue("same-origin", forAdditionalHeader: "Cross-Origin-Opener-Policy")
+ response?.setValue("require-corp", forAdditionalHeader: "Cross-Origin-Embedder-Policy")
+ return response
+ }
+
+ // ROM 文件流式处理器
+ server?.addHandler(forMethod: "GET", pathRegex: "/file/.*", request: GCDWebServerRequest.self) { [weak self] request in
+ guard let self else { return nil }
+ let fileId = request.path.lastPathComponent
+ guard let filePath = self.files[fileId] else {
+ return GCDWebServerResponse(statusCode: 404)
+ }
+
+ guard FileManager.default.fileExists(atPath: filePath) else {
+ return GCDWebServerResponse(statusCode: 404)
+ }
+
+ let response = GCDWebServerFileResponse(file: filePath)
+ response?.cacheControlMaxAge = 0
+ response?.setValue("no-cache, no-store, must-revalidate", forAdditionalHeader: "Cache-Control")
+ response?.setValue("no-cache", forAdditionalHeader: "Pragma")
+ response?.setValue("0", forAdditionalHeader: "Expires")
+ response?.setValue("same-origin", forAdditionalHeader: "Cross-Origin-Opener-Policy")
+ response?.setValue("require-corp", forAdditionalHeader: "Cross-Origin-Embedder-Policy")
+ response?.contentType = "application/octet-stream"
+ return response
+ }
+
+ case .RomPatcher:
+ resourcePath = Constants.Path.RomPatcher
+
+ // 首先添加通用的目录处理器(优先级最低)
+ server?.addGETHandler(forBasePath: "/",
+ directoryPath: resourcePath,
+ indexFilename: nil,
+ cacheAge: 0,
+ allowRangeRequests: true)
+ }
+
+ try server?.start(options: [
+ GCDWebServerOption_Port: port,
+ GCDWebServerOption_BindToLocalhost: true
+ ])
+
+ Log.debug("✅ 服务器启动: http://localhost:\(port)")
+ }
+
+ func stop() {
+ DispatchQueue.global(qos: .utility).async {
+ self.server?.stop()
+ }
+ }
+
+ func getURL() -> URL? {
+ return URL(string: "http://localhost:\(port)/index.html")
+ }
+
+ /// 注册 ROM 文件,返回唯一文件 ID
+ func registerFile(filePath: String) -> String {
+ let fileId = "\(filePath.lastPathComponent.sha256())"
+ files[fileId] = filePath
+ return fileId
+ }
+}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/MelonNXKit.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/MeloNXKit.swift
similarity index 95%
rename from ManicEmu/ManicEmu/Sources/Tools/Others/MelonNXKit.swift
rename to ManicEmu/ManicEmu/Sources/Tools/Others/MeloNXKit.swift
index fabc503b..83c9aace 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/MelonNXKit.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/MeloNXKit.swift
@@ -1,5 +1,5 @@
//
-// MelonNXKit.swift
+// MeloNXKit.swift
// ManicEmu
//
// Created by Daiuno on 2025/12/16.
@@ -13,7 +13,7 @@ extension GameType {
static let ns = GameType("public.aoshuang.game.ns")
}
-struct MelonNXKit {
+struct MeloNXKit {
static var isInstalled: Bool {
return UIApplication.shared.canOpenURL(Constants.URLs.FetchMeloNXGames)
}
@@ -62,7 +62,6 @@ struct MelonNXKit {
game.hasCoverMatch = true
if let icon = mg.iconData {
game.gameCover = CreamAsset.create(objectID: game.id, propName: "gameCover", data: icon)
- try? icon.write(to: URL(fileURLWithPath: Constants.Path.Document.appendingPathComponent("image.jpg")))
}
games.append(game)
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift
index 004c6649..0d083941 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/OnlineCoverManager.swift
@@ -74,49 +74,59 @@ class OnlineCoverManager {
var boxArtUrl: URL? = nil
switch coverMatch.gameType {
case ._3ds:
- boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo 3DS/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo 3DS/Named_Boxarts")
case .ds:
- boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo DS/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo DS/Named_Boxarts")
case .gba:
- boxArtUrl = host.appendingPathComponent("Nintendo - Game Boy Advance/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Game Boy Advance/Named_Boxarts")
case .gbc:
- boxArtUrl = host.appendingPathComponent("Nintendo - Game Boy Color/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Game Boy Color/Named_Boxarts")
case .gb:
- boxArtUrl = host.appendingPathComponent("Nintendo - Game Boy/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Game Boy/Named_Boxarts")
case .nes:
- boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo Entertainment System/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo Entertainment System/Named_Boxarts")
case .fds:
- boxArtUrl = host.appendingPathComponent("Nintendo - Family Computer Disk System/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Family Computer Disk System/Named_Boxarts")
case .snes:
- boxArtUrl = host.appendingPathComponent("Nintendo - Super Nintendo Entertainment System/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Super Nintendo Entertainment System/Named_Boxarts")
case .psp:
- boxArtUrl = host.appendingPathComponent("Sony - PlayStation Portable/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sony - PlayStation Portable/Named_Boxarts")
case .md:
- boxArtUrl = host.appendingPathComponent("Sega - Mega Drive - Genesis/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - Mega Drive - Genesis/Named_Boxarts")
case .mcd:
- boxArtUrl = host.appendingPathComponent("Sega - Mega-CD - Sega CD/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - Mega-CD - Sega CD/Named_Boxarts")
case ._32x:
- boxArtUrl = host.appendingPathComponent("Sega - 32X/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - 32X/Named_Boxarts")
case .gg:
- boxArtUrl = host.appendingPathComponent("Sega - Game Gear/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - Game Gear/Named_Boxarts")
case .ms:
- boxArtUrl = host.appendingPathComponent("Sega - Master System - Mark III/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - Master System - Mark III/Named_Boxarts")
case .sg1000:
- boxArtUrl = host.appendingPathComponent("Sega - SG-1000/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - SG-1000/Named_Boxarts")
case .ss:
- boxArtUrl = host.appendingPathComponent("Sega - Saturn/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - Saturn/Named_Boxarts")
case .n64:
- boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo 64/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Nintendo 64/Named_Boxarts")
case .vb:
- boxArtUrl = host.appendingPathComponent("Nintendo - Virtual Boy/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Virtual Boy/Named_Boxarts")
case .pm:
- boxArtUrl = host.appendingPathComponent("Nintendo - Pokemon Mini/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Nintendo - Pokemon Mini/Named_Boxarts")
case .ps1:
- boxArtUrl = host.appendingPathComponent("Sony - PlayStation/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sony - PlayStation/Named_Boxarts")
case .dc:
- boxArtUrl = host.appendingPathComponent("Sega - Dreamcast/Named_Boxarts/")
+ boxArtUrl = host.appendingPathComponent("Sega - Dreamcast/Named_Boxarts")
case .arcade:
boxArtUrl = host.appendingPathComponent("MAME/Named_Boxarts")
+ case .a2600:
+ boxArtUrl = host.appendingPathComponent("Atari - 2600/Named_Boxarts")
+ case .a5200:
+ boxArtUrl = host.appendingPathComponent("Atari - 5200/Named_Boxarts")
+ case .a7800:
+ boxArtUrl = host.appendingPathComponent("Atari - 7800/Named_Boxarts")
+ case .jaguar:
+ boxArtUrl = host.appendingPathComponent("Atari - Jaguar/Named_Boxarts")
+ case .lynx:
+ boxArtUrl = host.appendingPathComponent("Atari - Lynx/Named_Boxarts")
default:
boxArtUrl = nil
}
@@ -225,7 +235,7 @@ class OnlineCoverManager {
if let links {
//进行缓存
DispatchQueue.global().async {
- try? links.joined(separator: "\n").write(to: URL(fileURLWithPath: cachePath), atomically: true, encoding: .utf8)
+ try? links.joined(separator: "\n").writeWithCompletePath(to: URL(fileURLWithPath: cachePath))
}
completion?(links)
} else {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/PlatformSelectionView.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/PlatformSelectionView.swift
index 6bb44fdf..51360445 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/PlatformSelectionView.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/PlatformSelectionView.swift
@@ -91,7 +91,19 @@ class PlatformSelectionView: BaseView {
sheet?.pop {
Game.change { realm in
game.gameType = gameType
+#if !SIDE_LOAD
+ if game.isJGenesisCore {
+ game.defaultCore = 1
+ }
+#endif
+ }
+ //如果切换到PSP 则检查game code
+ if gameType == .psp,
+ game.gameCodeForPSP == nil,
+ let gameCode = LibretroCore.getPSPGameID(withRomPath: game.romUrl.path) {
+ game.updateExtra(key: ExtraKey.PSPGameCode.rawValue, value: gameCode)
}
+
NotificationCenter.default.post(name: Constants.NotificationName.PlatformSelectionChange, object: nil)
if !game.hasCoverMatch {
OnlineCoverManager.shared.addCoverMatch(OnlineCoverManager.CoverMatch(game: game))
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/PurchaseManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/PurchaseManager.swift
index 7582e9b0..07745668 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/PurchaseManager.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/PurchaseManager.swift
@@ -202,6 +202,30 @@ struct PurchaseManager {
}
}
+ @available(iOS 16.0, *)
+ static func redeemOfferCode(completion: ((_ isCompleted: Bool, _ isMember: Bool)->Void)? = nil) {
+ if let scene = ApplicationSceneDelegate.applicationScene {
+ Task {
+ do {
+ try await AppStore.presentOfferCodeRedeemSheet(in: scene)
+ await refreshPurchase()
+ await MainActor.run {
+ if PurchaseManager.isMember {
+ completion?(true, true)
+ } else {
+ completion?(true, false)
+ }
+ }
+ } catch {
+ await MainActor.run {
+ completion?(false, PurchaseManager.isMember)
+ Log.error("兑换优惠代码失败:\(error)")
+ }
+ }
+ }
+ }
+ }
+
private static func handlePurchaseSuccess(transaction: Transaction) async {
await transaction.finish()
if PurchaseManager.isMember {
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/ShaderManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/ShaderManager.swift
index da4594ca..8d41720e 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/ShaderManager.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/ShaderManager.swift
@@ -9,9 +9,10 @@
struct ShaderManager {
- static func fetchShaders(source: ShadersListView.ShaderSource? = nil, isGlsl: Bool, selectedShader: Shader?, includeOriginal: Bool) -> ShadersListData {
+ static func fetchShaders(source: ShadersListView.ShaderSource? = nil, isGlsl: Bool, selectedShader: Shader?, includeOriginal: Bool, shaderConfig: ShaderConfig?, ignoreShaderConfig: Bool, currentCoreName: String?) -> ShadersListData {
var result = ShadersListData()
let sourceCase = source == nil ? ShadersListView.ShaderSource.allCases : [source!]
+ var hasSelectedShader = false
for source in sourceCase {
if source == .imported {
if FileManager.default.fileExists(atPath: Constants.Path.ShaderImportedInDocument) {
@@ -25,9 +26,15 @@ struct ShaderManager {
let shadersRelativePathes = findShaderFiles(in: source.searchUrl, isGlsl: isGlsl, isRecursive: isRecursive)
switch source {
case .default, .custom:
- var shaders = shadersRelativePathes.map({ genShader($0, isSelected: selectedShader == nil ? false : ($0 == selectedShader!.relativePath)) })
+ var shaders = shadersRelativePathes.map({
+ let shader = genShader($0, selectedShader: selectedShader, shaderConfig: shaderConfig, ignoreShaderConfig: ignoreShaderConfig, currentCoreName: currentCoreName)
+ if shader.isSelected {
+ hasSelectedShader = true
+ }
+ return shader
+ })
if source == .default, includeOriginal {
- shaders.insert(ShaderManager.genOriginalShader(isSelected: selectedShader == nil ? true : false), at: 0)
+ shaders.insert(ShaderManager.genOriginalShader(), at: 0)
}
result[source] = [("", shaders)]
case .retroarch, .imported:
@@ -37,7 +44,10 @@ struct ShaderManager {
let components = path.pathComponents
if components.count > sectionTitleIndex + 1 {
let sectionTitle = components[sectionTitleIndex]
- let shader = genShader(path, isSelected: selectedShader == nil ? false : (path == selectedShader!.relativePath))
+ let shader = genShader(path, selectedShader: selectedShader, shaderConfig: shaderConfig, ignoreShaderConfig: ignoreShaderConfig, currentCoreName: currentCoreName)
+ if shader.isSelected {
+ hasSelectedShader = true
+ }
if var shaderArray = subResult[sectionTitle] {
shaderArray.append(shader)
subResult[sectionTitle] = shaderArray.sorted(by: {
@@ -51,6 +61,46 @@ struct ShaderManager {
result[source] = subResult.sorted(by: \.key).map({ ($0, $1) })
}
}
+
+ if !hasSelectedShader, let _ = result[.default] {
+ //需要把"原始"设置为选中
+ result[.default]![0].shaders[0].isSelected = true
+ }
+
+ //将多个选中的shader选出一个值得选中的
+ var selectedShaders = [(source: ShadersListView.ShaderSource, section: Int, index: Int, shader: Shader)]()
+ for source in result.keys {
+ if let shadersInSouce = result[source] {
+ for (section, shadersInSection) in shadersInSouce.enumerated() {
+ for (index, shader) in shadersInSection.shaders.enumerated() {
+ if shader.isSelected {
+ selectedShaders.append((source, section, index, shader))
+ }
+ }
+ }
+ }
+ }
+ if selectedShaders.count > 1 {
+ selectedShaders = selectedShaders.sorted(by: { left, _ in
+ if left.shader.isOriginal {
+ return true
+ }
+ if let selectedShader, left.shader.relativePath == selectedShader.relativePath {
+ return true
+ }
+ if let currentCoreName, left.shader.coreConfigs.contains(currentCoreName) {
+ return true
+ }
+ if left.shader.isGlobalConfig {
+ return true
+ }
+ return false
+ })
+ selectedShaders[1...].forEach({
+ result[$0.source]![$0.section].shaders[$0.index].isSelected = false
+ })
+ }
+
return result
}
@@ -89,12 +139,34 @@ struct ShaderManager {
return nil
}
- static func genShader(_ relativePath: String, isSelected: Bool) -> Shader {
- Shader(title: relativePath.deletingPathExtension.lastPathComponent, isSelected: isSelected, relativePath: relativePath)
+ static func genShader(_ relativePath: String, selectedShader: Shader?, shaderConfig: ShaderConfig?, ignoreShaderConfig: Bool, currentCoreName: String?) -> Shader {
+ var isSelected = false
+ if let selectedShader {
+ isSelected = (selectedShader.relativePath == relativePath)
+ }
+ var shader = Shader(title: relativePath.deletingPathExtension.lastPathComponent, isSelected: isSelected, relativePath: relativePath)
+ var isCoreConfig = false
+ if let shaderConfig {
+ shaderConfig.coreConfigs.forEach { core, shaderName in
+ if shader.relativePath == shaderName {
+ shader.coreConfigs.append(core)
+ if let currentCoreName, core == currentCoreName {
+ isCoreConfig = true
+ }
+ }
+ }
+ if let globalConfig = shaderConfig.globalConfig, shader.relativePath == globalConfig {
+ shader.isGlobalConfig = true
+ }
+ }
+ if selectedShader == nil && (isCoreConfig || shader.isGlobalConfig) && !ignoreShaderConfig {
+ shader.isSelected = true
+ }
+ return shader
}
- static func genOriginalShader(isSelected: Bool) -> Shader {
- var shader = Shader(title: R.string.localizable.filterOriginTitle(), isSelected: isSelected, relativePath: "")
+ static func genOriginalShader() -> Shader {
+ var shader = Shader(title: R.string.localizable.filterOriginTitle(), isSelected: false, relativePath: "")
shader.isOriginal = true
return shader
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/ShareManager.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/ShareManager.swift
index 71d1b77f..9bb8a2f0 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/ShareManager.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/ShareManager.swift
@@ -229,7 +229,7 @@ extension ShareManager: UIDocumentInteractionControllerDelegate {
try? FileManager.default.removeItem(at: tempURL)
}
do {
- try data.write(to: tempURL)
+ try data.writeWithCompletePath(to: tempURL)
} catch {
return
}
diff --git a/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift b/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift
index 01c1588e..84d9e96f 100644
--- a/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift
+++ b/ManicEmu/ManicEmu/Sources/Tools/Others/System.swift
@@ -11,6 +11,11 @@ import ManicEmuCore
enum System: CaseIterable
{
+ case jaguar
+ case lynx
+ case a7800
+ case a5200
+ case a2600
case ns
case arcade
case dc
@@ -41,7 +46,7 @@ enum System: CaseIterable
}
static var allCores: [ManicEmuCoreProtocol] {
- return [NES.core, SNES.core, ThreeDS.core, GBC.core, GBA.core, PSP.core, MD.core, MCD.core, S2X.core, SG1000.core, GG.core, MS.core, SS.core, N64.core, GB.core, VB.core, PM.core, PS1.core, DC.core, DS.core, FDS.core, Arcade.core]
+ return [NES.core, SNES.core, ThreeDS.core, GBC.core, GBA.core, PSP.core, MD.core, MCD.core, S2X.core, SG1000.core, GG.core, MS.core, SS.core, N64.core, GB.core, VB.core, PM.core, PS1.core, DC.core, DS.core, FDS.core, Arcade.core, A2600.core, A5200.core, A7800.core, Lynx.core, Jaguar.core]
}
}
@@ -73,6 +78,11 @@ extension System {
case .fds: return .fds
case .arcade: return .arcade
case .ns: return .ns
+ case .a2600: return .a2600
+ case .a5200: return .a5200
+ case .a7800: return .a7800
+ case .jaguar: return .jaguar
+ case .lynx: return .lynx
}
}
}
diff --git a/ManicEmu/Podfile.lock b/ManicEmu/Podfile.lock
index d5537098..996452a8 100644
--- a/ManicEmu/Podfile.lock
+++ b/ManicEmu/Podfile.lock
@@ -351,7 +351,7 @@ SPEC CHECKSUMS:
Kingfisher: 3204d23de16b5ea53541c44ca5a8efb55741dec3
LookinServer: 1b2b61c6402ae29fa22182d48f5cd067b4e99e80
ManicEmuCore: 34894a1ba8092736be51d06ce9bec33d8c7df58d
- ManicSupport: 8ae21bae33d19eb2e34c82543edfb35481781453
+ ManicSupport: 76b12c9a8557f6da19609516aa396681c1b7cb7d
MarqueeLabel: 4b46d196abd253448e830cbd976f9eacc3af0849
NVActivityIndicatorView: fe52a6a68664c2df8991d7d9e3d86d8d19453c53
OAuthSwift: 75efbb5bd9a4b2b71a37bd7e986bf3f55ddd54c6
diff --git a/ManicEmu/ThreeDS/Custom/ThreeDSObjC.h b/ManicEmu/ThreeDS/Custom/ThreeDSObjC.h
index f303ce58..7b9e61e5 100644
--- a/ManicEmu/ThreeDS/Custom/ThreeDSObjC.h
+++ b/ManicEmu/ThreeDS/Custom/ThreeDSObjC.h
@@ -42,6 +42,7 @@
#include "core/hle/service/nfc/nfc_device.h"
#include "core/hle/service/apt/apt_u.h"
#include "core/hle/service/apt/applet_manager.h"
+#include "core/hle/service/mic/mic_u.h"
namespace InformationForGame {
std::vector<u8> GetSMDHData(const std::string& path) {
diff --git a/ManicSupport/ManicSupport.podspec b/ManicSupport/ManicSupport.podspec
index d3752117..c50c5cb2 100644
--- a/ManicSupport/ManicSupport.podspec
+++ b/ManicSupport/ManicSupport.podspec
@@ -3,9 +3,9 @@ Pod::Spec.new do |s|
s.version = "1.0.2"
s.summary = "Delta emulator support libraries"
s.license = { :type => 'MIT License', :file => 'LICENSE' } # 协议
- s.homepage = "https://github.com/rileytestut/GBADeltaCore"
- s.author = { "Riley Testut" => "[email protected]" }
- s.source = { :git => "https://github.com/rileytestut/GBADeltaCore.git" }
+ s.homepage = "https://manicemu.site/"
+ s.author = { "Daiuno" => "[email protected]" }
+ s.source = { :git => "https://github.com/Manic-EMU/ManicEMU.git" }
s.platform = :ios, '14.0'
s.requires_arc = true
s.vendored_frameworks = 'Frameworks/**/*.xcframework'
diff --git a/ManicSupport/Resources/System.core b/ManicSupport/Resources/System.core
index 2372b6f8..87ddd305 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:31468347b915c7174c4c6ad97c009cf090128ec9f34e81f371b14ff216a4d3e9
-size 50632468
+oid sha256:a2258e654a1184b1115dc9a4307601390012ed9bd12b06bf22e5dfaa267d947b
+size 59302195
diff --git a/ProHUD/Sources/ProHUD/Alert/AlertWindow.swift b/ProHUD/Sources/ProHUD/Alert/AlertWindow.swift
index bd09c7a1..4253317a 100644
--- a/ProHUD/Sources/ProHUD/Alert/AlertWindow.swift
+++ b/ProHUD/Sources/ProHUD/Alert/AlertWindow.swift
@@ -24,6 +24,7 @@ class AlertWindow: Window {
} else {
w = .init(frame: AppContext.appBounds)
}
+ w.tintColor = UIColor(red: 1, green: 36/255, blue: 66/255, alpha: 1)
if let windowScene = windowScene {
AppContext.alertWindow[windowScene] = w
}
diff --git a/ProHUD/Sources/ProHUD/Capsule/CapsuleWindow.swift b/ProHUD/Sources/ProHUD/Capsule/CapsuleWindow.swift
index 381a8c61..9a86bc01 100644
--- a/ProHUD/Sources/ProHUD/Capsule/CapsuleWindow.swift
+++ b/ProHUD/Sources/ProHUD/Capsule/CapsuleWindow.swift
@@ -14,6 +14,7 @@ class CapsuleWindow: Window {
init(capsule: CapsuleTarget) {
self.capsule = capsule
super.init(frame: .zero)
+ tintColor = UIColor(red: 1, green: 36/255, blue: 66/255, alpha: 1)
isUserInteractionEnabled = false
windowScene = AppContext.windowScene
switch capsule.vm?.position {
diff --git a/ProHUD/Sources/ProHUD/Sheet/SheetWindow.swift b/ProHUD/Sources/ProHUD/Sheet/SheetWindow.swift
index 2c2a8f8a..d89a3081 100644
--- a/ProHUD/Sources/ProHUD/Sheet/SheetWindow.swift
+++ b/ProHUD/Sources/ProHUD/Sheet/SheetWindow.swift
@@ -18,6 +18,7 @@ class SheetWindow: Window {
} else {
super.init(frame: AppContext.appBounds)
}
+ tintColor = UIColor(red: 1, green: 36/255, blue: 66/255, alpha: 1)
sheet.window = self
windowLevel = .phSheet
isHidden = false
diff --git a/ProHUD/Sources/ProHUD/Toast/ToastWindow.swift b/ProHUD/Sources/ProHUD/Toast/ToastWindow.swift
index 87ed9c4e..f93ed770 100644
--- a/ProHUD/Sources/ProHUD/Toast/ToastWindow.swift
+++ b/ProHUD/Sources/ProHUD/Toast/ToastWindow.swift
@@ -16,6 +16,7 @@ class ToastWindow: Window {
init(toast: ToastTarget) {
self.toast = toast
super.init(frame: .zero)
+ tintColor = UIColor(red: 1, green: 36/255, blue: 66/255, alpha: 1)
windowScene = AppContext.windowScene
toast.window = self
windowLevel = .phToast