ios_main.mm 2.04 KB
Newer Older
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
28
29
30
31
32
33
34
35
36
37
38
39
//
//  ios_main.m
//  emulator
//
//  Created by admin on 12/17/14.
//  Copyright (c) 2014 Karen Tsai (angelXwind). All rights reserved.
//

#import <Foundation/Foundation.h>

#include <assert.h>
#include <poll.h>
#include <termios.h>
//#include <curses.h>
#include <fcntl.h>
#include <semaphore.h>
#include <stdarg.h>
#include <signal.h>
#include <sys/param.h>
#include <sys/mman.h>
#include <sys/time.h>
#include "hw/sh4/dyna/blockmanager.h"
#include <unistd.h>


int msgboxf(const wchar* text,unsigned int type,...)
{
    va_list args;
    
    wchar temp[2048];
    va_start(args, type);
    vsprintf(temp, text, args);
    va_end(args);
    
    //printf(NULL,temp,VER_SHORTNAME,type | MB_TASKMODAL);
    puts(temp);
    return 0;
}

40
41
42
43
44
45
46
47
48
49
50
51
52
53
int darw_printf(const wchar* text,...) {
    va_list args;
    
    wchar temp[2048];
    va_start(args, text);
    vsprintf(temp, text, args);
    va_end(args);
    
    NSLog(@"%s", temp);
    
    return 0;
}


54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
void common_linux_setup();
int dc_init(int argc,wchar* argv[]);
void dc_run();

u16 kcode[4];
u32 vks[4];
s8 joyx[4],joyy[4];
u8 rt[4],lt[4];

extern "C" int reicast_main(int argc, wchar* argv[])
{
    //if (argc==2)
    //ndcid=atoi(argv[1]);
    
    string homedir = [ [[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] objectAtIndex:0] path] UTF8String];
    SetHomeDir(homedir);
    
71
72
    freopen( (homedir + "/log.txt").c_str(), "wb", stdout);
    
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
    printf("Home dir is: %s\n",GetPath("/").c_str());
    
    common_linux_setup();
    
    settings.profile.run_counts=0;
    
    dc_init(argc,argv);
    
    dc_run();
    
    return 0;
}

void os_DoEvents() {
    
}


u32  os_Push(void*, u32, bool) {
    return 1;
}

void os_SetWindowText(const char* t) {
    puts(t);
}

void os_CreateWindow() {

}

void UpdateInputState(u32 port) {
    
}

void get_mic_data(u8* ) {

}

void* libPvr_GetRenderTarget() {
    return 0;
}

void* libPvr_GetRenderSurface() {
    return 0;
    
}

bool gl_init(void*, void*) {
    return true;
}

void gl_term() {
    
}

void gl_swap() {
    
}