RetroArch/griffin/griffin.c

679 lines
17 KiB
C
Raw Normal View History

2012-04-21 21:13:50 +00:00
/* RetroArch - A frontend for libretro.
2014-01-01 00:50:59 +00:00
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis
2012-04-13 23:02:37 +00:00
*
2012-04-21 21:13:50 +00:00
* RetroArch is free software: you can redistribute it and/or modify it under the terms
2012-04-13 23:02:37 +00:00
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
2012-04-21 21:13:50 +00:00
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
2012-04-13 23:02:37 +00:00
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
2012-04-21 21:31:57 +00:00
* You should have received a copy of the GNU General Public License along with RetroArch.
2012-04-13 23:02:37 +00:00
* If not, see <http://www.gnu.org/licenses/>.
*/
#if defined(HAVE_CG) || defined(HAVE_HLSL) || defined(HAVE_GLSL)
#define HAVE_SHADERS
#endif
2012-04-13 23:02:37 +00:00
#if defined(_XBOX)
#include "../msvc/msvc_compat.h"
2012-04-13 23:02:37 +00:00
#endif
#ifdef __CELLOS_LV2__
#include "../ps3/altivec_mem.c"
#endif
/*============================================================
CONSOLE EXTENSIONS
============================================================ */
#ifdef RARCH_CONSOLE
#if defined(HAVE_LOGGER) && defined(__PSL1GHT__)
#include "../console/logger/psl1ght_logger.c"
2012-12-16 03:13:31 +00:00
#elif defined(HAVE_LOGGER) && !defined(ANDROID)
#include "../console/logger/logger.c"
#endif
#ifdef HW_DOL
#include "../ngc/ssaram.c"
#endif
#endif
2012-04-13 23:02:37 +00:00
#ifdef HAVE_ZLIB
#include "../file_extract.c"
2012-11-03 07:42:33 +00:00
#endif
2013-01-12 23:42:21 +00:00
/*============================================================
RLAUNCH
============================================================ */
#ifdef HAVE_RLAUNCH
#include "../tools/retrolaunch/rl_fnmatch.c"
#include "../tools/retrolaunch/sha1.c"
#include "../tools/retrolaunch/cd_detect.c"
#include "../tools/retrolaunch/parser.c"
#include "../tools/retrolaunch/main.c"
2013-01-12 23:42:21 +00:00
#endif
2012-11-03 07:42:33 +00:00
/*============================================================
PERFORMANCE
============================================================ */
#ifdef ANDROID
#include "../performance/performance_android.c"
2012-11-03 07:42:33 +00:00
#endif
#include "../performance.c"
2012-11-03 07:42:33 +00:00
2012-04-13 23:02:37 +00:00
/*============================================================
COMPATIBILITY
============================================================ */
#include "../compat/compat.c"
2012-04-13 23:02:37 +00:00
/*============================================================
CONFIG FILE
============================================================ */
#ifdef _XBOX
2012-04-21 21:25:32 +00:00
#undef __RARCH_POSIX_STRING_H
#undef __RARCH_MSVC_COMPAT_H
2012-04-13 23:02:37 +00:00
#undef strcasecmp
#endif
#include "../conf/config_file.c"
2013-04-04 12:15:13 +00:00
#include "../core_options.c"
/*============================================================
CHEATS
============================================================ */
#include "../cheats.c"
#include "../hash.c"
2012-04-13 23:02:37 +00:00
/*============================================================
2012-05-28 03:19:04 +00:00
VIDEO CONTEXT
2012-04-13 23:02:37 +00:00
============================================================ */
2012-05-27 02:02:07 +00:00
#include "../gfx/gfx_context.c"
2012-05-27 23:15:00 +00:00
#if defined(__CELLOS_LV2__)
#include "../gfx/context/ps3_ctx.c"
#elif defined(_XBOX)
2014-03-09 14:49:20 +00:00
#include "../gfx/context/d3d_ctx.cpp"
2012-11-03 07:42:33 +00:00
#elif defined(ANDROID)
#include "../gfx/context/androidegl_ctx.c"
#elif defined(__BLACKBERRY_QNX__)
#include "../gfx/context/bbqnx_ctx.c"
#elif defined(IOS) || defined(OSX)
#include "../gfx/context/apple_gl_ctx.c"
#elif defined(EMSCRIPTEN)
#include "../gfx/context/emscriptenegl_ctx.c"
2012-05-27 20:58:14 +00:00
#endif
2013-07-28 17:55:18 +00:00
#if defined(HAVE_OPENGL)
#if defined(HAVE_KMS)
#include "../gfx/context/drm_egl_ctx.c"
#endif
#if defined(HAVE_VIDEOCORE)
#include "../gfx/context/vc_egl_ctx.c"
2012-05-27 20:58:14 +00:00
#endif
#if defined(HAVE_X11) && defined(HAVE_OPENGLES)
#include "../gfx/context/glx_ctx.c"
#endif
#if defined(HAVE_EGL)
#include "../gfx/context/xegl_ctx.c"
#endif
#endif
#ifdef HAVE_X11
#include "../gfx/context/x11_common.c"
#endif
2012-05-27 20:58:14 +00:00
2012-05-28 03:19:04 +00:00
/*============================================================
VIDEO SHADERS
============================================================ */
#ifdef HAVE_SHADERS
#include "../gfx/shader_common.c"
#include "../gfx/shader_parse.c"
2012-05-27 20:58:14 +00:00
#ifdef HAVE_CG
#include "../gfx/shader_cg.c"
#endif
2012-05-27 22:37:54 +00:00
#ifdef HAVE_HLSL
#include "../gfx/shader_hlsl.c"
2012-05-27 22:37:54 +00:00
#endif
2012-07-01 20:46:25 +00:00
#ifdef HAVE_GLSL
#include "../gfx/shader_glsl.c"
2012-07-01 20:46:25 +00:00
#endif
#endif
2012-05-28 03:19:04 +00:00
/*============================================================
VIDEO IMAGE
============================================================ */
#if defined(__CELLOS_LV2__)
2014-02-25 20:24:15 +00:00
#include "../gfx/image/image_ps3.c"
#elif defined(_XBOX1)
2014-02-25 20:24:15 +00:00
#include "../gfx/image/image_xdk1.c"
#elif defined(HAVE_SDL_IMAGE)
#include "../gfx/image/image_sdl.c"
#endif
#include "../gfx/image_context.c"
#include "../gfx/image/image_rpng.c"
#include "../gfx/rpng/rpng.c"
2012-05-28 03:19:04 +00:00
/*============================================================
VIDEO DRIVER
============================================================ */
2012-07-28 20:58:08 +00:00
#if defined(HAVE_OPENGL)
#include "../gfx/math/matrix.c"
2012-04-14 11:42:25 +00:00
#elif defined(GEKKO)
#ifdef HW_RVL
#include "../wii/vi_encoder.c"
#include "../wii/mem2_manager.c"
#endif
2012-04-14 11:42:25 +00:00
#endif
#ifdef HAVE_VG
#include "../gfx/vg.c"
#include "../gfx/math/matrix_3x3.c"
#endif
#ifdef HAVE_OMAP
#include "../gfx/omap_gfx.c"
#include "../gfx/fbdev.c"
#endif
#include "../gfx/gfx_common.c"
2012-07-15 17:12:58 +00:00
#ifdef _XBOX
#include "../xdk/xdk_resources.cpp"
#endif
2013-01-10 02:34:43 +00:00
#ifdef HAVE_OPENGL
#include "../gfx/gl.c"
2013-08-11 13:06:42 +00:00
2013-08-11 13:10:56 +00:00
#ifndef HAVE_PSGL
2013-07-05 17:29:48 +00:00
#include "../gfx/glsym/rglgen.c"
#ifdef HAVE_OPENGLES2
#include "../gfx/glsym/glsym_es2.c"
#else
#include "../gfx/glsym/glsym_gl.c"
#endif
2013-01-10 02:34:43 +00:00
#endif
2013-08-11 13:06:42 +00:00
#endif
#ifdef HAVE_XVIDEO
#include "../gfx/xvideo.c"
#endif
2013-01-10 02:34:43 +00:00
#ifdef _XBOX
#include "../xdk/xdk_d3d.cpp"
2013-01-10 02:34:43 +00:00
#endif
#if defined(GEKKO)
#include "../gx/gx_video.c"
2013-07-27 18:47:00 +00:00
#elif defined(PSP)
#include "../psp1/psp1_video.c"
#elif defined(XENON)
#include "../xenon/xenon360_video.c"
2013-01-09 04:57:02 +00:00
#endif
#if defined(HAVE_NULLVIDEO)
#include "../gfx/null.c"
#endif
2012-05-27 02:02:07 +00:00
/*============================================================
FONTS
============================================================ */
#ifdef _XBOX
#define DONT_HAVE_BITMAPFONTS
#endif
#if defined(HAVE_OPENGL) || defined(HAVE_D3D8) || defined(HAVE_D3D9)
#if defined(HAVE_FREETYPE) || !defined(DONT_HAVE_BITMAPFONTS)
#include "../gfx/fonts/fonts.c"
#if defined(HAVE_FREETYPE)
#include "../gfx/fonts/freetype.c"
#endif
#if !defined(DONT_HAVE_BITMAPFONTS)
#include "../gfx/fonts/bitmapfont.c"
#endif
#endif
2012-12-14 23:17:43 +00:00
#ifdef HAVE_OPENGL
#include "../gfx/fonts/gl_font.c"
2012-12-14 23:17:43 +00:00
#endif
2012-12-15 02:59:31 +00:00
#ifdef _XBOX
#include "../gfx/fonts/d3d_font.c"
2012-12-15 02:59:31 +00:00
#endif
#if defined(HAVE_LIBDBGFONT)
#include "../gfx/fonts/ps_libdbgfont.c"
2012-12-15 01:59:35 +00:00
#elif defined(HAVE_OPENGL)
#include "../gfx/fonts/gl_raster_font.c"
2012-07-30 23:23:42 +00:00
#elif defined(_XBOX1)
#include "../gfx/fonts/xdk1_xfonts.c"
2012-06-24 19:25:11 +00:00
#elif defined(_XBOX360)
#include "../gfx/fonts/xdk360_fonts.cpp"
2012-04-13 23:02:37 +00:00
#endif
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
INPUT
============================================================ */
#include "../input/input_common.c"
2013-12-10 18:42:42 +00:00
#include "../input/keyboard_line.c"
#ifdef HAVE_OVERLAY
#include "../input/overlay.c"
#endif
#if defined(__CELLOS_LV2__)
#include "../input/ps3_input.c"
#elif defined(SN_TARGET_PSP2) || defined(PSP)
#include "../input/psp_input.c"
2012-04-14 11:42:25 +00:00
#elif defined(GEKKO)
#ifdef HAVE_LIBSICKSAXIS
#include "../gx/sicksaxis.c"
#endif
#include "../input/gx_input.c"
#elif defined(_XBOX)
#include "../input/xdk_xinput_input.c"
#elif defined(XENON)
#include "../xenon/xenon360_input.c"
2012-11-03 07:42:33 +00:00
#elif defined(ANDROID)
#include "../android/native/jni/input_autodetect.c"
#include "../android/native/jni/input_android.c"
#elif defined(IOS) || defined(OSX)
#include "../input/apple_input.c"
#include "../input/apple_joypad.c"
#elif defined(__BLACKBERRY_QNX__)
#include "../blackberry-qnx/qnx_input.c"
#elif defined(EMSCRIPTEN)
#include "../input/rwebinput_input.c"
2013-01-09 04:57:02 +00:00
#endif
#ifdef HAVE_OSK
#if defined(__CELLOS_LV2__)
#include "../input/ps3_input_osk.c"
#endif
#endif
#if defined(__linux__) && !defined(ANDROID)
#include "../input/linuxraw_input.c"
#include "../input/linuxraw_joypad.c"
#endif
#ifdef HAVE_X11
#include "../input/x11_input.c"
#endif
2013-01-09 04:57:02 +00:00
#if defined(HAVE_NULLINPUT)
#include "../input/null.c"
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
2012-05-28 03:19:04 +00:00
STATE TRACKER
2012-04-13 23:02:37 +00:00
============================================================ */
2013-02-17 12:30:02 +00:00
#ifdef _XBOX
#define DONT_HAVE_STATE_TRACKER
#endif
#ifndef DONT_HAVE_STATE_TRACKER
#include "../gfx/state_tracker.c"
#endif
2012-04-13 23:02:37 +00:00
#ifdef HAVE_PYTHON
#include "../gfx/py_state/py_state.c"
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
FIFO BUFFER
============================================================ */
#include "../fifo_buffer.c"
2012-04-13 23:02:37 +00:00
/*============================================================
2013-02-08 10:49:51 +00:00
AUDIO RESAMPLER
2012-04-13 23:02:37 +00:00
============================================================ */
#include "../audio/resampler.c"
#include "../audio/sinc.c"
2014-03-23 13:27:31 +00:00
#ifdef HAVE_CC_RESAMPLER
#include "../audio/cc_resampler.c"
#endif
2012-04-13 23:02:37 +00:00
2013-11-17 18:47:37 +00:00
/*============================================================
CAMERA
============================================================ */
#ifdef HAVE_CAMERA
#if defined(ANDROID)
#include "../camera/android.c"
#elif defined(EMSCRIPTEN)
#include "../camera/rwebcam.c"
#endif
#ifdef HAVE_V4L2
#include "../camera/video4linux2.c"
#endif
#endif
/*============================================================
LOCATION
============================================================ */
#ifdef HAVE_LOCATION
#if defined(ANDROID)
#include "../location/android.c"
#endif
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
RSOUND
============================================================ */
#ifdef HAVE_RSOUND
#include "../audio/librsound.c"
#include "../audio/rsound.c"
2012-04-13 23:02:37 +00:00
#endif
/*============================================================
AUDIO UTILS
============================================================ */
#include "../audio/utils.c"
2012-04-13 23:02:37 +00:00
/*============================================================
AUDIO
============================================================ */
#if defined(__CELLOS_LV2__)
#include "../audio/ps3_audio.c"
#elif defined(XENON)
#include "../xenon/xenon360_audio.c"
2012-04-14 11:42:25 +00:00
#elif defined(GEKKO)
#include "../audio/gx_audio.c"
#elif defined(EMSCRIPTEN)
#include "../audio/rwebaudio.c"
2014-02-17 13:26:03 +00:00
#elif defined(PSP)
#include "../audio/psp1_audio.c"
#endif
#ifdef HAVE_XAUDIO
#include "../audio/xaudio.c"
#include "../audio/xaudio-c/xaudio-c.cpp"
#endif
#ifdef HAVE_DSOUND
#include "../audio/dsound.c"
#endif
#ifdef HAVE_SL
#include "../audio/opensl.c"
2013-01-09 04:57:02 +00:00
#endif
#ifdef HAVE_ALSA
#ifdef __QNX__
#include "../blackberry-qnx/alsa_qsa.c"
#else
#include "../audio/alsa.c"
#include "../audio/alsathread.c"
#endif
#endif
#ifdef HAVE_AL
#include "../audio/openal.c"
#endif
#ifdef HAVE_COREAUDIO
#include "../audio/coreaudio.c"
#endif
2013-01-09 04:57:02 +00:00
#if defined(HAVE_NULLAUDIO)
#include "../audio/null.c"
2012-07-08 16:30:19 +00:00
#endif
/*============================================================
DRIVERS
============================================================ */
#include "../driver.c"
/*============================================================
SCALERS
============================================================ */
#include "../gfx/scaler/scaler_filter.c"
#include "../gfx/scaler/pixconv.c"
#include "../gfx/scaler/scaler.c"
#include "../gfx/scaler/scaler_int.c"
/*============================================================
FILTERS
============================================================ */
#ifdef HAVE_FILTERS_BUILTIN
#include "../gfx/filters/2xsai.c"
#include "../gfx/filters/super2xsai.c"
#include "../gfx/filters/supereagle.c"
#include "../gfx/filters/2xbr.c"
#include "../gfx/filters/darken.c"
#include "../gfx/filters/epx.c"
#include "../gfx/filters/scale2x.c"
#include "../gfx/filters/blargg_ntsc_snes_rf.c"
#include "../gfx/filters/blargg_ntsc_snes_composite.c"
#include "../gfx/filters/blargg_ntsc_snes_svideo.c"
#include "../gfx/filters/blargg_ntsc_snes_rgb.c"
2014-05-02 19:09:59 +00:00
#include "../gfx/filters/lq2x.c"
2014-05-03 00:26:04 +00:00
#include "../gfx/filters/phosphor2x.c"
#include "../audio/filters/echo.c"
#ifndef ANDROID
2014-04-29 21:02:07 +00:00
#ifndef _WIN32
#include "../audio/filters/eq.c"
2014-04-29 21:02:07 +00:00
#endif
#endif
#include "../audio/filters/iir.c"
#include "../audio/filters/phaser.c"
#include "../audio/filters/reverb.c"
#include "../audio/filters/volume.c"
#include "../audio/filters/wah.c"
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
DYNAMIC
============================================================ */
#include "../dynamic.c"
2013-04-14 14:24:19 +00:00
#include "../dynamic_dummy.c"
2014-04-15 02:11:36 +00:00
#include "../gfx/filter.c"
2012-04-13 23:02:37 +00:00
/*============================================================
FILE
============================================================ */
#include "../file.c"
#include "../file_path.c"
2012-04-13 23:02:37 +00:00
/*============================================================
MESSAGE
============================================================ */
#include "../message_queue.c"
2012-04-13 23:02:37 +00:00
/*============================================================
PATCH
============================================================ */
#include "../patch.c"
2012-04-13 23:02:37 +00:00
/*============================================================
SETTINGS
============================================================ */
#include "../settings.c"
2012-04-13 23:02:37 +00:00
/*============================================================
REWIND
============================================================ */
#include "../rewind.c"
2012-04-13 23:02:37 +00:00
2013-07-27 10:59:23 +00:00
/*============================================================
FRONTEND
============================================================ */
#include "../frontend/frontend_context.c"
2013-07-27 10:59:23 +00:00
#if defined(__CELLOS_LV2__)
#include "../frontend/platform/platform_ps3.c"
#elif defined(GEKKO)
#include "../frontend/platform/platform_gx.c"
#ifdef HW_RVL
#include "../frontend/platform/platform_wii.c"
#endif
2013-07-27 10:59:23 +00:00
#elif defined(_XBOX)
#include "../frontend/platform/platform_xdk.c"
#elif defined(PSP)
#include "../frontend/platform/platform_psp.c"
2013-07-27 15:16:46 +00:00
#elif defined(__QNX__)
#include "../frontend/platform/platform_qnx.c"
2013-07-27 15:40:21 +00:00
#elif defined(OSX) || defined(IOS)
#include "../frontend/platform/platform_apple.c"
2013-11-03 15:38:56 +00:00
#elif defined(ANDROID)
#include "../frontend/platform/platform_android.c"
2013-07-27 10:59:23 +00:00
#endif
#include "../frontend/platform/platform_null.c"
2013-07-27 10:59:23 +00:00
2014-03-01 10:53:04 +00:00
#include "../frontend/info/core_info.c"
2012-04-13 23:02:37 +00:00
/*============================================================
MAIN
============================================================ */
2013-01-08 05:26:02 +00:00
#if defined(XENON)
#include "../frontend/frontend_xenon.c"
#else
#include "../frontend/frontend.c"
#endif
2013-02-25 06:29:09 +00:00
2012-04-13 23:02:37 +00:00
/*============================================================
2012-04-22 00:06:34 +00:00
RETROARCH
2012-04-13 23:02:37 +00:00
============================================================ */
#include "../retroarch.c"
2012-04-13 23:02:37 +00:00
/*============================================================
THREAD
============================================================ */
#if defined(HAVE_THREADS) && defined(XENON)
#include "../thread/xenon_sdl_threads.c"
2013-02-16 11:30:26 +00:00
#elif defined(HAVE_THREADS)
#include "../thread.c"
2013-12-31 21:10:58 +00:00
#include "../gfx/video_thread_wrapper.c"
#include "../audio/thread_wrapper.c"
#include "../autosave.c"
2012-04-14 12:08:00 +00:00
#endif
2012-04-13 23:02:37 +00:00
2013-02-16 11:30:26 +00:00
2012-04-13 23:02:37 +00:00
/*============================================================
NETPLAY
============================================================ */
2012-05-28 03:19:04 +00:00
#ifdef HAVE_NETPLAY
#include "../netplay.c"
2012-04-14 12:08:00 +00:00
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
SCREENSHOTS
============================================================ */
#if defined(_XBOX1)
#include "../xdk/screenshot_xdk1.c"
#elif defined(HAVE_SCREENSHOTS)
#include "../screenshot.c"
#endif
2012-04-13 23:02:37 +00:00
/*============================================================
MENU
============================================================ */
2013-04-18 13:04:09 +00:00
#ifdef HAVE_MENU
2014-03-02 05:07:18 +00:00
#include "../frontend/menu/menu_input_line_cb.c"
#include "../frontend/menu/menu_common.c"
#include "../frontend/menu/menu_navigation.c"
2013-04-28 01:52:48 +00:00
#include "../frontend/menu/history.c"
#include "../frontend/menu/file_list.c"
#if defined(HAVE_RMENU) || defined(HAVE_RGUI) || defined(HAVE_RMENU_XUI)
#include "../frontend/menu/backend/menu_common_backend.c"
#endif
#ifdef HAVE_RMENU
#include "../frontend/menu/disp/rmenu.c"
#endif
#ifdef HAVE_RGUI
#include "../frontend/menu/disp/rgui.c"
#endif
#ifdef HAVE_RMENU_XUI
2013-12-29 03:26:34 +00:00
#include "../frontend/menu/disp/rmenu_xui.cpp"
#endif
#if defined(HAVE_LAKKA) && defined(HAVE_OPENGL)
#include "../frontend/menu/disp/lakka.c"
#endif
2013-04-18 13:04:09 +00:00
#endif
2012-11-20 02:40:39 +00:00
#ifdef __cplusplus
extern "C" {
#endif
/*============================================================
RZLIB
============================================================ */
2013-02-16 20:43:29 +00:00
#ifdef WANT_MINIZ
#include "../deps/rzlib/adler32.c"
#include "../deps/rzlib/compress.c"
#include "../deps/rzlib/crc32.c"
#include "../deps/rzlib/deflate.c"
#include "../deps/rzlib/gzclose.c"
#include "../deps/rzlib/gzlib.c"
#include "../deps/rzlib/gzread.c"
#include "../deps/rzlib/gzwrite.c"
#include "../deps/rzlib/inffast.c"
#include "../deps/rzlib/inflate.c"
#include "../deps/rzlib/inftrees.c"
#include "../deps/rzlib/trees.c"
#include "../deps/rzlib/uncompr.c"
#include "../deps/rzlib/zutil.c"
#include "../deps/rzlib/ioapi.c"
#include "../deps/rzlib/unzip.c"
#endif
2012-11-20 02:40:39 +00:00
/*============================================================
XML
============================================================ */
2014-01-22 11:39:28 +00:00
#ifndef HAVE_LIBXML2
#define RXML_LIBXML2_COMPAT
#include "../compat/rxml/rxml.c"
2014-01-22 11:39:28 +00:00
#endif
/*============================================================
APPLE EXTENSIONS
============================================================ */
#include "../settings_data.c"
2012-11-20 02:40:39 +00:00
#ifdef __cplusplus
}
2013-01-09 04:57:02 +00:00
#endif