2015-01-09 17:40:47 +01:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2021-09-21 18:38:53 +02:00
|
|
|
* Copyright (C) 2011-2021 - Daniel De Matteis
|
2019-06-18 16:33:37 -04:00
|
|
|
* Copyright (C) 2016-2019 - Brad Parker
|
2015-10-19 19:43:21 -05:00
|
|
|
*
|
2015-01-09 17:40:47 +01: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 09:11:46 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
2019-06-17 15:10:22 +02:00
|
|
|
#include <sys/types.h>
|
2017-05-11 09:11:46 +02:00
|
|
|
#include <stdlib.h>
|
2015-06-02 17:17:46 +02:00
|
|
|
|
2017-05-11 09:11:46 +02:00
|
|
|
#include <boolean.h>
|
2019-06-17 15:10:22 +02:00
|
|
|
#include <retro_inline.h>
|
|
|
|
#include <retro_common_api.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2016-06-03 02:39:35 +02:00
|
|
|
|
2020-07-08 11:48:33 +02:00
|
|
|
#include <lists/string_list.h>
|
2018-11-22 15:45:52 +01:00
|
|
|
#include <queues/task_queue.h>
|
|
|
|
#include <queues/message_queue.h>
|
2021-09-27 19:37:22 +02:00
|
|
|
#include "gfx/video_driver.h"
|
2018-11-22 15:45:52 +01:00
|
|
|
|
2017-05-11 09:11:46 +02:00
|
|
|
#include "core.h"
|
2017-05-13 18:20:14 +02:00
|
|
|
|
2023-01-09 15:28:15 +01:00
|
|
|
#include "driver.h"
|
2021-09-21 19:08:26 +02:00
|
|
|
#include "runloop.h"
|
2021-09-30 23:22:50 +02:00
|
|
|
#include "retroarch_types.h"
|
2021-09-21 19:08:26 +02:00
|
|
|
|
2016-06-03 02:39:35 +02:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-01-09 17:40:47 +01:00
|
|
|
|
2018-09-11 18:45:01 -04: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.
|
|
|
|
*/
|
|
|
|
|
2019-08-24 19:25:03 +02:00
|
|
|
#define RETRO_ENVIRONMENT_POLL_TYPE_OVERRIDE (4 | RETRO_ENVIRONMENT_RETROARCH_START_BLOCK)
|
|
|
|
/* unsigned * --
|
|
|
|
* Tells the frontend to override the poll type behavior.
|
2019-11-17 16:45:40 +01:00
|
|
|
* Allows the frontend to influence the polling behavior of the
|
2019-08-24 19:25:03 +02:00
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2021-11-22 03:27:23 +01:00
|
|
|
#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 )
|
|
|
|
|
2021-09-28 12:56:10 +02:00
|
|
|
bool retroarch_ctl(enum rarch_ctl_state state, void *data);
|
2015-01-09 17:40:47 +01:00
|
|
|
|
2016-05-09 07:09:26 +02:00
|
|
|
int retroarch_get_capabilities(enum rarch_capabilities type,
|
2022-08-08 19:11:15 +02:00
|
|
|
char *s, size_t len, size_t _len);
|
2015-04-16 20:17:05 +02:00
|
|
|
|
2016-10-01 05:51:03 +02:00
|
|
|
void retroarch_override_setting_set(enum rarch_override_setting enum_idx, void *data);
|
2016-08-01 20:41:42 +02:00
|
|
|
|
2016-10-01 06:14:30 +02:00
|
|
|
void retroarch_override_setting_unset(enum rarch_override_setting enum_idx, void *data);
|
2016-08-01 20:41:42 +02:00
|
|
|
|
2016-10-01 06:05:08 +02:00
|
|
|
bool retroarch_override_setting_is_set(enum rarch_override_setting enum_idx, void *data);
|
2016-08-01 20:41:42 +02:00
|
|
|
|
2022-12-22 21:36:32 +01:00
|
|
|
const char* video_shader_get_current_shader_preset(void);
|
2018-01-29 22:11:08 -05:00
|
|
|
|
2016-05-11 20:50:34 +02:00
|
|
|
/**
|
|
|
|
* retroarch_main_init:
|
|
|
|
* @argc : Count of (commandline) arguments.
|
|
|
|
* @argv : (Commandline) arguments.
|
|
|
|
*
|
|
|
|
* Initializes the program.
|
|
|
|
*
|
2022-08-01 15:46:08 +02:00
|
|
|
* @return true on success, otherwise false if there was an error.
|
2016-05-11 20:50:34 +02:00
|
|
|
**/
|
|
|
|
bool retroarch_main_init(int argc, char *argv[]);
|
|
|
|
|
2017-05-08 03:54:51 +02:00
|
|
|
bool retroarch_main_quit(void);
|
|
|
|
|
2017-05-11 09:11:46 +02:00
|
|
|
global_t *global_get_ptr(void);
|
|
|
|
|
2020-07-08 11:48:33 +02:00
|
|
|
content_state_t *content_state_get_ptr(void);
|
|
|
|
|
|
|
|
unsigned content_get_subsystem_rom_id(void);
|
|
|
|
|
|
|
|
int content_get_subsystem(void);
|
|
|
|
|
2019-07-20 12:43:43 +02:00
|
|
|
void retroarch_menu_running(void);
|
2017-05-15 04:31:40 +02:00
|
|
|
|
2019-07-20 12:43:43 +02:00
|
|
|
void retroarch_menu_running_finished(bool quit);
|
2017-05-15 04:31:40 +02:00
|
|
|
|
2019-04-15 23:14:49 -04:00
|
|
|
enum retro_language rarch_get_language_from_iso(const char *lang);
|
|
|
|
|
2019-07-31 11:32:19 +01:00
|
|
|
void rarch_favorites_init(void);
|
|
|
|
|
|
|
|
void rarch_favorites_deinit(void);
|
|
|
|
|
2019-06-17 12:49:21 +02: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);
|
|
|
|
|
2019-06-17 11:18:27 +02:00
|
|
|
/* Camera */
|
|
|
|
|
2019-11-17 22:58:52 +01:00
|
|
|
unsigned int retroarch_get_rotation(void);
|
2019-11-17 18:03:57 +01:00
|
|
|
|
2020-02-02 02:16:00 +01:00
|
|
|
void retroarch_init_task_queue(void);
|
|
|
|
|
2023-01-08 09:05:46 +01:00
|
|
|
/* 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);
|
|
|
|
|
2022-10-12 13:27:31 +02:00
|
|
|
enum rarch_state_flags
|
|
|
|
{
|
|
|
|
RARCH_FLAGS_HAS_SET_USERNAME = (1 << 0),
|
|
|
|
RARCH_FLAGS_HAS_SET_VERBOSITY = (1 << 1),
|
|
|
|
RARCH_FLAGS_HAS_SET_LIBRETRO = (1 << 2),
|
|
|
|
RARCH_FLAGS_HAS_SET_LIBRETRO_DIRECTORY = (1 << 3),
|
|
|
|
RARCH_FLAGS_HAS_SET_SAVE_PATH = (1 << 4),
|
|
|
|
RARCH_FLAGS_HAS_SET_STATE_PATH = (1 << 5),
|
|
|
|
RARCH_FLAGS_HAS_SET_UPS_PREF = (1 << 6),
|
|
|
|
RARCH_FLAGS_HAS_SET_BPS_PREF = (1 << 7),
|
|
|
|
RARCH_FLAGS_HAS_SET_IPS_PREF = (1 << 8),
|
|
|
|
RARCH_FLAGS_HAS_SET_LOG_TO_FILE = (1 << 9),
|
|
|
|
RARCH_FLAGS_UPS_PREF = (1 << 10),
|
|
|
|
RARCH_FLAGS_BPS_PREF = (1 << 11),
|
|
|
|
RARCH_FLAGS_IPS_PREF = (1 << 12),
|
2022-12-19 03:29:46 +01:00
|
|
|
RARCH_FLAGS_BLOCK_CONFIG_READ = (1 << 13)
|
2022-10-12 13:27:31 +02:00
|
|
|
};
|
|
|
|
|
2021-11-12 04:45:09 +01:00
|
|
|
/**
|
|
|
|
* retroarch_fail:
|
|
|
|
* @error_code : Error code.
|
|
|
|
* @error : Error message to show.
|
|
|
|
*
|
|
|
|
* Sanely kills the program.
|
|
|
|
**/
|
|
|
|
void retroarch_fail(int error_code, const char *error);
|
|
|
|
|
2022-10-12 13:27:31 +02:00
|
|
|
uint16_t retroarch_get_flags(void);
|
|
|
|
|
2019-12-04 06:21:16 +01:00
|
|
|
RETRO_END_DECLS
|
2019-11-15 19:08:49 -08:00
|
|
|
|
2015-01-09 17:40:47 +01:00
|
|
|
#endif
|