forked from rileytestut/N64iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.m
27 lines (25 loc) · 817 Bytes
/
helpers.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#import <UIKit/UIKit.h>
const char* get_resource_path(char* file)
{
static char resource_path[1024];
#ifdef APPSTORE_BUILD
const char* path = [[[NSBundle mainBundle] resourcePath] UTF8String];
sprintf(resource_path, "%s/%s", path, file);
#else
sprintf(resource_path, "/Applications/n64ios.app/%s", file);
#endif
return resource_path;
}
const char* get_documents_path(char* file)
{
static char documents_path[1024];
#ifdef APPSTORE_BUILD
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex: 0];
const char* path = [documentsDirectory UTF8String];
sprintf(documents_path, "%s/%s", path, file);
#else
sprintf(documents_path, "/var/mobile/Media/ROMs/N64/%s", file);
#endif
return documents_path;
}