From c62d52de0f80bbd8bd7a57c88bb25470b5f4a6aa Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 21 Oct 2014 05:05:52 +0200 Subject: [PATCH] Start properly implementing libretro SDK for boolean.h include header, glsym, and rthreads --- Makefile.common | 10 +- Makefile.griffin | 2 + Makefile.ps3 | 2 +- Makefile.psp1 | 2 +- android/phoenix/jni/Android.mk | 6 +- android/phoenix/jni/apk-extract/apk-extract.c | 8 +- apple/iOS/bluetooth/btdynamic.h | 2 +- audio/alsathread.c | 2 +- audio/audio_thread_wrapper.c | 2 +- audio/audio_thread_wrapper.h | 2 +- audio/coreaudio.c | 2 +- audio/dsound.c | 2 +- audio/gx_audio.c | 2 +- audio/jack.c | 2 +- audio/opensl.c | 2 +- audio/pulse.c | 2 +- audio/resamplers/resampler.h | 2 +- audio/roar.c | 2 +- audio/rsound.c | 4 +- audio/rsound.h | 6 +- audio/sdl_audio.c | 4 +- audio/utils.c | 2 +- audio/xaudio-c/xaudio-c.cpp | 2 +- audio/xenon360_audio.c | 2 +- autosave.c | 2 +- camera/android.c | 2 +- command.h | 2 +- compat/compat.c | 2 +- compat/rxml/rxml.c | 2 +- conf/config_file.h | 2 +- config.def.h | 2 +- config.features.h | 2 +- core_options.h | 2 +- dir_list.c | 10 + driver.h | 2 +- dynamic.c | 2 +- dynamic.h | 2 +- dynamic_dummy.h | 2 +- emscripten/RWebAudio.h | 2 +- emscripten/RWebCam.h | 2 +- file.c | 2 +- file.h | 2 +- file_extract.h | 2 +- file_list.h | 2 +- file_path.c | 2 +- file_path.h | 2 +- frontend/frontend.h | 2 +- frontend/frontend_context.h | 2 +- frontend/frontend_salamander.c | 2 +- frontend/menu/menu_common.h | 2 +- frontend/menu/menu_driver.h | 2 +- frontend/platform/platform_android.h | 2 +- frontend/platform/platform_apple.c | 2 +- frontend/platform/platform_gx.c | 2 +- frontend/platform/platform_null.c | 2 +- frontend/platform/platform_ps3.c | 1 + frontend/platform/platform_psp.c | 3 +- frontend/platform/platform_qnx.c | 2 +- general.h | 2 +- gfx/context/x11_common.h | 2 +- gfx/filter.c | 2 +- gfx/filters/Makefile | 2 +- gfx/filters/blargg_ntsc_snes.c | 2 +- gfx/filters/boolean.h | 33 -- gfx/filters/phosphor2x.c | 2 +- gfx/fonts/bitmapfont.c | 2 +- gfx/fonts/d3d_font.h | 2 +- gfx/fonts/fonts.h | 2 +- gfx/fonts/gl_font.h | 2 +- gfx/gfx_common.h | 2 +- gfx/gfx_context.h | 2 +- gfx/gl_common.h | 2 +- gfx/image/image.h | 2 +- gfx/math/matrix_3x3.h | 2 +- gfx/py_state/py_state.c | 3 +- gfx/py_state/py_state.h | 2 +- gfx/rpng/rpng.h | 2 +- gfx/scaler/filter.h | 2 +- gfx/scaler/scaler.h | 2 +- gfx/shader/shader_context.h | 2 +- gfx/shader/shader_glsl.c | 3 - gfx/shader/shader_glsl.h | 2 +- gfx/shader/shader_null.c | 2 +- gfx/shader/shader_parse.h | 2 +- gfx/state_tracker.h | 2 +- gfx/video_thread_wrapper.h | 4 +- griffin/griffin.c | 8 +- input/connect/connect_ps3.c | 2 +- input/connect/connect_ps4.c | 2 +- input/dinput.c | 2 +- input/keyboard_line.h | 2 +- input/overlay.h | 2 +- input/ps3_input.c | 2 +- input/rwebinput_input.c | 2 +- input/sdl_input.c | 2 +- input/winxinput_joypad.c | 2 +- input/x11_input.c | 2 +- {gfx => libretro-sdk}/glsym/README.md | 0 {gfx => libretro-sdk}/glsym/glgen.py | 0 {gfx => libretro-sdk}/glsym/glsym_es2.c | 2 +- {gfx => libretro-sdk}/glsym/glsym_gl.c | 2 +- {gfx => libretro-sdk}/glsym/rglgen.c | 4 +- libretro-sdk/include/boolean.h | 39 ++ {gfx => libretro-sdk/include}/glsym/glsym.h | 4 +- .../include}/glsym/glsym_es2.h | 0 .../include}/glsym/glsym_gl.h | 0 {gfx => libretro-sdk/include}/glsym/rglgen.h | 0 .../include}/glsym/rglgen_headers.h | 0 .../include/rthreads}/rthreads.h | 6 +- libretro-sdk/libco/amd64.c | 117 +++++ libretro-sdk/libco/armeabi.c | 90 ++++ libretro-sdk/libco/fiber.c | 58 +++ libretro-sdk/libco/libco.c | 21 + libretro-sdk/libco/libco.h | 34 ++ libretro-sdk/libco/ppc.c | 407 ++++++++++++++++++ libretro-sdk/libco/sjlj.c | 112 +++++ libretro-sdk/libco/ucontext.c | 81 ++++ libretro-sdk/libco/x86.c | 106 +++++ .../rthreads}/gx_pthread.h | 0 .../rthreads}/psp_pthread.h | 0 .../rthreads}/rthreads.c | 2 +- .../rthreads}/xenon_sdl_threads.c | 2 +- libretro_version_1.c | 2 +- message_queue.c | 2 +- movie.h | 2 +- netplay.h | 2 +- patch.c | 2 +- record/ffemu.h | 2 +- record/ffmpeg.c | 4 +- retroarch.c | 2 +- rewind.h | 2 +- screenshot.c | 2 +- screenshot.h | 2 +- settings_list.h | 2 +- string_list.h | 2 +- tools/retroarch-joyconfig.c | 2 +- 136 files changed, 1215 insertions(+), 171 deletions(-) delete mode 100644 gfx/filters/boolean.h rename {gfx => libretro-sdk}/glsym/README.md (100%) rename {gfx => libretro-sdk}/glsym/glgen.py (100%) rename {gfx => libretro-sdk}/glsym/glsym_es2.c (99%) rename {gfx => libretro-sdk}/glsym/glsym_gl.c (99%) rename {gfx => libretro-sdk}/glsym/rglgen.c (97%) create mode 100644 libretro-sdk/include/boolean.h rename {gfx => libretro-sdk/include}/glsym/glsym.h (95%) rename {gfx => libretro-sdk/include}/glsym/glsym_es2.h (100%) rename {gfx => libretro-sdk/include}/glsym/glsym_gl.h (100%) rename {gfx => libretro-sdk/include}/glsym/rglgen.h (100%) rename {gfx => libretro-sdk/include}/glsym/rglgen_headers.h (100%) rename {rthreads => libretro-sdk/include/rthreads}/rthreads.h (97%) create mode 100644 libretro-sdk/libco/amd64.c create mode 100644 libretro-sdk/libco/armeabi.c create mode 100644 libretro-sdk/libco/fiber.c create mode 100644 libretro-sdk/libco/libco.c create mode 100644 libretro-sdk/libco/libco.h create mode 100644 libretro-sdk/libco/ppc.c create mode 100644 libretro-sdk/libco/sjlj.c create mode 100644 libretro-sdk/libco/ucontext.c create mode 100644 libretro-sdk/libco/x86.c rename {rthreads => libretro-sdk/rthreads}/gx_pthread.h (100%) rename {rthreads => libretro-sdk/rthreads}/psp_pthread.h (100%) rename {rthreads => libretro-sdk/rthreads}/rthreads.c (99%) rename {rthreads => libretro-sdk/rthreads}/xenon_sdl_threads.c (98%) diff --git a/Makefile.common b/Makefile.common index 3e875e2196..492d3d4736 100644 --- a/Makefile.common +++ b/Makefile.common @@ -33,6 +33,8 @@ ifeq ($(REENTRANT_TEST), 1) OBJ += console/test.o endif +CFLAGS += -I./libretro-sdk/include + # Switches # Extra menu drivers if GL supported @@ -292,7 +294,7 @@ ifeq ($(HAVE_FREETYPE), 1) endif ifeq ($(HAVE_THREADS), 1) - OBJ += autosave.o rthreads/rthreads.o gfx/video_thread_wrapper.o audio/audio_thread_wrapper.o + OBJ += autosave.o libretro-sdk/rthreads/rthreads.o gfx/video_thread_wrapper.o audio/audio_thread_wrapper.o DEFINES += -DHAVE_THREADS ifeq ($(findstring Haiku,$(OS)),) LIBS += -lpthread @@ -362,7 +364,7 @@ ifeq ($(HAVE_OPENGL), 1) gfx/fonts/gl_raster_font.o \ gfx/math/matrix.o \ gfx/state_tracker.o \ - gfx/glsym/rglgen.o + libretro-sdk/glsym/rglgen.o ifeq ($(HAVE_KMS), 1) OBJ += gfx/context/drm_egl_ctx.o @@ -415,10 +417,10 @@ ifeq ($(HAVE_OPENGL), 1) ifeq ($(HAVE_GLES3), 1) DEFINES += -DHAVE_OPENGLES3 endif - OBJ += gfx/glsym/glsym_es2.o + OBJ += libretro-sdk/glsym/glsym_es2.o else DEFINES += -DHAVE_GL_SYNC - OBJ += gfx/glsym/glsym_gl.o + OBJ += libretro-sdk/glsym/glsym_gl.o ifeq ($(OSX), 1) LIBS += -framework OpenGL else ifneq ($(findstring Win32,$(OS)),) diff --git a/Makefile.griffin b/Makefile.griffin index 13825bfbd5..8949f800cd 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -133,6 +133,8 @@ CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(INCLUDE) OBJ = griffin/griffin.o $(PLATOBJS) +INCLUDE += -I./libretro-sdk/include + ifeq ($(HAVE_LOGGER), 1) CFLAGS += -DHAVE_LOGGER CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) diff --git a/Makefile.ps3 b/Makefile.ps3 index 5966b493f4..d3fc08faee 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -34,7 +34,7 @@ EBOOT_PATH = ps3/pkg/USRDIR/EBOOT.BIN CORE_PATH = ps3/pkg/USRDIR/cores/CORE.SELF LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt -INCDIRS = -I. -Ips3 -Icommon -Ideps/rzlib +INCDIRS = -I. -Ips3 -Icommon -Ideps/rzlib -Ilibretro-sdk/include # system platform system_platform = unix diff --git a/Makefile.psp1 b/Makefile.psp1 index af812f8cd0..0757d6c46d 100644 --- a/Makefile.psp1 +++ b/Makefile.psp1 @@ -19,7 +19,7 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1) WHOLE_END := -Wl,--no-whole-archive endif -INCDIR = $(PSPPATH)/include +INCDIR = $(PSPPATH)/include libretro-sdk/include CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math ASFLAGS = $(CFLAGS) diff --git a/android/phoenix/jni/Android.mk b/android/phoenix/jni/Android.mk index 7de030b916..e18c199b3e 100644 --- a/android/phoenix/jni/Android.mk +++ b/android/phoenix/jni/Android.mk @@ -3,10 +3,12 @@ include $(CLEAR_VARS) LOCAL_MODULE := retroarch-jni RARCH_DIR := ../../.. -LOCAL_CFLAGS += -std=gnu99 -Wall -DHAVE_LOGGER -DRARCH_DUMMY_LOG -DHAVE_ZLIB -DHAVE_MMAP -I$(LOCAL_PATH)/$(RARCH_DIR) +LOCAL_CFLAGS += -std=gnu99 -Wall -DHAVE_LOGGER -DRARCH_DUMMY_LOG -DHAVE_ZLIB -DHAVE_MMAP LOCAL_LDLIBS := -llog -lz LOCAL_SRC_FILES := apk-extract/apk-extract.c $(RARCH_DIR)/file_extract.c $(RARCH_DIR)/file_path.c $(RARCH_DIR)/string_list.c $(RARCH_DIR)/compat/compat.c +LOCAL_C_INCLUDES := $(RARCH_DIR)/libretro-sdk/include/ + include $(BUILD_SHARED_LIBRARY) HAVE_NEON := 1 @@ -55,12 +57,14 @@ else GLES_LIB := -lGLESv2 endif + LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_LAKKA -DHAVE_GLUI -DHAVE_XMB LOCAL_CFLAGS += -DHAVE_7ZIP LOCAL_CFLAGS += -O2 LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL $(GLES_LIB) $(LOGGER_LDLIBS) -ldl +LOCAL_C_INCLUDES := $(RARCH_DIR)/libretro-sdk/include/ LOCAL_CFLAGS += -DHAVE_SL LOCAL_LDLIBS += -lOpenSLES -lz diff --git a/android/phoenix/jni/apk-extract/apk-extract.c b/android/phoenix/jni/apk-extract/apk-extract.c index f220b4ad84..f4b3a2b22f 100644 --- a/android/phoenix/jni/apk-extract/apk-extract.c +++ b/android/phoenix/jni/apk-extract/apk-extract.c @@ -1,10 +1,10 @@ -#include "file_extract.h" -#include "file.h" -#include "file_path.h" +#include "../../../../file_extract.h" +#include "../../../../file.h" +#include "../../../../file_path.h" #include #include -#include "miscellaneous.h" +#include "../../../../miscellaneous.h" #include "../native/com_retroarch_browser_NativeInterface.h" //#define VERBOSE_LOG diff --git a/apple/iOS/bluetooth/btdynamic.h b/apple/iOS/bluetooth/btdynamic.h index 35c3f45361..14a0c24151 100644 --- a/apple/iOS/bluetooth/btdynamic.h +++ b/apple/iOS/bluetooth/btdynamic.h @@ -17,7 +17,7 @@ #ifndef __IOS_RARCH_BTDYNAMIC_H__ #define __IOS_RARCH_BTDYNAMIC_H__ -#include "../../../boolean.h" +#include #include "btstack/utils.h" #include "btstack/btstack.h" diff --git a/audio/alsathread.c b/audio/alsathread.c index 75dbe5284f..429954cb9c 100644 --- a/audio/alsathread.c +++ b/audio/alsathread.c @@ -19,7 +19,7 @@ #include #include #include "../general.h" -#include "../rthreads/rthreads.h" +#include #include "../fifo_buffer.h" #define TRY_ALSA(x) if (x < 0) { \ diff --git a/audio/audio_thread_wrapper.c b/audio/audio_thread_wrapper.c index d8efa3c825..9f7fe82793 100644 --- a/audio/audio_thread_wrapper.c +++ b/audio/audio_thread_wrapper.c @@ -14,7 +14,7 @@ */ #include "audio_thread_wrapper.h" -#include "../rthreads/rthreads.h" +#include #include "../general.h" #include "../performance.h" #include "../fifo_buffer.h" diff --git a/audio/audio_thread_wrapper.h b/audio/audio_thread_wrapper.h index 11e2edf225..9ef3e606c8 100644 --- a/audio/audio_thread_wrapper.h +++ b/audio/audio_thread_wrapper.h @@ -17,7 +17,7 @@ #define RARCH_AUDIO_THREAD_H__ #include "../driver.h" -#include "../boolean.h" +#include // Starts a audio driver in a new thread. // Access to audio driver will be mediated through this driver. diff --git a/audio/coreaudio.c b/audio/coreaudio.c index a472e45c0a..95208bc66a 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@ -19,7 +19,7 @@ #include "../general.h" #include "../fifo_buffer.h" #include -#include "../boolean.h" +#include #include #ifdef OSX diff --git a/audio/dsound.c b/audio/dsound.c index f886d89cfe..07bb55d69f 100644 --- a/audio/dsound.c +++ b/audio/dsound.c @@ -41,7 +41,7 @@ static DSMIXBINS dsmb; #include "../driver.h" #include -#include "../boolean.h" +#include #include #include #include diff --git a/audio/gx_audio.c b/audio/gx_audio.c index 6858de7935..22b830a124 100644 --- a/audio/gx_audio.c +++ b/audio/gx_audio.c @@ -16,7 +16,7 @@ #include "../driver.h" #include -#include "../boolean.h" +#include #include "../general.h" #include diff --git a/audio/jack.c b/audio/jack.c index 9b740d950a..4f63f40c0c 100644 --- a/audio/jack.c +++ b/audio/jack.c @@ -23,7 +23,7 @@ #include #include #include -#include "../boolean.h" +#include #include #include diff --git a/audio/opensl.c b/audio/opensl.c index 984d79e1ca..e728bf8f5e 100644 --- a/audio/opensl.c +++ b/audio/opensl.c @@ -16,7 +16,7 @@ #include "../driver.h" #include "../general.h" -#include "../rthreads/rthreads.h" +#include #include #ifdef ANDROID diff --git a/audio/pulse.c b/audio/pulse.c index 19c1d67c7d..102a298e48 100644 --- a/audio/pulse.c +++ b/audio/pulse.c @@ -17,7 +17,7 @@ #include "driver.h" #include "general.h" #include -#include "../boolean.h" +#include #include #include diff --git a/audio/resamplers/resampler.h b/audio/resamplers/resampler.h index 8e23205bdb..b9a55c518a 100644 --- a/audio/resamplers/resampler.h +++ b/audio/resamplers/resampler.h @@ -25,7 +25,7 @@ extern "C" { #include #include #include -#include "../../boolean.h" +#include #ifndef M_PI #define M_PI 3.14159265358979323846264338327 diff --git a/audio/roar.c b/audio/roar.c index 1269bdd574..ccbf734589 100644 --- a/audio/roar.c +++ b/audio/roar.c @@ -19,7 +19,7 @@ #include #include #include -#include "../boolean.h" +#include #include "general.h" typedef struct diff --git a/audio/rsound.c b/audio/rsound.c index 4135aab0cf..c05bacefe4 100644 --- a/audio/rsound.c +++ b/audio/rsound.c @@ -18,8 +18,8 @@ #include #include "rsound.h" #include "../fifo_buffer.h" -#include "../boolean.h" -#include "../rthreads/rthreads.h" +#include +#include typedef struct rsd { diff --git a/audio/rsound.h b/audio/rsound.h index abed2790ed..70d7827e11 100644 --- a/audio/rsound.h +++ b/audio/rsound.h @@ -24,11 +24,7 @@ extern "C" { #include #include -#ifdef STANDALONE -#include "rthreads.h" -#else -#include "../rthreads/rthreads.h" -#endif +#include #include #include #include diff --git a/audio/sdl_audio.c b/audio/sdl_audio.c index 3371e2ba90..530dd83c26 100644 --- a/audio/sdl_audio.c +++ b/audio/sdl_audio.c @@ -16,14 +16,14 @@ #include "../driver.h" #include -#include "../boolean.h" +#include #include #include #include #include "SDL.h" #include "SDL_audio.h" -#include "../rthreads/rthreads.h" +#include #include "../general.h" #include "../fifo_buffer.h" diff --git a/audio/utils.c b/audio/utils.c index dae3a2b517..fc7a52899d 100644 --- a/audio/utils.c +++ b/audio/utils.c @@ -14,7 +14,7 @@ * If not, see . */ -#include "../boolean.h" +#include #include "utils.h" #include "../performance.h" diff --git a/audio/xaudio-c/xaudio-c.cpp b/audio/xaudio-c/xaudio-c.cpp index b266c45055..8df369d517 100644 --- a/audio/xaudio-c/xaudio-c.cpp +++ b/audio/xaudio-c/xaudio-c.cpp @@ -21,7 +21,7 @@ #include #include #include "../../msvc/msvc_compat.h" -#include "../../boolean.h" +#include #define MAX_BUFFERS 16 #define MAX_BUFFERS_MASK (MAX_BUFFERS - 1) diff --git a/audio/xenon360_audio.c b/audio/xenon360_audio.c index 64794e69e6..bd81ebe90b 100644 --- a/audio/xenon360_audio.c +++ b/audio/xenon360_audio.c @@ -16,7 +16,7 @@ #include "../driver.h" #include -#include "../boolean.h" +#include #include "../general.h" #include diff --git a/autosave.c b/autosave.c index 4854c8ddec..e59c1bc9a5 100644 --- a/autosave.c +++ b/autosave.c @@ -16,7 +16,7 @@ #include "autosave.h" #include "rthreads/rthreads.h" #include -#include "boolean.h" +#include #include #include #include "general.h" diff --git a/camera/android.c b/camera/android.c index ad746304d2..bb300fa9cf 100644 --- a/camera/android.c +++ b/camera/android.c @@ -15,7 +15,7 @@ * If not, see . */ -#include "../gfx/glsym/glsym.h" +#include #include "../driver.h" typedef struct android_camera diff --git a/command.h b/command.h index 58227a8f97..ec08b16043 100644 --- a/command.h +++ b/command.h @@ -21,7 +21,7 @@ #endif #include -#include "boolean.h" +#include #ifdef __cplusplus extern "C" { diff --git a/compat/compat.c b/compat/compat.c index d5535e1ec9..6d545b38aa 100644 --- a/compat/compat.c +++ b/compat/compat.c @@ -21,7 +21,7 @@ #ifndef HAVE_GETOPT_LONG #include -#include "../boolean.h" +#include #include #include #include diff --git a/compat/rxml/rxml.c b/compat/rxml/rxml.c index 3d521a3b0e..d1105e4cef 100644 --- a/compat/rxml/rxml.c +++ b/compat/rxml/rxml.c @@ -20,7 +20,7 @@ #include #include #include -#include "../../boolean.h" +#include #include "../posix_string.h" #ifndef RXML_TEST diff --git a/conf/config_file.h b/conf/config_file.h index 4a79f77411..903d2b3bfc 100644 --- a/conf/config_file.h +++ b/conf/config_file.h @@ -22,7 +22,7 @@ extern "C" { #endif #include -#include "../boolean.h" +#include #include #include diff --git a/config.def.h b/config.def.h index 89949e2816..34c55beafa 100644 --- a/config.def.h +++ b/config.def.h @@ -17,7 +17,7 @@ #ifndef __CONFIG_DEF_H #define __CONFIG_DEF_H -#include "boolean.h" +#include #include "libretro.h" #include "driver.h" #include "gfx/gfx_common.h" diff --git a/config.features.h b/config.features.h index ebddc3e9f2..f1e6c623ca 100644 --- a/config.features.h +++ b/config.features.h @@ -2,7 +2,7 @@ #define __RARCH_FEATURES_H #include -#include "boolean.h" +#include #ifdef HAVE_CONFIG_H #include "config.h" diff --git a/core_options.h b/core_options.h index bb1665a74a..c068d97c9f 100644 --- a/core_options.h +++ b/core_options.h @@ -16,7 +16,7 @@ #ifndef CORE_OPTIONS_H__ #define CORE_OPTIONS_H__ -#include "boolean.h" +#include #include "libretro.h" #include diff --git a/dir_list.c b/dir_list.c index bcad2bb7d3..80037756f0 100644 --- a/dir_list.c +++ b/dir_list.c @@ -39,6 +39,16 @@ #include #endif +/* Some platforms do not set this value. + * Just assume a value. It's usually 4KiB. + * Platforms with a known value (like Win32) + * set this value explicitly in platform specific headers. + */ + +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + static int qstrcmp_plain(const void *a_, const void *b_) { const struct string_list_elem *a = (const struct string_list_elem*)a_; diff --git a/driver.h b/driver.h index 46d20a1f09..6b81e48902 100644 --- a/driver.h +++ b/driver.h @@ -19,7 +19,7 @@ #define __DRIVER__H #include -#include "boolean.h" +#include #include "libretro_private.h" #include #include diff --git a/dynamic.c b/dynamic.c index 2804498824..09369a510d 100644 --- a/dynamic.c +++ b/dynamic.c @@ -28,7 +28,7 @@ #include "config.h" #endif -#include "boolean.h" +#include #include "libretro_private.h" #include "dynamic_dummy.h" diff --git a/dynamic.h b/dynamic.h index 2ef4a4f0cf..6cda0ccf55 100644 --- a/dynamic.h +++ b/dynamic.h @@ -16,7 +16,7 @@ #ifndef __DYNAMIC_H #define __DYNAMIC_H -#include "boolean.h" +#include #include "libretro.h" #ifdef HAVE_CONFIG_H diff --git a/dynamic_dummy.h b/dynamic_dummy.h index 8b180fd577..261355f2c7 100644 --- a/dynamic_dummy.h +++ b/dynamic_dummy.h @@ -18,7 +18,7 @@ #ifndef DYNAMIC_DUMMY_H__ #define DYNAMIC_DUMMY_H__ -#include "boolean.h" +#include #include "libretro.h" void libretro_dummy_retro_init(void); diff --git a/emscripten/RWebAudio.h b/emscripten/RWebAudio.h index c8492fda99..9d2250fff0 100644 --- a/emscripten/RWebAudio.h +++ b/emscripten/RWebAudio.h @@ -15,7 +15,7 @@ #include #include -#include "../boolean.h" +#include unsigned RWebAudioSampleRate(void); void *RWebAudioInit(unsigned latency); diff --git a/emscripten/RWebCam.h b/emscripten/RWebCam.h index b64a3cbc60..0e310dbcba 100644 --- a/emscripten/RWebCam.h +++ b/emscripten/RWebCam.h @@ -14,7 +14,7 @@ */ #include -#include "../boolean.h" +#include #include "../driver.h" void *RWebCamInit(uint64_t caps, unsigned width, unsigned height); diff --git a/file.c b/file.c index 14a1acd764..c696efaac1 100644 --- a/file.c +++ b/file.c @@ -17,7 +17,7 @@ #include "file_path.h" #include "general.h" #include -#include "boolean.h" +#include #include "libretro.h" #include #include diff --git a/file.h b/file.h index b96bca87f8..84ee067bde 100644 --- a/file.h +++ b/file.h @@ -16,7 +16,7 @@ #ifndef __RARCH_FILE_H #define __RARCH_FILE_H -#include "boolean.h" +#include #include #include #include diff --git a/file_extract.h b/file_extract.h index c99cb40bde..b69662b667 100644 --- a/file_extract.h +++ b/file_extract.h @@ -16,7 +16,7 @@ #ifndef FILE_EXTRACT_H__ #define FILE_EXTRACT_H__ -#include "boolean.h" +#include #include "file.h" #include #include diff --git a/file_list.h b/file_list.h index 4f604cf0fe..02ce6311e3 100644 --- a/file_list.h +++ b/file_list.h @@ -21,7 +21,7 @@ extern "C" { #endif -#include "boolean.h" +#include struct item_file { diff --git a/file_path.c b/file_path.c index 729c778bb4..d7014945a9 100644 --- a/file_path.c +++ b/file_path.c @@ -16,7 +16,7 @@ #include "file_path.h" #include -#include "boolean.h" +#include #include #include #include diff --git a/file_path.h b/file_path.h index 6277300454..55eb9c0290 100644 --- a/file_path.h +++ b/file_path.h @@ -17,7 +17,7 @@ #ifndef __RARCH_FILE_PATH_H #define __RARCH_FILE_PATH_H -#include "boolean.h" +#include #include #include #include diff --git a/frontend/frontend.h b/frontend/frontend.h index d638a972ff..3aaaeb4e0c 100644 --- a/frontend/frontend.h +++ b/frontend/frontend.h @@ -20,7 +20,7 @@ #include #include -#include "../boolean.h" +#include #include "frontend_context.h" #ifdef __cplusplus diff --git a/frontend/frontend_context.h b/frontend/frontend_context.h index 8811c664f0..5d30b41ea7 100644 --- a/frontend/frontend_context.h +++ b/frontend/frontend_context.h @@ -18,7 +18,7 @@ #define __FRONTEND_CONTEXT_H #include -#include "../boolean.h" +#include #ifdef HAVE_CONFIG_H #include "../config.h" diff --git a/frontend/frontend_salamander.c b/frontend/frontend_salamander.c index e6d5ae09f4..88ae1032a2 100644 --- a/frontend/frontend_salamander.c +++ b/frontend/frontend_salamander.c @@ -15,7 +15,7 @@ */ #include -#include "../boolean.h" +#include #include #include diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index 647d5185dd..219fc2737c 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -22,7 +22,7 @@ #include #include #include -#include "../../boolean.h" +#include #include "../../general.h" #include "menu_navigation.h" #include "../../core_info.h" diff --git a/frontend/menu/menu_driver.h b/frontend/menu/menu_driver.h index 6a19411faa..cdf6a271f9 100644 --- a/frontend/menu/menu_driver.h +++ b/frontend/menu/menu_driver.h @@ -19,7 +19,7 @@ #include #include -#include "../../boolean.h" +#include #include "menu_list.h" #include "../../settings_list.h" diff --git a/frontend/platform/platform_android.h b/frontend/platform/platform_android.h index ccd40550d4..fc82432159 100644 --- a/frontend/platform/platform_android.h +++ b/frontend/platform/platform_android.h @@ -27,7 +27,7 @@ #include #include -#include "../../thread.h" +#include struct android_app { diff --git a/frontend/platform/platform_apple.c b/frontend/platform/platform_apple.c index 0aba9c15ea..2a15cebedb 100644 --- a/frontend/platform/platform_apple.c +++ b/frontend/platform/platform_apple.c @@ -21,7 +21,7 @@ #include "../frontend.h" #include -#include "../../boolean.h" +#include #include #include diff --git a/frontend/platform/platform_gx.c b/frontend/platform/platform_gx.c index 883c0029c1..8c72d14fab 100644 --- a/frontend/platform/platform_gx.c +++ b/frontend/platform/platform_gx.c @@ -15,7 +15,7 @@ * If not, see . */ -#include "../../boolean.h" +#include #include "../../driver.h" #include "../../general.h" #include "../../libretro_private.h" diff --git a/frontend/platform/platform_null.c b/frontend/platform/platform_null.c index f25b8892a4..5e62db136a 100644 --- a/frontend/platform/platform_null.c +++ b/frontend/platform/platform_null.c @@ -17,7 +17,7 @@ #include "../frontend_context.h" #include -#include "../../boolean.h" +#include #include #include diff --git a/frontend/platform/platform_ps3.c b/frontend/platform/platform_ps3.c index 95da079dc5..beb9884290 100644 --- a/frontend/platform/platform_ps3.c +++ b/frontend/platform/platform_ps3.c @@ -22,6 +22,7 @@ #include "../../conf/config_file.h" #include "../../general.h" #include "../../file.h" +#include "../../file_path.h" #define EMULATOR_CONTENT_DIR "SSNE10000" diff --git a/frontend/platform/platform_psp.c b/frontend/platform/platform_psp.c index 0c1d61cb9c..274c91fccc 100644 --- a/frontend/platform/platform_psp.c +++ b/frontend/platform/platform_psp.c @@ -21,12 +21,13 @@ #include #include -#include "../../boolean.h" +#include #include #include #include "../../gfx/psp/sdk_defines.h" #include "../../file.h" +#include "../../file_path.h" #include "../../general.h" #if defined(HAVE_KERNEL_PRX) || defined(IS_SALAMANDER) diff --git a/frontend/platform/platform_qnx.c b/frontend/platform/platform_qnx.c index 2906f11bf8..e7b91f2029 100644 --- a/frontend/platform/platform_qnx.c +++ b/frontend/platform/platform_qnx.c @@ -17,7 +17,7 @@ #include #include -#include "../../boolean.h" +#include #include #include #include "../../dynamic.h" diff --git a/general.h b/general.h index 5eb4bb0927..874d898471 100644 --- a/general.h +++ b/general.h @@ -17,7 +17,7 @@ #ifndef __RARCH_GENERAL_H #define __RARCH_GENERAL_H -#include "boolean.h" +#include #include #include #include diff --git a/gfx/context/x11_common.h b/gfx/context/x11_common.h index 05104b0ffa..c7b27a5555 100644 --- a/gfx/context/x11_common.h +++ b/gfx/context/x11_common.h @@ -29,7 +29,7 @@ #include #endif -#include "../../boolean.h" +#include void x11_show_mouse(Display *dpy, Window win, bool state); void x11_windowed_fullscreen(Display *dpy, Window win); diff --git a/gfx/filter.c b/gfx/filter.c index 0bc9db14b4..22e4820eef 100644 --- a/gfx/filter.c +++ b/gfx/filter.c @@ -32,7 +32,7 @@ struct rarch_soft_plug }; #ifdef HAVE_THREADS -#include "../rthreads/rthreads.h" +#include struct filter_thread_data { diff --git a/gfx/filters/Makefile b/gfx/filters/Makefile index 3f732c7817..d5be50efe1 100644 --- a/gfx/filters/Makefile +++ b/gfx/filters/Makefile @@ -57,7 +57,7 @@ endif CC := $(compiler) CXX := $(subst CC,++,$(compiler)) -std=gnu++0x -flags := -fPIC $(extra_flags) +flags := -fPIC $(extra_flags) -I../../libretro-sdk/include asflags := -fPIC $(extra_flags) objects := flags += -std=c99 diff --git a/gfx/filters/blargg_ntsc_snes.c b/gfx/filters/blargg_ntsc_snes.c index a37e7b8406..0cfe45af1b 100644 --- a/gfx/filters/blargg_ntsc_snes.c +++ b/gfx/filters/blargg_ntsc_snes.c @@ -18,7 +18,7 @@ #include #include #include -#include "boolean.h" +#include #include "snes_ntsc/snes_ntsc.h" #include "snes_ntsc/snes_ntsc.c" diff --git a/gfx/filters/boolean.h b/gfx/filters/boolean.h deleted file mode 100644 index b0a20bd8d6..0000000000 --- a/gfx/filters/boolean.h +++ /dev/null @@ -1,33 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * - * 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 . - */ - -#ifndef __RARCH_BOOLEAN_H -#define __RARCH_BOOLEAN_H - -#ifndef __cplusplus - -#if defined(_MSC_VER) && !defined(SN_TARGET_PS3) -/* Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant. */ -#define bool unsigned char -#define true 1 -#define false 0 -#else -#include -#endif - -#endif - -#endif - diff --git a/gfx/filters/phosphor2x.c b/gfx/filters/phosphor2x.c index eaa1c01b56..305f3d390d 100644 --- a/gfx/filters/phosphor2x.c +++ b/gfx/filters/phosphor2x.c @@ -15,7 +15,7 @@ */ #include "softfilter.h" -#include "boolean.h" +#include #include #include #include diff --git a/gfx/fonts/bitmapfont.c b/gfx/fonts/bitmapfont.c index 93211c7277..b4896ca471 100644 --- a/gfx/fonts/bitmapfont.c +++ b/gfx/fonts/bitmapfont.c @@ -19,7 +19,7 @@ #include #include #include "../../msvc/msvc_compat.h" -#include "../../boolean.h" +#include #define ATLAS_COLS 16 #define ATLAS_ROWS 16 diff --git a/gfx/fonts/d3d_font.h b/gfx/fonts/d3d_font.h index dc926ac75b..ad141bc7e6 100644 --- a/gfx/fonts/d3d_font.h +++ b/gfx/fonts/d3d_font.h @@ -17,7 +17,7 @@ #define D3D_FONT_H__ #include -#include "../../boolean.h" +#include #include "../../driver.h" #ifdef __cplusplus diff --git a/gfx/fonts/fonts.h b/gfx/fonts/fonts.h index d8221a6baa..5db1905eec 100644 --- a/gfx/fonts/fonts.h +++ b/gfx/fonts/fonts.h @@ -18,7 +18,7 @@ #define __RARCH_FONTS_H #include -#include "../../boolean.h" +#include /* All coordinates and offsets are top-left oriented. * diff --git a/gfx/fonts/gl_font.h b/gfx/fonts/gl_font.h index 8986510813..fc59302cb9 100644 --- a/gfx/fonts/gl_font.h +++ b/gfx/fonts/gl_font.h @@ -17,7 +17,7 @@ #define GL_FONT_H__ #include "../../driver.h" -#include "../../boolean.h" +#include struct font_glyph; diff --git a/gfx/gfx_common.h b/gfx/gfx_common.h index 1635574615..f7c0261a38 100644 --- a/gfx/gfx_common.h +++ b/gfx/gfx_common.h @@ -23,7 +23,7 @@ extern "C" { #include #include #include "../general.h" -#include "../boolean.h" +#include #include "../performance.h" #ifdef HAVE_CONFIG_H diff --git a/gfx/gfx_context.h b/gfx/gfx_context.h index e37e51a3d0..d7920b526d 100644 --- a/gfx/gfx_context.h +++ b/gfx/gfx_context.h @@ -16,7 +16,7 @@ #ifndef __GFX_CONTEXT_H #define __GFX_CONTEXT_H -#include "../boolean.h" +#include #include "../driver.h" #ifdef HAVE_CONFIG_H diff --git a/gfx/gl_common.h b/gfx/gl_common.h index a13aa097c9..64b30d02db 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -35,7 +35,7 @@ #include #endif -#include "glsym/glsym.h" +#include #define context_bind_hw_render(gl, enable) if (gl->shared_context_use && gl->ctx_driver->bind_hw_render) gl->ctx_driver->bind_hw_render(gl, enable) diff --git a/gfx/image/image.h b/gfx/image/image.h index 1145e342af..3c080e4886 100644 --- a/gfx/image/image.h +++ b/gfx/image/image.h @@ -17,7 +17,7 @@ #define __RARCH_IMAGE_CONTEXT_H #include -#include "../../boolean.h" +#include #ifdef _WIN32 #include "../context/win32_common.h" diff --git a/gfx/math/matrix_3x3.h b/gfx/math/matrix_3x3.h index 48485a14e7..6293abbc07 100644 --- a/gfx/math/matrix_3x3.h +++ b/gfx/math/matrix_3x3.h @@ -17,7 +17,7 @@ #ifndef MATH_MATRIX_3X3_H__ #define MATH_MATRIX_3X3_H__ -#include "boolean.h" +#include typedef struct math_matrix_3x3 { diff --git a/gfx/py_state/py_state.c b/gfx/py_state/py_state.c index 429283c940..316e536624 100644 --- a/gfx/py_state/py_state.c +++ b/gfx/py_state/py_state.c @@ -14,14 +14,13 @@ */ #include -#include "../../boolean.h" #include #include #include +#include "py_state.h" #include "../../dynamic.h" #include "../../libretro.h" -#include "py_state.h" #include "../../general.h" #include "../../compat/strl.h" #include "../../compat/posix_string.h" diff --git a/gfx/py_state/py_state.h b/gfx/py_state/py_state.h index 4d73882b1a..56a6d9f25f 100644 --- a/gfx/py_state/py_state.h +++ b/gfx/py_state/py_state.h @@ -17,7 +17,7 @@ #define __RARCH_PY_STATE_H #include -#include "../../boolean.h" +#include #ifndef PY_STATE_OMIT_DECLARATION typedef struct py_state py_state_t; diff --git a/gfx/rpng/rpng.h b/gfx/rpng/rpng.h index 6401233e56..95fa96d512 100644 --- a/gfx/rpng/rpng.h +++ b/gfx/rpng/rpng.h @@ -18,7 +18,7 @@ #include -#include "../../boolean.h" +#include #ifdef HAVE_CONFIG_H #include "../../config.h" diff --git a/gfx/scaler/filter.h b/gfx/scaler/filter.h index 8eaf6d7ba7..d14cf1c2aa 100644 --- a/gfx/scaler/filter.h +++ b/gfx/scaler/filter.h @@ -17,7 +17,7 @@ #ifndef FILTER_H__ #define FILTER_H__ -#include "../../boolean.h" +#include #include "scaler.h" bool scaler_gen_filter(struct scaler_ctx *ctx); diff --git a/gfx/scaler/scaler.h b/gfx/scaler/scaler.h index 694dc75d65..b975b43b51 100644 --- a/gfx/scaler/scaler.h +++ b/gfx/scaler/scaler.h @@ -18,7 +18,7 @@ #include #include -#include "../../boolean.h" +#include #include "scaler_common.h" #define FILTER_UNITY (1 << 14) diff --git a/gfx/shader/shader_context.h b/gfx/shader/shader_context.h index afa1b50f58..48d3ec8723 100644 --- a/gfx/shader/shader_context.h +++ b/gfx/shader/shader_context.h @@ -17,7 +17,7 @@ #ifndef SHADER_CONTEXT_H__ #define SHADER_CONTEXT_H__ -#include "../../boolean.h" +#include #ifdef HAVE_CONFIG_H #include "../../config.h" diff --git a/gfx/shader/shader_glsl.c b/gfx/shader/shader_glsl.c index bd2b32384a..a006e4366b 100644 --- a/gfx/shader/shader_glsl.c +++ b/gfx/shader/shader_glsl.c @@ -13,7 +13,6 @@ * If not, see . */ -#include "../../boolean.h" #include #include "../../general.h" #include "shader_glsl.h" @@ -28,8 +27,6 @@ #include "../../config.h" #endif -#include "../glsym/glsym.h" - #include "../gfx_context.h" #include diff --git a/gfx/shader/shader_glsl.h b/gfx/shader/shader_glsl.h index 546fc7b5bc..0be7d6c256 100644 --- a/gfx/shader/shader_glsl.h +++ b/gfx/shader/shader_glsl.h @@ -17,7 +17,7 @@ #ifndef __RARCH_GLSL_H #define __RARCH_GLSL_H -#include "../../boolean.h" +#include #include "shader_context.h" void gl_glsl_set_get_proc_address(gfx_ctx_proc_t (*proc)(const char*)); diff --git a/gfx/shader/shader_null.c b/gfx/shader/shader_null.c index d7f27c6f5a..72ae59ede6 100644 --- a/gfx/shader/shader_null.c +++ b/gfx/shader/shader_null.c @@ -14,7 +14,7 @@ * If not, see . */ -#include "../../boolean.h" +#include #include #include "../../general.h" #include "../../compat/strl.h" diff --git a/gfx/shader/shader_parse.h b/gfx/shader/shader_parse.h index 4519a426e8..f0cfcd5bd9 100644 --- a/gfx/shader/shader_parse.h +++ b/gfx/shader/shader_parse.h @@ -16,7 +16,7 @@ #ifndef SHADER_PARSE_H #define SHADER_PARSE_H -#include "../../boolean.h" +#include #include "../state_tracker.h" #include "../../conf/config_file.h" #include "../../miscellaneous.h" diff --git a/gfx/state_tracker.h b/gfx/state_tracker.h index 0363ad9717..4c27f7495c 100644 --- a/gfx/state_tracker.h +++ b/gfx/state_tracker.h @@ -21,7 +21,7 @@ extern "C" { #endif #include -#include "../boolean.h" +#include #ifdef HAVE_CONFIG_H #include "../config.h" diff --git a/gfx/video_thread_wrapper.h b/gfx/video_thread_wrapper.h index bcaf750981..d36db968cb 100644 --- a/gfx/video_thread_wrapper.h +++ b/gfx/video_thread_wrapper.h @@ -17,8 +17,8 @@ #define RARCH_VIDEO_THREAD_H__ #include "../driver.h" -#include "../boolean.h" -#include "../rthreads/rthreads.h" +#include +#include #include "../general.h" /* Starts a video driver in a new thread. diff --git a/griffin/griffin.c b/griffin/griffin.c index ce002c68ce..d5643561c8 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -216,11 +216,11 @@ VIDEO DRIVER #include "../gfx/gl_common.c" #ifndef HAVE_PSGL -#include "../gfx/glsym/rglgen.c" +#include "../libretro-sdk/glsym/rglgen.c" #ifdef HAVE_OPENGLES2 -#include "../gfx/glsym/glsym_es2.c" +#include "../libretro-sdk/glsym/glsym_es2.c" #else -#include "../gfx/glsym/glsym_gl.c" +#include "../libretro-sdk/glsym/glsym_gl.c" #endif #endif @@ -616,7 +616,7 @@ THREAD #if defined(HAVE_THREADS) && defined(XENON) #include "../thread/xenon_sdl_threads.c" #elif defined(HAVE_THREADS) -#include "../rthreads/rthreads.c" +#include "../libretro-sdk/rthreads/rthreads.c" #include "../gfx/video_thread_wrapper.c" #include "../audio/audio_thread_wrapper.c" #include "../autosave.c" diff --git a/input/connect/connect_ps3.c b/input/connect/connect_ps3.c index 4fe1bc7743..6d977982e7 100644 --- a/input/connect/connect_ps3.c +++ b/input/connect/connect_ps3.c @@ -17,7 +17,7 @@ #include #include -#include "../../boolean.h" +#include #include "joypad_connection.h" struct hidpad_ps3_data diff --git a/input/connect/connect_ps4.c b/input/connect/connect_ps4.c index ad383fc9ef..cb86706f1a 100644 --- a/input/connect/connect_ps4.c +++ b/input/connect/connect_ps4.c @@ -17,7 +17,7 @@ #include #include -#include "../../boolean.h" +#include #include "joypad_connection.h" struct hidpad_ps4_data diff --git a/input/dinput.c b/input/dinput.c index 2218afcb46..386fb040d1 100644 --- a/input/dinput.c +++ b/input/dinput.c @@ -22,7 +22,7 @@ #include #include "../general.h" -#include "../boolean.h" +#include #include "input_common.h" #include "retroarch_logger.h" #include diff --git a/input/keyboard_line.h b/input/keyboard_line.h index 68c95cd6ac..1db10f72ed 100644 --- a/input/keyboard_line.h +++ b/input/keyboard_line.h @@ -20,7 +20,7 @@ extern "C" { #endif -#include "../boolean.h" +#include #include "../libretro.h" #include diff --git a/input/overlay.h b/input/overlay.h index f601fdcfd5..28a34a098c 100644 --- a/input/overlay.h +++ b/input/overlay.h @@ -16,7 +16,7 @@ #ifndef INPUT_OVERLAY_H__ #define INPUT_OVERLAY_H__ -#include "../boolean.h" +#include #include "../libretro.h" #include diff --git a/input/ps3_input.c b/input/ps3_input.c index 761d5df1bd..5a75aae507 100644 --- a/input/ps3_input.c +++ b/input/ps3_input.c @@ -18,7 +18,7 @@ #include #include -#include "../boolean.h" +#include #include "../ps3/sdk_defines.h" diff --git a/input/rwebinput_input.c b/input/rwebinput_input.c index 6663e83e3a..f703d19380 100644 --- a/input/rwebinput_input.c +++ b/input/rwebinput_input.c @@ -17,7 +17,7 @@ #include "../driver.h" -#include "../boolean.h" +#include #include "../general.h" #include "keyboard_line.h" diff --git a/input/sdl_input.c b/input/sdl_input.c index 3774694559..2767fc5223 100644 --- a/input/sdl_input.c +++ b/input/sdl_input.c @@ -17,7 +17,7 @@ #include "SDL.h" #include "../gfx/gfx_context.h" -#include "../boolean.h" +#include #include "../general.h" #include #include diff --git a/input/winxinput_joypad.c b/input/winxinput_joypad.c index ee6e7e40a6..0398ccc660 100644 --- a/input/winxinput_joypad.c +++ b/input/winxinput_joypad.c @@ -23,7 +23,7 @@ #include "input_common.h" #include "../general.h" -#include "../boolean.h" +#include #include #include diff --git a/input/x11_input.c b/input/x11_input.c index 2e209d7372..ffcf9f2fde 100644 --- a/input/x11_input.c +++ b/input/x11_input.c @@ -17,7 +17,7 @@ #include "../driver.h" -#include "../boolean.h" +#include #include "../general.h" #include #include diff --git a/gfx/glsym/README.md b/libretro-sdk/glsym/README.md similarity index 100% rename from gfx/glsym/README.md rename to libretro-sdk/glsym/README.md diff --git a/gfx/glsym/glgen.py b/libretro-sdk/glsym/glgen.py similarity index 100% rename from gfx/glsym/glgen.py rename to libretro-sdk/glsym/glgen.py diff --git a/gfx/glsym/glsym_es2.c b/libretro-sdk/glsym/glsym_es2.c similarity index 99% rename from gfx/glsym/glsym_es2.c rename to libretro-sdk/glsym/glsym_es2.c index c479fbd74a..e6bfffe5de 100644 --- a/gfx/glsym/glsym_es2.c +++ b/libretro-sdk/glsym/glsym_es2.c @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glsym.h" +#include #include #define SYM(x) { "gl" #x, &(gl##x) } diff --git a/gfx/glsym/glsym_gl.c b/libretro-sdk/glsym/glsym_gl.c similarity index 99% rename from gfx/glsym/glsym_gl.c rename to libretro-sdk/glsym/glsym_gl.c index cf95149f8e..f2dd4a9a9b 100644 --- a/gfx/glsym/glsym_gl.c +++ b/libretro-sdk/glsym/glsym_gl.c @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "glsym.h" +#include #include #define SYM(x) { "gl" #x, &(gl##x) } diff --git a/gfx/glsym/rglgen.c b/libretro-sdk/glsym/rglgen.c similarity index 97% rename from gfx/glsym/rglgen.c rename to libretro-sdk/glsym/rglgen.c index 0c89a43111..b7dc401160 100644 --- a/gfx/glsym/rglgen.c +++ b/libretro-sdk/glsym/rglgen.c @@ -21,8 +21,8 @@ */ #include -#include "rglgen.h" -#include "glsym.h" +#include +#include #include void rglgen_resolve_symbols_custom(rglgen_proc_address_t proc, diff --git a/libretro-sdk/include/boolean.h b/libretro-sdk/include/boolean.h new file mode 100644 index 0000000000..ffbc197f55 --- /dev/null +++ b/libretro-sdk/include/boolean.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2010-2014 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (boolean.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_BOOLEAN_H +#define __LIBRETRO_SDK_BOOLEAN_H + +#ifndef __cplusplus + +#if defined(_MSC_VER) && !defined(SN_TARGET_PS3) +/* Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant. */ +#define bool unsigned char +#define true 1 +#define false 0 +#else +#include +#endif + +#endif + +#endif diff --git a/gfx/glsym/glsym.h b/libretro-sdk/include/glsym/glsym.h similarity index 95% rename from gfx/glsym/glsym.h rename to libretro-sdk/include/glsym/glsym.h index 378cffacb7..5d42d18980 100644 --- a/gfx/glsym/glsym.h +++ b/libretro-sdk/include/glsym/glsym.h @@ -20,8 +20,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef GLSYM_H__ -#define GLSYM_H__ +#ifndef __LIBRETRO_SDK_GLSYM_H__ +#define __LIBRETRO_SDK_GLSYM_H__ #include "rglgen.h" diff --git a/gfx/glsym/glsym_es2.h b/libretro-sdk/include/glsym/glsym_es2.h similarity index 100% rename from gfx/glsym/glsym_es2.h rename to libretro-sdk/include/glsym/glsym_es2.h diff --git a/gfx/glsym/glsym_gl.h b/libretro-sdk/include/glsym/glsym_gl.h similarity index 100% rename from gfx/glsym/glsym_gl.h rename to libretro-sdk/include/glsym/glsym_gl.h diff --git a/gfx/glsym/rglgen.h b/libretro-sdk/include/glsym/rglgen.h similarity index 100% rename from gfx/glsym/rglgen.h rename to libretro-sdk/include/glsym/rglgen.h diff --git a/gfx/glsym/rglgen_headers.h b/libretro-sdk/include/glsym/rglgen_headers.h similarity index 100% rename from gfx/glsym/rglgen_headers.h rename to libretro-sdk/include/glsym/rglgen_headers.h diff --git a/rthreads/rthreads.h b/libretro-sdk/include/rthreads/rthreads.h similarity index 97% rename from rthreads/rthreads.h rename to libretro-sdk/include/rthreads/rthreads.h index b34ac377cf..1957d245a9 100644 --- a/rthreads/rthreads.h +++ b/libretro-sdk/include/rthreads/rthreads.h @@ -20,10 +20,10 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef THREAD_H__ -#define THREAD_H__ +#ifndef __LIBRETRO_SDK_RTHREADS_H__ +#define __LIBRETRO_SDK_RTHREADS_H__ -#include "../boolean.h" +#include #include #if defined(__cplusplus) && !defined(MSC_VER) diff --git a/libretro-sdk/libco/amd64.c b/libretro-sdk/libco/amd64.c new file mode 100644 index 0000000000..b2a1b1d2d7 --- /dev/null +++ b/libretro-sdk/libco/amd64.c @@ -0,0 +1,117 @@ +/* + libco.amd64 (2009-10-12) + author: byuu + license: public domain +*/ + +#define LIBCO_C +#include "libco.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static thread_local long long co_active_buffer[64]; +static thread_local cothread_t co_active_handle = 0; +static void (*co_swap)(cothread_t, cothread_t) = 0; + +#ifdef _WIN32 +//ABI: Win64 +static unsigned char co_swap_function[] = { + 0x48, 0x89, 0x22, 0x48, 0x8B, 0x21, 0x58, 0x48, 0x89, 0x6A, 0x08, 0x48, 0x89, 0x72, 0x10, 0x48, + 0x89, 0x7A, 0x18, 0x48, 0x89, 0x5A, 0x20, 0x4C, 0x89, 0x62, 0x28, 0x4C, 0x89, 0x6A, 0x30, 0x4C, + 0x89, 0x72, 0x38, 0x4C, 0x89, 0x7A, 0x40, 0x48, 0x81, 0xC2, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, + 0xE2, 0xF0, 0x0F, 0x29, 0x32, 0x0F, 0x29, 0x7A, 0x10, 0x44, 0x0F, 0x29, 0x42, 0x20, 0x44, 0x0F, + 0x29, 0x4A, 0x30, 0x44, 0x0F, 0x29, 0x52, 0x40, 0x44, 0x0F, 0x29, 0x5A, 0x50, 0x44, 0x0F, 0x29, + 0x62, 0x60, 0x44, 0x0F, 0x29, 0x6A, 0x70, 0x44, 0x0F, 0x29, 0xB2, 0x80, 0x00, 0x00, 0x00, 0x44, + 0x0F, 0x29, 0xBA, 0x90, 0x00, 0x00, 0x00, 0x48, 0x8B, 0x69, 0x08, 0x48, 0x8B, 0x71, 0x10, 0x48, + 0x8B, 0x79, 0x18, 0x48, 0x8B, 0x59, 0x20, 0x4C, 0x8B, 0x61, 0x28, 0x4C, 0x8B, 0x69, 0x30, 0x4C, + 0x8B, 0x71, 0x38, 0x4C, 0x8B, 0x79, 0x40, 0x48, 0x81, 0xC1, 0x80, 0x00, 0x00, 0x00, 0x48, 0x83, + 0xE1, 0xF0, 0x0F, 0x29, 0x31, 0x0F, 0x29, 0x79, 0x10, 0x44, 0x0F, 0x29, 0x41, 0x20, 0x44, 0x0F, + 0x29, 0x49, 0x30, 0x44, 0x0F, 0x29, 0x51, 0x40, 0x44, 0x0F, 0x29, 0x59, 0x50, 0x44, 0x0F, 0x29, + 0x61, 0x60, 0x44, 0x0F, 0x29, 0x69, 0x70, 0x44, 0x0F, 0x29, 0xB1, 0x80, 0x00, 0x00, 0x00, 0x44, + 0x0F, 0x29, 0xB9, 0x90, 0x00, 0x00, 0x00, 0xFF, 0xE0, +}; + +#include + +void co_init(void) +{ + DWORD old_privileges; + VirtualProtect(co_swap_function, sizeof(co_swap_function), PAGE_EXECUTE_READWRITE, &old_privileges); +} +#else +//ABI: SystemV +static unsigned char co_swap_function[] = { + 0x48, 0x89, 0x26, 0x48, 0x8B, 0x27, 0x58, 0x48, 0x89, 0x6E, 0x08, 0x48, 0x89, 0x5E, 0x10, 0x4C, + 0x89, 0x66, 0x18, 0x4C, 0x89, 0x6E, 0x20, 0x4C, 0x89, 0x76, 0x28, 0x4C, 0x89, 0x7E, 0x30, 0x48, + 0x8B, 0x6F, 0x08, 0x48, 0x8B, 0x5F, 0x10, 0x4C, 0x8B, 0x67, 0x18, 0x4C, 0x8B, 0x6F, 0x20, 0x4C, + 0x8B, 0x77, 0x28, 0x4C, 0x8B, 0x7F, 0x30, 0xFF, 0xE0, +}; + +#include +#include + +void co_init(void) +{ + unsigned long long addr = (unsigned long long)co_swap_function; + unsigned long long base = addr - (addr % sysconf(_SC_PAGESIZE)); + unsigned long long size = (addr - base) + sizeof(co_swap_function); + mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC); +} +#endif + +static void crash(void) +{ + assert(0); /* called only if cothread_t entrypoint returns */ +} + +cothread_t co_active(void) +{ + if (!co_active_handle) + co_active_handle = &co_active_buffer; + return co_active_handle; +} + +cothread_t co_create(unsigned int size, void (*entrypoint)(void)) +{ + cothread_t handle; + + if(!co_swap) + { + co_init(); + co_swap = (void (*)(cothread_t, cothread_t))co_swap_function; + } + + if (!co_active_handle) + co_active_handle = &co_active_buffer; + size += 512; /* allocate additional space for storage */ + size &= ~15; /* align stack to 16-byte boundary */ + + if(handle = (cothread_t)malloc(size)) + { + long long *p = (long long*)((char*)handle + size); /* seek to top of stack */ + *--p = (long long)crash; /* crash if entrypoint returns */ + *--p = (long long)entrypoint; /* start of function */ + *(long long*)handle = (long long)p; /* stack pointer */ + } + + return handle; +} + +void co_delete(cothread_t handle) +{ + free(handle); +} + +void co_switch(cothread_t handle) +{ + register cothread_t co_previous_handle = co_active_handle; + co_swap(co_active_handle = handle, co_previous_handle); +} + +#ifdef __cplusplus +} +#endif diff --git a/libretro-sdk/libco/armeabi.c b/libretro-sdk/libco/armeabi.c new file mode 100644 index 0000000000..709cf0bc12 --- /dev/null +++ b/libretro-sdk/libco/armeabi.c @@ -0,0 +1,90 @@ +/* + libco.armeabi (2013-04-05) + author: Themaister + license: public domain +*/ + +#define LIBCO_C +#include "libco.h" +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static thread_local uint32_t co_active_buffer[64]; +static thread_local cothread_t co_active_handle; + +asm ( + ".arm\n" + ".align 4\n" + ".globl co_switch_arm\n" + ".globl _co_switch_arm\n" + "co_switch_arm:\n" + "_co_switch_arm:\n" + " stmia r1!, {r4, r5, r6, r7, r8, r9, r10, r11, sp, lr}\n" + " ldmia r0!, {r4, r5, r6, r7, r8, r9, r10, r11, sp, pc}\n" + ); + +// ASM +void co_switch_arm(cothread_t handle, cothread_t current); + +static void crash(void) +{ + assert(0); // Called only if cothread_t entrypoint returns. +} + +cothread_t co_create(unsigned int size, void (*entrypoint)(void)) +{ + size = (size + 1023) & ~1023; + cothread_t handle = 0; +#if HAVE_POSIX_MEMALIGN >= 1 + if (posix_memalign(&handle, 1024, size + 256) < 0) + return 0; +#else + handle = memalign(1024, size + 256); +#endif + + if (!handle) + return handle; + + uint32_t *ptr = (uint32_t*)handle; + // Non-volatiles + ptr[0] = 0; // r4 + ptr[1] = 0; // r5 + ptr[2] = 0; // r6 + ptr[3] = 0; // r7 + ptr[4] = 0; // r8 + ptr[5] = 0; // r9 + ptr[6] = 0; // r10 + ptr[7] = 0; // r11 + ptr[8] = (uintptr_t)ptr + size + 256 - 4; // r13, stack pointer + ptr[9] = (uintptr_t)entrypoint; // r15, PC (link register r14 gets saved here). + return handle; +} + +cothread_t co_active(void) +{ + if (!co_active_handle) + co_active_handle = co_active_buffer; + return co_active_handle; +} + +void co_delete(cothread_t handle) +{ + free(handle); +} + +void co_switch(cothread_t handle) +{ + cothread_t co_previous_handle = co_active(); + co_switch_arm(co_active_handle = handle, co_previous_handle); +} + +#ifdef __cplusplus +} +#endif + diff --git a/libretro-sdk/libco/fiber.c b/libretro-sdk/libco/fiber.c new file mode 100644 index 0000000000..067005d594 --- /dev/null +++ b/libretro-sdk/libco/fiber.c @@ -0,0 +1,58 @@ +/* + libco.win (2008-01-28) + authors: Nach, byuu + license: public domain +*/ + +#define LIBCO_C +#include "libco.h" +#define WINVER 0x0400 +#define _WIN32_WINNT 0x0400 +#define WIN32_LEAN_AND_MEAN +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static thread_local cothread_t co_active_ = 0; + +static void __stdcall co_thunk(void *coentry) +{ + ((void (*)(void))coentry)(); +} + +cothread_t co_active(void) +{ + if(!co_active_) + { + ConvertThreadToFiber(0); + co_active_ = GetCurrentFiber(); + } + return co_active_; +} + +cothread_t co_create(unsigned int heapsize, void (*coentry)(void)) +{ + if(!co_active_) + { + ConvertThreadToFiber(0); + co_active_ = GetCurrentFiber(); + } + return (cothread_t)CreateFiber(heapsize, co_thunk, (void*)coentry); +} + +void co_delete(cothread_t cothread) +{ + DeleteFiber(cothread); +} + +void co_switch(cothread_t cothread) +{ + co_active_ = cothread; + SwitchToFiber(cothread); +} + +#ifdef __cplusplus +} +#endif diff --git a/libretro-sdk/libco/libco.c b/libretro-sdk/libco/libco.c new file mode 100644 index 0000000000..63126d3c23 --- /dev/null +++ b/libretro-sdk/libco/libco.c @@ -0,0 +1,21 @@ +/* + libco + auto-selection module + license: public domain +*/ + +#if defined(__GNUC__) && defined(__i386__) || (defined(_MSC_VER) && defined(_M_IX86)) + #include "x86.c" +#elif defined(__GNUC__) && defined(__amd64__) || (defined(_MSC_VER) && defined(_M_AMD64)) + #include "amd64.c" +#elif defined(__GNUC__) && defined(_ARCH_PPC) + #include "ppc.c" +#elif defined(__GNUC__) && (defined(__ARM_EABI__) || defined(__arm__)) + #include "armeabi.c" +#elif defined(__GNUC__) + #include "sjlj.c" +#elif defined(_MSC_VER) + #include "fiber.c" +#else + #error "libco: unsupported processor, compiler or operating system" +#endif diff --git a/libretro-sdk/libco/libco.h b/libretro-sdk/libco/libco.h new file mode 100644 index 0000000000..9b180cb76a --- /dev/null +++ b/libretro-sdk/libco/libco.h @@ -0,0 +1,34 @@ +/* + libco + version: 0.16 (2010-12-24) + license: public domain +*/ + +#ifndef LIBCO_H +#define LIBCO_H + +#ifdef LIBCO_C + #ifdef LIBCO_MP + #define thread_local __thread + #else + #define thread_local + #endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* cothread_t; + +cothread_t co_active(void); +cothread_t co_create(unsigned int, void (*)(void)); +void co_delete(cothread_t); +void co_switch(cothread_t); + +#ifdef __cplusplus +} +#endif + +/* ifndef LIBCO_H */ +#endif diff --git a/libretro-sdk/libco/ppc.c b/libretro-sdk/libco/ppc.c new file mode 100644 index 0000000000..356335d7bb --- /dev/null +++ b/libretro-sdk/libco/ppc.c @@ -0,0 +1,407 @@ +/* + libco.ppc (2010-10-17) + author: blargg + license: public domain +*/ + +/* PowerPC 32/64 using embedded or external asm, with optional +floating-point and AltiVec save/restore */ + +#define LIBCO_C +#include "libco.h" +#include +#include +#include + +#define LIBCO_MPROTECT (__unix__ && !LIBCO_PPC_ASM) + +#if LIBCO_MPROTECT + #include + #include +#endif + +/* State format (offsets in 32-bit words) + ++0 Pointer to swap code + Rest of function descriptor for entry function ++8 PC ++10 SP + Special regs + GPRs + FPRs + VRs + stack +*/ + +enum { state_size = 1024 }; +enum { above_stack = 2048 }; +enum { stack_align = 256 }; + +static thread_local cothread_t co_active_handle = 0; + +/**** Determine environment ****/ + +#define LIBCO_PPC64 (_ARCH_PPC64 || __PPC64__ || __ppc64__ || __powerpc64__) + +/* Whether function calls are indirect through a descriptor, +or are directly to function */ +#ifndef LIBCO_PPCDESC + #if !_CALL_SYSV && (_CALL_AIX || _CALL_AIXDESC || LIBCO_PPC64) + #define LIBCO_PPCDESC 1 + #endif +#endif + +#ifdef LIBCO_PPC_ASM + + #ifdef __cplusplus + extern "C" + #endif + + /* Swap code is in ppc.S */ + void co_swap_asm( cothread_t, cothread_t ); + #define CO_SWAP_ASM( x, y ) co_swap_asm( x, y ) + +#else + +/* Swap code is here in array. Please leave dieassembly comments, +as they make it easy to see what it does, and reorder instructions +if one wants to see whether that improves performance. */ +static const uint32_t libco_ppc_code [] = { +#if LIBCO_PPC64 + 0x7d000026, /* mfcr r8 */ + 0xf8240028, /* std r1,40(r4) */ + 0x7d2802a6, /* mflr r9 */ + 0xf9c40048, /* std r14,72(r4) */ + 0xf9e40050, /* std r15,80(r4) */ + 0xfa040058, /* std r16,88(r4) */ + 0xfa240060, /* std r17,96(r4) */ + 0xfa440068, /* std r18,104(r4) */ + 0xfa640070, /* std r19,112(r4) */ + 0xfa840078, /* std r20,120(r4) */ + 0xfaa40080, /* std r21,128(r4) */ + 0xfac40088, /* std r22,136(r4) */ + 0xfae40090, /* std r23,144(r4) */ + 0xfb040098, /* std r24,152(r4) */ + 0xfb2400a0, /* std r25,160(r4) */ + 0xfb4400a8, /* std r26,168(r4) */ + 0xfb6400b0, /* std r27,176(r4) */ + 0xfb8400b8, /* std r28,184(r4) */ + 0xfba400c0, /* std r29,192(r4) */ + 0xfbc400c8, /* std r30,200(r4) */ + 0xfbe400d0, /* std r31,208(r4) */ + 0xf9240020, /* std r9,32(r4) */ + 0xe8e30020, /* ld r7,32(r3) */ + 0xe8230028, /* ld r1,40(r3) */ + 0x48000009, /* bl 1 */ + 0x7fe00008, /* trap */ + 0x91040030,/*1:stw r8,48(r4) */ + 0x80c30030, /* lwz r6,48(r3) */ + 0x7ce903a6, /* mtctr r7 */ + 0xe9c30048, /* ld r14,72(r3) */ + 0xe9e30050, /* ld r15,80(r3) */ + 0xea030058, /* ld r16,88(r3) */ + 0xea230060, /* ld r17,96(r3) */ + 0xea430068, /* ld r18,104(r3) */ + 0xea630070, /* ld r19,112(r3) */ + 0xea830078, /* ld r20,120(r3) */ + 0xeaa30080, /* ld r21,128(r3) */ + 0xeac30088, /* ld r22,136(r3) */ + 0xeae30090, /* ld r23,144(r3) */ + 0xeb030098, /* ld r24,152(r3) */ + 0xeb2300a0, /* ld r25,160(r3) */ + 0xeb4300a8, /* ld r26,168(r3) */ + 0xeb6300b0, /* ld r27,176(r3) */ + 0xeb8300b8, /* ld r28,184(r3) */ + 0xeba300c0, /* ld r29,192(r3) */ + 0xebc300c8, /* ld r30,200(r3) */ + 0xebe300d0, /* ld r31,208(r3) */ + 0x7ccff120, /* mtcr r6 */ +#else + 0x7d000026, /* mfcr r8 */ + 0x90240028, /* stw r1,40(r4) */ + 0x7d2802a6, /* mflr r9 */ + 0x91a4003c, /* stw r13,60(r4) */ + 0x91c40040, /* stw r14,64(r4) */ + 0x91e40044, /* stw r15,68(r4) */ + 0x92040048, /* stw r16,72(r4) */ + 0x9224004c, /* stw r17,76(r4) */ + 0x92440050, /* stw r18,80(r4) */ + 0x92640054, /* stw r19,84(r4) */ + 0x92840058, /* stw r20,88(r4) */ + 0x92a4005c, /* stw r21,92(r4) */ + 0x92c40060, /* stw r22,96(r4) */ + 0x92e40064, /* stw r23,100(r4) */ + 0x93040068, /* stw r24,104(r4) */ + 0x9324006c, /* stw r25,108(r4) */ + 0x93440070, /* stw r26,112(r4) */ + 0x93640074, /* stw r27,116(r4) */ + 0x93840078, /* stw r28,120(r4) */ + 0x93a4007c, /* stw r29,124(r4) */ + 0x93c40080, /* stw r30,128(r4) */ + 0x93e40084, /* stw r31,132(r4) */ + 0x91240020, /* stw r9,32(r4) */ + 0x80e30020, /* lwz r7,32(r3) */ + 0x80230028, /* lwz r1,40(r3) */ + 0x48000009, /* bl 1 */ + 0x7fe00008, /* trap */ + 0x91040030,/*1:stw r8,48(r4) */ + 0x80c30030, /* lwz r6,48(r3) */ + 0x7ce903a6, /* mtctr r7 */ + 0x81a3003c, /* lwz r13,60(r3) */ + 0x81c30040, /* lwz r14,64(r3) */ + 0x81e30044, /* lwz r15,68(r3) */ + 0x82030048, /* lwz r16,72(r3) */ + 0x8223004c, /* lwz r17,76(r3) */ + 0x82430050, /* lwz r18,80(r3) */ + 0x82630054, /* lwz r19,84(r3) */ + 0x82830058, /* lwz r20,88(r3) */ + 0x82a3005c, /* lwz r21,92(r3) */ + 0x82c30060, /* lwz r22,96(r3) */ + 0x82e30064, /* lwz r23,100(r3) */ + 0x83030068, /* lwz r24,104(r3) */ + 0x8323006c, /* lwz r25,108(r3) */ + 0x83430070, /* lwz r26,112(r3) */ + 0x83630074, /* lwz r27,116(r3) */ + 0x83830078, /* lwz r28,120(r3) */ + 0x83a3007c, /* lwz r29,124(r3) */ + 0x83c30080, /* lwz r30,128(r3) */ + 0x83e30084, /* lwz r31,132(r3) */ + 0x7ccff120, /* mtcr r6 */ +#endif + +#ifndef LIBCO_PPC_NOFP + 0xd9c400e0, /* stfd f14,224(r4) */ + 0xd9e400e8, /* stfd f15,232(r4) */ + 0xda0400f0, /* stfd f16,240(r4) */ + 0xda2400f8, /* stfd f17,248(r4) */ + 0xda440100, /* stfd f18,256(r4) */ + 0xda640108, /* stfd f19,264(r4) */ + 0xda840110, /* stfd f20,272(r4) */ + 0xdaa40118, /* stfd f21,280(r4) */ + 0xdac40120, /* stfd f22,288(r4) */ + 0xdae40128, /* stfd f23,296(r4) */ + 0xdb040130, /* stfd f24,304(r4) */ + 0xdb240138, /* stfd f25,312(r4) */ + 0xdb440140, /* stfd f26,320(r4) */ + 0xdb640148, /* stfd f27,328(r4) */ + 0xdb840150, /* stfd f28,336(r4) */ + 0xdba40158, /* stfd f29,344(r4) */ + 0xdbc40160, /* stfd f30,352(r4) */ + 0xdbe40168, /* stfd f31,360(r4) */ + 0xc9c300e0, /* lfd f14,224(r3) */ + 0xc9e300e8, /* lfd f15,232(r3) */ + 0xca0300f0, /* lfd f16,240(r3) */ + 0xca2300f8, /* lfd f17,248(r3) */ + 0xca430100, /* lfd f18,256(r3) */ + 0xca630108, /* lfd f19,264(r3) */ + 0xca830110, /* lfd f20,272(r3) */ + 0xcaa30118, /* lfd f21,280(r3) */ + 0xcac30120, /* lfd f22,288(r3) */ + 0xcae30128, /* lfd f23,296(r3) */ + 0xcb030130, /* lfd f24,304(r3) */ + 0xcb230138, /* lfd f25,312(r3) */ + 0xcb430140, /* lfd f26,320(r3) */ + 0xcb630148, /* lfd f27,328(r3) */ + 0xcb830150, /* lfd f28,336(r3) */ + 0xcba30158, /* lfd f29,344(r3) */ + 0xcbc30160, /* lfd f30,352(r3) */ + 0xcbe30168, /* lfd f31,360(r3) */ +#endif + +#ifdef __ALTIVEC__ + 0x7ca042a6, /* mfvrsave r5 */ + 0x39040180, /* addi r8,r4,384 */ + 0x39240190, /* addi r9,r4,400 */ + 0x70a00fff, /* andi. r0,r5,4095 */ + 0x90a40034, /* stw r5,52(r4) */ + 0x4182005c, /* beq- 2 */ + 0x7e8041ce, /* stvx v20,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7ea049ce, /* stvx v21,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7ec041ce, /* stvx v22,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7ee049ce, /* stvx v23,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7f0041ce, /* stvx v24,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7f2049ce, /* stvx v25,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7f4041ce, /* stvx v26,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7f6049ce, /* stvx v27,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7f8041ce, /* stvx v28,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7fa049ce, /* stvx v29,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7fc041ce, /* stvx v30,r0,r8 */ + 0x7fe049ce, /* stvx v31,r0,r9 */ + 0x80a30034,/*2:lwz r5,52(r3) */ + 0x39030180, /* addi r8,r3,384 */ + 0x39230190, /* addi r9,r3,400 */ + 0x70a00fff, /* andi. r0,r5,4095 */ + 0x7ca043a6, /* mtvrsave r5 */ + 0x4d820420, /* beqctr */ + 0x7e8040ce, /* lvx v20,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7ea048ce, /* lvx v21,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7ec040ce, /* lvx v22,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7ee048ce, /* lvx v23,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7f0040ce, /* lvx v24,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7f2048ce, /* lvx v25,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7f4040ce, /* lvx v26,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7f6048ce, /* lvx v27,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7f8040ce, /* lvx v28,r0,r8 */ + 0x39080020, /* addi r8,r8,32 */ + 0x7fa048ce, /* lvx v29,r0,r9 */ + 0x39290020, /* addi r9,r9,32 */ + 0x7fc040ce, /* lvx v30,r0,r8 */ + 0x7fe048ce, /* lvx v31,r0,r9 */ +#endif + + 0x4e800420, /* bctr */ +}; + + #if LIBCO_PPCDESC + /* Function call goes through indirect descriptor */ + #define CO_SWAP_ASM( x, y ) \ + ((void (*)( cothread_t, cothread_t )) (uintptr_t) x)( x, y ) + #else + /* Function call goes directly to code */ + #define CO_SWAP_ASM( x, y ) \ + ((void (*)( cothread_t, cothread_t )) (uintptr_t) libco_ppc_code)( x, y ) + #endif + +#endif + +static uint32_t* co_create_( unsigned size, uintptr_t entry ) +{ + uint32_t* t = (uint32_t*) malloc( size ); + + (void) entry; + + #if LIBCO_PPCDESC + if ( t ) + { + /* Copy entry's descriptor */ + memcpy( t, (void*) entry, sizeof (void*) * 3 ); + + /* Set function pointer to swap routine */ + #ifdef LIBCO_PPC_ASM + *(const void**) t = *(void**) &co_swap_asm; + #else + *(const void**) t = libco_ppc_code; + #endif + } + #endif + + return t; +} + +cothread_t co_create( unsigned int size, void (*entry_)( void ) ) +{ + uintptr_t entry = (uintptr_t) entry_; + uint32_t* t = NULL; + + /* Be sure main thread was successfully allocated */ + if ( co_active() ) + { + size += state_size + above_stack + stack_align; + t = co_create_( size, entry ); + } + + if ( t ) + { + uintptr_t sp; + int shift; + + /* Save current registers into new thread, so that any special ones will + have proper values when thread is begun */ + CO_SWAP_ASM( t, t ); + + #if LIBCO_PPCDESC + /* Get real address */ + entry = (uintptr_t) *(void**) entry; + #endif + + /* Put stack near end of block, and align */ + sp = (uintptr_t) t + size - above_stack; + sp -= sp % stack_align; + + /* On PPC32, we save and restore GPRs as 32 bits. For PPC64, we + save and restore them as 64 bits, regardless of the size the ABI + uses. So, we manually write pointers at the proper size. We always + save and restore at the same address, and since PPC is big-endian, + we must put the low byte first on PPC32. */ + + /* If uintptr_t is 32 bits, >>32 is undefined behavior, so we do two shifts + and don't have to care how many bits uintptr_t is. */ + #if LIBCO_PPC64 + shift = 16; + #else + shift = 0; + #endif + + /* Set up so entry will be called on next swap */ + t [8] = (uint32_t) (entry >> shift >> shift); + t [9] = (uint32_t) entry; + + t [10] = (uint32_t) (sp >> shift >> shift); + t [11] = (uint32_t) sp; + } + + return t; +} + +void co_delete( cothread_t t ) +{ + free(t); +} + +static void co_init_( void ) +{ +#if LIBCO_MPROTECT + /* TODO: pre- and post-pad PPC code so that this doesn't make other + data executable and writable */ + long page_size = sysconf( _SC_PAGESIZE ); + if ( page_size > 0 ) + { + uintptr_t align = page_size; + uintptr_t begin = (uintptr_t) libco_ppc_code; + uintptr_t end = begin + sizeof libco_ppc_code; + + /* Align beginning and end */ + end += align - 1; + end -= end % align; + begin -= begin % align; + + mprotect( (void*) begin, end - begin, PROT_READ | PROT_WRITE | PROT_EXEC ); + } +#endif + + co_active_handle = co_create_( state_size, (uintptr_t) &co_switch ); +} + +cothread_t co_active(void) +{ + if (!co_active_handle) + co_init_(); + + return co_active_handle; +} + +void co_switch(cothread_t t) +{ + cothread_t old = co_active_handle; + co_active_handle = t; + + CO_SWAP_ASM( t, old ); +} diff --git a/libretro-sdk/libco/sjlj.c b/libretro-sdk/libco/sjlj.c new file mode 100644 index 0000000000..28c9c38a63 --- /dev/null +++ b/libretro-sdk/libco/sjlj.c @@ -0,0 +1,112 @@ +/* + libco.sjlj (2008-01-28) + author: Nach + license: public domain +*/ + +/* + * Note this was designed for UNIX systems. Based on ideas expressed in a paper + * by Ralf Engelschall. + * For SJLJ on other systems, one would want to rewrite springboard() and + * co_create() and hack the jmb_buf stack pointer. + */ + +#define LIBCO_C +#include "libco.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct +{ + sigjmp_buf context; + void (*coentry)(void); + void *stack; +} cothread_struct; + +static thread_local cothread_struct co_primary; +static thread_local cothread_struct *creating, *co_running = 0; + +static void springboard(int ignored) +{ + if(sigsetjmp(creating->context, 0)) + co_running->coentry(); +} + +cothread_t co_active(void) +{ + if (!co_running) + co_running = &co_primary; + return (cothread_t)co_running; +} + +cothread_t co_create(unsigned int size, void (*coentry)(void)) +{ + if(!co_running) + co_running = &co_primary; + + cothread_struct *thread = (cothread_struct*)malloc(sizeof(cothread_struct)); + + if(thread) + { + struct sigaction handler; + struct sigaction old_handler; + + stack_t stack; + stack_t old_stack; + + thread->coentry = thread->stack = 0; + + stack.ss_flags = 0; + stack.ss_size = size; + thread->stack = stack.ss_sp = malloc(size); + if(stack.ss_sp && !sigaltstack(&stack, &old_stack)) { + handler.sa_handler = springboard; + handler.sa_flags = SA_ONSTACK; + sigemptyset(&handler.sa_mask); + creating = thread; + + if(!sigaction(SIGUSR1, &handler, &old_handler)) { + if(!raise(SIGUSR1)) { + thread->coentry = coentry; + } + sigaltstack(&old_stack, 0); + sigaction(SIGUSR1, &old_handler, 0); + } + } + + if(thread->coentry != coentry) { + co_delete(thread); + thread = 0; + } + } + + return (cothread_t)thread; +} + +void co_delete(cothread_t cothread) +{ + if(cothread) + { + if(((cothread_struct*)cothread)->stack) + free(((cothread_struct*)cothread)->stack); + free(cothread); + } +} + +void co_switch(cothread_t cothread) +{ + if(!sigsetjmp(co_running->context, 0)) + { + co_running = (cothread_struct*)cothread; + siglongjmp(co_running->context, 1); + } +} + +#ifdef __cplusplus +} +#endif diff --git a/libretro-sdk/libco/ucontext.c b/libretro-sdk/libco/ucontext.c new file mode 100644 index 0000000000..ad6998ae15 --- /dev/null +++ b/libretro-sdk/libco/ucontext.c @@ -0,0 +1,81 @@ +/* + libco.ucontext (2008-01-28) + author: Nach + license: public domain +*/ + +/* + * WARNING: the overhead of POSIX ucontext is very high, + * assembly versions of libco or libco_sjlj should be much faster + * + * This library only exists for two reasons: + * 1 - as an initial test for the viability of a ucontext implementation + * 2 - to demonstrate the power and speed of libco over existing implementations, + * such as pth (which defaults to wrapping ucontext on unix targets) + * + * Use this library only as a *last resort* + */ + +#define LIBCO_C +#include "libco.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +static thread_local ucontext_t co_primary; +static thread_local ucontext_t *co_running = 0; + +cothread_t co_active(void) +{ + if (!co_running) + co_running = &co_primary; + return (cothread_t)co_running; +} + +cothread_t co_create(unsigned int heapsize, void (*coentry)(void)) +{ + if (!co_running) + co_running = &co_primary; + ucontext_t *thread = (ucontext_t*)malloc(sizeof(ucontext_t)); + + if(thread) + { + if((!getcontext(thread) && !(thread->uc_stack.ss_sp = 0)) && (thread->uc_stack.ss_sp = malloc(heapsize))) + { + thread->uc_link = co_running; + thread->uc_stack.ss_size = heapsize; + makecontext(thread, coentry, 0); + } + else + { + co_delete((cothread_t)thread); + thread = 0; + } + } + return (cothread_t)thread; +} + +void co_delete(cothread_t cothread) +{ + if (!cothread) + return; + + if(((ucontext_t*)cothread)->uc_stack.ss_sp) + free(((ucontext_t*)cothread)->uc_stack.ss_sp); + free(cothread); +} + +void co_switch(cothread_t cothread) +{ + ucontext_t *old_thread = co_running; + + co_running = (ucontext_t*)cothread; + swapcontext(old_thread, co_running); +} + +#ifdef __cplusplus +} +#endif diff --git a/libretro-sdk/libco/x86.c b/libretro-sdk/libco/x86.c new file mode 100644 index 0000000000..7760445c7a --- /dev/null +++ b/libretro-sdk/libco/x86.c @@ -0,0 +1,106 @@ +/* + libco.x86 (2009-10-12) + author: byuu + license: public domain +*/ + +#define LIBCO_C +#include "libco.h" +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_MSC_VER) + #define fastcall __fastcall +#elif defined(__GNUC__) + #define fastcall __attribute__((fastcall)) +#else + #error "libco: please define fastcall macro" +#endif + +static thread_local long co_active_buffer[64]; +static thread_local cothread_t co_active_handle = 0; +static void (fastcall *co_swap)(cothread_t, cothread_t) = 0; + +//ABI: fastcall +static unsigned char co_swap_function[] = { + 0x89, 0x22, 0x8B, 0x21, 0x58, 0x89, 0x6A, 0x04, 0x89, 0x72, 0x08, 0x89, 0x7A, 0x0C, 0x89, 0x5A, + 0x10, 0x8B, 0x69, 0x04, 0x8B, 0x71, 0x08, 0x8B, 0x79, 0x0C, 0x8B, 0x59, 0x10, 0xFF, 0xE0, +}; + +#ifdef _WIN32 +#include + +void co_init(void) +{ + DWORD old_privileges; + VirtualProtect(co_swap_function, sizeof co_swap_function, PAGE_EXECUTE_READWRITE, &old_privileges); +} +#else +#include +#include + +void co_init(void) +{ + unsigned long addr = (unsigned long)co_swap_function; + unsigned long base = addr - (addr % sysconf(_SC_PAGESIZE)); + unsigned long size = (addr - base) + sizeof co_swap_function; + mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC); +} +#endif + +static void crash(void) +{ + assert(0); /* called only if cothread_t entrypoint returns */ +} + +cothread_t co_active(void) +{ + if(!co_active_handle) + co_active_handle = &co_active_buffer; + return co_active_handle; +} + +cothread_t co_create(unsigned int size, void (*entrypoint)(void)) +{ + cothread_t handle; + if(!co_swap) + { + co_init(); + co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function; + } + + if(!co_active_handle) + co_active_handle = &co_active_buffer; + + size += 256; /* allocate additional space for storage */ + size &= ~15; /* align stack to 16-byte boundary */ + + if(handle = (cothread_t)malloc(size)) + { + long *p = (long*)((char*)handle + size); /* seek to top of stack */ + *--p = (long)crash; /* crash if entrypoint returns */ + *--p = (long)entrypoint; /* start of function */ + *(long*)handle = (long)p; /* stack pointer */ + } + + return handle; +} + +void co_delete(cothread_t handle) +{ + free(handle); +} + +void co_switch(cothread_t handle) +{ + register cothread_t co_previous_handle = co_active_handle; + co_swap(co_active_handle = handle, co_previous_handle); +} + +#ifdef __cplusplus +} +#endif diff --git a/rthreads/gx_pthread.h b/libretro-sdk/rthreads/gx_pthread.h similarity index 100% rename from rthreads/gx_pthread.h rename to libretro-sdk/rthreads/gx_pthread.h diff --git a/rthreads/psp_pthread.h b/libretro-sdk/rthreads/psp_pthread.h similarity index 100% rename from rthreads/psp_pthread.h rename to libretro-sdk/rthreads/psp_pthread.h diff --git a/rthreads/rthreads.c b/libretro-sdk/rthreads/rthreads.c similarity index 99% rename from rthreads/rthreads.c rename to libretro-sdk/rthreads/rthreads.c index a1a3f63805..fde84e343a 100644 --- a/rthreads/rthreads.c +++ b/libretro-sdk/rthreads/rthreads.c @@ -20,7 +20,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include "rthreads.h" +#include #include #if defined(_WIN32) diff --git a/rthreads/xenon_sdl_threads.c b/libretro-sdk/rthreads/xenon_sdl_threads.c similarity index 98% rename from rthreads/xenon_sdl_threads.c rename to libretro-sdk/rthreads/xenon_sdl_threads.c index 95905207f1..19482f1b26 100644 --- a/rthreads/xenon_sdl_threads.c +++ b/libretro-sdk/rthreads/xenon_sdl_threads.c @@ -25,7 +25,7 @@ #include "SDL_thread.h" #include "SDL_mutex.h" #include -#include "../boolean.h" +#include SDL_cond *SDL_CreateCond(void) { diff --git a/libretro_version_1.c b/libretro_version_1.c index f8dbc7bf81..a1deef17ec 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -15,7 +15,7 @@ * If not, see . */ -#include "boolean.h" +#include #include "libretro.h" #include "retro.h" #include diff --git a/message_queue.c b/message_queue.c index 1a921c051c..670419f661 100644 --- a/message_queue.c +++ b/message_queue.c @@ -16,7 +16,7 @@ #include #include #include -#include "boolean.h" +#include #include "message_queue.h" #include "retroarch_logger.h" #include "compat/posix_string.h" diff --git a/movie.h b/movie.h index a7d8145861..6909620563 100644 --- a/movie.h +++ b/movie.h @@ -18,7 +18,7 @@ #include #include -#include "boolean.h" +#include #define BSV_MAGIC 0x42535631 diff --git a/netplay.h b/netplay.h index c428f529b9..8b7c253c44 100644 --- a/netplay.h +++ b/netplay.h @@ -19,7 +19,7 @@ #include #include -#include "boolean.h" +#include #include "libretro.h" #include "retro.h" diff --git a/patch.c b/patch.c index 49fbbb7ac7..87d295213b 100644 --- a/patch.c +++ b/patch.c @@ -18,7 +18,7 @@ #include "patch.h" #include "hash.h" -#include "boolean.h" +#include #include "msvc/msvc_compat.h" #include #include diff --git a/record/ffemu.h b/record/ffemu.h index 29e30da8b9..ff4540ce69 100644 --- a/record/ffemu.h +++ b/record/ffemu.h @@ -18,7 +18,7 @@ #include #include -#include "../boolean.h" +#include #ifdef __cplusplus extern "C" { diff --git a/record/ffmpeg.c b/record/ffmpeg.c index 4cabfc2cac..6e6c6a25c9 100644 --- a/record/ffmpeg.c +++ b/record/ffmpeg.c @@ -42,9 +42,9 @@ extern "C" { #include #include #include -#include "../boolean.h" +#include #include "../fifo_buffer.h" -#include "../rthreads/rthreads.h" +#include #include "../general.h" #include "../gfx/scaler/scaler.h" #include "../conf/config_file.h" diff --git a/retroarch.c b/retroarch.c index 8a620b7bd2..598d5dff24 100644 --- a/retroarch.c +++ b/retroarch.c @@ -15,7 +15,7 @@ * If not, see . */ -#include "boolean.h" +#include #include "libretro.h" #include "retro.h" #include diff --git a/rewind.h b/rewind.h index d0705f9961..e531284876 100644 --- a/rewind.h +++ b/rewind.h @@ -17,7 +17,7 @@ #define __RARCH_REWIND_H #include -#include "boolean.h" +#include typedef struct state_manager state_manager_t; diff --git a/screenshot.c b/screenshot.c index 19f7381f9a..7f359bae9a 100644 --- a/screenshot.c +++ b/screenshot.c @@ -17,7 +17,7 @@ #include #include #include -#include "boolean.h" +#include #include #include #include "general.h" diff --git a/screenshot.h b/screenshot.h index b11a40272f..03d56a39d1 100644 --- a/screenshot.h +++ b/screenshot.h @@ -18,7 +18,7 @@ #include #include -#include "boolean.h" +#include bool screenshot_dump(const char *folder, const void *frame, unsigned width, unsigned height, int pitch, bool bgr24); diff --git a/settings_list.h b/settings_list.h index 2de8d30114..98301f78d0 100644 --- a/settings_list.h +++ b/settings_list.h @@ -19,7 +19,7 @@ #include #include -#include "boolean.h" +#include #ifdef __cplusplus extern "C" { diff --git a/string_list.h b/string_list.h index d645bc3793..efcfc43f76 100644 --- a/string_list.h +++ b/string_list.h @@ -17,7 +17,7 @@ #ifndef __RARCH_STRING_LIST_H #define __RARCH_STRING_LIST_H -#include "boolean.h" +#include #include #include diff --git a/tools/retroarch-joyconfig.c b/tools/retroarch-joyconfig.c index 2e669cfef3..6b5dc7abe8 100644 --- a/tools/retroarch-joyconfig.c +++ b/tools/retroarch-joyconfig.c @@ -21,7 +21,7 @@ #include #include #include "../compat/getopt_rarch.h" -#include "../boolean.h" +#include #include "../input/input_common.h" #include "../general.h" #include