diff --git a/Cores/DeltaCore b/Cores/DeltaCore index 35d634f..54697b0 160000 --- a/Cores/DeltaCore +++ b/Cores/DeltaCore @@ -1 +1 @@ -Subproject commit 35d634fdeec4f89da7dfecacb90188d688caa177 +Subproject commit 54697b08bf8c029d92b97e1acb2be7c21ff45a57 diff --git a/Delta.xcodeproj/project.pbxproj b/Delta.xcodeproj/project.pbxproj index 19c5d79..cc3bd5e 100644 --- a/Delta.xcodeproj/project.pbxproj +++ b/Delta.xcodeproj/project.pbxproj @@ -26,7 +26,6 @@ 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, ); }; }; BF04E6FF1DB8625C000F35D3 /* ControllerSkinsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF04E6FE1DB8625C000F35D3 /* ControllerSkinsViewController.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 */; }; BF0D057F1DDD9A96002A71A7 /* GamesDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF0D057E1DDD9A96002A71A7 /* GamesDatabase.swift */; }; BF107EC41BF413F000E0C32C /* GamesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF107EC31BF413F000E0C32C /* GamesViewController.swift */; }; @@ -129,8 +128,6 @@ BF0418131D01E93400E85BCF /* GBADeltaCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = GBADeltaCore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BF04E6FE1DB8625C000F35D3 /* ControllerSkinsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ControllerSkinsViewController.swift; path = "Controller Skins/ControllerSkinsViewController.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 = ""; }; - BF090CF31B490D8300DCAB45 /* UIDevice+Vibration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+Vibration.m"; sourceTree = ""; }; BF0A81C41DC915C800443EF0 /* ControllerSkinConfigurations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ControllerSkinConfigurations.h; path = Misc/ControllerSkinConfigurations.h; sourceTree = ""; }; BF0CDDAC1C8155D200640168 /* LoadImageOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = LoadImageOperation.swift; path = Components/LoadImageOperation.swift; sourceTree = ""; }; BF0D057E1DDD9A96002A71A7 /* GamesDatabase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GamesDatabase.swift; sourceTree = ""; }; @@ -227,8 +224,6 @@ BF090CEE1B490C1A00DCAB45 /* Extensions */ = { isa = PBXGroup; children = ( - BF090CF21B490D8300DCAB45 /* UIDevice+Vibration.h */, - BF090CF31B490D8300DCAB45 /* UIDevice+Vibration.m */, BF797A2C1C2D339F00F1A000 /* UILabel+FontSize.swift */, BF7AE8091C2E8C7600B1B5BC /* UIColor+Delta.swift */, BFCEA67D1D56FF640061A534 /* UIViewControllerContextTransitioning+Conveniences.swift */, @@ -740,7 +735,6 @@ BF353FFF1C5DA3C500C1184C /* PausePresentationController.swift in Sources */, BFFC464C1D5998D600AF2CC6 /* CheatTableViewCell.swift in Sources */, BF7AE80A1C2E8C7600B1B5BC /* UIColor+Delta.swift in Sources */, - BF090CF41B490D8300DCAB45 /* UIDevice+Vibration.m in Sources */, BFACD5FD1DC3D2CE002D6DDC /* LoadControllerSkinImageOperation.swift in Sources */, BF797A2D1C2D339F00F1A000 /* UILabel+FontSize.swift in Sources */, BFD097211D3A01B8005A44C2 /* SaveStatesViewController.swift in Sources */, @@ -952,6 +946,7 @@ BF14D8961DE7A512002CA1BE /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; BFFA71D21AAC406100EE9DD1 /* Build configuration list for PBXProject "Delta" */ = { isa = XCConfigurationList; diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index bfabdf1..bda659d 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -125,11 +125,6 @@ class GameViewController: DeltaCore.GameViewController { super.gameController(gameController, didActivate: input) - if gameController is ControllerView && UIDevice.current.isVibrationSupported - { - UIDevice.current.vibrate() - } - guard (input as? ControllerInput) != .menu else { return } if self.selectingSustainedButtons diff --git a/Delta/Extensions/UIDevice+Vibration.h b/Delta/Extensions/UIDevice+Vibration.h deleted file mode 100644 index d313447..0000000 --- a/Delta/Extensions/UIDevice+Vibration.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// UIDevice+Vibration.h -// Delta -// -// Created by Riley Testut on 7/5/15. -// Copyright © 2015 Riley Testut. All rights reserved. -// - -@import UIKit; - -NS_ASSUME_NONNULL_BEGIN - -@interface UIDevice (Vibration) - -@property (nonatomic, readonly, getter=isVibrationSupported) BOOL supportsVibration; - -- (void)vibrate; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Delta/Extensions/UIDevice+Vibration.m b/Delta/Extensions/UIDevice+Vibration.m deleted file mode 100644 index 9a905b8..0000000 --- a/Delta/Extensions/UIDevice+Vibration.m +++ /dev/null @@ -1,78 +0,0 @@ -// -// UIDevice+Vibration.m -// Delta -// -// Created by Riley Testut on 7/5/15. -// Copyright © 2015 Riley Testut. All rights reserved. -// - -#import "UIDevice+Vibration.h" - -#include - -@import AudioToolbox; - -// Private vibration API declarations -#if !APP_STORE_BUILD -void AudioServicesStopSystemSound(int); -void AudioServicesPlaySystemSoundWithVibration(int, id, NSDictionary *); -#endif - -@implementation UIDevice (Vibration) - -#pragma mark - Vibration - - -- (void)vibrate -{ -#if !APP_STORE_BUILD - AudioServicesStopSystemSound(kSystemSoundID_Vibrate); - - int64_t vibrationLength = 30; - - if ([[self modelGeneration] hasPrefix:@"iPhone6"]) - { - // iPhone 5S has a weaker vibration motor, so we vibrate for 10ms longer to compensate - vibrationLength = 40; - } - - NSArray *pattern = @[@NO, @0, @YES, @(vibrationLength)]; - - NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; - dictionary[@"VibePattern"] = pattern; - dictionary[@"Intensity"] = @1; - - AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate, nil, dictionary); -#endif -} - -#pragma mark - Device Info - - -- (NSString *)modelGeneration -{ - char *type = "hw.machine"; - - size_t size; - sysctlbyname(type, NULL, &size, NULL, 0); - - char *name = malloc(size); - sysctlbyname(type, name, &size, NULL, 0); - - NSString *modelName = [NSString stringWithCString:name encoding:NSUTF8StringEncoding]; - free(name); - - return modelName; -} - -#pragma mark - Getters/Setters - - -- (BOOL)isVibrationSupported -{ -#if APP_STORE_BUILD || TARGET_IPHONE_SIMULATOR - return NO; -#else - // No way to detect if hardware supports vibration, so we assume if it's not an iPhone, it doesn't have a vibration motor - return [self.model hasPrefix:@"iPhone"]; -#endif -} - -@end diff --git a/Delta/Supporting Files/Delta-Bridging-Header.h b/Delta/Supporting Files/Delta-Bridging-Header.h index fc19b9d..8da8b48 100644 --- a/Delta/Supporting Files/Delta-Bridging-Header.h +++ b/Delta/Supporting Files/Delta-Bridging-Header.h @@ -2,6 +2,5 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "UIDevice+Vibration.h" #import "NSFetchedResultsController+Conveniences.h" #import "ControllerSkinConfigurations.h"