forked from SourMesen/Mesen-S
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigApiWrapper.cpp
68 lines (56 loc) · 1.8 KB
/
ConfigApiWrapper.cpp
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
#include "stdafx.h"
#include "../Core/Console.h"
#include "../Core/IAudioDevice.h"
#include "../Core/EmuSettings.h"
#include "../Core/SettingTypes.h"
extern shared_ptr<Console> _console;
extern unique_ptr<IAudioDevice> _soundManager;
static string _returnString;
extern "C" {
DllExport void __stdcall SetVideoConfig(VideoConfig config)
{
_console->GetSettings()->SetVideoConfig(config);
}
DllExport void __stdcall SetAudioConfig(AudioConfig config)
{
_console->GetSettings()->SetAudioConfig(config);
}
DllExport void __stdcall SetInputConfig(InputConfig config)
{
_console->GetSettings()->SetInputConfig(config);
}
DllExport void __stdcall SetEmulationConfig(EmulationConfig config)
{
_console->GetSettings()->SetEmulationConfig(config);
}
DllExport void __stdcall SetGameboyConfig(GameboyConfig config)
{
_console->GetSettings()->SetGameboyConfig(config);
}
DllExport void __stdcall SetPreferences(PreferencesConfig config)
{
_console->GetSettings()->SetPreferences(config);
}
DllExport void __stdcall SetShortcutKeys(ShortcutKeyInfo shortcuts[], uint32_t count)
{
vector<ShortcutKeyInfo> shortcutList(shortcuts, shortcuts + count);
_console->GetSettings()->SetShortcutKeys(shortcutList);
}
DllExport ControllerType __stdcall GetControllerType(int player)
{
return _console->GetSettings()->GetInputConfig().Controllers[player].Type;
}
DllExport const char* __stdcall GetAudioDevices()
{
_returnString = _soundManager ? _soundManager->GetAvailableDevices() : "";
return _returnString.c_str();
}
DllExport void __stdcall SetEmulationFlag(EmulationFlags flag, bool enabled)
{
_console->GetSettings()->SetFlagState(flag, enabled);
}
DllExport void __stdcall SetDebuggerFlag(DebuggerFlags flag, bool enabled)
{
_console->GetSettings()->SetDebuggerFlag(flag, enabled);
}
}