2012-07-28 07:47:35 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2016-01-10 04:06:50 +01:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2019-02-22 10:07:32 -05:00
|
|
|
* Copyright (C) 2016-2019 - Brad Parker
|
2017-12-11 23:55:31 -08:00
|
|
|
*
|
2012-07-28 07:47:35 +02:00
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2015-04-13 11:39:40 +02:00
|
|
|
#ifndef COMMAND_H__
|
|
|
|
#define COMMAND_H__
|
2012-07-28 07:47:35 +02:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2016-09-11 18:05:39 +02:00
|
|
|
|
2014-10-21 05:05:52 +02:00
|
|
|
#include <boolean.h>
|
2016-06-03 03:22:35 +02:00
|
|
|
#include <retro_common_api.h>
|
2012-07-28 07:47:35 +02:00
|
|
|
|
2016-09-11 18:05:39 +02:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-06-03 03:22:35 +02:00
|
|
|
RETRO_BEGIN_DECLS
|
2013-04-21 10:05:12 +02:00
|
|
|
|
2016-05-09 20:10:08 +02:00
|
|
|
typedef struct command command_t;
|
2012-07-28 07:47:35 +02:00
|
|
|
|
2016-05-09 21:23:53 +02:00
|
|
|
typedef struct command_handle
|
|
|
|
{
|
|
|
|
command_t *handle;
|
|
|
|
unsigned id;
|
|
|
|
} command_handle_t;
|
|
|
|
|
2016-05-09 20:30:47 +02:00
|
|
|
enum event_command
|
|
|
|
{
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_NONE = 0,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Resets RetroArch. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RESET,
|
|
|
|
CMD_EVENT_SET_PER_GAME_RESOLUTION,
|
|
|
|
CMD_EVENT_SET_FRAME_LIMIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Loads core. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_LOAD_CORE,
|
|
|
|
CMD_EVENT_LOAD_CORE_PERSIST,
|
|
|
|
CMD_EVENT_UNLOAD_CORE,
|
|
|
|
CMD_EVENT_LOAD_STATE,
|
2016-06-11 17:21:09 +01:00
|
|
|
/* Swaps the current state with what's on the undo load buffer */
|
2016-06-02 23:33:52 -05:00
|
|
|
CMD_EVENT_UNDO_LOAD_STATE,
|
2016-06-09 00:38:27 +01:00
|
|
|
/* Rewrites a savestate on disk */
|
2016-06-04 14:34:06 -05:00
|
|
|
CMD_EVENT_UNDO_SAVE_STATE,
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_SAVE_STATE,
|
|
|
|
CMD_EVENT_SAVE_STATE_DECREMENT,
|
|
|
|
CMD_EVENT_SAVE_STATE_INCREMENT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Takes screenshot. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_TAKE_SCREENSHOT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Quits RetroArch. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_QUIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Reinitialize all drivers. */
|
2017-12-17 12:56:26 -05:00
|
|
|
CMD_EVENT_REINIT_FROM_TOGGLE,
|
|
|
|
/* Reinitialize all drivers. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_REINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles cheevos hardcore mode. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitialize rewind. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_REWIND_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes rewind. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_REWIND_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles rewind. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_REWIND_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes autosave. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_AUTOSAVE_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Stops audio. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_AUDIO_STOP,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Starts audio. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_AUDIO_START,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Mutes audio. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_AUDIO_MUTE_TOGGLE,
|
2018-11-29 13:12:11 +01:00
|
|
|
/* Toggles FPS counter. */
|
|
|
|
CMD_EVENT_FPS_TOGGLE,
|
2019-03-09 16:03:17 -05:00
|
|
|
/* Gathers diagnostic info about the system and RetroArch configuration, then sends it to our servers. */
|
|
|
|
CMD_EVENT_SEND_DEBUG_INFO,
|
2019-03-09 17:48:03 -05:00
|
|
|
/* Toggles netplay hosting. */
|
|
|
|
CMD_EVENT_NETPLAY_HOST_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes overlay. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_OVERLAY_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes overlay. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_OVERLAY_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Sets current scale factor for overlay. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_OVERLAY_SET_SCALE_FACTOR,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Sets current alpha modulation for overlay. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_OVERLAY_SET_ALPHA_MOD,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Cycle to next overlay. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_OVERLAY_NEXT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes overlay. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_DSP_FILTER_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes recording system. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RECORD_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes recording system. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RECORD_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes history playlist. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_HISTORY_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes history playlist. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_HISTORY_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes core information. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_CORE_INFO_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes core information. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_CORE_INFO_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes core. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_CORE_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes core. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_CORE_INIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Apply video state changes. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_VIDEO_APPLY_STATE_CHANGES,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Set video blocking state. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_VIDEO_SET_BLOCKING_STATE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Sets current aspect ratio index. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_VIDEO_SET_ASPECT_RATIO,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Restarts RetroArch. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RESTART_RETROARCH,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Shutdown the OS */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_SHUTDOWN,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Reboot the OS */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_REBOOT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Resume RetroArch when in menu. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RESUME,
|
2017-08-14 00:29:38 +02:00
|
|
|
/* Add a playlist entry to favorites. */
|
|
|
|
CMD_EVENT_ADD_TO_FAVORITES,
|
2018-03-18 16:34:57 -04:00
|
|
|
/* Reset playlist entry associated core to DETECT */
|
2018-04-30 14:33:05 -04:00
|
|
|
CMD_EVENT_RESET_CORE_ASSOCIATION,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles pause. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_PAUSE_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Pauses RetroArch. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_UNPAUSE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Unpauses retroArch. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_PAUSE,
|
2018-10-01 02:13:53 +02:00
|
|
|
CMD_EVENT_MENU_RESET_TO_DEFAULT_CONFIG,
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG,
|
2016-08-26 09:43:29 -05:00
|
|
|
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE,
|
2018-05-13 22:33:06 -05:00
|
|
|
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR,
|
2016-08-26 09:43:29 -05:00
|
|
|
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_GAME,
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_MENU_SAVE_CONFIG,
|
|
|
|
CMD_EVENT_MENU_PAUSE_LIBRETRO,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles menu on/off. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_MENU_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Applies shader changes. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_SHADERS_APPLY_CHANGES,
|
2018-08-14 21:38:52 -04:00
|
|
|
/* A new shader preset has been loaded */
|
|
|
|
CMD_EVENT_SHADER_PRESET_LOADED,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Apply cheats. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_CHEATS_APPLY,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Initializes network system. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_NETWORK_INIT,
|
2016-12-27 16:41:27 -05:00
|
|
|
/* Initializes netplay system with a string or no host specified. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_NETPLAY_INIT,
|
2016-12-27 16:41:27 -05:00
|
|
|
/* Initializes netplay system with a direct host specified. */
|
|
|
|
CMD_EVENT_NETPLAY_INIT_DIRECT,
|
2017-01-20 16:04:10 -05:00
|
|
|
/* Initializes netplay system with a direct host specified after loading content. */
|
|
|
|
CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Deinitializes netplay system. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_NETPLAY_DEINIT,
|
2016-12-12 17:22:35 -05:00
|
|
|
/* Switch between netplay gaming and watching. */
|
|
|
|
CMD_EVENT_NETPLAY_GAME_WATCH,
|
2019-03-09 17:48:03 -05:00
|
|
|
/* Start hosting netplay. */
|
|
|
|
CMD_EVENT_NETPLAY_ENABLE_HOST,
|
|
|
|
/* Disconnect from the netplay host. */
|
|
|
|
CMD_EVENT_NETPLAY_DISCONNECT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Reinitializes audio driver. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_AUDIO_REINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Resizes windowed scale. Will reinitialize video driver. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RESIZE_WINDOWED_SCALE,
|
|
|
|
CMD_EVENT_LOG_FILE_DEINIT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles disk eject. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_DISK_EJECT_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Cycle to next disk. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_DISK_NEXT,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Cycle to previous disk. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_DISK_PREV,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Appends disk image to disk image list. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_DISK_APPEND_IMAGE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Stops rumbling. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_RUMBLE_STOP,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles mouse grab. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_GRAB_MOUSE_TOGGLE,
|
2016-12-06 03:32:28 -02:00
|
|
|
/* Toggles game focus. */
|
|
|
|
CMD_EVENT_GAME_FOCUS_TOGGLE,
|
2018-04-30 14:33:05 -04:00
|
|
|
/* Toggles desktop menu. */
|
|
|
|
CMD_EVENT_UI_COMPANION_TOGGLE,
|
2016-05-09 20:30:47 +02:00
|
|
|
/* Toggles fullscreen mode. */
|
2016-05-09 20:51:53 +02:00
|
|
|
CMD_EVENT_FULLSCREEN_TOGGLE,
|
|
|
|
CMD_EVENT_VOLUME_UP,
|
2016-05-20 17:54:29 -05:00
|
|
|
CMD_EVENT_VOLUME_DOWN,
|
2017-06-08 22:58:43 +02:00
|
|
|
CMD_EVENT_MIXER_VOLUME_UP,
|
|
|
|
CMD_EVENT_MIXER_VOLUME_DOWN,
|
2018-05-29 12:41:13 +02:00
|
|
|
CMD_EVENT_DISCORD_INIT,
|
2019-06-08 15:19:15 +02:00
|
|
|
CMD_EVENT_DISCORD_UPDATE,
|
|
|
|
CMD_EVENT_OSK_TOGGLE,
|
|
|
|
CMD_EVENT_RECORDING_TOGGLE,
|
|
|
|
CMD_EVENT_STREAMING_TOGGLE,
|
|
|
|
CMD_EVENT_AI_SERVICE_TOGGLE,
|
2019-06-09 08:35:16 +02:00
|
|
|
CMD_EVENT_BSV_RECORDING_TOGGLE,
|
|
|
|
CMD_EVENT_SHADER_NEXT,
|
2019-06-09 08:48:59 +02:00
|
|
|
CMD_EVENT_SHADER_PREV,
|
|
|
|
CMD_EVENT_CHEAT_INDEX_PLUS,
|
|
|
|
CMD_EVENT_CHEAT_INDEX_MINUS,
|
2019-05-30 09:06:16 -07:00
|
|
|
CMD_EVENT_CHEAT_TOGGLE,
|
|
|
|
CMD_EVENT_AI_SERVICE_CALL
|
2016-05-09 20:30:47 +02:00
|
|
|
};
|
|
|
|
|
2017-05-20 15:50:38 +02:00
|
|
|
bool command_set_shader(const char *arg);
|
|
|
|
|
2016-05-09 20:30:47 +02:00
|
|
|
/**
|
2016-05-09 20:51:53 +02:00
|
|
|
* command_event:
|
2016-05-09 20:30:47 +02:00
|
|
|
* @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);
|
2016-02-13 07:19:21 +01:00
|
|
|
|
2016-06-03 03:22:35 +02:00
|
|
|
RETRO_END_DECLS
|
2013-04-21 10:05:12 +02:00
|
|
|
|
2012-07-28 07:47:35 +02:00
|
|
|
#endif
|