2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2010-12-30 12:54:49 +00:00
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2010-12-30 12:54:49 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2010-12-30 12:54:49 +00:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2010-12-30 12:54:49 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DYNAMIC_H
|
|
|
|
#define __DYNAMIC_H
|
|
|
|
|
2011-12-24 12:46:12 +00:00
|
|
|
#include "boolean.h"
|
2012-04-05 09:47:43 +00:00
|
|
|
#include "libretro.h"
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2011-12-01 21:36:26 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_DYNAMIC) || defined(HAVE_DYLIB)
|
|
|
|
#define NEED_DYNAMIC
|
|
|
|
#else
|
|
|
|
#undef NEED_DYNAMIC
|
|
|
|
#endif
|
|
|
|
|
2013-02-09 09:36:39 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-04-14 14:24:19 +00:00
|
|
|
void init_libretro_sym(bool dummy);
|
2012-04-05 09:47:43 +00:00
|
|
|
void uninit_libretro_sym(void);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2011-03-07 19:05:03 +00:00
|
|
|
typedef void *dylib_t;
|
2011-12-01 21:36:26 +00:00
|
|
|
#ifdef NEED_DYNAMIC
|
2011-05-31 13:03:59 +00:00
|
|
|
typedef void (*function_t)(void);
|
2011-03-07 18:12:14 +00:00
|
|
|
|
|
|
|
dylib_t dylib_load(const char *path);
|
|
|
|
void dylib_close(dylib_t lib);
|
2011-05-31 13:03:59 +00:00
|
|
|
function_t dylib_proc(dylib_t lib, const char *proc);
|
2011-12-01 21:36:26 +00:00
|
|
|
#endif
|
2011-03-07 18:12:14 +00:00
|
|
|
|
2013-05-02 13:17:31 +00:00
|
|
|
// Sets environment callback in order to get statically known information from it.
|
|
|
|
// Fetched via environment callbacks instead of retro_get_system_info(), as this info
|
|
|
|
// is part of extensions.
|
|
|
|
// Should only be called once right after core load to avoid overwriting
|
|
|
|
// the "real" environ callback.
|
|
|
|
//
|
|
|
|
// For statically linked cores, pass retro_set_environment as argument.
|
2014-07-28 17:37:25 +00:00
|
|
|
void libretro_get_environment_info(void (*)(retro_environment_t), bool *load_no_content);
|
2013-05-02 13:17:31 +00:00
|
|
|
|
2013-03-17 19:08:24 +00:00
|
|
|
#ifdef HAVE_DYNAMIC
|
|
|
|
// Gets system info from an arbitrary lib.
|
|
|
|
// The struct returned must be freed as strings are allocated dynamically.
|
2014-07-28 17:37:25 +00:00
|
|
|
bool libretro_get_system_info(const char *path, struct retro_system_info *info, bool *load_no_content);
|
2013-03-17 19:08:24 +00:00
|
|
|
void libretro_free_system_info(struct retro_system_info *info);
|
|
|
|
#endif
|
|
|
|
|
2013-03-22 19:54:33 +00:00
|
|
|
// Transforms a library id to a name suitable as a pathname.
|
2013-03-22 22:42:34 +00:00
|
|
|
void libretro_get_current_core_pathname(char *name, size_t size);
|
2013-03-22 19:54:33 +00:00
|
|
|
|
2014-04-04 15:04:01 +00:00
|
|
|
const struct retro_subsystem_info *libretro_find_subsystem_info(const struct retro_subsystem_info *info, unsigned num_info, const char *ident);
|
2014-04-12 11:22:24 +00:00
|
|
|
const struct retro_controller_description *libretro_find_controller_description(const struct retro_controller_info *info, unsigned id);
|
2014-04-04 12:58:42 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void (*pretro_init)(void);
|
|
|
|
extern void (*pretro_deinit)(void);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern unsigned (*pretro_api_version)(void);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void (*pretro_get_system_info)(struct retro_system_info*);
|
|
|
|
extern void (*pretro_get_system_av_info)(struct retro_system_av_info*);
|
2011-04-17 11:30:59 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void (*pretro_set_environment)(retro_environment_t);
|
|
|
|
extern void (*pretro_set_video_refresh)(retro_video_refresh_t);
|
|
|
|
extern void (*pretro_set_audio_sample)(retro_audio_sample_t);
|
|
|
|
extern void (*pretro_set_audio_sample_batch)(retro_audio_sample_batch_t);
|
|
|
|
extern void (*pretro_set_input_poll)(retro_input_poll_t);
|
|
|
|
extern void (*pretro_set_input_state)(retro_input_state_t);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-09 22:37:09 +00:00
|
|
|
extern void (*pretro_set_controller_port_device)(unsigned, unsigned);
|
2011-01-12 18:24:20 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void (*pretro_reset)(void);
|
|
|
|
extern void (*pretro_run)(void);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern size_t (*pretro_serialize_size)(void);
|
|
|
|
extern bool (*pretro_serialize)(void*, size_t);
|
|
|
|
extern bool (*pretro_unserialize)(const void*, size_t);
|
2011-01-11 15:53:31 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void (*pretro_cheat_reset)(void);
|
|
|
|
extern void (*pretro_cheat_set)(unsigned, bool, const char*);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern bool (*pretro_load_game)(const struct retro_game_info*);
|
|
|
|
extern bool (*pretro_load_game_special)(unsigned, const struct retro_game_info*, size_t);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void (*pretro_unload_game)(void);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern unsigned (*pretro_get_region)(void);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2012-04-05 09:47:43 +00:00
|
|
|
extern void *(*pretro_get_memory_data)(unsigned);
|
|
|
|
extern size_t (*pretro_get_memory_size)(unsigned);
|
2010-12-30 12:54:49 +00:00
|
|
|
|
2013-08-24 20:35:54 +00:00
|
|
|
extern bool rarch_environment_cb(unsigned cmd, void *data);
|
|
|
|
|
2013-02-09 09:36:39 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-12-30 12:54:49 +00:00
|
|
|
#endif
|
|
|
|
|