Limits DSi support to beta versions
This commit is contained in:
parent
6cfca53dc8
commit
8888b72d29
@ -136,6 +136,8 @@ extension DatabaseManager
|
|||||||
filename = "nds.bios"
|
filename = "nds.bios"
|
||||||
|
|
||||||
case Game.melonDSDSiBIOSIdentifier:
|
case Game.melonDSDSiBIOSIdentifier:
|
||||||
|
#if BETA
|
||||||
|
|
||||||
guard
|
guard
|
||||||
FileManager.default.fileExists(atPath: MelonDSEmulatorBridge.shared.dsiBIOS7URL.path) &&
|
FileManager.default.fileExists(atPath: MelonDSEmulatorBridge.shared.dsiBIOS7URL.path) &&
|
||||||
FileManager.default.fileExists(atPath: MelonDSEmulatorBridge.shared.dsiBIOS9URL.path) &&
|
FileManager.default.fileExists(atPath: MelonDSEmulatorBridge.shared.dsiBIOS9URL.path) &&
|
||||||
@ -145,6 +147,10 @@ extension DatabaseManager
|
|||||||
|
|
||||||
filename = "dsi.bios"
|
filename = "dsi.bios"
|
||||||
|
|
||||||
|
#else
|
||||||
|
return nil
|
||||||
|
#endif
|
||||||
|
|
||||||
default: filename = "system.bios"
|
default: filename = "system.bios"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -138,6 +138,36 @@ class MelonDSCoreSettingsViewController: UITableViewController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension MelonDSCoreSettingsViewController
|
||||||
|
{
|
||||||
|
func isSectionHidden(_ section: Section) -> Bool
|
||||||
|
{
|
||||||
|
#if BETA
|
||||||
|
let isBeta = true
|
||||||
|
#else
|
||||||
|
let isBeta = false
|
||||||
|
#endif
|
||||||
|
|
||||||
|
switch section
|
||||||
|
{
|
||||||
|
case .dsBIOS where Settings.preferredCore(for: .ds) == DS.core:
|
||||||
|
// Using DeSmuME core, which doesn't require BIOS.
|
||||||
|
return true
|
||||||
|
|
||||||
|
case .dsiBIOS where Settings.preferredCore(for: .ds) == DS.core || !isBeta:
|
||||||
|
// Using DeSmuME core, which doesn't require BIOS,
|
||||||
|
// or using public Delta version, which doesn't support DSi (yet).
|
||||||
|
return true
|
||||||
|
|
||||||
|
case .changeCore where !isBeta:
|
||||||
|
// Using public Delta version, which only supports melonDS core.
|
||||||
|
return true
|
||||||
|
|
||||||
|
default: return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private extension MelonDSCoreSettingsViewController
|
private extension MelonDSCoreSettingsViewController
|
||||||
{
|
{
|
||||||
func openMetadataURL(for key: DeltaCoreMetadata.Key)
|
func openMetadataURL(for key: DeltaCoreMetadata.Key)
|
||||||
@ -231,6 +261,20 @@ private extension MelonDSCoreSettingsViewController
|
|||||||
|
|
||||||
extension MelonDSCoreSettingsViewController
|
extension MelonDSCoreSettingsViewController
|
||||||
{
|
{
|
||||||
|
override func tableView(_ tableView: UITableView, numberOfRowsInSection sectionIndex: Int) -> Int
|
||||||
|
{
|
||||||
|
let section = Section(rawValue: sectionIndex)!
|
||||||
|
|
||||||
|
if isSectionHidden(section)
|
||||||
|
{
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return super.tableView(tableView, numberOfRowsInSection: sectionIndex)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
|
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
|
||||||
{
|
{
|
||||||
let cell = super.tableView(tableView, cellForRowAt: indexPath)
|
let cell = super.tableView(tableView, cellForRowAt: indexPath)
|
||||||
@ -340,28 +384,30 @@ extension MelonDSCoreSettingsViewController
|
|||||||
|
|
||||||
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?
|
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String?
|
||||||
{
|
{
|
||||||
switch Section(rawValue: section)!
|
let section = Section(rawValue: section)!
|
||||||
|
|
||||||
|
if isSectionHidden(section)
|
||||||
{
|
{
|
||||||
case .dsBIOS, .dsiBIOS:
|
return nil
|
||||||
guard Settings.preferredCore(for: .ds) == MelonDS.core else { return nil }
|
}
|
||||||
|
else
|
||||||
default: break
|
{
|
||||||
|
return super.tableView(tableView, titleForHeaderInSection: section.rawValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.tableView(tableView, titleForHeaderInSection: section)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String?
|
override func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String?
|
||||||
{
|
{
|
||||||
switch Section(rawValue: section)!
|
let section = Section(rawValue: section)!
|
||||||
|
|
||||||
|
if isSectionHidden(section)
|
||||||
{
|
{
|
||||||
case .dsBIOS, .dsiBIOS:
|
return nil
|
||||||
guard Settings.preferredCore(for: .ds) == MelonDS.core else { return nil }
|
}
|
||||||
|
else
|
||||||
default: break
|
{
|
||||||
|
return super.tableView(tableView, titleForFooterInSection: section.rawValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.tableView(tableView, titleForFooterInSection: section)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat
|
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat
|
||||||
@ -372,9 +418,6 @@ extension MelonDSCoreSettingsViewController
|
|||||||
let key = DeltaCoreMetadata.Key.allCases[indexPath.row]
|
let key = DeltaCoreMetadata.Key.allCases[indexPath.row]
|
||||||
guard Settings.preferredCore(for: .ds)?.metadata?[key] != nil else { return 0 }
|
guard Settings.preferredCore(for: .ds)?.metadata?[key] != nil else { return 0 }
|
||||||
|
|
||||||
case .dsBIOS, .dsiBIOS:
|
|
||||||
guard Settings.preferredCore(for: .ds) == MelonDS.core else { return 0 }
|
|
||||||
|
|
||||||
default: break
|
default: break
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -383,28 +426,30 @@ extension MelonDSCoreSettingsViewController
|
|||||||
|
|
||||||
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
|
override func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat
|
||||||
{
|
{
|
||||||
switch Section(rawValue: section)!
|
let section = Section(rawValue: section)!
|
||||||
|
|
||||||
|
if isSectionHidden(section)
|
||||||
{
|
{
|
||||||
case .dsBIOS, .dsiBIOS:
|
return 1
|
||||||
guard Settings.preferredCore(for: .ds) == MelonDS.core else { return 1 }
|
}
|
||||||
|
else
|
||||||
default: break
|
{
|
||||||
|
return super.tableView(tableView, heightForHeaderInSection: section.rawValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.tableView(tableView, heightForHeaderInSection: section)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat
|
override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat
|
||||||
{
|
{
|
||||||
switch Section(rawValue: section)!
|
let section = Section(rawValue: section)!
|
||||||
|
|
||||||
|
if isSectionHidden(section)
|
||||||
{
|
{
|
||||||
case .dsBIOS, .dsiBIOS:
|
return 1
|
||||||
guard Settings.preferredCore(for: .ds) == MelonDS.core else { return 1 }
|
}
|
||||||
|
else
|
||||||
default: break
|
{
|
||||||
|
return super.tableView(tableView, heightForFooterInSection: section.rawValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.tableView(tableView, heightForFooterInSection: section)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user