From 29c8990540852e6bc43de83370bd1395c6244187 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Fri, 10 Jun 2016 10:53:29 -0500 Subject: [PATCH] Adds support for Gameboy Advance games --- .gitmodules | 3 + Common/Database/Model/Cheat.swift | 4 ++ Common/Database/Model/Game.swift | 3 +- Common/Database/Model/GameCollection.swift | 1 + Cores/DeltaCore | 2 +- Cores/GBADeltaCore | 1 + Cores/SNESDeltaCore | 2 +- Delta.xcodeproj/project.pbxproj | 14 +++-- .../xcshareddata/xcschemes/Delta.xcscheme | 58 ++++++++++++++++++- Delta.xcworkspace/contents.xcworkspacedata | 3 + Delta/Emulation/EmulationViewController.swift | 4 +- .../Game Selection/GamesViewController.swift | 2 - Delta/Supporting Files/Info.plist | 15 +++++ DeltaTV/GameSelectionViewController.swift | 2 - 14 files changed, 99 insertions(+), 15 deletions(-) create mode 160000 Cores/GBADeltaCore diff --git a/.gitmodules b/.gitmodules index c305b38..8996cfa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "External/Roxas"] path = External/Roxas url = git@github.com:rileytestut/Roxas.git +[submodule "Cores/GBADeltaCore"] + path = Cores/GBADeltaCore + url = git@github.com:rileytestut/GBADeltaCore.git diff --git a/Common/Database/Model/Cheat.swift b/Common/Database/Model/Cheat.swift index 8e9baff..020eb06 100644 --- a/Common/Database/Model/Cheat.swift +++ b/Common/Database/Model/Cheat.swift @@ -35,6 +35,8 @@ extension CheatType { case .actionReplay: return 0 case .gameGenie: return 1 + case .gameShark: return 2 + case .codeBreaker: return 3 } } @@ -44,6 +46,8 @@ extension CheatType { case 0: self = .actionReplay case 1: self = .gameGenie + case 2: self = .gameShark + case 3: self = .codeBreaker default: return nil } } diff --git a/Common/Database/Model/Game.swift b/Common/Database/Model/Game.swift index fedaac1..e5132b7 100644 --- a/Common/Database/Model/Game.swift +++ b/Common/Database/Model/Game.swift @@ -11,8 +11,7 @@ import CoreData import DeltaCore import SNESDeltaCore - -public let kUTTypeGBAGame: CFStringRef = "com.rileytestut.delta.game.gba" +import GBADeltaCore extension Game { diff --git a/Common/Database/Model/GameCollection.swift b/Common/Database/Model/GameCollection.swift index baaaca4..48e8cef 100644 --- a/Common/Database/Model/GameCollection.swift +++ b/Common/Database/Model/GameCollection.swift @@ -11,6 +11,7 @@ import CoreData import DeltaCore import SNESDeltaCore +import GBADeltaCore extension GameCollection { diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 769ba80..64f6520 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 769ba80cc892f7267739a13719cb38bec3daf7e7 +Subproject commit 64f652019405b72c2a4e3281da8d1e0514538ac3 diff --git a/Cores/GBADeltaCore b/Cores/GBADeltaCore new file mode 160000 index 0000000..06b2082 --- /dev/null +++ b/Cores/GBADeltaCore @@ -0,0 +1 @@ +Subproject commit 06b20822c7e9d28b9b3bcc6085deec2249a14e64 diff --git a/Cores/SNESDeltaCore b/Cores/SNESDeltaCore index 4a41f84..2c913a2 160000 --- a/Cores/SNESDeltaCore +++ b/Cores/SNESDeltaCore @@ -1 +1 @@ -Subproject commit 4a41f84576d0162f544a6d78268867b4d529262c +Subproject commit 2c913a2b2910711fa1c12be31b00f2205170c935 diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 4dd238c..25ebc08 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -8,6 +8,8 @@ /* Begin PBXBuildFile section */ AF0535CD7331785FA15E0864 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22506DA00971C4300AF90A35 /* Pods.framework */; }; + BF0418141D01E93400E85BCF /* GBADeltaCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF0418131D01E93400E85BCF /* GBADeltaCore.framework */; }; + BF0418151D01E93400E85BCF /* GBADeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BF0418131D01E93400E85BCF /* GBADeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF04A5A31CF8E61C00B4A267 /* UIViewController+PeekPop.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF04A5A21CF8E61C00B4A267 /* UIViewController+PeekPop.swift */; }; BF090CF41B490D8300DCAB45 /* UIDevice+Vibration.m in Sources */ = {isa = PBXBuildFile; fileRef = BF090CF31B490D8300DCAB45 /* UIDevice+Vibration.m */; }; BF0CDDAD1C8155D200640168 /* LoadImageOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0CDDAC1C8155D200640168 /* LoadImageOperation.swift */; }; @@ -67,6 +69,8 @@ BF8624891BB743FE00C12EEE /* Roxas.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BFEC732C1AAECC4A00650035 /* Roxas.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF8624A91BB7464B00C12EEE /* DeltaCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF9F4FCE1AAD7B87004C9500 /* DeltaCore.framework */; }; BF8624AA1BB7464B00C12EEE /* DeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BF9F4FCE1AAD7B87004C9500 /* DeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + BF99C6941D0A9AA600BA92BC /* SNESDeltaCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFC134E01AAD82460087AD7B /* SNESDeltaCore.framework */; }; + BF99C6951D0A9AA600BA92BC /* SNESDeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BFC134E01AAD82460087AD7B /* SNESDeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BF9F4FCF1AAD7B87004C9500 /* DeltaCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF9F4FCE1AAD7B87004C9500 /* DeltaCore.framework */; }; BF9F4FD01AAD7B87004C9500 /* DeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BF9F4FCE1AAD7B87004C9500 /* DeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BFA2315C1CED10BE0011E35A /* Action.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA2315B1CED10BE0011E35A /* Action.swift */; }; @@ -74,8 +78,6 @@ BFAA1FF41B8AD7F900495943 /* ControllersSettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFAA1FF31B8AD7F900495943 /* ControllersSettingsViewController.swift */; }; BFB141181BE46934004FBF46 /* GameCollectionViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB141171BE46934004FBF46 /* GameCollectionViewDataSource.swift */; }; BFB141191BE46934004FBF46 /* GameCollectionViewDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFB141171BE46934004FBF46 /* GameCollectionViewDataSource.swift */; }; - BFC134E11AAD82460087AD7B /* SNESDeltaCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFC134E01AAD82460087AD7B /* SNESDeltaCore.framework */; }; - BFC134E21AAD82470087AD7B /* SNESDeltaCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BFC134E01AAD82460087AD7B /* SNESDeltaCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; BFC2731A1BE6152200D22B05 /* GameCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC273171BE6152200D22B05 /* GameCollection.swift */; }; BFC2731B1BE6152200D22B05 /* GameCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC273171BE6152200D22B05 /* GameCollection.swift */; }; BFC9B7391CEFCD34008629BB /* CheatsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFC9B7381CEFCD34008629BB /* CheatsViewController.swift */; }; @@ -118,7 +120,8 @@ BF9F4FD01AAD7B87004C9500 /* DeltaCore.framework in Embed Frameworks */, BFEC732E1AAECC4A00650035 /* Roxas.framework in Embed Frameworks */, BF70798D1B6B464B0019077C /* ZipZap.framework in Embed Frameworks */, - BFC134E21AAD82470087AD7B /* SNESDeltaCore.framework in Embed Frameworks */, + BF0418151D01E93400E85BCF /* GBADeltaCore.framework in Embed Frameworks */, + BF99C6951D0A9AA600BA92BC /* SNESDeltaCore.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -129,6 +132,7 @@ 0340C4EC8B47535482F7F1BB /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 22506DA00971C4300AF90A35 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 685E0D2F62E4246995A02970 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + BF0418131D01E93400E85BCF /* GBADeltaCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GBADeltaCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BF04A5A21CF8E61C00B4A267 /* UIViewController+PeekPop.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIViewController+PeekPop.swift"; sourceTree = ""; }; BF090CF11B490D8300DCAB45 /* Delta-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Delta-Bridging-Header.h"; sourceTree = ""; }; BF090CF21B490D8300DCAB45 /* UIDevice+Vibration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIDevice+Vibration.h"; sourceTree = ""; }; @@ -213,8 +217,9 @@ BFE704F51CEA426E0058BAC8 /* Pods.framework in Frameworks */, BF9F4FCF1AAD7B87004C9500 /* DeltaCore.framework in Frameworks */, BFEC732D1AAECC4A00650035 /* Roxas.framework in Frameworks */, + BF99C6941D0A9AA600BA92BC /* SNESDeltaCore.framework in Frameworks */, BF70798C1B6B464B0019077C /* ZipZap.framework in Frameworks */, - BFC134E11AAD82460087AD7B /* SNESDeltaCore.framework in Frameworks */, + BF0418141D01E93400E85BCF /* GBADeltaCore.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -369,6 +374,7 @@ BF9F4FCD1AAD7B25004C9500 /* Frameworks */ = { isa = PBXGroup; children = ( + BF0418131D01E93400E85BCF /* GBADeltaCore.framework */, BF27CC941BCB7B7A00A20D89 /* GameController.framework */, BF27CC8A1BC9FE4D00A20D89 /* Pods.framework */, BF70798B1B6B464B0019077C /* ZipZap.framework */, diff --git a/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme b/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme index b6554e7..a143786 100644 --- a/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme +++ b/Delta.xcodeproj/xcshareddata/xcschemes/Delta.xcscheme @@ -3,9 +3,65 @@ LastUpgradeVersion = "0710" version = "1.3"> + + + + + + + + + + + + + + + + + + diff --git a/Delta/Emulation/EmulationViewController.swift b/Delta/Emulation/EmulationViewController.swift index df52f17..a64d082 100644 --- a/Delta/Emulation/EmulationViewController.swift +++ b/Delta/Emulation/EmulationViewController.swift @@ -250,9 +250,9 @@ class EmulationViewController: UIViewController sustainButtonsItem.selected = self.sustainedInputs[ObjectIdentifier(gameController)]?.count > 0 var fastForwardItem = PauseItem(image: UIImage(named: "FastForward")!, text: NSLocalizedString("Fast Forward", comment: ""), action: { [unowned self] item in - self.emulatorCore.fastForwarding = item.selected + self.emulatorCore.rate = item.selected ? self.emulatorCore.supportedRates.end : self.emulatorCore.supportedRates.start }) - fastForwardItem.selected = self.emulatorCore.fastForwarding + fastForwardItem.selected = self.emulatorCore.rate == self.emulatorCore.supportedRates.start ? false : true pauseViewController.items = [saveStateItem, loadStateItem, cheatCodesItem, fastForwardItem, sustainButtonsItem] diff --git a/Delta/Game Selection/GamesViewController.swift b/Delta/Game Selection/GamesViewController.swift index 2b0fe30..74eb345 100644 --- a/Delta/Game Selection/GamesViewController.swift +++ b/Delta/Game Selection/GamesViewController.swift @@ -9,8 +9,6 @@ import UIKit import CoreData -import SNESDeltaCore - import Roxas class GamesViewController: UIViewController diff --git a/Delta/Supporting Files/Info.plist b/Delta/Supporting Files/Info.plist index 88fe9ca..95684da 100644 --- a/Delta/Supporting Files/Info.plist +++ b/Delta/Supporting Files/Info.plist @@ -86,6 +86,21 @@ smc + + UTTypeConformsTo + + com.rileytestut.delta.game + + UTTypeDescription + GBA Game + UTTypeIdentifier + com.rileytestut.delta.game.gba + UTTypeTagSpecification + + public.filename-extension + gba + + diff --git a/DeltaTV/GameSelectionViewController.swift b/DeltaTV/GameSelectionViewController.swift index 182c4c9..3e2473c 100644 --- a/DeltaTV/GameSelectionViewController.swift +++ b/DeltaTV/GameSelectionViewController.swift @@ -9,8 +9,6 @@ import UIKit import CoreData -import SNESDeltaCore - import Roxas class GameSelectionViewController: UICollectionViewController