2012-04-21 23:13:50 +02:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2010-12-30 13:54:49 +01:00
|
|
|
*
|
2012-04-21 23:13:50 +02:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2010-12-30 13:54:49 +01: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 23:13:50 +02:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2010-12-30 13:54:49 +01: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 23:31:57 +02:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2010-12-30 13:54:49 +01:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DYNAMIC_H
|
|
|
|
#define __DYNAMIC_H
|
|
|
|
|
2011-12-24 13:46:12 +01:00
|
|
|
#include "boolean.h"
|
2012-04-05 11:47:43 +02:00
|
|
|
#include "libretro.h"
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2011-12-01 22:36:26 +01: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 10:36:39 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2013-04-14 16:24:19 +02:00
|
|
|
void init_libretro_sym(bool dummy);
|
2012-04-05 11:47:43 +02:00
|
|
|
void uninit_libretro_sym(void);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2011-03-07 20:05:03 +01:00
|
|
|
typedef void *dylib_t;
|
2011-12-01 22:36:26 +01:00
|
|
|
#ifdef NEED_DYNAMIC
|
2011-05-31 15:03:59 +02:00
|
|
|
typedef void (*function_t)(void);
|
2011-03-07 19:12:14 +01:00
|
|
|
|
|
|
|
dylib_t dylib_load(const char *path);
|
|
|
|
void dylib_close(dylib_t lib);
|
2011-05-31 15:03:59 +02:00
|
|
|
function_t dylib_proc(dylib_t lib, const char *proc);
|
2011-12-01 22:36:26 +01:00
|
|
|
#endif
|
2011-03-07 19:12:14 +01:00
|
|
|
|
2013-05-02 15:17:31 +02: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.
|
|
|
|
void libretro_get_environment_info(void (*)(retro_environment_t), bool *load_no_rom);
|
|
|
|
|
2013-03-17 20:08:24 +01:00
|
|
|
#ifdef HAVE_DYNAMIC
|
|
|
|
// Gets system info from an arbitrary lib.
|
|
|
|
// The struct returned must be freed as strings are allocated dynamically.
|
2013-05-02 14:42:58 +02:00
|
|
|
bool libretro_get_system_info(const char *path, struct retro_system_info *info, bool *load_no_rom);
|
2013-03-17 20:08:24 +01:00
|
|
|
void libretro_free_system_info(struct retro_system_info *info);
|
|
|
|
#endif
|
|
|
|
|
2013-03-22 20:54:33 +01:00
|
|
|
// Transforms a library id to a name suitable as a pathname.
|
2013-03-22 23:42:34 +01:00
|
|
|
void libretro_get_current_core_pathname(char *name, size_t size);
|
2013-03-22 20:54:33 +01:00
|
|
|
|
2014-04-04 17:04:01 +02: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 13:22:24 +02:00
|
|
|
const struct retro_controller_description *libretro_find_controller_description(const struct retro_controller_info *info, unsigned id);
|
2014-04-04 14:58:42 +02:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern void (*pretro_init)(void);
|
|
|
|
extern void (*pretro_deinit)(void);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern unsigned (*pretro_api_version)(void);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02: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 13:30:59 +02:00
|
|
|
|
2012-04-05 11:47:43 +02: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 13:54:49 +01:00
|
|
|
|
2012-04-10 00:37:09 +02:00
|
|
|
extern void (*pretro_set_controller_port_device)(unsigned, unsigned);
|
2011-01-12 19:24:20 +01:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern void (*pretro_reset)(void);
|
|
|
|
extern void (*pretro_run)(void);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02: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 16:53:31 +01:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern void (*pretro_cheat_reset)(void);
|
|
|
|
extern void (*pretro_cheat_set)(unsigned, bool, const char*);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02: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 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern void (*pretro_unload_game)(void);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern unsigned (*pretro_get_region)(void);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2012-04-05 11:47:43 +02:00
|
|
|
extern void *(*pretro_get_memory_data)(unsigned);
|
|
|
|
extern size_t (*pretro_get_memory_size)(unsigned);
|
2010-12-30 13:54:49 +01:00
|
|
|
|
2013-08-24 22:35:54 +02:00
|
|
|
extern bool rarch_environment_cb(unsigned cmd, void *data);
|
|
|
|
|
2013-02-09 10:36:39 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-12-30 13:54:49 +01:00
|
|
|
#endif
|
|
|
|
|