From d0ed98ba6b5fea843156cdc696db5389f4ad4d42 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Sun, 30 Apr 2017 19:36:48 -0700 Subject: [PATCH] Updates DeltaCore + system cores --- Cores/DeltaCore | 2 +- Cores/GBADeltaCore | 2 +- Cores/SNESDeltaCore | 2 +- Delta.xcodeproj/project.pbxproj | 4 ++++ .../xcshareddata/xcschemes/Delta.xcscheme | 2 +- Delta/Emulation/GameViewController.swift | 16 +++++++------- .../Extensions/DeltaCoreProtocol+Delta.swift | 21 +++++++++++++++++++ .../Cheats/EditCheatViewController.swift | 2 +- .../SaveStatesViewController.swift | 2 +- 9 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 Delta/Extensions/DeltaCoreProtocol+Delta.swift diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 99da200..9492085 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 99da200c440a8dad93d9b92314f91b933b659bf8 +Subproject commit 9492085ec6cbcd665df3347b843f5cce09c1b466 diff --git a/Cores/GBADeltaCore b/Cores/GBADeltaCore index ae5ab38..4eedbd4 160000 --- a/Cores/GBADeltaCore +++ b/Cores/GBADeltaCore @@ -1 +1 @@ -Subproject commit ae5ab38dbe6a5fc995f4f3a8cb7075dad3f8f6d5 +Subproject commit 4eedbd481457e3c236d1f3ffab3ba2f49c6d18df diff --git a/Cores/SNESDeltaCore b/Cores/SNESDeltaCore index e49d318..bdc95ae 160000 --- a/Cores/SNESDeltaCore +++ b/Cores/SNESDeltaCore @@ -1 +1 @@ -Subproject commit e49d318e2e18034b2bccea34047800956298de4a +Subproject commit bdc95aeb5e7f50263c34187cbe38ddddb4a2576e diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 4834848..c0f2006 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -85,6 +85,7 @@ BF9F4FD01AAD7B87004C9500 /* DeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BF9F4FCE1AAD7B87004C9500 /* DeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BFA0D1271D3AE1F600565894 /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF63BDE91D389EEB00FCB040 /* GameViewController.swift */; }; BFAA1FED1B8AA4FA00495943 /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFAA1FEC1B8AA4FA00495943 /* Settings.swift */; }; + BFBAB2E31EB685A2004E0B0E /* DeltaCoreProtocol+Delta.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFBAB2E21EB685A2004E0B0E /* DeltaCoreProtocol+Delta.swift */; }; BFC314771E0C8CFC0056E3A8 /* GameType+Delta.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC314761E0C8CFC0056E3A8 /* GameType+Delta.swift */; }; BFC9B7391CEFCD34008629BB /* CheatsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC9B7381CEFCD34008629BB /* CheatsViewController.swift */; }; BFCEA67E1D56FF640061A534 /* UIViewControllerContextTransitioning+Conveniences.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCEA67D1D56FF640061A534 /* UIViewControllerContextTransitioning+Conveniences.swift */; }; @@ -192,6 +193,7 @@ BF99A5961DC2F9C400468E9E /* ControllerSkinTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ControllerSkinTableViewCell.swift; path = "Controller Skins/ControllerSkinTableViewCell.swift"; sourceTree = ""; }; BF9F4FCE1AAD7B87004C9500 /* DeltaCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = DeltaCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BFAA1FEC1B8AA4FA00495943 /* Settings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = ""; }; + BFBAB2E21EB685A2004E0B0E /* DeltaCoreProtocol+Delta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DeltaCoreProtocol+Delta.swift"; sourceTree = ""; }; BFC134E01AAD82460087AD7B /* SNESDeltaCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = SNESDeltaCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BFC314761E0C8CFC0056E3A8 /* GameType+Delta.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "GameType+Delta.swift"; sourceTree = ""; }; BFC9B7381CEFCD34008629BB /* CheatsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CheatsViewController.swift; path = "Pause Menu/Cheats/CheatsViewController.swift"; sourceTree = ""; }; @@ -245,6 +247,7 @@ BF5942911E09BD1A0051894B /* NSManagedObject+Conveniences.swift */, BF5942921E09BD1A0051894B /* NSManagedObjectContext+Conveniences.swift */, BFC314761E0C8CFC0056E3A8 /* GameType+Delta.swift */, + BFBAB2E21EB685A2004E0B0E /* DeltaCoreProtocol+Delta.swift */, BF18B61E1E2985F900F70067 /* UIAlertController+Importing.swift */, ); path = Extensions; @@ -721,6 +724,7 @@ files = ( BF59426A1E09BBD00051894B /* GridCollectionViewCell.swift in Sources */, BF59427C1E09BC830051894B /* Cheat.swift in Sources */, + BFBAB2E31EB685A2004E0B0E /* DeltaCoreProtocol+Delta.swift in Sources */, BF3540081C5DAFAD00C1184C /* PauseTransitionCoordinator.swift in Sources */, BF59427E1E09BC830051894B /* Game.swift in Sources */, BFAA1FED1B8AA4FA00495943 /* Settings.swift in Sources */, diff --git a/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme b/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme index 17d2b36..f3e1d85 100644 --- a/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme +++ b/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme @@ -1,6 +1,6 @@ 0 diff --git a/Delta/Extensions/DeltaCoreProtocol+Delta.swift b/Delta/Extensions/DeltaCoreProtocol+Delta.swift new file mode 100644 index 0000000..06aad27 --- /dev/null +++ b/Delta/Extensions/DeltaCoreProtocol+Delta.swift @@ -0,0 +1,21 @@ +// +// DeltaCoreProtocol+Delta.swift +// Delta +// +// Created by Riley Testut on 4/30/17. +// Copyright © 2017 Riley Testut. All rights reserved. +// + +import DeltaCore +import GBADeltaCore + +extension DeltaCoreProtocol +{ + var supportedRates: ClosedRange { + switch self.gameType + { + case GameType.gba: return 1...3 + default: return 1...4 + } + } +} diff --git a/Delta/Pause Menu/Cheats/EditCheatViewController.swift b/Delta/Pause Menu/Cheats/EditCheatViewController.swift index 8d9b4fb..db04c37 100644 --- a/Delta/Pause Menu/Cheats/EditCheatViewController.swift +++ b/Delta/Pause Menu/Cheats/EditCheatViewController.swift @@ -33,7 +33,7 @@ class EditCheatViewController: UITableViewController var game: Game! { didSet { let deltaCore = Delta.core(for: self.game.type)! - self.supportedCheatFormats = deltaCore.emulatorConfiguration.supportedCheatFormats + self.supportedCheatFormats = deltaCore.supportedCheatFormats.sorted() { $0.name < $1.name } } } diff --git a/Delta/Pause Menu/Save States/SaveStatesViewController.swift b/Delta/Pause Menu/Save States/SaveStatesViewController.swift index 3de34db..2503ceb 100644 --- a/Delta/Pause Menu/Save States/SaveStatesViewController.swift +++ b/Delta/Pause Menu/Save States/SaveStatesViewController.swift @@ -241,7 +241,7 @@ private extension SaveStatesViewController let deltaCore = Delta.core(for: self.game.type)! - let dimensions = deltaCore.emulatorConfiguration.videoBufferInfo.outputDimensions + let dimensions = deltaCore.videoFormat.dimensions cell.maximumImageSize = CGSize(width: self.prototypeCellWidthConstraint.constant, height: (self.prototypeCellWidthConstraint.constant / dimensions.width) * dimensions.height) cell.textLabel.font = UIFont.preferredFont(forTextStyle: .subheadline)