Raises MelonDSDeltaCore maximum Fast Forward speed to 3x

This commit is contained in:
Riley Testut 2021-01-11 14:12:44 -06:00
parent 474cae0a5b
commit d0823b1acb
3 changed files with 24 additions and 17 deletions

View File

@ -409,20 +409,17 @@ extension GameViewController
self.pausingGameController = gameController
}
if self.emulatorCore?.deltaCore.supportedRates.upperBound == 1
{
pauseViewController.fastForwardItem = nil
}
switch self.game?.type
{
case .n64? where !UIDevice.current.hasA9ProcessorOrBetter:
// A8 processors and earlier aren't powerful enough to run N64 games faster than 1x speed.
pauseViewController.fastForwardItem = nil
case .ds? where self.emulatorCore?.deltaCore == DS.core:
// Cheats are not supported by DeSmuME core.
pauseViewController.cheatCodesItem = nil
case .ds? where !UIDevice.current.hasA9ProcessorOrBetter:
// A8 processors and earlier aren't powerful enough to run DS games faster than 1x speed.
pauseViewController.fastForwardItem = nil
default: break
}

View File

@ -8,15 +8,23 @@
import UIKit
import ARKit
import Metal
extension UIDevice
{
private static var mtlDevice: MTLDevice? = MTLCreateSystemDefaultDevice()
var hasA9ProcessorOrBetter: Bool {
// ARKit is only supported by devices with an A9 processor or better, according to the documentation.
// https://developer.apple.com/documentation/arkit/arconfiguration/2923553-issupported
return ARConfiguration.isSupported
}
var hasA11ProcessorOrBetter: Bool {
guard let mtlDevice = UIDevice.mtlDevice else { return false }
return mtlDevice.supportsFeatureSet(.iOS_GPUFamily4_v1) // iOS GPU Family 4 = A11 GPU
}
var supportsJIT: Bool {
guard #available(iOS 14.2, *) else { return false }

View File

@ -60,16 +60,18 @@ struct DeltaCoreMetadata
extension DeltaCoreProtocol
{
var supportedRates: ClosedRange<Double> {
return 1...self.maximumFastForwardSpeed
}
private var maximumFastForwardSpeed: Double {
switch self
{
case NES.core: return 1...4
case SNES.core: return 1...4
case GBC.core: return 1...4
case GBA.core: return 1...3
case N64.core: return 1...3
case DS.core: return 1...3
case MelonDS.core: return 1...2
default: return 1...2
case NES.core, SNES.core, GBC.core: return 4
case GBA.core: return 3
case N64.core where UIDevice.current.hasA9ProcessorOrBetter: return 3
case DS.core where UIDevice.current.supportsJIT: return 3
case DS.core where UIDevice.current.hasA11ProcessorOrBetter: return 2
default: return 1
}
}