forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 7
/
command.h
246 lines (227 loc) · 7.33 KB
/
command.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
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
* Copyright (C) 2016-2019 - Brad Parker
*
* RetroArch 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 Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch 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 RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef COMMAND_H__
#define COMMAND_H__
#include <stdint.h>
#include <boolean.h>
#include <retro_common_api.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
RETRO_BEGIN_DECLS
typedef struct command command_t;
typedef struct command_handle
{
command_t *handle;
unsigned id;
} command_handle_t;
enum event_command
{
CMD_EVENT_NONE = 0,
/* Resets RetroArch. */
CMD_EVENT_RESET,
CMD_EVENT_SET_PER_GAME_RESOLUTION,
CMD_EVENT_SET_FRAME_LIMIT,
/* Loads core. */
CMD_EVENT_LOAD_CORE,
CMD_EVENT_LOAD_CORE_PERSIST,
CMD_EVENT_UNLOAD_CORE,
CMD_EVENT_LOAD_STATE,
/* Swaps the current state with what's on the undo load buffer */
CMD_EVENT_UNDO_LOAD_STATE,
/* Rewrites a savestate on disk */
CMD_EVENT_UNDO_SAVE_STATE,
CMD_EVENT_SAVE_STATE,
CMD_EVENT_SAVE_STATE_DECREMENT,
CMD_EVENT_SAVE_STATE_INCREMENT,
/* Takes screenshot. */
CMD_EVENT_TAKE_SCREENSHOT,
/* Quits RetroArch. */
CMD_EVENT_QUIT,
/* Reinitialize all drivers. */
CMD_EVENT_REINIT_FROM_TOGGLE,
/* Reinitialize all drivers. */
CMD_EVENT_REINIT,
/* Toggles cheevos hardcore mode. */
CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE,
/* Deinitialize rewind. */
CMD_EVENT_REWIND_DEINIT,
/* Initializes rewind. */
CMD_EVENT_REWIND_INIT,
/* Toggles rewind. */
CMD_EVENT_REWIND_TOGGLE,
/* Initializes autosave. */
CMD_EVENT_AUTOSAVE_INIT,
/* Stops audio. */
CMD_EVENT_AUDIO_STOP,
/* Starts audio. */
CMD_EVENT_AUDIO_START,
/* Mutes audio. */
CMD_EVENT_AUDIO_MUTE_TOGGLE,
/* Toggles FPS counter. */
CMD_EVENT_FPS_TOGGLE,
/* Gathers diagnostic info about the system and RetroArch configuration, then sends it to our servers. */
CMD_EVENT_SEND_DEBUG_INFO,
/* Toggles netplay hosting. */
CMD_EVENT_NETPLAY_HOST_TOGGLE,
/* Initializes overlay. */
CMD_EVENT_OVERLAY_INIT,
/* Deinitializes overlay. */
CMD_EVENT_OVERLAY_DEINIT,
/* Sets current scale factor for overlay. */
CMD_EVENT_OVERLAY_SET_SCALE_FACTOR,
/* Sets current alpha modulation for overlay. */
CMD_EVENT_OVERLAY_SET_ALPHA_MOD,
/* Cycle to next overlay. */
CMD_EVENT_OVERLAY_NEXT,
/* Deinitializes overlay. */
CMD_EVENT_DSP_FILTER_INIT,
/* Initializes recording system. */
CMD_EVENT_RECORD_INIT,
/* Deinitializes recording system. */
CMD_EVENT_RECORD_DEINIT,
/* Deinitializes history playlist. */
CMD_EVENT_HISTORY_DEINIT,
/* Initializes history playlist. */
CMD_EVENT_HISTORY_INIT,
/* Deinitializes core information. */
CMD_EVENT_CORE_INFO_DEINIT,
/* Initializes core information. */
CMD_EVENT_CORE_INFO_INIT,
/* Deinitializes core. */
CMD_EVENT_CORE_DEINIT,
/* Initializes core. */
CMD_EVENT_CORE_INIT,
/* Apply video state changes. */
CMD_EVENT_VIDEO_APPLY_STATE_CHANGES,
/* Set video blocking state. */
CMD_EVENT_VIDEO_SET_BLOCKING_STATE,
/* Sets current aspect ratio index. */
CMD_EVENT_VIDEO_SET_ASPECT_RATIO,
/* Restarts RetroArch. */
CMD_EVENT_RESTART_RETROARCH,
/* Shutdown the OS */
CMD_EVENT_SHUTDOWN,
/* Reboot the OS */
CMD_EVENT_REBOOT,
/* Resume RetroArch when in menu. */
CMD_EVENT_RESUME,
/* Add a playlist entry to favorites. */
CMD_EVENT_ADD_TO_FAVORITES,
/* Reset playlist entry associated core to DETECT */
CMD_EVENT_RESET_CORE_ASSOCIATION,
/* Toggles pause. */
CMD_EVENT_PAUSE_TOGGLE,
/* Pauses RetroArch. */
CMD_EVENT_UNPAUSE,
/* Unpauses retroArch. */
CMD_EVENT_PAUSE,
CMD_EVENT_MENU_RESET_TO_DEFAULT_CONFIG,
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG,
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE,
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR,
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_GAME,
CMD_EVENT_MENU_SAVE_CONFIG,
CMD_EVENT_MENU_PAUSE_LIBRETRO,
/* Toggles menu on/off. */
CMD_EVENT_MENU_TOGGLE,
/* Applies shader changes. */
CMD_EVENT_SHADERS_APPLY_CHANGES,
/* A new shader preset has been loaded */
CMD_EVENT_SHADER_PRESET_LOADED,
/* Apply cheats. */
CMD_EVENT_CHEATS_APPLY,
/* Initializes network system. */
CMD_EVENT_NETWORK_INIT,
/* Initializes netplay system with a string or no host specified. */
CMD_EVENT_NETPLAY_INIT,
/* Initializes netplay system with a direct host specified. */
CMD_EVENT_NETPLAY_INIT_DIRECT,
/* Initializes netplay system with a direct host specified after loading content. */
CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED,
/* Deinitializes netplay system. */
CMD_EVENT_NETPLAY_DEINIT,
/* Switch between netplay gaming and watching. */
CMD_EVENT_NETPLAY_GAME_WATCH,
/* Start hosting netplay. */
CMD_EVENT_NETPLAY_ENABLE_HOST,
/* Disconnect from the netplay host. */
CMD_EVENT_NETPLAY_DISCONNECT,
/* Reinitializes audio driver. */
CMD_EVENT_AUDIO_REINIT,
/* Resizes windowed scale. Will reinitialize video driver. */
CMD_EVENT_RESIZE_WINDOWED_SCALE,
CMD_EVENT_LOG_FILE_DEINIT,
/* Toggles disk eject. */
CMD_EVENT_DISK_EJECT_TOGGLE,
/* Cycle to next disk. */
CMD_EVENT_DISK_NEXT,
/* Cycle to previous disk. */
CMD_EVENT_DISK_PREV,
/* Appends disk image to disk image list. */
CMD_EVENT_DISK_APPEND_IMAGE,
/* Stops rumbling. */
CMD_EVENT_RUMBLE_STOP,
/* Toggles mouse grab. */
CMD_EVENT_GRAB_MOUSE_TOGGLE,
/* Toggles game focus. */
CMD_EVENT_GAME_FOCUS_TOGGLE,
/* Toggles desktop menu. */
CMD_EVENT_UI_COMPANION_TOGGLE,
/* Toggles fullscreen mode. */
CMD_EVENT_FULLSCREEN_TOGGLE,
CMD_EVENT_VOLUME_UP,
CMD_EVENT_VOLUME_DOWN,
CMD_EVENT_MIXER_VOLUME_UP,
CMD_EVENT_MIXER_VOLUME_DOWN,
CMD_EVENT_DISCORD_INIT,
CMD_EVENT_DISCORD_UPDATE,
CMD_EVENT_OSK_TOGGLE,
CMD_EVENT_RECORDING_TOGGLE,
CMD_EVENT_STREAMING_TOGGLE,
CMD_EVENT_AI_SERVICE_TOGGLE,
CMD_EVENT_BSV_RECORDING_TOGGLE,
CMD_EVENT_SHADER_NEXT,
CMD_EVENT_SHADER_PREV,
CMD_EVENT_CHEAT_INDEX_PLUS,
CMD_EVENT_CHEAT_INDEX_MINUS,
CMD_EVENT_CHEAT_TOGGLE,
CMD_EVENT_AI_SERVICE_CALL
};
bool command_set_shader(const char *arg);
bool command_network_send(const char *cmd_);
bool command_network_new(
command_t *handle,
bool stdin_enable,
bool network_enable,
uint16_t port);
command_t *command_new(void);
bool command_poll(command_t *handle);
bool command_get(command_handle_t *handle);
bool command_set(command_handle_t *handle);
bool command_free(command_t *handle);
/**
* command_event:
* @cmd : Command index.
*
* Performs RetroArch command with index @cmd.
*
* Returns: true (1) on success, otherwise false (0).
**/
bool command_event(enum event_command action, void *data);
RETRO_END_DECLS
#endif