From ab44947e00f17ec9eba7ccc68b103b93b343a070 Mon Sep 17 00:00:00 2001 From: Karen Tsai Date: Thu, 22 May 2014 03:54:09 -0400 Subject: [PATCH] =?UTF-8?q?Improved=20PPSSPP=E2=80=99s=20Vibrate()=20for?= =?UTF-8?q?=20iOS,=20now=20no=20longer=20gives=20you=20a=20hand=20massage.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/main.mm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ios/main.mm b/ios/main.mm index 2cd34915ed..bacc2a11f6 100644 --- a/ios/main.mm +++ b/ios/main.mm @@ -27,9 +27,18 @@ void System_SendMessage(const char *command, const char *parameter) { } } +FOUNDATION_EXTERN void AudioServicesPlaySystemSoundWithVibration(unsigned long, objc_object*, NSDictionary*); + void Vibrate(int length_ms) { - AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); - // TODO: Actually make use of length_ms? + + NSMutableDictionary *dictionary = [NSMutableDictionary dictionary]; + NSArray *pattern = @[@YES, @30, @NO, @2]; + + dictionary[@"VibePattern"] = pattern; + dictionary[@"Intensity"] = @2; + + AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate, nil, dictionary); + // TODO: Actually make use of length_ms if PPSSPP ever adds that in the config } int main(int argc, char *argv[])