mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 21:40:49 +00:00
Some more work on external API.
This commit is contained in:
parent
59c6de69b0
commit
75d618140b
3
Makefile
3
Makefile
@ -97,7 +97,8 @@ ifeq ($(HAVE_XML), 1)
|
||||
DEFINES += $(XML_CFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTER), 1)
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
OBJ += gfx/ext.o
|
||||
LIBS += -ldl
|
||||
endif
|
||||
|
||||
|
@ -12,7 +12,7 @@ HAVE_XML = 1
|
||||
HAVE_FREETYPE = 1
|
||||
HAVE_XAUDIO = 1
|
||||
HAVE_RSOUND = 1
|
||||
HAVE_FILTER = 1
|
||||
HAVE_DYLIB = 1
|
||||
HAVE_NETPLAY = 1
|
||||
HAVE_FBO = 1
|
||||
libsnes ?= -lsnes
|
||||
@ -55,8 +55,8 @@ ifeq ($(HAVE_XML), 1)
|
||||
LIBS += -lxml2
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTER), 1)
|
||||
DEFINES += -DHAVE_FILTER
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
DEFINES += -DHAVE_DYLIB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETPLAY), 1)
|
||||
@ -81,6 +81,10 @@ ifeq ($(HAVE_FBO), 1)
|
||||
DEFINES += -DHAVE_FBO
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
OBJ += gfx/ext.c
|
||||
endif
|
||||
|
||||
ifneq ($(V),1)
|
||||
Q := @
|
||||
endif
|
||||
|
@ -12,7 +12,7 @@ HAVE_XML = 1
|
||||
HAVE_FREETYPE = 1
|
||||
HAVE_XAUDIO = 1
|
||||
HAVE_RSOUND = 0
|
||||
HAVE_FILTER = 1
|
||||
HAVE_DYLIB = 1
|
||||
HAVE_NETPLAY = 1
|
||||
HAVE_FBO = 1
|
||||
libsnes ?= -lsnes
|
||||
@ -55,8 +55,8 @@ ifeq ($(HAVE_XML), 1)
|
||||
LIBS += -lxml2 -lz -lws2_32
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_FILTER), 1)
|
||||
DEFINES += -DHAVE_FILTER
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
DEFINES += -DHAVE_DYLIB
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETPLAY), 1)
|
||||
@ -81,6 +81,11 @@ ifeq ($(HAVE_FBO), 1)
|
||||
DEFINES += -DHAVE_FBO
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DYLIB), 1)
|
||||
OBJ += gfx/ext.c
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(V),1)
|
||||
Q := @
|
||||
endif
|
||||
|
13
config.def.h
13
config.def.h
@ -33,7 +33,7 @@
|
||||
#ifdef HAVE_SDL
|
||||
#include "SDL.h"
|
||||
#else
|
||||
#error HAVE_SDL is not defined!
|
||||
#error "HAVE_SDL is not defined!"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SRC
|
||||
@ -45,6 +45,7 @@
|
||||
#define VIDEO_GL 0
|
||||
#define VIDEO_XVIDEO 11
|
||||
#define VIDEO_SDL 13
|
||||
#define VIDEO_EXT 14
|
||||
////////////////////////
|
||||
#define AUDIO_RSOUND 1
|
||||
#define AUDIO_OSS 2
|
||||
@ -64,6 +65,12 @@
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_GL
|
||||
#elif defined(HAVE_XVIDEO)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_XVIDEO
|
||||
#elif defined(HAVE_SDL)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_SDL
|
||||
#elif defined(HAVE_DYLIB)
|
||||
#define VIDEO_DEFAULT_DRIVER VIDEO_EXT
|
||||
#else
|
||||
#error "Need at least one video driver!"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ALSA)
|
||||
@ -85,13 +92,15 @@
|
||||
#elif defined(HAVE_ROAR)
|
||||
#define AUDIO_DEFAULT_DRIVER AUDIO_ROAR
|
||||
#else
|
||||
#error Need at least one audio driver!
|
||||
#error "Need at least one audio driver!"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SDL)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_SDL
|
||||
#elif defined(HAVE_XVIDEO)
|
||||
#define INPUT_DEFAULT_DRIVER INPUT_X
|
||||
#else
|
||||
#error "Need at least one input driver!"
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -62,10 +62,10 @@ static const bool _xaudio_supp = true;
|
||||
static const bool _xaudio_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FILTER
|
||||
static const bool _filter_supp = true;
|
||||
#ifdef HAVE_DYLIB
|
||||
static const bool _dylib_supp = true;
|
||||
#else
|
||||
static const bool _filter_supp = false;
|
||||
static const bool _dylib_supp = false;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CG
|
||||
|
4
driver.c
4
driver.c
@ -220,7 +220,7 @@ void uninit_audio(void)
|
||||
free(g_extern.audio_data.conv_outsamples); g_extern.audio_data.conv_outsamples = NULL;
|
||||
}
|
||||
|
||||
#ifdef HAVE_FILTER
|
||||
#ifdef HAVE_DYLIB
|
||||
static void init_filter(void)
|
||||
{
|
||||
if (g_extern.filter.active)
|
||||
@ -319,7 +319,7 @@ static void deinit_shader_dir(void)
|
||||
|
||||
void init_video_input(void)
|
||||
{
|
||||
#ifdef HAVE_FILTER
|
||||
#ifdef HAVE_DYLIB
|
||||
init_filter();
|
||||
#endif
|
||||
|
||||
|
@ -88,6 +88,8 @@ struct settings
|
||||
float msg_pos_y;
|
||||
|
||||
bool force_16bit;
|
||||
|
||||
char external_driver[256];
|
||||
} video;
|
||||
|
||||
struct
|
||||
|
@ -63,10 +63,13 @@ typedef struct ssnes_video_info
|
||||
|
||||
// If non-NULL, requests the use of an XML shader. Can be disregarded.
|
||||
const char *xml_shader;
|
||||
// If non-NULL, requests the use of a Cg shader. Can be disregarded. If both are non-NULL, Cg or XML could be used at the discretion of the plugin.
|
||||
const char *cg_shader;
|
||||
|
||||
// Requestes that a certain TTF font is used for rendering messages to the screen.
|
||||
// Can be disregarded.
|
||||
const char *ttf_font;
|
||||
unsigned ttf_font_size;
|
||||
} ssnes_video_info_t;
|
||||
|
||||
#define SSNES_AXIS_NEG(x) (((unsigned)(x) << 16) | 0xFFFFU)
|
||||
@ -107,14 +110,17 @@ struct ssnes_keybind
|
||||
|
||||
typedef struct ssnes_input_driver
|
||||
{
|
||||
// Inits input driver.
|
||||
void* (*init)(const unsigned joypad_index[5]);
|
||||
// Inits input driver. Joypad index denotes which joypads are desired for the various players.
|
||||
// Should an entry be negative, do not open joypad for that player.
|
||||
void* (*init)(const int joypad_index[5]);
|
||||
|
||||
// Polls input. Called once every frame.
|
||||
void (*poll)(void* data);
|
||||
|
||||
// Queries input state for a certain key on a certain player. Players are 1 - 5.
|
||||
int (*input_state)(void* data, const struct snes_keybind *bind, unsigned player);
|
||||
// For digital inputs, pressed key is 1, not pressed key is 0.
|
||||
// Analog values have same range as a signed 16-bit integer.
|
||||
int (*input_state)(void* data, const struct ssnes_keybind *bind, unsigned player);
|
||||
|
||||
// Frees the input struct.
|
||||
void (*free)(void* data);
|
||||
@ -131,7 +137,7 @@ typedef struct ssnes_video_driver
|
||||
// Should the video driver request that a certain input driver is used,
|
||||
// it is possible to set the driver to *input, and driver handle to *input_data.
|
||||
// If no certain driver is desired, set both of these to NULL.
|
||||
void* (*init)(const video_info_t *video, const input_driver_t **input, void **input_data);
|
||||
void* (*init)(const ssnes_video_info_t *video, const ssnes_input_driver_t **input, void **input_data);
|
||||
|
||||
// Updates frame on the screen. frame can be either XRGB1555 or ARGB32 format depending on rgb32 setting in ssnes_video_info_t. Pitch is the distance in bytes between two scanlines in memory. When msg is non-NULL, it's a message that should be displayed to the user.
|
||||
int (*frame)(void* data, const void* frame, unsigned width, unsigned height, unsigned pitch, const char *msg);
|
||||
@ -145,17 +151,14 @@ typedef struct ssnes_video_driver
|
||||
// Does the window have focus?
|
||||
int (*focus)(void *data);
|
||||
|
||||
// Sets an XML shader. Implementing this function is optional, and can be set to NULL.
|
||||
int (*xml_shader)(void *data, const char *path);
|
||||
|
||||
// Frees the video driver.
|
||||
void (*free)(void* data);
|
||||
|
||||
// A human-readable identification of the video driver.
|
||||
const char *ident;
|
||||
} video_driver_t;
|
||||
} ssnes_video_driver_t;
|
||||
|
||||
SSNES_API_DECL const ssnes_video_info_t* ssnes_video_init(void);
|
||||
SSNES_API_DECL const ssnes_video_driver_t* ssnes_video_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ if [ $HAVE_DYNAMIC != yes ]; then
|
||||
add_define_make libsnes $LIBSNES
|
||||
fi
|
||||
|
||||
check_lib FILTER -ldl dlopen
|
||||
check_lib DYLIB -ldl dlopen
|
||||
check_lib NETPLAY -lc socket
|
||||
|
||||
check_lib ALSA -lasound snd_pcm_open
|
||||
@ -64,7 +64,7 @@ check_lib XVIDEO -lXv XvShmCreateImage
|
||||
check_lib STRL -lc strlcpy
|
||||
|
||||
# Creates config.mk and config.h.
|
||||
VARS="ALSA OSS AL RSOUND ROAR JACK PULSE SDL FILTER CG XML DYNAMIC FFMPEG AVCODEC AVFORMAT AVCORE AVUTIL SWSCALE SRC CONFIGFILE FREETYPE XVIDEO NETPLAY FBO STRL"
|
||||
VARS="ALSA OSS AL RSOUND ROAR JACK PULSE SDL DYLIB CG XML DYNAMIC FFMPEG AVCODEC AVFORMAT AVCORE AVUTIL SWSCALE SRC CONFIGFILE FREETYPE XVIDEO NETPLAY FBO STRL"
|
||||
create_config_make config.mk $VARS
|
||||
create_config_header config.h $VARS
|
||||
|
||||
|
@ -10,7 +10,7 @@ PACKAGE_VERSION=0.4.1
|
||||
add_command_line_enable DYNAMIC "Enable dynamic loading of libsnes library." no
|
||||
add_command_line_string LIBSNES "libsnes library used" "-lsnes"
|
||||
add_command_line_enable FFMPEG "Enable FFmpeg recording support" no
|
||||
add_command_line_enable FILTER "Enable CPU filter support" auto
|
||||
add_command_line_enable DYLIB "Enable dynamic loading support" auto
|
||||
add_command_line_enable NETPLAY "Enable netplay support" auto
|
||||
add_command_line_enable SRC "Enable libsamplerate support" no
|
||||
add_command_line_enable CONFIGFILE "Disable support for config file" yes
|
||||
|
@ -309,8 +309,9 @@ static void parse_config_file(void)
|
||||
CONFIG_GET_DOUBLE(video.msg_pos_y, "video_message_pos_y");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FILTER
|
||||
#ifdef HAVE_DYLIB
|
||||
CONFIG_GET_STRING(video.filter_path, "video_filter");
|
||||
CONFIG_GET_STRING(video.external_driver, "video_external_driver");
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_CG) || defined(HAVE_XML)
|
||||
|
4
ssnes.c
4
ssnes.c
@ -114,7 +114,7 @@ static void video_frame(const uint16_t *data, unsigned width, unsigned height)
|
||||
|
||||
const char *msg = msg_queue_pull(g_extern.msg_queue);
|
||||
|
||||
#ifdef HAVE_FILTER
|
||||
#ifdef HAVE_DYLIB
|
||||
if (g_extern.filter.active)
|
||||
{
|
||||
unsigned owidth = width;
|
||||
@ -282,7 +282,7 @@ static void print_features(void)
|
||||
_PSUPP(pulse, "PulseAudio", "audio driver");
|
||||
_PSUPP(xaudio, "XAudio2", "audio driver");
|
||||
_PSUPP(al, "OpenAL", "audio driver");
|
||||
_PSUPP(filter, "Filter", "CPU based video filters");
|
||||
_PSUPP(dylib, "External", "External filter and driver support");
|
||||
_PSUPP(cg, "Cg", "Cg pixel shaders");
|
||||
_PSUPP(xml, "XML", "bSNES XML pixel shaders");
|
||||
_PSUPP(fbo, "FBO", "OpenGL render-to-texture (multi-pass shaders)");
|
||||
|
Loading…
x
Reference in New Issue
Block a user