RetroArch/dynamic.h

96 lines
3.1 KiB
C
Raw Normal View History

2011-01-17 19:54:58 +00:00
/* SSNES - A Super Nintendo Entertainment System (SNES) Emulator frontend for libsnes.
2011-01-23 19:29:28 +00:00
* Copyright (C) 2010-2011 - Hans-Kristian Arntzen
2010-12-30 12:54:49 +00:00
*
* Some code herein may be based on code found in BSNES.
*
* SSNES 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.
*
* SSNES 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 SSNES.
* 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"
2011-11-30 16:32:30 +00:00
#include "libsnes.hpp"
2010-12-30 12:54:49 +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
void init_libsnes_sym(void);
void uninit_libsnes_sym(void);
2010-12-30 12:54:49 +00:00
2011-03-07 19:05:03 +00:00
typedef void *dylib_t;
#ifdef NEED_DYNAMIC
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);
function_t dylib_proc(dylib_t lib, const char *proc);
#endif
2011-03-07 18:12:14 +00:00
2010-12-30 12:54:49 +00:00
extern void (*psnes_init)(void);
extern void (*psnes_set_video_refresh)(snes_video_refresh_t);
extern void (*psnes_set_audio_sample)(snes_audio_sample_t);
extern void (*psnes_set_input_poll)(snes_input_poll_t);
extern void (*psnes_set_input_state)(snes_input_state_t);
2011-04-17 11:30:59 +00:00
extern void (*psnes_cheat_reset)(void);
extern void (*psnes_cheat_set)(unsigned, bool, const char*);
2011-11-02 18:31:36 +00:00
extern const char *(*psnes_library_id)(void);
2010-12-30 12:54:49 +00:00
extern unsigned (*psnes_library_revision_minor)(void);
extern unsigned (*psnes_library_revision_major)(void);
extern bool (*psnes_load_cartridge_normal)(const char*, const uint8_t*, unsigned);
extern bool (*psnes_load_cartridge_super_game_boy)(
const char*, const uint8_t*, unsigned,
const char*, const uint8_t*, unsigned);
extern bool (*psnes_load_cartridge_bsx)(
const char*, const uint8_t*, unsigned,
const char*, const uint8_t*, unsigned);
extern bool (*psnes_load_cartridge_bsx_slotted)(
const char*, const uint8_t*, unsigned,
const char*, const uint8_t*, unsigned);
extern bool (*psnes_load_cartridge_sufami_turbo)(
const char*, const uint8_t*, unsigned,
const char*, const uint8_t*, unsigned,
const char*, const uint8_t*, unsigned);
2011-01-10 06:58:11 +00:00
extern void (*psnes_set_controller_port_device)(bool, unsigned);
2010-12-30 12:54:49 +00:00
extern bool (*psnes_get_region)(void);
2010-12-30 12:54:49 +00:00
extern unsigned (*psnes_serialize_size)(void);
extern bool (*psnes_serialize)(uint8_t*, unsigned);
extern bool (*psnes_unserialize)(const uint8_t*, unsigned);
extern void (*psnes_reset)(void);
2010-12-30 12:54:49 +00:00
extern void (*psnes_run)(void);
extern void (*psnes_set_cartridge_basename)(const char*);
extern uint8_t* (*psnes_get_memory_data)(unsigned);
extern unsigned (*psnes_get_memory_size)(unsigned);
extern void (*psnes_unload_cartridge)(void);
extern void (*psnes_term)(void);
#endif