-
Notifications
You must be signed in to change notification settings - Fork 0
/
CLibretro.h
77 lines (62 loc) · 1.5 KB
/
CLibretro.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef CEMULATOR_H
#define CEMULATOR_H
#include <initguid.h>
#include <list>
#include <thread>
#include <chrono>
#include <mutex>
#include "io/input.h"
#include "io/audio.h"
namespace std
{
typedef wstring tstring;
typedef wistringstream tistringstream;
typedef wostringstream tostringstream;
}
class CLibretro
{
private:
static CLibretro* m_Instance ;
public:
struct core_vars
{
char name[100];
char var[100];
char description[256];
char usevars[256];
};
TCHAR inputcfg_path[MAX_PATH];
TCHAR corevar_path[MAX_PATH];
std::vector<core_vars> variables;
bool variables_changed;
HANDLE thread_handle;
DWORD thread_id;
HWND emulator_hwnd;
static DWORD WINAPI libretro_thread(void* Param);
static CLibretro* CreateInstance(HWND hwnd ) ;
static CLibretro* GetSingleton( ) ;
CLibretro();
~CLibretro();
DWORD rate;
bool paused;
unsigned frame_count;
bool running();
bool loadfile(TCHAR* filename, TCHAR* core_filename, bool gamespecificoptions);
void splash();
void render();
void run();
void reset();
bool core_load(TCHAR *sofile,bool specifics, TCHAR* filename, TCHAR* core_filename);
bool init(HWND hwnd);
bool savestate(TCHAR* filename, bool save = false);
void kill();
BOOL isEmulating;
void core_audio_sample(int16_t left, int16_t right);
size_t core_audio_sample_batch(const int16_t *data, size_t frames);
int16_t* _samples;
size_t _samplesCount;
Audio _audio;
double lastTime;
int nbFrames;
};
#endif CEMULATOR_H