RetroArch/retroarch.h

214 lines
6.7 KiB
C
Raw Normal View History

2015-01-09 16:40:47 +00:00
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
2021-09-21 16:38:53 +00:00
* Copyright (C) 2011-2021 - Daniel De Matteis
2019-06-18 20:33:37 +00:00
* Copyright (C) 2016-2019 - Brad Parker
*
2015-01-09 16:40:47 +00: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/>.
*/
#ifndef __RETROARCH_H
#define __RETROARCH_H
2017-05-11 07:11:46 +00:00
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
2017-05-11 07:11:46 +00:00
#include <stdlib.h>
2015-06-02 15:17:46 +00:00
2017-05-11 07:11:46 +00:00
#include <boolean.h>
#include <retro_inline.h>
#include <retro_common_api.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
2016-06-03 00:39:35 +00:00
#include <lists/string_list.h>
#include <queues/task_queue.h>
#include <queues/message_queue.h>
#include "gfx/video_driver.h"
2017-05-11 07:11:46 +00:00
#include "core.h"
2017-05-13 16:20:14 +00:00
2021-09-21 17:08:26 +00:00
#include "runloop.h"
#include "retroarch_types.h"
2021-09-21 17:08:26 +00:00
2016-06-03 00:39:35 +00:00
RETRO_BEGIN_DECLS
2015-01-09 16:40:47 +00:00
2018-09-11 22:45:01 +00:00
#define RETRO_ENVIRONMENT_RETROARCH_START_BLOCK 0x800000
#define RETRO_ENVIRONMENT_SET_SAVE_STATE_IN_BACKGROUND (2 | RETRO_ENVIRONMENT_RETROARCH_START_BLOCK)
/* bool * --
* Boolean value that tells the front end to save states in the
* background or not.
*/
#define RETRO_ENVIRONMENT_GET_CLEAR_ALL_THREAD_WAITS_CB (3 | RETRO_ENVIRONMENT_RETROARCH_START_BLOCK)
/* retro_environment_t * --
* Provides the callback to the frontend method which will cancel
* all currently waiting threads. Used when coordination is needed
* between the core and the frontend to gracefully stop all threads.
*/
#define RETRO_ENVIRONMENT_POLL_TYPE_OVERRIDE (4 | RETRO_ENVIRONMENT_RETROARCH_START_BLOCK)
/* unsigned * --
* Tells the frontend to override the poll type behavior.
* Allows the frontend to influence the polling behavior of the
* frontend.
*
* Will be unset when retro_unload_game is called.
*
* 0 - Don't Care, no changes, frontend still determines polling type behavior.
* 1 - Early
* 2 - Normal
* 3 - Late
*/
#define DRIVERS_CMD_ALL \
( DRIVER_AUDIO_MASK \
| DRIVER_VIDEO_MASK \
| DRIVER_INPUT_MASK \
| DRIVER_CAMERA_MASK \
| DRIVER_LOCATION_MASK \
| DRIVER_MENU_MASK \
| DRIVERS_VIDEO_INPUT_MASK \
| DRIVER_BLUETOOTH_MASK \
| DRIVER_WIFI_MASK \
| DRIVER_LED_MASK \
| DRIVER_MIDI_MASK )
bool retroarch_ctl(enum rarch_ctl_state state, void *data);
2015-01-09 16:40:47 +00:00
2016-05-09 05:09:26 +00:00
int retroarch_get_capabilities(enum rarch_capabilities type,
2016-01-26 04:56:53 +00:00
char *s, size_t len);
2015-04-16 18:17:05 +00:00
2016-10-01 03:51:03 +00:00
void retroarch_override_setting_set(enum rarch_override_setting enum_idx, void *data);
2016-08-01 18:41:42 +00:00
void retroarch_override_setting_unset(enum rarch_override_setting enum_idx, void *data);
2016-08-01 18:41:42 +00:00
2016-10-01 04:05:08 +00:00
bool retroarch_override_setting_is_set(enum rarch_override_setting enum_idx, void *data);
2016-08-01 18:41:42 +00:00
const char* retroarch_get_shader_preset(void);
2016-05-11 18:50:34 +00:00
/**
* retroarch_main_init:
* @argc : Count of (commandline) arguments.
* @argv : (Commandline) arguments.
*
* Initializes the program.
*
* Returns: 1 (true) on success, otherwise false (0) if there was an error.
**/
bool retroarch_main_init(int argc, char *argv[]);
bool retroarch_main_quit(void);
2017-05-11 07:11:46 +00:00
global_t *global_get_ptr(void);
content_state_t *content_state_get_ptr(void);
unsigned content_get_subsystem_rom_id(void);
int content_get_subsystem(void);
void retroarch_menu_running(void);
void retroarch_path_set_redirect(settings_t *settings);
void retroarch_menu_running_finished(bool quit);
enum retro_language rarch_get_language_from_iso(const char *lang);
void rarch_favorites_init(void);
void rarch_favorites_deinit(void);
2019-06-17 10:49:21 +00:00
/* Audio */
/**
* config_get_audio_driver_options:
*
* Get an enumerated list of all audio driver names, separated by '|'.
*
* Returns: string listing of all audio driver names, separated by '|'.
**/
const char* config_get_audio_driver_options(void);
/* BSV Movie */
void bsv_movie_frame_rewind(void);
2019-06-17 09:18:27 +00:00
/* Camera */
unsigned int retroarch_get_rotation(void);
2020-02-02 01:16:00 +00:00
void retroarch_init_task_queue(void);
2021-03-15 21:42:59 +00:00
/* Human readable order of input binds */
static const unsigned input_config_bind_order[] = {
RETRO_DEVICE_ID_JOYPAD_UP,
RETRO_DEVICE_ID_JOYPAD_DOWN,
RETRO_DEVICE_ID_JOYPAD_LEFT,
RETRO_DEVICE_ID_JOYPAD_RIGHT,
RETRO_DEVICE_ID_JOYPAD_A,
RETRO_DEVICE_ID_JOYPAD_B,
RETRO_DEVICE_ID_JOYPAD_X,
RETRO_DEVICE_ID_JOYPAD_Y,
RETRO_DEVICE_ID_JOYPAD_SELECT,
RETRO_DEVICE_ID_JOYPAD_START,
RETRO_DEVICE_ID_JOYPAD_L,
RETRO_DEVICE_ID_JOYPAD_R,
RETRO_DEVICE_ID_JOYPAD_L2,
RETRO_DEVICE_ID_JOYPAD_R2,
RETRO_DEVICE_ID_JOYPAD_L3,
RETRO_DEVICE_ID_JOYPAD_R3,
19, /* Left Analog Up */
18, /* Left Analog Down */
17, /* Left Analog Left */
16, /* Left Analog Right */
23, /* Right Analog Up */
22, /* Right Analog Down */
21, /* Right Analog Left */
20, /* Right Analog Right */
};
/* Creates folder and core options stub file for subsequent runs */
bool core_options_create_override(bool game_specific);
bool core_options_remove_override(bool game_specific);
void core_options_reset(void);
void core_options_flush(void);
2021-01-19 03:38:07 +00:00
typedef enum apple_view_type
{
APPLE_VIEW_TYPE_NONE = 0,
APPLE_VIEW_TYPE_OPENGL_ES,
APPLE_VIEW_TYPE_OPENGL,
APPLE_VIEW_TYPE_VULKAN,
APPLE_VIEW_TYPE_METAL
} apple_view_type_t;
bool retroarch_get_current_savestate_path(char *path, size_t len);
bool retroarch_get_entry_state_path(char *path, size_t len, unsigned slot);
/**
* retroarch_fail:
* @error_code : Error code.
* @error : Error message to show.
*
* Sanely kills the program.
**/
void retroarch_fail(int error_code, const char *error);
RETRO_END_DECLS
2019-11-16 03:08:49 +00:00
2015-01-09 16:40:47 +00:00
#endif