aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/qt_sdl/PlatformConfig.cpp
blob: 40f55bae0c6846cc16da225aafdb259225b04c04 (plain)
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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
    Copyright 2016-2021 Arisotura

    This file is part of melonDS.

    melonDS is free software: you can redistribute it and/or modify it under
    the terms of the GNU General Public License as published by the Free
    Software Foundation, either version 3 of the License, or (at your option)
    any later version.

    melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with melonDS. If not, see http://www.gnu.org/licenses/.
*/

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "PlatformConfig.h"

namespace Config
{

int KeyMapping[12];
int JoyMapping[12];

int HKKeyMapping[HK_MAX];
int HKJoyMapping[HK_MAX];

int JoystickID;

int WindowWidth;
int WindowHeight;
int WindowMaximized;

int ScreenRotation;
int ScreenGap;
int ScreenLayout;
int ScreenSwap;
int ScreenSizing;
int IntegerScaling;
int ScreenAspectTop;
int ScreenAspectBot;
int ScreenFilter;

int ScreenUseGL;
int ScreenVSync;
int ScreenVSyncInterval;

int _3DRenderer;
int Threaded3D;

int GL_ScaleFactor;
int GL_BetterPolygons;

int LimitFPS;
int AudioSync;
int ShowOSD;

int ConsoleType;
int DirectBoot;

int SocketBindAnyAddr;
char LANDevice[128];
int DirectLAN;

int SavestateRelocSRAM;

int AudioInterp;
int AudioVolume;
int MicInputType;
char MicWavPath[1024];

char LastROMFolder[1024];

char RecentROMList[10][1024];

int EnableCheats;

int MouseHide;
int MouseHideSeconds;

int PauseLostFocus;

bool EnableJIT;

ConfigEntry PlatformConfigFile[] =
{
    {"Key_A",      0, &KeyMapping[0],  -1, NULL, 0},
    {"Key_B",      0, &KeyMapping[1],  -1, NULL, 0},
    {"Key_Select", 0, &KeyMapping[2],  -1, NULL, 0},
    {"Key_Start",  0, &KeyMapping[3],  -1, NULL, 0},
    {"Key_Right",  0, &KeyMapping[4],  -1, NULL, 0},
    {"Key_Left",   0, &KeyMapping[5],  -1, NULL, 0},
    {"Key_Up",     0, &KeyMapping[6],  -1, NULL, 0},
    {"Key_Down",   0, &KeyMapping[7],  -1, NULL, 0},
    {"Key_R",      0, &KeyMapping[8],  -1, NULL, 0},
    {"Key_L",      0, &KeyMapping[9],  -1, NULL, 0},
    {"Key_X",      0, &KeyMapping[10], -1, NULL, 0},
    {"Key_Y",      0, &KeyMapping[11], -1, NULL, 0},

    {"Joy_A",      0, &JoyMapping[0],  -1, NULL, 0},
    {"Joy_B",      0, &JoyMapping[1],  -1, NULL, 0},
    {"Joy_Select", 0, &JoyMapping[2],  -1, NULL, 0},
    {"Joy_Start",  0, &JoyMapping[3],  -1, NULL, 0},
    {"Joy_Right",  0, &JoyMapping[4],  -1, NULL, 0},
    {"Joy_Left",   0, &JoyMapping[5],  -1, NULL, 0},
    {"Joy_Up",     0, &JoyMapping[6],  -1, NULL, 0},
    {"Joy_Down",   0, &JoyMapping[7],  -1, NULL, 0},
    {"Joy_R",      0, &JoyMapping[8],  -1, NULL, 0},
    {"Joy_L",      0, &JoyMapping[9],  -1, NULL, 0},
    {"Joy_X",      0, &JoyMapping[10], -1, NULL, 0},
    {"Joy_Y",      0, &JoyMapping[11], -1, NULL, 0},

    {"HKKey_Lid",                 0, &HKKeyMapping[HK_Lid],                 -1, NULL, 0},
    {"HKKey_Mic",                 0, &HKKeyMapping[HK_Mic],                 -1, NULL, 0},
    {"HKKey_Pause",               0, &HKKeyMapping[HK_Pause],               -1, NULL, 0},
    {"HKKey_Reset",               0, &HKKeyMapping[HK_Reset],               -1, NULL, 0},
    {"HKKey_FastForward",         0, &HKKeyMapping[HK_FastForward],         -1, NULL, 0},
    {"HKKey_FastForwardToggle",   0, &HKKeyMapping[HK_FastForwardToggle],   -1, NULL, 0},
    {"HKKey_FullscreenToggle",    0, &HKKeyMapping[HK_FullscreenToggle],    -1, NULL, 0},
    {"HKKey_SwapScreens",         0, &HKKeyMapping[HK_SwapScreens],         -1, NULL, 0},
    {"HKKey_SolarSensorDecrease", 0, &HKKeyMapping[HK_SolarSensorDecrease], -1, NULL, 0},
    {"HKKey_SolarSensorIncrease", 0, &HKKeyMapping[HK_SolarSensorIncrease], -1, NULL, 0},
    {"HKKey_FrameStep",           0, &HKKeyMapping[HK_FrameStep],           -1, NULL, 0},

    {"HKJoy_Lid",                 0, &HKJoyMapping[HK_Lid],                 -1, NULL, 0},
    {"HKJoy_Mic",                 0, &HKJoyMapping[HK_Mic],                 -1, NULL, 0},
    {"HKJoy_Pause",               0, &HKJoyMapping[HK_Pause],               -1, NULL, 0},
    {"HKJoy_Reset",               0, &HKJoyMapping[HK_Reset],               -1, NULL, 0},
    {"HKJoy_FastForward",         0, &HKJoyMapping[HK_FastForward],         -1, NULL, 0},
    {"HKJoy_FastForwardToggle",   0, &HKJoyMapping[HK_FastForwardToggle],   -1, NULL, 0},
    {"HKJoy_FullscreenToggle",    0, &HKJoyMapping[HK_FullscreenToggle],    -1, NULL, 0},
    {"HKJoy_SwapScreens",         0, &HKJoyMapping[HK_SwapScreens],         -1, NULL, 0},
    {"HKJoy_SolarSensorDecrease", 0, &HKJoyMapping[HK_SolarSensorDecrease], -1, NULL, 0},
    {"HKJoy_SolarSensorIncrease", 0, &HKJoyMapping[HK_SolarSensorIncrease], -1, NULL, 0},
    {"HKJoy_FrameStep",           0, &HKJoyMapping[HK_FrameStep],           -1, NULL, 0},

    {"JoystickID", 0, &JoystickID, 0, NULL, 0},

    {"WindowWidth",  0, &WindowWidth,  256, NULL, 0},
    {"WindowHeight", 0, &WindowHeight, 384, NULL, 0},
    {"WindowMax",    0, &WindowMaximized, 0, NULL, 0},

    {"ScreenRotation", 0, &ScreenRotation, 0, NULL, 0},
    {"ScreenGap",      0, &ScreenGap,      0, NULL, 0},
    {"ScreenLayout",   0, &ScreenLayout,   0, NULL, 0},
    {"ScreenSwap",     0, &ScreenSwap,     0, NULL, 0},
    {"ScreenSizing",   0, &ScreenSizing,   0, NULL, 0},
    {"IntegerScaling", 0, &IntegerScaling, 0, NULL, 0},
    {"ScreenAspectTop",0, &ScreenAspectTop,0, NULL, 0},
    {"ScreenAspectBot",0, &ScreenAspectBot,0, NULL, 0},
    {"ScreenFilter",   0, &ScreenFilter,   1, NULL, 0},

    {"ScreenUseGL",         0, &ScreenUseGL,         0, NULL, 0},
    {"ScreenVSync",         0, &ScreenVSync,         0, NULL, 0},
    {"ScreenVSyncInterval", 0, &ScreenVSyncInterval, 1, NULL, 0},

    {"3DRenderer", 0, &_3DRenderer, 0, NULL, 0},
    {"Threaded3D", 0, &Threaded3D, 1, NULL, 0},

    {"GL_ScaleFactor", 0, &GL_ScaleFactor, 1, NULL, 0},
    {"GL_BetterPolygons", 0, &GL_BetterPolygons, 0, NULL, 0},

    {"LimitFPS", 0, &LimitFPS, 1, NULL, 0},
    {"AudioSync", 0, &AudioSync, 0, NULL, 0},
    {"ShowOSD", 0, &ShowOSD, 1, NULL, 0},

    {"ConsoleType", 0, &ConsoleType, 0, NULL, 0},
    {"DirectBoot", 0, &DirectBoot, 1, NULL, 0},

    {"SockBindAnyAddr", 0, &SocketBindAnyAddr, 0, NULL, 0},
    {"LANDevice", 1, LANDevice, 0, "", 127},
    {"DirectLAN", 0, &DirectLAN, 0, NULL, 0},

    {"SavStaRelocSRAM", 0, &SavestateRelocSRAM, 0, NULL, 0},

    {"AudioInterp", 0, &AudioInterp, 0, NULL, 0},
    {"AudioVolume", 0, &AudioVolume, 256, NULL, 0},
    {"MicInputType", 0, &MicInputType, 1, NULL, 0},
    {"MicWavPath", 1, MicWavPath, 0, "", 1023},

    {"LastROMFolder", 1, LastROMFolder, 0, "", 1023},

    {"RecentROM_0", 1, RecentROMList[0], 0, "", 1023},
    {"RecentROM_1", 1, RecentROMList[1], 0, "", 1023},
    {"RecentROM_2", 1, RecentROMList[2], 0, "", 1023},
    {"RecentROM_3", 1, RecentROMList[3], 0, "", 1023},
    {"RecentROM_4", 1, RecentROMList[4], 0, "", 1023},
    {"RecentROM_5", 1, RecentROMList[5], 0, "", 1023},
    {"RecentROM_6", 1, RecentROMList[6], 0, "", 1023},
    {"RecentROM_7", 1, RecentROMList[7], 0, "", 1023},
    {"RecentROM_8", 1, RecentROMList[8], 0, "", 1023},
    {"RecentROM_9", 1, RecentROMList[9], 0, "", 1023},

    {"EnableCheats", 0, &EnableCheats, 0, NULL, 0},

    {"MouseHide",        0, &MouseHide,        0, NULL, 0},
    {"MouseHideSeconds", 0, &MouseHideSeconds, 5, NULL, 0},
    {"PauseLostFocus",   0, &PauseLostFocus,   0, NULL, 0},

    {"", -1, NULL, 0, NULL, 0}
};

}