ppsspp/ios/main.mm

61 lines
1.4 KiB
Plaintext
Raw Normal View History

2013-08-18 20:17:33 -07:00
// main.mm boilerplate
#import <UIKit/UIKit.h>
2013-08-18 20:17:33 -07:00
#import <string>
#import <stdio.h>
#import <stdlib.h>
#import <AudioToolbox/AudioToolbox.h>
#import "AppDelegate.h"
2014-05-17 12:55:31 +07:00
#import <AudioToolbox/AudioToolbox.h>
2013-09-06 01:12:48 -07:00
#include "base/NativeApp.h"
std::string System_GetProperty(SystemProperty prop) {
switch (prop) {
case SYSPROP_NAME:
return "iOS:";
case SYSPROP_LANGREGION:
return "en_US";
default:
return "";
}
2013-08-18 20:17:33 -07:00
}
int System_GetPropertyInt(SystemProperty prop) {
switch (prop) {
case SYSPROP_AUDIO_SAMPLE_RATE:
return 44100;
case SYSPROP_DISPLAY_REFRESH_RATE:
return 60000;
default:
return -1;
}
}
void System_SendMessage(const char *command, const char *parameter) {
if (!strcmp(command, "finish")) {
exit(0);
}
}
FOUNDATION_EXTERN void AudioServicesPlaySystemSoundWithVibration(unsigned long, objc_object*, NSDictionary*);
2013-10-13 12:12:36 -07:00
void Vibrate(int length_ms) {
2014-05-22 03:56:33 -04:00
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
2013-10-13 12:12:36 -07:00
}
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}