mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Merge branch 'master' of https://github.com/libretro/RetroArch into webcam-test
Conflicts: Makefile.emscripten
This commit is contained in:
commit
4b7557c5ae
7
Makefile
7
Makefile
@ -90,7 +90,7 @@ ifneq ($(findstring Linux,$(OS)),)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_RGUI), 1)
|
ifeq ($(HAVE_RGUI), 1)
|
||||||
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/rgui.o frontend/menu/history.o
|
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/disp/rgui.o frontend/menu/history.o
|
||||||
DEFINES += -DHAVE_MENU
|
DEFINES += -DHAVE_MENU
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -156,6 +156,11 @@ ifeq ($(HAVE_AL), 1)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HAVE_V4L2),1)
|
||||||
|
OBJ += camera/video4linux2.o
|
||||||
|
DEFINES += -DHAVE_CAMERA -DHAVE_V4L2
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_JACK),1)
|
ifeq ($(HAVE_JACK),1)
|
||||||
OBJ += audio/jack.o
|
OBJ += audio/jack.o
|
||||||
LIBS += $(JACK_LIBS)
|
LIBS += $(JACK_LIBS)
|
||||||
|
@ -59,7 +59,7 @@ libretro = libretro_emscripten.bc
|
|||||||
|
|
||||||
LIBS = -lm
|
LIBS = -lm
|
||||||
DEFINES = -DHAVE_SCREENSHOTS -DHAVE_NULLAUDIO -DHAVE_BSV_MOVIE
|
DEFINES = -DHAVE_SCREENSHOTS -DHAVE_NULLAUDIO -DHAVE_BSV_MOVIE
|
||||||
LDFLAGS = -L. -s TOTAL_MEMORY=$(MEMORY) --js-library emscripten/library_rwebaudio.js --js-library emscripten/library_rwebinput.js --js-library emscripten/library_rwebcam.js
|
LDFLAGS = -L. -s TOTAL_MEMORY=$(MEMORY) -s OUTLINING_LIMIT=50000 --js-library emscripten/library_rwebaudio.js --js-library emscripten/library_rwebinput.js --no-heap-copy
|
||||||
|
|
||||||
ifeq ($(PERF_TEST), 1)
|
ifeq ($(PERF_TEST), 1)
|
||||||
DEFINES += -DPERF_TEST
|
DEFINES += -DPERF_TEST
|
||||||
@ -67,7 +67,7 @@ endif
|
|||||||
|
|
||||||
ifeq ($(HAVE_RGUI), 1)
|
ifeq ($(HAVE_RGUI), 1)
|
||||||
DEFINES += -DHAVE_MENU -DHAVE_RGUI
|
DEFINES += -DHAVE_MENU -DHAVE_RGUI
|
||||||
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/rgui.o frontend/menu/history.o
|
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/disp/rgui.o frontend/menu/history.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_SDL), 1)
|
ifeq ($(HAVE_SDL), 1)
|
||||||
|
@ -62,7 +62,7 @@ CFLAGS += -DHAVE_FILE_LOGGER
|
|||||||
CFLAGS += -Iconsole/logger
|
CFLAGS += -Iconsole/logger
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -std=gnu99 -DHAVE_RGUI -DHAVE_MENU -DRARCH_CONSOLE -DGEKKO -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -Wno-char-subscripts
|
CFLAGS += -std=gnu99 -DHAVE_RGUI -DHAVE_MENU -DRARCH_CONSOLE -DGEKKO -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DHAVE_RSOUND -Wno-char-subscripts
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -O0 -g
|
||||||
|
@ -111,7 +111,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
|
|||||||
|
|
||||||
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
|
||||||
|
|
||||||
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DWANT_MINIZ -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSKUTIL -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_VID_CONTEXT -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DWANT_MINIZ -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_OSK -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
PPU_OPTIMIZE_LV := -O0 -g
|
PPU_OPTIMIZE_LV := -O0 -g
|
||||||
|
@ -92,7 +92,7 @@ endif
|
|||||||
|
|
||||||
RSXGL_DEFINES = -D__RSX__ -DGL3_PROTOTYPES
|
RSXGL_DEFINES = -D__RSX__ -DGL3_PROTOTYPES
|
||||||
|
|
||||||
SHARED_FLAGS := -DHAVE_FILEBROWSER $(RSXGL_DEFINES) -DHAVE_OPENGL -DHAVE_EGL -DHAVE_OPENGL_MODERN -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_FBO -DHAVE_MOUSE -DRARCH_CONSOLE -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_GRIFFIN=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts
|
SHARED_FLAGS := $(RSXGL_DEFINES) -DHAVE_OPENGL -DHAVE_EGL -DHAVE_OPENGL_MODERN -DHAVE_GLSL -DHAVE_VID_CONTEXT -DHAVE_FBO -DHAVE_MOUSE -DRARCH_CONSOLE -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_GRIFFIN=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -Wno-char-subscripts
|
||||||
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
CFLAGS += -std=gnu99 $(SHARED_FLAGS)
|
||||||
CXXFLAGS += $(SHARED_FLAGS)
|
CXXFLAGS += $(SHARED_FLAGS)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ INCDIR =
|
|||||||
CFLAGS = -O2 -G0 -g -std=gnu99 -ffast-math
|
CFLAGS = -O2 -G0 -g -std=gnu99 -ffast-math
|
||||||
ASFLAGS = $(CFLAGS)
|
ASFLAGS = $(CFLAGS)
|
||||||
|
|
||||||
RARCH_DEFINES = -DPSP -DHAVE_FILEBROWSER -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_GRIFFIN=1 -DHAVE_NULLVIDEO -DHAVE_NULLAUDIO
|
RARCH_DEFINES = -DPSP -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_GRIFFIN=1 -DHAVE_NULLVIDEO -DHAVE_NULLAUDIO
|
||||||
|
|
||||||
ifeq ($(HAVE_FILE_LOGGER), 1)
|
ifeq ($(HAVE_FILE_LOGGER), 1)
|
||||||
CFLAGS += -DHAVE_FILE_LOGGER
|
CFLAGS += -DHAVE_FILE_LOGGER
|
||||||
|
@ -63,7 +63,7 @@ CFLAGS += -Iconsole/logger
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
CFLAGS += -std=gnu99 -DSINC_LOWER_QUALITY -DHAVE_RGUI -DHAVE_MENU -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DGEKKO -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DHAVE_THREADS -Wno-char-subscripts
|
CFLAGS += -std=gnu99 -DSINC_LOWER_QUALITY -DHAVE_RGUI -DHAVE_MENU -DRARCH_CONSOLE -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RARCH_EXEC -DGEKKO -DHAVE_ZLIB -DWANT_MINIZ -DHAVE_RARCH_MAIN_WRAP -DHAVE_RARCH_MAIN_IMPLEMENTATION -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DHAVE_THREADS -DHAVE_RSOUND -Wno-char-subscripts
|
||||||
|
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -g -DDEBUG
|
CFLAGS += -O0 -g -DDEBUG
|
||||||
|
@ -102,7 +102,7 @@ JLIBS =
|
|||||||
|
|
||||||
ifeq ($(HAVE_RGUI), 1)
|
ifeq ($(HAVE_RGUI), 1)
|
||||||
DEFINES += -DHAVE_RGUI -DHAVE_MENU
|
DEFINES += -DHAVE_RGUI -DHAVE_MENU
|
||||||
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/rgui.o frontend/menu/history.o
|
OBJ += frontend/menu/menu_common.o frontend/menu/menu_settings.o frontend/menu/menu_context.o file_list.o frontend/menu/disp/rgui.o frontend/menu/history.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_SDL), 1)
|
ifeq ($(HAVE_SDL), 1)
|
||||||
|
@ -47,7 +47,7 @@ ifeq ($(PERF_TEST), 1)
|
|||||||
LOCAL_CFLAGS += -DPERF_TEST
|
LOCAL_CFLAGS += -DPERF_TEST
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_SCREENSHOTS -DWANT_MINIZ -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -I../../../deps/miniz -DHAVE_RSOUND
|
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -O3 -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_VID_CONTEXT -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_SCREENSHOTS -DWANT_MINIZ -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -I../../../deps/miniz -DHAVE_RSOUND -DHAVE_NETPLAY
|
||||||
|
|
||||||
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 $(LOGGER_LDLIBS) -ldl
|
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL -lGLESv2 $(LOGGER_LDLIBS) -ldl
|
||||||
|
|
||||||
|
@ -441,8 +441,13 @@ void apple_gfx_ctx_swap_buffers()
|
|||||||
|
|
||||||
gfx_ctx_proc_t apple_gfx_ctx_get_proc_address(const char *symbol_name)
|
gfx_ctx_proc_t apple_gfx_ctx_get_proc_address(const char *symbol_name)
|
||||||
{
|
{
|
||||||
|
#ifdef MAC_OS_X_VERSION_10_7
|
||||||
return (gfx_ctx_proc_t)CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(GLFrameworkID),
|
return (gfx_ctx_proc_t)CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(GLFrameworkID),
|
||||||
(__bridge CFStringRef)(@(symbol_name)));
|
(__bridge CFStringRef)@(symbol_name));
|
||||||
|
#else
|
||||||
|
return (gfx_ctx_proc_t)CFBundleGetFunctionPointerForName(CFBundleGetBundleWithIdentifier(GLFrameworkID),
|
||||||
|
(CFStringRef)symbol_name);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IOS
|
#ifdef IOS
|
||||||
|
@ -31,14 +31,29 @@
|
|||||||
|
|
||||||
#include "rsound.h"
|
#include "rsound.h"
|
||||||
|
|
||||||
#ifdef __CELLOS_LV2__
|
#if defined(__CELLOS_LV2__)
|
||||||
|
#include <cell/sysmodule.h>
|
||||||
|
#include <sys/timer.h>
|
||||||
|
#include <sys/sys_time.h>
|
||||||
|
|
||||||
|
// network headers
|
||||||
#include <netex/net.h>
|
#include <netex/net.h>
|
||||||
#include <netex/errno.h>
|
#include <netex/errno.h>
|
||||||
|
#define NETWORK_COMPAT_HEADERS 1
|
||||||
|
#elif defined(GEKKO)
|
||||||
|
#include <network.h>
|
||||||
|
#else
|
||||||
|
#define NETWORK_COMPAT_HEADERS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NETWORK_COMPAT_HEADERS
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
|
#include <sys/poll.h>
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
@ -51,16 +66,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/poll.h>
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <arpa/inet.h>
|
|
||||||
|
|
||||||
#ifdef __CELLOS_LV2__
|
|
||||||
#include <cell/sysmodule.h>
|
|
||||||
#include <sys/timer.h>
|
|
||||||
#include <sys/sys_time.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
****************************************************************************
|
****************************************************************************
|
||||||
@ -91,6 +98,41 @@ enum rsd_conn_type
|
|||||||
#define RSD_ERR(fmt, args...)
|
#define RSD_ERR(fmt, args...)
|
||||||
#define RSD_DEBUG(fmt, args...)
|
#define RSD_DEBUG(fmt, args...)
|
||||||
|
|
||||||
|
#if defined(__CELLOS_LV2__)
|
||||||
|
static int init_count = 0;
|
||||||
|
#define pollfd_fd(x) x.fd
|
||||||
|
#define net_send(a,b,c,d) send(a,b,c,d)
|
||||||
|
#define net_socket(a,b,c) socket(a,b,c)
|
||||||
|
#define net_connect(a,b,c) connect(a,b,c)
|
||||||
|
#define net_shutdown(a,b) shutdown(a,b)
|
||||||
|
#define net_socketclose(x) socketclose(x)
|
||||||
|
#define net_recv(a,b,c,d) recv(a,b,c,d)
|
||||||
|
#elif defined(GEKKO)
|
||||||
|
#define SHUT_RD 0
|
||||||
|
|
||||||
|
#define socketpoll(x, y, z) net_poll(x, y, z)
|
||||||
|
#define pollfd pollsd
|
||||||
|
#define pollfd_fd(x) x.socket
|
||||||
|
#define gethostbyname net_gethostbyname
|
||||||
|
#define getsockopt net_getsockopt
|
||||||
|
#define setsockopt net_setsockopt
|
||||||
|
#define net_send(a,b,c,d) net_send(a,b,c,d)
|
||||||
|
#define net_socket(a,b,c) net_socket(a,b,c)
|
||||||
|
#define net_connect(a,b,c) net_connect(a,b,c)
|
||||||
|
#define net_shutdown(a,b) net_shutdown(a,b)
|
||||||
|
#define net_socketclose(x) net_close(x)
|
||||||
|
#define net_recv(a,b,c,d) net_recv(a,b,c,d)
|
||||||
|
#else
|
||||||
|
#define pollfd_fd(x) x.fd
|
||||||
|
#define net_socket(a,b,c) socket(a,b,c)
|
||||||
|
#define socketpoll(x, y, z) poll(x, y, z)
|
||||||
|
#define net_send(a,b,c,d) send(a,b,c,d)
|
||||||
|
#define net_connect(a,b,c) connect(a,b,c)
|
||||||
|
#define net_shutdown(a,b) shutdown(a,b)
|
||||||
|
#define net_socketclose(x) close(x)
|
||||||
|
#define net_recv(a,b,c,d) recv(a,b,c,d)
|
||||||
|
#endif
|
||||||
|
|
||||||
static ssize_t rsnd_send_chunk(int socket, const void *buf, size_t size, int blocking);
|
static ssize_t rsnd_send_chunk(int socket, const void *buf, size_t size, int blocking);
|
||||||
static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking);
|
static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking);
|
||||||
static int rsnd_start_thread(rsound_t *rd);
|
static int rsnd_start_thread(rsound_t *rd);
|
||||||
@ -111,12 +153,6 @@ static void rsnd_sleep(int msec);
|
|||||||
static void rsnd_cb_thread(void *thread_data);
|
static void rsnd_cb_thread(void *thread_data);
|
||||||
static void rsnd_thread(void *thread_data);
|
static void rsnd_thread(void *thread_data);
|
||||||
|
|
||||||
#ifdef __CELLOS_LV2__
|
|
||||||
static int init_count = 0;
|
|
||||||
#else
|
|
||||||
#define socketclose(x) close(x)
|
|
||||||
#define socketpoll(x, y, z) poll(x, y, z)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Determine whether we're running big- or little endian */
|
/* Determine whether we're running big- or little endian */
|
||||||
static inline int rsnd_is_little_endian(void)
|
static inline int rsnd_is_little_endian(void)
|
||||||
@ -202,11 +238,11 @@ static int rsnd_connect_server( rsound_t *rd )
|
|||||||
rd->conn_type = RSD_CONN_TCP;
|
rd->conn_type = RSD_CONN_TCP;
|
||||||
|
|
||||||
|
|
||||||
rd->conn.socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
rd->conn.socket = net_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
if ( rd->conn.socket < 0 )
|
if ( rd->conn.socket < 0 )
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
rd->conn.ctl_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
rd->conn.ctl_socket = net_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
if ( rd->conn.ctl_socket < 0 )
|
if ( rd->conn.ctl_socket < 0 )
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -221,18 +257,18 @@ static int rsnd_connect_server( rsound_t *rd )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Nonblocking connect with 3 second timeout */
|
/* Nonblocking connect with 3 second timeout */
|
||||||
connect(rd->conn.socket, (struct sockaddr*)&addr, sizeof(addr));
|
net_connect(rd->conn.socket, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
|
|
||||||
fd.fd = rd->conn.socket;
|
pollfd_fd(fd) = rd->conn.socket;
|
||||||
fd.events = POLLOUT;
|
fd.events = POLLOUT;
|
||||||
|
|
||||||
rsnd_poll(&fd, 1, 3000);
|
rsnd_poll(&fd, 1, 3000);
|
||||||
if (!(fd.revents & POLLOUT))
|
if (!(fd.revents & POLLOUT))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
connect(rd->conn.ctl_socket, (struct sockaddr*)&addr, sizeof(addr));
|
net_connect(rd->conn.ctl_socket, (struct sockaddr*)&addr, sizeof(addr));
|
||||||
|
|
||||||
fd.fd = rd->conn.ctl_socket;
|
pollfd_fd(fd) = rd->conn.ctl_socket;
|
||||||
rsnd_poll(&fd, 1, 3000);
|
rsnd_poll(&fd, 1, 3000);
|
||||||
if (!(fd.revents & POLLOUT))
|
if (!(fd.revents & POLLOUT))
|
||||||
goto error;
|
goto error;
|
||||||
@ -466,9 +502,9 @@ static int rsnd_get_backend_info ( rsound_t *rd )
|
|||||||
|
|
||||||
// We no longer want to read from this socket.
|
// We no longer want to read from this socket.
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
shutdown(rd->conn.socket, SD_RECEIVE);
|
net_shutdown(rd->conn.socket, SD_RECEIVE);
|
||||||
#elif !defined(__APPLE__) // OSX doesn't seem to like shutdown()
|
#elif !defined(__APPLE__) // OSX doesn't seem to like shutdown()
|
||||||
shutdown(rd->conn.socket, SHUT_RD);
|
net_shutdown(rd->conn.socket, SHUT_RD);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -492,10 +528,9 @@ static int rsnd_create_connection(rsound_t *rd)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* After connecting, makes really sure that we have a working connection. */
|
/* After connecting, makes really sure that we have a working connection. */
|
||||||
struct pollfd fd = {
|
struct pollfd fd;
|
||||||
.fd = rd->conn.socket,
|
pollfd_fd(fd) = rd->conn.socket;
|
||||||
.events = POLLOUT
|
fd.events = POLLOUT;
|
||||||
};
|
|
||||||
|
|
||||||
if ( rsnd_poll(&fd, 1, 2000) < 0 )
|
if ( rsnd_poll(&fd, 1, 2000) < 0 )
|
||||||
{
|
{
|
||||||
@ -561,10 +596,9 @@ static ssize_t rsnd_send_chunk(int socket, const void* buf, size_t size, int blo
|
|||||||
ssize_t rc = 0;
|
ssize_t rc = 0;
|
||||||
size_t wrote = 0;
|
size_t wrote = 0;
|
||||||
ssize_t send_size = 0;
|
ssize_t send_size = 0;
|
||||||
struct pollfd fd = {
|
struct pollfd fd;
|
||||||
.fd = socket,
|
pollfd_fd(fd) = socket;
|
||||||
.events = POLLOUT
|
fd.events = POLLOUT;
|
||||||
};
|
|
||||||
|
|
||||||
int sleep_time = (blocking) ? 10000 : 0;
|
int sleep_time = (blocking) ? 10000 : 0;
|
||||||
|
|
||||||
@ -585,7 +619,7 @@ static ssize_t rsnd_send_chunk(int socket, const void* buf, size_t size, int blo
|
|||||||
{
|
{
|
||||||
/* We try to limit ourselves to 1KiB packet sizes. */
|
/* We try to limit ourselves to 1KiB packet sizes. */
|
||||||
send_size = (size - wrote) > MAX_PACKET_SIZE ? MAX_PACKET_SIZE : size - wrote;
|
send_size = (size - wrote) > MAX_PACKET_SIZE ? MAX_PACKET_SIZE : size - wrote;
|
||||||
rc = send(socket, (const char*)buf + wrote, send_size, 0);
|
rc = net_send(socket, (const char*)buf + wrote, send_size, 0);
|
||||||
if ( rc < 0 )
|
if ( rc < 0 )
|
||||||
{
|
{
|
||||||
RSD_ERR("[RSound] Error sending chunk, %s.\n", strerror(errno));
|
RSD_ERR("[RSound] Error sending chunk, %s.\n", strerror(errno));
|
||||||
@ -613,10 +647,9 @@ static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking)
|
|||||||
ssize_t rc = 0;
|
ssize_t rc = 0;
|
||||||
size_t has_read = 0;
|
size_t has_read = 0;
|
||||||
ssize_t read_size = 0;
|
ssize_t read_size = 0;
|
||||||
struct pollfd fd = {
|
struct pollfd fd;
|
||||||
.fd = socket,
|
pollfd_fd(fd) = socket;
|
||||||
.events = POLLIN
|
fd.events = POLLIN;
|
||||||
};
|
|
||||||
|
|
||||||
int sleep_time = (blocking) ? 5000 : 0;
|
int sleep_time = (blocking) ? 5000 : 0;
|
||||||
|
|
||||||
@ -637,7 +670,7 @@ static ssize_t rsnd_recv_chunk(int socket, void *buf, size_t size, int blocking)
|
|||||||
if ( fd.revents & POLLIN )
|
if ( fd.revents & POLLIN )
|
||||||
{
|
{
|
||||||
read_size = (size - has_read) > MAX_PACKET_SIZE ? MAX_PACKET_SIZE : size - has_read;
|
read_size = (size - has_read) > MAX_PACKET_SIZE ? MAX_PACKET_SIZE : size - has_read;
|
||||||
rc = recv(socket, (char*)buf + has_read, read_size, 0);
|
rc = net_recv(socket, (char*)buf + has_read, read_size, 0);
|
||||||
if ( rc <= 0 )
|
if ( rc <= 0 )
|
||||||
{
|
{
|
||||||
RSD_ERR("[RSound] Error receiving chunk, %s.\n", strerror(errno));
|
RSD_ERR("[RSound] Error receiving chunk, %s.\n", strerror(errno));
|
||||||
@ -899,10 +932,9 @@ static int rsnd_close_ctl(rsound_t *rd)
|
|||||||
if ( !(rd->conn_type & RSD_CONN_PROTO) )
|
if ( !(rd->conn_type & RSD_CONN_PROTO) )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
struct pollfd fd = {
|
struct pollfd fd;
|
||||||
.fd = rd->conn.ctl_socket,
|
pollfd_fd(fd) = rd->conn.ctl_socket;
|
||||||
.events = POLLOUT
|
fd.events = POLLOUT;
|
||||||
};
|
|
||||||
|
|
||||||
if ( rsnd_poll(&fd, 1, 0) < 0 )
|
if ( rsnd_poll(&fd, 1, 0) < 0 )
|
||||||
return -1;
|
return -1;
|
||||||
@ -910,7 +942,7 @@ static int rsnd_close_ctl(rsound_t *rd)
|
|||||||
if ( fd.revents & POLLOUT )
|
if ( fd.revents & POLLOUT )
|
||||||
{
|
{
|
||||||
const char *sendbuf = "RSD 9 CLOSECTL";
|
const char *sendbuf = "RSD 9 CLOSECTL";
|
||||||
if ( send(rd->conn.ctl_socket, sendbuf, strlen(sendbuf), 0) < 0 )
|
if (net_send(rd->conn.ctl_socket, sendbuf, strlen(sendbuf), 0) < 0 )
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if ( fd.revents & POLLHUP )
|
else if ( fd.revents & POLLHUP )
|
||||||
@ -935,7 +967,7 @@ static int rsnd_close_ctl(rsound_t *rd)
|
|||||||
const char *subchar;
|
const char *subchar;
|
||||||
|
|
||||||
// We just read everything in large chunks until we find what we're looking for
|
// We just read everything in large chunks until we find what we're looking for
|
||||||
int rc = recv(rd->conn.ctl_socket, buf + index, RSD_PROTO_MAXSIZE*2 - 1 - index, 0);
|
int rc = net_recv(rd->conn.ctl_socket, buf + index, RSD_PROTO_MAXSIZE*2 - 1 - index, 0);
|
||||||
|
|
||||||
if (rc <= 0 )
|
if (rc <= 0 )
|
||||||
return -1;
|
return -1;
|
||||||
@ -960,7 +992,7 @@ static int rsnd_close_ctl(rsound_t *rd)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
socketclose(rd->conn.ctl_socket);
|
net_socketclose(rd->conn.ctl_socket);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1261,10 +1293,10 @@ static void rsnd_cb_thread(void *thread_data)
|
|||||||
static int rsnd_reset(rsound_t *rd)
|
static int rsnd_reset(rsound_t *rd)
|
||||||
{
|
{
|
||||||
if ( rd->conn.socket != -1 )
|
if ( rd->conn.socket != -1 )
|
||||||
socketclose(rd->conn.socket);
|
net_socketclose(rd->conn.socket);
|
||||||
|
|
||||||
if ( rd->conn.socket != 1 )
|
if ( rd->conn.socket != 1 )
|
||||||
socketclose(rd->conn.ctl_socket);
|
net_socketclose(rd->conn.ctl_socket);
|
||||||
|
|
||||||
/* Pristine stuff, baby! */
|
/* Pristine stuff, baby! */
|
||||||
slock_lock(rd->thread.mutex);
|
slock_lock(rd->thread.mutex);
|
||||||
@ -1385,7 +1417,7 @@ int rsd_exec(rsound_t *rsound)
|
|||||||
if ( rsnd_send_chunk(fd, buffer, sizeof(buffer), 1) != (ssize_t)sizeof(buffer) )
|
if ( rsnd_send_chunk(fd, buffer, sizeof(buffer), 1) != (ssize_t)sizeof(buffer) )
|
||||||
{
|
{
|
||||||
RSD_DEBUG("[RSound] Failed flushing buffer.\n");
|
RSD_DEBUG("[RSound] Failed flushing buffer.\n");
|
||||||
socketclose(fd);
|
net_socketclose(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
513
camera/video4linux2.c
Normal file
513
camera/video4linux2.c
Normal file
@ -0,0 +1,513 @@
|
|||||||
|
/* RetroArch - A frontend for libretro.
|
||||||
|
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
||||||
|
* Copyright (C) 2011-2013 - Daniel De Matteis
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include "../driver.h"
|
||||||
|
#include "../miscellaneous.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/mman.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include "../compat/strl.h"
|
||||||
|
|
||||||
|
#include <asm/types.h>
|
||||||
|
|
||||||
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
|
struct buffer
|
||||||
|
{
|
||||||
|
void *start;
|
||||||
|
size_t length;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct video4linux
|
||||||
|
{
|
||||||
|
char dev_name[256];
|
||||||
|
int fd;
|
||||||
|
bool ready;
|
||||||
|
struct buffer *buffers;
|
||||||
|
unsigned n_buffers;
|
||||||
|
size_t width;
|
||||||
|
size_t height;
|
||||||
|
} video4linux_t;
|
||||||
|
|
||||||
|
// FIXME: Shouldn't use LUTs for this.
|
||||||
|
// The LUT is simply too big, and the conversion can be done efficiently with fixed-point SIMD anyways.
|
||||||
|
/*
|
||||||
|
* YCbCr to RGB lookup table
|
||||||
|
* Y, Cb, Cr range is 0-255
|
||||||
|
*
|
||||||
|
* Stored value bits:
|
||||||
|
* 24-16 Red
|
||||||
|
* 15-8 Green
|
||||||
|
* 7-0 Blue
|
||||||
|
*/
|
||||||
|
#define YUV_SHIFT(y, cb, cr) ((y << 16) | (cb << 8) | (cr << 0))
|
||||||
|
#define RGB_SHIFT(r, g, b) ((r << 16) | (g << 8) | (b << 0))
|
||||||
|
static uint32_t *YCbCr_to_RGB;
|
||||||
|
|
||||||
|
static void generate_YCbCr_to_RGB_lookup(void)
|
||||||
|
{
|
||||||
|
int y;
|
||||||
|
int cb;
|
||||||
|
int cr;
|
||||||
|
|
||||||
|
YCbCr_to_RGB = (uint32_t*)realloc(YCbCr_to_RGB, 256 * 256 * 256 * sizeof(uint32_t));
|
||||||
|
if (!YCbCr_to_RGB)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (y = 0; y < 256; y++)
|
||||||
|
{
|
||||||
|
for (cb = 0; cb < 256; cb++)
|
||||||
|
{
|
||||||
|
for (cr = 0; cr < 256; cr++)
|
||||||
|
{
|
||||||
|
double Y = (double)y;
|
||||||
|
double Cb = (double)cb;
|
||||||
|
double Cr = (double)cr;
|
||||||
|
|
||||||
|
int R = (int)(Y + 1.40200 * (Cr - 0x80));
|
||||||
|
int G = (int)(Y - 0.34414 * (Cb - 0x80) - 0.71414 * (Cr - 0x80));
|
||||||
|
int B = (int)(Y + 1.77200 * (Cb - 0x80));
|
||||||
|
|
||||||
|
R = max(0, min(255, R));
|
||||||
|
G = max(0, min(255, G));
|
||||||
|
B = max(0, min(255, B));
|
||||||
|
|
||||||
|
YCbCr_to_RGB[YUV_SHIFT(y, cb, cr)] = RGB_SHIFT(R, G, B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts YUV422 to RGB
|
||||||
|
* Before first use call generate_YCbCr_to_RGB_lookup();
|
||||||
|
*
|
||||||
|
* input is pointer to YUV422 encoded data in following order: Y0, Cb, Y1, Cr.
|
||||||
|
* output is pointer to 24 bit RGB buffer.
|
||||||
|
* Output data is written in following order: R1, G1, B1, R2, G2, B2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// FIXME: Software CPU color conersion from YUV to RGB - we'll make two codepaths
|
||||||
|
// eventually - GL binding to texture and color conversion through shaders,
|
||||||
|
// and this approach
|
||||||
|
|
||||||
|
static inline void YUV422_to_RGB(uint32_t *output, const uint8_t *input)
|
||||||
|
{
|
||||||
|
uint8_t y0 = input[0];
|
||||||
|
uint8_t cb = input[1];
|
||||||
|
uint8_t y1 = input[2];
|
||||||
|
uint8_t cr = input[3];
|
||||||
|
|
||||||
|
output[0] = YCbCr_to_RGB[YUV_SHIFT(y0, cb, cr)];
|
||||||
|
output[1] = YCbCr_to_RGB[YUV_SHIFT(y1, cb, cr)];
|
||||||
|
}
|
||||||
|
|
||||||
|
static void process_image(const void *p)
|
||||||
|
{
|
||||||
|
(void)p;
|
||||||
|
//FIXME - fill in here how we are going to render
|
||||||
|
//this - could have two codepaths - one for GL
|
||||||
|
//and one non-GL
|
||||||
|
#if 0
|
||||||
|
const uint8_t *buffer_yuv = p;
|
||||||
|
|
||||||
|
size_t x;
|
||||||
|
size_t y;
|
||||||
|
|
||||||
|
for (y = 0; y < height; y++)
|
||||||
|
for (x = 0; x < width; x += 2)
|
||||||
|
YUV422_to_RGB(buffer_sdl + (y * width + x) * 3,
|
||||||
|
buffer_yuv + (y * width + x) * 2);
|
||||||
|
|
||||||
|
render(data_sf);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int xioctl(int fd, int request, void *args)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
r = ioctl(fd, request, args);
|
||||||
|
} while (r == -1 && errno == EINTR);
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int init_mmap(void *data)
|
||||||
|
{
|
||||||
|
struct v4l2_requestbuffers req;
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
|
||||||
|
memset(&req, 0, sizeof(req));
|
||||||
|
|
||||||
|
req.count = 4;
|
||||||
|
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
req.memory = V4L2_MEMORY_MMAP;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_REQBUFS, &req) == -1)
|
||||||
|
{
|
||||||
|
if (errno == EINVAL)
|
||||||
|
{
|
||||||
|
RARCH_ERR("%s does not support memory mapping.\n", v4l->dev_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RARCH_ERR("xioctl of VIDIOC_REQBUFS failed.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (req.count < 2)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Insufficient buffer memory on %s.\n", v4l->dev_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
v4l->buffers = (struct buffer*)calloc(req.count, sizeof(*v4l->buffers));
|
||||||
|
|
||||||
|
if (!v4l->buffers)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Out of memory allocating V4L2 buffers.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (v4l->n_buffers = 0; v4l->n_buffers < req.count; v4l->n_buffers++)
|
||||||
|
{
|
||||||
|
struct v4l2_buffer buf;
|
||||||
|
|
||||||
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
|
||||||
|
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
buf.memory = V4L2_MEMORY_MMAP;
|
||||||
|
buf.index = v4l->n_buffers;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_QUERYBUF, &buf) == -1)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Error - xioctl VIDIOC_QUERYBUF.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
v4l->buffers[v4l->n_buffers].length = buf.length;
|
||||||
|
v4l->buffers[v4l->n_buffers].start = mmap(NULL,
|
||||||
|
buf.length, PROT_READ | PROT_WRITE,
|
||||||
|
MAP_SHARED,
|
||||||
|
v4l->fd, buf.m.offset);
|
||||||
|
|
||||||
|
if (v4l->buffers[v4l->n_buffers].start == MAP_FAILED)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Error - mmap.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int init_device(void *data)
|
||||||
|
{
|
||||||
|
struct v4l2_capability cap;
|
||||||
|
struct v4l2_cropcap cropcap;
|
||||||
|
struct v4l2_crop crop;
|
||||||
|
struct v4l2_format fmt;
|
||||||
|
unsigned min;
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_QUERYCAP, &cap) == -1)
|
||||||
|
{
|
||||||
|
if (errno == EINVAL)
|
||||||
|
{
|
||||||
|
RARCH_ERR("%s is no V4L2 device.\n", v4l->dev_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RARCH_ERR("Error - VIDIOC_QUERYCAP.\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
|
||||||
|
{
|
||||||
|
RARCH_ERR("%s is no video capture device.\n", v4l->dev_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(cap.capabilities & V4L2_CAP_STREAMING))
|
||||||
|
{
|
||||||
|
RARCH_ERR("%s does not support streaming I/O (V4L2_CAP_STREAMING).\n", v4l->dev_name);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Select video input, video standard and tune here. */
|
||||||
|
|
||||||
|
memset(&cropcap, 0, sizeof(cropcap));
|
||||||
|
|
||||||
|
cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_CROPCAP, &cropcap) == 0)
|
||||||
|
{
|
||||||
|
crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
crop.c = cropcap.defrect; /* reset to default */
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_S_CROP, &crop) == -1)
|
||||||
|
{
|
||||||
|
switch (errno)
|
||||||
|
{
|
||||||
|
case EINVAL:
|
||||||
|
/* Cropping not supported. */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* Errors ignored. */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
memset (&fmt, 0, sizeof(fmt));
|
||||||
|
|
||||||
|
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
fmt.fmt.pix.width = v4l->width;
|
||||||
|
fmt.fmt.pix.height = v4l->height;
|
||||||
|
// TODO: See if we can use a saner format here.
|
||||||
|
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
|
||||||
|
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_S_FMT, &fmt) == -1)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Error - VIDIOC_S_FMT\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Note VIDIOC_S_FMT may change width and height. */
|
||||||
|
|
||||||
|
/* Buggy driver paranoia. */
|
||||||
|
min = fmt.fmt.pix.width * 2;
|
||||||
|
if (fmt.fmt.pix.bytesperline < min)
|
||||||
|
fmt.fmt.pix.bytesperline = min;
|
||||||
|
min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height;
|
||||||
|
if (fmt.fmt.pix.sizeimage < min)
|
||||||
|
fmt.fmt.pix.sizeimage = min;
|
||||||
|
|
||||||
|
if (fmt.fmt.pix.width != v4l->width)
|
||||||
|
v4l->width = fmt.fmt.pix.width;
|
||||||
|
|
||||||
|
if (fmt.fmt.pix.height != v4l->height)
|
||||||
|
v4l->height = fmt.fmt.pix.height;
|
||||||
|
|
||||||
|
return init_mmap(v4l);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void v4l_stop(void *data)
|
||||||
|
{
|
||||||
|
enum v4l2_buf_type type;
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
|
||||||
|
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_STREAMOFF, &type) == -1)
|
||||||
|
RARCH_ERR("Error - VIDIOC_STREAMOFF.\n");
|
||||||
|
|
||||||
|
v4l->ready = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool v4l_start(void *data)
|
||||||
|
{
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
unsigned i;
|
||||||
|
enum v4l2_buf_type type;
|
||||||
|
|
||||||
|
for (i = 0; i < v4l->n_buffers; i++)
|
||||||
|
{
|
||||||
|
struct v4l2_buffer buf;
|
||||||
|
|
||||||
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
|
||||||
|
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
buf.memory = V4L2_MEMORY_MMAP;
|
||||||
|
buf.index = i;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_QBUF, &buf) == -1)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Error - VIDIOC_QBUF.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_STREAMON, &type) == -1)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Error - VIDIOC_STREAMON.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
generate_YCbCr_to_RGB_lookup();
|
||||||
|
v4l->ready = true;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *v4l_init(const char *device, uint64_t caps, unsigned width, unsigned height)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if (!(caps & RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER))
|
||||||
|
{
|
||||||
|
RARCH_ERR("video4linux2 returns raw framebuffers.\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
video4linux_t *v4l = (video4linux_t*)calloc(1, sizeof(video4linux_t));
|
||||||
|
if (!v4l)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (device == NULL)
|
||||||
|
strlcpy(v4l->dev_name, "/dev/video0", sizeof(v4l->dev_name));
|
||||||
|
else
|
||||||
|
strlcpy(v4l->dev_name, device, sizeof(v4l->dev_name));
|
||||||
|
|
||||||
|
v4l->width = width;
|
||||||
|
v4l->height = height;
|
||||||
|
v4l->ready = false;
|
||||||
|
|
||||||
|
if (stat(v4l->dev_name, &st) == -1)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Cannot identify '%s' : %d, %s\n", v4l->dev_name, errno, strerror(errno));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!S_ISCHR(st.st_mode))
|
||||||
|
{
|
||||||
|
RARCH_ERR("%s is no device.\n", v4l->dev_name);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
v4l->fd = open(v4l->dev_name, O_RDWR | O_NONBLOCK, 0);
|
||||||
|
|
||||||
|
if (v4l->fd == -1)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Cannot open '%s': %d, %s\n", v4l->dev_name, errno, strerror(errno));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (init_device(v4l) == -1)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
return v4l;
|
||||||
|
|
||||||
|
error:
|
||||||
|
RARCH_ERR("V4L2: Failed to initialize camera.\n");
|
||||||
|
free(v4l);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void v4l_free(void *data)
|
||||||
|
{
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
|
||||||
|
unsigned i;
|
||||||
|
for (i = 0; i < v4l->n_buffers; i++)
|
||||||
|
if (munmap(v4l->buffers[i].start, v4l->buffers[i].length) == -1)
|
||||||
|
RARCH_ERR("munmap failed.\n");
|
||||||
|
|
||||||
|
if (v4l->fd >= 0)
|
||||||
|
close(v4l->fd);
|
||||||
|
free(v4l);
|
||||||
|
|
||||||
|
// Assumes one instance. LUT will be gone at some point anyways.
|
||||||
|
free(YCbCr_to_RGB);
|
||||||
|
YCbCr_to_RGB = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool preprocess_image(void *data)
|
||||||
|
{
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
struct v4l2_buffer buf;
|
||||||
|
unsigned i;
|
||||||
|
|
||||||
|
memset(&buf, 0, sizeof(buf));
|
||||||
|
|
||||||
|
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||||
|
buf.memory = V4L2_MEMORY_MMAP;
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_DQBUF, &buf) == -1)
|
||||||
|
{
|
||||||
|
switch (errno)
|
||||||
|
{
|
||||||
|
case EAGAIN:
|
||||||
|
return false;
|
||||||
|
case EIO:
|
||||||
|
/* Could ignore EIO, see spec. */
|
||||||
|
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
|
default:
|
||||||
|
RARCH_ERR("VIDIOC_DQBUF.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(buf.index < v4l->n_buffers);
|
||||||
|
|
||||||
|
process_image(v4l->buffers[buf.index].start);
|
||||||
|
|
||||||
|
if (xioctl(v4l->fd, VIDIOC_QBUF, &buf) == -1)
|
||||||
|
RARCH_ERR("VIDIOC_QBUF\n");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool v4l_poll(void *data, retro_camera_frame_raw_framebuffer_t frame_raw_cb,
|
||||||
|
retro_camera_frame_opengl_texture_t frame_gl_cb)
|
||||||
|
{
|
||||||
|
video4linux_t *v4l = (video4linux_t*)data;
|
||||||
|
if (!v4l->ready)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
(void)frame_raw_cb;
|
||||||
|
(void)frame_gl_cb;
|
||||||
|
|
||||||
|
if (preprocess_image(data))
|
||||||
|
{
|
||||||
|
// TODO: Call frame_raw_cb() here with updated data if new data was processed.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const camera_driver_t camera_v4l2 = {
|
||||||
|
v4l_init,
|
||||||
|
v4l_free,
|
||||||
|
v4l_start,
|
||||||
|
v4l_stop,
|
||||||
|
v4l_poll,
|
||||||
|
"video4linux2",
|
||||||
|
};
|
||||||
|
|
11
config.def.h
11
config.def.h
@ -79,7 +79,10 @@ enum
|
|||||||
INPUT_APPLE,
|
INPUT_APPLE,
|
||||||
INPUT_QNX,
|
INPUT_QNX,
|
||||||
INPUT_RWEBINPUT,
|
INPUT_RWEBINPUT,
|
||||||
INPUT_NULL
|
INPUT_NULL,
|
||||||
|
|
||||||
|
CAMERA_V4L2,
|
||||||
|
CAMERA_NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)
|
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)
|
||||||
@ -178,6 +181,12 @@ enum
|
|||||||
#define INPUT_DEFAULT_DRIVER INPUT_NULL
|
#define INPUT_DEFAULT_DRIVER INPUT_NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(HAVE_V4L2)
|
||||||
|
#define CAMERA_DEFAULT_DRIVER CAMERA_V4L2
|
||||||
|
#else
|
||||||
|
#define CAMERA_DEFAULT_DRIVER CAMERA_NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(XENON) || defined(_XBOX360) || defined(__CELLOS_LV2__)
|
#if defined(XENON) || defined(_XBOX360) || defined(__CELLOS_LV2__)
|
||||||
#define DEFAULT_ASPECT_RATIO 1.7778f
|
#define DEFAULT_ASPECT_RATIO 1.7778f
|
||||||
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID) || defined(__BLACKBERRY_QNX__)
|
#elif defined(_XBOX1) || defined(GEKKO) || defined(ANDROID) || defined(__BLACKBERRY_QNX__)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* If not, see <http://www.gnu.org/licenses/>.
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __CELLOS_LV2__
|
#if defined(__CELLOS_LV2__)
|
||||||
#include "../../ps3/sdk_defines.h"
|
#include "../../ps3/sdk_defines.h"
|
||||||
#ifndef __PSL1GHT__
|
#ifndef __PSL1GHT__
|
||||||
#include <netex/net.h>
|
#include <netex/net.h>
|
||||||
@ -25,9 +25,7 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#elif defined(GEKKO)
|
||||||
|
|
||||||
#ifdef GEKKO
|
|
||||||
#include <network.h>
|
#include <network.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,13 +25,7 @@
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char menu_border_file[MAXIMUM_PATH];
|
|
||||||
char border_dir[MAXIMUM_PATH];
|
|
||||||
char core_dir[MAXIMUM_PATH];
|
char core_dir[MAXIMUM_PATH];
|
||||||
char config_path[MAXIMUM_PATH];
|
|
||||||
char libretro_path[MAXIMUM_PATH];
|
|
||||||
char filebrowser_startup_dir[MAXIMUM_PATH];
|
|
||||||
char filesystem_root_dir[MAXIMUM_PATH];
|
|
||||||
char port_dir[MAXIMUM_PATH];
|
char port_dir[MAXIMUM_PATH];
|
||||||
char savestate_dir[MAXIMUM_PATH];
|
char savestate_dir[MAXIMUM_PATH];
|
||||||
char sram_dir[MAXIMUM_PATH];
|
char sram_dir[MAXIMUM_PATH];
|
||||||
|
8
deps/miniz/miniz.c
vendored
8
deps/miniz/miniz.c
vendored
@ -296,10 +296,12 @@ typedef struct
|
|||||||
tinfl_status m_last_status;
|
tinfl_status m_last_status;
|
||||||
} inflate_state;
|
} inflate_state;
|
||||||
|
|
||||||
|
#ifndef _XBOX1
|
||||||
int inflateInit2_(z_streamp pStream, int window_bits, char *version, int stream_size)
|
int inflateInit2_(z_streamp pStream, int window_bits, char *version, int stream_size)
|
||||||
{
|
{
|
||||||
return mz_inflateInit2(pStream, window_bits);
|
return mz_inflateInit2(pStream, window_bits);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int mz_inflateInit2(mz_streamp pStream, int window_bits)
|
int mz_inflateInit2(mz_streamp pStream, int window_bits)
|
||||||
{
|
{
|
||||||
@ -335,10 +337,12 @@ int mz_inflateInit(mz_streamp pStream)
|
|||||||
return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS);
|
return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _XBOX1
|
||||||
int inflate(z_streamp pStream, int flush)
|
int inflate(z_streamp pStream, int flush)
|
||||||
{
|
{
|
||||||
return mz_inflate(pStream, flush);
|
return mz_inflate(pStream, flush);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int mz_inflate(mz_streamp pStream, int flush)
|
int mz_inflate(mz_streamp pStream, int flush)
|
||||||
{
|
{
|
||||||
@ -431,10 +435,12 @@ int mz_inflate(mz_streamp pStream, int flush)
|
|||||||
return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
|
return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _XBOX1
|
||||||
int inflateReset(z_streamp pStream)
|
int inflateReset(z_streamp pStream)
|
||||||
{
|
{
|
||||||
return mz_inflateReset(pStream);
|
return mz_inflateReset(pStream);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int mz_inflateReset(mz_streamp pStream)
|
int mz_inflateReset(mz_streamp pStream)
|
||||||
{
|
{
|
||||||
@ -442,10 +448,12 @@ int mz_inflateReset(mz_streamp pStream)
|
|||||||
return mz_inflateInit(pStream);
|
return mz_inflateInit(pStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _XBOX1
|
||||||
int inflateEnd(z_streamp pStream)
|
int inflateEnd(z_streamp pStream)
|
||||||
{
|
{
|
||||||
return mz_inflateEnd(pStream);
|
return mz_inflateEnd(pStream);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int mz_inflateEnd(mz_streamp pStream)
|
int mz_inflateEnd(mz_streamp pStream)
|
||||||
{
|
{
|
||||||
|
146
driver.c
146
driver.c
@ -179,6 +179,59 @@ static const input_driver_t *input_drivers[] = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
static const camera_driver_t *camera_drivers[] = {
|
||||||
|
#ifdef HAVE_V4L2
|
||||||
|
&camera_v4l2,
|
||||||
|
#endif
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int find_camera_driver_index(const char *driver)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
for (i = 0; camera_drivers[i]; i++)
|
||||||
|
if (strcasecmp(driver, camera_drivers[i]->ident) == 0)
|
||||||
|
return i;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void find_camera_driver(void)
|
||||||
|
{
|
||||||
|
int i = find_camera_driver_index(g_settings.camera.driver);
|
||||||
|
if (i >= 0)
|
||||||
|
driver.camera = camera_drivers[i];
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unsigned d;
|
||||||
|
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n", g_settings.camera.driver);
|
||||||
|
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
|
||||||
|
for (d = 0; camera_drivers[d]; d++)
|
||||||
|
RARCH_LOG_OUTPUT("\t%s\n", camera_drivers[d]->ident);
|
||||||
|
|
||||||
|
rarch_fail(1, "find_camera_driver()");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void find_prev_camera_driver(void)
|
||||||
|
{
|
||||||
|
int i = find_camera_driver_index(g_settings.camera.driver);
|
||||||
|
if (i > 0)
|
||||||
|
strlcpy(g_settings.camera.driver, camera_drivers[i - 1]->ident, sizeof(g_settings.camera.driver));
|
||||||
|
else
|
||||||
|
RARCH_WARN("Couldn't find any previous camera driver (current one: \"%s\").\n", g_settings.camera.driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
void find_next_camera_driver(void)
|
||||||
|
{
|
||||||
|
int i = find_camera_driver_index(g_settings.camera.driver);
|
||||||
|
if (i >= 0 && camera_drivers[i + 1])
|
||||||
|
strlcpy(g_settings.camera.driver, camera_drivers[i + 1]->ident, sizeof(g_settings.camera.driver));
|
||||||
|
else
|
||||||
|
RARCH_WARN("Couldn't find any next camera driver (current one: \"%s\").\n", g_settings.camera.driver);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int find_audio_driver_index(const char *driver)
|
static int find_audio_driver_index(const char *driver)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
@ -327,6 +380,9 @@ void init_drivers_pre(void)
|
|||||||
find_audio_driver();
|
find_audio_driver();
|
||||||
find_video_driver();
|
find_video_driver();
|
||||||
find_input_driver();
|
find_input_driver();
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
find_camera_driver();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void adjust_system_rates(void)
|
static void adjust_system_rates(void)
|
||||||
@ -417,6 +473,32 @@ bool driver_set_sensor_state(unsigned port, enum retro_sensor_action action, uns
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
bool driver_camera_start(void)
|
||||||
|
{
|
||||||
|
if (driver.camera && driver.camera_data)
|
||||||
|
return driver.camera->start(driver.camera_data);
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void driver_camera_stop(void)
|
||||||
|
{
|
||||||
|
if (driver.camera && driver.camera_data)
|
||||||
|
driver.camera->stop(driver.camera_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
void driver_camera_poll(void)
|
||||||
|
{
|
||||||
|
if (driver.camera && driver.camera_data)
|
||||||
|
{
|
||||||
|
driver.camera->poll(driver.camera_data,
|
||||||
|
g_extern.system.camera_callback.frame_raw_framebuffer,
|
||||||
|
g_extern.system.camera_callback.frame_opengl_texture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
uintptr_t driver_get_current_framebuffer(void)
|
uintptr_t driver_get_current_framebuffer(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FBO
|
#ifdef HAVE_FBO
|
||||||
@ -468,13 +550,47 @@ void global_uninit_drivers(void)
|
|||||||
driver.input->free(driver.input_data);
|
driver.input->free(driver.input_data);
|
||||||
driver.input_data = NULL;
|
driver.input_data = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
if (driver.camera && driver.camera_data)
|
||||||
|
{
|
||||||
|
driver.camera->free(driver.camera_data);
|
||||||
|
driver.camera_data = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
void init_camera(void)
|
||||||
|
{
|
||||||
|
// Resource leaks will follow if camera is initialized twice.
|
||||||
|
if (driver.camera_data)
|
||||||
|
return;
|
||||||
|
|
||||||
|
find_camera_driver();
|
||||||
|
|
||||||
|
driver.camera_data = camera_init_func(
|
||||||
|
*g_settings.camera.device ? g_settings.camera.device : NULL,
|
||||||
|
g_extern.system.camera_callback.caps,
|
||||||
|
g_settings.camera.width ? g_settings.camera.width : g_extern.system.camera_callback.width,
|
||||||
|
g_settings.camera.height ? g_settings.camera.height : g_extern.system.camera_callback.height);
|
||||||
|
|
||||||
|
if (!driver.camera_data)
|
||||||
|
{
|
||||||
|
RARCH_ERR("Failed to initialize camera driver. Will continue without camera.\n");
|
||||||
|
g_extern.camera_active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void init_drivers(void)
|
void init_drivers(void)
|
||||||
{
|
{
|
||||||
driver.video_data_own = !driver.video_data;
|
driver.video_data_own = !driver.video_data;
|
||||||
driver.audio_data_own = !driver.audio_data;
|
driver.audio_data_own = !driver.audio_data;
|
||||||
driver.input_data_own = !driver.input_data;
|
driver.input_data_own = !driver.input_data;
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
driver.camera_data_own = !driver.camera_data;
|
||||||
|
#endif
|
||||||
|
|
||||||
adjust_system_rates();
|
adjust_system_rates();
|
||||||
|
|
||||||
@ -487,6 +603,12 @@ void init_drivers(void)
|
|||||||
|
|
||||||
init_audio();
|
init_audio();
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
// Only init camera driver if we're ever going to use it.
|
||||||
|
if (g_extern.system.camera_callback.caps)
|
||||||
|
init_camera();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Keep non-throttled state as good as possible.
|
// Keep non-throttled state as good as possible.
|
||||||
if (driver.nonblock_state)
|
if (driver.nonblock_state)
|
||||||
driver_set_nonblock_state(driver.nonblock_state);
|
driver_set_nonblock_state(driver.nonblock_state);
|
||||||
@ -494,6 +616,14 @@ void init_drivers(void)
|
|||||||
g_extern.system.frame_time_last = 0;
|
g_extern.system.frame_time_last = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
void uninit_camera(void)
|
||||||
|
{
|
||||||
|
if (driver.camera_data && driver.camera)
|
||||||
|
driver.camera->free(driver.camera_data);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void uninit_drivers(void)
|
void uninit_drivers(void)
|
||||||
{
|
{
|
||||||
uninit_audio();
|
uninit_audio();
|
||||||
@ -503,6 +633,12 @@ void uninit_drivers(void)
|
|||||||
|
|
||||||
uninit_video_input();
|
uninit_video_input();
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
uninit_camera();
|
||||||
|
|
||||||
|
if (driver.camera_data_own)
|
||||||
|
driver.camera_data = NULL;
|
||||||
|
#endif
|
||||||
if (driver.video_data_own)
|
if (driver.video_data_own)
|
||||||
driver.video_data = NULL;
|
driver.video_data = NULL;
|
||||||
if (driver.audio_data_own)
|
if (driver.audio_data_own)
|
||||||
@ -510,9 +646,12 @@ void uninit_drivers(void)
|
|||||||
if (driver.input_data_own)
|
if (driver.input_data_own)
|
||||||
driver.input_data = NULL;
|
driver.input_data = NULL;
|
||||||
|
|
||||||
driver.video_data_own = false;
|
#ifdef HAVE_CAMERA
|
||||||
driver.audio_data_own = false;
|
driver.camera_data_own = false;
|
||||||
driver.input_data_own = false;
|
#endif
|
||||||
|
driver.video_data_own = false;
|
||||||
|
driver.audio_data_own = false;
|
||||||
|
driver.input_data_own = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_DYLIB
|
#ifdef HAVE_DYLIB
|
||||||
@ -692,6 +831,7 @@ void init_audio(void)
|
|||||||
audio_start_func();
|
audio_start_func();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void compute_audio_buffer_statistics(void)
|
static void compute_audio_buffer_statistics(void)
|
||||||
{
|
{
|
||||||
unsigned i, samples;
|
unsigned i, samples;
|
||||||
|
59
driver.h
59
driver.h
@ -331,6 +331,42 @@ typedef struct input_driver
|
|||||||
const rarch_joypad_driver_t *(*get_joypad_driver)(void *data);
|
const rarch_joypad_driver_t *(*get_joypad_driver)(void *data);
|
||||||
} input_driver_t;
|
} input_driver_t;
|
||||||
|
|
||||||
|
typedef struct input_osk_driver
|
||||||
|
{
|
||||||
|
void *(*init)(size_t size);
|
||||||
|
void (*free)(void *data);
|
||||||
|
bool (*enable_key_layout)(void *data);
|
||||||
|
void (*oskutil_create_activation_parameters)(void *data);
|
||||||
|
void (*write_msg)(void *data, const void *msg);
|
||||||
|
void (*write_initial_msg)(void *data, const void *msg);
|
||||||
|
bool (*start)(void *data);
|
||||||
|
void (*lifecycle)(void *data, uint64_t status);
|
||||||
|
bool (*cb_init)(void *data);
|
||||||
|
bool (*cb_callback)(void *data);
|
||||||
|
unsigned action;
|
||||||
|
const char *ident;
|
||||||
|
} input_osk_driver_t;
|
||||||
|
|
||||||
|
typedef struct camera_driver
|
||||||
|
{
|
||||||
|
// FIXME: params for init - queries for resolution, framerate, color format
|
||||||
|
// which might or might not be honored
|
||||||
|
void *(*init)(const char *device, uint64_t buffer_types, unsigned width, unsigned height);
|
||||||
|
void (*free)(void *data);
|
||||||
|
|
||||||
|
bool (*start)(void *data);
|
||||||
|
void (*stop)(void *data);
|
||||||
|
|
||||||
|
// Polls the camera driver.
|
||||||
|
// Will call the appropriate callback if a new frame is ready.
|
||||||
|
// Returns true if a new frame was handled.
|
||||||
|
bool (*poll)(void *data,
|
||||||
|
retro_camera_frame_raw_framebuffer_t frame_raw_cb,
|
||||||
|
retro_camera_frame_opengl_texture_t frame_gl_cb);
|
||||||
|
|
||||||
|
const char *ident;
|
||||||
|
} camera_driver_t;
|
||||||
|
|
||||||
struct rarch_viewport;
|
struct rarch_viewport;
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
@ -416,6 +452,10 @@ typedef struct driver
|
|||||||
const audio_driver_t *audio;
|
const audio_driver_t *audio;
|
||||||
const video_driver_t *video;
|
const video_driver_t *video;
|
||||||
const input_driver_t *input;
|
const input_driver_t *input;
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
const camera_driver_t *camera;
|
||||||
|
void *camera_data;
|
||||||
|
#endif
|
||||||
void *audio_data;
|
void *audio_data;
|
||||||
void *video_data;
|
void *video_data;
|
||||||
void *input_data;
|
void *input_data;
|
||||||
@ -437,6 +477,9 @@ typedef struct driver
|
|||||||
bool video_data_own;
|
bool video_data_own;
|
||||||
bool audio_data_own;
|
bool audio_data_own;
|
||||||
bool input_data_own;
|
bool input_data_own;
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
bool camera_data_own;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COMMAND
|
#ifdef HAVE_COMMAND
|
||||||
rarch_cmd_t *command;
|
rarch_cmd_t *command;
|
||||||
@ -494,6 +537,13 @@ void find_next_video_driver(void);
|
|||||||
void find_next_audio_driver(void);
|
void find_next_audio_driver(void);
|
||||||
void find_next_input_driver(void);
|
void find_next_input_driver(void);
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
void init_camera(void);
|
||||||
|
void uninit_camera(void);
|
||||||
|
void find_prev_camera_driver(void);
|
||||||
|
void find_next_camera_driver(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
void driver_set_monitor_refresh_rate(float hz);
|
void driver_set_monitor_refresh_rate(float hz);
|
||||||
bool driver_monitor_fps_statistics(double *refresh_rate, double *deviation, unsigned *sample_points);
|
bool driver_monitor_fps_statistics(double *refresh_rate, double *deviation, unsigned *sample_points);
|
||||||
void driver_set_nonblock_state(bool nonblock);
|
void driver_set_nonblock_state(bool nonblock);
|
||||||
@ -507,6 +557,13 @@ bool driver_set_rumble_state(unsigned port, enum retro_rumble_effect effect, uin
|
|||||||
// Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE
|
// Used by RETRO_ENVIRONMENT_GET_SENSOR_INTERFACE
|
||||||
bool driver_set_sensor_state(unsigned port, enum retro_sensor_action action, unsigned rate);
|
bool driver_set_sensor_state(unsigned port, enum retro_sensor_action action, unsigned rate);
|
||||||
|
|
||||||
|
// Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
bool driver_camera_start(void);
|
||||||
|
void driver_camera_stop(void);
|
||||||
|
void driver_camera_poll(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern driver_t driver;
|
extern driver_t driver;
|
||||||
|
|
||||||
//////////////////////////////////////////////// Backends
|
//////////////////////////////////////////////// Backends
|
||||||
@ -554,6 +611,8 @@ extern const input_driver_t input_apple;
|
|||||||
extern const input_driver_t input_qnx;
|
extern const input_driver_t input_qnx;
|
||||||
extern const input_driver_t input_rwebinput;
|
extern const input_driver_t input_rwebinput;
|
||||||
extern const input_driver_t input_null;
|
extern const input_driver_t input_null;
|
||||||
|
extern const camera_driver_t camera_v4l2;
|
||||||
|
extern const input_osk_driver_t input_ps3_osk;
|
||||||
|
|
||||||
#include "driver_funcs.h"
|
#include "driver_funcs.h"
|
||||||
|
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#ifndef _RARCH_DRIVER_FUNCS_H
|
#ifndef _RARCH_DRIVER_FUNCS_H
|
||||||
#define _RARCH_DRIVER_FUNCS_H
|
#define _RARCH_DRIVER_FUNCS_H
|
||||||
|
|
||||||
|
#define camera_init_func(device, caps, width, height) driver.camera->init(device, caps, width, height)
|
||||||
|
|
||||||
#define audio_init_func(device, rate, latency) driver.audio->init(device, rate, latency)
|
#define audio_init_func(device, rate, latency) driver.audio->init(device, rate, latency)
|
||||||
#define audio_write_func(buf, size) driver.audio->write(driver.audio_data, buf, size)
|
#define audio_write_func(buf, size) driver.audio->write(driver.audio_data, buf, size)
|
||||||
#define audio_stop_func() driver.audio->stop(driver.audio_data)
|
#define audio_stop_func() driver.audio->stop(driver.audio_data)
|
||||||
|
12
dynamic.c
12
dynamic.c
@ -783,6 +783,18 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
case RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE:
|
||||||
|
{
|
||||||
|
RARCH_LOG("Environ GET_CAMERA_INTERFACE.\n");
|
||||||
|
struct retro_camera_callback *cb = (struct retro_camera_callback*)data;
|
||||||
|
cb->start = driver_camera_start;
|
||||||
|
cb->stop = driver_camera_stop;
|
||||||
|
g_extern.system.camera_callback = *cb;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Private extensions for internal use, not part of libretro API.
|
// Private extensions for internal use, not part of libretro API.
|
||||||
case RETRO_ENVIRONMENT_SET_LIBRETRO_PATH:
|
case RETRO_ENVIRONMENT_SET_LIBRETRO_PATH:
|
||||||
RARCH_LOG("Environ (Private) SET_LIBRETRO_PATH.\n");
|
RARCH_LOG("Environ (Private) SET_LIBRETRO_PATH.\n");
|
||||||
|
155
emscripten/template.html
Normal file
155
emscripten/template.html
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en-us">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<title>RetroArch - Template</title>
|
||||||
|
<style>
|
||||||
|
.emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
|
||||||
|
textarea.emscripten { font-family: monospace; width: 80%; }
|
||||||
|
div.emscripten, h1 { text-align: center; }
|
||||||
|
div.emscripten_border { border: 1px solid black; }
|
||||||
|
#fakerom { font-size: 20pt; margin: 5pt;}
|
||||||
|
/* the canvas *must not* have any border or padding, or mouse coords will be wrong */
|
||||||
|
canvas.emscripten { border: 0px none; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Template</h1>
|
||||||
|
<hr/>
|
||||||
|
<div class="emscripten" id="status">Downloading...</div>
|
||||||
|
<div class="emscripten">
|
||||||
|
<progress value="0" max="100" id="progress" hidden=1></progress>
|
||||||
|
</div>
|
||||||
|
<div class="emscripten_border" id="canvas_div" style="display: none">
|
||||||
|
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
|
||||||
|
</div>
|
||||||
|
<div class="emscripten emscripten_border" id="openrom">
|
||||||
|
<button id="fakerom" onclick="document.getElementById('rom').click()">Select a ROM</button>
|
||||||
|
<input style="display: none" type="file" id="rom" name="upload" onclick="document.getElementById('fakerom').click();" onchange="runEmulator(event.target.files);" multiple />
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<div class="emscripten">
|
||||||
|
|
||||||
|
<input type="checkbox" id="resize"><label for="resize">Resize canvas</label>
|
||||||
|
<input type="checkbox" id="pointerLock" checked><label for="pointerLock">Lock/hide mouse pointer</label>
|
||||||
|
|
||||||
|
<input type="button" value="Fullscreen" onclick="Module.requestFullScreen(document.getElementById('pointerLock').checked,
|
||||||
|
document.getElementById('resize').checked)"><br>
|
||||||
|
<input type="checkbox" id="vsync"><label for="vsync" id="vsync-label">Enable V-sync (can only be done before loading game)</label><br>
|
||||||
|
<input type="textbox" id="latency" size="3" maxlength="3" value="96"> <label for="latency" id="latency-label">Audio latency (ms) (increase if you hear pops at fullspeed, can only be done before loading game)</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
<textarea class="emscripten" id="output" rows="8"></textarea>
|
||||||
|
<hr>
|
||||||
|
<div class="emscripten" id="controls">
|
||||||
|
Controls:<br>
|
||||||
|
<br>
|
||||||
|
A button (OK in menu): X<br>
|
||||||
|
B button (Back in menu): Z<br>
|
||||||
|
X Button: S<br>
|
||||||
|
Y Button: A<br>
|
||||||
|
L Button: Q<br>
|
||||||
|
R Button: W<br>
|
||||||
|
D-pad: Arrow Keys<br>
|
||||||
|
Start Button: Enter<br>
|
||||||
|
Select Button: Shift<br>
|
||||||
|
Toggle Menu: F1<br>
|
||||||
|
Fast forward: Spacebar (toggle)<br>
|
||||||
|
Slow motion: E (hold)</br>
|
||||||
|
Save state: F2<br>
|
||||||
|
Load state: F4
|
||||||
|
</div>
|
||||||
|
<script type='text/javascript'>
|
||||||
|
var count = 0;
|
||||||
|
function runEmulator(files){
|
||||||
|
count = files.length;
|
||||||
|
document.getElementById("openrom").innerHTML = '';
|
||||||
|
document.getElementById("openrom").style.display = 'none';
|
||||||
|
for (var i = 0; i < files.length; i++) {
|
||||||
|
filereader = new FileReader();
|
||||||
|
filereader.file_name = files[i].name;
|
||||||
|
filereader.onload = function(){initFromData(this.result, this.file_name)};
|
||||||
|
filereader.readAsArrayBuffer(files[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initFromData(data, name){
|
||||||
|
var dataView = new Uint8Array(data);
|
||||||
|
Module.FS_createDataFile('/', name, dataView, true, false);
|
||||||
|
count--;
|
||||||
|
if (count === 0) {
|
||||||
|
Module.FS_createFolder('/', 'etc', true, true);
|
||||||
|
var config = 'input_player1_select = shift\n';
|
||||||
|
var latency = parseInt(document.getElementById('latency').value, 10);
|
||||||
|
if (isNaN(latency)) latency = 96;
|
||||||
|
config += 'audio_latency = ' + latency + '\n'
|
||||||
|
if (document.getElementById('vsync').checked)
|
||||||
|
config += 'video_vsync = true\n';
|
||||||
|
else
|
||||||
|
config += 'video_vsync = false\n';
|
||||||
|
Module.FS_createDataFile('/etc', 'retroarch.cfg', config, true, true);
|
||||||
|
document.getElementById('canvas_div').style.display = 'block';
|
||||||
|
document.getElementById('vsync').disabled = true;
|
||||||
|
document.getElementById('vsync-label').style.color = 'gray';
|
||||||
|
document.getElementById('latency').disabled = true;
|
||||||
|
document.getElementById('latency-label').style.color = 'gray';
|
||||||
|
Module['callMain'](Module['arguments']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<script type='text/javascript'>
|
||||||
|
// connect to canvas
|
||||||
|
var Module = {
|
||||||
|
noInitialRun: true,
|
||||||
|
arguments: ["-v", "--menu"],
|
||||||
|
preRun: [],
|
||||||
|
postRun: [],
|
||||||
|
print: (function() {
|
||||||
|
var element = document.getElementById('output');
|
||||||
|
element.value = ''; // clear browser cache
|
||||||
|
return function(text) {
|
||||||
|
text = Array.prototype.slice.call(arguments).join(' ');
|
||||||
|
// These replacements are necessary if you render to raw HTML
|
||||||
|
//text = text.replace(/&/g, "&");
|
||||||
|
//text = text.replace(/</g, "<");
|
||||||
|
//text = text.replace(/>/g, ">");
|
||||||
|
//text = text.replace('\n', '<br>', 'g');
|
||||||
|
element.value += text + "\n";
|
||||||
|
element.scrollTop = 99999; // focus on bottom
|
||||||
|
};
|
||||||
|
})(),
|
||||||
|
printErr: function(text) {
|
||||||
|
var text = Array.prototype.slice.call(arguments).join(' ');
|
||||||
|
var element = document.getElementById('output');
|
||||||
|
element.value += text + "\n";
|
||||||
|
element.scrollTop = 99999; // focus on bottom
|
||||||
|
},
|
||||||
|
canvas: document.getElementById('canvas'),
|
||||||
|
setStatus: function(text) {
|
||||||
|
if (Module.setStatus.interval) clearInterval(Module.setStatus.interval);
|
||||||
|
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
|
||||||
|
var statusElement = document.getElementById('status');
|
||||||
|
var progressElement = document.getElementById('progress');
|
||||||
|
if (m) {
|
||||||
|
text = m[1];
|
||||||
|
progressElement.value = parseInt(m[2])*100;
|
||||||
|
progressElement.max = parseInt(m[4])*100;
|
||||||
|
progressElement.hidden = false;
|
||||||
|
} else {
|
||||||
|
progressElement.value = null;
|
||||||
|
progressElement.max = null;
|
||||||
|
progressElement.hidden = true;
|
||||||
|
}
|
||||||
|
statusElement.innerHTML = text;
|
||||||
|
},
|
||||||
|
totalDependencies: 0,
|
||||||
|
monitorRunDependencies: function(left) {
|
||||||
|
this.totalDependencies = Math.max(this.totalDependencies, left);
|
||||||
|
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Module.setStatus('Downloading...');
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="retroarch.js"></script>
|
@ -24,12 +24,6 @@
|
|||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_RGUI)
|
|
||||||
#include "menu/rgui.h"
|
|
||||||
#elif defined(HAVE_RMENU)
|
|
||||||
#include "menu/rmenu.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct frontend_ctx_driver
|
typedef struct frontend_ctx_driver
|
||||||
{
|
{
|
||||||
void (*environment_get)(int argc, char *argv[], void *args);
|
void (*environment_get)(int argc, char *argv[], void *args);
|
||||||
|
@ -21,25 +21,21 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "rgui.h"
|
#include "../menu_common.h"
|
||||||
#include "menu_context.h"
|
#include "../menu_context.h"
|
||||||
#include "../../file_list.h"
|
#include "../../../file_list.h"
|
||||||
#include "../../general.h"
|
#include "../../../general.h"
|
||||||
#include "../../gfx/gfx_common.h"
|
#include "../../../gfx/gfx_common.h"
|
||||||
#include "../../config.def.h"
|
#include "../../../config.def.h"
|
||||||
#include "../../file.h"
|
#include "../../../file.h"
|
||||||
#include "../../dynamic.h"
|
#include "../../../dynamic.h"
|
||||||
#include "../../compat/posix_string.h"
|
#include "../../../compat/posix_string.h"
|
||||||
#include "../../gfx/shader_parse.h"
|
#include "../../../gfx/shader_parse.h"
|
||||||
#include "../../performance.h"
|
#include "../../../performance.h"
|
||||||
#include "../../input/input_common.h"
|
#include "../../../input/input_common.h"
|
||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#include "../../../screenshot.h"
|
||||||
#include "../../gfx/gl_common.h"
|
#include "../../../gfx/fonts/bitmap.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../screenshot.h"
|
|
||||||
#include "../../gfx/fonts/bitmap.h"
|
|
||||||
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
||||||
#define HAVE_SHADER_MANAGER
|
#define HAVE_SHADER_MANAGER
|
@ -21,31 +21,35 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "rgui.h"
|
#include "../menu_common.h"
|
||||||
#include "menu_context.h"
|
#include "../menu_context.h"
|
||||||
#include "../../file_list.h"
|
#include "../../../file_list.h"
|
||||||
#include "../../general.h"
|
#include "../../../general.h"
|
||||||
#include "../../gfx/gfx_common.h"
|
#include "../../../gfx/gfx_common.h"
|
||||||
#include "../../config.def.h"
|
#include "../../../config.def.h"
|
||||||
#include "../../file.h"
|
#include "../../../file.h"
|
||||||
#include "../../dynamic.h"
|
#include "../../../dynamic.h"
|
||||||
#include "../../compat/posix_string.h"
|
#include "../../../compat/posix_string.h"
|
||||||
#include "../../gfx/shader_parse.h"
|
#include "../../../gfx/shader_parse.h"
|
||||||
#include "../../performance.h"
|
#include "../../../performance.h"
|
||||||
#include "../../input/input_common.h"
|
#include "../../../input/input_common.h"
|
||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#include "../../../screenshot.h"
|
||||||
#include "../../gfx/gl_common.h"
|
#include "../../../gfx/fonts/bitmap.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../../screenshot.h"
|
|
||||||
#include "../../gfx/fonts/bitmap.h"
|
|
||||||
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
||||||
#define HAVE_SHADER_MANAGER
|
#define HAVE_SHADER_MANAGER
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_XBOX1)
|
#if defined(_XBOX1)
|
||||||
|
#define ENTRIES_HEIGHT 10
|
||||||
|
#define POSITION_EDGE_MAX (480)
|
||||||
|
#define POSITION_EDGE_MIN 0
|
||||||
|
#define POSITION_EDGE_CENTER (450)
|
||||||
|
#define POSITION_OFFSET 30
|
||||||
|
#define POSITION_RENDER_OFFSET 100
|
||||||
|
#define TERM_WIDTH 45
|
||||||
|
#define FONT_SIZE_NORMAL 21
|
||||||
#elif defined(__CELLOS_LV2__)
|
#elif defined(__CELLOS_LV2__)
|
||||||
#define ENTRIES_HEIGHT 25
|
#define ENTRIES_HEIGHT 25
|
||||||
#define POSITION_MIDDLE 0.50f
|
#define POSITION_MIDDLE 0.50f
|
||||||
@ -59,7 +63,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct texture_image *menu_texture;
|
struct texture_image *menu_texture;
|
||||||
struct texture_image *menu_panel;
|
|
||||||
static bool render_normal = true;
|
static bool render_normal = true;
|
||||||
|
|
||||||
static void render_background(rgui_handle_t *rgui)
|
static void render_background(rgui_handle_t *rgui)
|
||||||
@ -68,6 +71,7 @@ static void render_background(rgui_handle_t *rgui)
|
|||||||
|
|
||||||
static void rmenu_render_messagebox(void *data, const char *message)
|
static void rmenu_render_messagebox(void *data, const char *message)
|
||||||
{
|
{
|
||||||
|
#ifndef _XBOX1
|
||||||
font_params_t font_parms;
|
font_params_t font_parms;
|
||||||
|
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
@ -107,6 +111,7 @@ static void rmenu_render_messagebox(void *data, const char *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
render_normal = false;
|
render_normal = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -395,9 +400,6 @@ void rmenu_set_texture(void *data, bool enable)
|
|||||||
static void rmenu_init_assets(void *data)
|
static void rmenu_init_assets(void *data)
|
||||||
{
|
{
|
||||||
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
||||||
#ifdef HAVE_MENU_PANEL
|
|
||||||
texture_image_load("D:\\Media\\menuMainRomSelectPanel.png", menu_panel);
|
|
||||||
#endif
|
|
||||||
texture_image_load(g_extern.menu_texture_path, menu_texture);
|
texture_image_load(g_extern.menu_texture_path, menu_texture);
|
||||||
rgui->width = menu_texture->width;
|
rgui->width = menu_texture->width;
|
||||||
rgui->height = menu_texture->height;
|
rgui->height = menu_texture->height;
|
||||||
@ -410,7 +412,6 @@ static void *rmenu_init(void)
|
|||||||
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
|
rgui_handle_t *rgui = (rgui_handle_t*)calloc(1, sizeof(*rgui));
|
||||||
|
|
||||||
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
|
menu_texture = (struct texture_image*)calloc(1, sizeof(*menu_texture));
|
||||||
menu_panel = (struct texture_image*)calloc(1, sizeof(*menu_panel));
|
|
||||||
|
|
||||||
rmenu_init_assets(rgui);
|
rmenu_init_assets(rgui);
|
||||||
|
|
||||||
@ -420,17 +421,6 @@ static void *rmenu_init(void)
|
|||||||
static void rmenu_free_assets(void *data)
|
static void rmenu_free_assets(void *data)
|
||||||
{
|
{
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
if (menu_panel->vertex_buf)
|
|
||||||
{
|
|
||||||
menu_panel->vertex_buf->Release();
|
|
||||||
menu_panel->vertex_buf = NULL;
|
|
||||||
}
|
|
||||||
if (menu_panel->pixels)
|
|
||||||
{
|
|
||||||
menu_panel->pixels->Release();
|
|
||||||
menu_panel->pixels = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu_texture->vertex_buf)
|
if (menu_texture->vertex_buf)
|
||||||
{
|
{
|
||||||
menu_texture->vertex_buf->Release();
|
menu_texture->vertex_buf->Release();
|
||||||
@ -442,12 +432,6 @@ static void rmenu_free_assets(void *data)
|
|||||||
menu_texture->pixels = NULL;
|
menu_texture->pixels = NULL;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (menu_panel)
|
|
||||||
{
|
|
||||||
free(menu_panel->pixels);
|
|
||||||
menu_panel->pixels = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menu_texture)
|
if (menu_texture)
|
||||||
{
|
{
|
||||||
free(menu_texture->pixels);
|
free(menu_texture->pixels);
|
@ -1,168 +0,0 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2013 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "file_browser.h"
|
|
||||||
|
|
||||||
static bool directory_parse(void *data, const char *path)
|
|
||||||
{
|
|
||||||
filebrowser_t *filebrowser = (filebrowser_t*)data;
|
|
||||||
|
|
||||||
struct string_list *list = dir_list_new(path,
|
|
||||||
filebrowser->current_dir.extensions, true);
|
|
||||||
if(!list)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (list->size)
|
|
||||||
dir_list_sort(list, true);
|
|
||||||
|
|
||||||
filebrowser->current_dir.ptr = 0;
|
|
||||||
strlcpy(filebrowser->current_dir.directory_path,
|
|
||||||
path, sizeof(filebrowser->current_dir.directory_path));
|
|
||||||
|
|
||||||
if (filebrowser->list)
|
|
||||||
dir_list_free(filebrowser->list);
|
|
||||||
|
|
||||||
filebrowser->list = list;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void filebrowser_free(void *data)
|
|
||||||
{
|
|
||||||
filebrowser_t *filebrowser = (filebrowser_t*)data;
|
|
||||||
|
|
||||||
dir_list_free(filebrowser->list);
|
|
||||||
filebrowser->list = NULL;
|
|
||||||
filebrowser->current_dir.ptr = 0;
|
|
||||||
free(filebrowser);
|
|
||||||
}
|
|
||||||
|
|
||||||
void filebrowser_set_root_and_ext(void *data, const char *ext, const char *root_dir)
|
|
||||||
{
|
|
||||||
filebrowser_t *filebrowser = (filebrowser_t*)data;
|
|
||||||
|
|
||||||
if (ext)
|
|
||||||
strlcpy(filebrowser->current_dir.extensions, ext,
|
|
||||||
sizeof(filebrowser->current_dir.extensions));
|
|
||||||
|
|
||||||
strlcpy(filebrowser->current_dir.root_dir,
|
|
||||||
root_dir, sizeof(filebrowser->current_dir.root_dir));
|
|
||||||
filebrowser_iterate(filebrowser, RGUI_ACTION_START);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define GET_CURRENT_PATH(browser) (browser->list->elems[browser->current_dir.ptr].data)
|
|
||||||
|
|
||||||
bool filebrowser_iterate(void *data, unsigned action)
|
|
||||||
{
|
|
||||||
filebrowser_t *filebrowser = (filebrowser_t*)data;
|
|
||||||
bool ret = true;
|
|
||||||
unsigned entries_to_scroll = 19;
|
|
||||||
|
|
||||||
switch(action)
|
|
||||||
{
|
|
||||||
case RGUI_ACTION_UP:
|
|
||||||
if (filebrowser->list->size)
|
|
||||||
{
|
|
||||||
filebrowser->current_dir.ptr--;
|
|
||||||
if (filebrowser->current_dir.ptr >= filebrowser->list->size)
|
|
||||||
filebrowser->current_dir.ptr = filebrowser->list->size - 1;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_DOWN:
|
|
||||||
if (filebrowser->list->size)
|
|
||||||
{
|
|
||||||
filebrowser->current_dir.ptr++;
|
|
||||||
if (filebrowser->current_dir.ptr >= filebrowser->list->size)
|
|
||||||
filebrowser->current_dir.ptr = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_LEFT:
|
|
||||||
if (filebrowser->list->size)
|
|
||||||
{
|
|
||||||
if (filebrowser->current_dir.ptr <= 5)
|
|
||||||
filebrowser->current_dir.ptr = 0;
|
|
||||||
else
|
|
||||||
filebrowser->current_dir.ptr -= 5;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_RIGHT:
|
|
||||||
if (filebrowser->list->size)
|
|
||||||
filebrowser->current_dir.ptr = (min(filebrowser->current_dir.ptr + 5,
|
|
||||||
filebrowser->list->size-1));
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_SCROLL_UP:
|
|
||||||
if (filebrowser->list->size)
|
|
||||||
{
|
|
||||||
if (filebrowser->current_dir.ptr <= entries_to_scroll)
|
|
||||||
filebrowser->current_dir.ptr= 0;
|
|
||||||
else
|
|
||||||
filebrowser->current_dir.ptr -= entries_to_scroll;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_SCROLL_DOWN:
|
|
||||||
if (filebrowser->list->size)
|
|
||||||
filebrowser->current_dir.ptr = (min(filebrowser->current_dir.ptr +
|
|
||||||
entries_to_scroll, filebrowser->list->size-1));
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_OK:
|
|
||||||
ret = directory_parse(filebrowser, GET_CURRENT_PATH(filebrowser));
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_CANCEL:
|
|
||||||
{
|
|
||||||
char tmp_str[PATH_MAX];
|
|
||||||
fill_pathname_parent_dir(tmp_str, rgui->browser->current_dir.directory_path, sizeof(tmp_str));
|
|
||||||
|
|
||||||
if (tmp_str[0] != '\0')
|
|
||||||
{
|
|
||||||
fill_pathname_parent_dir(filebrowser->current_dir.directory_path,
|
|
||||||
filebrowser->current_dir.directory_path,
|
|
||||||
sizeof(filebrowser->current_dir.directory_path));
|
|
||||||
|
|
||||||
ret = directory_parse(filebrowser, filebrowser->current_dir.directory_path);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
ret = false;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RGUI_ACTION_START:
|
|
||||||
#ifdef HAVE_RMENU_XUI
|
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
|
||||||
#endif
|
|
||||||
ret = directory_parse(filebrowser, filebrowser->current_dir.root_dir);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ret)
|
|
||||||
strlcpy(filebrowser->current_dir.path, GET_CURRENT_PATH(filebrowser),
|
|
||||||
sizeof(filebrowser->current_dir.path));
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool filebrowser_is_current_entry_dir(void *data)
|
|
||||||
{
|
|
||||||
filebrowser_t *filebrowser = (filebrowser_t*)data;
|
|
||||||
return filebrowser->list->elems[filebrowser->current_dir.ptr].attr.b;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool filebrowser_reset_current_dir(void *data)
|
|
||||||
{
|
|
||||||
filebrowser_t *filebrowser = (filebrowser_t*)data;
|
|
||||||
return directory_parse(filebrowser, filebrowser->current_dir.directory_path);
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2013 - Daniel De Matteis
|
|
||||||
*
|
|
||||||
* 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 FILEBROWSER_H_
|
|
||||||
#define FILEBROWSER_H_
|
|
||||||
|
|
||||||
#include "../../general.h"
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
size_t ptr;
|
|
||||||
char directory_path[PATH_MAX];
|
|
||||||
char extensions[PATH_MAX];
|
|
||||||
char root_dir[PATH_MAX];
|
|
||||||
char path[PATH_MAX];
|
|
||||||
} filebrowser_dir_type_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
struct string_list *list;
|
|
||||||
filebrowser_dir_type_t current_dir;
|
|
||||||
filebrowser_dir_type_t prev_dir;
|
|
||||||
} filebrowser_t;
|
|
||||||
|
|
||||||
void filebrowser_set_root_and_ext(void *data, const char *ext, const char *root_dir);
|
|
||||||
bool filebrowser_iterate(void *data, unsigned action);
|
|
||||||
void filebrowser_free(void *data);
|
|
||||||
bool filebrowser_is_current_entry_dir(void *data);
|
|
||||||
bool filebrowser_reset_current_dir(void *data);
|
|
||||||
|
|
||||||
#endif /* FILEBROWSER_H_ */
|
|
@ -33,6 +33,9 @@
|
|||||||
|
|
||||||
rgui_handle_t *rgui;
|
rgui_handle_t *rgui;
|
||||||
const menu_ctx_driver_t *menu_ctx;
|
const menu_ctx_driver_t *menu_ctx;
|
||||||
|
#ifdef HAVE_OSK
|
||||||
|
input_osk_driver_t *osk;
|
||||||
|
#endif
|
||||||
|
|
||||||
//forward decl
|
//forward decl
|
||||||
static int menu_iterate_func(void *data, unsigned action);
|
static int menu_iterate_func(void *data, unsigned action);
|
||||||
@ -382,6 +385,36 @@ bool load_menu_game(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_OSK
|
||||||
|
static const input_osk_driver_t *osk_drivers[] = {
|
||||||
|
#if defined(__CELLOS_LV2__)
|
||||||
|
&input_ps3_osk,
|
||||||
|
#endif
|
||||||
|
NULL // zero length array is not valid
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool osk_init_first(void **data)
|
||||||
|
{
|
||||||
|
unsigned i;
|
||||||
|
input_osk_driver_t **handle = (input_osk_driver_t**)data;
|
||||||
|
|
||||||
|
if (!osk_drivers[0])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (i = 0; osk_drivers[i]; i++)
|
||||||
|
{
|
||||||
|
void *h = osk_drivers[i]->init(0);
|
||||||
|
if (h)
|
||||||
|
{
|
||||||
|
*handle = (input_osk_driver_t*)h;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void menu_init(void)
|
void menu_init(void)
|
||||||
{
|
{
|
||||||
if (!menu_ctx_init_first(&menu_ctx, ((void**)&rgui)))
|
if (!menu_ctx_init_first(&menu_ctx, ((void**)&rgui)))
|
||||||
@ -407,38 +440,18 @@ void menu_init(void)
|
|||||||
|
|
||||||
menu_update_libretro_info();
|
menu_update_libretro_info();
|
||||||
|
|
||||||
#ifdef HAVE_FILEBROWSER
|
|
||||||
if (!(strlen(g_settings.rgui_browser_directory) > 0))
|
|
||||||
strlcpy(g_settings.rgui_browser_directory, default_paths.filebrowser_startup_dir,
|
|
||||||
sizeof(g_settings.rgui_browser_directory));
|
|
||||||
|
|
||||||
rgui->browser = (filebrowser_t*)calloc(1, sizeof(*(rgui->browser)));
|
|
||||||
|
|
||||||
if (rgui->browser == NULL)
|
|
||||||
{
|
|
||||||
RARCH_ERR("Could not initialize filebrowser.\n");
|
|
||||||
rarch_fail(1, "menu_init()");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Look for zips to extract as well.
|
|
||||||
if (*rgui->info.valid_extensions)
|
|
||||||
{
|
|
||||||
strlcpy(rgui->browser->current_dir.extensions, rgui->info.valid_extensions,
|
|
||||||
sizeof(rgui->browser->current_dir.extensions));
|
|
||||||
strlcat(rgui->browser->current_dir.extensions, "|zip",
|
|
||||||
sizeof(rgui->browser->current_dir.extensions));
|
|
||||||
}
|
|
||||||
|
|
||||||
strlcpy(rgui->browser->current_dir.root_dir, g_settings.rgui_browser_directory,
|
|
||||||
sizeof(rgui->browser->current_dir.root_dir));
|
|
||||||
|
|
||||||
filebrowser_iterate(rgui->browser, RGUI_ACTION_START);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
shader_manager_init(rgui);
|
shader_manager_init(rgui);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_OSK
|
||||||
|
if (!osk_init_first(((void**)&osk)))
|
||||||
|
{
|
||||||
|
RARCH_ERR("Could not initialize OSK.\n");
|
||||||
|
rarch_fail(1, "osk_init()");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
menu_init_history();
|
menu_init_history();
|
||||||
rgui->last_time = rarch_get_time_usec();
|
rgui->last_time = rarch_get_time_usec();
|
||||||
}
|
}
|
||||||
@ -452,13 +465,14 @@ void menu_free(void)
|
|||||||
libretro_free_system_info(&rgui->info);
|
libretro_free_system_info(&rgui->info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_OSK
|
||||||
|
if (osk)
|
||||||
|
free(osk);
|
||||||
|
#endif
|
||||||
|
|
||||||
file_list_free(rgui->menu_stack);
|
file_list_free(rgui->menu_stack);
|
||||||
file_list_free(rgui->selection_buf);
|
file_list_free(rgui->selection_buf);
|
||||||
|
|
||||||
#ifdef HAVE_FILEBROWSER
|
|
||||||
filebrowser_free(rgui->browser);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rom_history_free(rgui->history);
|
rom_history_free(rgui->history);
|
||||||
core_info_list_free(rgui->core_info);
|
core_info_list_free(rgui->core_info);
|
||||||
|
|
||||||
@ -1964,6 +1978,9 @@ void menu_populate_entries(void *data, unsigned menu_type)
|
|||||||
file_list_push(rgui->selection_buf, "Video driver", RGUI_SETTINGS_DRIVER_VIDEO, 0);
|
file_list_push(rgui->selection_buf, "Video driver", RGUI_SETTINGS_DRIVER_VIDEO, 0);
|
||||||
file_list_push(rgui->selection_buf, "Audio driver", RGUI_SETTINGS_DRIVER_AUDIO, 0);
|
file_list_push(rgui->selection_buf, "Audio driver", RGUI_SETTINGS_DRIVER_AUDIO, 0);
|
||||||
file_list_push(rgui->selection_buf, "Input driver", RGUI_SETTINGS_DRIVER_INPUT, 0);
|
file_list_push(rgui->selection_buf, "Input driver", RGUI_SETTINGS_DRIVER_INPUT, 0);
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
file_list_push(rgui->selection_buf, "Camera driver", RGUI_SETTINGS_DRIVER_CAMERA, 0);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS:
|
case RGUI_SETTINGS:
|
||||||
file_list_clear(rgui->selection_buf);
|
file_list_clear(rgui->selection_buf);
|
||||||
@ -2074,11 +2091,11 @@ void menu_parse_and_resolve(void *data, unsigned menu_type)
|
|||||||
file_list_push(rgui->selection_buf, "carda:/", menu_type, 0);
|
file_list_push(rgui->selection_buf, "carda:/", menu_type, 0);
|
||||||
file_list_push(rgui->selection_buf, "cardb:/", menu_type, 0);
|
file_list_push(rgui->selection_buf, "cardb:/", menu_type, 0);
|
||||||
#elif defined(_XBOX1)
|
#elif defined(_XBOX1)
|
||||||
file_list_push(rgui->selection_buf, "C:\\", menu_type, 0);
|
file_list_push(rgui->selection_buf, "C:", menu_type, 0);
|
||||||
file_list_push(rgui->selection_buf, "D:\\", menu_type, 0);
|
file_list_push(rgui->selection_buf, "D:", menu_type, 0);
|
||||||
file_list_push(rgui->selection_buf, "E:\\", menu_type, 0);
|
file_list_push(rgui->selection_buf, "E:", menu_type, 0);
|
||||||
file_list_push(rgui->selection_buf, "F:\\", menu_type, 0);
|
file_list_push(rgui->selection_buf, "F:", menu_type, 0);
|
||||||
file_list_push(rgui->selection_buf, "G:\\", menu_type, 0);
|
file_list_push(rgui->selection_buf, "G:", menu_type, 0);
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
unsigned drives = GetLogicalDrives();
|
unsigned drives = GetLogicalDrives();
|
||||||
char drive[] = " :\\";
|
char drive[] = " :\\";
|
||||||
|
@ -39,9 +39,6 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FILEBROWSER
|
|
||||||
#include "file_browser.h"
|
|
||||||
#endif
|
|
||||||
#include "../../file_list.h"
|
#include "../../file_list.h"
|
||||||
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
|
||||||
@ -123,6 +120,7 @@ typedef enum
|
|||||||
RGUI_SETTINGS_DRIVER_VIDEO,
|
RGUI_SETTINGS_DRIVER_VIDEO,
|
||||||
RGUI_SETTINGS_DRIVER_AUDIO,
|
RGUI_SETTINGS_DRIVER_AUDIO,
|
||||||
RGUI_SETTINGS_DRIVER_INPUT,
|
RGUI_SETTINGS_DRIVER_INPUT,
|
||||||
|
RGUI_SETTINGS_DRIVER_CAMERA,
|
||||||
RGUI_SETTINGS_SCREENSHOT,
|
RGUI_SETTINGS_SCREENSHOT,
|
||||||
RGUI_SETTINGS_GPU_SCREENSHOT,
|
RGUI_SETTINGS_GPU_SCREENSHOT,
|
||||||
RGUI_SCREENSHOT_DIR_PATH,
|
RGUI_SCREENSHOT_DIR_PATH,
|
||||||
@ -266,6 +264,7 @@ enum
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint64_t old_input_state;
|
uint64_t old_input_state;
|
||||||
@ -282,10 +281,6 @@ typedef struct
|
|||||||
size_t frame_buf_pitch;
|
size_t frame_buf_pitch;
|
||||||
bool frame_buf_show;
|
bool frame_buf_show;
|
||||||
|
|
||||||
#ifdef HAVE_FILEBROWSER
|
|
||||||
filebrowser_t *browser;
|
|
||||||
unsigned menu_type;
|
|
||||||
#endif
|
|
||||||
file_list_t *menu_stack;
|
file_list_t *menu_stack;
|
||||||
file_list_t *selection_buf;
|
file_list_t *selection_buf;
|
||||||
size_t selection_ptr;
|
size_t selection_ptr;
|
||||||
@ -314,12 +309,6 @@ typedef struct
|
|||||||
struct retro_system_info info;
|
struct retro_system_info info;
|
||||||
bool load_no_rom;
|
bool load_no_rom;
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
|
||||||
unsigned osk_param;
|
|
||||||
oskutil_params oskutil_handle;
|
|
||||||
bool (*osk_init)(void *data);
|
|
||||||
bool (*osk_callback)(void *data);
|
|
||||||
#endif
|
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
struct gfx_shader shader;
|
struct gfx_shader shader;
|
||||||
#endif
|
#endif
|
||||||
@ -332,6 +321,9 @@ typedef struct
|
|||||||
} rgui_handle_t;
|
} rgui_handle_t;
|
||||||
|
|
||||||
extern rgui_handle_t *rgui;
|
extern rgui_handle_t *rgui;
|
||||||
|
#ifdef HAVE_OSK
|
||||||
|
extern input_osk_driver_t *osk;
|
||||||
|
#endif
|
||||||
|
|
||||||
void menu_init(void);
|
void menu_init(void);
|
||||||
bool menu_iterate(void);
|
bool menu_iterate(void);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "menu_common.h"
|
#include "menu_common.h"
|
||||||
#include "../../gfx/gfx_common.h"
|
#include "../../gfx/gfx_common.h"
|
||||||
#include "../../input/input_common.h"
|
#include "../../input/input_common.h"
|
||||||
|
#include "../../config.def.h"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
@ -142,7 +143,7 @@ static enum rarch_shader_type shader_manager_get_type(const struct gfx_shader *s
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shader_manager_toggle_setting(void *data, unsigned setting, rgui_action_t action)
|
static int shader_manager_toggle_setting(void *data, unsigned setting, unsigned action)
|
||||||
{
|
{
|
||||||
unsigned dist_shader, dist_filter, dist_scale;
|
unsigned dist_shader, dist_filter, dist_scale;
|
||||||
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
||||||
@ -247,7 +248,7 @@ static int shader_manager_toggle_setting(void *data, unsigned setting, rgui_acti
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int menu_core_setting_toggle(unsigned setting, rgui_action_t action)
|
static int menu_core_setting_toggle(unsigned setting, unsigned action)
|
||||||
{
|
{
|
||||||
unsigned index = setting - RGUI_SETTINGS_CORE_OPTION_START;
|
unsigned index = setting - RGUI_SETTINGS_CORE_OPTION_START;
|
||||||
switch (action)
|
switch (action)
|
||||||
@ -272,7 +273,7 @@ static int menu_core_setting_toggle(unsigned setting, rgui_action_t action)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int menu_settings_toggle_setting(void *data, unsigned setting, rgui_action_t action, unsigned menu_type)
|
int menu_settings_toggle_setting(void *data, unsigned setting, unsigned action, unsigned menu_type)
|
||||||
{
|
{
|
||||||
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
rgui_handle_t *rgui = (rgui_handle_t*)data;
|
||||||
#ifdef HAVE_SHADER_MANAGER
|
#ifdef HAVE_SHADER_MANAGER
|
||||||
@ -301,7 +302,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
action == RGUI_ACTION_LEFT ||
|
action == RGUI_ACTION_LEFT ||
|
||||||
action == RGUI_ACTION_RIGHT)
|
action == RGUI_ACTION_RIGHT)
|
||||||
{
|
{
|
||||||
settings_set(1ULL << S_REWIND);
|
g_settings.rewind_enable = !g_settings.rewind_enable;
|
||||||
if (g_settings.rewind_enable)
|
if (g_settings.rewind_enable)
|
||||||
rarch_init_rewind();
|
rarch_init_rewind();
|
||||||
else
|
else
|
||||||
@ -325,11 +326,14 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
#endif
|
#endif
|
||||||
case RGUI_SETTINGS_REWIND_GRANULARITY:
|
case RGUI_SETTINGS_REWIND_GRANULARITY:
|
||||||
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT)
|
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT)
|
||||||
settings_set(1ULL << S_REWIND_GRANULARITY_INCREMENT);
|
g_settings.rewind_granularity++;
|
||||||
else if (action == RGUI_ACTION_LEFT)
|
else if (action == RGUI_ACTION_LEFT)
|
||||||
settings_set(1ULL << S_REWIND_GRANULARITY_DECREMENT);
|
{
|
||||||
|
if (g_settings.rewind_granularity > 1)
|
||||||
|
g_settings.rewind_granularity--;
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_START)
|
else if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_REWIND_GRANULARITY);
|
g_settings.rewind_granularity = 1;
|
||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS_CONFIG_SAVE_ON_EXIT:
|
case RGUI_SETTINGS_CONFIG_SAVE_ON_EXIT:
|
||||||
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT
|
if (action == RGUI_ACTION_OK || action == RGUI_ACTION_RIGHT
|
||||||
@ -378,11 +382,14 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
else if (action == RGUI_ACTION_START)
|
else if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_SAVE_STATE);
|
g_extern.state_slot = 0;
|
||||||
else if (action == RGUI_ACTION_LEFT)
|
else if (action == RGUI_ACTION_LEFT)
|
||||||
settings_set(1ULL << S_SAVESTATE_DECREMENT);
|
{
|
||||||
|
if (g_extern.state_slot != 0)
|
||||||
|
g_extern.state_slot--;
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_RIGHT)
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
settings_set(1ULL << S_SAVESTATE_INCREMENT);
|
g_extern.state_slot++;
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_SCREENSHOTS
|
#ifdef HAVE_SCREENSHOTS
|
||||||
case RGUI_SETTINGS_SCREENSHOT:
|
case RGUI_SETTINGS_SCREENSHOT:
|
||||||
@ -400,17 +407,35 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS_AUDIO_MUTE:
|
case RGUI_SETTINGS_AUDIO_MUTE:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_AUDIO_MUTE);
|
g_extern.audio_data.mute = false;
|
||||||
else
|
else
|
||||||
settings_set(1ULL << S_AUDIO_MUTE);
|
g_extern.audio_data.mute = !g_extern.audio_data.mute;
|
||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA:
|
case RGUI_SETTINGS_AUDIO_CONTROL_RATE_DELTA:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_AUDIO_CONTROL_RATE);
|
{
|
||||||
|
g_settings.audio.rate_control_delta = rate_control_delta;
|
||||||
|
g_settings.audio.rate_control = rate_control;
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_LEFT)
|
else if (action == RGUI_ACTION_LEFT)
|
||||||
settings_set(1ULL << S_AUDIO_CONTROL_RATE_DECREMENT);
|
{
|
||||||
|
if (g_settings.audio.rate_control_delta > 0.0)
|
||||||
|
g_settings.audio.rate_control_delta -= 0.001;
|
||||||
|
|
||||||
|
if (g_settings.audio.rate_control_delta < 0.0005)
|
||||||
|
{
|
||||||
|
g_settings.audio.rate_control = false;
|
||||||
|
g_settings.audio.rate_control_delta = 0.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_settings.audio.rate_control = true;
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_RIGHT)
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
settings_set(1ULL << S_AUDIO_CONTROL_RATE_INCREMENT);
|
{
|
||||||
|
if (g_settings.audio.rate_control_delta < 0.2)
|
||||||
|
g_settings.audio.rate_control_delta += 0.001;
|
||||||
|
g_settings.audio.rate_control = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RGUI_SETTINGS_DEBUG_TEXT:
|
case RGUI_SETTINGS_DEBUG_TEXT:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
@ -501,16 +526,22 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
settings_set(1ULL << S_INPUT_OVERLAY_OPACITY_DECREMENT);
|
g_settings.input.overlay_opacity -= 0.01f;
|
||||||
|
|
||||||
|
if (g_settings.input.overlay_opacity < 0.0f)
|
||||||
|
g_settings.input.overlay_opacity = 0.0f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
settings_set(1ULL << S_INPUT_OVERLAY_OPACITY_INCREMENT);
|
g_settings.input.overlay_opacity += 0.01f;
|
||||||
|
|
||||||
|
if (g_settings.input.overlay_opacity > 1.0f)
|
||||||
|
g_settings.input.overlay_opacity = 1.0f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_START:
|
case RGUI_ACTION_START:
|
||||||
settings_set(1ULL << S_DEF_INPUT_OVERLAY_OPACITY);
|
g_settings.input.overlay_opacity = 1.0f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -530,16 +561,22 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
settings_set(1ULL << S_INPUT_OVERLAY_SCALE_DECREMENT);
|
g_settings.input.overlay_scale -= 0.01f;
|
||||||
|
|
||||||
|
if (g_settings.input.overlay_scale < 0.01f) // Avoid potential divide by zero.
|
||||||
|
g_settings.input.overlay_scale = 0.01f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
settings_set(1ULL << S_INPUT_OVERLAY_SCALE_INCREMENT);
|
g_settings.input.overlay_scale += 0.01f;
|
||||||
|
|
||||||
|
if (g_settings.input.overlay_scale > 2.0f)
|
||||||
|
g_settings.input.overlay_scale = 2.0f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_START:
|
case RGUI_ACTION_START:
|
||||||
settings_set(1ULL << S_DEF_INPUT_OVERLAY_SCALE);
|
g_settings.input.overlay_scale = 1.0f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -806,26 +843,28 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
case RGUI_SETTINGS_VIDEO_ROTATION:
|
case RGUI_SETTINGS_VIDEO_ROTATION:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
{
|
{
|
||||||
settings_set(1ULL << S_DEF_ROTATION);
|
g_settings.video.rotation = ORIENTATION_NORMAL;
|
||||||
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
|
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
|
||||||
}
|
}
|
||||||
else if (action == RGUI_ACTION_LEFT)
|
else if (action == RGUI_ACTION_LEFT)
|
||||||
{
|
{
|
||||||
settings_set(1ULL << S_ROTATION_DECREMENT);
|
if (g_settings.video.rotation > 0)
|
||||||
|
g_settings.video.rotation--;
|
||||||
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
|
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
|
||||||
}
|
}
|
||||||
else if (action == RGUI_ACTION_RIGHT)
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
{
|
{
|
||||||
settings_set(1ULL << S_ROTATION_INCREMENT);
|
if (g_settings.video.rotation < LAST_ORIENTATION)
|
||||||
|
g_settings.video.rotation++;
|
||||||
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
|
video_set_rotation_func((g_settings.video.rotation + g_extern.system.rotation) % 4);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_SETTINGS_VIDEO_FILTER:
|
case RGUI_SETTINGS_VIDEO_FILTER:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_HW_TEXTURE_FILTER);
|
g_settings.video.smooth = video_smooth;
|
||||||
else
|
else
|
||||||
settings_set(1ULL << S_HW_TEXTURE_FILTER);
|
g_settings.video.smooth = !g_settings.video.smooth;
|
||||||
|
|
||||||
if (driver.video_poke->set_filtering)
|
if (driver.video_poke->set_filtering)
|
||||||
driver.video_poke->set_filtering(driver.video_data, 1, g_settings.video.smooth);
|
driver.video_poke->set_filtering(driver.video_data, 1, g_settings.video.smooth);
|
||||||
@ -849,7 +888,14 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
else if (action == RGUI_ACTION_RIGHT)
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
find_next_input_driver();
|
find_next_input_driver();
|
||||||
break;
|
break;
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
case RGUI_SETTINGS_DRIVER_CAMERA:
|
||||||
|
if (action == RGUI_ACTION_LEFT)
|
||||||
|
find_prev_camera_driver();
|
||||||
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
|
find_next_camera_driver();
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case RGUI_SETTINGS_VIDEO_GAMMA:
|
case RGUI_SETTINGS_VIDEO_GAMMA:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
{
|
{
|
||||||
@ -879,11 +925,11 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
|
|
||||||
case RGUI_SETTINGS_VIDEO_INTEGER_SCALE:
|
case RGUI_SETTINGS_VIDEO_INTEGER_SCALE:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_SCALE_INTEGER);
|
g_settings.video.scale_integer = scale_integer;
|
||||||
else if (action == RGUI_ACTION_LEFT ||
|
else if (action == RGUI_ACTION_LEFT ||
|
||||||
action == RGUI_ACTION_RIGHT ||
|
action == RGUI_ACTION_RIGHT ||
|
||||||
action == RGUI_ACTION_OK)
|
action == RGUI_ACTION_OK)
|
||||||
settings_set(1ULL << S_SCALE_INTEGER_TOGGLE);
|
g_settings.video.scale_integer = !g_settings.video.scale_integer;
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
@ -891,11 +937,17 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
|
|
||||||
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
|
case RGUI_SETTINGS_VIDEO_ASPECT_RATIO:
|
||||||
if (action == RGUI_ACTION_START)
|
if (action == RGUI_ACTION_START)
|
||||||
settings_set(1ULL << S_DEF_ASPECT_RATIO);
|
g_settings.video.aspect_ratio_idx = aspect_ratio_idx;
|
||||||
else if (action == RGUI_ACTION_LEFT)
|
else if (action == RGUI_ACTION_LEFT)
|
||||||
settings_set(1ULL << S_ASPECT_RATIO_DECREMENT);
|
{
|
||||||
|
if (g_settings.video.aspect_ratio_idx > 0)
|
||||||
|
g_settings.video.aspect_ratio_idx--;
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_RIGHT)
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
settings_set(1ULL << S_ASPECT_RATIO_INCREMENT);
|
{
|
||||||
|
if (g_settings.video.aspect_ratio_idx < LAST_ASPECT_RATIO)
|
||||||
|
g_settings.video.aspect_ratio_idx++;
|
||||||
|
}
|
||||||
|
|
||||||
if (driver.video_poke->set_aspect_ratio)
|
if (driver.video_poke->set_aspect_ratio)
|
||||||
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
||||||
@ -935,9 +987,24 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
#elif defined(__CELLOS_LV2__)
|
#elif defined(__CELLOS_LV2__)
|
||||||
case RGUI_SETTINGS_VIDEO_RESOLUTION:
|
case RGUI_SETTINGS_VIDEO_RESOLUTION:
|
||||||
if (action == RGUI_ACTION_LEFT)
|
if (action == RGUI_ACTION_LEFT)
|
||||||
settings_set(1ULL << S_RESOLUTION_PREVIOUS);
|
{
|
||||||
|
if (g_extern.console.screen.resolutions.current.idx)
|
||||||
|
{
|
||||||
|
g_extern.console.screen.resolutions.current.idx--;
|
||||||
|
g_extern.console.screen.resolutions.current.id =
|
||||||
|
g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_RIGHT)
|
else if (action == RGUI_ACTION_RIGHT)
|
||||||
settings_set(1ULL << S_RESOLUTION_NEXT);
|
{
|
||||||
|
if (g_extern.console.screen.resolutions.current.idx + 1 <
|
||||||
|
g_extern.console.screen.resolutions.count)
|
||||||
|
{
|
||||||
|
g_extern.console.screen.resolutions.current.idx++;
|
||||||
|
g_extern.console.screen.resolutions.current.id =
|
||||||
|
g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (action == RGUI_ACTION_OK)
|
else if (action == RGUI_ACTION_OK)
|
||||||
{
|
{
|
||||||
if (g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx] == CELL_VIDEO_OUT_RESOLUTION_576)
|
if (g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx] == CELL_VIDEO_OUT_RESOLUTION_576)
|
||||||
@ -1003,13 +1070,13 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
|
|||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case RGUI_ACTION_START:
|
case RGUI_ACTION_START:
|
||||||
settings_set(1ULL << S_DEF_VIDEO_VSYNC);
|
g_settings.video.vsync = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
settings_set(1ULL << S_VIDEO_VSYNC_TOGGLE);
|
g_settings.video.vsync = !g_settings.video.vsync;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1367,6 +1434,11 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w,
|
|||||||
case RGUI_SETTINGS_DRIVER_INPUT:
|
case RGUI_SETTINGS_DRIVER_INPUT:
|
||||||
strlcpy(type_str, g_settings.input.driver, type_str_size);
|
strlcpy(type_str, g_settings.input.driver, type_str_size);
|
||||||
break;
|
break;
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
case RGUI_SETTINGS_DRIVER_CAMERA:
|
||||||
|
strlcpy(type_str, g_settings.camera.driver, type_str_size);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
case RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO:
|
case RGUI_SETTINGS_VIDEO_REFRESH_RATE_AUTO:
|
||||||
{
|
{
|
||||||
double refresh_rate = 0.0;
|
double refresh_rate = 0.0;
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
/* RetroArch - A frontend for libretro.
|
|
||||||
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
|
||||||
* Copyright (C) 2011-2013 - Daniel De Matteis
|
|
||||||
* Copyright (C) 2012-2013 - Michael Lelli
|
|
||||||
*
|
|
||||||
* 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 RGUI_H__
|
|
||||||
#define RGUI_H__
|
|
||||||
|
|
||||||
#include "menu_common.h"
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#ifndef __cplusplus
|
|
||||||
#include <stdbool.h>
|
|
||||||
#else
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef void (*rgui_file_enum_cb_t)(void *ctx,
|
|
||||||
const char *path, unsigned file_type, size_t directory_ptr);
|
|
||||||
typedef bool (*rgui_folder_enum_cb_t)(const char *directory,
|
|
||||||
rgui_file_enum_cb_t file_cb, void *userdata, void *ctx);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
@ -1204,7 +1204,7 @@ static void set_keybind_digital(unsigned default_retro_joypad_id, uint64_t actio
|
|||||||
default_retro_joypad_id, keybind_action);
|
default_retro_joypad_id, keybind_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_OSKUTIL)
|
#if defined(HAVE_OSK)
|
||||||
#ifdef __CELLOS_LV2__
|
#ifdef __CELLOS_LV2__
|
||||||
|
|
||||||
static bool osk_callback_enter_rsound(void *data)
|
static bool osk_callback_enter_rsound(void *data)
|
||||||
@ -1432,14 +1432,16 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
|
|||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
settings_set(1ULL << S_TRIPLE_BUFFERING);
|
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
|
||||||
|
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
||||||
|
else
|
||||||
|
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
||||||
|
|
||||||
driver.video->restart();
|
driver.video->restart();
|
||||||
rgui_init_textures(rgui);
|
rgui_init_textures(rgui);
|
||||||
break;
|
break;
|
||||||
case RGUI_ACTION_START:
|
case RGUI_ACTION_START:
|
||||||
settings_set(1ULL << S_DEF_TRIPLE_BUFFERING);
|
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
||||||
|
|
||||||
if (!(g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)))
|
if (!(g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE)))
|
||||||
{
|
{
|
||||||
driver.video->restart();
|
driver.video->restart();
|
||||||
@ -1484,7 +1486,7 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
|
|||||||
case RGUI_ACTION_LEFT:
|
case RGUI_ACTION_LEFT:
|
||||||
case RGUI_ACTION_RIGHT:
|
case RGUI_ACTION_RIGHT:
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
rgui->osk_init = osk_callback_enter_rsound_init;
|
rgui->osk_init = osk_callback_enter_rsound_init;
|
||||||
rgui->osk_callback = osk_callback_enter_rsound;
|
rgui->osk_callback = osk_callback_enter_rsound;
|
||||||
#endif
|
#endif
|
||||||
@ -1749,7 +1751,7 @@ static int set_setting_action(void *data, uint8_t menu_type, unsigned switchvalu
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SHADERMAN_SAVE_CGP:
|
case SHADERMAN_SAVE_CGP:
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case RGUI_ACTION_OK:
|
case RGUI_ACTION_OK:
|
||||||
@ -2155,7 +2157,7 @@ int rmenu_iterate(void *data, unsigned action)
|
|||||||
rgui->need_refresh = false;
|
rgui->need_refresh = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
if (rgui->osk_init != NULL)
|
if (rgui->osk_init != NULL)
|
||||||
{
|
{
|
||||||
if (rgui->osk_init(rgui))
|
if (rgui->osk_init(rgui))
|
||||||
@ -2239,7 +2241,7 @@ static void* rmenu_init(void)
|
|||||||
|
|
||||||
rgui_init_textures(rgui);
|
rgui_init_textures(rgui);
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
oskutil_params *osk = &rgui->oskutil_handle;
|
oskutil_params *osk = &rgui->oskutil_handle;
|
||||||
oskutil_init(osk, 0);
|
oskutil_init(osk, 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -228,7 +228,7 @@ static void menu_settings_create_menu_item_label_w(wchar_t *strwbuf, unsigned se
|
|||||||
|
|
||||||
void filebrowser_fetch_directory_entries(uint64_t action)
|
void filebrowser_fetch_directory_entries(uint64_t action)
|
||||||
{
|
{
|
||||||
filebrowser_iterate(rgui->browser, action);
|
//filebrowser_iterate(rgui->browser, action);
|
||||||
|
|
||||||
mbstowcs(strw_buffer, rgui->browser->current_dir.directory_path, sizeof(strw_buffer) / sizeof(wchar_t));
|
mbstowcs(strw_buffer, rgui->browser->current_dir.directory_path, sizeof(strw_buffer) / sizeof(wchar_t));
|
||||||
XuiTextElementSetText(m_menutitle, strw_buffer);
|
XuiTextElementSetText(m_menutitle, strw_buffer);
|
||||||
@ -251,10 +251,12 @@ HRESULT CRetroArchFileBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled
|
|||||||
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
||||||
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
|
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
|
||||||
|
|
||||||
|
#if 0
|
||||||
filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions,
|
filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions,
|
||||||
default_paths.filebrowser_startup_dir);
|
default_paths.filebrowser_startup_dir);
|
||||||
|
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -277,8 +279,10 @@ HRESULT CRetroArchFileBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
|
|||||||
else if(rgui->browser->list->elems[index].attr.b)
|
else if(rgui->browser->list->elems[index].attr.b)
|
||||||
{
|
{
|
||||||
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
|
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
|
||||||
|
#if 0
|
||||||
filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions, path);
|
filebrowser_set_root_and_ext(rgui->browser, rgui->info.valid_extensions, path);
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1000,8 +1004,10 @@ HRESULT CRetroArchShaderBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandl
|
|||||||
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
||||||
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
|
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
|
||||||
|
|
||||||
|
#if 0
|
||||||
filebrowser_set_root_and_ext(rgui->browser, "cg", "game:\\media\\shaders");
|
filebrowser_set_root_and_ext(rgui->browser, "cg", "game:\\media\\shaders");
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1020,8 +1026,10 @@ HRESULT CRetroArchShaderBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHand
|
|||||||
{
|
{
|
||||||
wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer));
|
wcstombs(str_buffer, (const wchar_t *)XuiListGetText(m_menulist, index), sizeof(str_buffer));
|
||||||
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
|
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
|
||||||
|
#if 0
|
||||||
filebrowser_set_root_and_ext(rgui->browser, "cg", path);
|
filebrowser_set_root_and_ext(rgui->browser, "cg", path);
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1036,8 +1044,10 @@ HRESULT CRetroArchCoreBrowser::OnInit(XUIMessageInit * pInitData, BOOL& bHandled
|
|||||||
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
GetChildById(L"XuiTxtTitle", &m_menutitle);
|
||||||
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
|
GetChildById(L"XuiTxtBottom", &m_menutitlebottom);
|
||||||
|
|
||||||
|
#if 0
|
||||||
filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", "game:");
|
filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", "game:");
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1063,8 +1073,10 @@ HRESULT CRetroArchCoreBrowser::OnNotifyPress( HXUIOBJ hObjPressed, BOOL& bHandle
|
|||||||
else if (rgui->browser->list->elems[index].attr.b)
|
else if (rgui->browser->list->elems[index].attr.b)
|
||||||
{
|
{
|
||||||
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
|
fill_pathname_join(path, rgui->browser->current_dir.directory_path, str_buffer, sizeof(path));
|
||||||
|
#if 0
|
||||||
filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", path);
|
filebrowser_set_root_and_ext(rgui->browser, "xex|XEX", path);
|
||||||
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
filebrowser_fetch_directory_entries(RGUI_ACTION_OK);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,8 @@ extern void system_exec_wii(const char *path, bool should_load_game);
|
|||||||
#include <fat.h>
|
#include <fat.h>
|
||||||
|
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
|
char config_path[512];
|
||||||
|
char libretro_path[512];
|
||||||
|
|
||||||
static void find_and_set_first_file(void)
|
static void find_and_set_first_file(void)
|
||||||
{
|
{
|
||||||
@ -60,7 +62,7 @@ static void find_and_set_first_file(void)
|
|||||||
default_paths.core_dir, "dol");
|
default_paths.core_dir, "dol");
|
||||||
|
|
||||||
if(first_file[0])
|
if(first_file[0])
|
||||||
strlcpy(default_paths.libretro_path, first_file, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, first_file, sizeof(libretro_path));
|
||||||
else
|
else
|
||||||
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
||||||
}
|
}
|
||||||
@ -70,7 +72,7 @@ static void salamander_init_settings(void)
|
|||||||
char tmp_str[512] = {0};
|
char tmp_str[512] = {0};
|
||||||
bool config_file_exists;
|
bool config_file_exists;
|
||||||
|
|
||||||
if (path_file_exists(default_paths.config_path))
|
if (path_file_exists(config_path))
|
||||||
config_file_exists = true;
|
config_file_exists = true;
|
||||||
|
|
||||||
//try to find CORE executable
|
//try to find CORE executable
|
||||||
@ -80,36 +82,36 @@ static void salamander_init_settings(void)
|
|||||||
if(path_file_exists(core_executable))
|
if(path_file_exists(core_executable))
|
||||||
{
|
{
|
||||||
//Start CORE executable
|
//Start CORE executable
|
||||||
strlcpy(default_paths.libretro_path, core_executable, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, core_executable, sizeof(libretro_path));
|
||||||
RARCH_LOG("Start [%s].\n", default_paths.libretro_path);
|
RARCH_LOG("Start [%s].\n", libretro_path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(config_file_exists)
|
if(config_file_exists)
|
||||||
{
|
{
|
||||||
config_file_t * conf = config_file_new(default_paths.config_path);
|
config_file_t * conf = config_file_new(config_path);
|
||||||
if (!conf) // stupid libfat bug or something; somtimes it says the file is there when it doesn't
|
if (!conf) // stupid libfat bug or something; somtimes it says the file is there when it doesn't
|
||||||
config_file_exists = false;
|
config_file_exists = false;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
strlcpy(default_paths.libretro_path, tmp_str, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, tmp_str, sizeof(libretro_path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!config_file_exists || !strcmp(default_paths.libretro_path, ""))
|
if(!config_file_exists || !strcmp(libretro_path, ""))
|
||||||
find_and_set_first_file();
|
find_and_set_first_file();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", default_paths.libretro_path);
|
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config_file_exists)
|
if (!config_file_exists)
|
||||||
{
|
{
|
||||||
config_file_t *new_conf = config_file_new(NULL);
|
config_file_t *new_conf = config_file_new(NULL);
|
||||||
config_set_string(new_conf, "libretro_path", default_paths.libretro_path);
|
config_set_string(new_conf, "libretro_path", libretro_path);
|
||||||
config_file_write(new_conf, default_paths.config_path);
|
config_file_write(new_conf, config_path);
|
||||||
config_file_free(new_conf);
|
config_file_free(new_conf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -240,22 +242,19 @@ static void get_environment_settings(int argc, char *argv[], void *args)
|
|||||||
if (device_end)
|
if (device_end)
|
||||||
snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "%.*s/retroarch", device_end - default_paths.core_dir, default_paths.core_dir);
|
snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "%.*s/retroarch", device_end - default_paths.core_dir, default_paths.core_dir);
|
||||||
else
|
else
|
||||||
strlcpy(default_paths.port_dir, "/retroarch", sizeof(default_paths.port_dir));
|
fill_pathname_join(default_paths.port_dir, default_paths.port_dir, "retroarch", sizeof(default_paths.port_dir));
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
snprintf(default_paths.config_path, sizeof(default_paths.config_path), "%s/retroarch.cfg", default_paths.port_dir);
|
fill_pathname_join(config_path, default_paths.port_dir, "retroarch.cfg", sizeof(config_path));
|
||||||
#else
|
#else
|
||||||
snprintf(g_extern.config_path, sizeof(g_extern.config_path), "%s/retroarch.cfg", default_paths.port_dir);
|
fill_pathname_join(g_extern.config_path, default_paths.port_dir, "retroarch.cfg", sizeof(g_extern.config_path));
|
||||||
#endif
|
#endif
|
||||||
snprintf(default_paths.system_dir, sizeof(default_paths.system_dir), "%s/system", default_paths.port_dir);
|
fill_pathname_join(default_paths.system_dir, default_paths.port_dir, "system", sizeof(default_paths.system_dir));
|
||||||
snprintf(default_paths.sram_dir, sizeof(default_paths.savestate_dir), "%s/savefiles", default_paths.port_dir);
|
fill_pathname_join(default_paths.sram_dir, default_paths.port_dir, "savefiles", sizeof(default_paths.sram_dir));
|
||||||
snprintf(default_paths.savestate_dir, sizeof(default_paths.savestate_dir), "%s/savestates", default_paths.port_dir);
|
fill_pathname_join(default_paths.savestate_dir, default_paths.port_dir, "savefiles", sizeof(default_paths.savestate_dir));
|
||||||
strlcpy(default_paths.filesystem_root_dir, "/", sizeof(default_paths.filesystem_root_dir));
|
|
||||||
strlcpy(default_paths.filebrowser_startup_dir, default_paths.filesystem_root_dir, sizeof(default_paths.filebrowser_startup_dir));
|
|
||||||
|
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
if (argc > 2 && argv[1] != NULL && argv[2] != NULL)
|
if (argc > 2 && argv[1] != NULL && argv[2] != NULL)
|
||||||
snprintf(gx_rom_path, sizeof(gx_rom_path),
|
fill_pathname_join(gx_rom_path, argv[1], argv[2], sizeof(gx_rom_path));
|
||||||
"%s%s", argv[1], argv[2]);
|
|
||||||
else
|
else
|
||||||
gx_rom_path[0] = '\0';
|
gx_rom_path[0] = '\0';
|
||||||
#endif
|
#endif
|
||||||
@ -308,7 +307,7 @@ static void system_exec(const char *path, bool should_load_game);
|
|||||||
static void system_exitspawn(void)
|
static void system_exitspawn(void)
|
||||||
{
|
{
|
||||||
#if defined(IS_SALAMANDER)
|
#if defined(IS_SALAMANDER)
|
||||||
system_exec(default_paths.libretro_path, gx_rom_path[0] != '\0' ? true : false);
|
system_exec(libretro_path, gx_rom_path[0] != '\0' ? true : false);
|
||||||
#elif defined(HW_RVL)
|
#elif defined(HW_RVL)
|
||||||
bool should_load_game = false;
|
bool should_load_game = false;
|
||||||
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
|
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include "../../ps3/sdk_defines.h"
|
#include "../../ps3/sdk_defines.h"
|
||||||
#include "../../ps3/ps3_input.h"
|
#include "../../ps3/ps3_input.h"
|
||||||
|
#include "../menu/menu_common.h"
|
||||||
|
|
||||||
#include "../../console/rarch_console.h"
|
#include "../../console/rarch_console.h"
|
||||||
#include "../../conf/config_file.h"
|
#include "../../conf/config_file.h"
|
||||||
@ -49,6 +50,9 @@ SYS_PROCESS_PARAM(1001, 0x200000)
|
|||||||
#include <cell/pad.h>
|
#include <cell/pad.h>
|
||||||
#include <cell/sysmodule.h>
|
#include <cell/sysmodule.h>
|
||||||
|
|
||||||
|
char config_path[512];
|
||||||
|
char libretro_path[512];
|
||||||
|
|
||||||
static void find_and_set_first_file(void)
|
static void find_and_set_first_file(void)
|
||||||
{
|
{
|
||||||
//Last fallback - we'll need to start the first executable file
|
//Last fallback - we'll need to start the first executable file
|
||||||
@ -59,8 +63,8 @@ static void find_and_set_first_file(void)
|
|||||||
|
|
||||||
if(first_file)
|
if(first_file)
|
||||||
{
|
{
|
||||||
fill_pathname_join(default_paths.libretro_path, default_paths.core_dir, first_file, sizeof(default_paths.libretro_path));
|
fill_pathname_join(libretro_path, default_paths.core_dir, first_file, sizeof(libretro_path));
|
||||||
RARCH_LOG("libretro_path now set to: %s.\n", default_paths.libretro_path);
|
RARCH_LOG("libretro_path now set to: %s.\n", libretro_path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
||||||
@ -85,7 +89,7 @@ static void salamander_init_settings(void)
|
|||||||
char tmp_str[PATH_MAX];
|
char tmp_str[PATH_MAX];
|
||||||
bool config_file_exists = false;
|
bool config_file_exists = false;
|
||||||
|
|
||||||
if (path_file_exists(default_paths.config_path))
|
if (path_file_exists(config_path))
|
||||||
config_file_exists = true;
|
config_file_exists = true;
|
||||||
|
|
||||||
//try to find CORE executable
|
//try to find CORE executable
|
||||||
@ -95,29 +99,29 @@ static void salamander_init_settings(void)
|
|||||||
if(path_file_exists(core_executable))
|
if(path_file_exists(core_executable))
|
||||||
{
|
{
|
||||||
//Start CORE executable
|
//Start CORE executable
|
||||||
strlcpy(default_paths.libretro_path, core_executable, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, core_executable, sizeof(libretro_path));
|
||||||
RARCH_LOG("Start [%s].\n", default_paths.libretro_path);
|
RARCH_LOG("Start [%s].\n", libretro_path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (config_file_exists)
|
if (config_file_exists)
|
||||||
{
|
{
|
||||||
config_file_t * conf = config_file_new(default_paths.config_path);
|
config_file_t * conf = config_file_new(config_path);
|
||||||
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
strlcpy(default_paths.libretro_path, tmp_str, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, tmp_str, sizeof(libretro_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config_file_exists || !strcmp(default_paths.libretro_path, ""))
|
if (!config_file_exists || !strcmp(libretro_path, ""))
|
||||||
find_and_set_first_file();
|
find_and_set_first_file();
|
||||||
else
|
else
|
||||||
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", default_paths.libretro_path);
|
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path);
|
||||||
|
|
||||||
if (!config_file_exists)
|
if (!config_file_exists)
|
||||||
{
|
{
|
||||||
config_file_t *new_conf = config_file_new(NULL);
|
config_file_t *new_conf = config_file_new(NULL);
|
||||||
config_set_string(new_conf, "libretro_path", default_paths.libretro_path);
|
config_set_string(new_conf, "libretro_path", libretro_path);
|
||||||
config_file_write(new_conf, default_paths.config_path);
|
config_file_write(new_conf, config_path);
|
||||||
config_file_free(new_conf);
|
config_file_free(new_conf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,9 +141,6 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
|
|||||||
(void)status;
|
(void)status;
|
||||||
|
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
#ifdef HAVE_OSKUTIL
|
|
||||||
oskutil_params *osk = &rgui->oskutil_handle;
|
|
||||||
#endif
|
|
||||||
gl_t *gl = driver.video_data;
|
gl_t *gl = driver.video_data;
|
||||||
|
|
||||||
switch (status)
|
switch (status)
|
||||||
@ -148,34 +149,12 @@ static void callback_sysutil_exit(uint64_t status, uint64_t param, void *userdat
|
|||||||
gl->quitting = true;
|
gl->quitting = true;
|
||||||
g_extern.lifecycle_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_GAME));
|
g_extern.lifecycle_state &= ~((1ULL << MODE_MENU) | (1ULL << MODE_GAME));
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
case CELL_SYSUTIL_OSKDIALOG_LOADED:
|
case CELL_SYSUTIL_OSKDIALOG_LOADED:
|
||||||
break;
|
|
||||||
case CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED:
|
case CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED:
|
||||||
RARCH_LOG("CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED.\n");
|
|
||||||
pOskAbort(); //fall-through
|
|
||||||
case CELL_SYSUTIL_OSKDIALOG_FINISHED:
|
case CELL_SYSUTIL_OSKDIALOG_FINISHED:
|
||||||
if (status == CELL_SYSUTIL_OSKDIALOG_FINISHED)
|
|
||||||
RARCH_LOG("CELL_SYSUTIL_OSKDIALOG_FINISHED.\n");
|
|
||||||
|
|
||||||
pOskUnloadAsync(&osk->outputInfo);
|
|
||||||
|
|
||||||
if (osk->outputInfo.result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK)
|
|
||||||
{
|
|
||||||
RARCH_LOG("Setting MODE_OSK_ENTRY_SUCCESS.\n");
|
|
||||||
g_extern.lifecycle_state |= (1ULL << MODE_OSK_ENTRY_SUCCESS);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
RARCH_LOG("Setting MODE_OSK_ENTRY_FAIL.\n");
|
|
||||||
g_extern.lifecycle_state |= (1ULL << MODE_OSK_ENTRY_FAIL);
|
|
||||||
}
|
|
||||||
|
|
||||||
osk->flags &= ~OSK_IN_USE;
|
|
||||||
break;
|
|
||||||
case CELL_SYSUTIL_OSKDIALOG_UNLOADED:
|
case CELL_SYSUTIL_OSKDIALOG_UNLOADED:
|
||||||
RARCH_LOG("CELL_SYSUTIL_OSKDIALOG_UNLOADED.\n");
|
oskutil_lifecycle(osk, status);
|
||||||
sys_memory_container_destroy(osk->containerid);
|
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -249,7 +228,7 @@ static void get_environment_settings(int argc, char *argv[], void *args)
|
|||||||
if (g_extern.lifecycle_state & (1ULL << MODE_EXTLAUNCH_MULTIMAN))
|
if (g_extern.lifecycle_state & (1ULL << MODE_EXTLAUNCH_MULTIMAN))
|
||||||
{
|
{
|
||||||
fill_pathname_join(contentInfoPath, "/dev_hdd0/game/", EMULATOR_CONTENT_DIR, sizeof(contentInfoPath));
|
fill_pathname_join(contentInfoPath, "/dev_hdd0/game/", EMULATOR_CONTENT_DIR, sizeof(contentInfoPath));
|
||||||
snprintf(default_paths.port_dir, sizeof(default_paths.port_dir), "/dev_hdd0/game/%s/USRDIR", EMULATOR_CONTENT_DIR);
|
fill_pathname_join(default_paths.port_dir, contentInfoPath, "USRDIR", sizeof(default_paths.port_dir));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -264,21 +243,19 @@ static void get_environment_settings(int argc, char *argv[], void *args)
|
|||||||
|
|
||||||
fill_pathname_join(default_paths.core_dir, default_paths.port_dir, "cores", sizeof(default_paths.core_dir));
|
fill_pathname_join(default_paths.core_dir, default_paths.port_dir, "cores", sizeof(default_paths.core_dir));
|
||||||
fill_pathname_join(default_paths.savestate_dir, default_paths.core_dir, "savestates", sizeof(default_paths.savestate_dir));
|
fill_pathname_join(default_paths.savestate_dir, default_paths.core_dir, "savestates", sizeof(default_paths.savestate_dir));
|
||||||
strlcpy(default_paths.filesystem_root_dir, "/", sizeof(default_paths.filesystem_root_dir));
|
|
||||||
strlcpy(default_paths.filebrowser_startup_dir, default_paths.filesystem_root_dir, sizeof(default_paths.filebrowser_startup_dir));
|
|
||||||
fill_pathname_join(default_paths.sram_dir, default_paths.core_dir, "savefiles", sizeof(default_paths.sram_dir));
|
fill_pathname_join(default_paths.sram_dir, default_paths.core_dir, "savefiles", sizeof(default_paths.sram_dir));
|
||||||
fill_pathname_join(default_paths.system_dir, default_paths.core_dir, "system", sizeof(default_paths.system_dir));
|
fill_pathname_join(default_paths.system_dir, default_paths.core_dir, "system", sizeof(default_paths.system_dir));
|
||||||
|
|
||||||
/* now we fill in all the variables */
|
/* now we fill in all the variables */
|
||||||
fill_pathname_join(default_paths.menu_border_file, default_paths.core_dir, "borders/Menu/main-menu_1080p.png", sizeof(default_paths.menu_border_file));
|
|
||||||
fill_pathname_join(default_paths.border_dir, default_paths.core_dir, "borders", sizeof(default_paths.border_dir));
|
|
||||||
#if defined(HAVE_CG) || defined(HAVE_GLSL)
|
#if defined(HAVE_CG) || defined(HAVE_GLSL)
|
||||||
fill_pathname_join(g_settings.video.shader_dir, default_paths.core_dir, "shaders", sizeof(g_settings.video.shader_dir));
|
fill_pathname_join(g_settings.video.shader_dir, default_paths.core_dir, "shaders", sizeof(g_settings.video.shader_dir));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
fill_pathname_join(default_paths.config_path, default_paths.port_dir, "retroarch.cfg", sizeof(default_paths.config_path));
|
fill_pathname_join(config_path, default_paths.port_dir, "retroarch.cfg", sizeof(config_path));
|
||||||
#else
|
#else
|
||||||
|
fill_pathname_join(g_extern.menu_texture_path, default_paths.core_dir, "borders/Menu/main-menu_1080p.png",
|
||||||
|
sizeof(g_extern.menu_texture_path));
|
||||||
fill_pathname_join(g_extern.config_path, default_paths.port_dir, "retroarch.cfg", sizeof(g_extern.config_path));
|
fill_pathname_join(g_extern.config_path, default_paths.port_dir, "retroarch.cfg", sizeof(g_extern.config_path));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -395,7 +372,7 @@ static void system_exitspawn(void)
|
|||||||
#ifdef HAVE_RARCH_EXEC
|
#ifdef HAVE_RARCH_EXEC
|
||||||
|
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
system_exec(default_paths.libretro_path, false);
|
system_exec(libretro_path, false);
|
||||||
|
|
||||||
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_GAME);
|
||||||
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
cellSysmoduleLoadModule(CELL_SYSMODULE_FS);
|
||||||
|
@ -57,18 +57,13 @@ static void get_environment_settings(int argc, char *argv[])
|
|||||||
fill_pathname_basedir(default_paths.port_dir, argv[0], sizeof(default_paths.port_dir));
|
fill_pathname_basedir(default_paths.port_dir, argv[0], sizeof(default_paths.port_dir));
|
||||||
RARCH_LOG("port dir: [%s]\n", default_paths.port_dir);
|
RARCH_LOG("port dir: [%s]\n", default_paths.port_dir);
|
||||||
|
|
||||||
snprintf(default_paths.core_dir, sizeof(default_paths.core_dir), "%s/cores", default_paths.port_dir);
|
fill_pathname_join(default_paths.core_dir, default_paths.port_dir, "cores", sizeof(default_paths.core_dir));
|
||||||
snprintf(default_paths.savestate_dir, sizeof(default_paths.savestate_dir), "%s/savestates", default_paths.core_dir);
|
fill_pathname_join(default_paths.savestate_dir, default_paths.core_dir, "savestates", sizeof(default_paths.savestate_dir));
|
||||||
snprintf(default_paths.filesystem_root_dir, sizeof(default_paths.filesystem_root_dir), "/");
|
fill_pathname_join(default_paths.sram_dir, default_paths.core_dir, "savefiles", sizeof(default_paths.sram_dir));
|
||||||
snprintf(default_paths.filebrowser_startup_dir, sizeof(default_paths.filebrowser_startup_dir), default_paths.filesystem_root_dir);
|
fill_pathname_join(default_paths.system_dir, default_paths.core_dir, "system", sizeof(default_paths.system_dir));
|
||||||
snprintf(default_paths.sram_dir, sizeof(default_paths.sram_dir), "%s/savefiles", default_paths.core_dir);
|
|
||||||
|
|
||||||
snprintf(default_paths.system_dir, sizeof(default_paths.system_dir), "%s/system", default_paths.core_dir);
|
|
||||||
|
|
||||||
/* now we fill in all the variables */
|
/* now we fill in all the variables */
|
||||||
snprintf(default_paths.menu_border_file, sizeof(default_paths.menu_border_file), "%s/borders/Menu/main-menu.png", default_paths.core_dir);
|
fill_pathname_join(g_extern.config_path, default_paths.port_dir, "retroarch.cfg", sizeof(g_extern.config_path));
|
||||||
snprintf(default_paths.border_dir, sizeof(default_paths.border_dir), "%s/borders", default_paths.core_dir);
|
|
||||||
snprintf(g_extern.config_path, sizeof(g_extern.config_path), "%s/retroarch.cfg", default_paths.port_dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int callback_thread(SceSize args, void *argp)
|
int callback_thread(SceSize args, void *argp)
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
|
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
|
char config_path[512];
|
||||||
|
char libretro_path[512];
|
||||||
|
|
||||||
static void find_and_set_first_file(void)
|
static void find_and_set_first_file(void)
|
||||||
{
|
{
|
||||||
@ -49,11 +51,11 @@ static void find_and_set_first_file(void)
|
|||||||
if(first_file)
|
if(first_file)
|
||||||
{
|
{
|
||||||
#ifdef _XBOX1
|
#ifdef _XBOX1
|
||||||
fill_pathname_join(default_paths.libretro_path, "D:", first_file, sizeof(default_paths.libretro_path));
|
fill_pathname_join(libretro_path, "D:", first_file, sizeof(libretro_path));
|
||||||
#else
|
#else
|
||||||
strlcpy(default_paths.libretro_path, first_file, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, first_file, sizeof(libretro_path));
|
||||||
#endif
|
#endif
|
||||||
RARCH_LOG("libretro_path now set to: %s.\n", default_paths.libretro_path);
|
RARCH_LOG("libretro_path now set to: %s.\n", libretro_path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
RARCH_ERR("Failed last fallback - RetroArch Salamander will exit.\n");
|
||||||
@ -81,7 +83,7 @@ static void salamander_init_settings(void)
|
|||||||
char tmp_str[PATH_MAX];
|
char tmp_str[PATH_MAX];
|
||||||
bool config_file_exists = false;
|
bool config_file_exists = false;
|
||||||
|
|
||||||
if(path_file_exists(default_paths.config_path))
|
if(path_file_exists(config_path))
|
||||||
config_file_exists = true;
|
config_file_exists = true;
|
||||||
|
|
||||||
//try to find CORE executable
|
//try to find CORE executable
|
||||||
@ -95,32 +97,32 @@ static void salamander_init_settings(void)
|
|||||||
if(path_file_exists(core_executable))
|
if(path_file_exists(core_executable))
|
||||||
{
|
{
|
||||||
//Start CORE executable
|
//Start CORE executable
|
||||||
strlcpy(default_paths.libretro_path, core_executable, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, core_executable, sizeof(libretro_path));
|
||||||
RARCH_LOG("Start [%s].\n", default_paths.libretro_path);
|
RARCH_LOG("Start [%s].\n", libretro_path);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(config_file_exists)
|
if(config_file_exists)
|
||||||
{
|
{
|
||||||
config_file_t * conf = config_file_new(default_paths.config_path);
|
config_file_t * conf = config_file_new(config_path);
|
||||||
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
config_get_array(conf, "libretro_path", tmp_str, sizeof(tmp_str));
|
||||||
strlcpy(default_paths.libretro_path, tmp_str, sizeof(default_paths.libretro_path));
|
strlcpy(libretro_path, tmp_str, sizeof(libretro_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!config_file_exists || !strcmp(default_paths.libretro_path, ""))
|
if(!config_file_exists || !strcmp(libretro_path, ""))
|
||||||
{
|
{
|
||||||
find_and_set_first_file();
|
find_and_set_first_file();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", default_paths.libretro_path);
|
RARCH_LOG("Start [%s] found in retroarch.cfg.\n", libretro_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config_file_exists)
|
if (!config_file_exists)
|
||||||
{
|
{
|
||||||
config_file_t *new_conf = config_file_new(NULL);
|
config_file_t *new_conf = config_file_new(NULL);
|
||||||
config_set_string(new_conf, "libretro_path", default_paths.libretro_path);
|
config_set_string(new_conf, "libretro_path", libretro_path);
|
||||||
config_file_write(new_conf, default_paths.config_path);
|
config_file_write(new_conf, config_path);
|
||||||
config_file_free(new_conf);
|
config_file_free(new_conf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,24 +226,21 @@ static void get_environment_settings(int argc, char *argv[], void *args)
|
|||||||
#if defined(_XBOX1)
|
#if defined(_XBOX1)
|
||||||
strlcpy(default_paths.core_dir, "D:", sizeof(default_paths.core_dir));
|
strlcpy(default_paths.core_dir, "D:", sizeof(default_paths.core_dir));
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
fill_pathname_join(default_paths.config_path, default_paths.core_dir, "retroarch.cfg", sizeof(default_paths.config_path));
|
fill_pathname_join(config_path, default_paths.core_dir, "retroarch.cfg", sizeof(config_path));
|
||||||
#else
|
#else
|
||||||
fill_pathname_join(g_extern.config_path, default_paths.core_dir, "retroarch.cfg", sizeof(g_extern.config_path));
|
fill_pathname_join(g_extern.config_path, default_paths.core_dir, "retroarch.cfg", sizeof(g_extern.config_path));
|
||||||
#endif
|
#endif
|
||||||
fill_pathname_join(default_paths.savestate_dir, default_paths.core_dir, "savestates", sizeof(default_paths.savestate_dir));
|
fill_pathname_join(default_paths.savestate_dir, default_paths.core_dir, "savestates", sizeof(default_paths.savestate_dir));
|
||||||
fill_pathname_join(default_paths.sram_dir, default_paths.core_dir, "savefiles", sizeof(default_paths.sram_dir));
|
fill_pathname_join(default_paths.sram_dir, default_paths.core_dir, "savefiles", sizeof(default_paths.sram_dir));
|
||||||
fill_pathname_join(default_paths.system_dir, default_paths.core_dir, "system", sizeof(default_paths.system_dir));
|
fill_pathname_join(default_paths.system_dir, default_paths.core_dir, "system", sizeof(default_paths.system_dir));
|
||||||
strlcpy(default_paths.filesystem_root_dir, default_paths.core_dir, sizeof(default_paths.filesystem_root_dir));
|
|
||||||
strlcpy(default_paths.filebrowser_startup_dir, default_paths.core_dir, sizeof(default_paths.filebrowser_startup_dir));
|
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
fill_pathname_join(g_settings.screenshot_directory, default_paths.core_dir, "screenshots", sizeof(g_settings.screenshot_directory));
|
fill_pathname_join(g_settings.screenshot_directory, default_paths.core_dir, "screenshots", sizeof(g_settings.screenshot_directory));
|
||||||
|
strlcpy(g_extern.menu_texture_path, "D:\\Media\\main-menu_480p.png", sizeof(g_extern.menu_texture_path));
|
||||||
#endif
|
#endif
|
||||||
strlcpy(default_paths.menu_border_file, "D:\\Media\\main-menu_480p.png", sizeof(default_paths.menu_border_file));
|
|
||||||
#elif defined(_XBOX360)
|
#elif defined(_XBOX360)
|
||||||
strlcpy(default_paths.core_dir, "game:", sizeof(default_paths.core_dir));
|
strlcpy(default_paths.core_dir, "game:", sizeof(default_paths.core_dir));
|
||||||
strlcpy(default_paths.filesystem_root_dir, "game:\\", sizeof(default_paths.filesystem_root_dir));
|
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
strlcpy(default_paths.config_path, "game:\\retroarch.cfg", sizeof(default_paths.config_path));
|
strlcpy(config_path, "game:\\retroarch.cfg", sizeof(config_path));
|
||||||
#else
|
#else
|
||||||
strlcpy(g_settings.screenshot_directory, "game:", sizeof(g_settings.screenshot_directory));
|
strlcpy(g_settings.screenshot_directory, "game:", sizeof(g_settings.screenshot_directory));
|
||||||
strlcpy(g_extern.config_path, "game:\\retroarch.cfg", sizeof(g_extern.config_path));
|
strlcpy(g_extern.config_path, "game:\\retroarch.cfg", sizeof(g_extern.config_path));
|
||||||
@ -249,7 +248,6 @@ static void get_environment_settings(int argc, char *argv[], void *args)
|
|||||||
strlcpy(default_paths.savestate_dir, "game:\\savestates", sizeof(default_paths.savestate_dir));
|
strlcpy(default_paths.savestate_dir, "game:\\savestates", sizeof(default_paths.savestate_dir));
|
||||||
strlcpy(default_paths.sram_dir, "game:\\savefiles", sizeof(default_paths.sram_dir));
|
strlcpy(default_paths.sram_dir, "game:\\savefiles", sizeof(default_paths.sram_dir));
|
||||||
strlcpy(default_paths.system_dir, "game:\\system", sizeof(default_paths.system_dir));
|
strlcpy(default_paths.system_dir, "game:\\system", sizeof(default_paths.system_dir));
|
||||||
strlcpy(default_paths.filebrowser_startup_dir, "game:", sizeof(default_paths.filebrowser_startup_dir));
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -309,7 +307,7 @@ static void system_exec(const char *path, bool should_load_game);
|
|||||||
static void system_exitspawn(void)
|
static void system_exitspawn(void)
|
||||||
{
|
{
|
||||||
#ifdef IS_SALAMANDER
|
#ifdef IS_SALAMANDER
|
||||||
system_exec(default_paths.libretro_path, false);
|
system_exec(libretro_path, false);
|
||||||
#else
|
#else
|
||||||
bool should_load_game = false;
|
bool should_load_game = false;
|
||||||
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
|
if (g_extern.lifecycle_state & (1ULL << MODE_EXITSPAWN_START_GAME))
|
||||||
|
64
general.h
64
general.h
@ -185,6 +185,16 @@ struct settings
|
|||||||
bool allow_rotate;
|
bool allow_rotate;
|
||||||
} video;
|
} video;
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
char driver[32];
|
||||||
|
char device[PATH_MAX];
|
||||||
|
unsigned width;
|
||||||
|
unsigned height;
|
||||||
|
} camera;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
char driver[32];
|
char driver[32];
|
||||||
@ -309,6 +319,9 @@ struct global
|
|||||||
bool verbose;
|
bool verbose;
|
||||||
bool audio_active;
|
bool audio_active;
|
||||||
bool video_active;
|
bool video_active;
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
bool camera_active;
|
||||||
|
#endif
|
||||||
bool force_fullscreen;
|
bool force_fullscreen;
|
||||||
|
|
||||||
bool rom_file_temporary;
|
bool rom_file_temporary;
|
||||||
@ -392,6 +405,7 @@ struct global
|
|||||||
|
|
||||||
struct retro_disk_control_callback disk_control;
|
struct retro_disk_control_callback disk_control;
|
||||||
struct retro_hw_render_callback hw_render_callback;
|
struct retro_hw_render_callback hw_render_callback;
|
||||||
|
struct retro_camera_callback camera_callback;
|
||||||
|
|
||||||
struct retro_frame_time_callback frame_time;
|
struct retro_frame_time_callback frame_time;
|
||||||
retro_usec_t frame_time_last;
|
retro_usec_t frame_time_last;
|
||||||
@ -618,59 +632,15 @@ struct rarch_main_wrap
|
|||||||
bool no_rom;
|
bool no_rom;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
S_ASPECT_RATIO_DECREMENT = 0,
|
|
||||||
S_ASPECT_RATIO_INCREMENT,
|
|
||||||
S_SCALE_INTEGER_TOGGLE,
|
|
||||||
S_AUDIO_MUTE,
|
|
||||||
S_AUDIO_CONTROL_RATE_DECREMENT,
|
|
||||||
S_AUDIO_CONTROL_RATE_INCREMENT,
|
|
||||||
S_HW_TEXTURE_FILTER,
|
|
||||||
S_RESOLUTION_PREVIOUS,
|
|
||||||
S_RESOLUTION_NEXT,
|
|
||||||
S_ROTATION_DECREMENT,
|
|
||||||
S_ROTATION_INCREMENT,
|
|
||||||
S_REWIND,
|
|
||||||
S_SAVESTATE_DECREMENT,
|
|
||||||
S_SAVESTATE_INCREMENT,
|
|
||||||
S_TRIPLE_BUFFERING,
|
|
||||||
S_REFRESH_RATE_DECREMENT,
|
|
||||||
S_REFRESH_RATE_INCREMENT,
|
|
||||||
S_INFO_DEBUG_MSG_TOGGLE,
|
|
||||||
S_INFO_MSG_TOGGLE,
|
|
||||||
S_INPUT_OVERLAY_OPACITY_DECREMENT,
|
|
||||||
S_INPUT_OVERLAY_OPACITY_INCREMENT,
|
|
||||||
S_INPUT_OVERLAY_SCALE_DECREMENT,
|
|
||||||
S_INPUT_OVERLAY_SCALE_INCREMENT,
|
|
||||||
S_VIDEO_VSYNC_TOGGLE,
|
|
||||||
S_VIDEO_FULLSCREEN_TOGGLE,
|
|
||||||
S_REWIND_GRANULARITY_DECREMENT,
|
|
||||||
S_REWIND_GRANULARITY_INCREMENT,
|
|
||||||
S_DEF_REWIND_GRANULARITY,
|
|
||||||
S_DEF_ASPECT_RATIO,
|
|
||||||
S_DEF_VIDEO_VSYNC,
|
|
||||||
S_DEF_INPUT_OVERLAY_OPACITY,
|
|
||||||
S_DEF_INPUT_OVERLAY_SCALE,
|
|
||||||
S_DEF_SCALE_INTEGER,
|
|
||||||
S_DEF_AUDIO_MUTE,
|
|
||||||
S_DEF_AUDIO_CONTROL_RATE,
|
|
||||||
S_DEF_HW_TEXTURE_FILTER,
|
|
||||||
S_DEF_ROTATION,
|
|
||||||
S_DEF_TRIPLE_BUFFERING,
|
|
||||||
S_DEF_SAVE_STATE,
|
|
||||||
S_DEF_REFRESH_RATE,
|
|
||||||
S_DEF_INFO_DEBUG_MSG,
|
|
||||||
S_DEF_INFO_MSG,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Public functions
|
// Public functions
|
||||||
void config_load(void);
|
void config_load(void);
|
||||||
void config_set_defaults(void);
|
void config_set_defaults(void);
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
const char *config_get_default_camera(void);
|
||||||
|
#endif
|
||||||
const char *config_get_default_video(void);
|
const char *config_get_default_video(void);
|
||||||
const char *config_get_default_audio(void);
|
const char *config_get_default_audio(void);
|
||||||
const char *config_get_default_input(void);
|
const char *config_get_default_input(void);
|
||||||
void settings_set(uint64_t settings);
|
|
||||||
|
|
||||||
#include "conf/config_file.h"
|
#include "conf/config_file.h"
|
||||||
bool config_load_file(const char *path);
|
bool config_load_file(const char *path);
|
||||||
|
@ -220,10 +220,6 @@ static void gfx_ctx_xdk_destroy(void)
|
|||||||
{
|
{
|
||||||
xdk_d3d_video_t * d3d = (xdk_d3d_video_t*)driver.video_data;
|
xdk_d3d_video_t * d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||||
|
|
||||||
#ifdef HAVE_MENU
|
|
||||||
texture_image_free(&d3d->rgui_texture);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (d3d->d3d_render_device)
|
if (d3d->d3d_render_device)
|
||||||
{
|
{
|
||||||
d3d->d3d_render_device->Release();
|
d3d->d3d_render_device->Release();
|
||||||
|
@ -311,8 +311,10 @@ const struct rglgen_sym_map rglgen_symbol_map[] = {
|
|||||||
SYM(DrawElementsInstanced),
|
SYM(DrawElementsInstanced),
|
||||||
SYM(TexBuffer),
|
SYM(TexBuffer),
|
||||||
SYM(PrimitiveRestartIndex),
|
SYM(PrimitiveRestartIndex),
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
SYM(GetInteger64i_v),
|
SYM(GetInteger64i_v),
|
||||||
SYM(GetBufferParameteri64v),
|
SYM(GetBufferParameteri64v),
|
||||||
|
#endif
|
||||||
SYM(FramebufferTexture),
|
SYM(FramebufferTexture),
|
||||||
SYM(VertexAttribDivisor),
|
SYM(VertexAttribDivisor),
|
||||||
SYM(MinSampleShading),
|
SYM(MinSampleShading),
|
||||||
@ -571,6 +573,7 @@ const struct rglgen_sym_map rglgen_symbol_map[] = {
|
|||||||
SYM(DrawElementsInstancedBaseVertex),
|
SYM(DrawElementsInstancedBaseVertex),
|
||||||
SYM(MultiDrawElementsBaseVertex),
|
SYM(MultiDrawElementsBaseVertex),
|
||||||
SYM(ProvokingVertex),
|
SYM(ProvokingVertex),
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
SYM(FenceSync),
|
SYM(FenceSync),
|
||||||
SYM(IsSync),
|
SYM(IsSync),
|
||||||
SYM(DeleteSync),
|
SYM(DeleteSync),
|
||||||
@ -578,6 +581,7 @@ const struct rglgen_sym_map rglgen_symbol_map[] = {
|
|||||||
SYM(WaitSync),
|
SYM(WaitSync),
|
||||||
SYM(GetInteger64v),
|
SYM(GetInteger64v),
|
||||||
SYM(GetSynciv),
|
SYM(GetSynciv),
|
||||||
|
#endif
|
||||||
SYM(TexImage2DMultisample),
|
SYM(TexImage2DMultisample),
|
||||||
SYM(TexImage3DMultisample),
|
SYM(TexImage3DMultisample),
|
||||||
SYM(GetMultisamplefv),
|
SYM(GetMultisamplefv),
|
||||||
@ -610,8 +614,10 @@ const struct rglgen_sym_map rglgen_symbol_map[] = {
|
|||||||
SYM(GetSamplerParameterfv),
|
SYM(GetSamplerParameterfv),
|
||||||
SYM(GetSamplerParameterIuiv),
|
SYM(GetSamplerParameterIuiv),
|
||||||
SYM(QueryCounter),
|
SYM(QueryCounter),
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
SYM(GetQueryObjecti64v),
|
SYM(GetQueryObjecti64v),
|
||||||
SYM(GetQueryObjectui64v),
|
SYM(GetQueryObjectui64v),
|
||||||
|
#endif
|
||||||
SYM(VertexP2ui),
|
SYM(VertexP2ui),
|
||||||
SYM(VertexP2uiv),
|
SYM(VertexP2uiv),
|
||||||
SYM(VertexP3ui),
|
SYM(VertexP3ui),
|
||||||
@ -779,8 +785,10 @@ const struct rglgen_sym_map rglgen_symbol_map[] = {
|
|||||||
SYM(DepthRangeIndexed),
|
SYM(DepthRangeIndexed),
|
||||||
SYM(GetFloati_v),
|
SYM(GetFloati_v),
|
||||||
SYM(GetDoublei_v),
|
SYM(GetDoublei_v),
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
SYM(CreateSyncFromCLeventARB),
|
SYM(CreateSyncFromCLeventARB),
|
||||||
SYM(DebugMessageControlARB),
|
SYM(DebugMessageControlARB),
|
||||||
|
#endif
|
||||||
SYM(DebugMessageInsertARB),
|
SYM(DebugMessageInsertARB),
|
||||||
SYM(DebugMessageCallbackARB),
|
SYM(DebugMessageCallbackARB),
|
||||||
SYM(GetDebugMessageLogARB),
|
SYM(GetDebugMessageLogARB),
|
||||||
@ -840,7 +848,9 @@ const struct rglgen_sym_map rglgen_symbol_map[] = {
|
|||||||
SYM(VertexBindingDivisor),
|
SYM(VertexBindingDivisor),
|
||||||
SYM(FramebufferParameteri),
|
SYM(FramebufferParameteri),
|
||||||
SYM(GetFramebufferParameteriv),
|
SYM(GetFramebufferParameteriv),
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
SYM(GetInternalformati64v),
|
SYM(GetInternalformati64v),
|
||||||
|
#endif
|
||||||
SYM(InvalidateTexSubImage),
|
SYM(InvalidateTexSubImage),
|
||||||
SYM(InvalidateTexImage),
|
SYM(InvalidateTexImage),
|
||||||
SYM(InvalidateBufferSubData),
|
SYM(InvalidateBufferSubData),
|
||||||
@ -1310,8 +1320,10 @@ RGLSYMGLDRAWARRAYSINSTANCEDPROC __rglgen_glDrawArraysInstanced;
|
|||||||
RGLSYMGLDRAWELEMENTSINSTANCEDPROC __rglgen_glDrawElementsInstanced;
|
RGLSYMGLDRAWELEMENTSINSTANCEDPROC __rglgen_glDrawElementsInstanced;
|
||||||
RGLSYMGLTEXBUFFERPROC __rglgen_glTexBuffer;
|
RGLSYMGLTEXBUFFERPROC __rglgen_glTexBuffer;
|
||||||
RGLSYMGLPRIMITIVERESTARTINDEXPROC __rglgen_glPrimitiveRestartIndex;
|
RGLSYMGLPRIMITIVERESTARTINDEXPROC __rglgen_glPrimitiveRestartIndex;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
RGLSYMGLGETINTEGER64I_VPROC __rglgen_glGetInteger64i_v;
|
RGLSYMGLGETINTEGER64I_VPROC __rglgen_glGetInteger64i_v;
|
||||||
RGLSYMGLGETBUFFERPARAMETERI64VPROC __rglgen_glGetBufferParameteri64v;
|
RGLSYMGLGETBUFFERPARAMETERI64VPROC __rglgen_glGetBufferParameteri64v;
|
||||||
|
#endif
|
||||||
RGLSYMGLFRAMEBUFFERTEXTUREPROC __rglgen_glFramebufferTexture;
|
RGLSYMGLFRAMEBUFFERTEXTUREPROC __rglgen_glFramebufferTexture;
|
||||||
RGLSYMGLVERTEXATTRIBDIVISORPROC __rglgen_glVertexAttribDivisor;
|
RGLSYMGLVERTEXATTRIBDIVISORPROC __rglgen_glVertexAttribDivisor;
|
||||||
RGLSYMGLMINSAMPLESHADINGPROC __rglgen_glMinSampleShading;
|
RGLSYMGLMINSAMPLESHADINGPROC __rglgen_glMinSampleShading;
|
||||||
@ -1570,6 +1582,7 @@ RGLSYMGLDRAWRANGEELEMENTSBASEVERTEXPROC __rglgen_glDrawRangeElementsBaseVertex;
|
|||||||
RGLSYMGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __rglgen_glDrawElementsInstancedBaseVertex;
|
RGLSYMGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __rglgen_glDrawElementsInstancedBaseVertex;
|
||||||
RGLSYMGLMULTIDRAWELEMENTSBASEVERTEXPROC __rglgen_glMultiDrawElementsBaseVertex;
|
RGLSYMGLMULTIDRAWELEMENTSBASEVERTEXPROC __rglgen_glMultiDrawElementsBaseVertex;
|
||||||
RGLSYMGLPROVOKINGVERTEXPROC __rglgen_glProvokingVertex;
|
RGLSYMGLPROVOKINGVERTEXPROC __rglgen_glProvokingVertex;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
RGLSYMGLFENCESYNCPROC __rglgen_glFenceSync;
|
RGLSYMGLFENCESYNCPROC __rglgen_glFenceSync;
|
||||||
RGLSYMGLISSYNCPROC __rglgen_glIsSync;
|
RGLSYMGLISSYNCPROC __rglgen_glIsSync;
|
||||||
RGLSYMGLDELETESYNCPROC __rglgen_glDeleteSync;
|
RGLSYMGLDELETESYNCPROC __rglgen_glDeleteSync;
|
||||||
@ -1577,6 +1590,7 @@ RGLSYMGLCLIENTWAITSYNCPROC __rglgen_glClientWaitSync;
|
|||||||
RGLSYMGLWAITSYNCPROC __rglgen_glWaitSync;
|
RGLSYMGLWAITSYNCPROC __rglgen_glWaitSync;
|
||||||
RGLSYMGLGETINTEGER64VPROC __rglgen_glGetInteger64v;
|
RGLSYMGLGETINTEGER64VPROC __rglgen_glGetInteger64v;
|
||||||
RGLSYMGLGETSYNCIVPROC __rglgen_glGetSynciv;
|
RGLSYMGLGETSYNCIVPROC __rglgen_glGetSynciv;
|
||||||
|
#endif
|
||||||
RGLSYMGLTEXIMAGE2DMULTISAMPLEPROC __rglgen_glTexImage2DMultisample;
|
RGLSYMGLTEXIMAGE2DMULTISAMPLEPROC __rglgen_glTexImage2DMultisample;
|
||||||
RGLSYMGLTEXIMAGE3DMULTISAMPLEPROC __rglgen_glTexImage3DMultisample;
|
RGLSYMGLTEXIMAGE3DMULTISAMPLEPROC __rglgen_glTexImage3DMultisample;
|
||||||
RGLSYMGLGETMULTISAMPLEFVPROC __rglgen_glGetMultisamplefv;
|
RGLSYMGLGETMULTISAMPLEFVPROC __rglgen_glGetMultisamplefv;
|
||||||
@ -1609,8 +1623,10 @@ RGLSYMGLGETSAMPLERPARAMETERIIVPROC __rglgen_glGetSamplerParameterIiv;
|
|||||||
RGLSYMGLGETSAMPLERPARAMETERFVPROC __rglgen_glGetSamplerParameterfv;
|
RGLSYMGLGETSAMPLERPARAMETERFVPROC __rglgen_glGetSamplerParameterfv;
|
||||||
RGLSYMGLGETSAMPLERPARAMETERIUIVPROC __rglgen_glGetSamplerParameterIuiv;
|
RGLSYMGLGETSAMPLERPARAMETERIUIVPROC __rglgen_glGetSamplerParameterIuiv;
|
||||||
RGLSYMGLQUERYCOUNTERPROC __rglgen_glQueryCounter;
|
RGLSYMGLQUERYCOUNTERPROC __rglgen_glQueryCounter;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
RGLSYMGLGETQUERYOBJECTI64VPROC __rglgen_glGetQueryObjecti64v;
|
RGLSYMGLGETQUERYOBJECTI64VPROC __rglgen_glGetQueryObjecti64v;
|
||||||
RGLSYMGLGETQUERYOBJECTUI64VPROC __rglgen_glGetQueryObjectui64v;
|
RGLSYMGLGETQUERYOBJECTUI64VPROC __rglgen_glGetQueryObjectui64v;
|
||||||
|
#endif
|
||||||
RGLSYMGLVERTEXP2UIPROC __rglgen_glVertexP2ui;
|
RGLSYMGLVERTEXP2UIPROC __rglgen_glVertexP2ui;
|
||||||
RGLSYMGLVERTEXP2UIVPROC __rglgen_glVertexP2uiv;
|
RGLSYMGLVERTEXP2UIVPROC __rglgen_glVertexP2uiv;
|
||||||
RGLSYMGLVERTEXP3UIPROC __rglgen_glVertexP3ui;
|
RGLSYMGLVERTEXP3UIPROC __rglgen_glVertexP3ui;
|
||||||
@ -1778,7 +1794,9 @@ RGLSYMGLDEPTHRANGEARRAYVPROC __rglgen_glDepthRangeArrayv;
|
|||||||
RGLSYMGLDEPTHRANGEINDEXEDPROC __rglgen_glDepthRangeIndexed;
|
RGLSYMGLDEPTHRANGEINDEXEDPROC __rglgen_glDepthRangeIndexed;
|
||||||
RGLSYMGLGETFLOATI_VPROC __rglgen_glGetFloati_v;
|
RGLSYMGLGETFLOATI_VPROC __rglgen_glGetFloati_v;
|
||||||
RGLSYMGLGETDOUBLEI_VPROC __rglgen_glGetDoublei_v;
|
RGLSYMGLGETDOUBLEI_VPROC __rglgen_glGetDoublei_v;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
RGLSYMGLCREATESYNCFROMCLEVENTARBPROC __rglgen_glCreateSyncFromCLeventARB;
|
RGLSYMGLCREATESYNCFROMCLEVENTARBPROC __rglgen_glCreateSyncFromCLeventARB;
|
||||||
|
#endif
|
||||||
RGLSYMGLDEBUGMESSAGECONTROLARBPROC __rglgen_glDebugMessageControlARB;
|
RGLSYMGLDEBUGMESSAGECONTROLARBPROC __rglgen_glDebugMessageControlARB;
|
||||||
RGLSYMGLDEBUGMESSAGEINSERTARBPROC __rglgen_glDebugMessageInsertARB;
|
RGLSYMGLDEBUGMESSAGEINSERTARBPROC __rglgen_glDebugMessageInsertARB;
|
||||||
RGLSYMGLDEBUGMESSAGECALLBACKARBPROC __rglgen_glDebugMessageCallbackARB;
|
RGLSYMGLDEBUGMESSAGECALLBACKARBPROC __rglgen_glDebugMessageCallbackARB;
|
||||||
@ -1839,7 +1857,9 @@ RGLSYMGLVERTEXATTRIBBINDINGPROC __rglgen_glVertexAttribBinding;
|
|||||||
RGLSYMGLVERTEXBINDINGDIVISORPROC __rglgen_glVertexBindingDivisor;
|
RGLSYMGLVERTEXBINDINGDIVISORPROC __rglgen_glVertexBindingDivisor;
|
||||||
RGLSYMGLFRAMEBUFFERPARAMETERIPROC __rglgen_glFramebufferParameteri;
|
RGLSYMGLFRAMEBUFFERPARAMETERIPROC __rglgen_glFramebufferParameteri;
|
||||||
RGLSYMGLGETFRAMEBUFFERPARAMETERIVPROC __rglgen_glGetFramebufferParameteriv;
|
RGLSYMGLGETFRAMEBUFFERPARAMETERIVPROC __rglgen_glGetFramebufferParameteriv;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
RGLSYMGLGETINTERNALFORMATI64VPROC __rglgen_glGetInternalformati64v;
|
RGLSYMGLGETINTERNALFORMATI64VPROC __rglgen_glGetInternalformati64v;
|
||||||
|
#endif
|
||||||
RGLSYMGLINVALIDATETEXSUBIMAGEPROC __rglgen_glInvalidateTexSubImage;
|
RGLSYMGLINVALIDATETEXSUBIMAGEPROC __rglgen_glInvalidateTexSubImage;
|
||||||
RGLSYMGLINVALIDATETEXIMAGEPROC __rglgen_glInvalidateTexImage;
|
RGLSYMGLINVALIDATETEXIMAGEPROC __rglgen_glInvalidateTexImage;
|
||||||
RGLSYMGLINVALIDATEBUFFERSUBDATAPROC __rglgen_glInvalidateBufferSubData;
|
RGLSYMGLINVALIDATEBUFFERSUBDATAPROC __rglgen_glInvalidateBufferSubData;
|
||||||
|
@ -21,6 +21,9 @@ typedef void *GLeglImageOES;
|
|||||||
#if !defined(GL_OES_fixed_point) && !defined(HAVE_OPENGLES2)
|
#if !defined(GL_OES_fixed_point) && !defined(HAVE_OPENGLES2)
|
||||||
typedef GLint GLfixed;
|
typedef GLint GLfixed;
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(OSX) && !defined(MAC_OS_X_VERSION_10_7)
|
||||||
|
#define OSX_10_6_SNOW_LEOPARD 1
|
||||||
|
#endif
|
||||||
typedef void (APIENTRYP RGLSYMGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
typedef void (APIENTRYP RGLSYMGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||||
typedef void (APIENTRYP RGLSYMGLBLENDEQUATIONPROC) (GLenum mode);
|
typedef void (APIENTRYP RGLSYMGLBLENDEQUATIONPROC) (GLenum mode);
|
||||||
typedef void (APIENTRYP RGLSYMGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
|
typedef void (APIENTRYP RGLSYMGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
|
||||||
@ -330,8 +333,10 @@ typedef void (APIENTRYP RGLSYMGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint fir
|
|||||||
typedef void (APIENTRYP RGLSYMGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);
|
typedef void (APIENTRYP RGLSYMGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount);
|
||||||
typedef void (APIENTRYP RGLSYMGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
|
typedef void (APIENTRYP RGLSYMGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer);
|
||||||
typedef void (APIENTRYP RGLSYMGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
|
typedef void (APIENTRYP RGLSYMGLPRIMITIVERESTARTINDEXPROC) (GLuint index);
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
typedef void (APIENTRYP RGLSYMGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
typedef void (APIENTRYP RGLSYMGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
|
typedef void (APIENTRYP RGLSYMGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params);
|
||||||
|
#endif
|
||||||
typedef void (APIENTRYP RGLSYMGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
typedef void (APIENTRYP RGLSYMGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
|
||||||
typedef void (APIENTRYP RGLSYMGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
|
typedef void (APIENTRYP RGLSYMGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
|
||||||
typedef void (APIENTRYP RGLSYMGLMINSAMPLESHADINGPROC) (GLfloat value);
|
typedef void (APIENTRYP RGLSYMGLMINSAMPLESHADINGPROC) (GLfloat value);
|
||||||
@ -590,6 +595,7 @@ typedef void (APIENTRYP RGLSYMGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, G
|
|||||||
typedef void (APIENTRYP RGLSYMGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
|
typedef void (APIENTRYP RGLSYMGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instancecount, GLint basevertex);
|
||||||
typedef void (APIENTRYP RGLSYMGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
|
typedef void (APIENTRYP RGLSYMGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei drawcount, const GLint *basevertex);
|
||||||
typedef void (APIENTRYP RGLSYMGLPROVOKINGVERTEXPROC) (GLenum mode);
|
typedef void (APIENTRYP RGLSYMGLPROVOKINGVERTEXPROC) (GLenum mode);
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
typedef GLsync (APIENTRYP RGLSYMGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
|
typedef GLsync (APIENTRYP RGLSYMGLFENCESYNCPROC) (GLenum condition, GLbitfield flags);
|
||||||
typedef GLboolean (APIENTRYP RGLSYMGLISSYNCPROC) (GLsync sync);
|
typedef GLboolean (APIENTRYP RGLSYMGLISSYNCPROC) (GLsync sync);
|
||||||
typedef void (APIENTRYP RGLSYMGLDELETESYNCPROC) (GLsync sync);
|
typedef void (APIENTRYP RGLSYMGLDELETESYNCPROC) (GLsync sync);
|
||||||
@ -597,6 +603,8 @@ typedef GLenum (APIENTRYP RGLSYMGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield f
|
|||||||
typedef void (APIENTRYP RGLSYMGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
typedef void (APIENTRYP RGLSYMGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
|
typedef void (APIENTRYP RGLSYMGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
typedef void (APIENTRYP RGLSYMGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef void (APIENTRYP RGLSYMGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
|
typedef void (APIENTRYP RGLSYMGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
|
||||||
typedef void (APIENTRYP RGLSYMGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
|
typedef void (APIENTRYP RGLSYMGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
|
typedef void (APIENTRYP RGLSYMGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val);
|
||||||
@ -629,8 +637,10 @@ typedef void (APIENTRYP RGLSYMGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLe
|
|||||||
typedef void (APIENTRYP RGLSYMGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
|
typedef void (APIENTRYP RGLSYMGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
|
typedef void (APIENTRYP RGLSYMGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
|
||||||
typedef void (APIENTRYP RGLSYMGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
|
typedef void (APIENTRYP RGLSYMGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
typedef void (APIENTRYP RGLSYMGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
|
typedef void (APIENTRYP RGLSYMGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
|
typedef void (APIENTRYP RGLSYMGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params);
|
||||||
|
#endif
|
||||||
typedef void (APIENTRYP RGLSYMGLVERTEXP2UIPROC) (GLenum type, GLuint value);
|
typedef void (APIENTRYP RGLSYMGLVERTEXP2UIPROC) (GLenum type, GLuint value);
|
||||||
typedef void (APIENTRYP RGLSYMGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
|
typedef void (APIENTRYP RGLSYMGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value);
|
||||||
typedef void (APIENTRYP RGLSYMGLVERTEXP3UIPROC) (GLenum type, GLuint value);
|
typedef void (APIENTRYP RGLSYMGLVERTEXP3UIPROC) (GLenum type, GLuint value);
|
||||||
@ -798,7 +808,9 @@ typedef void (APIENTRYP RGLSYMGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei cou
|
|||||||
typedef void (APIENTRYP RGLSYMGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
|
typedef void (APIENTRYP RGLSYMGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLdouble n, GLdouble f);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
|
typedef void (APIENTRYP RGLSYMGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
|
typedef void (APIENTRYP RGLSYMGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data);
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
typedef GLsync (APIENTRYP RGLSYMGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
|
typedef GLsync (APIENTRYP RGLSYMGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags);
|
||||||
|
#endif
|
||||||
typedef void (APIENTRYP RGLSYMGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
typedef void (APIENTRYP RGLSYMGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
||||||
typedef void (APIENTRYP RGLSYMGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
|
typedef void (APIENTRYP RGLSYMGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
|
||||||
typedef void (APIENTRYP RGLSYMGLDEBUGMESSAGECALLBACKARBPROC) (RGLGENGLDEBUGPROCARB callback, const GLvoid *userParam);
|
typedef void (APIENTRYP RGLSYMGLDEBUGMESSAGECALLBACKARBPROC) (RGLGENGLDEBUGPROCARB callback, const GLvoid *userParam);
|
||||||
@ -859,7 +871,9 @@ typedef void (APIENTRYP RGLSYMGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GL
|
|||||||
typedef void (APIENTRYP RGLSYMGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
|
typedef void (APIENTRYP RGLSYMGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
|
||||||
typedef void (APIENTRYP RGLSYMGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
typedef void (APIENTRYP RGLSYMGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
||||||
typedef void (APIENTRYP RGLSYMGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
typedef void (APIENTRYP RGLSYMGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
typedef void (APIENTRYP RGLSYMGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
|
typedef void (APIENTRYP RGLSYMGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 *params);
|
||||||
|
#endif
|
||||||
typedef void (APIENTRYP RGLSYMGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
|
typedef void (APIENTRYP RGLSYMGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
|
||||||
typedef void (APIENTRYP RGLSYMGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
|
typedef void (APIENTRYP RGLSYMGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
|
||||||
typedef void (APIENTRYP RGLSYMGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
|
typedef void (APIENTRYP RGLSYMGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
|
||||||
@ -2324,8 +2338,10 @@ extern RGLSYMGLDRAWARRAYSINSTANCEDPROC __rglgen_glDrawArraysInstanced;
|
|||||||
extern RGLSYMGLDRAWELEMENTSINSTANCEDPROC __rglgen_glDrawElementsInstanced;
|
extern RGLSYMGLDRAWELEMENTSINSTANCEDPROC __rglgen_glDrawElementsInstanced;
|
||||||
extern RGLSYMGLTEXBUFFERPROC __rglgen_glTexBuffer;
|
extern RGLSYMGLTEXBUFFERPROC __rglgen_glTexBuffer;
|
||||||
extern RGLSYMGLPRIMITIVERESTARTINDEXPROC __rglgen_glPrimitiveRestartIndex;
|
extern RGLSYMGLPRIMITIVERESTARTINDEXPROC __rglgen_glPrimitiveRestartIndex;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
extern RGLSYMGLGETINTEGER64I_VPROC __rglgen_glGetInteger64i_v;
|
extern RGLSYMGLGETINTEGER64I_VPROC __rglgen_glGetInteger64i_v;
|
||||||
extern RGLSYMGLGETBUFFERPARAMETERI64VPROC __rglgen_glGetBufferParameteri64v;
|
extern RGLSYMGLGETBUFFERPARAMETERI64VPROC __rglgen_glGetBufferParameteri64v;
|
||||||
|
#endif
|
||||||
extern RGLSYMGLFRAMEBUFFERTEXTUREPROC __rglgen_glFramebufferTexture;
|
extern RGLSYMGLFRAMEBUFFERTEXTUREPROC __rglgen_glFramebufferTexture;
|
||||||
extern RGLSYMGLVERTEXATTRIBDIVISORPROC __rglgen_glVertexAttribDivisor;
|
extern RGLSYMGLVERTEXATTRIBDIVISORPROC __rglgen_glVertexAttribDivisor;
|
||||||
extern RGLSYMGLMINSAMPLESHADINGPROC __rglgen_glMinSampleShading;
|
extern RGLSYMGLMINSAMPLESHADINGPROC __rglgen_glMinSampleShading;
|
||||||
@ -2584,6 +2600,7 @@ extern RGLSYMGLDRAWRANGEELEMENTSBASEVERTEXPROC __rglgen_glDrawRangeElementsBaseV
|
|||||||
extern RGLSYMGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __rglgen_glDrawElementsInstancedBaseVertex;
|
extern RGLSYMGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __rglgen_glDrawElementsInstancedBaseVertex;
|
||||||
extern RGLSYMGLMULTIDRAWELEMENTSBASEVERTEXPROC __rglgen_glMultiDrawElementsBaseVertex;
|
extern RGLSYMGLMULTIDRAWELEMENTSBASEVERTEXPROC __rglgen_glMultiDrawElementsBaseVertex;
|
||||||
extern RGLSYMGLPROVOKINGVERTEXPROC __rglgen_glProvokingVertex;
|
extern RGLSYMGLPROVOKINGVERTEXPROC __rglgen_glProvokingVertex;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
extern RGLSYMGLFENCESYNCPROC __rglgen_glFenceSync;
|
extern RGLSYMGLFENCESYNCPROC __rglgen_glFenceSync;
|
||||||
extern RGLSYMGLISSYNCPROC __rglgen_glIsSync;
|
extern RGLSYMGLISSYNCPROC __rglgen_glIsSync;
|
||||||
extern RGLSYMGLDELETESYNCPROC __rglgen_glDeleteSync;
|
extern RGLSYMGLDELETESYNCPROC __rglgen_glDeleteSync;
|
||||||
@ -2591,6 +2608,7 @@ extern RGLSYMGLCLIENTWAITSYNCPROC __rglgen_glClientWaitSync;
|
|||||||
extern RGLSYMGLWAITSYNCPROC __rglgen_glWaitSync;
|
extern RGLSYMGLWAITSYNCPROC __rglgen_glWaitSync;
|
||||||
extern RGLSYMGLGETINTEGER64VPROC __rglgen_glGetInteger64v;
|
extern RGLSYMGLGETINTEGER64VPROC __rglgen_glGetInteger64v;
|
||||||
extern RGLSYMGLGETSYNCIVPROC __rglgen_glGetSynciv;
|
extern RGLSYMGLGETSYNCIVPROC __rglgen_glGetSynciv;
|
||||||
|
#endif
|
||||||
extern RGLSYMGLTEXIMAGE2DMULTISAMPLEPROC __rglgen_glTexImage2DMultisample;
|
extern RGLSYMGLTEXIMAGE2DMULTISAMPLEPROC __rglgen_glTexImage2DMultisample;
|
||||||
extern RGLSYMGLTEXIMAGE3DMULTISAMPLEPROC __rglgen_glTexImage3DMultisample;
|
extern RGLSYMGLTEXIMAGE3DMULTISAMPLEPROC __rglgen_glTexImage3DMultisample;
|
||||||
extern RGLSYMGLGETMULTISAMPLEFVPROC __rglgen_glGetMultisamplefv;
|
extern RGLSYMGLGETMULTISAMPLEFVPROC __rglgen_glGetMultisamplefv;
|
||||||
@ -2623,8 +2641,10 @@ extern RGLSYMGLGETSAMPLERPARAMETERIIVPROC __rglgen_glGetSamplerParameterIiv;
|
|||||||
extern RGLSYMGLGETSAMPLERPARAMETERFVPROC __rglgen_glGetSamplerParameterfv;
|
extern RGLSYMGLGETSAMPLERPARAMETERFVPROC __rglgen_glGetSamplerParameterfv;
|
||||||
extern RGLSYMGLGETSAMPLERPARAMETERIUIVPROC __rglgen_glGetSamplerParameterIuiv;
|
extern RGLSYMGLGETSAMPLERPARAMETERIUIVPROC __rglgen_glGetSamplerParameterIuiv;
|
||||||
extern RGLSYMGLQUERYCOUNTERPROC __rglgen_glQueryCounter;
|
extern RGLSYMGLQUERYCOUNTERPROC __rglgen_glQueryCounter;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
extern RGLSYMGLGETQUERYOBJECTI64VPROC __rglgen_glGetQueryObjecti64v;
|
extern RGLSYMGLGETQUERYOBJECTI64VPROC __rglgen_glGetQueryObjecti64v;
|
||||||
extern RGLSYMGLGETQUERYOBJECTUI64VPROC __rglgen_glGetQueryObjectui64v;
|
extern RGLSYMGLGETQUERYOBJECTUI64VPROC __rglgen_glGetQueryObjectui64v;
|
||||||
|
#endif
|
||||||
extern RGLSYMGLVERTEXP2UIPROC __rglgen_glVertexP2ui;
|
extern RGLSYMGLVERTEXP2UIPROC __rglgen_glVertexP2ui;
|
||||||
extern RGLSYMGLVERTEXP2UIVPROC __rglgen_glVertexP2uiv;
|
extern RGLSYMGLVERTEXP2UIVPROC __rglgen_glVertexP2uiv;
|
||||||
extern RGLSYMGLVERTEXP3UIPROC __rglgen_glVertexP3ui;
|
extern RGLSYMGLVERTEXP3UIPROC __rglgen_glVertexP3ui;
|
||||||
@ -2792,7 +2812,9 @@ extern RGLSYMGLDEPTHRANGEARRAYVPROC __rglgen_glDepthRangeArrayv;
|
|||||||
extern RGLSYMGLDEPTHRANGEINDEXEDPROC __rglgen_glDepthRangeIndexed;
|
extern RGLSYMGLDEPTHRANGEINDEXEDPROC __rglgen_glDepthRangeIndexed;
|
||||||
extern RGLSYMGLGETFLOATI_VPROC __rglgen_glGetFloati_v;
|
extern RGLSYMGLGETFLOATI_VPROC __rglgen_glGetFloati_v;
|
||||||
extern RGLSYMGLGETDOUBLEI_VPROC __rglgen_glGetDoublei_v;
|
extern RGLSYMGLGETDOUBLEI_VPROC __rglgen_glGetDoublei_v;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
extern RGLSYMGLCREATESYNCFROMCLEVENTARBPROC __rglgen_glCreateSyncFromCLeventARB;
|
extern RGLSYMGLCREATESYNCFROMCLEVENTARBPROC __rglgen_glCreateSyncFromCLeventARB;
|
||||||
|
#endif
|
||||||
extern RGLSYMGLDEBUGMESSAGECONTROLARBPROC __rglgen_glDebugMessageControlARB;
|
extern RGLSYMGLDEBUGMESSAGECONTROLARBPROC __rglgen_glDebugMessageControlARB;
|
||||||
extern RGLSYMGLDEBUGMESSAGEINSERTARBPROC __rglgen_glDebugMessageInsertARB;
|
extern RGLSYMGLDEBUGMESSAGEINSERTARBPROC __rglgen_glDebugMessageInsertARB;
|
||||||
extern RGLSYMGLDEBUGMESSAGECALLBACKARBPROC __rglgen_glDebugMessageCallbackARB;
|
extern RGLSYMGLDEBUGMESSAGECALLBACKARBPROC __rglgen_glDebugMessageCallbackARB;
|
||||||
@ -2853,7 +2875,9 @@ extern RGLSYMGLVERTEXATTRIBBINDINGPROC __rglgen_glVertexAttribBinding;
|
|||||||
extern RGLSYMGLVERTEXBINDINGDIVISORPROC __rglgen_glVertexBindingDivisor;
|
extern RGLSYMGLVERTEXBINDINGDIVISORPROC __rglgen_glVertexBindingDivisor;
|
||||||
extern RGLSYMGLFRAMEBUFFERPARAMETERIPROC __rglgen_glFramebufferParameteri;
|
extern RGLSYMGLFRAMEBUFFERPARAMETERIPROC __rglgen_glFramebufferParameteri;
|
||||||
extern RGLSYMGLGETFRAMEBUFFERPARAMETERIVPROC __rglgen_glGetFramebufferParameteriv;
|
extern RGLSYMGLGETFRAMEBUFFERPARAMETERIVPROC __rglgen_glGetFramebufferParameteriv;
|
||||||
|
#ifndef OSX_10_6_SNOW_LEOPARD
|
||||||
extern RGLSYMGLGETINTERNALFORMATI64VPROC __rglgen_glGetInternalformati64v;
|
extern RGLSYMGLGETINTERNALFORMATI64VPROC __rglgen_glGetInternalformati64v;
|
||||||
|
#endif
|
||||||
extern RGLSYMGLINVALIDATETEXSUBIMAGEPROC __rglgen_glInvalidateTexSubImage;
|
extern RGLSYMGLINVALIDATETEXSUBIMAGEPROC __rglgen_glInvalidateTexSubImage;
|
||||||
extern RGLSYMGLINVALIDATETEXIMAGEPROC __rglgen_glInvalidateTexImage;
|
extern RGLSYMGLINVALIDATETEXIMAGEPROC __rglgen_glInvalidateTexImage;
|
||||||
extern RGLSYMGLINVALIDATEBUFFERSUBDATAPROC __rglgen_glInvalidateBufferSubData;
|
extern RGLSYMGLINVALIDATEBUFFERSUBDATAPROC __rglgen_glInvalidateBufferSubData;
|
||||||
|
@ -523,15 +523,12 @@ MENU
|
|||||||
#include "../frontend/menu/menu_settings.c"
|
#include "../frontend/menu/menu_settings.c"
|
||||||
#include "../frontend/menu/history.c"
|
#include "../frontend/menu/history.c"
|
||||||
|
|
||||||
#ifdef HAVE_FILEBROWSER
|
|
||||||
#include "../frontend/menu/file_browser.c"
|
|
||||||
#endif
|
|
||||||
#include "../file_list.c"
|
#include "../file_list.c"
|
||||||
|
|
||||||
#if defined(HAVE_RMENU)
|
#if defined(HAVE_RMENU)
|
||||||
#include "../frontend/menu/rmenu_disp.c"
|
#include "../frontend/menu/disp/rmenu.c"
|
||||||
#elif defined(HAVE_RGUI)
|
#elif defined(HAVE_RGUI)
|
||||||
#include "../frontend/menu/rgui.c"
|
#include "../frontend/menu/disp/rgui.c"
|
||||||
#elif defined(HAVE_RMENU_XUI)
|
#elif defined(HAVE_RMENU_XUI)
|
||||||
#include "../frontend/menu/rmenu_xui.cpp"
|
#include "../frontend/menu/rmenu_xui.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
#include "../gfx/fonts/bitmap.h"
|
#include "../gfx/fonts/bitmap.h"
|
||||||
#include "../frontend/menu/rgui.h"
|
#include "../frontend/menu/menu_common.h"
|
||||||
#include "../gfx/gfx_common.h"
|
#include "../gfx/gfx_common.h"
|
||||||
|
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
|
@ -323,9 +323,9 @@ static int16_t dinput_input_state(void *data,
|
|||||||
return dinput_keyboard_pressed(di, id);
|
return dinput_keyboard_pressed(di, id);
|
||||||
|
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
ret = input_joypad_analog(di->joypad, port, index, id, g_settings.input.binds[port]);
|
ret = dinput_pressed_analog(di, binds[port], index, id);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
dinput_pressed_analog(di, binds[port], index, id);
|
ret = input_joypad_analog(di->joypad, port, index, id, g_settings.input.binds[port]);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
|
@ -287,9 +287,9 @@ static int16_t linuxraw_input_state(void *data, const struct retro_keybind **bin
|
|||||||
input_joypad_pressed(linuxraw->joypad, port, binds[port], id);
|
input_joypad_pressed(linuxraw->joypad, port, binds[port], id);
|
||||||
|
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
ret = input_joypad_analog(linuxraw->joypad, port, index, id, binds[port]);
|
ret = linuxraw_analog_pressed(linuxraw, binds[port], index, id);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = linuxraw_analog_pressed(linuxraw, binds[port], index, id);
|
ret = input_joypad_analog(linuxraw->joypad, port, index, id, binds[port]);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -101,9 +101,9 @@ static int16_t sdl_joypad_device_state(sdl_input_t *sdl, const struct retro_keyb
|
|||||||
static int16_t sdl_analog_device_state(sdl_input_t *sdl, const struct retro_keybind **binds,
|
static int16_t sdl_analog_device_state(sdl_input_t *sdl, const struct retro_keybind **binds,
|
||||||
unsigned port_num, unsigned index, unsigned id)
|
unsigned port_num, unsigned index, unsigned id)
|
||||||
{
|
{
|
||||||
int16_t ret = input_joypad_analog(sdl->joypad, port_num, index, id, binds[port_num]);
|
int16_t ret = sdl_analog_pressed(sdl, binds[port_num], index, id);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = sdl_analog_pressed(sdl, binds[port_num], index, id);
|
ret = input_joypad_analog(sdl->joypad, port_num, index, id, binds[port_num]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,9 +194,9 @@ static int16_t x_input_state(void *data, const struct retro_keybind **binds, uns
|
|||||||
return x_key_pressed(x11, id);
|
return x_key_pressed(x11, id);
|
||||||
|
|
||||||
case RETRO_DEVICE_ANALOG:
|
case RETRO_DEVICE_ANALOG:
|
||||||
ret = input_joypad_analog(x11->joypad, port, index, id, binds[port]);
|
ret = x_pressed_analog(x11, binds[port], index, id);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
ret = x_pressed_analog(x11, binds[port], index, id);
|
ret = input_joypad_analog(x11->joypad, port, index, id, binds[port]);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
case RETRO_DEVICE_MOUSE:
|
case RETRO_DEVICE_MOUSE:
|
||||||
|
61
libretro.h
61
libretro.h
@ -446,8 +446,6 @@ enum retro_mod
|
|||||||
// swapped out by the user (e.g. PSX).
|
// swapped out by the user (e.g. PSX).
|
||||||
#define RETRO_ENVIRONMENT_SET_HW_RENDER 14
|
#define RETRO_ENVIRONMENT_SET_HW_RENDER 14
|
||||||
// struct retro_hw_render_callback * --
|
// struct retro_hw_render_callback * --
|
||||||
// NOTE: This call is currently very experimental, and should not be considered part of the public API.
|
|
||||||
// The interface could be changed or removed at any time.
|
|
||||||
// Sets an interface to let a libretro core render with hardware acceleration.
|
// Sets an interface to let a libretro core render with hardware acceleration.
|
||||||
// Should be called in retro_load_game().
|
// Should be called in retro_load_game().
|
||||||
// If successful, libretro cores will be able to render to a frontend-provided framebuffer.
|
// If successful, libretro cores will be able to render to a frontend-provided framebuffer.
|
||||||
@ -541,6 +539,23 @@ enum retro_mod
|
|||||||
// The purpose of this interface is to allow
|
// The purpose of this interface is to allow
|
||||||
// setting state related to sensors such as polling rate, enabling/disable it entirely, etc.
|
// setting state related to sensors such as polling rate, enabling/disable it entirely, etc.
|
||||||
// Reading sensor state is done via the normal input_state_callback API.
|
// Reading sensor state is done via the normal input_state_callback API.
|
||||||
|
#define RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE (26 | RETRO_ENVIRONMENT_EXPERIMENTAL)
|
||||||
|
// struct retro_camera_callback * --
|
||||||
|
// Gets an interface to a video camera driver.
|
||||||
|
// A libretro core can use this interface to get access to a video camera.
|
||||||
|
// New video frames are delivered in a callback in same thread as retro_run().
|
||||||
|
//
|
||||||
|
// GET_CAMERA_INTERFACE should be called in retro_load_game().
|
||||||
|
//
|
||||||
|
// Depending on the camera implementation used, camera frames will be delivered as a raw framebuffer,
|
||||||
|
// or as an OpenGL texture directly.
|
||||||
|
//
|
||||||
|
// The core has to tell the frontend here which types of buffers can be handled properly.
|
||||||
|
// An OpenGL texture can only be handled when using a libretro GL core (SET_HW_RENDER).
|
||||||
|
// It is recommended to use a libretro GL core when using camera interface.
|
||||||
|
//
|
||||||
|
// The camera is not started automatically. The retrieved start/stop functions must be used to explicitly
|
||||||
|
// start and stop the camera driver.
|
||||||
|
|
||||||
// FIXME: Document the sensor API and work out behavior.
|
// FIXME: Document the sensor API and work out behavior.
|
||||||
// It will be marked as experimental until then.
|
// It will be marked as experimental until then.
|
||||||
@ -559,6 +574,48 @@ struct retro_sensor_interface
|
|||||||
};
|
};
|
||||||
////
|
////
|
||||||
|
|
||||||
|
enum retro_camera_buffer
|
||||||
|
{
|
||||||
|
RETRO_CAMERA_BUFFER_OPENGL_TEXTURE = 0,
|
||||||
|
RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER,
|
||||||
|
|
||||||
|
RETRO_CAMERA_BUFFER_DUMMY = INT_MAX
|
||||||
|
};
|
||||||
|
|
||||||
|
// Starts the camera driver. Can only be called in retro_run().
|
||||||
|
typedef bool (*retro_camera_start_t)(void);
|
||||||
|
// Stops the camera driver. Can only be called in retro_run().
|
||||||
|
typedef void (*retro_camera_stop_t)(void);
|
||||||
|
// A callback for raw framebuffer data. buffer points to an XRGB8888 buffer.
|
||||||
|
// Width, height and pitch are similar to retro_video_refresh_t.
|
||||||
|
// First pixel is top-left origin.
|
||||||
|
typedef void (*retro_camera_frame_raw_framebuffer_t)(const uint32_t *buffer, unsigned width, unsigned height, size_t pitch);
|
||||||
|
// A callback for when OpenGL textures are used.
|
||||||
|
//
|
||||||
|
// texture_id is a texture owned by camera driver.
|
||||||
|
// Its state or content should be considered immutable, except for things like texture filtering and clamping.
|
||||||
|
//
|
||||||
|
// texture_target is the texture target for the GL texture.
|
||||||
|
// These can include e.g. GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE, and possibly more depending on extensions.
|
||||||
|
//
|
||||||
|
// affine points to a packed 3x3 column-major matrix used to apply an affine transform to texture coordinates. (affine_matrix * vec3(coord_x, coord_y, 1.0))
|
||||||
|
// After transform, normalized texture coord (0, 0) should be bottom-left and (1, 1) should be top-right (or (width, height) for RECTANGLE).
|
||||||
|
//
|
||||||
|
// GL-specific typedefs are avoided here to avoid relying on gl.h in the API definition.
|
||||||
|
typedef void (*retro_camera_frame_opengl_texture_t)(unsigned texture_id, unsigned texture_target, const float *affine);
|
||||||
|
struct retro_camera_callback
|
||||||
|
{
|
||||||
|
uint64_t caps; // Set by libretro core. Example bitmask: caps = (1 << RETRO_CAMERA_BUFFER_OPENGL_TEXTURE) | (1 << RETRO_CAMERA_BUFFER_RAW_FRAMEBUFFER).
|
||||||
|
|
||||||
|
unsigned width; // Desired resolution for camera. Is only used as a hint.
|
||||||
|
unsigned height;
|
||||||
|
retro_camera_start_t start; // Set by frontend.
|
||||||
|
retro_camera_stop_t stop; // Set by frontend.
|
||||||
|
|
||||||
|
retro_camera_frame_raw_framebuffer_t frame_raw_framebuffer; // Set by libretro core if raw framebuffer callbacks will be used.
|
||||||
|
retro_camera_frame_opengl_texture_t frame_opengl_texture; // Set by libretro core if OpenGL texture callbacks will be used.
|
||||||
|
};
|
||||||
|
|
||||||
enum retro_rumble_effect
|
enum retro_rumble_effect
|
||||||
{
|
{
|
||||||
RETRO_RUMBLE_STRONG = 0,
|
RETRO_RUMBLE_STRONG = 0,
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
<MinimalRebuild>true</MinimalRebuild>
|
<MinimalRebuild>true</MinimalRebuild>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<PreprocessorDefinitions>_DEBUG;_XBOX;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;_XBOX;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
||||||
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
|
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@ -151,7 +151,7 @@
|
|||||||
<PREfast>AnalyzeOnly</PREfast>
|
<PREfast>AnalyzeOnly</PREfast>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<PreprocessorDefinitions>_DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;WANT_RPNG</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;WANT_RPNG</PreprocessorDefinitions>
|
||||||
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
|
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@ -190,7 +190,7 @@
|
|||||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
||||||
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
|
<CallAttributedProfiling>Callcap</CallAttributedProfiling>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@ -234,7 +234,7 @@
|
|||||||
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
<FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -275,7 +275,7 @@
|
|||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<PreprocessorDefinitions>NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE=1;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_XBOX;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_RARCH_MAIN_IMPLEMENTATION;RARCH_CONSOLE=1;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_RMENU_XUI;HAVE_MENU;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
@ -316,7 +316,7 @@
|
|||||||
<ExceptionHandling>false</ExceptionHandling>
|
<ExceptionHandling>false</ExceptionHandling>
|
||||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<PreprocessorDefinitions>NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_FILEBROWSER;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_RMENU_XUI;HAVE_MENU;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_NETPLAY;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_EXEC;HAVE_LIBRETRO_MANAGEMENT;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_VID_CONTEXT;HAVE_D3D9;_XBOX360;HAVE_FBO;HAVE_SCREENSHOTS;WANT_MINIZ;SINC_LOWER_QUALITY;HAVE_XAUDIO;WANT_RPNG</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
Optimization="3"
|
Optimization="3"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
MinimalRebuild="TRUE"
|
MinimalRebuild="TRUE"
|
||||||
BasicRuntimeChecks="0"
|
BasicRuntimeChecks="0"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@ -72,7 +72,7 @@
|
|||||||
OmitFramePointers="TRUE"
|
OmitFramePointers="TRUE"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
@ -127,7 +127,7 @@
|
|||||||
OmitFramePointers="TRUE"
|
OmitFramePointers="TRUE"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
@ -188,7 +188,7 @@
|
|||||||
EnableFiberSafeOptimizations="TRUE"
|
EnableFiberSafeOptimizations="TRUE"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
@ -241,7 +241,7 @@
|
|||||||
OmitFramePointers="TRUE"
|
OmitFramePointers="TRUE"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
@ -300,7 +300,7 @@
|
|||||||
EnableFiberSafeOptimizations="TRUE"
|
EnableFiberSafeOptimizations="TRUE"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
@ -353,7 +353,7 @@
|
|||||||
OmitFramePointers="TRUE"
|
OmitFramePointers="TRUE"
|
||||||
OptimizeForProcessor="2"
|
OptimizeForProcessor="2"
|
||||||
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
AdditionalIncludeDirectories=""$(SolutionDir)\msvc-stdint";"$(SolutionDir)\msvc-71""
|
||||||
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;HAVE_FILEBROWSER;WANT_MINIZ;SINC_LOWER_QUALITY"
|
PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;HAVE_RMENU;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_MAIN_WRAP;HAVE_RARCH_MAIN_IMPLEMENTATION;HAVE_LIBRETRO_MANAGEMENT;HAVE_RARCH_EXEC;HAVE_VID_CONTEXT;HAVE_DSOUND;HAVE_D3D8;WANT_MINIZ;SINC_LOWER_QUALITY"
|
||||||
StringPooling="TRUE"
|
StringPooling="TRUE"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
BufferSecurityCheck="TRUE"
|
BufferSecurityCheck="TRUE"
|
||||||
|
@ -189,7 +189,7 @@
|
|||||||
<ClCompile Include="..\..\file_extract.c" />
|
<ClCompile Include="..\..\file_extract.c" />
|
||||||
<ClCompile Include="..\..\frontend\menu\history.c" />
|
<ClCompile Include="..\..\frontend\menu\history.c" />
|
||||||
<ClCompile Include="..\..\file_list.c" />
|
<ClCompile Include="..\..\file_list.c" />
|
||||||
<ClCompile Include="..\..\frontend\menu\rgui.c" />
|
<ClCompile Include="..\..\frontend\menu\disp\rgui.c" />
|
||||||
<ClCompile Include="..\..\frontend\menu\menu_common.c" />
|
<ClCompile Include="..\..\frontend\menu\menu_common.c" />
|
||||||
<ClCompile Include="..\..\frontend\menu\menu_settings.c" />
|
<ClCompile Include="..\..\frontend\menu\menu_settings.c" />
|
||||||
<ClCompile Include="..\..\frontend\menu\menu_context.c" />
|
<ClCompile Include="..\..\frontend\menu\menu_context.c" />
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
#ifndef __MSVC_71_H
|
#ifndef __MSVC_71_H
|
||||||
#define __MSVC_71_H
|
#define __MSVC_71_H
|
||||||
|
|
||||||
|
#ifdef _XBOX1
|
||||||
|
#include <xtl.h>
|
||||||
|
#endif
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include "../msvc_compat.h"
|
#include "../msvc_compat.h"
|
||||||
|
119
ps3/ps3_input.c
119
ps3/ps3_input.c
@ -216,10 +216,13 @@ static int16_t ps3_input_state(void *data, const struct retro_keybind **binds,
|
|||||||
// fixed range of 0x000 - 0x3ff
|
// fixed range of 0x000 - 0x3ff
|
||||||
case RETRO_DEVICE_ID_SENSOR_ACCELEROMETER_X:
|
case RETRO_DEVICE_ID_SENSOR_ACCELEROMETER_X:
|
||||||
retval = ps3->accelerometer_state[port].x;
|
retval = ps3->accelerometer_state[port].x;
|
||||||
|
break;
|
||||||
case RETRO_DEVICE_ID_SENSOR_ACCELEROMETER_Y:
|
case RETRO_DEVICE_ID_SENSOR_ACCELEROMETER_Y:
|
||||||
retval = ps3->accelerometer_state[port].y;
|
retval = ps3->accelerometer_state[port].y;
|
||||||
|
break;
|
||||||
case RETRO_DEVICE_ID_SENSOR_ACCELEROMETER_Z:
|
case RETRO_DEVICE_ID_SENSOR_ACCELEROMETER_Z:
|
||||||
retval = ps3->accelerometer_state[port].z;
|
retval = ps3->accelerometer_state[port].z;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
retval = 0;
|
retval = 0;
|
||||||
}
|
}
|
||||||
@ -241,31 +244,47 @@ static int16_t ps3_input_state(void *data, const struct retro_keybind **binds,
|
|||||||
ON-SCREEN KEYBOARD UTILITY
|
ON-SCREEN KEYBOARD UTILITY
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
|
|
||||||
#define OSK_IN_USE 1
|
#define OSK_IN_USE 1
|
||||||
|
|
||||||
void oskutil_init(oskutil_params *params, unsigned containersize)
|
void *oskutil_init(size_t size)
|
||||||
{
|
{
|
||||||
|
ps3_osk_t *params = (ps3_osk_t*)calloc(1, sizeof(*params));
|
||||||
|
|
||||||
|
if (!params)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
params->flags = 0;
|
params->flags = 0;
|
||||||
if (containersize)
|
if (size)
|
||||||
params->osk_memorycontainer = containersize;
|
params->osk_memorycontainer = size;
|
||||||
else
|
else
|
||||||
params->osk_memorycontainer = 1024*1024*2;
|
params->osk_memorycontainer = 1024*1024*2;
|
||||||
|
|
||||||
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool oskutil_enable_key_layout (void)
|
void oskutil_free(void *data)
|
||||||
{
|
{
|
||||||
int ret = pOskSetKeyLayoutOption(CELL_OSKDIALOG_10KEY_PANEL | \
|
ps3_osk_t *params = (ps3_osk_t*)data;
|
||||||
CELL_OSKDIALOG_FULLKEY_PANEL);
|
|
||||||
if (ret < 0)
|
if (params)
|
||||||
return (false);
|
free(params);
|
||||||
else
|
|
||||||
return (true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void oskutil_create_activation_parameters(oskutil_params *params)
|
static bool oskutil_enable_key_layout(void *data)
|
||||||
{
|
{
|
||||||
|
(void)data;
|
||||||
|
|
||||||
|
if (pOskSetKeyLayoutOption(CELL_OSKDIALOG_10KEY_PANEL | CELL_OSKDIALOG_FULLKEY_PANEL) < 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void oskutil_create_activation_parameters(void *data)
|
||||||
|
{
|
||||||
|
ps3_osk_t *params = (ps3_osk_t*)data;
|
||||||
params->dialogParam.controlPoint.x = 0.0;
|
params->dialogParam.controlPoint.x = 0.0;
|
||||||
params->dialogParam.controlPoint.y = 0.0;
|
params->dialogParam.controlPoint.y = 0.0;
|
||||||
|
|
||||||
@ -282,29 +301,31 @@ static void oskutil_create_activation_parameters(oskutil_params *params)
|
|||||||
params->dialogParam.osk_prohibit_flags = 0;
|
params->dialogParam.osk_prohibit_flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oskutil_write_message(oskutil_params *params, const wchar_t* msg)
|
void oskutil_write_message(void *data, const void *data_msg)
|
||||||
{
|
{
|
||||||
|
ps3_osk_t *params = (ps3_osk_t*)data;
|
||||||
|
const wchar_t *msg = (const wchar_t*)data_msg;
|
||||||
params->inputFieldInfo.osk_inputfield_message = (uint16_t*)msg;
|
params->inputFieldInfo.osk_inputfield_message = (uint16_t*)msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
void oskutil_write_initial_message(oskutil_params *params, const wchar_t* msg)
|
void oskutil_write_initial_message(void *data, const void *data_msg)
|
||||||
{
|
{
|
||||||
|
ps3_osk_t *params = (ps3_osk_t*)data;
|
||||||
|
const wchar_t *msg = (const wchar_t*)data_msg;
|
||||||
params->inputFieldInfo.osk_inputfield_starttext = (uint16_t*)msg;
|
params->inputFieldInfo.osk_inputfield_starttext = (uint16_t*)msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool oskutil_start(oskutil_params *params)
|
bool oskutil_start(void *data)
|
||||||
{
|
{
|
||||||
|
ps3_osk_t *params = (ps3_osk_t*)data;
|
||||||
|
|
||||||
if (params->flags & OSK_IN_USE)
|
if (params->flags & OSK_IN_USE)
|
||||||
{
|
{
|
||||||
RARCH_WARN("OSK util already initialized and in use\n");
|
RARCH_WARN("OSK util already initialized and in use\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = 0;
|
if (sys_memory_container_create(¶ms->containerid, params->osk_memorycontainer) < 0)
|
||||||
|
|
||||||
ret = sys_memory_container_create(¶ms->containerid, params->osk_memorycontainer);
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
goto do_deinit;
|
goto do_deinit;
|
||||||
|
|
||||||
params->outputInfo.osk_callback_return_param = CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK;
|
params->outputInfo.osk_callback_return_param = CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK;
|
||||||
@ -317,12 +338,10 @@ bool oskutil_start(oskutil_params *params)
|
|||||||
|
|
||||||
oskutil_create_activation_parameters(params);
|
oskutil_create_activation_parameters(params);
|
||||||
|
|
||||||
if (!oskutil_enable_key_layout())
|
if (!oskutil_enable_key_layout(params))
|
||||||
return (false);
|
return (false);
|
||||||
|
|
||||||
ret = pOskLoadAsync(params->containerid, ¶ms->dialogParam, ¶ms->inputFieldInfo);
|
if (pOskLoadAsync(params->containerid, ¶ms->dialogParam, ¶ms->inputFieldInfo) < 0)
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
goto do_deinit;
|
goto do_deinit;
|
||||||
|
|
||||||
params->flags |= OSK_IN_USE;
|
params->flags |= OSK_IN_USE;
|
||||||
@ -333,6 +352,58 @@ do_deinit:
|
|||||||
RARCH_ERR("Could not properly initialize OSK util.\n");
|
RARCH_ERR("Could not properly initialize OSK util.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void oskutil_lifecycle(void *data, uint64_t status)
|
||||||
|
{
|
||||||
|
ps3_osk_t *osk = (ps3_osk_t*)data;
|
||||||
|
|
||||||
|
switch (status)
|
||||||
|
{
|
||||||
|
case CELL_SYSUTIL_OSKDIALOG_LOADED:
|
||||||
|
break;
|
||||||
|
case CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED:
|
||||||
|
RARCH_LOG("CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED.\n");
|
||||||
|
pOskAbort(); //fall-through
|
||||||
|
case CELL_SYSUTIL_OSKDIALOG_FINISHED:
|
||||||
|
if (status == CELL_SYSUTIL_OSKDIALOG_FINISHED)
|
||||||
|
RARCH_LOG("CELL_SYSUTIL_OSKDIALOG_FINISHED.\n");
|
||||||
|
|
||||||
|
pOskUnloadAsync(&osk->outputInfo);
|
||||||
|
|
||||||
|
if (osk->outputInfo.result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK)
|
||||||
|
{
|
||||||
|
RARCH_LOG("Setting MODE_OSK_ENTRY_SUCCESS.\n");
|
||||||
|
g_extern.lifecycle_state |= (1ULL << MODE_OSK_ENTRY_SUCCESS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RARCH_LOG("Setting MODE_OSK_ENTRY_FAIL.\n");
|
||||||
|
g_extern.lifecycle_state |= (1ULL << MODE_OSK_ENTRY_FAIL);
|
||||||
|
}
|
||||||
|
|
||||||
|
osk->flags &= ~OSK_IN_USE;
|
||||||
|
break;
|
||||||
|
case CELL_SYSUTIL_OSKDIALOG_UNLOADED:
|
||||||
|
RARCH_LOG("CELL_SYSUTIL_OSKDIALOG_UNLOADED.\n");
|
||||||
|
sys_memory_container_destroy(osk->containerid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const input_osk_driver_t input_ps3_osk = {
|
||||||
|
oskutil_init,
|
||||||
|
oskutil_free,
|
||||||
|
oskutil_enable_key_layout,
|
||||||
|
oskutil_create_activation_parameters,
|
||||||
|
oskutil_write_message,
|
||||||
|
oskutil_write_initial_message,
|
||||||
|
oskutil_start,
|
||||||
|
oskutil_lifecycle,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
0,
|
||||||
|
"ps3osk"
|
||||||
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
|
@ -29,9 +29,8 @@
|
|||||||
#define DEADZONE_LOW 55
|
#define DEADZONE_LOW 55
|
||||||
#define DEADZONE_HIGH 210
|
#define DEADZONE_HIGH 210
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
|
typedef struct ps3_osk
|
||||||
typedef struct
|
|
||||||
{
|
{
|
||||||
unsigned int osk_memorycontainer;
|
unsigned int osk_memorycontainer;
|
||||||
wchar_t init_message[CELL_OSKDIALOG_STRING_SIZE + 1];
|
wchar_t init_message[CELL_OSKDIALOG_STRING_SIZE + 1];
|
||||||
@ -43,12 +42,12 @@ typedef struct
|
|||||||
CellOskDialogInputFieldInfo inputFieldInfo;
|
CellOskDialogInputFieldInfo inputFieldInfo;
|
||||||
CellOskDialogCallbackReturnParam outputInfo;
|
CellOskDialogCallbackReturnParam outputInfo;
|
||||||
CellOskDialogParam dialogParam;
|
CellOskDialogParam dialogParam;
|
||||||
} oskutil_params;
|
} ps3_osk_t;
|
||||||
|
|
||||||
void oskutil_write_message(oskutil_params *params, const wchar_t* msg);
|
|
||||||
void oskutil_write_initial_message(oskutil_params *params, const wchar_t* msg);
|
|
||||||
void oskutil_init(oskutil_params *params, unsigned containersize);
|
|
||||||
|
|
||||||
|
void oskutil_write_message(void *params, const void* msg);
|
||||||
|
void oskutil_write_initial_message(void *params, const void* msg);
|
||||||
|
void *oskutil_init(unsigned containersize);
|
||||||
|
void oskutil_free(void *data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -3408,8 +3408,7 @@ GLAPI void APIENTRY glDeleteFramebuffersOES( GLsizei n, const GLuint *framebuffe
|
|||||||
|
|
||||||
GLAPI void APIENTRY glGenFramebuffersOES( GLsizei n, GLuint *framebuffers )
|
GLAPI void APIENTRY glGenFramebuffersOES( GLsizei n, GLuint *framebuffers )
|
||||||
{
|
{
|
||||||
RGLcontext *LContext = _CurrentContext;
|
rglTexNameSpaceGenNames( &_CurrentContext->framebufferNameSpace, n, framebuffers );
|
||||||
rglTexNameSpaceGenNames( &LContext->framebufferNameSpace, n, framebuffers );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GLAPI GLenum APIENTRY glCheckFramebufferStatusOES( GLenum target )
|
GLAPI GLenum APIENTRY glCheckFramebufferStatusOES( GLenum target )
|
||||||
@ -3417,11 +3416,7 @@ GLAPI GLenum APIENTRY glCheckFramebufferStatusOES( GLenum target )
|
|||||||
RGLcontext* LContext = _CurrentContext;
|
RGLcontext* LContext = _CurrentContext;
|
||||||
|
|
||||||
if (LContext->framebuffer)
|
if (LContext->framebuffer)
|
||||||
{
|
return rglPlatformFramebufferCheckStatus( rglGetFramebuffer( LContext, LContext->framebuffer ) );
|
||||||
rglFramebuffer* framebuffer = rglGetFramebuffer( LContext, LContext->framebuffer );
|
|
||||||
|
|
||||||
return rglPlatformFramebufferCheckStatus( framebuffer );
|
|
||||||
}
|
|
||||||
|
|
||||||
return GL_FRAMEBUFFER_COMPLETE_OES;
|
return GL_FRAMEBUFFER_COMPLETE_OES;
|
||||||
}
|
}
|
||||||
@ -3941,7 +3936,6 @@ static rglTexture *rglAllocateTexture(void)
|
|||||||
texture->compareMode = GL_NONE;
|
texture->compareMode = GL_NONE;
|
||||||
texture->compareFunc = GL_LEQUAL;
|
texture->compareFunc = GL_LEQUAL;
|
||||||
texture->gammaRemap = 0;
|
texture->gammaRemap = 0;
|
||||||
texture->vertexEnable = GL_FALSE;
|
|
||||||
texture->usage = 0;
|
texture->usage = 0;
|
||||||
texture->isRenderTarget = GL_FALSE;
|
texture->isRenderTarget = GL_FALSE;
|
||||||
texture->image = NULL;
|
texture->image = NULL;
|
||||||
@ -4249,9 +4243,9 @@ rglTexture *rglGetCurrentTexture (const void *data, GLenum target)
|
|||||||
rglTexture *defaultTexture = unit->default2D;
|
rglTexture *defaultTexture = unit->default2D;
|
||||||
|
|
||||||
if (name)
|
if (name)
|
||||||
return ( rglTexture * )LContext->textureNameSpace.data[name];
|
defaultTexture = (rglTexture *)LContext->textureNameSpace.data[name];
|
||||||
else
|
|
||||||
return defaultTexture;
|
return defaultTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rglGetImage( GLenum target, GLint level, rglTexture **texture, rglImage **image, GLsizei reallocateSize )
|
static void rglGetImage( GLenum target, GLint level, rglTexture **texture, rglImage **image, GLsizei reallocateSize )
|
||||||
@ -4359,13 +4353,6 @@ GLAPI void APIENTRY glTexParameteri( GLenum target, GLenum pname, GLint param )
|
|||||||
case GL_TEXTURE_WRAP_R:
|
case GL_TEXTURE_WRAP_R:
|
||||||
texture->wrapR = param;
|
texture->wrapR = param;
|
||||||
break;
|
break;
|
||||||
case GL_TEXTURE_FROM_VERTEX_PROGRAM_SCE:
|
|
||||||
if ( param != 0 )
|
|
||||||
texture->vertexEnable = GL_TRUE;
|
|
||||||
else
|
|
||||||
texture->vertexEnable = GL_FALSE;
|
|
||||||
texture->revalidate |= RGL_TEXTURE_REVALIDATE_LAYOUT;
|
|
||||||
break;
|
|
||||||
case GL_TEXTURE_COMPARE_MODE_ARB:
|
case GL_TEXTURE_COMPARE_MODE_ARB:
|
||||||
texture->compareMode = param;
|
texture->compareMode = param;
|
||||||
break;
|
break;
|
||||||
|
@ -695,13 +695,6 @@ void _cgIgnoreParamIndex (void *data, const void*v, const int index )
|
|||||||
// nothing
|
// nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
CgRuntimeParameter* _cgGLTestArrayParameter( CGparameter paramIn, long offset, long nelements )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter* param = rglCgGLTestParameter( paramIn );
|
|
||||||
|
|
||||||
return param;
|
|
||||||
}
|
|
||||||
|
|
||||||
CgRuntimeParameter* _cgGLTestTextureParameter( CGparameter param )
|
CgRuntimeParameter* _cgGLTestTextureParameter( CGparameter param )
|
||||||
{
|
{
|
||||||
CgRuntimeParameter* ptr = rglCgGLTestParameter( param );
|
CgRuntimeParameter* ptr = rglCgGLTestParameter( param );
|
||||||
@ -1226,163 +1219,6 @@ CG_API CGparameter cgGetNextParameter( CGparameter param )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CG_API CGparameter cgGetFirstStructParameter( CGparameter param )
|
|
||||||
{
|
|
||||||
//check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = ( CgRuntimeParameter* )rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return ( CGparameter )NULL;
|
|
||||||
|
|
||||||
const CgParameterEntry *parameterEntry = rtParameter->parameterEntry;
|
|
||||||
if (( parameterEntry->flags & CGP_STRUCTURE ) != CGP_STRUCTURE )
|
|
||||||
{
|
|
||||||
// failure, there was no child.
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAM_HANDLE_ERROR );
|
|
||||||
return ( CGparameter )NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CgParameterStructure *parameterStructure = rglGetParameterStructure( rtParameter->program, parameterEntry );
|
|
||||||
if ( parameterStructure->memberCount > 0 ) //is is needed ?
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *firstStructureItem = rtParameter + 1;
|
|
||||||
return firstStructureItem->id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return ( CGparameter )NULL; //we have a struct with 0 items ?
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGparameter cgGetArrayParameter( CGparameter param, int arrayIndex )
|
|
||||||
{
|
|
||||||
// check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = ( CgRuntimeParameter* )_cgGLTestArrayParameter( param, arrayIndex, 1 );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return ( CGparameter )NULL;
|
|
||||||
|
|
||||||
CGparameter arrayFirstItemID;
|
|
||||||
if ( rtParameter->parameterEntry->flags & CGP_UNROLLED )
|
|
||||||
{
|
|
||||||
//move over the first item of the array and starts from here
|
|
||||||
rtParameter++;
|
|
||||||
arrayFirstItemID = rtParameter->id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// SPECIAL CASE FOR ARRAY_OF_SAMPLERS
|
|
||||||
if ( RGL_UNLIKELY( !( rtParameter->parameterEntry->flags & ( CGP_STRUCTURE | CGP_ARRAY ) ) ) &&
|
|
||||||
isSampler( rglGetParameterCGtype( rtParameter->program, rtParameter->parameterEntry ) ) )
|
|
||||||
{
|
|
||||||
for ( int i = 0; i < arrayIndex; ++i )
|
|
||||||
{
|
|
||||||
rtParameter++;
|
|
||||||
}
|
|
||||||
return rtParameter->id;
|
|
||||||
}
|
|
||||||
// END SPECIAL CASE FOR ARRAY_OF_SAMPLERS
|
|
||||||
|
|
||||||
//move to the type item
|
|
||||||
rtParameter++;
|
|
||||||
//and create the ID for the item 0
|
|
||||||
//I know this is stupid, and that this really the same as the previous case, but that's to make the code understandable
|
|
||||||
arrayFirstItemID = ( CGparameter )((( unsigned int )rtParameter->id ) | ( 0 << CG_PARAMETERSIZE ) );
|
|
||||||
}
|
|
||||||
CGparameter arrayItemID = rglAdvanceParameter( arrayFirstItemID, arrayIndex );
|
|
||||||
return arrayItemID;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API int cgGetArraySize( CGparameter param, int dimension )
|
|
||||||
{
|
|
||||||
// check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = ( CgRuntimeParameter* )rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
// this is another rarely queried value (see also cgGetArrayDimension), so we
|
|
||||||
// do not store it. Instead we calculate it every time it is requested.
|
|
||||||
// recurse down the array tree decrementing "dimension" until either it reached zero
|
|
||||||
// and we return the arraySize or we fail to find a child in which case the
|
|
||||||
// dimension was invalid.
|
|
||||||
|
|
||||||
const CgParameterEntry *parameterEntry = rtParameter->parameterEntry;
|
|
||||||
if (( parameterEntry->flags & CGP_ARRAY ) == 0 )
|
|
||||||
{
|
|
||||||
// ***** NOT IN CG DOCUMENTATION, but should be ****
|
|
||||||
rglCgRaiseError( CG_ARRAY_PARAM_ERROR );
|
|
||||||
return CG_UNKNOWN_TYPE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const CgParameterArray *parameterArray = rglGetParameterArray( rtParameter->program, parameterEntry );
|
|
||||||
if ( dimension < 0 || dimension >= parameterArray->dimensionCount )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_DIMENSION_ERROR );
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return (int)parameterArray->dimensions[dimension];
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGprogram cgGetParameterProgram( CGparameter param )
|
|
||||||
{
|
|
||||||
// check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = ( CgRuntimeParameter* )rglCgGLTestParameter( param );
|
|
||||||
if (!rtParameter)
|
|
||||||
return ( CGprogram )NULL;
|
|
||||||
// I don't think we want to expose the fact that we internally store runtime created effect and context parameters in a program
|
|
||||||
else if ( RGL_UNLIKELY( rtParameter->parameterEntry->flags & CGP_RTCREATED ) )
|
|
||||||
return ( CGprogram )NULL;
|
|
||||||
else
|
|
||||||
return rtParameter->program->id;
|
|
||||||
return (CGprogram)NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGcontext cgGetParameterContext( CGparameter param )
|
|
||||||
{
|
|
||||||
// check parameter handle
|
|
||||||
if ( !CG_IS_PARAMETER( param ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAM_HANDLE_ERROR );
|
|
||||||
return ( CGcontext )NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGcontext result = cgGetProgramContext( cgGetParameterProgram( param ) );
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGbool cgIsParameter( CGparameter param )
|
|
||||||
{
|
|
||||||
if ( RGL_LIKELY( CG_IS_PARAMETER( param ) ) )
|
|
||||||
{
|
|
||||||
return CG_TRUE;
|
|
||||||
}
|
|
||||||
return CG_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGtype cgGetParameterType( CGparameter param )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *rtParameter = ( CgRuntimeParameter* )rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return CG_UNKNOWN_TYPE;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( rtParameter->parameterEntry->flags & CGP_ARRAY )
|
|
||||||
return CG_ARRAY;
|
|
||||||
else if ( rtParameter->parameterEntry->flags & CGP_STRUCTURE )
|
|
||||||
return CG_STRUCT;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return rglGetParameterCGtype( rtParameter->program, rtParameter->parameterEntry );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGtype cgGetParameterNamedType( CGparameter param )
|
|
||||||
{
|
|
||||||
return cgGetParameterType( param );
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API const char* cgGetParameterSemantic( CGparameter param )
|
CG_API const char* cgGetParameterSemantic( CGparameter param )
|
||||||
{
|
{
|
||||||
// check parameter handle
|
// check parameter handle
|
||||||
@ -1428,95 +1264,6 @@ static bool rglPrependString( char *dst, const char *src, size_t size )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CG_API const char* cgGetParameterName( CGparameter param )
|
|
||||||
{
|
|
||||||
// check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = ( CgRuntimeParameter* )rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
// runtime created parameters have their names stored in the entry differently than compile created params
|
|
||||||
if ( rtParameter->parameterEntry->flags & CGP_RTCREATED )
|
|
||||||
return (const char*)( rtParameter->parameterEntry->nameOffset );
|
|
||||||
|
|
||||||
char *currentParameterName = rtParameter->program->parentContext->currentParameterName;
|
|
||||||
currentParameterName[0] = '\0';
|
|
||||||
size_t stringSize = sizeof( rtParameter->program->parentContext->currentParameterName );
|
|
||||||
|
|
||||||
//I walk down the parameterEntry list until I find the root
|
|
||||||
const CgParameterEntry *paramEntry = rtParameter->parameterEntry;
|
|
||||||
const CgParameterEntry *firstEntry = rtParameter->program->parametersEntries;
|
|
||||||
|
|
||||||
//start by the current name
|
|
||||||
bool res = rglPrependString( currentParameterName, rtParameter->program->stringTable + paramEntry->nameOffset, stringSize );
|
|
||||||
if ( !res )
|
|
||||||
return NULL;
|
|
||||||
//are we starting from an array ?
|
|
||||||
if ( paramEntry > firstEntry )
|
|
||||||
{
|
|
||||||
const CgParameterEntry *previousEntry = paramEntry - 1;
|
|
||||||
if (( previousEntry->flags & CGP_ARRAY ) && !( previousEntry->flags & CGP_UNROLLED ) )
|
|
||||||
{
|
|
||||||
//ok we are in an non unrolled array
|
|
||||||
//I need to append the array index, I should use the dimensions , no time for now
|
|
||||||
int index = CG_GETINDEX( param );
|
|
||||||
//should divide the index on the dimensions... later...
|
|
||||||
char buffer[256];
|
|
||||||
sprintf( buffer, "[%i]", index );
|
|
||||||
if ( strlen( currentParameterName ) + strlen( buffer ) + 1 < stringSize )
|
|
||||||
strcat( currentParameterName, buffer );
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
//prepend array name
|
|
||||||
res = rglPrependString( currentParameterName, rtParameter->program->stringTable + previousEntry->nameOffset, stringSize );
|
|
||||||
if ( !res )
|
|
||||||
return NULL;
|
|
||||||
paramEntry--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//we have already treated the current entry at that point, the loop starts on the previous one, the distance is 1
|
|
||||||
int distance = 1;
|
|
||||||
paramEntry--;
|
|
||||||
|
|
||||||
while ( paramEntry >= firstEntry )
|
|
||||||
{
|
|
||||||
switch ( paramEntry->flags & CGP_TYPE_MASK )
|
|
||||||
{
|
|
||||||
case CGP_ARRAY:
|
|
||||||
distance--; // the array has one extra item, whether it's a structure or if it's an intrinsic type
|
|
||||||
break;
|
|
||||||
case CGP_STRUCTURE:
|
|
||||||
{
|
|
||||||
const CgParameterStructure *parameterStructure = rglGetParameterStructure( rtParameter->program, paramEntry );
|
|
||||||
//the parameter is not in this structure, so I need to remove from the distance all the structure item
|
|
||||||
if ( distance > parameterStructure->memberCount )
|
|
||||||
distance -= parameterStructure->memberCount;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//the parameter is in this structure, prepend the name
|
|
||||||
res = rglPrependString( currentParameterName, ".", stringSize );
|
|
||||||
if (!res )
|
|
||||||
return NULL;
|
|
||||||
res = rglPrependString( currentParameterName, rtParameter->program->stringTable + paramEntry->nameOffset, stringSize );
|
|
||||||
if (!res)
|
|
||||||
return NULL;
|
|
||||||
distance = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case CGP_INTRINSIC:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
distance++;
|
|
||||||
paramEntry--;
|
|
||||||
}
|
|
||||||
return currentParameterName;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGenum cgGetParameterVariability( CGparameter param )
|
CG_API CGenum cgGetParameterVariability( CGparameter param )
|
||||||
{
|
{
|
||||||
// check parameter handle
|
// check parameter handle
|
||||||
@ -1633,34 +1380,6 @@ static void destroy_context( _CGcontext*ctx )
|
|||||||
free( ctx );
|
free( ctx );
|
||||||
}
|
}
|
||||||
|
|
||||||
void rglCgContextPopFront()
|
|
||||||
{
|
|
||||||
// remove and delete the context at the head of the list
|
|
||||||
if ( _CurrentContext->RGLcgContextHead )
|
|
||||||
{
|
|
||||||
_CGcontext* head = _cgGetContextPtr( _CurrentContext->RGLcgContextHead );
|
|
||||||
_CGcontext* temp = head->next;
|
|
||||||
// free the id as well
|
|
||||||
destroy_context( head );
|
|
||||||
|
|
||||||
// this is not the end of the list, feel free to dereference it.
|
|
||||||
if ( temp )
|
|
||||||
_CurrentContext->RGLcgContextHead = temp->id;
|
|
||||||
// nothing left, no dereferenceing for you, mister.
|
|
||||||
else
|
|
||||||
_CurrentContext->RGLcgContextHead = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void rglCgContextEraseAfter( _CGcontext* c )
|
|
||||||
{
|
|
||||||
_CGcontext* eraseme = c->next;
|
|
||||||
c->next = eraseme->next;
|
|
||||||
|
|
||||||
destroy_context( eraseme );
|
|
||||||
}
|
|
||||||
|
|
||||||
// API functions ----------------------------------------
|
// API functions ----------------------------------------
|
||||||
|
|
||||||
CG_API CGcontext cgCreateContext( void )
|
CG_API CGcontext cgCreateContext( void )
|
||||||
@ -1739,14 +1458,6 @@ CG_API void cgDestroyContext( CGcontext c )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CG_API CGbool cgIsContext( CGcontext ctx )
|
|
||||||
{
|
|
||||||
// is the pointer valid?
|
|
||||||
if ( CG_IS_CONTEXT( ctx ) )
|
|
||||||
return CG_TRUE;
|
|
||||||
return CG_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API const char* cgGetLastListing( CGcontext c )
|
CG_API const char* cgGetLastListing( CGcontext c )
|
||||||
{
|
{
|
||||||
// check to see if context is a valid one
|
// check to see if context is a valid one
|
||||||
@ -1764,29 +1475,6 @@ CG_API const char* cgGetLastListing( CGcontext c )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CG_API void cgSetAutoCompile( CGcontext c, CGenum flag )
|
|
||||||
{
|
|
||||||
// check to see if context is a valid one
|
|
||||||
if ( !CG_IS_CONTEXT( c ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_CONTEXT_HANDLE_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check if enum has any meaning here
|
|
||||||
switch ( flag )
|
|
||||||
{
|
|
||||||
case CG_COMPILE_MANUAL:
|
|
||||||
case CG_COMPILE_IMMEDIATE:
|
|
||||||
case CG_COMPILE_LAZY:
|
|
||||||
// set the value and return
|
|
||||||
_cgGetContextPtr( c )->compileType = flag;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rglCgRaiseError( CG_INVALID_ENUMERANT_ERROR );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
CG PROGRAM
|
CG PROGRAM
|
||||||
============================================================ */
|
============================================================ */
|
||||||
@ -1805,14 +1493,6 @@ RGL_EXPORT cgRTCgcFreeHookFunction _cgRTCgcFreeCompiledProgramHook;
|
|||||||
// a non-intrusive list. The list is walked using cgGetFirstProgram() and
|
// a non-intrusive list. The list is walked using cgGetFirstProgram() and
|
||||||
// cgGetNextProgram()
|
// cgGetNextProgram()
|
||||||
|
|
||||||
void rglCgProgramZero( _CGprogram* p )
|
|
||||||
{
|
|
||||||
// zero all pointers in the node and enclosed binary program
|
|
||||||
// this makes sure cgIsProgram calls on invalid pointers always fail
|
|
||||||
memset( p, 0, sizeof( _CGprogram ) );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void rglCgProgramPushFront( _CGcontext* ctx, _CGprogram* prog )
|
void rglCgProgramPushFront( _CGcontext* ctx, _CGprogram* prog )
|
||||||
{
|
{
|
||||||
// push the program to the context.
|
// push the program to the context.
|
||||||
@ -1873,7 +1553,7 @@ void rglCgProgramErase( _CGprogram* prog )
|
|||||||
free( prog->runtimeElf );
|
free( prog->runtimeElf );
|
||||||
|
|
||||||
// zero out all pointers
|
// zero out all pointers
|
||||||
rglCgProgramZero( prog );
|
memset( prog, 0, sizeof( _CGprogram ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void rglCgProgramEraseAfter( _CGprogram* prog )
|
void rglCgProgramEraseAfter( _CGprogram* prog )
|
||||||
@ -3137,7 +2817,7 @@ CGprogram rglCgCreateProgram( CGcontext ctx, CGprofile profile, const CgProgramH
|
|||||||
}
|
}
|
||||||
|
|
||||||
// zero out the fields
|
// zero out the fields
|
||||||
rglCgProgramZero( prog );
|
memset( prog, 0, sizeof( _CGprogram ) );
|
||||||
|
|
||||||
// fill in the fields we know
|
// fill in the fields we know
|
||||||
prog->parentContext = _cgGetContextPtr( ctx );
|
prog->parentContext = _cgGetContextPtr( ctx );
|
||||||
@ -3586,7 +3266,7 @@ CG_API CGprogram cgCopyProgram( CGprogram program )
|
|||||||
rglCgRaiseError( CG_MEMORY_ALLOC_ERROR );
|
rglCgRaiseError( CG_MEMORY_ALLOC_ERROR );
|
||||||
return ( CGprogram )NULL;
|
return ( CGprogram )NULL;
|
||||||
}
|
}
|
||||||
rglCgProgramZero( newprog );
|
memset( newprog, 0, sizeof( _CGprogram ) );
|
||||||
|
|
||||||
// copy information from the old program
|
// copy information from the old program
|
||||||
newprog->header.profile = prog->header.profile;
|
newprog->header.profile = prog->header.profile;
|
||||||
@ -3644,7 +3324,6 @@ CG_API CGprogram cgCopyProgram( CGprogram program )
|
|||||||
return newprog->id;
|
return newprog->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CG_API void cgDestroyProgram( CGprogram program )
|
CG_API void cgDestroyProgram( CGprogram program )
|
||||||
{
|
{
|
||||||
// remove the program from the program list
|
// remove the program from the program list
|
||||||
@ -3709,101 +3388,10 @@ CG_API void cgDestroyProgram( CGprogram program )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CG_API CGprogram cgGetFirstProgram( CGcontext ctx )
|
|
||||||
{
|
|
||||||
if ( !CG_IS_CONTEXT( ctx ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_CONTEXT_HANDLE_ERROR );
|
|
||||||
return ( CGprogram )NULL;
|
|
||||||
}
|
|
||||||
// check context
|
|
||||||
_CGcontext* c = _cgGetContextPtr( ctx );
|
|
||||||
|
|
||||||
// return the id of the head of the program list in the context (got all that? good)
|
|
||||||
_CGprogram* ptr = c->programList;
|
|
||||||
if ( ptr )
|
|
||||||
{
|
|
||||||
// if any programs have been allocated...
|
|
||||||
return c->programList->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ( CGprogram )NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGprogram cgGetNextProgram( CGprogram current )
|
|
||||||
{
|
|
||||||
// check the program input
|
|
||||||
if ( !CG_IS_PROGRAM( current ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PROGRAM_HANDLE_ERROR );
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
_CGprogram* ptr = _cgGetProgPtr( current );
|
|
||||||
|
|
||||||
// increment the iterator down the program list
|
|
||||||
if ( ptr->next != NULL )
|
|
||||||
{
|
|
||||||
return ptr->next->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
// failed, so return an empty program
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGcontext cgGetProgramContext( CGprogram prog )
|
|
||||||
{
|
|
||||||
// check the program input
|
|
||||||
if ( !CG_IS_PROGRAM( prog ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PROGRAM_HANDLE_ERROR );
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
_CGprogram* ptr = _cgGetProgPtr( prog );
|
|
||||||
|
|
||||||
return ptr->parentContext->id;
|
|
||||||
}
|
|
||||||
|
|
||||||
CG_API CGprofile cgGetProgramProfile( CGprogram prog )
|
|
||||||
{
|
|
||||||
// check the program input
|
|
||||||
if ( !CG_IS_PROGRAM( prog ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PROGRAM_HANDLE_ERROR );
|
|
||||||
return CG_PROFILE_UNKNOWN;
|
|
||||||
}
|
|
||||||
|
|
||||||
// return the profile the program was compiled under
|
|
||||||
return ( CGprofile )_cgGetProgPtr( prog )->header.profile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
CG GL
|
CG GL
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
inline static float *rglGetUniformValuePtr( CGparameter param, CgRuntimeParameter *rtParameter )
|
|
||||||
{
|
|
||||||
float* value = ( float* )( rtParameter->pushBufferPointer );
|
|
||||||
|
|
||||||
// check in bounds to know if you should even bother checking that it is in an array
|
|
||||||
if ( rtParameter > rtParameter->program->runtimeParameters )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *rtInArrayCheckParameter = rtParameter - 1;
|
|
||||||
// check is array
|
|
||||||
if ( rtInArrayCheckParameter->parameterEntry->flags & CGP_ARRAY )
|
|
||||||
value = *(( float** )( rtParameter->pushBufferPointer ) + CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// endian swapping of the fragment uniforms, if necessary
|
|
||||||
#if RGL_ENDIAN == RGL_BIG_ENDIAN
|
|
||||||
#define SWAP_IF_BE(arg) endianSwapWordByHalf(arg)
|
|
||||||
#else
|
|
||||||
#define SWAP_IF_BE(arg) arg
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*** Profile Functions
|
*** Profile Functions
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@ -3974,27 +3562,6 @@ CGGL_API void cgGLUnbindProgram( CGprofile profile )
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// this API exposes internal implementation of Cg.
|
|
||||||
// Since we do not rely on program objects, always return 0.
|
|
||||||
CGGL_API GLuint cgGLGetProgramID( CGprogram program )
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLEnableProgramProfiles( CGprogram program )
|
|
||||||
{
|
|
||||||
// TODO: unsupported in Jetstream
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLDisableProgramProfiles( CGprogram program )
|
|
||||||
{
|
|
||||||
// TODO: unsupported in Jetstream
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
*** Parameter Managment Functions
|
*** Parameter Managment Functions
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@ -4018,400 +3585,6 @@ CGGL_API void cgGLSetParameter2f( CGparameter param, float x, float y )
|
|||||||
ptr->setterIndex( ptr, v, CG_GETINDEX( param ) );
|
ptr->setterIndex( ptr, v, CG_GETINDEX( param ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameter3f( CGparameter param, float x, float y, float z )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *ptr = rglCgGLTestParameter( param );
|
|
||||||
|
|
||||||
// otherwise apply the values to the parameter
|
|
||||||
float v[4] = {x, y, z, z};
|
|
||||||
ptr->setterIndex( ptr, v, CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameter4f( CGparameter param, float x, float y, float z, float w )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *ptr = rglCgGLTestParameter( param );
|
|
||||||
|
|
||||||
// otherwise apply the values to the parameter
|
|
||||||
float v[4] = {x, y, z, w};
|
|
||||||
ptr->setterIndex( ptr, v, CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameter1fv( CGparameter param, const float *v )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *ptr = rglCgGLTestParameter( param );
|
|
||||||
|
|
||||||
float v2[4] = { v[0], v[0], v[0], v[0]};
|
|
||||||
ptr->setterIndex( ptr, v2, CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameter2fv( CGparameter param, const float *v )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *ptr = rglCgGLTestParameter( param );
|
|
||||||
|
|
||||||
float v2[4] = { v[0], v[1], v[1], v[1]};
|
|
||||||
ptr->setterIndex( ptr, v2, CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameter3fv( CGparameter param, const float *v )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *ptr = rglCgGLTestParameter( param );
|
|
||||||
|
|
||||||
float v2[4] = { v[0], v[1], v[2], v[2]};
|
|
||||||
ptr->setterIndex( ptr, v2, CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameter4fv( CGparameter param, const float *v )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter *ptr = rglCgGLTestParameter( param );
|
|
||||||
|
|
||||||
float v2[4] = { v[0], v[1], v[2], v[3]};
|
|
||||||
ptr->setterIndex( ptr, v2, CG_GETINDEX( param ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameter1f( CGparameter param, float *v )
|
|
||||||
{
|
|
||||||
//check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return;
|
|
||||||
|
|
||||||
const CgParameterEntry *parameterEntry = rtParameter->parameterEntry;
|
|
||||||
if (( parameterEntry->flags & CGP_TYPE_MASK ) != CGP_INTRINSIC ||
|
|
||||||
(( parameterEntry->flags & CGPV_MASK ) != CGPV_UNIFORM && ( parameterEntry->flags & CGPV_MASK ) != CGPV_CONSTANT ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// uniforms only
|
|
||||||
float* value = rglGetUniformValuePtr( param, rtParameter );
|
|
||||||
if ( !value )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const CgParameterResource *parameterResource = rglGetParameterResource( rtParameter->program, parameterEntry );
|
|
||||||
|
|
||||||
switch ( parameterResource->type )
|
|
||||||
{
|
|
||||||
case CG_FLOAT4:
|
|
||||||
case CG_FLOAT3:
|
|
||||||
case CG_FLOAT2:
|
|
||||||
case CG_FLOAT:
|
|
||||||
case CG_HALF4:
|
|
||||||
case CG_HALF3:
|
|
||||||
case CG_HALF2:
|
|
||||||
case CG_HALF:
|
|
||||||
case CG_INT4:
|
|
||||||
case CG_INT3:
|
|
||||||
case CG_INT2:
|
|
||||||
case CG_INT:
|
|
||||||
case CG_BOOL4:
|
|
||||||
case CG_BOOL3:
|
|
||||||
case CG_BOOL2:
|
|
||||||
case CG_BOOL:
|
|
||||||
case CG_FIXED4:
|
|
||||||
case CG_FIXED3:
|
|
||||||
case CG_FIXED2:
|
|
||||||
case CG_FIXED:
|
|
||||||
*v = *value; // fall through...
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameter2f( CGparameter param, float *v )
|
|
||||||
{
|
|
||||||
//check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return;
|
|
||||||
|
|
||||||
const CgParameterEntry *parameterEntry = rtParameter->parameterEntry;
|
|
||||||
if (( parameterEntry->flags & CGP_TYPE_MASK ) != CGP_INTRINSIC ||
|
|
||||||
(( parameterEntry->flags & CGPV_MASK ) != CGPV_UNIFORM && ( parameterEntry->flags & CGPV_MASK ) != CGPV_CONSTANT ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// uniforms only
|
|
||||||
float* value = rglGetUniformValuePtr( param, rtParameter );
|
|
||||||
if ( !value )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// peek into image for value
|
|
||||||
const CgParameterResource *parameterResource = rglGetParameterResource( rtParameter->program, parameterEntry );
|
|
||||||
switch ( parameterResource->type )
|
|
||||||
{
|
|
||||||
case CG_FLOAT2:
|
|
||||||
case CG_FLOAT3:
|
|
||||||
case CG_FLOAT4:
|
|
||||||
case CG_HALF2:
|
|
||||||
case CG_HALF3:
|
|
||||||
case CG_HALF4:
|
|
||||||
case CG_INT2:
|
|
||||||
case CG_INT3:
|
|
||||||
case CG_INT4:
|
|
||||||
case CG_BOOL2:
|
|
||||||
case CG_BOOL3:
|
|
||||||
case CG_BOOL4:
|
|
||||||
case CG_FIXED2:
|
|
||||||
case CG_FIXED3:
|
|
||||||
case CG_FIXED4:
|
|
||||||
v[0] = value[0];
|
|
||||||
v[1] = value[1];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameter3f( CGparameter param, float *v )
|
|
||||||
{
|
|
||||||
//check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return;
|
|
||||||
|
|
||||||
const CgParameterEntry *parameterEntry = rtParameter->parameterEntry;
|
|
||||||
if (( parameterEntry->flags & CGP_TYPE_MASK ) != CGP_INTRINSIC ||
|
|
||||||
(( parameterEntry->flags & CGPV_MASK ) != CGPV_UNIFORM && ( parameterEntry->flags & CGPV_MASK ) != CGPV_CONSTANT ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// uniforms only
|
|
||||||
float* value = rglGetUniformValuePtr( param, rtParameter );
|
|
||||||
if ( !value )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// peek into image for value
|
|
||||||
const CgParameterResource *parameterResource = rglGetParameterResource( rtParameter->program, parameterEntry );
|
|
||||||
switch ( parameterResource->type )
|
|
||||||
{
|
|
||||||
case CG_FLOAT3:
|
|
||||||
case CG_FLOAT4:
|
|
||||||
case CG_HALF3:
|
|
||||||
case CG_HALF4:
|
|
||||||
case CG_INT3:
|
|
||||||
case CG_INT4:
|
|
||||||
case CG_BOOL3:
|
|
||||||
case CG_BOOL4:
|
|
||||||
case CG_FIXED3:
|
|
||||||
case CG_FIXED4:
|
|
||||||
v[0] = value[0];
|
|
||||||
v[1] = value[1];
|
|
||||||
v[2] = value[2];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameter4f( CGparameter param, float *v )
|
|
||||||
{
|
|
||||||
//check parameter handle
|
|
||||||
CgRuntimeParameter *rtParameter = rglCgGLTestParameter( param );
|
|
||||||
if ( !rtParameter )
|
|
||||||
return;
|
|
||||||
|
|
||||||
const CgParameterEntry *parameterEntry = rtParameter->parameterEntry;
|
|
||||||
if (( parameterEntry->flags & CGP_TYPE_MASK ) != CGP_INTRINSIC ||
|
|
||||||
(( parameterEntry->flags & CGPV_MASK ) != CGPV_UNIFORM && ( parameterEntry->flags & CGPV_MASK ) != CGPV_CONSTANT ) )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// uniforms only
|
|
||||||
float* value = rglGetUniformValuePtr( param, rtParameter );
|
|
||||||
if ( !value )
|
|
||||||
{
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// peek into image for value
|
|
||||||
const CgParameterResource *parameterResource = rglGetParameterResource( rtParameter->program, parameterEntry );
|
|
||||||
switch ( parameterResource->type )
|
|
||||||
{
|
|
||||||
case CG_FLOAT4:
|
|
||||||
case CG_HALF4:
|
|
||||||
case CG_INT4:
|
|
||||||
case CG_BOOL4:
|
|
||||||
case CG_FIXED4:
|
|
||||||
v[0] = value[0];
|
|
||||||
v[1] = value[1];
|
|
||||||
v[2] = value[2];
|
|
||||||
v[3] = value[3];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameterArray1f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
const float *v )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter* ptr = _cgGLTestArrayParameter( param, offset, nelements );
|
|
||||||
|
|
||||||
|
|
||||||
if ( nelements == 0 )
|
|
||||||
{
|
|
||||||
const CgParameterArray *parameterArray = rglGetParameterArray( ptr->program, ptr->parameterEntry );
|
|
||||||
nelements = rglGetSizeofSubArray( parameterArray->dimensions, parameterArray->dimensionCount ) - offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
//we have an array here, the parameterEntry of the type is the next one
|
|
||||||
ptr++;
|
|
||||||
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
ptr->setterIndex( ptr, v + i, i + offset );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameterArray2f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
const float *v )
|
|
||||||
{
|
|
||||||
CgRuntimeParameter* ptr = _cgGLTestArrayParameter( param, offset, nelements );
|
|
||||||
|
|
||||||
if ( nelements == 0 )
|
|
||||||
{
|
|
||||||
const CgParameterArray *parameterArray = rglGetParameterArray( ptr->program, ptr->parameterEntry );
|
|
||||||
nelements = rglGetSizeofSubArray( parameterArray->dimensions, parameterArray->dimensionCount ) - offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
//we have an array here, the parameterEntry of the type is the next one
|
|
||||||
ptr++;
|
|
||||||
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
ptr->setterIndex( ptr, v + 2 * i, i + offset );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameterArray3f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
const float *v )
|
|
||||||
{
|
|
||||||
|
|
||||||
CgRuntimeParameter* ptr = _cgGLTestArrayParameter( param, offset, nelements );
|
|
||||||
if ( nelements == 0 )
|
|
||||||
{
|
|
||||||
const CgParameterArray *parameterArray = rglGetParameterArray( ptr->program, ptr->parameterEntry );
|
|
||||||
nelements = rglGetSizeofSubArray( parameterArray->dimensions, parameterArray->dimensionCount ) - offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
//we have an array here, the parameterEntry of the type is the next one
|
|
||||||
ptr++;
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
ptr->setterIndex( ptr, v + 3 * i, i + offset );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameterArray4f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
const float *v )
|
|
||||||
{
|
|
||||||
|
|
||||||
CgRuntimeParameter* ptr = _cgGLTestArrayParameter( param, offset, nelements );
|
|
||||||
if ( nelements == 0 )
|
|
||||||
{
|
|
||||||
const CgParameterArray *parameterArray = rglGetParameterArray( ptr->program, ptr->parameterEntry );
|
|
||||||
nelements = rglGetSizeofSubArray( parameterArray->dimensions, parameterArray->dimensionCount ) - offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
//we have an array here, the parameterEntry of the type is the next one
|
|
||||||
ptr++;
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
ptr->setterIndex( ptr, v + 4 * i, i + offset );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameterArray1f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
float *v )
|
|
||||||
{
|
|
||||||
if ( nelements == 0 ) nelements = cgGetArraySize( param, 0 ) - offset;
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
CGparameter p = cgGetArrayParameter( param, i + offset );
|
|
||||||
cgGLGetParameter1f( p, v + i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameterArray2f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
float *v )
|
|
||||||
{
|
|
||||||
if ( nelements == 0 ) nelements = cgGetArraySize( param, 0 ) - offset;
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
CGparameter p = cgGetArrayParameter( param, i + offset );
|
|
||||||
cgGLGetParameter2f( p, v + 2*i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameterArray3f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
float *v )
|
|
||||||
{
|
|
||||||
|
|
||||||
if ( nelements == 0 ) nelements = cgGetArraySize( param, 0 ) - offset;
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
CGparameter p = cgGetArrayParameter( param, i + offset );
|
|
||||||
cgGLGetParameter3f( p, v + 3*i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLGetParameterArray4f( CGparameter param,
|
|
||||||
long offset,
|
|
||||||
long nelements,
|
|
||||||
float *v )
|
|
||||||
{
|
|
||||||
|
|
||||||
if ( nelements == 0 ) nelements = cgGetArraySize( param, 0 ) - offset;
|
|
||||||
// loop over array elements
|
|
||||||
for ( int i = 0; i < nelements; ++i )
|
|
||||||
{
|
|
||||||
CGparameter p = cgGetArrayParameter( param, i + offset );
|
|
||||||
cgGLGetParameter4f( p, v + 4*i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetParameterPointer( CGparameter param,
|
CGGL_API void cgGLSetParameterPointer( CGparameter param,
|
||||||
GLint fsize,
|
GLint fsize,
|
||||||
GLenum type,
|
GLenum type,
|
||||||
@ -4495,33 +3668,6 @@ CGGL_API void cgGLDisableTextureParameter( CGparameter param )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CGGL_API GLenum cgGLGetTextureEnum( CGparameter param )
|
|
||||||
{
|
|
||||||
// The returned value is the texture unit assigned to this parameter
|
|
||||||
// by the Cg compiler.
|
|
||||||
CgRuntimeParameter* ptr = _cgGLTestTextureParameter( param );
|
|
||||||
if ( ptr == NULL ) return GL_INVALID_OPERATION;
|
|
||||||
|
|
||||||
if ( ptr->parameterEntry->flags & CGP_RTCREATED )
|
|
||||||
{
|
|
||||||
// runtime created texture parameters do not have allocated texture units
|
|
||||||
rglCgRaiseError( CG_INVALID_PARAMETER_ERROR );
|
|
||||||
return GL_INVALID_OPERATION;
|
|
||||||
}
|
|
||||||
|
|
||||||
// XXX what about the vertex texture enums !?
|
|
||||||
if ( ptr->program->header.profile == CG_PROFILE_SCE_VP_RSX)
|
|
||||||
return GL_INVALID_OPERATION;
|
|
||||||
|
|
||||||
if ( !( ptr->parameterEntry->flags & CGPF_REFERENCED ) || !(( ptr->parameterEntry->flags & CGPV_MASK ) == CGPV_UNIFORM ) ) { rglCgRaiseError( CG_INVALID_PARAMETER_ERROR ); return GL_INVALID_OPERATION; }
|
|
||||||
const CgParameterResource *parameterResource = rglGetParameterResource( ptr->program, ptr->parameterEntry );
|
|
||||||
return GL_TEXTURE0 + parameterResource->resource - CG_TEXUNIT0;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGGL_API void cgGLSetDebugMode( CGbool debug )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
CG NV2ELF
|
CG NV2ELF
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
@ -2657,11 +2657,7 @@ GLAPI void APIENTRY glTextureReferenceSCE( GLenum target, GLuint levels,
|
|||||||
newLayout.pixelBits = rglPlatformGetBitsPerPixel( newLayout.internalFormat );
|
newLayout.pixelBits = rglPlatformGetBitsPerPixel( newLayout.internalFormat );
|
||||||
newLayout.pitch = pitch ? pitch : GET_TEXTURE_PITCH(texture);
|
newLayout.pitch = pitch ? pitch : GET_TEXTURE_PITCH(texture);
|
||||||
|
|
||||||
GLboolean isRenderTarget = GL_FALSE;
|
texture->isRenderTarget = GL_FALSE;
|
||||||
GLboolean vertexEnable = GL_FALSE;
|
|
||||||
|
|
||||||
texture->isRenderTarget = isRenderTarget;
|
|
||||||
texture->vertexEnable = vertexEnable;
|
|
||||||
|
|
||||||
if ( gcmTexture->gpuAddressId != GMM_ERROR )
|
if ( gcmTexture->gpuAddressId != GMM_ERROR )
|
||||||
rglPlatformDestroyTexture( texture );
|
rglPlatformDestroyTexture( texture );
|
||||||
|
@ -143,7 +143,7 @@ extern int audioAddData(uint32_t portNum, float *data, uint32_t frames, float vo
|
|||||||
OSK PROTOTYPES
|
OSK PROTOTYPES
|
||||||
============================================================ */
|
============================================================ */
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSK
|
||||||
|
|
||||||
#ifdef __PSL1GHT__
|
#ifdef __PSL1GHT__
|
||||||
#include <sysutil/osk.h>
|
#include <sysutil/osk.h>
|
||||||
|
@ -220,6 +220,8 @@ else
|
|||||||
HAVE_GLES=no
|
HAVE_GLES=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
check_pkgconf V4L2 libv4l2
|
||||||
|
|
||||||
if [ "$OS" = 'Darwin' ]; then
|
if [ "$OS" = 'Darwin' ]; then
|
||||||
check_lib FBO "-framework OpenGL" glFramebufferTexture2D
|
check_lib FBO "-framework OpenGL" glFramebufferTexture2D
|
||||||
else
|
else
|
||||||
@ -258,6 +260,6 @@ add_define_make OS "$OS"
|
|||||||
|
|
||||||
# Creates config.mk and config.h.
|
# Creates config.mk and config.h.
|
||||||
add_define_make GLOBAL_CONFIG_DIR "$GLOBAL_CONFIG_DIR"
|
add_define_make GLOBAL_CONFIG_DIR "$GLOBAL_CONFIG_DIR"
|
||||||
VARS="RGUI ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL GLES VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG LIBXML2 SDL_IMAGE ZLIB DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE XVIDEO X11 XEXT XF86VM XINERAMA NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL MMAP PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 BSV_MOVIE VIDEOCORE NEON FLOATHARD FLOATSOFTFP UDEV"
|
VARS="RGUI ALSA OSS OSS_BSD OSS_LIB AL RSOUND ROAR JACK COREAUDIO PULSE SDL OPENGL GLES VG EGL KMS GBM DRM DYLIB GETOPT_LONG THREADS CG LIBXML2 SDL_IMAGE ZLIB DYNAMIC FFMPEG AVCODEC AVFORMAT AVUTIL SWSCALE FREETYPE XVIDEO X11 XEXT XF86VM XINERAMA NETPLAY NETWORK_CMD STDIN_CMD COMMAND SOCKET_LEGACY FBO STRL MMAP PYTHON FFMPEG_ALLOC_CONTEXT3 FFMPEG_AVCODEC_OPEN2 FFMPEG_AVIO_OPEN FFMPEG_AVFORMAT_WRITE_HEADER FFMPEG_AVFORMAT_NEW_STREAM FFMPEG_AVCODEC_ENCODE_AUDIO2 FFMPEG_AVCODEC_ENCODE_VIDEO2 BSV_MOVIE VIDEOCORE NEON FLOATHARD FLOATSOFTFP UDEV V4L2"
|
||||||
create_config_make config.mk $VARS
|
create_config_make config.mk $VARS
|
||||||
create_config_header config.h $VARS
|
create_config_header config.h $VARS
|
||||||
|
@ -31,6 +31,7 @@ HAVE_FREETYPE=auto # Enable FreeType support
|
|||||||
HAVE_XVIDEO=auto # Enable XVideo support
|
HAVE_XVIDEO=auto # Enable XVideo support
|
||||||
HAVE_SDL_IMAGE=auto # Enable SDL_image support
|
HAVE_SDL_IMAGE=auto # Enable SDL_image support
|
||||||
HAVE_PYTHON=auto # Enable Python 3 support for shaders
|
HAVE_PYTHON=auto # Enable Python 3 support for shaders
|
||||||
|
HAVE_V4L2=auto # Enable video4linux2 support
|
||||||
HAVE_BSV_MOVIE=yes # Disable BSV movie support
|
HAVE_BSV_MOVIE=yes # Disable BSV movie support
|
||||||
HAVE_NEON=no # Forcefully enable ARM NEON optimizations
|
HAVE_NEON=no # Forcefully enable ARM NEON optimizations
|
||||||
HAVE_SSE=no # Forcefully enable x86 SSE optimizations (SSE, SSE2)
|
HAVE_SSE=no # Forcefully enable x86 SSE optimizations (SSE, SSE2)
|
||||||
|
27
retroarch.c
27
retroarch.c
@ -533,6 +533,7 @@ void rarch_input_poll(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef RARCH_CONSOLE
|
||||||
// Turbo scheme: If turbo button is held, all buttons pressed except for D-pad will go into
|
// Turbo scheme: If turbo button is held, all buttons pressed except for D-pad will go into
|
||||||
// a turbo mode. Until the button is released again, the input state will be modulated by a periodic pulse defined
|
// a turbo mode. Until the button is released again, the input state will be modulated by a periodic pulse defined
|
||||||
// by the configured duty cycle.
|
// by the configured duty cycle.
|
||||||
@ -548,6 +549,7 @@ static bool input_apply_turbo(unsigned port, unsigned id, bool res)
|
|||||||
else
|
else
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int16_t input_state(unsigned port, unsigned device, unsigned index, unsigned id)
|
static int16_t input_state(unsigned port, unsigned device, unsigned index, unsigned id)
|
||||||
{
|
{
|
||||||
@ -1994,7 +1996,6 @@ static void check_savestates(bool immutable)
|
|||||||
void rarch_set_fullscreen(bool fullscreen)
|
void rarch_set_fullscreen(bool fullscreen)
|
||||||
{
|
{
|
||||||
g_settings.video.fullscreen = fullscreen;
|
g_settings.video.fullscreen = fullscreen;
|
||||||
|
|
||||||
driver.video_cache_context = g_extern.system.hw_render_callback.cache_context;
|
driver.video_cache_context = g_extern.system.hw_render_callback.cache_context;
|
||||||
driver.video_cache_context_ack = false;
|
driver.video_cache_context_ack = false;
|
||||||
uninit_drivers();
|
uninit_drivers();
|
||||||
@ -2012,9 +2013,10 @@ static bool check_fullscreen(void)
|
|||||||
static bool was_pressed = false;
|
static bool was_pressed = false;
|
||||||
bool pressed = input_key_pressed_func(RARCH_FULLSCREEN_TOGGLE_KEY);
|
bool pressed = input_key_pressed_func(RARCH_FULLSCREEN_TOGGLE_KEY);
|
||||||
bool toggle = pressed && !was_pressed;
|
bool toggle = pressed && !was_pressed;
|
||||||
|
|
||||||
if (toggle)
|
if (toggle)
|
||||||
{
|
{
|
||||||
settings_set(1ULL << S_VIDEO_FULLSCREEN_TOGGLE);
|
g_settings.video.fullscreen = !g_settings.video.fullscreen;
|
||||||
rarch_set_fullscreen(g_settings.video.fullscreen);
|
rarch_set_fullscreen(g_settings.video.fullscreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2030,11 +2032,7 @@ void rarch_state_slot_increase(void)
|
|||||||
msg_queue_clear(g_extern.msg_queue);
|
msg_queue_clear(g_extern.msg_queue);
|
||||||
char msg[256];
|
char msg[256];
|
||||||
|
|
||||||
#ifdef HAVE_BSV_MOVIE
|
snprintf(msg, sizeof(msg), "State slot: %u", g_extern.state_slot);
|
||||||
snprintf(msg, sizeof(msg), "Save state/movie slot: %u", g_extern.state_slot);
|
|
||||||
#else
|
|
||||||
snprintf(msg, sizeof(msg), "Save state slot: %u", g_extern.state_slot);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (g_extern.msg_queue)
|
if (g_extern.msg_queue)
|
||||||
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
|
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
|
||||||
@ -2052,11 +2050,7 @@ void rarch_state_slot_decrease(void)
|
|||||||
|
|
||||||
char msg[256];
|
char msg[256];
|
||||||
|
|
||||||
#ifdef HAVE_BSV_MOVIE
|
snprintf(msg, sizeof(msg), "State slot: %u", g_extern.state_slot);
|
||||||
snprintf(msg, sizeof(msg), "Save state/movie slot: %u", g_extern.state_slot);
|
|
||||||
#else
|
|
||||||
snprintf(msg, sizeof(msg), "Save state slot: %u", g_extern.state_slot);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (g_extern.msg_queue)
|
if (g_extern.msg_queue)
|
||||||
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
|
msg_queue_push(g_extern.msg_queue, msg, 1, 180);
|
||||||
@ -2536,14 +2530,14 @@ void rarch_disk_control_set_index(unsigned next_index)
|
|||||||
if (next_index < num_disks)
|
if (next_index < num_disks)
|
||||||
snprintf(msg, sizeof(msg), "Setting disk %u of %u in tray.", next_index + 1, num_disks);
|
snprintf(msg, sizeof(msg), "Setting disk %u of %u in tray.", next_index + 1, num_disks);
|
||||||
else
|
else
|
||||||
snprintf(msg, sizeof(msg), "Removed disk from tray.");
|
strlcpy(msg, "Removed disk from tray.", sizeof(msg));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (next_index < num_disks)
|
if (next_index < num_disks)
|
||||||
snprintf(msg, sizeof(msg), "Failed to set disk %u of %u.", next_index + 1, num_disks);
|
snprintf(msg, sizeof(msg), "Failed to set disk %u of %u.", next_index + 1, num_disks);
|
||||||
else
|
else
|
||||||
snprintf(msg, sizeof(msg), "Failed to remove disk from tray.");
|
strlcpy(msg, "Failed to remove disk from tray.", sizeof(msg));
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3141,6 +3135,11 @@ bool rarch_main_iterate(void)
|
|||||||
bsv_movie_set_frame_start(g_extern.bsv.movie);
|
bsv_movie_set_frame_start(g_extern.bsv.movie);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
if (g_extern.system.camera_callback.caps)
|
||||||
|
driver_camera_poll();
|
||||||
|
#endif
|
||||||
|
|
||||||
update_frame_time();
|
update_frame_time();
|
||||||
pretro_run();
|
pretro_run();
|
||||||
limit_frame_time();
|
limit_frame_time();
|
||||||
|
224
settings.c
224
settings.c
@ -148,13 +148,33 @@ const char *config_get_default_input(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
const char *config_get_default_camera(void)
|
||||||
|
{
|
||||||
|
switch (CAMERA_DEFAULT_DRIVER)
|
||||||
|
{
|
||||||
|
case CAMERA_V4L2:
|
||||||
|
return "video4linux2";
|
||||||
|
case CAMERA_NULL:
|
||||||
|
return "null";
|
||||||
|
default:
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void config_set_defaults(void)
|
void config_set_defaults(void)
|
||||||
{
|
{
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
const char *def_video = config_get_default_video();
|
const char *def_video = config_get_default_video();
|
||||||
const char *def_audio = config_get_default_audio();
|
const char *def_audio = config_get_default_audio();
|
||||||
const char *def_input = config_get_default_input();
|
const char *def_input = config_get_default_input();
|
||||||
|
#ifdef HAVE_CAMERA
|
||||||
|
const char *def_camera = config_get_default_camera();
|
||||||
|
|
||||||
|
if (def_camera)
|
||||||
|
strlcpy(g_settings.camera.driver, def_camera, sizeof(g_settings.camera.driver));
|
||||||
|
#endif
|
||||||
if (def_video)
|
if (def_video)
|
||||||
strlcpy(g_settings.video.driver, def_video, sizeof(g_settings.video.driver));
|
strlcpy(g_settings.video.driver, def_video, sizeof(g_settings.video.driver));
|
||||||
if (def_audio)
|
if (def_audio)
|
||||||
@ -317,9 +337,6 @@ void config_set_defaults(void)
|
|||||||
|
|
||||||
g_extern.console.screen.resolutions.current.id = 0;
|
g_extern.console.screen.resolutions.current.id = 0;
|
||||||
strlcpy(g_extern.savestate_dir, default_paths.savestate_dir, sizeof(g_extern.savestate_dir));
|
strlcpy(g_extern.savestate_dir, default_paths.savestate_dir, sizeof(g_extern.savestate_dir));
|
||||||
#ifdef HAVE_RMENU
|
|
||||||
strlcpy(g_extern.menu_texture_path, default_paths.menu_border_file, sizeof(g_extern.menu_texture_path));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_extern.state_slot = 0;
|
g_extern.state_slot = 0;
|
||||||
g_extern.audio_data.mute = 0;
|
g_extern.audio_data.mute = 0;
|
||||||
@ -1161,204 +1178,3 @@ bool config_save_file(const char *path)
|
|||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void settings_set(uint64_t settings)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_OVERLAY
|
|
||||||
if (settings & (1ULL << S_INPUT_OVERLAY_OPACITY_DECREMENT))
|
|
||||||
{
|
|
||||||
g_settings.input.overlay_opacity -= 0.01f;
|
|
||||||
|
|
||||||
if (g_settings.input.overlay_opacity < 0.0f)
|
|
||||||
g_settings.input.overlay_opacity = 0.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_INPUT_OVERLAY_OPACITY_INCREMENT))
|
|
||||||
{
|
|
||||||
g_settings.input.overlay_opacity += 0.01f;
|
|
||||||
|
|
||||||
if (g_settings.input.overlay_opacity > 1.0f)
|
|
||||||
g_settings.input.overlay_opacity = 1.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_INPUT_OVERLAY_OPACITY))
|
|
||||||
g_settings.input.overlay_opacity = 1.0f;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_INPUT_OVERLAY_SCALE_DECREMENT))
|
|
||||||
{
|
|
||||||
g_settings.input.overlay_scale -= 0.01f;
|
|
||||||
|
|
||||||
if (g_settings.input.overlay_scale < 0.01f) // Avoid potential divide by zero.
|
|
||||||
g_settings.input.overlay_scale = 0.01f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_INPUT_OVERLAY_SCALE_INCREMENT))
|
|
||||||
{
|
|
||||||
g_settings.input.overlay_scale += 0.01f;
|
|
||||||
|
|
||||||
if (g_settings.input.overlay_scale > 2.0f)
|
|
||||||
g_settings.input.overlay_scale = 2.0f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_INPUT_OVERLAY_SCALE))
|
|
||||||
g_settings.input.overlay_scale = 1.0f;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_REWIND_GRANULARITY_INCREMENT))
|
|
||||||
g_settings.rewind_granularity++;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_REWIND_GRANULARITY_DECREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.rewind_granularity > 1)
|
|
||||||
g_settings.rewind_granularity--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_REWIND_GRANULARITY))
|
|
||||||
g_settings.rewind_granularity = 1;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_VIDEO_VSYNC_TOGGLE))
|
|
||||||
g_settings.video.vsync = !g_settings.video.vsync;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_VIDEO_FULLSCREEN_TOGGLE))
|
|
||||||
g_settings.video.fullscreen = !g_settings.video.fullscreen;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_VIDEO_VSYNC))
|
|
||||||
g_settings.video.vsync = true;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_ASPECT_RATIO_DECREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.video.aspect_ratio_idx > 0)
|
|
||||||
g_settings.video.aspect_ratio_idx--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_ASPECT_RATIO_INCREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.video.aspect_ratio_idx < LAST_ASPECT_RATIO)
|
|
||||||
g_settings.video.aspect_ratio_idx++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_SCALE_INTEGER_TOGGLE))
|
|
||||||
g_settings.video.scale_integer = !g_settings.video.scale_integer;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_AUDIO_MUTE))
|
|
||||||
g_extern.audio_data.mute = !g_extern.audio_data.mute;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_AUDIO_CONTROL_RATE_DECREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.audio.rate_control_delta > 0.0)
|
|
||||||
g_settings.audio.rate_control_delta -= 0.001;
|
|
||||||
|
|
||||||
if (g_settings.audio.rate_control_delta < 0.0005)
|
|
||||||
{
|
|
||||||
g_settings.audio.rate_control = false;
|
|
||||||
g_settings.audio.rate_control_delta = 0.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
g_settings.audio.rate_control = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_AUDIO_CONTROL_RATE_INCREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.audio.rate_control_delta < 0.2)
|
|
||||||
g_settings.audio.rate_control_delta += 0.001;
|
|
||||||
g_settings.audio.rate_control = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_HW_TEXTURE_FILTER))
|
|
||||||
g_settings.video.smooth = !g_settings.video.smooth;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_RESOLUTION_PREVIOUS))
|
|
||||||
{
|
|
||||||
if (g_extern.console.screen.resolutions.current.idx)
|
|
||||||
{
|
|
||||||
g_extern.console.screen.resolutions.current.idx--;
|
|
||||||
g_extern.console.screen.resolutions.current.id =
|
|
||||||
g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_RESOLUTION_NEXT))
|
|
||||||
{
|
|
||||||
if (g_extern.console.screen.resolutions.current.idx + 1 <
|
|
||||||
g_extern.console.screen.resolutions.count)
|
|
||||||
{
|
|
||||||
g_extern.console.screen.resolutions.current.idx++;
|
|
||||||
g_extern.console.screen.resolutions.current.id =
|
|
||||||
g_extern.console.screen.resolutions.list[g_extern.console.screen.resolutions.current.idx];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_ROTATION_DECREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.video.rotation > 0)
|
|
||||||
g_settings.video.rotation--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_ROTATION_INCREMENT))
|
|
||||||
{
|
|
||||||
if (g_settings.video.rotation < LAST_ORIENTATION)
|
|
||||||
g_settings.video.rotation++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_REWIND))
|
|
||||||
g_settings.rewind_enable = !g_settings.rewind_enable;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_SAVESTATE_DECREMENT))
|
|
||||||
{
|
|
||||||
if (g_extern.state_slot != 0)
|
|
||||||
g_extern.state_slot--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_SAVESTATE_INCREMENT))
|
|
||||||
g_extern.state_slot++;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_TRIPLE_BUFFERING))
|
|
||||||
{
|
|
||||||
if (g_extern.lifecycle_state & (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE))
|
|
||||||
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
|
||||||
else
|
|
||||||
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_REFRESH_RATE_DECREMENT))
|
|
||||||
g_settings.video.refresh_rate -= 0.01f;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_REFRESH_RATE_INCREMENT))
|
|
||||||
g_settings.video.refresh_rate += 0.01f;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_INFO_DEBUG_MSG_TOGGLE))
|
|
||||||
g_settings.fps_show = !g_settings.fps_show;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_ASPECT_RATIO))
|
|
||||||
g_settings.video.aspect_ratio_idx = aspect_ratio_idx;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_SCALE_INTEGER))
|
|
||||||
g_settings.video.scale_integer = scale_integer;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_AUDIO_MUTE))
|
|
||||||
g_extern.audio_data.mute = false;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_AUDIO_CONTROL_RATE))
|
|
||||||
{
|
|
||||||
g_settings.audio.rate_control_delta = rate_control_delta;
|
|
||||||
g_settings.audio.rate_control = rate_control;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_HW_TEXTURE_FILTER))
|
|
||||||
g_settings.video.smooth = video_smooth;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_ROTATION))
|
|
||||||
g_settings.video.rotation = ORIENTATION_NORMAL;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_TRIPLE_BUFFERING))
|
|
||||||
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_TRIPLE_BUFFERING_ENABLE);
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_SAVE_STATE))
|
|
||||||
g_extern.state_slot = 0;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_REFRESH_RATE))
|
|
||||||
g_settings.video.refresh_rate = refresh_rate;
|
|
||||||
|
|
||||||
if (settings & (1ULL << S_DEF_INFO_DEBUG_MSG))
|
|
||||||
g_settings.fps_show = false;
|
|
||||||
}
|
|
||||||
|
@ -34,10 +34,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _XBOX1
|
|
||||||
#define HAVE_MENU_PANEL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "../xdk/xdk_resources.h"
|
#include "../xdk/xdk_resources.h"
|
||||||
|
|
||||||
#if defined(_XBOX1)
|
#if defined(_XBOX1)
|
||||||
@ -780,10 +776,6 @@ static bool texture_image_render(struct texture_image *out_img,
|
|||||||
|
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
|
|
||||||
#ifdef HAVE_MENU_PANEL
|
|
||||||
extern struct texture_image *menu_panel;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static inline void xdk_d3d_draw_texture(void *data)
|
static inline void xdk_d3d_draw_texture(void *data)
|
||||||
{
|
{
|
||||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
|
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)data;
|
||||||
@ -803,16 +795,6 @@ static inline void xdk_d3d_draw_texture(void *data)
|
|||||||
640, 480, true);
|
640, 480, true);
|
||||||
d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
|
d3d->d3d_render_device->SetRenderState(D3DRS_ALPHABLENDENABLE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MENU_PANEL
|
|
||||||
if ((menu_panel->x != 0) || (menu_panel->y != 0))
|
|
||||||
{
|
|
||||||
texture_image_render(menu_panel, menu_panel->x, menu_panel->y,
|
|
||||||
610, 20, false);
|
|
||||||
menu_panel->x = 0;
|
|
||||||
menu_panel->y = 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -286,6 +286,7 @@ static bool xdk_input_set_rumble(void *data, unsigned port, enum retro_rumble_ef
|
|||||||
rumble_state.wRightMotorSpeed = strength;
|
rumble_state.wRightMotorSpeed = strength;
|
||||||
val = XInputSetState(port, &rumble_state) == ERROR_SUCCESS;
|
val = XInputSetState(port, &rumble_state) == ERROR_SUCCESS;
|
||||||
#elif defined(_XBOX1)
|
#elif defined(_XBOX1)
|
||||||
|
#if 0
|
||||||
XINPUT_FEEDBACK rumble_state;
|
XINPUT_FEEDBACK rumble_state;
|
||||||
|
|
||||||
if (effect == RETRO_RUMBLE_STRONG)
|
if (effect == RETRO_RUMBLE_STRONG)
|
||||||
@ -293,6 +294,7 @@ static bool xdk_input_set_rumble(void *data, unsigned port, enum retro_rumble_ef
|
|||||||
else if (effect == RETRO_RUMBLE_WEAK)
|
else if (effect == RETRO_RUMBLE_WEAK)
|
||||||
rumble_state.Rumble.wRightMotorSpeed = strength;
|
rumble_state.Rumble.wRightMotorSpeed = strength;
|
||||||
val = XInputSetState(xdk->gamepads[port], &rumble_state) == ERROR_SUCCESS;
|
val = XInputSetState(xdk->gamepads[port], &rumble_state) == ERROR_SUCCESS;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user