Adds support for building Delta Lite (and Delta Lite beta)
Limits Delta Lite to NES games, and Delta Lite beta to NES and GBC games.
This commit is contained in:
parent
6e380814aa
commit
ebf3fc6c27
@ -38,11 +38,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
|||||||
{
|
{
|
||||||
Settings.registerDefaults()
|
Settings.registerDefaults()
|
||||||
|
|
||||||
#if BETA
|
self.registerCores()
|
||||||
System.allCases.forEach { Delta.register($0.deltaCore) }
|
|
||||||
#else
|
|
||||||
System.allCases.filter { $0 != .ds }.forEach { Delta.register($0.deltaCore) }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|
||||||
@ -114,8 +110,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AppDelegate
|
private extension AppDelegate
|
||||||
{
|
{
|
||||||
|
func registerCores()
|
||||||
|
{
|
||||||
|
#if LITE
|
||||||
|
|
||||||
|
#if BETA
|
||||||
|
Delta.register(System.nes.deltaCore)
|
||||||
|
Delta.register(System.gbc.deltaCore)
|
||||||
|
#else
|
||||||
|
Delta.register(System.nes.deltaCore)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if BETA
|
||||||
|
System.allCases.forEach { Delta.register($0.deltaCore) }
|
||||||
|
#else
|
||||||
|
System.allCases.filter { $0 != .ds }.forEach { Delta.register($0.deltaCore) }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
func configureAppearance()
|
func configureAppearance()
|
||||||
{
|
{
|
||||||
self.window?.tintColor = UIColor.deltaPurple
|
self.window?.tintColor = UIColor.deltaPurple
|
||||||
|
|||||||
@ -201,12 +201,10 @@ extension DatabaseManager
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !BETA
|
guard System.registeredSystems.contains(system) else {
|
||||||
guard system != .ds else {
|
|
||||||
errors.insert(.unsupported(url))
|
errors.insert(.unsupported(url))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
let identifier: String
|
let identifier: String
|
||||||
|
|
||||||
|
|||||||
@ -13,11 +13,25 @@ extension Bundle
|
|||||||
{
|
{
|
||||||
@objc private var swizzled_infoDictionary: [String : Any]? {
|
@objc private var swizzled_infoDictionary: [String : Any]? {
|
||||||
var infoDictionary = self.swizzled_infoDictionary
|
var infoDictionary = self.swizzled_infoDictionary
|
||||||
|
|
||||||
|
#if LITE
|
||||||
|
|
||||||
|
#if BETA
|
||||||
|
infoDictionary?[kCFBundleIdentifierKey as String] = "com.rileytestut.Delta.Lite.Beta"
|
||||||
|
#else
|
||||||
|
infoDictionary?[kCFBundleIdentifierKey as String] = "com.rileytestut.Delta.Lite"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#if BETA
|
#if BETA
|
||||||
infoDictionary?[kCFBundleIdentifierKey as String] = "com.rileytestut.Delta.AltStore.Beta"
|
infoDictionary?[kCFBundleIdentifierKey as String] = "com.rileytestut.Delta.AltStore.Beta"
|
||||||
#else
|
#else
|
||||||
infoDictionary?[kCFBundleIdentifierKey as String] = "com.rileytestut.Delta.AltStore"
|
infoDictionary?[kCFBundleIdentifierKey as String] = "com.rileytestut.Delta.AltStore"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return infoDictionary
|
return infoDictionary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -323,13 +323,7 @@ extension GamesViewController: ImportControllerDelegate
|
|||||||
{
|
{
|
||||||
@IBAction private func importFiles()
|
@IBAction private func importFiles()
|
||||||
{
|
{
|
||||||
#if BETA
|
var documentTypes = Set(System.registeredSystems.map { $0.gameType.rawValue })
|
||||||
let systems = System.allCases
|
|
||||||
#else
|
|
||||||
let systems = System.allCases.filter { $0 != .ds }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
var documentTypes = Set(systems.map { $0.gameType.rawValue })
|
|
||||||
documentTypes.insert(kUTTypeZipArchive as String)
|
documentTypes.insert(kUTTypeZipArchive as String)
|
||||||
|
|
||||||
// Add GBA4iOS's exported UTIs in case user has GBA4iOS installed (which may override Delta's UTI declarations)
|
// Add GBA4iOS's exported UTIs in case user has GBA4iOS installed (which may override Delta's UTI declarations)
|
||||||
|
|||||||
@ -66,11 +66,19 @@ class SettingsViewController: UITableViewController
|
|||||||
|
|
||||||
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
|
if let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String
|
||||||
{
|
{
|
||||||
|
#if LITE
|
||||||
|
self.versionLabel.text = NSLocalizedString(String(format: "Delta Lite %@", version), comment: "Delta Version")
|
||||||
|
#else
|
||||||
self.versionLabel.text = NSLocalizedString(String(format: "Delta %@", version), comment: "Delta Version")
|
self.versionLabel.text = NSLocalizedString(String(format: "Delta %@", version), comment: "Delta Version")
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#if LITE
|
||||||
|
self.versionLabel.text = NSLocalizedString("Delta Lite", comment: "")
|
||||||
|
#else
|
||||||
self.versionLabel.text = NSLocalizedString("Delta", comment: "")
|
self.versionLabel.text = NSLocalizedString("Delta", comment: "")
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +126,7 @@ class SettingsViewController: UITableViewController
|
|||||||
case Segue.controllerSkins:
|
case Segue.controllerSkins:
|
||||||
let systemControllerSkinsViewController = segue.destination as! SystemControllerSkinsViewController
|
let systemControllerSkinsViewController = segue.destination as! SystemControllerSkinsViewController
|
||||||
|
|
||||||
let system = System.allCases[indexPath.row]
|
let system = System.registeredSystems[indexPath.row]
|
||||||
systemControllerSkinsViewController.system = system
|
systemControllerSkinsViewController.system = system
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -232,13 +240,7 @@ extension SettingsViewController
|
|||||||
switch section
|
switch section
|
||||||
{
|
{
|
||||||
case .controllers: return 1 // Temporarily hide other controller indexes until controller logic is finalized
|
case .controllers: return 1 // Temporarily hide other controller indexes until controller logic is finalized
|
||||||
case .controllerSkins:
|
case .controllerSkins: return System.registeredSystems.count
|
||||||
#if BETA
|
|
||||||
return System.allCases.count
|
|
||||||
#else
|
|
||||||
return System.allCases.filter { $0 != .ds}.count
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case .syncing: return SyncManager.shared.coordinator?.account == nil ? 1 : super.tableView(tableView, numberOfRowsInSection: sectionIndex)
|
case .syncing: return SyncManager.shared.coordinator?.account == nil ? 1 : super.tableView(tableView, numberOfRowsInSection: sectionIndex)
|
||||||
default:
|
default:
|
||||||
if isSectionHidden(section)
|
if isSectionHidden(section)
|
||||||
@ -274,7 +276,9 @@ extension SettingsViewController
|
|||||||
cell.detailTextLabel?.text = nil
|
cell.detailTextLabel?.text = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
case .controllerSkins: cell.textLabel?.text = System.allCases[indexPath.row].localizedName
|
case .controllerSkins:
|
||||||
|
cell.textLabel?.text = System.registeredSystems[indexPath.row].localizedName
|
||||||
|
|
||||||
case .syncing:
|
case .syncing:
|
||||||
switch SyncingRow.allCases[indexPath.row]
|
switch SyncingRow.allCases[indexPath.row]
|
||||||
{
|
{
|
||||||
|
|||||||
@ -23,6 +23,11 @@ enum System: CaseIterable
|
|||||||
case gbc
|
case gbc
|
||||||
case gba
|
case gba
|
||||||
case ds
|
case ds
|
||||||
|
|
||||||
|
static var registeredSystems: [System] {
|
||||||
|
let systems = System.allCases.filter { Delta.registeredCores.keys.contains($0.gameType) }
|
||||||
|
return systems
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension System
|
extension System
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user