Compare commits

..
1620 Commits
Author SHA1 Message Date
twinaphex 28c7ae5007 Bump version code 2016-03-16 19:45:57 +01:00
twinaphex 0a613c04a6 Bump up to 1.3.2 2016-03-15 23:16:12 +01:00
Alcaro f12092a09f Fix missing linebreak. 2016-03-15 13:44:46 +01:00
twinaphex 21aa1cdbe6 (menu_setting.c) Update paths 2016-03-14 22:58:25 +01:00
twinaphex 5e18a5513c (menu_setting.c) Update menu paths 2016-03-14 22:47:59 +01:00
twinaphex 1188650a3f (menu_setting.c) Update paths 2016-03-14 22:44:43 +01:00
twinaphex f64a01c5d4 (menu_setting.c) Update more paths 2016-03-14 22:07:18 +01:00
twinaphex 42e803435f (menu_setting.c) Update paths 2016-03-14 21:51:02 +01:00
Twinaphex 5e1486d92a Remove some unused variables 2016-03-14 21:23:45 +01:00
twinaphex f03a0cedca (menu_setting.c) Updates 2016-03-14 16:49:01 +01:00
twinaphex 75a134a578 (menu_setting.c) Updates 2016-03-14 16:42:16 +01:00
twinaphex a9b9435e0b (menu_setting.c) Update 2016-03-14 16:37:33 +01:00
twinaphex b674457671 More menu settings refactoring 2016-03-14 16:27:52 +01:00
twinaphex 7752c73abc Start using temporary copies for menu_settings 2016-03-14 16:11:59 +01:00
twinaphex 7f1c4fa2ff Rename sinc_neon.S to sinc_resampler_neon.S 2016-03-14 15:49:02 +01:00
twinaphex 55bb739996 Rename some files 2016-03-14 15:43:40 +01:00
twinaphex 2ce76ff147 Add null resampler so we can iterate over the rsamplers and
start from right to left again when touching
2016-03-14 15:42:12 +01:00
twinaphex 1a978b0f3c Create RARCH_NETPLAY_CTL_IS_ENABLED, RARCH_NETPLAY_CTL_SET_ENABLE,
and RARCH_NETPLAY_CTL_USNET_ENABLE
2016-03-14 15:03:42 +01:00
twinaphex 29bc5b1d50 Should now properly hide cursor when mouse grabbed 2016-03-14 14:41:46 +01:00
twinaphex d8ebcde5ec Implement GFX_CTL_SHOW_MOUSE 2016-03-14 14:39:58 +01:00
twinaphex 2e080967b0 Reimplement grab mouse code a bit - we really need to drastically
rewrite this
2016-03-14 14:37:18 +01:00
Twinaphex 3f3983c19d Merge pull request #2790 from DSkywalk/master
CHEEVOS - Implemented Hardcore Mode
2016-03-14 13:00:23 +01:00
David Skywalker 1a5273a73b just check hardcore mode changes on menu
also fix a rewind deinit
2016-03-14 12:53:56 +01:00
David Skywalker 91361f26de cheevos - added hardcore mode, in this mode savestates and rewind are disabled. 2016-03-14 11:51:54 +01:00
Twinaphex 8f867427db Merge pull request #2789 from Yogarine/master
Fix emscripten build
2016-03-14 10:54:51 +01:00
Alwin Garside 36117750af Merge branch 'master' of https://github.com/libretro/RetroArch 2016-03-13 15:30:41 +01:00
Alwin Garside 97b60b1e20 Fixed emscripten build 2016-03-13 15:30:30 +01:00
Twinaphex 4d3f187db0 Merge pull request #2787 from aliaspider/master
(3DS) update assets.
2016-03-12 18:12:58 +01:00
aliaspider b5f35ec39b (3DS) nit. 2016-03-12 17:52:03 +01:00
aliaspider aea164f3c8 (3DS) update core assets/ids 2016-03-12 17:47:46 +01:00
aliaspider bb6fe9cceb (3DS) update core icons/banners.
source:
- https://gbatemp.net/threads/retroarch-emulation-thread-nightly-builds-
- https://gbatemp.net/threads/retroarch-emulation-thread-nightly-builds-
2016-03-12 17:46:56 +01:00
twinaphex 69998b0d6c Memset runloop_frame_time to NULL at RUNLOOP_CTL_PREPARE_DUMMY
time
2016-03-12 15:17:02 +01:00
twinaphex 3d19ec2e9e Reimplement frame time code 2016-03-12 14:47:10 +01:00
twinaphex 8467ce114c (Android) Followup to earlier commit 2016-03-12 08:53:27 +01:00
twinaphex 432d7a358a (Android) Move Android-specific Moto G2 DPI workaround to android graphics context
driver
2016-03-12 08:52:29 +01:00
radius 48d61f33ab attempt to fix moto g2 issue 2016-03-12 00:00:05 -05:00
Twinaphex c5ed4f1f65 Merge pull request #2785 from Kivutar/patch-2
Reorder static functions in vivante context
2016-03-11 22:30:04 +01:00
Jean-André Santoni 0863a8eb84 Reorder static functions in vivante context 2016-03-12 04:29:26 +07:00
Twinaphex 0e4a8dfd97 Merge pull request #2784 from DSkywalk/master
Bettler Cheevos NES detection game_id to avoid unresolved game_id requests.
2016-03-11 21:54:40 +01:00
David Skywalker d62d80c1ce cheevo - fixed md5 nes compute to fix unresolved game_id request. 2016-03-11 21:26:07 +01:00
Twinaphex ca480ef459 Prevent possible crash 2016-03-11 10:16:23 +01:00
radius 761ece0f3c set SAVE directory correctly when using content dir on cores that don't use the SRAM interface 2016-03-10 17:36:46 -05:00
radius 82084205d8 [zr] we don't need to pass the context we already have that in the menu handle 2016-03-09 20:14:01 -05:00
radius 53be91af9e style nits 2016-03-09 16:17:18 -05:00
radius 6a17168739 Merge branch 'master' of github.com:libretro/RetroArch 2016-03-09 15:39:50 -05:00
radius 7f8c6f50e3 [zr] split GL code in another file
This makes zahnrad reusable in other menu drivers
2016-03-09 15:33:27 -05:00
Alcaro b6c1b9f7a0 Merge pull request #2778 from Kivutar/patch-1
Fix a typo in mali_fbdev_ctx
2016-03-09 19:55:10 +01:00
Jean-André Santoni a16ce4a146 Fix a typo in mali_fbdev_ctx 2016-03-10 01:50:30 +07:00
Twinaphex 809398b740 Merge pull request #2777 from lakkatv/master
(Lakka) If HAVE_LAKKA is defined, display Shutdown and Reboot entries…
2016-03-09 19:10:31 +01:00
Jean-André Santoni 1d69f55b37 (Lakka) If HAVE_LAKKA is defined, display Shutdown and Reboot entries in RGUI 2016-03-10 00:52:17 +07:00
twinaphex b12367c781 Update 2016-03-09 12:42:58 +01:00
twinaphex 341d0f9998 Update 2016-03-09 12:00:45 +01:00
twinaphex f79418459f Ability to compile now with --enable-wayland and --disable-x11
defined
2016-03-09 09:21:07 +01:00
twinaphex 08ed4d0e57 Cleanup 2016-03-08 16:11:53 +01:00
twinaphex 0de724d066 Update glsm 2016-03-08 16:09:09 +01:00
radius 26e171cfbc [zr] add wizard page indicator 2016-03-07 18:17:57 -05:00
radius 58ef1541c2 [zr] start implementing wizard 2016-03-07 00:27:40 -05:00
radius 4e4c69a3dc [zr] save window state so it can be restored after a context reset 2016-03-07 00:27:39 -05:00
twinaphex bdb8edb708 Update to glsm 2016-03-07 01:46:47 +01:00
radius 34d618238b [zr] tidy up zr_common 2016-03-06 14:13:20 -05:00
radius f41280e82c [remapping] fix saving for players other than 1 2016-03-06 13:15:05 -05:00
Twinaphex 787924fc8f Merge pull request #2775 from Themaister/master
Vulkan: Various fixes and cleanups
2016-03-06 12:38:43 +01:00
Hans-Kristian Arntzen f02faeea27 Vulkan: Fix segfault on nVidia. 2016-03-06 12:33:46 +01:00
Hans-Kristian Arntzen c00d32f30f Vulkan: Get correct window mode size. 2016-03-06 12:18:11 +01:00
Hans-Kristian Arntzen 6cde59a8ad Vulkan: Add more detailed counters. 2016-03-06 12:11:44 +01:00
Hans-Kristian Arntzen e6fb3c3a1c Update Vulkan headers. 2016-03-06 11:31:30 +01:00
Hans-Kristian Arntzen 9954d03f2a Strip out some warnings in glslang. 2016-03-06 11:31:10 +01:00
Hans-Kristian Arntzen ebdb7168ed Vulkan: Clean up symbol loading.
Should use GetDeviceProcAddr when appropriate.
2016-03-06 11:27:36 +01:00
radius cc250f755b [zr] fix message 2016-03-05 23:09:28 -05:00
radius 1ee45f2162 [zr] add an extra image to the wizard stub 2016-03-05 23:05:16 -05:00
radius f73d086abd [zr] add image loading code (stb) 2016-03-05 23:02:29 -05:00
radius 992c66ffc8 [zr] add image loading code (stb) 2016-03-05 22:54:56 -05:00
radius 0eba3fe791 [zr] add wizard window stub 2016-03-05 22:24:01 -05:00
radius a0eb17200b [zr] rename function 2016-03-05 21:59:01 -05:00
twinaphex 5e87fd5ecc Include stdarg.h 2016-03-06 03:57:37 +01:00
radius d860642c75 [zr] split the window code to zr_common 2016-03-05 21:52:09 -05:00
radius c2e4eb772d [zr] refactor structures pt.2 2016-03-05 21:13:25 -05:00
radius 2809074ccd [zr] refactor structures pt.1 2016-03-05 21:13:24 -05:00
twinaphex e5ce152b95 Update submodule 2016-03-06 02:59:21 +01:00
twinaphex 15c9e0ae7e Add fallback 2016-03-06 01:31:46 +01:00
twinaphex 5e99d163de Puti n call to input_keyboard_event when compiling without HAVE_XKBCOMMON 2016-03-05 22:18:22 +01:00
twinaphex f4ea4bfdda Bump up version 2016-03-05 20:33:23 +01:00
Twinaphex 74629ab4b5 Bump up version to 1.3.1 2016-03-05 19:07:22 +01:00
Twinaphex 644de4ae9e Merge pull request #2774 from lordhoto/cg2glsl-fragment-uniform-fix
cg2glsl: Write uniform declarations for fragment shaders.
2016-03-05 17:05:06 +01:00
Johannes Schickel 3a658172f8 (tools/cg2glsl.py) Write uniform declarations for fragment shaders.
Formerly, the fragment shader conversion pass did not write required uniform
declarations. This resulted in use of undefined symbols in some cases. In turn
conversion of some shaders to GLSL were broken.

This fixes conversion of some shaders, most prominently the hq shaders.
2016-03-05 12:49:21 +01:00
Twinaphex e0d7c25ea0 Add gfx_coord_array_resize 2016-03-05 09:43:15 +01:00
twinaphex a73cbb6114 (zahnrad) Use menu_texture_item 2016-03-05 08:42:35 +01:00
twinaphex 1742b96ec0 Add menu_texture_item 2016-03-05 08:40:28 +01:00
twinaphex 72303888c8 Remove unused menu_increment_menu_stack 2016-03-05 07:41:44 +01:00
twinaphex eebcde721b Rename video_coord_array 2016-03-05 07:28:02 +01:00
radius d647c1b215 [zr] hook up the scroll wheel 2016-03-05 01:26:45 -05:00
radius 145979ddcb [zr] label fix 2016-03-05 00:52:59 -05:00
radius 052730bbf1 [zr] refactor most of the menu, have a global state, width, height now 2016-03-05 00:50:57 -05:00
twinaphex 94ec0fc94d Fix fastforward mode 2016-03-04 22:35:39 +01:00
twinaphex 1c6d58e6c6 Cleanups 2016-03-04 22:22:03 +01:00
twinaphex d56bde43e8 audio_driver_ctl - cleanups 2016-03-04 22:10:47 +01:00
twinaphex 508d849fa5 Cleanups 2016-03-04 22:07:47 +01:00
twinaphex 50e70bf707 (audio_driver.c) Cleanups 2016-03-04 22:02:51 +01:00
twinaphex 9f50ab2534 Cleanups 2016-03-04 21:51:33 +01:00
twinaphex 009329969a Refactor away audio_driver_set_callback_state 2016-03-04 21:47:24 +01:00
twinaphex b7d3f3b01c Remove functions audio_driver_set_callback/audio_driver_unset_callback 2016-03-04 21:44:44 +01:00
twinaphex f3a9a38987 (audio_driver.c) Cleanup 2016-03-04 21:38:18 +01:00
twinaphex 3d6e6efe49 audio_driver.c - cleanup 2016-03-04 21:35:54 +01:00
radius 0ce76cbf5b [zr] remove more glui code 2016-03-04 15:08:43 -05:00
twinaphex 64a77af881 Use RARCH_DISPLAY_CTL_HW_CONTEXT_GET directly instead of
going through video_driver_callback
2016-03-04 20:49:55 +01:00
twinaphex a9d29041a3 (gfx/video_driver.c) Cleanup 2016-03-04 20:14:53 +01:00
radius 6066ab3ecc [zr] update toolkit 2016-03-04 14:06:04 -05:00
twinaphex c717ebdfda Rename callbacks 2016-03-04 20:00:49 +01:00
twinaphex acdf0eb74e Fix C89_BUILD 2016-03-04 19:48:05 +01:00
twinaphex 0140f989c3 Fix CXX_BUILD 2016-03-04 19:46:25 +01:00
twinaphex e9a0aba85b Silence bunch of warnings and fix an error 2016-03-04 19:42:30 +01:00
twinaphex 90fbc6330c Create RARCH_DISPLAY_CTL_SET_TITLE_BUF 2016-03-04 19:38:15 +01:00
twinaphex 2d158b809c Cleanups 2016-03-04 19:29:22 +01:00
twinaphex 05ce32efe4 Add RUNLOOP_CTL_FORCED_NONBLOCK_{} actions 2016-03-04 19:20:00 +01:00
twinaphex fe9ad4825d (gfx/video_driver.c) Cleanups 2016-03-04 19:12:54 +01:00
twinaphex f9ef8d4cc7 Move variables to camera_driver_ctl 2016-03-04 19:02:14 +01:00
twinaphex a9038e3b0a Remove these enums 2016-03-04 18:16:57 +01:00
twinaphex e34943194c Refactor camera driver code 2016-03-04 18:16:07 +01:00
twinaphex 9ba753993b Create RUNLOOP_CTL_{GET/SET}_FRAME_TIME 2016-03-04 17:54:54 +01:00
twinaphex 81e13aa2c1 (command.c) Cut down on some functions 2016-03-04 17:35:44 +01:00
twinaphex 95314700f9 Turn menu_displaylist_parse_settings into static function 2016-03-04 07:42:38 +01:00
twinaphex ed54600b41 (XMB) Start using DISPLAYLIST_SETTING 2016-03-04 07:41:45 +01:00
twinaphex b03487dc4f Start using DISPLAYLIST_SETTING 2016-03-04 07:37:40 +01:00
twinaphex 0c517434f3 Add DISPLAYLIST_SETTING 2016-03-04 07:29:17 +01:00
twinaphex 9fdbde1b4c Add menu_displaylist_ctx_parse_entry 2016-03-04 07:24:30 +01:00
twinaphex 3d8e1e0f6c Revert "Change signature of menu_displaylist_parse_settings"
This reverts commit 280431114e.
2016-03-04 07:23:07 +01:00
twinaphex 280431114e Change signature of menu_displaylist_parse_settings 2016-03-04 07:20:37 +01:00
twinaphex 418c5cbb76 (Win32) Buildfix 2016-03-04 05:01:49 +01:00
twinaphex 6d4212ca06 Check OS version before going down screensaver path 2016-03-04 04:51:57 +01:00
radius f86097aefb [zr] remove a lot of glui code 2016-03-03 22:31:38 -05:00
twinaphex f687fec624 Makefile.win - cleanups 2016-03-04 04:24:47 +01:00
twinaphex f828de24db Remove this 2016-03-04 04:19:35 +01:00
twinaphex 297abae623 (Mingw) Add program files include dir check 2016-03-04 04:06:43 +01:00
twinaphex be95858b16 Add DirectX SDK path if not already included inside PATH 2016-03-04 02:11:15 +01:00
twinaphex 93de657952 (retro_inline.h) Fix backwards compatibility with older mingw versions 2016-03-04 01:43:09 +01:00
radius 5b11e290dd [zr] add entry for test window 2016-03-03 18:39:14 -05:00
radius d9bc760b46 [zr] fix window opening and closing 2016-03-03 18:39:13 -05:00
radius 041af7cdb8 [zr] update zahnrad 2016-03-03 18:39:11 -05:00
radius dfefefb416 [zr] change the window hiding method a bit 2016-03-03 18:39:10 -05:00
twinaphex 5a1d8a96d0 (Menu) Create new input_ctl actions for pointer dragging 2016-03-03 23:21:02 +01:00
twinaphex 242b511387 Ifdef with RARCH_INTERNAL 2016-03-03 18:18:41 +01:00
twinaphex d15eb9a570 Add HAVE_SSA switch to qb 2016-03-03 18:17:48 +01:00
twinaphex e663a69c0b (Network Information) Show title bar 2016-03-03 07:27:47 +01:00
twinaphex 869cb8a1be (net_ifinfo.c) Bugfix 2016-03-03 07:17:17 +01:00
twinaphex ec0d9f0a70 (net_ifinfo.c) Style nits 2016-03-03 07:16:06 +01:00
twinaphex fe3c279f73 Cleanups 2016-03-03 06:59:54 +01:00
twinaphex 5cef419209 (zahnrad) Get past crash when shader is NULL 2016-03-03 06:21:40 +01:00
twinaphex 97eea9e71f (net_ifinfo/Win32) Adapter name shows up now - IP address doesn't yet 2016-03-03 05:50:45 +01:00
radius 4617f792c5 [zr] implement combo box for recents 2016-03-02 22:41:28 -05:00
twinaphex 4d630189a2 Start adding Windows implementation for net_ifinfo.c - will
need to link against iphlpapi for mingw
2016-03-03 04:40:25 +01:00
twinaphex 966f267285 (Win32) Start trying to implement Win32 backend for net_ifinfo.c 2016-03-03 04:11:24 +01:00
twinaphex dfa315f0d5 Fix compat_ifaddrs.c - network addresses are now shown on Android 2016-03-03 03:44:16 +01:00
twinaphex 5b4ba2a449 Add Network Information now 2016-03-03 03:06:54 +01:00
twinaphex e99a97d9b7 Some compilation fixes for compat_ifaddrs.c 2016-03-03 02:51:06 +01:00
twinaphex 4fce2e74ac (Win32) Buildfix 2016-03-03 02:10:34 +01:00
twinaphex 88b3b9a08d Include boolean.h 2016-03-03 02:09:30 +01:00
twinaphex c9e6a91137 (Android) Bake in ifaddrs for Android 2016-03-03 02:08:47 +01:00
twinaphex a3234f3f17 (net_ifinfo.c) ifndef this out for _WIN32 so far 2016-03-03 01:34:45 +01:00
radius c2bd46e3cb [zr] remove most glui drawing code 2016-03-02 19:28:46 -05:00
Twinaphex d5bc3c4d5b (OSX) Silence some warnings - just use plain numbers instead of enums
which can rapidly grow out of date
2016-03-03 00:48:45 +01:00
twinaphex b7ef5271ea zrmenu_set_style - C89 fix 2016-03-03 00:43:53 +01:00
twinaphex 7de6a0f005 (menu_displaylist.c) Turn this into enum with name 2016-03-03 00:37:32 +01:00
twinaphex 61faa0a04b Bake in net_ifinfo 2016-03-03 00:26:26 +01:00
twinaphex 191b233334 Cleanup net_ifinfo 2016-03-03 00:22:38 +01:00
twinaphex cbc8bab8e2 Cleanup 2016-03-03 00:19:37 +01:00
twinaphex d805845e29 Add net_ifinfo 2016-03-03 00:17:14 +01:00
radius 1cea6cd7be [zr] implement 'bool' parameters 2016-03-02 18:08:57 -05:00
radius e9ce64e854 [zr] implement shader parameters dialog 2016-03-02 17:14:50 -05:00
twinaphex 414c63b59a (VG) Silence some warnings
(Libretro-common) Add some headers
2016-03-02 23:09:31 +01:00
Twinaphex 6a2449bd1e Merge pull request #2770 from dankcushions/master
Fix compilation error:
2016-03-02 23:06:14 +01:00
Christopher Bransden 2d0c02d21e Fix compilation error:
gfx/drivers_context/vc_egl_ctx.c:591:13: error: static declaration of ‘gfx_ctx_vc_set_swap_interval’ follows non-static declaration
gfx/drivers_context/vc_egl_ctx.c:312:4
2016-03-02 21:31:56 +00:00
radius 55530dcbc3 [zr] implement exit, make clics respond even when the window is innactive 2016-03-02 16:24:36 -05:00
radius 7853815d45 [zr] change layout 2016-03-02 16:24:35 -05:00
radius 89cccb111b [zr] update zahnrad 2016-03-02 16:24:34 -05:00
twinaphex 1645ae54be (Zarch) Cleanups 2016-03-02 22:21:12 +01:00
twinaphex 30fa73dc8d (Zarch) Create typedef zarch_texture_item 2016-03-02 22:19:20 +01:00
twinaphex 7df467422b Create typedefs 2016-03-02 22:17:05 +01:00
twinaphex 885966c16b Nit 2016-03-02 22:08:37 +01:00
twinaphex 138e4bc78b menu_input_mouse_state - cleanups 2016-03-02 22:02:35 +01:00
twinaphex 4ba487df99 (menu_input.c) Turn some variables into static local variables 2016-03-02 22:01:00 +01:00
twinaphex 0f8e31cad3 (iOS) Use -1 instead of UIUserInterfaceIdiomUnspecified for backwards
compatibility
2016-03-02 17:25:13 +01:00
radius 1d0beeb665 [zr] set focus properly 2016-03-02 11:03:10 -05:00
radius 4eb6f26d92 [zr] update zahnrad 2016-03-02 11:01:22 -05:00
radius 780974ef32 [zr] change menu label 2016-03-02 02:51:03 -05:00
radius 8c86c6a47c [zr] hide/unhide window concept 2016-03-02 02:49:07 -05:00
radius 272563f3ca [zr] hide/unhide window concept 2016-03-02 02:48:51 -05:00
radius 8d89b1fa86 [zr] draw window offscreen till a better solution is available 2016-03-02 01:49:57 -05:00
twinaphex 75c05a5d7f Do away with no_content member 2016-03-02 06:20:36 +01:00
twinaphex 50f0e19263 Remove unused variable 2016-03-02 06:11:03 +01:00
radius 2807f94a14 [zr] hide/unhide windows 2016-03-01 23:43:15 -05:00
twinaphex 5dfc3f31db Move game_options_path to paths 2016-03-02 05:29:24 +01:00
radius 1b1b59692b [zr] add menu bar 2016-03-01 23:20:43 -05:00
twinaphex 0b78b07573 Cleanups 2016-03-02 05:17:30 +01:00
twinaphex b038b4ae41 Move some variables to menu_input_ctl as static local variables 2016-03-02 05:09:09 +01:00
radius d2d4312128 [zr] start adding main window 2016-03-01 21:49:30 -05:00
twinaphex 7d0205deac (vulkan_common.c) Add log error when vkCreateInstance fails 2016-03-02 03:13:31 +01:00
radius 0b9ea0943b [zr] cleanups 2016-03-01 18:54:46 -05:00
twinaphex fa1662412b Use MIN/MAX 2016-03-02 00:11:45 +01:00
twinaphex 130f0749d4 (Android) Update 2016-03-02 00:09:43 +01:00
twinaphex 6f80e09ce1 Change MIN/MAX to upper-case 2016-03-02 00:07:31 +01:00
twinaphex 784df92f8d (Android) Compile in Vulkan support 2016-03-01 23:37:27 +01:00
twinaphex 702d4f9e3a (Android) Buildfix 2016-03-01 22:26:57 +01:00
twinaphex d2a798e9cf (Griffin) Add files to griffin.c 2016-03-01 22:25:53 +01:00
twinaphex efb1c88215 (opendingux_fbdev_ctx.c) Another ifdef 2016-03-01 22:23:40 +01:00
twinaphex f3cc1a9b59 (opendingux_fbdev_ctx.c) More HAVE_EGL ifdefs 2016-03-01 22:23:17 +01:00
twinaphex ac584330bb (Android) Bugfix 2016-03-01 21:58:35 +01:00
twinaphex 1b0a9d0b1d Backport Opendingux/GCW Zero patches courtesy of gama.coder 2016-03-01 21:50:23 +01:00
twinaphex d2645e9087 Add more glslang include dirs 2016-03-01 19:19:39 +01:00
twinaphex 800d54a7fb (Android) Start setting up include dirs 2016-03-01 19:04:20 +01:00
twinaphex 77001a5577 (Android) More preparation for Vulkan 2016-03-01 18:59:12 +01:00
twinaphex 86a8899b0f (Android) Start preparing Android JNI Makefiles for Android 2016-03-01 18:46:40 +01:00
twinaphex c44107949d (Vulkan) Pass width and height to vulkan_surface_create 2016-03-01 18:35:41 +01:00
twinaphex 5f125bc1f6 (Android) Only need to pass window for Android 2016-03-01 18:22:17 +01:00
twinaphex eaa0b08bc2 (Android) Hook up Vulkan for gfx_ctx_bind_api 2016-03-01 18:21:09 +01:00
twinaphex b8c1e31c13 (Android/Vulkan) Start hooking up Vulkan for Android context driver 2016-03-01 18:16:22 +01:00
twinaphex cbc575eec0 (zarch) Prevent some more NULL pointer dereferences when using the mouse 2016-03-01 17:33:36 +01:00
twinaphex 81690601c0 (gl_raster_font.c) Fix some race issues 2016-03-01 17:24:33 +01:00
Twinaphex 89bcdeaf0b Merge pull request #2768 from Themaister/master
Vulkan: Allocate correct number of descriptors.
2016-03-01 14:28:41 +01:00
Themaister bce0d55a43 Vulkan: Allocate correct number of descriptors.
Have to allocate for entire pool, not per set.
2016-03-01 09:44:18 +01:00
twinaphex b57b5f3624 load_content_from_compressed_archive - prevent warning 2016-03-01 07:20:16 +01:00
twinaphex dc12f07a55 (mali_fbdev) Add some ifdefs 2016-03-01 07:17:57 +01:00
twinaphex 59ed4b939f Cleanups 2016-03-01 07:09:55 +01:00
twinaphex 47fddf28e5 (Emscripten context) Cleanups 2016-03-01 07:07:56 +01:00
twinaphex 32c4f13761 (XEGL) Add HAVE_VG ifdefs 2016-03-01 06:56:41 +01:00
twinaphex e938be3747 Have to rewrite EGL context code 2016-03-01 06:49:05 +01:00
twinaphex ae6302ede2 (Android EGL context) Add missing break 2016-03-01 05:09:07 +01:00
twinaphex 00741d06fb Add android_gfx_ctx_bind_hw_render 2016-03-01 05:08:18 +01:00
twinaphex c5667d8253 (Android EGL context) Refactor more code 2016-03-01 05:07:11 +01:00
twinaphex 2480181469 (Android) Add android_api variable 2016-03-01 04:53:48 +01:00
twinaphex 481196c55c Add some more ifdefs 2016-03-01 04:19:33 +01:00
twinaphex f8f2f7d03c Rename androidegl_ctx.c to android_ctx.c 2016-03-01 04:18:43 +01:00
twinaphex 0ec1c5ade5 Start adding HAVE_OPENGLES ifdefs to androidegl_ctx.c 2016-03-01 04:17:02 +01:00
twinaphex dff5aa35d6 Update glslang 2016-03-01 03:48:29 +01:00
twinaphex de27720044 We don't need to link against libvulkan.so implicitly anymore 2016-03-01 02:47:16 +01:00
twinaphex b0834a0f17 Remove this 2016-03-01 02:22:25 +01:00
twinaphex b79edb6095 Reimplement function pointers 2016-03-01 02:21:53 +01:00
twinaphex 937230564d move more code to vksym.h 2016-03-01 01:53:48 +01:00
twinaphex a6048b4218 Add vksym.h 2016-02-29 23:38:49 +01:00
twinaphex 7a907a97a7 Start preparing to split this code up 2016-02-29 23:31:51 +01:00
twinaphex 9a10ef5591 (Vulkan) Add more Vulkan function pointers 2016-02-29 23:28:12 +01:00
twinaphex 860b7fde62 (Vulkan) Add DeviceWaitIdle function pointer 2016-02-29 23:25:25 +01:00
twinaphex 1d9220d9d1 (Vulkan) Add vkCmdBindVertexBuffers function pointer 2016-02-29 23:22:56 +01:00
twinaphex c8b9bb609f (Vulkan) More image function pointers 2016-02-29 23:19:23 +01:00
twinaphex 30eac5b778 (Vulkan) Add vkDestroyDescriptorPool fp 2016-02-29 23:13:13 +01:00
twinaphex 6023a5f06e Add vkAllocateDescriptorSets fp 2016-02-29 23:11:00 +01:00
twinaphex 4a1a623099 (Vulkan) Add more funcptrs 2016-02-29 23:09:05 +01:00
twinaphex 0e60d20705 Add Command Function pointers 2016-02-29 23:04:17 +01:00
twinaphex 67ea4e1d6b (Vulkan) Pipeline function pointers 2016-02-29 22:55:31 +01:00
twinaphex 1fbac78e35 (Vulkan) Go through function pointer for vkDestroyPipelineCache 2016-02-29 22:38:58 +01:00
twinaphex a7df7be64b Add vkAllocateMemory/vkFreeMemory 2016-02-29 22:36:53 +01:00
twinaphex a53e7a5437 (Vulkan) Add pipeline barrier function pointer 2016-02-29 22:30:23 +01:00
twinaphex bd96ab3585 (vulkan_common.c) Cleanups 2016-02-29 22:26:20 +01:00
twinaphex 1b85ee442f Go through funcptr for vkAllocateCommandBuffers 2016-02-29 22:23:35 +01:00
twinaphex 83dc7db6c7 (Vulkan) Add descriptor set layout function callbacks 2016-02-29 22:04:23 +01:00
twinaphex caed6c61cb (Vulkan) Function pointer for vkFreeCommandBuffers 2016-02-29 21:58:10 +01:00
twinaphex 1e407079e4 Add function pointers for image view functions 2016-02-29 21:55:54 +01:00
twinaphex a6eb40b3d2 Add funcptr for vkAllocateCommandBuffers 2016-02-29 21:51:42 +01:00
twinaphex 4771c45ed3 Add render pass command function pointers 2016-02-29 21:43:04 +01:00
twinaphex 7f5d0f2763 (Vulkan) More function pointers for command buffer functions 2016-02-29 21:37:35 +01:00
twinaphex 860ffff3c9 (Vulkan) Go through funcptr for vkEndCommandBuffer 2016-02-29 21:31:51 +01:00
twinaphex a1c8a47665 (Vulkan) Go through funcptr for vkDestroyInstance 2016-02-29 21:27:18 +01:00
twinaphex c62971042d (Vulkan) Cleanups 2016-02-29 21:20:36 +01:00
twinaphex eae652d6a5 Go through funcptr for vkDestroyCommandPool 2016-02-29 21:17:21 +01:00
twinaphex 8232135922 Cleanups 2016-02-29 20:08:56 +01:00
twinaphex e669f92399 (Vulkan) Cleanups 2016-02-29 20:07:11 +01:00
twinaphex 3b9552bd36 (vulkan_raster_font.c) Style nits 2016-02-29 20:02:44 +01:00
twinaphex 8a06e27c22 (Vulkan) Cleanups 2016-02-29 19:44:46 +01:00
twinaphex 59ad8fcfde (Vulkan) Cleanups 2016-02-29 19:43:54 +01:00
twinaphex f0458495f4 Go through funcptr for vkDestroyPipeline 2016-02-29 19:41:25 +01:00
twinaphex d45f0e0946 Some cleanups 2016-02-29 19:39:49 +01:00
twinaphex 670eede306 Go through function pointer for vkCmdClearAttachments 2016-02-29 19:34:40 +01:00
twinaphex b09a19d9a0 (Vulkan) Style nits 2016-02-29 19:26:57 +01:00
twinaphex ae5d7849af (shader_vulkan.cpp) Don't have to include general.h for this 2016-02-29 19:23:51 +01:00
twinaphex fc7a972466 Go through function pointers for vkMapMemory/vkUnmapMemory 2016-02-29 19:20:42 +01:00
twinaphex 28d5ca6a86 (Vulkan) Style nits 2016-02-29 19:16:21 +01:00
twinaphex b660fb8878 Create sampler function pointers 2016-02-29 19:11:09 +01:00
twinaphex 0e91bb6852 Go through more function pointers 2016-02-29 19:03:18 +01:00
twinaphex dfde6f833a (Vulkan) Nits 2016-02-29 18:46:17 +01:00
twinaphex 1d96e80b05 (Vulkan) More funcptrs 2016-02-29 18:40:30 +01:00
twinaphex fbf527eac2 (vulkan_common.c) Style nits 2016-02-29 18:24:12 +01:00
twinaphex ef93f92ea2 Cleanups 2016-02-29 17:22:57 +01:00
twinaphex a8ccf2531d Cleanups 2016-02-29 17:21:40 +01:00
twinaphex e6da374bb5 Cleanups 2016-02-29 17:18:28 +01:00
twinaphex a4c9d02953 Add DestroyImage funcptr 2016-02-29 17:16:01 +01:00
twinaphex 874b5b7e17 Go through more funcptrs 2016-02-29 17:13:13 +01:00
twinaphex 8fd280967b Go through funcptr 2016-02-29 17:08:25 +01:00
twinaphex 5863996d83 Go through VKFUNC 2016-02-29 17:06:41 +01:00
twinaphex 8f69470c25 Go through VKFUNC macro 2016-02-29 17:00:08 +01:00
twinaphex d6005c224c Go through VKFUNC 2016-02-29 16:55:50 +01:00
twinaphex 6836b5f868 vkCreateImage - go through funcptr 2016-02-29 16:48:55 +01:00
twinaphex 3677144d18 Start going through VKFUNC 2016-02-29 16:47:21 +01:00
twinaphex 6c9e8041c6 Add function pointer for vkCreateCommandPool 2016-02-29 16:41:49 +01:00
twinaphex 6dce80ea07 Add function pointers for vkCreatePipelineCache and vkCreatePipelineLayout 2016-02-29 16:37:15 +01:00
twinaphex 778b50fc28 Add funcptr for vkCreateFramebuffer 2016-02-29 16:32:34 +01:00
twinaphex 361cce328d vkCreateRenderPass - add funcptr 2016-02-29 16:30:45 +01:00
twinaphex 277e2977ff (Vulkan) Add function pointer to vkDestroyDevice 2016-02-29 16:28:12 +01:00
twinaphex 4248e244a8 Go through funcptr for vkCmdCopyImage 2016-02-29 06:52:08 +01:00
twinaphex 01f5a7ad84 Go through vkQueueWaitIdle function pointer 2016-02-29 06:31:55 +01:00
twinaphex 89ee08214d We need to grab a function pointer to vkCmdDraw later after
vkCreateDevice
2016-02-29 06:21:42 +01:00
twinaphex be5333371b (Vulkan) More funcptrs 2016-02-29 06:16:31 +01:00
twinaphex bfd38e171b (Vulkan) More Vulkan funcptrs 2016-02-29 05:57:38 +01:00
radius 3f22d5cb33 make the gui a bit flatter 2016-02-28 23:52:33 -05:00
twinaphex 3abea50cbf Move function pointers to vulkan_context 2016-02-29 05:49:05 +01:00
radius 7e1e330463 add context menu to demo window 2016-02-28 23:43:02 -05:00
twinaphex 2a621a8424 Go through vkEnumeratePhysicalDevices funcptr 2016-02-29 05:37:37 +01:00
twinaphex cf03851cc8 Add vkGetDeviceQueue funcptr 2016-02-29 05:37:37 +01:00
radius a6f015623a stub function for kbd input 2016-02-28 23:35:22 -05:00
twinaphex 5e970637d4 (Vulkan) Add more function pointers 2016-02-29 05:32:10 +01:00
twinaphex 25d741e26a Start setting up more function pointers 2016-02-29 04:21:08 +01:00
twinaphex 82f5d917f0 Start trying to roll our own Vulkan loader based on PPSSPP
approacha
2016-02-29 03:14:17 +01:00
twinaphex a8185f0b81 Cleanups 2016-02-29 02:54:46 +01:00
twinaphex 042e4b0ba7 (Zarch) Style nits 2016-02-29 02:52:00 +01:00
twinaphex 070f25131a (Zarch) Cleanups 2016-02-29 02:48:29 +01:00
Twinaphex e5e11ae716 Remove unused variable 2016-02-29 02:41:06 +01:00
twinaphex 28a02da5bf Cleanups 2016-02-29 02:38:11 +01:00
twinaphex 91d19a15ec Take this out 2016-02-29 02:36:18 +01:00
twinaphex 28bb5295f7 (menu/drivers/zarch.c) Use strlcpy instead of strncpy 2016-02-29 02:17:53 +01:00
twinaphex b4e872476b Prevent some more crashes 2016-02-29 02:09:10 +01:00
twinaphex 4f1ab1f9c3 (gl_raster_font.c) Add early return in case gl pointer is NULL 2016-02-29 01:54:54 +01:00
twinaphex 65b628cf20 Cover more edge cases for crashes initiated by Zarch 2016-02-29 01:49:58 +01:00
twinaphex 09f2b64c1f gl_render_overlay -add early return 2016-02-29 01:43:40 +01:00
twinaphex 34f3963e4e Simplify RUNLOOP_CTL_IS_SLOWMOTION 2016-02-29 01:33:14 +01:00
twinaphex 6fbad68561 (gl.c) Cleanup 2016-02-29 01:29:49 +01:00
twinaphex 7d346d627f Robustness fixes 2016-02-29 01:22:39 +01:00
Twinaphex d9750591d2 Merge pull request #2764 from IlDucci/master
Updating Spanish Translation
2016-02-28 23:04:06 +01:00
IlDucci 86a94a5d95 Updating Spanish Translation
Added the two missing lines.
2016-02-28 22:57:34 +01:00
twinaphex 6f9b7a4c87 Silence CXX_BUILD warnings 2016-02-28 22:51:02 +01:00
twinaphex ea94d33de5 Avoid CXX_BUILD warnings 2016-02-28 22:49:52 +01:00
twinaphex ca497533db Fix C89_BUILD warning 2016-02-28 22:47:46 +01:00
Twinaphex edf296a06c Merge pull request #2763 from IlDucci/master
Updating Spanish Translation
2016-02-28 22:45:26 +01:00
IlDucci 76ef4bd44a Updating Spanish Translation
Adding changes to the Spanish translation
2016-02-28 22:30:31 +01:00
twinaphex 5104e05a89 Cleanup 2016-02-28 21:18:06 +01:00
twinaphex cec6701c0d (config_file.C) Fix segfaultthat happened at freeing of tmp->key
when tmp->key is NULL
2016-02-28 18:44:07 +01:00
twinaphex f13b630d57 Reimplement pending_action OK 2016-02-28 18:35:34 +01:00
twinaphex 841a647d0c Revert "Remove the pending_action code"
This reverts commit b19f12ec66.
2016-02-28 18:28:11 +01:00
twinaphex b19f12ec66 Remove the pending_action code 2016-02-28 18:03:57 +01:00
twinaphex 96c21eeb0d Reimplement gamepad action OK button 2016-02-28 17:45:14 +01:00
twinaphex b4acda26a2 Remove unused struct variables 2016-02-28 17:35:52 +01:00
twinaphex ae66fc95cc Start refactoring 'Load' menu 2016-02-28 17:33:56 +01:00
twinaphex 6726b64d0d Refactor zarch_zui_gamepad_input - introduce cutoff point 2016-02-28 17:20:14 +01:00
twinaphex 49d751e6c3 Create zarch_zui_gamepad_input 2016-02-28 16:49:46 +01:00
twinaphex 5c18dc8a04 (Zarch) Better gamepad controls 2016-02-28 16:44:41 +01:00
twinaphex 004ca19fe4 (Zarch) Start implementing gamepad controls 2016-02-28 15:39:20 +01:00
Twinaphex 77cec284f4 Merge pull request #2762 from Monroe88/menu_filter
Add option for menu linear filter
2016-02-28 04:11:30 +01:00
Monroe88 a669039523 Add option for menu linear filter 2016-02-27 17:30:12 -06:00
radius 11423ac52e look for assets in the correct folder 2016-02-27 15:02:13 -05:00
radius 87c2f16ca7 readd the cursor for fullscreen mode 2016-02-27 14:59:42 -05:00
radius a4720acf22 disable oversampling leads to some font alignment issues 2016-02-27 13:10:07 -05:00
radius 88dfabf92f change texture filtering to nearest 2016-02-27 12:42:16 -05:00
twinaphex 5f00e6ee56 Dehardcode 54 2016-02-27 16:44:22 +01:00
twinaphex 5e4e30abe9 Change extraction_directory to cache_directory 2016-02-27 03:22:32 +01:00
twinaphex 12d6d56199 (Zarch) Reimplement gamepad navigation 2016-02-27 02:51:46 +01:00
radius 16fb6d5f07 remove stray printf 2016-02-26 20:49:59 -05:00
radius 1bac8c8649 Use the same font for the underlying glui 2016-02-26 20:49:58 -05:00
twinaphex 75200b8e11 (Zarch) Cleanups 2016-02-26 23:31:34 +01:00
twinaphex 7ef56a2e46 Cleanup 2016-02-26 23:10:01 +01:00
twinaphex ae5640fa25 (Zarch) Cleanups 2016-02-26 22:57:04 +01:00
twinaphex f34288781e Remove unneeded macro 2016-02-26 22:54:43 +01:00
twinaphex 58073b937f (Zarch) Variables should not be all-caps 2016-02-26 22:53:17 +01:00
twinaphex 7beff1adaa (D3D) Silence warnings 2016-02-26 22:46:01 +01:00
twinaphex c14e281544 (Win32) Buildfix 2016-02-26 22:45:30 +01:00
twinaphex 0f8f980c8f Start reimplementing Zarch joypad input 2016-02-26 22:29:10 +01:00
twinaphex 2c69bc7d79 Cleanups 2016-02-26 22:09:02 +01:00
twinaphex a82cc0d31f Remove MENU_INPUT_CTL_SET_FRAME_INPUT 2016-02-26 21:47:25 +01:00
twinaphex d443ac53ef Cleanups 2016-02-26 21:46:26 +01:00
twinaphex 13a3bfeee7 Cleanups 2016-02-26 21:43:20 +01:00
twinaphex 6aa2fbea47 Cleanups 2016-02-26 21:30:54 +01:00
twinaphex a3aba22c6e Cleanups 2016-02-26 21:29:01 +01:00
twinaphex d40af3143f Remove this - unneeded 2016-02-26 21:09:35 +01:00
twinaphex 678ec1b662 Remove unused MENU_INPUT_CTL_SCROLL_UP/SCROLL_DOWN 2016-02-26 21:07:32 +01:00
twinaphex fe60a7d813 Cleanup 2016-02-26 21:04:56 +01:00
twinaphex 4bda039f62 Cleanup menu_input_mouse_frame 2016-02-26 21:02:29 +01:00
twinaphex c83c242e3a Cleanups 2016-02-26 20:43:12 +01:00
twinaphex 02b456f3a1 Turn some variables into static local variables 2016-02-26 20:38:47 +01:00
twinaphex 59db6de385 Refactor more mouse input code for the menu 2016-02-26 20:35:56 +01:00
twinaphex 0f83f48cb4 Cleanups 2016-02-26 20:31:02 +01:00
twinaphex 4a097af3e4 Cleanups 2016-02-26 20:23:07 +01:00
twinaphex c31ef24412 Add MENU_INPUT_CTL_SET_FRAME_INPUT 2016-02-26 18:01:10 +01:00
twinaphex 583d4fd283 Cleanups 2016-02-26 17:55:47 +01:00
twinaphex faee785aaa Add more to menu_ctx_iterate_t 2016-02-26 17:40:24 +01:00
twinaphex ac3cb48302 (VG) Style nits 2016-02-26 17:36:39 +01:00
twinaphex d9b86c4f6b Remove stub xshm video driver for now 2016-02-26 17:29:35 +01:00
twinaphex 2746bf0cb1 (xvideo.c) Cleanups 2016-02-26 17:26:26 +01:00
twinaphex 94b8e8820e (xvideo.c) Style nits 2016-02-26 17:24:36 +01:00
twinaphex eaf08ad88c (Zahnrad) Take out mouse code 2016-02-26 15:57:22 +01:00
twinaphex 55abe2e38f 80-char width limit nits 2016-02-26 15:41:28 +01:00
Twinaphex ea2094126b (iOS) Buildfix(iOS) Buildfix(iOS) Buildfix(iOS) Buildfix(iOS) Buildfix(iOS) Buildfix(iOS) Buildfix(iOS) Buildfix(iOS) Buildfix 2016-02-26 14:25:57 +01:00
twinaphex 2de97c9176 Cleanup 2016-02-26 13:54:04 +01:00
Twinaphex 77373e9ba4 Remove unused variable 2016-02-26 13:46:47 +01:00
Twinaphex 7e641b7274 (OSX) Silence deprecation warnings 2016-02-26 13:44:45 +01:00
Twinaphex 33356f2df6 (OSX) Buildfix 2016-02-26 13:40:29 +01:00
Twinaphex 353072c9cd (OSX) Fix build now for real 2016-02-26 13:39:32 +01:00
twinaphex 4dfed7e930 Cast to NSOpenGLContext * 2016-02-26 13:39:01 +01:00
twinaphex dcefb740f2 Create glcontext_get_ptr 2016-02-26 13:36:12 +01:00
twinaphex 93e17b46bd Cleanups 2016-02-26 13:32:56 +01:00
twinaphex 61a4d47feb (ui_win32.c) 80-char width limit 2016-02-26 13:31:34 +01:00
twinaphex 4939a9ea22 (zahnrad) Rename alloc to zr_alloc 2016-02-26 13:15:07 +01:00
twinaphex 0a74bcc080 Get rid of texture uniform 2016-02-26 12:37:20 +01:00
twinaphex b4425d4524 Look in assets directory 'zahnrad' instead of 'wimp' 2016-02-26 12:30:39 +01:00
twinaphex ce51396fb4 (zahnrad) Correct name 2016-02-26 12:21:42 +01:00
radius e303b62635 re-enable antialiasing 2016-02-25 23:11:06 -05:00
radius e9682c1122 refactor zr menu, using zrmenu for our functions. Context reset should work fine now 2016-02-25 23:08:33 -05:00
twinaphex 46c48fa4b8 (CXX_BUILD) FIxes 2016-02-26 00:49:23 +01:00
twinaphex a8b834f2c8 (C89_BUILD) Fix 2016-02-26 00:47:53 +01:00
twinaphex ee8c5bfa98 (Zahnrad) Don't call glViewport directly 2016-02-26 00:44:09 +01:00
twinaphex ac084a5175 Change typo 2016-02-25 23:40:27 +01:00
twinaphex b171be802e (Zahrand) Cleanups 2016-02-25 23:16:36 +01:00
twinaphex fa7ea1d20a (Zahrand) Cleanups 2016-02-25 23:15:28 +01:00
twinaphex 198ecd263d (Zahrand) Don't need this I think 2016-02-25 22:54:30 +01:00
twinaphex 1516ee8e76 Silence this warning too for C89 - not correct but whatever -
never used
2016-02-25 22:36:08 +01:00
twinaphex 4b9143430c Add C89 workaround 2016-02-25 22:26:48 +01:00
twinaphex 4c7ae72c62 Some C89_BUILD fixes 2016-02-25 22:16:25 +01:00
twinaphex 7da6797112 CXX_BUILD - More buildfixes 2016-02-25 22:13:12 +01:00
twinaphex 68cd176d63 Some CXX_BUILD fixes 2016-02-25 22:11:02 +01:00
twinaphex eb9971703b (Zahrand) Cleanups 2016-02-25 22:08:02 +01:00
twinaphex 5ca0085e22 (Zahrand) Dehardcode some OpenGL code 2016-02-25 22:04:36 +01:00
twinaphex d44aa37be0 Some renames 2016-02-25 21:55:42 +01:00
twinaphex 4e5d66547a (Zahrand) Cleanups 2016-02-25 21:47:32 +01:00
twinaphex 816539f9df (Zahrand) Rename wimp.c to zahrand 2016-02-25 21:29:38 +01:00
twinaphex c6dc2b6c3e (WIMP) Rebase WIMP driver 2016-02-25 21:09:44 +01:00
Twinaphex 42600fa74b Merge pull request #2726 from fr500/master
New driver implementation for the WIMP UI
2016-02-25 20:57:31 +01:00
twinaphex 7d61fbb780 Respect 80-char width limit 2016-02-25 20:53:52 +01:00
twinaphex f15effe68b (menu_displaylist.c) 80-char width limit 2016-02-25 20:32:46 +01:00
twinaphex 63c4b7c772 Cleanups 2016-02-25 19:52:40 +01:00
twinaphex bc6e9ee3bf Cleanups 2016-02-25 19:50:45 +01:00
twinaphex 0eb3feff64 Cleanups 2016-02-25 19:48:07 +01:00
twinaphex c3f3207b0d Cleanups 2016-02-25 19:33:46 +01:00
twinaphex 05f2a2d18c Communicate better that these are enums 2016-02-25 19:30:14 +01:00
twinaphex 255ee8766f Communicate better that this is an enum 2016-02-25 19:27:06 +01:00
twinaphex a2d4d832f6 Move defines to menu_input.c 2016-02-25 19:23:28 +01:00
twinaphex 37d895d77b Create MENU_INPUT_CTL_BIND_SET_MIN_MAX 2016-02-25 19:01:51 +01:00
twinaphex 00a958edc2 Cleanups 2016-02-25 18:37:43 +01:00
twinaphex b870aaf2fa Create MENU_INPUT_CTL_START_LINE 2016-02-25 18:36:29 +01:00
twinaphex 27b5617cd9 Create MENU_INPUT_CTL_BIND_ITERATE 2016-02-25 17:55:45 +01:00
twinaphex a9fc111ea2 Refactor code 2016-02-25 17:41:33 +01:00
twinaphex 22f6d1ce1d Cleanups 2016-02-25 17:32:12 +01:00
twinaphex 60c551fe75 Cleanups 2016-02-25 17:26:55 +01:00
twinaphex b1a3d5bb25 Create MENU_INPUT_CTL_CHECK_INSIDE_HITBOX 2016-02-25 17:11:00 +01:00
twinaphex 6b0e0adf27 Rename IDEAL_DT 2016-02-25 16:06:23 +01:00
twinaphex 1d84894e09 Create MENU_ANIMATION_CTL_IDEAL_DELTA_TIME_GET 2016-02-25 16:05:30 +01:00
twinaphex c32e828c6f Cleanups 2016-02-25 15:47:03 +01:00
twinaphex afcb3f1e5d Create MENU_ANIMATION_CTL_PUSH 2016-02-25 15:44:30 +01:00
twinaphex 835e5e751b Move variables to menu_animation_ctl as static local variables 2016-02-25 15:25:16 +01:00
twinaphex b5f4332e74 Create MENU_ANIMATION_CTL_TICKER 2016-02-25 15:19:33 +01:00
twinaphex 5dbca80ed8 Add MENU_ANIMATION_CTL_KILL_BY_SUBJECT 2016-02-25 15:05:18 +01:00
twinaphex e424d432a2 Cleanups 2016-02-25 13:30:02 +01:00
twinaphex f6f306903c Cleanup 2016-02-25 13:26:51 +01:00
twinaphex bd0347f1ae Create MENU_ANIMATION_CTL_KILL_BY_TAG 2016-02-25 13:23:39 +01:00
radius ee6a0e40b0 set rounding to zero, elements look better like this 2016-02-24 22:58:11 -05:00
radius 1e74f02b94 add control window from the demo 2016-02-24 22:36:15 -05:00
radius 777be51eb6 add a few more elements 2016-02-24 21:55:34 -05:00
twinaphex 433155c95f Move UTF8 helper functions to encoding_utf.c (libretro-common) -
hopefully did not introduce any regressions
2016-02-25 00:57:46 +01:00
twinaphex c834b7825e Have to use PATH_MAX_LENGTH in menu_animation_ticker_str 2016-02-25 00:42:40 +01:00
twinaphex 090a68f9cf Take out header include 2016-02-25 00:13:55 +01:00
Alcaro 3c9b39f4bd Fix cutoff text, we don't need that. 2016-02-24 23:52:28 +01:00
Alcaro 6c69cdb93c Fix missing define. 2016-02-24 23:34:08 +01:00
twinaphex 2c18bf12f5 Add DISPLAYLIST_PUSH_ONTO_STACK 2016-02-24 23:31:51 +01:00
Alcaro 353795b25e Wipe debug code. 2016-02-24 23:29:12 +01:00
Alcaro 9b35965ce1 Wipe test code again. 2016-02-24 23:29:12 +01:00
Alcaro 75b91e3ddc Rewrite that function to work properly. 2016-02-24 23:29:12 +01:00
Alcaro c0cd5256a2 Stupid signed chars... 2016-02-24 23:29:12 +01:00
Alcaro 9587efde67 Use these two functions. 2016-02-24 23:29:12 +01:00
Alcaro f8aefd0030 Add this counter function too. 2016-02-24 23:29:12 +01:00
Alcaro f14624370d Add UTF-8 string copy function. 2016-02-24 23:29:12 +01:00
twinaphex 77c583ae47 Create DISPLAYLIST_PROCESS 2016-02-24 23:19:53 +01:00
radius ba43724fec fix slider 2016-02-24 17:13:06 -05:00
twinaphex e8eaa54218 Refactor menu_displaylist_ctl 2016-02-24 23:05:54 +01:00
twinaphex 7968914453 Refactor menu_displaylist_push_list to menu_displaylist_ctl 2016-02-24 22:56:41 +01:00
radius 4c738b9645 add volume slider 2016-02-24 16:47:50 -05:00
twinaphex e8a5f6194e Create MENU_ENTRIES_CTL_CLEAR 2016-02-24 22:45:21 +01:00
twinaphex 1c06843811 Remove dead function prototype 2016-02-24 22:42:07 +01:00
twinaphex 1dcd6856db Remove dead code 2016-02-24 22:40:44 +01:00
radius 8a6c2568de remove glui mouse support 2016-02-24 16:16:12 -05:00
radius 4158248b77 add boolean wrapper thanks to Alcaro 2016-02-24 16:08:36 -05:00
twinaphex 2f98073fc1 Add setting 'Menu Throttle Framerate' to 'Frame Throttle' 2016-02-24 21:24:32 +01:00
Alcaro 3f52b9e246 Let's not rely on integer underflows canceling each other... 2016-02-24 20:26:28 +01:00
twinaphex b398a0c185 Fix build with UTF-8 2016-02-24 19:25:54 +01:00
Alcaro a5a666071b Fix tpyo. 2016-02-24 19:23:44 +01:00
twinaphex 51db7e695e Add preliminary russian translation - can't get it to compile yet 2016-02-24 19:19:24 +01:00
Alcaro cb9976a125 Wipe debug code. 2016-02-24 18:56:29 +01:00
twinaphex 60a303e144 Edit README.md 2016-02-24 18:52:44 +01:00
Alcaro d98c7a1c34 (RGUI) Fix string alignment under UTF8. 2016-02-24 18:50:21 +01:00
Alcaro 67e1c82575 Update this pseudolocalization thingy. 2016-02-24 18:24:50 +01:00
twinaphex eb62d5f4a4 Add HAVE_ZLIB ifdef to content.c 2016-02-23 22:05:32 +01:00
twinaphex c4b80e0e44 Fix CXX_BUILD - doesn't like a variable being named 'template' 2016-02-23 17:11:30 +01:00
Alcaro 949cbcac07 Always poll input even if core doesn't have any input. 2016-02-23 16:28:32 +01:00
Alcaro eeccb63c4e Avoid build fails due to missing submodule. 2016-02-23 16:26:36 +01:00
Alcaro 7a6463a300 Add escape hatch if rarch (or the core) is in an infinite loop. 2016-02-23 16:11:39 +01:00
Alcaro 04ac09f579 One thing less to worry about when copypasting this, less risk of repeating 2d5e10e840. 2016-02-23 16:08:57 +01:00
Alcaro f8452e23c8 Don't use uninitialized variables. 2016-02-23 16:06:37 +01:00
Twinaphex c7b5d41151 Merge pull request #2751 from FIX94/master
GX resolution and custom viewport changes
2016-02-23 09:14:09 +01:00
FIX94 1ed54b8683 Merge branch 'master' of https://github.com/FIX94/RetroArch 2016-02-23 03:40:40 +01:00
FIX94 4f48e61b98 (GX) allow all resolutions to use aspect ratio settings and allow custom viewport x and y to use as much of the screen as possible while making sure to keep the system screen position in mind 2016-02-23 03:40:14 +01:00
twinaphex 6f6ba98576 (DRM) Add more HAVE_EGL ifdefs 2016-02-23 01:34:28 +01:00
twinaphex ffd94d3ac0 We cannot rely on vulkan_intel.h being available, so just
include its contents inside vulkan_common.h
2016-02-23 01:24:15 +01:00
twinaphex 32353b10bb Take out async job code from imageviewer core 2016-02-22 18:18:12 +01:00
twinaphex 8aa429bd67 Refactor imageviewer code 2016-02-22 16:55:02 +01:00
twinaphex 6429bb6a40 (X context) rename g_api to x_api 2016-02-22 13:29:32 +01:00
twinaphex e688770e64 (SDL GL Ctx) Rename g_api to sdl_api 2016-02-22 13:26:26 +01:00
twinaphex f8a2014b7e (DRM) Rename g_drm to drm 2016-02-22 13:25:48 +01:00
twinaphex aa4015837f (DRM) DRM context driver should compile now without OpenGL 2016-02-22 13:04:34 +01:00
twinaphex d537b6ee9f Rename some files 2016-02-22 13:01:16 +01:00
twinaphex 1a5d2ce85c Start divorcing DRM context from EGL 2016-02-22 12:59:13 +01:00
twinaphex 85804838ad (DRM) More refactors 2016-02-22 12:56:16 +01:00
twinaphex 09fba6016b (DRM) Cleanups 2016-02-22 12:50:45 +01:00
twinaphex 034f1769c9 (DRM) Cleanups 2016-02-22 12:43:18 +01:00
twinaphex cc622b6905 Start getting rid of 'egl' namespace conventions in drm_egl context
driver
2016-02-22 12:37:38 +01:00
twinaphex a2a4a365a3 We're able now to create a Vulkan build without any GL support
whatsoever
2016-02-22 12:33:42 +01:00
twinaphex ef1feca097 Some C89_BUILD fixes 2016-02-22 12:25:41 +01:00
twinaphex 47b34b38d2 (DRM) More HAVE_EGL ifdefs 2016-02-22 12:10:23 +01:00
twinaphex 7da0739b61 Get rid of global g_egl_api now too 2016-02-22 11:54:55 +01:00
twinaphex 22a677b3a8 Don't use egl_common's 'api' variable anymore 2016-02-22 11:54:19 +01:00
twinaphex fd7a62f5ca (Wayland) Context driver doesn't use egl api anymore 2016-02-22 11:48:17 +01:00
twinaphex a8a871bd4e (DRM) Create drm_api 2016-02-22 11:47:18 +01:00
twinaphex e4935d490c (DRM) Uses its own sighandler and atomic quit variable 2016-02-22 11:46:08 +01:00
twinaphex 3bebc2284f DRM gets its own interval variable inside data struct 2016-02-22 11:42:36 +01:00
twinaphex b421bdf687 (drm_egl_ctx.c) More ifdefs 2016-02-22 11:37:37 +01:00
twinaphex eceadcde2b (drm_egl_ctx.c) Add HAVE_EGL/HAVE_OPENGL ifdefs 2016-02-21 23:49:50 +01:00
twinaphex cedc6506b5 Show display metric height label 2016-02-21 22:09:38 +01:00
Twinaphex 902026ec86 Merge pull request #2747 from Themaister/master
Wayland: Add metrics support.
2016-02-21 22:07:41 +01:00
Hans-Kristian Arntzen c4104ae37c Wayland: Add metrics support. 2016-02-21 22:04:56 +01:00
Twinaphex 44688b1424 Merge pull request #2746 from Themaister/master
Wayland: Add HiDPI awareness.
2016-02-21 21:46:23 +01:00
Hans-Kristian Arntzen 52a515f0d3 Wayland: Add HiDPI awareness. 2016-02-21 21:35:06 +01:00
Twinaphex 765e229c35 Merge pull request #2745 from Themaister/master
Vulkan: Attempt workaround for Ivy Bridge.
2016-02-21 20:16:37 +01:00
Hans-Kristian Arntzen 8cab56e806 Vulkan: Attempt workaround for Ivy Bridge.
Reset command buffer instead of pool.
2016-02-21 20:13:22 +01:00
Twinaphex cfe06ce730 Merge pull request #2744 from Themaister/master
Fix silly bug in libretro-test-vulkan.
2016-02-21 20:02:12 +01:00
radius 66a8e08252 remove saving remapping, use the automated method instead 2016-02-21 13:55:04 -05:00
Hans-Kristian Arntzen 7acd82e189 Fix silly bug in libretro-test-vulkan.
Forgot to set sType correctly, fixes nVidia.
2016-02-21 19:53:36 +01:00
twinaphex 90850799b7 Remove saving of input_remapping_path 2016-02-21 19:10:33 +01:00
twinaphex d5429f00e1 silence warning 2016-02-21 19:05:58 +01:00
twinaphex e93e75321f Revert "don't save remapping path and don't load the library at startup"
This reverts commit 1638df4ae7.
2016-02-21 19:05:01 +01:00
radius 1638df4ae7 don't save remapping path and don't load the library at startup 2016-02-21 12:51:49 -05:00
radius 7cc72520f7 add message to save current config 2016-02-21 12:37:11 -05:00
radius 5f3b27417b fix save new config 2016-02-21 12:30:22 -05:00
Twinaphex d0e1802436 Merge pull request #2743 from Themaister/master
Vulkan: Add workaround for broken VkImageView swizzling.
2016-02-21 13:56:14 +01:00
Hans-Kristian Arntzen cece4e5ae2 Vulkan: Add workaround for broken VkImageView swizzling.
Certain early drivers fail to apply swizzle mask.
2016-02-21 13:52:30 +01:00
Twinaphex 1b4318d89b Merge pull request #2742 from Themaister/master
Vulkan: Set alphaBlendOp correctly.
2016-02-21 13:43:18 +01:00
Hans-Kristian Arntzen f09338b1b8 Set alphaBlendOp correctly. 2016-02-21 13:40:19 +01:00
Twinaphex 7bb5b749a0 Merge pull request #2741 from Themaister/master
Vulkan: Various improvements
2016-02-21 13:18:00 +01:00
Hans-Kristian Arntzen b87106e61a Vulkan: Implement menu display clear color. 2016-02-21 13:12:51 +01:00
Twinaphex 0bbac8da97 Silence unused variable warning 2016-02-21 13:10:49 +01:00
Hans-Kristian Arntzen 6e7f1371dd Vulkan: Fix scenario where we limit the number of frames too much. 2016-02-21 13:03:26 +01:00
Hans-Kristian Arntzen 9e060bf088 Fix STATIC texture upload. 2016-02-21 13:01:53 +01:00
Hans-Kristian Arntzen 0dddd671f8 Vulkan: Use more approriate barrier 2016-02-21 12:59:11 +01:00
Hans-Kristian Arntzen 4259ea3d06 Merge branch 'master' of git://github.com/libretro/RetroArch 2016-02-21 12:45:26 +01:00
Hans-Kristian Arntzen 36eb07e067 Vulkan: Use copy paths if needed. 2016-02-21 12:33:16 +01:00
twinaphex 6512e5ff6e Move this check - this should serve as a framerate limiter for the
menu
2016-02-21 12:11:08 +01:00
twinaphex 254e0bbd90 vulkan_common.h - style nits 2016-02-21 10:11:35 +01:00
twinaphex f462954609 Style nits pt. 2 2016-02-21 10:09:41 +01:00
twinaphex 8ce2665383 Style nits 2016-02-21 10:08:36 +01:00
twinaphex b57dbd5028 Style nits 2016-02-21 09:57:24 +01:00
twinaphex a5d39ba38d Style nits 2016-02-21 09:54:53 +01:00
twinaphex 5beb71711b zarch.c - Respect 80-char width limit 2016-02-21 09:51:16 +01:00
twinaphex 5f50034514 Refactor gfx_ctx_x_bind_api 2016-02-20 20:47:06 +01:00
twinaphex fbc7eaf287 (vulkan.c) Style nits 2016-02-20 20:29:52 +01:00
twinaphex 1426cf7fb2 (vulkan.c) Style nits 2016-02-20 20:15:46 +01:00
twinaphex 25c1c6202f Silence warning 2016-02-20 19:46:35 +01:00
twinaphex 9aeceadee6 Style nits for header 2016-02-20 16:37:59 +01:00
twinaphex 4bb3f35a02 80-char width limit style nits 2016-02-20 16:36:54 +01:00
Twinaphex f41ee75a82 Merge pull request #2740 from Themaister/master
Vulkan: Small tweaks
2016-02-20 15:30:17 +01:00
Hans-Kristian Arntzen 8550c16f86 Always try to use cached memory if we can for linear textures.
Should improve cores which use SOFTWARE_FRAMEBUFFER.
2016-02-20 15:17:25 +01:00
Hans-Kristian Arntzen b61c05e10f Log the number of swapchain images we get. 2016-02-20 14:24:36 +01:00
Hans-Kristian Arntzen 111c37832a Make sure we get a queue which also supports compute.
Graphics + Compute queue must be supported.
2016-02-20 14:20:17 +01:00
Twinaphex 74f1b3aa34 Merge pull request #2739 from Themaister/master
Fix some issues with Vulkan readback.
2016-02-20 14:07:53 +01:00
Hans-Kristian Arntzen fa449646e9 Bug fixes for Vulkan readback.
We were getting weird and inconsistent viewport sizes back.
2016-02-20 14:04:33 +01:00
Hans-Kristian Arntzen bcac4a204f Vulkan: Set initial viewport after keep_aspect is correct.
Fixes fullscreen recording.
2016-02-20 13:46:20 +01:00
Twinaphex 720a519987 Merge pull request #2738 from Themaister/master
Try to use cached memory for readbacks.
2016-02-20 12:07:41 +01:00
Hans-Kristian Arntzen 5542427246 Try to use cached memory for readbacks.
Speeds up nVidia readbacks by order of magnitude.
2016-02-20 12:04:53 +01:00
Twinaphex 452898c0f8 Merge pull request #2736 from Themaister/master
Use vkCmdCopyImage for readbacks.
2016-02-20 11:49:36 +01:00
Hans-Kristian Arntzen 459c55989a Use vkCmdCopyImage for readbacks.
Blits often imply render targets.
2016-02-20 11:21:39 +01:00
Twinaphex 9108ee773f Merge pull request #2735 from Themaister/master
Before unloading game, make sure we stop the threaded audio driver.
2016-02-20 10:33:55 +01:00
Hans-Kristian Arntzen 9c21c9ea1f Before unloading game, make sure we stop the threaded audio driver. 2016-02-20 10:28:39 +01:00
twinaphex dbe6bc5cfb Move wayland context driver up the context driver foodchain,
should hopefully have Gnome Wayland default to it instead of the
slower X11/XCB context
2016-02-20 09:23:17 +01:00
twinaphex 481fa56f2c Move some code 2016-02-20 06:36:32 +01:00
twinaphex fde9f1ce2c Start making GL optional (previously we assumed pretty much - hardware
context = GL) Still have the issue where the menu driver auto-switches
back to rgui instead of glui/xmb
2016-02-20 06:16:34 +01:00
twinaphex 9bc889b908 Add improved preprocessor conditionals for x context 2016-02-20 05:50:37 +01:00
twinaphex 11c1535fe3 Rename glx context driver to x 2016-02-20 05:48:45 +01:00
Twinaphex b1c614f1ca Merge pull request #2734 from Themaister/vulkan
Vulkan: X11 backend
2016-02-20 03:33:41 +01:00
Hans-Kristian Arntzen 4540369fcb Use correct cast for WSI_XLIB. 2016-02-19 22:25:51 +01:00
Hans-Kristian Arntzen 0bcdf6ebe0 More properly enumerate GPUs.
Just pick the first one for now.
2016-02-19 21:55:11 +01:00
Hans-Kristian Arntzen 88ec0f522b Vulkan: Add Vulkan backend to GLX context.
Also fixes some snags with libretro-test-vulkan.
2016-02-19 21:37:24 +01:00
Hans-Kristian Arntzen 1b5cc1ca9c Fix some types for WSI. 2016-02-19 19:50:04 +01:00
twinaphex 4e510247f5 Cleanups 2016-02-19 15:44:03 +01:00
twinaphex d6906ee7df (xcb) Buildfix 2016-02-19 15:43:12 +01:00
twinaphex 575cd4e3be Add xcb detection 2016-02-19 15:08:23 +01:00
twinaphex 11831a8b47 move shareable vulkan initialization code to vulkan_common.c 2016-02-19 14:38:15 +01:00
twinaphex 5cb0aa51c0 Add includes to vulkan_common.h 2016-02-19 14:26:45 +01:00
twinaphex e1a1843edc Start moving code to vulkan_common.h 2016-02-19 14:23:51 +01:00
twinaphex 2d5e10e840 Fix this 2016-02-19 13:17:03 +01:00
twinaphex 140d65b994 Setup specific WSI extensions 2016-02-19 13:11:30 +01:00
twinaphex 7ec1a6836c (Vulkan WSI) Add Mir bits (we don't have Mir context driver yet
but whatever, add them all)
2016-02-19 13:06:38 +01:00
twinaphex 50efe142b9 Go through function pointers 2016-02-19 13:03:35 +01:00
twinaphex eb1fe0476d Start implementing xlib/xcb bits (for when these context drivers
get added)
2016-02-19 12:46:42 +01:00
twinaphex 14d39be698 Move code around 2016-02-19 12:30:18 +01:00
twinaphex 72fed0d871 Add VULKAN_WSI_MIR (for when we ever get around to adding Mir support) 2016-02-19 12:24:20 +01:00
twinaphex cebefa6ae1 Refactor vulkan_surface_create 2016-02-19 12:23:16 +01:00
twinaphex db074e1c1a Start implementing more WSI variants 2016-02-19 12:15:16 +01:00
twinaphex 353c421a5c Add function pointer for vkCreateAndroidSurfaceKHR 2016-02-19 12:08:34 +01:00
twinaphex 6fcd097e4c Start setting up vulkan_init_context for multiple WSI types 2016-02-19 12:04:56 +01:00
twinaphex 1c412eea5a Start adding preliminary implementation for vulkan_surface_create 2016-02-19 12:00:52 +01:00
twinaphex 96c9687a8a Create vulkan_surface_create 2016-02-19 11:55:57 +01:00
twinaphex 98990d6afc Add more WSI enum types 2016-02-19 11:50:25 +01:00
twinaphex 7205d76ab0 Cleanups 2016-02-19 11:36:46 +01:00
twinaphex c105fb22f3 Style nits 2016-02-19 11:29:15 +01:00
twinaphex a61536ffdc More refactors - create vulkan_destroy_context 2016-02-19 11:12:43 +01:00
twinaphex 6be1453d9c Create vulkan_init_context 2016-02-19 11:04:51 +01:00
twinaphex 50a605e9db Cleanups 2016-02-19 10:54:00 +01:00
twinaphex 1165d1c0b7 Create gfx_ctx_vulkan_data_t 2016-02-19 10:35:59 +01:00
twinaphex 02e3d6eba7 Only one Wayland context driver now 2016-02-19 07:58:14 +01:00
twinaphex acf4931ad1 (Testcore Vulkan) Hook up one button - makes input response work 2016-02-19 05:53:25 +01:00
Twinaphex 7e9f66ad39 Merge pull request #2733 from Themaister/vulkan
Vulkan: Workaround broken push constant support on Ivy Bridge
2016-02-19 01:32:10 +01:00
Hans-Kristian Arntzen c74c7ae053 Vulkan: Work around broken push constants on Ivy Bridge.
Use UBOs instead, should be more compatible with early drivers.
2016-02-18 18:36:49 +01:00
Hans-Kristian Arntzen a1ae86a808 Remove obsolete shaders. 2016-02-18 18:36:49 +01:00
twinaphex 0b85951abe (Wayland context) Cleanup some defines 2016-02-18 07:40:13 +01:00
twinaphex a21444fc9a (Wayland ctx) More improvements to Vulkan support 2016-02-18 07:29:20 +01:00
twinaphex f5c5c82729 Add extra conditionals for all possible usecases (HAVE_EGL/HAVE_OPENGL/HAVE_OPENGLES/etc) 2016-02-18 07:18:58 +01:00
twinaphex bd672b8b72 Add vulkan path in registry_handle_global 2016-02-18 05:31:24 +01:00
twinaphex 620fbe8976 Forgot to set this 2016-02-18 00:20:23 +01:00
twinaphex eeada0c458 Start making general-purpose Wayland context driver that could work
for both Vulkan and EGL/GL
2016-02-17 23:22:54 +01:00
twinaphex 56a14ffc3c Start adding HAVE_OPENGL/HAVE_VG ifdefs 2016-02-17 22:20:43 +01:00
twinaphex 51a94d6ac7 Remove unix_common 2016-02-17 22:09:37 +01:00
twinaphex 17e5e57bed Add unix_common 2016-02-17 08:01:30 +01:00
twinaphex a84ebda75c Replace some strcmp usage 2016-02-17 07:29:10 +01:00
twinaphex 207c87e551 Add glslang files to griffin_cpp 2016-02-17 07:23:32 +01:00
twinaphex d4daf25c2a Remove stdin stub paths 2016-02-17 07:15:51 +01:00
twinaphex b6a9f5c239 Start adding vulkan files to Griffin 2016-02-17 05:22:17 +01:00
twinaphex a539a6512b (D3D) Buildfix 2016-02-17 02:25:24 +01:00
twinaphex 263efc965b Add Vulkan string to system information 2016-02-17 02:01:51 +01:00
twinaphex d78787d70e Add feature to print_features 2016-02-17 01:55:35 +01:00
twinaphex 0058e1ba51 Remove commented out code 2016-02-17 01:25:45 +01:00
twinaphex 2e853b3f04 Another ifdef 2016-02-17 01:24:38 +01:00
twinaphex 22452f6cb2 Ifdef hw_render_context_is_vulkan 2016-02-17 01:23:55 +01:00
Twinaphex 8f73779acb Merge pull request #2729 from Themaister/vulkan
Vulkan backend for RetroArch
2016-02-16 21:24:58 +01:00
Hans-Kristian Arntzen adbf9fed16 Vulkan implementation. 2016-02-16 20:42:02 +01:00
twinaphex 0d3c30978d Add log 2016-02-16 05:42:45 +01:00
twinaphex 46cc21029b Add CONTENT_CT_LOAD 2016-02-16 05:34:33 +01:00
twinaphex bebf9abfb2 Fix RARCH_CTL_UNSET_STDIN_CLAIMED 2016-02-16 05:19:04 +01:00
twinaphex ee24cfce31 Roll this back 2016-02-16 05:18:39 +01:00
twinaphex 9097727452 Revert "Fix RARCH_CTL_UNSET_STDIN_CLAIMED"
This reverts commit 25787c2ce6.
2016-02-16 05:16:44 +01:00
twinaphex 25787c2ce6 Fix RARCH_CTL_UNSET_STDIN_CLAIMED 2016-02-16 05:09:57 +01:00
radius 8f41174fca remove btn/axis identifier when no descriptor was available 2016-02-15 22:54:28 -05:00
twinaphex 7ef5bd5534 Cleanups 2016-02-16 04:54:26 +01:00
twinaphex a3ce07b5af Add preliminary backport of stdin ROM loading - doesn't work
for me yet
2016-02-16 04:52:36 +01:00
radius e97de06f24 add a fallback for cases when an autoconf is present but it doesn't have descriptors 2016-02-15 22:48:35 -05:00
radius 17f616e3dc use descriptors in core input remapping 2016-02-15 22:07:50 -05:00
twinaphex d14f9e6f08 Cleanup 2016-02-15 23:50:46 +01:00
twinaphex f71611251f Cleanups 2016-02-15 23:49:23 +01:00
twinaphex 620dac1abd Make some functions static 2016-02-15 21:51:30 +01:00
twinaphex f8b866c8c1 Combine file_ops.c and content.c 2016-02-15 21:49:29 +01:00
twinaphex d4f59c2a0e Rename more functions 2016-02-15 21:43:01 +01:00
twinaphex 0b8efb7736 Rename some functions 2016-02-15 21:40:54 +01:00
twinaphex 4aa36501fb Call RARCH_CTL_VERIFY_STDIN_PATHS 2016-02-15 21:30:11 +01:00
twinaphex d3a9b04223 Add back stdin features - pt. 1 2016-02-15 21:27:14 +01:00
twinaphex d7ebb49fd0 (ffmpeg) Style nits 2016-02-15 07:44:45 +01:00
twinaphex bdbd3098dd Style nits 2016-02-15 07:16:09 +01:00
twinaphex b2fa47ef43 Cleanups 2016-02-15 06:53:22 +01:00
twinaphex cd9f567fc2 Create RARCH_AUDIO_CTL_RESAMPLER_* functions 2016-02-15 06:43:32 +01:00
Andrés 1f951656a3 Update command_event.c 2016-02-14 23:23:29 -05:00
radius 7f1f345066 change the windows to the other side 2016-02-14 22:48:21 -05:00
twinaphex d4846b9021 Refactor content_load 2016-02-15 04:04:14 +01:00
twinaphex b4b50d1972 Create content_push_to_history_playlist 2016-02-15 03:56:10 +01:00
radius 97f2a2dfb1 add a settings 2016-02-14 21:44:03 -05:00
radius f00f09a549 fix input click 2016-02-14 21:12:06 -05:00
radius dfbe4cc049 positioning seems ok now, click is not 2016-02-14 21:01:27 -05:00
radius e189f35caf try to implement mouse 2016-02-14 20:42:45 -05:00
radius 96f1cb4175 try to implement mouse 2016-02-14 20:16:24 -05:00
radius 80284d760f make the window half of the GLUI window for now 2016-02-14 20:04:31 -05:00
radius 9109ea3dde make the window half of the GLUI window for now 2016-02-14 19:54:24 -05:00
twinaphex f621165adf Cleanups 2016-02-15 01:50:49 +01:00
twinaphex 8d4bb1326c menu_content.c - cleanups 2016-02-15 01:39:07 +01:00
twinaphex 300aac33cf Rename rarch_main_init_wrap 2016-02-15 01:34:15 +01:00
twinaphex a10fae4e8b Move main_load_content to content.c 2016-02-15 01:22:28 +01:00
radius a236c559f0 pass viewport size 2016-02-14 18:32:36 -05:00
twinaphex 0784608604 Buildfix 2016-02-14 22:23:30 +01:00
twinaphex 954ac39b91 Create SHADER_CTL_GET_PREV_TEXTURES 2016-02-14 22:22:40 +01:00
twinaphex 5a2816c6da Remove unused functions
t# Please enter the commit message for your changes. Lines starting
2016-02-14 22:18:46 +01:00
radius 4fbb08210c add some comments 2016-02-14 16:17:34 -05:00
twinaphex e790b503d9 Add SHADER_CTL_GET_IDENT 2016-02-14 22:17:00 +01:00
twinaphex debb5dd0ce Add SHADER_CTL_GET_CURRENT_SHADER 2016-02-14 22:13:21 +01:00
radius e5feaacf2c fix indentation a bit 2016-02-14 15:56:54 -05:00
twinaphex 38034abce6 Add SHADER_CTL_DIRECT_GET_CURRENT_SHADER 2016-02-14 21:55:19 +01:00
radius 0cbdd4f3a6 fix indentation a bit 2016-02-14 15:45:19 -05:00
twinaphex 46b963619a Create SHADER_CTL_WRAP_TYPE 2016-02-14 21:41:16 +01:00
radius 172cdc1f49 remove more unused code and deinit properly 2016-02-14 15:39:54 -05:00
radius 3376799768 remove more unused code 2016-02-14 15:35:19 -05:00
radius 031fc859ce remove init and zdraw functions 2016-02-14 15:33:24 -05:00
radius dbfc9ff370 remove init and zdraw functions 2016-02-14 15:30:48 -05:00
radius 76dc51faeb re-add POC implementation 2016-02-14 14:33:20 -05:00
radius 50929c9809 add gui toolkit 2016-02-14 14:33:17 -05:00
radius 1e31f06200 clone glui 2016-02-14 14:33:13 -05:00
twinaphex bd74390cde Add SHADER_CTL_USE 2016-02-14 20:01:39 +01:00
twinaphex b4dcbb235f Add SHADER_CTL_FILTER_TYPE 2016-02-14 19:51:32 +01:00
twinaphex 37c2b47915 Add SHADER_CTL_SET_MVP 2016-02-14 19:43:47 +01:00
twinaphex 02ec7830d9 Create SHADER_CTL_INFO 2016-02-14 19:30:48 +01:00
twinaphex cdd6684bb9 Create SHADER_CTL_SCALE 2016-02-14 19:21:54 +01:00
twinaphex 47cf62cdbd Header cleanups 2016-02-14 19:01:37 +01:00
twinaphex 6c1b96f50d Add SHADER_CTL_SET_COORDS 2016-02-14 18:59:42 +01:00
twinaphex 20441299e1 Add SHADER_CTL_MIPMAP_INPUT 2016-02-14 18:48:17 +01:00
twinaphex fab6903522 Create SHADER_CTL_INIT 2016-02-14 18:41:45 +01:00
twinaphex 8c867394a0 Cleanups 2016-02-14 18:23:47 +01:00
twinaphex 678cabc48c Add SHADER_CTL_DEINIT 2016-02-14 18:22:38 +01:00
twinaphex 7c4b372208 Add SHADER_CTL_GET_FEEDBACK_PASS 2016-02-14 18:19:48 +01:00
twinaphex fe3c3f5203 Create SHADER_CTL_INIT_FIRST 2016-02-14 18:17:43 +01:00
twinaphex f906e828ba Add SHADER_CTL_SET_PARAMS 2016-02-14 18:14:51 +01:00
twinaphex 8b714895a8 Create video_shader_driver_ctl 2016-02-14 18:12:42 +01:00
twinaphex f9824dd53e Simplify video_shader_driver_set_params 2016-02-14 18:09:12 +01:00
twinaphex bb0b6a6b68 Style nits 2016-02-14 17:44:00 +01:00
twinaphex 3f265360db Style nits 2016-02-14 17:40:20 +01:00
twinaphex 6957f57111 Cleanups 2016-02-14 17:29:03 +01:00
twinaphex 349892debf Cleanup 2016-02-14 17:27:14 +01:00
twinaphex 35ea059f82 Style nits - 80-char width limit 2016-02-14 17:22:01 +01:00
twinaphex 5e1f289cd4 80-char width limit, style nits 2016-02-14 17:02:55 +01:00
twinaphex 57c4db4338 Style nits 2016-02-14 16:59:21 +01:00
twinaphex cbf84b8d6e Style nits 2016-02-14 16:39:27 +01:00
twinaphex 64e891124c (ps3_ctx.c) Cleanups 2016-02-14 16:36:06 +01:00
twinaphex b0995e6eee (GLX) 80-char width limit style nits 2016-02-14 16:34:31 +01:00
twinaphex e842ebbfc4 80-char width limit style nits 2016-02-14 16:31:39 +01:00
twinaphex 602c40c228 (bbqnx) Style nits 2016-02-14 16:29:58 +01:00
twinaphex 5b581e70ba 80-char width limit style nits 2016-02-14 16:27:29 +01:00
twinaphex c2d7b330aa vg.c - buildfix 2016-02-14 16:15:01 +01:00
twinaphex 89f0c4211c Create menu_input_frame_build 2016-02-14 07:40:09 +01:00
twinaphex 76f7114b47 Remove duplicate prototype 2016-02-14 05:44:10 +01:00
twinaphex f1a572822b Create RARCH_DISPLAY_CTL_VIEWPORT_INFO 2016-02-14 05:42:27 +01:00
twinaphex d078682a3c Add RARCH_DISPLAY_CTL_GET_CURRENT_SOFTWARE_FRAMEBUFFER 2016-02-14 05:31:33 +01:00
twinaphex 4fcb1469cc Cleanups 2016-02-14 05:26:17 +01:00
twinaphex ead20f9ba5 Action OK toggles boolean setting now too 2016-02-14 04:33:42 +01:00
twinaphex 4941cd7dbd gl_ff_vertex - avoid glLoadIdentity 2016-02-14 03:47:33 +01:00
twinaphex 9f26e3bc69 Move static local variables to gfx_ctx_ctl - and other cleanups 2016-02-14 02:30:24 +01:00
twinaphex 68969d1363 Add GFX_CTL_GET_VIDEO_SIZE 2016-02-14 02:26:20 +01:00
twinaphex bcaf08ad2d Add GFX_CTL_SET_RESIZE 2016-02-14 02:15:43 +01:00
twinaphex 5516ff05b5 Create GFX_CTL_SET_VIDEO_MODE 2016-02-14 02:12:18 +01:00
twinaphex 637ee33ab6 Add GFX_CTL_IDENT_GET 2016-02-14 02:05:20 +01:00
twinaphex 6413449944 (Android/EGL Images) Buildfixes 2016-02-14 02:00:14 +01:00
twinaphex 1d7fdc64ba (D3D) Buildfix 2016-02-13 23:59:45 +01:00
twinaphex 154f85c6fa Add GFX_CTL_SUPPRESS_SCREENSAVER 2016-02-13 23:39:12 +01:00
twinaphex f6afe72a1e Add GFX_CTL_IMAGE_BUFFER_WRITE 2016-02-13 23:35:47 +01:00
twinaphex 0a9787ec49 Create GFX_CTL_INPUT_DRIVER 2016-02-13 23:26:33 +01:00
twinaphex 098fc0a860 Cleanups 2016-02-13 23:20:04 +01:00
twinaphex 82dcd2cd94 Cleanups 2016-02-13 23:17:09 +01:00
twinaphex 75d73ab658 (D3D) Buildfix 2016-02-13 23:12:49 +01:00
Twinaphex 3a924231a6 (OSX) Silence warnings 2016-02-13 22:31:49 +01:00
twinaphex 3140e5f980 Implement GFX_CTL_GET_METRICS 2016-02-13 22:14:33 +01:00
twinaphex ce41c5bbca Create GFX_CTL_TRANSLATE_ASPECT 2016-02-13 22:07:56 +01:00
twinaphex f94e9c532e Create GFX_CTL_PROC_ADDRESS_GET 2016-02-13 22:02:49 +01:00
twinaphex 39bc6c1e9e Add structs 2016-02-13 21:58:35 +01:00
twinaphex 254d2d1fff Avoid crash in gl_frame 2016-02-13 21:15:18 +01:00
twinaphex 9e186b4587 Create GFX_CTL_SWAP_INTERVAL 2016-02-13 20:45:45 +01:00
twinaphex 46c9ff36ef Create GFX_CTL_CHECK_WINDOW 2016-02-13 19:53:14 +01:00
twinaphex b9a5c326cd Create GFX_CTX_GET_VIDEO_OUTPUT_SIZE 2016-02-13 19:36:02 +01:00
twinaphex 46d210e977 Create GFX_CTL_FIND_NEXT_DRIVER/GFX_CTL_FIND_PREV_DRIVER 2016-02-13 19:12:08 +01:00
twinaphex 7c28ddbfc5 Add GFX_CTL_IMAGE_BUFFER_INIT 2016-02-13 18:51:16 +01:00
twinaphex ef6ef13143 Add GFX_CTL_GET_VIDEO_OUTPUT_PREV/GFX_CTL_GET_VIDEO_OUTPUT_NEXT 2016-02-13 18:47:38 +01:00
twinaphex 00e4793bed Add GFX_CTL_BIND_HW_RENDER 2016-02-13 18:36:23 +01:00
twinaphex b7c41c9fcd Remove gfx_ctx_show_mouse 2016-02-13 18:29:07 +01:00
twinaphex 8721c857e9 Add GFX_CTL_SET 2016-02-13 18:27:05 +01:00
twinaphex 6a697ef2e1 GFX_CTL_SHOW_MOUSE added 2016-02-13 17:48:25 +01:00
twinaphex 425a290ced Remove gfx_ctx_destroy 2016-02-13 16:33:38 +01:00
twinaphex ef1b0b0965 Add GFX_CTL_UPDATE_WINDOW_TITLE 2016-02-13 08:50:22 +01:00
twinaphex f079ca29e4 Add GFX_CTL_HAS_WINDOWED 2016-02-13 08:37:10 +01:00
twinaphex 752e9abd4e Add GFX_CTL_SWAP_BUFFERS 2016-02-13 08:33:33 +01:00
twinaphex 0a7c481ff0 Create GFX_CTL_FOCUS 2016-02-13 08:29:58 +01:00
twinaphex fab6c9b8c4 Add GFX_CTL_FREE 2016-02-13 08:26:54 +01:00
twinaphex 753fd86c2e Create gfx_ctx_ctl 2016-02-13 08:21:35 +01:00
twinaphex e3b2abed9e video_context_driver - cleanups 2016-02-13 08:19:56 +01:00
twinaphex 6d8ee1f8d4 Remove input_driver_data_ptr_is_same 2016-02-13 07:40:02 +01:00
twinaphex 016ee293cd Remove input_driver_grab_mouse 2016-02-13 07:38:09 +01:00
twinaphex 24bafd7ab9 Create RARCH_INPUT_CTL_GRAB_MOUSE 2016-02-13 07:36:45 +01:00
twinaphex ac31eeb360 Cleanups 2016-02-13 07:29:02 +01:00
twinaphex 3393a32547 Cleanup 2016-02-13 07:27:22 +01:00
twinaphex fcac9a8401 Cleanups 2016-02-13 07:20:55 +01:00
twinaphex 954c5a86f6 Add rarch_cmd_ctl 2016-02-13 07:19:21 +01:00
twinaphex ff9f433243 Create CHEEVOS_CTL_GET_DESCRIPTION 2016-02-13 06:30:39 +01:00
twinaphex e8e0917c9c Cleanups 2016-02-13 06:24:49 +01:00
twinaphex 3fab9843fd Create CHEEVOS_CTL_POPULATE_MENU 2016-02-13 06:15:38 +01:00
twinaphex 6c06ffbf1d Create CHEEVOS_CTL_SET_CHEATS 2016-02-13 06:13:46 +01:00
twinaphex fc6d22d47b Create CHEEVOS_CTL_UNLOAD 2016-02-13 06:11:17 +01:00
twinaphex a36382b938 Create CHEEVOS_CTL_TEST 2016-02-13 06:09:37 +01:00
twinaphex d255d6609b Create cheevos_ctl 2016-02-13 06:06:51 +01:00
twinaphex 4517d18fc0 cheevos.c - cleanups 2016-02-13 05:47:41 +01:00
twinaphex f75f0beb08 Add EVENT_CMD_EXEC 2016-02-13 05:30:57 +01:00
twinaphex 8c8ea6c167 Cleanups 2016-02-13 05:22:07 +01:00
twinaphex f1ea400456 Refactor away runloop_msg_queue_pull 2016-02-13 05:17:36 +01:00
twinaphex 45a663c100 Add header 2016-02-13 05:08:29 +01:00
twinaphex af1e698b05 Add retro_assert.h to sdl_gfx.c 2016-02-13 04:49:42 +01:00
twinaphex fed8570ec3 (Menu) Spacebar toggles 'RetroPad Start' action 2016-02-13 04:18:07 +01:00
twinaphex 0f35e0639e Fix subsystem loading 2016-02-13 04:07:46 +01:00
Twinaphex 14227c101b Merge pull request #2717 from netux79/master
(GX) Resolution Saving re-enabled. Video Corruption Fix.
2016-02-13 02:09:40 +01:00
netux79 a2851ab70b (GX) Resolution Saving's Video Corruption Fix.
Also some cleanups for the RA GX version included.
2016-02-12 16:58:59 -05:00
Alcaro 03e9577686 Fix compile fail. 2016-02-12 15:27:48 +01:00
Twinaphex 28ddefc467 Properly handle key down latch instead of hoky timer stuff 2016-02-12 08:10:35 +01:00
twinaphex 410e750d24 Style nits 2016-02-12 08:02:29 +01:00
twinaphex b9fde7bb24 (Windows) Windows likes autorepeating of keys too much - have to do
some ugly timer stuff here
2016-02-12 08:02:07 +01:00
Twinaphex cf4d31cd80 Shouldn't repeat keys now 2016-02-12 07:49:49 +01:00
twinaphex 37875fb242 Add MENU_CTL_*PENDING_ACTION 2016-02-12 07:30:34 +01:00
twinaphex 63d216ad1f (Menu controls) Keyboard 'Enter' does Retropad 'OK' and
Backspace does 'RetroPad Cancel'
2016-02-12 07:13:58 +01:00
radius 44e309e7c8 allow a debuggable release build for the buildbot 2016-02-12 01:09:33 -05:00
twinaphex 267c9f8225 Toggle after EVENT_CMD_RESET if UI companion driver is on
foreground
2016-02-12 06:56:43 +01:00
twinaphex 314d683228 Only toggle UI companion driver if UI is on foreground 2016-02-12 06:52:42 +01:00
Twinaphex 485750c8ba Remove unused variable 2016-02-12 06:50:44 +01:00
Twinaphex b4fdab79fe Pressing 'Resume Content' will now toggle the UI companion driver 2016-02-12 06:47:48 +01:00
twinaphex cfe884f0b7 Add ui_companion_driver_toggle 2016-02-12 06:43:06 +01:00
twinaphex c6220a9e66 Reimplement rarch_task_push_content_load_default 2016-02-12 04:55:18 +01:00
twinaphex e26c88b4bb (OSX) Buildfix 2016-02-12 04:40:53 +01:00
twinaphex ab3591df73 (Zarch) Remove unused variable 2016-02-12 04:39:35 +01:00
twinaphex 7d00f945b8 Implement RARCH_MENU_CTL_IS_PENDING_QUICK_MENU, RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, RARCH_MENU_CTL_UNSET_PENDING_QUICK_MENU 2016-02-12 04:28:09 +01:00
twinaphex ce93da7cbf Updates to glsm 2016-02-12 01:42:33 +01:00
twinaphex 9b521d665d Update glsm 2016-02-11 22:08:45 +01:00
twinaphex 49e7347f3d Update glsm 2016-02-11 20:20:55 +01:00
twinaphex 99804e2427 Update glsm 2016-02-11 19:10:40 +01:00
twinaphex c1fbccfc06 Don't try to open IPS/UPS/BPS patches if they don't exist 2016-02-11 18:57:27 +01:00
twinaphex bd008748da Update 2016-02-11 18:44:48 +01:00
twinaphex 74547ca990 Update 2016-02-11 18:30:16 +01:00
twinaphex d09ea1bb57 Add glsm to libretro-common 2016-02-11 18:25:27 +01:00
twinaphex 36b420ec17 Revert "Remove core_info_list_num_info_files"
This reverts commit 9d96e9e452.
2016-02-11 07:20:04 +01:00
radius 8a043a9c6d Revert "Cleanups"
This reverts commit f7d47bb956.
2016-02-10 21:50:54 -05:00
twinaphex a6c2e2981d Move comment to driver.c 2016-02-11 02:29:49 +01:00
twinaphex e2e1471946 Only attempt to create default directories if they don't already
exist
2016-02-11 02:25:16 +01:00
twinaphex db77e1e6ec Refactor menu_input_ctl 2016-02-11 01:57:52 +01:00
twinaphex b881908c91 menu_content_ctl - change return value 2016-02-11 01:55:23 +01:00
twinaphex 2585145b10 Cleanups 2016-02-11 01:54:09 +01:00
twinaphex 14aac016a9 Cleanups 2016-02-11 01:52:11 +01:00
twinaphex 774ec5b7ca Some runloop_ctl changes 2016-02-11 01:47:24 +01:00
twinaphex 3a6484d0ad Change input_driver_ctl default return values 2016-02-11 01:44:39 +01:00
twinaphex c75557d204 Cleanups 2016-02-11 01:42:47 +01:00
twinaphex 712a38083b Style nits 2016-02-11 01:40:43 +01:00
twinaphex 4364ce92c3 Create RARCH_MENU_CTL_LIST_GET_ENTRY 2016-02-11 01:12:19 +01:00
twinaphex b3944a21d5 Create RARCH_MENU_CTL_LIST_GET_SIZE 2016-02-11 01:07:30 +01:00
twinaphex 48e67d5546 Create RARCH_MENU_CT_LIST_GET_SELECTION 2016-02-11 00:59:55 +01:00
twinaphex 9e69551408 Add RARCH_MENU_CTL_BIND_INIT 2016-02-11 00:53:49 +01:00
twinaphex ddf5283ecd Cleanups 2016-02-11 00:47:00 +01:00
twinaphex f17f786234 Use menu_cbs_exit in more places 2016-02-10 21:42:18 +01:00
twinaphex da590b00a8 Add action_ok_exit 2016-02-10 21:38:51 +01:00
twinaphex 71507808c9 Create RARCH_MENU_CTL_LIST_FREE 2016-02-10 21:21:19 +01:00
twinaphex 84d64c4042 Add RARCH_MENU_CTL_DRIVER_DATA_GET 2016-02-10 21:15:23 +01:00
twinaphex 46750ff3e6 Cleanups 2016-02-10 21:01:55 +01:00
twinaphex 8620b4c33b Cleanups 2016-02-10 20:58:45 +01:00
twinaphex 96a6f8ec77 Cleanup 2016-02-10 20:40:39 +01:00
twinaphex 859a04e6ee Create RARCH_MENU_CTL_LIST_PUSH 2016-02-10 20:36:13 +01:00
twinaphex c9ec688a7e Cleanups 2016-02-10 20:29:17 +01:00
twinaphex 35ff9c35b3 Respect 80-char width limit 2016-02-10 20:24:09 +01:00
twinaphex f77722a213 Add RARCH_MENU_CTL_ENVIRONMENT 2016-02-10 20:19:21 +01:00
twinaphex b5e28cda58 Create RARCH_MENU_CTL_ITERATE 2016-02-10 20:13:12 +01:00
twinaphex 9db5d45361 Change return value to menu_driver_iterate 2016-02-10 20:08:10 +01:00
twinaphex 86e8c7a9f8 Free rdb 2016-02-10 20:01:38 +01:00
twinaphex e9e6fd7b80 (Menu) Implement pending shutdown 2016-02-10 19:56:35 +01:00
twinaphex c447f6d1bd Start implementing RARCH_MENU_CTL_SET_PENDING_QUIT 2016-02-10 19:20:58 +01:00
twinaphex 2df631a36f Add menu pending quit mechanism 2016-02-10 19:19:30 +01:00
fr500 2f787604e5 Sort list like on the Load Core section 2016-02-10 12:14:19 -05:00
twinaphex dd8d01a1cb Reorder this code a bit 2016-02-10 17:41:10 +01:00
Twinaphex c9c4c77d38 Prevent yet even more crashes - sigh 2016-02-10 17:18:06 +01:00
twinaphex 21c4a07cf0 (OSX) Buildfix 2016-02-10 07:20:54 +01:00
twinaphex 9b0034ccb2 Fix resolution toggle 2016-02-10 07:19:06 +01:00
twinaphex 9bb1127727 Add more state to RARCH_MENU_CTL_DEINIT 2016-02-10 07:17:26 +01:00
twinaphex 1e05027785 Don't need these headers 2016-02-10 06:54:32 +01:00
twinaphex 55927d5957 Better way to prevent crash 2016-02-10 06:51:47 +01:00
twinaphex b077113aff Prevent crash on calling RARCH_MENU_CTL_CONTEXT_DESTROY 2016-02-10 06:49:00 +01:00
twinaphex 99d21fd701 Implement RARCH_MENU_CTL_LIST_CACHE 2016-02-10 06:43:56 +01:00
twinaphex 23e48f1821 Add RARCH_MENU_CTL_LIST_INSERT 2016-02-10 06:38:57 +01:00
twinaphex b48c900129 Add RARCH_MENU_CTL_LIST_CACHE 2016-02-10 06:15:40 +01:00
twinaphex f2952c530c Cleanups 2016-02-10 06:01:11 +01:00
Twinaphex 259ac2ddbd Merge pull request #2710 from fr500/master
save only modified values when saving remaps
2016-02-10 05:46:17 +01:00
twinaphex 1721a23d54 Style nits 2016-02-10 05:41:53 +01:00
radius 80845f1cd6 save only modified values when saving remaps 2016-02-09 23:39:16 -05:00
twinaphex 788951958c Cleanups 2016-02-10 05:25:30 +01:00
twinaphex 85e0ab9a8e Cleanups 2016-02-10 05:23:33 +01:00
twinaphex 5164b8a058 Cleanups 2016-02-10 05:21:44 +01:00
twinaphex 33f0f72adc Cleanups 2016-02-10 04:30:33 +01:00
twinaphex 0e017ea925 Cleanups 2016-02-10 04:22:59 +01:00
twinaphex 65742d250b Cleanup 2016-02-10 04:16:58 +01:00
twinaphex 0541a9866e menu_entries_ctl - change returncode 2016-02-10 04:15:18 +01:00
twinaphex bbe7221d95 driver_ctl - return default return value to true 2016-02-10 04:12:20 +01:00
twinaphex 3763c6d4c0 Cleanups 2016-02-10 03:59:17 +01:00
twinaphex bb1fa17718 Cleanups 2016-02-10 03:53:20 +01:00
twinaphex efc580c071 (menu_driver.c0 Cleanups 2016-02-10 03:52:02 +01:00
twinaphex e0a29599f4 Cleanups 2016-02-10 03:49:47 +01:00
Twinaphex 8c910b73dc return true here 2016-02-10 03:35:13 +01:00
twinaphex dd0136e2d5 Refactor this code 2016-02-10 03:29:31 +01:00
twinaphex 9af5b44453 task_queue.c - Prevent warning 2016-02-09 18:39:41 +01:00
twinaphex d9de92f48b Buildfix 2016-02-09 18:38:57 +01:00
twinaphex 5b6d310abd Rename enums 2016-02-09 18:26:27 +01:00
twinaphex 8b9c7a47e4 Move task_queue to queues/ dir 2016-02-09 18:13:47 +01:00
twinaphex 31112e937b Move task_queue.c to libretro-common 2016-02-09 18:11:11 +01:00
twinaphex 8d47203ad1 Rename some functions 2016-02-09 18:00:17 +01:00
twinaphex e4d983646d Rename push_task_progress 2016-02-09 17:56:36 +01:00
twinaphex 4210ee197b Rename tasks.c to task_queue.c 2016-02-09 17:55:15 +01:00
twinaphex 6e9bc55dd6 Rename task_ctl to task_queue_ctl 2016-02-09 17:51:51 +01:00
twinaphex 08eb091610 Rename rarch_ to retro_ 2016-02-09 17:47:04 +01:00
twinaphex 0378463130 Remove configuration.h dependencies from tasks.c 2016-02-09 17:41:30 +01:00
Alcaro a12e307039 Whitespace cleanup 2016-02-09 17:36:59 +01:00
twinaphex 76770321b4 Cleanup 2016-02-09 17:27:29 +01:00
twinaphex ce2869b4d8 Create tasks_internal and split up RA-specific task code to outside 2016-02-09 17:12:39 +01:00
twinaphex c60c9fbd86 tasks.c - cleanups 2016-02-09 17:01:07 +01:00
twinaphex f604afeede Create RARCH_MENU_CTL_FIND_DRIVER 2016-02-09 16:49:23 +01:00
twinaphex 5cd66a19b2 Create RARCH_MENU_CTL_INIT 2016-02-09 16:45:28 +01:00
twinaphex a306d3acc7 Cleanups 2016-02-09 16:13:00 +01:00
twinaphex 88c68f479a Cleanups 2016-02-09 16:11:37 +01:00
twinaphex 2026401cc0 (D3D) Buildfix 2016-02-09 16:00:34 +01:00
twinaphex c6cc006223 pass draw pointer instead of plenty of params 2016-02-09 15:55:31 +01:00
twinaphex 159ebcc8a2 (XMB) Fix icons 2016-02-09 15:21:45 +01:00
twinaphex 1c3d8c5740 Cleanups 2016-02-09 05:17:42 +01:00
twinaphex e86bd1b021 Cleanups 2016-02-09 05:11:40 +01:00
twinaphex 07632702fb Cleanups 2016-02-09 05:07:36 +01:00
twinaphex e7798ed511 Refactor datetime menu display function 2016-02-09 05:03:13 +01:00
twinaphex a0f35e56fa Cleanups 2016-02-09 04:55:45 +01:00
twinaphex da1a5ad2cc Cleanup 2016-02-09 04:54:04 +01:00
twinaphex 0bfaf26993 Cleanup 2016-02-09 04:50:59 +01:00
twinaphex 41088165f5 Get rid of menu_display_get_tex_coords 2016-02-09 04:49:47 +01:00
twinaphex 7c7b170ceb Refactor rotate Z draw calls 2016-02-09 04:43:15 +01:00
twinaphex 2b86b9dbe6 (menu_display.c) Refactor draw functions 2016-02-09 04:34:07 +01:00
twinaphex 2dba1aaef4 Add new structs 2016-02-09 04:12:33 +01:00
twinaphex 82991afb36 Remove unnecessary menu_display_msg_queue_push 2016-02-09 03:29:37 +01:00
twinaphex 9f2e61cddd Cleanup 2016-02-09 03:21:03 +01:00
twinaphex a3fd1868c1 Turn function static 2016-02-09 03:11:14 +01:00
twinaphex ad4e633e11 Add MENU_DISPLAY_CTL_CLEAR_COLOR 2016-02-09 03:04:23 +01:00
twinaphex 38a341e6b5 Use video_driver_texture_load and video_driver_texture_unload
directly from menu drivers
2016-02-09 01:45:37 +01:00
twinaphex cdf272665e Cleanups 2016-02-09 01:39:01 +01:00
twinaphex c3c408f9d6 Add MENU_DISPLAY_CTL_RESTORE_CLEAR_COLOR 2016-02-09 01:36:00 +01:00
twinaphex 690c5c2bc8 Cleanups 2016-02-09 01:32:42 +01:00
twinaphex c6e0a38906 Move more variables to menu_display_ctl 2016-02-09 01:31:02 +01:00
twinaphex dd106ee8d2 Add more menu_display_ctl actions 2016-02-09 01:24:35 +01:00
twinaphex 28f3ea355a 80-char width limit cleanups 2016-02-09 01:01:11 +01:00
twinaphex e743f4377e 80-char width limit cleanups 2016-02-09 00:59:42 +01:00
twinaphex d0e9881f46 Add MENU_DISPLAY_CTL_FONT_BIND_BLOCK 2016-02-09 00:57:10 +01:00
twinaphex 3e0d3cbd55 Create MENU_DISPLAY_CTL_INIT_FIRST_DRIVER 2016-02-09 00:49:37 +01:00
twinaphex 9f2bc8d55e Move msg_queue to menu_display_ctl 2016-02-09 00:13:33 +01:00
twinaphex 486184d1eb Create MENU_DISPLAY_CTL_INIT/MENU_DISPLAY_CTL_DEINIT 2016-02-09 00:12:09 +01:00
twinaphex 5e9f8b276b Create MENU_DISPLAY_CTL_DEINIT 2016-02-09 00:07:23 +01:00
Andrés a8b5c4f3b1 Merge pull request #2706 from fr500/master
save libretro device and analog dpad mode with remap files
2016-02-08 17:03:47 -05:00
twinaphex bd1291dd71 Simplify framebuffer code for RGUI 2016-02-08 22:42:23 +01:00
radius 67a68c0595 save libretro device and analog dpad mode with remap files 2016-02-08 16:06:54 -05:00
twinaphex 459c18f5de Attempt to make blit_line more robust 2016-02-08 19:18:40 +01:00
twinaphex 2f13fe0ece Turn some variables into static local functions 2016-02-08 19:11:44 +01:00
twinaphex 88a8ac5370 Move framebuf_data to menu_display_ctl as static local variable 2016-02-08 18:58:02 +01:00
twinaphex c1e4a852cc Turn variable into static local variable 2016-02-08 18:55:22 +01:00
twinaphex d092e20b5a Simply 'framebuffer dirty' code 2016-02-08 18:54:19 +01:00
twinaphex 72ce7e8fd2 Add ability to set audio latency to 8ms 2016-02-08 16:43:24 +01:00
Twinaphex 94d227863f Merge pull request #2705 from fr500/master
xmb && per-game options improvements
2016-02-08 07:18:11 +01:00
radius 2fca1cccd3 add xmb font 2016-02-08 01:11:56 -05:00
radius cfa01e930d add settings for xmb font 2016-02-08 01:08:03 -05:00
radius 5c4ab83d98 add XMB settings for scale and opacity 2016-02-08 00:34:13 -05:00
radius 14cd4af752 don't create directories when checking for game options, only create when the user selects the menu entry 2016-02-08 00:07:41 -05:00
twinaphex ce1b86993b Style nits 2016-02-08 05:58:27 +01:00
twinaphex fc821fc5b4 Make rarch_task_http_finder more robust 2016-02-08 05:48:36 +01:00
Twinaphex 1924b8396b Merge pull request #2703 from diablodiab/master
Enables keyboard to be mapped to gamepad buttons
2016-02-08 02:41:02 +01:00
Diablodiab 84b6b505ad Fix crash when defining gamepad keys 2016-02-08 01:53:33 +01:00
Diablodiab bdb9471d13 Added support for using keyboards in the Retroarch menu and for mapping to gamepad keys. 2016-02-08 01:06:15 +01:00
twinaphex f8051d846f Turn function static 2016-02-08 00:36:32 +01:00
twinaphex b3e72f6f42 Respect 80-char width limit 2016-02-08 00:31:11 +01:00
twinaphex c30a2ec990 Cleanups 2016-02-08 00:28:05 +01:00
twinaphex 95deab8f1d Cleanup 2016-02-08 00:26:33 +01:00
twinaphex 29d1326c4f We assume deinit/init is going to be correct from now on on
console
2016-02-08 00:24:20 +01:00
twinaphex cd578521e4 Cleanups 2016-02-08 00:23:03 +01:00
twinaphex b578ffb056 Create RARCH_DISPLAY_CTL_HW_CONTEXT_GET 2016-02-07 21:53:38 +01:00
twinaphex a2b2869ca6 Cleanup 2016-02-07 21:46:57 +01:00
twinaphex 0584b3c072 Create RARCH_DISPLAY_CTL_IS_HW_CONTEXT 2016-02-07 20:32:53 +01:00
twinaphex d8bfa7ab7d Rename RARCH_DISPLAY_CTL_DEINIT_VIDEO_CACHE_CONTEXT to RARCH_DISPLAY_CTL_DEINIT_HW_CONTEXT 2016-02-07 20:15:58 +01:00
twinaphex 702d9d4728 Create RARCH_DISPLAY_CTL_DEINIT_VIDEO_CACHE_CONTEXT 2016-02-07 20:11:16 +01:00
twinaphex 3e69eb5a8e video_driver_unset_callback - have destroy_callback do this
implicitly
2016-02-07 20:06:07 +01:00
twinaphex 772aa6ef0c Move destroy and unsetting of video driver callback to RETRO_UNLOAD_GAME
time
2016-02-07 19:29:40 +01:00
twinaphex 76b726d154 Cleanup 2016-02-07 19:02:09 +01:00
twinaphex 81c4160a5a Cleanups 2016-02-07 19:01:17 +01:00
twinaphex eb33197a9b Cleanup core_info_get_name - reuse core_info_list_iterate 2016-02-07 18:32:56 +01:00
twinaphex c7b9625460 Create core_info_list_iterate 2016-02-07 18:27:27 +01:00
twinaphex f7d47bb956 Cleanups 2016-02-07 18:19:58 +01:00
twinaphex d384cb351f Cleanup 2016-02-07 17:40:42 +01:00
twinaphex a1ee49bf1d Cleanups 2016-02-07 17:39:10 +01:00
twinaphex 496a69c796 Cleanup 2016-02-07 17:35:52 +01:00
twinaphex fac18641cd Turn function static 2016-02-07 17:34:22 +01:00
twinaphex d3b9356958 Create CORE_INFO_CTL_LOAD 2016-02-07 17:26:10 +01:00
twinaphex e566665885 Cleanup 2016-02-07 17:19:27 +01:00
Alcaro b600e6e032 Fix typo. 2016-02-07 16:23:36 +01:00
twinaphex b647e8186d Create CORE_INFO_CTL_LIST_UPDATE_MISSING_FIRMWARE 2016-02-07 16:19:02 +01:00
twinaphex 452df47c14 Remove core_info_list_get_all_extensions 2016-02-07 16:10:42 +01:00
twinaphex 9d96e9e452 Remove core_info_list_num_info_files 2016-02-07 16:03:53 +01:00
twinaphex 71bc817e99 Remove unused STRING_LIST_CORES_NAMES 2016-02-07 15:54:37 +01:00
twinaphex c78c542aea Remove unused STRING_LIST_CORES_PATHS 2016-02-07 15:53:34 +01:00
twinaphex a67082865c N/A 2016-02-07 13:38:23 +01:00
twinaphex 26737dbf49 N/A 2016-02-07 13:33:56 +01:00
twinaphex 3fe210bb41 N/A 2016-02-07 13:29:50 +01:00
twinaphex 534a838472 Header cleanups 2016-02-07 13:25:55 +01:00
twinaphex 0b1b56214e Try to reduce dependence on general.h 2016-02-07 13:18:48 +01:00
twinaphex 04591cfc5c Header cleanups 2016-02-07 13:10:04 +01:00
twinaphex 1b2cf74e12 Add more ways to gracefully fail during content loading 2016-02-07 13:08:14 +01:00
twinaphex ff90a13a5e Turn core_info_does_support_any_file static 2016-02-07 12:59:50 +01:00
twinaphex 418fb62cfc Cleanups 2016-02-07 12:55:21 +01:00
twinaphex 6576348198 Turn core_info_does_support_file static 2016-02-07 12:53:45 +01:00
twinaphex bd56e0c02e Turn some functions static 2016-02-07 12:51:45 +01:00
twinaphex 487b295182 Turn core_info_find into static function 2016-02-07 02:53:00 +01:00
twinaphex 9e9723e721 Create CORE_INFO_CTL_FIND 2016-02-07 02:50:16 +01:00
twinaphex 490c023fe3 Add core_info_ctl actions 2016-02-07 02:37:57 +01:00
twinaphex 7a01fb1616 Create CORE_INFO_CTL commands 2016-02-07 02:24:08 +01:00
twinaphex e1bd5ca335 Create core_info_ctl 2016-02-07 02:18:26 +01:00
twinaphex 4448145532 Cleanups 2016-02-07 01:56:03 +01:00
twinaphex f1ca9604b7 Header include changes 2016-02-07 01:50:08 +01:00
twinaphex 0e89523fa8 Move function prototype to patch.c 2016-02-07 01:46:20 +01:00
twinaphex d9b3412922 (patch) Turn functions static 2016-02-07 01:44:54 +01:00
twinaphex c4c4ee4eee Respect 80-char width limit 2016-02-07 01:22:19 +01:00
twinaphex fbcad4e117 (core_info.c) Respect 80-char width limit 2016-02-07 01:15:10 +01:00
twinaphex 71a8098037 Refactor RARCH_DISPLAY_CTL_HAS_WINDOWED 2016-02-07 01:11:07 +01:00
twinaphex ac09b7eb29 (deps/zlib) Rollback changes 2016-02-07 01:05:40 +01:00
twinaphex 3c2f7fadcc (GX) Fix 'Restart RetroArch' 2016-02-07 00:04:19 +01:00
twinaphex 694ef7570e (PS3) Take out LIBRETRODB and silence some warnings 2016-02-07 00:04:00 +01:00
twinaphex 506645dd8d (PS3) Exclude GLUI/XMB 2016-02-06 23:13:40 +01:00
twinaphex fccb635f19 (PS3) Compile without stb font support 2016-02-06 22:53:57 +01:00
twinaphex b8b7ee530c Respect 80-char width limits 2016-02-06 21:51:37 +01:00
twinaphex ca2c38cd9f Respect 80-char width limit 2016-02-06 21:41:26 +01:00
twinaphex 7e8ea3f6fb Add better fallback for 'no items found' 2016-02-06 21:34:54 +01:00
twinaphex 05d9827830 Revert "Get rid of SL_FLAG_ALLOW_EMPTY_LIST"
This reverts commit bb0b8764c5.
2016-02-06 21:33:45 +01:00
twinaphex 788ded0138 Revert "Add better fallback for 'no items found'"
This reverts commit b208ce443c.
2016-02-06 21:33:38 +01:00
twinaphex b208ce443c Add better fallback for 'no items found' 2016-02-06 21:31:22 +01:00
twinaphex bb0b8764c5 Get rid of SL_FLAG_ALLOW_EMPTY_LIST 2016-02-06 21:29:44 +01:00
twinaphex 8b20409d32 Rename rarch_defer_core_wrapper 2016-02-06 19:43:42 +01:00
twinaphex 609fa8394e (GX) Fix FRONTEND_FORK_CORE when game has already been selected 2016-02-06 18:18:17 +01:00
twinaphex 24354f477e (GX) Fix FRONTEND_FORK_CORE_WITH_ARGS 2016-02-06 18:06:49 +01:00
twinaphex f29c61bacc (Linux) Restarting of core in non-HAVE_DYNAMIC mode now properly
implemented
2016-02-05 19:16:35 +01:00
twinaphex c67771fab6 Buildfix 2016-02-05 19:00:30 +01:00
twinaphex 8c2ed9f750 Rename FRONTEND_FORK_SALAMANDER_RESTART to FRONTEND_FORK_RESTART
and call FRONTEND_FORK_CORE instead of FRONTEND_FORK_RESTART
when selecting a core from 'Load Core' list
2016-02-05 18:57:44 +01:00
twinaphex 6a64ab1137 (platform_linux.c) Try to stay within 80-char width limit 2016-02-05 18:53:01 +01:00
twinaphex 6130f20d47 (XDK) Reimplement fork mode 2016-02-05 18:47:27 +01:00
twinaphex 17f885d158 (PSP) Refactor fork mode 2016-02-05 18:43:23 +01:00
twinaphex 9e497c1b11 (PS3) Reimplement set_fork_mode 2016-02-05 18:40:24 +01:00
twinaphex d59ffbdd2c (GX/Untested) Reimplement set fork mode 2016-02-05 18:34:28 +01:00
twinaphex 5f3ae10f20 (Linux) Reimplement fork mode functionality 2016-02-05 17:58:50 +01:00
twinaphex d9113b8bc4 (Linux non-HAVE_DYNAMIC) Can now exit properly 2016-02-05 17:44:51 +01:00
twinaphex feb744fafe dist-cores.sh : Add big stack rule for unix target 2016-02-05 17:38:09 +01:00
twinaphex 0ed22af4f5 Update dist-cores.sh - turn 'linux' target into 'unix' 2016-02-05 17:03:00 +01:00
twinaphex 02ab043ff5 Setup dist-cores.sh for Linux statically linked cores 2016-02-05 15:13:06 +01:00
twinaphex d3aaa7ac88 Style nits 2016-02-05 14:42:20 +01:00
twinaphex 341e8f8f15 Cleanup 2016-02-05 14:35:16 +01:00
twinaphex 6b55a5f20b Cleanup 2016-02-05 14:15:32 +01:00
twinaphex ce200823b8 Cleanup 2016-02-05 14:13:49 +01:00
twinaphex 8e2818bbeb Cleanups 2016-02-05 14:11:38 +01:00
twinaphex 36c36aa558 Cleanups 2016-02-05 14:09:46 +01:00
twinaphex 8fc2a05a70 Cleanups 2016-02-05 14:06:43 +01:00
twinaphex 188029373f Header include changes 2016-02-05 14:00:27 +01:00
twinaphex 0643b83f7d Header include changes 2016-02-05 13:57:08 +01:00
twinaphex ab64daf5aa Cleanups 2016-02-05 13:51:30 +01:00
twinaphex 2fa46bcef8 Cleanups 2016-02-05 13:36:18 +01:00
twinaphex ca3f352ed1 Remove unused udev_common 2016-02-05 13:30:19 +01:00
twinaphex 32ee695f9d Create udev_ctl 2016-02-05 01:49:31 +01:00
twinaphex 24f5275001 Use wiiugca for non-Wii too 2016-02-04 23:49:04 +01:00
twinaphex 407d85f604 Use nesusb/snesusb for non-Wii too 2016-02-04 23:43:33 +01:00
Twinaphex a90c5a9861 Merge pull request #2695 from netux79/master
(GX) Refactor of the Wii USB HID support. Now it's working!
2016-02-04 23:36:46 +01:00
netux79 bca4ccb155 (GX) Refactor of the Wii USB HID support. Now it's working!
In order to have a controller working you need:
1) Have a matching HID autoconfig file in autoconfig/hid for your controller.
2) Create a "connect" driver for the pad in "input/connect" folder (source code of RA).
3) Once you are in RA, change the joystick driver to HID and restart.
4) You may be now able to use you USB HID compatible pad in RA.

I included some "connect" drivers as an example. It also need to include them for compilation.
2016-02-04 17:01:03 -05:00
twinaphex 6623bdc054 (XMB) Fix text being cut off 2016-02-04 22:03:36 +01:00
twinaphex deb3c73ae0 Nits 2016-02-04 21:42:42 +01:00
twinaphex 9a75893cff Nits 2016-02-04 21:40:29 +01:00
twinaphex f747196e21 Style nits 2016-02-04 21:31:41 +01:00
twinaphex 3a5ddf15cf Nits 2016-02-04 21:27:58 +01:00
twinaphex 050cf545bf NIts 2016-02-04 21:24:51 +01:00
twinaphex 7bde72a8ec Nits 2016-02-04 21:20:28 +01:00
twinaphex 03199b564f Create MENU_ENTRIES_CTL_REFRESH 2016-02-04 21:13:38 +01:00
twinaphex 2e8f015de3 Cleanups 2016-02-04 21:07:02 +01:00
twinaphex 3d56dd1ef8 Cleanup 2016-02-04 21:03:28 +01:00
twinaphex dbef4d9b2b Nits 2016-02-04 20:58:53 +01:00
twinaphex 878c4e3833 Cleanup 2016-02-04 20:56:22 +01:00
twinaphex 958860dea7 Remove obsolete static function 2016-02-04 20:47:34 +01:00
Twinaphex da34967857 (OSX) Include <sys/types.h> - provide prototype for ssize_t 2016-02-04 20:36:00 +01:00
twinaphex d773dd8d45 Cleanups 2016-02-04 20:28:28 +01:00
Twinaphex a120ab1084 Cleanup RARCH_CTL_DEINIT 2016-02-04 20:26:36 +01:00
twinaphex 2901c3c737 (menu_driver.c) 80-char width limit 2016-02-04 20:23:52 +01:00
Twinaphex 9c9fdcfa58 (iOS 9) Fix iOS 9 build 2016-02-04 20:17:26 +01:00
twinaphex 543e680961 Rewrite menu_driver_list_free 2016-02-04 20:15:34 +01:00
twinaphex c039e4c6ab Make menu_driver_free a static function 2016-02-04 20:12:58 +01:00
Twinaphex 667e33e82b Buildfix 2016-02-04 20:05:20 +01:00
twinaphex 73684cb361 Set these static variables initially to NULL 2016-02-04 20:04:06 +01:00
twinaphex 12d1de4232 Set these static variables initially to NULL 2016-02-04 20:03:31 +01:00
twinaphex 12e453c29a Set these static variables initially to NULL 2016-02-04 20:02:50 +01:00
twinaphex 5b74105add Set these static variables to NULL 2016-02-04 20:02:02 +01:00
twinaphex 58219f897a Dehardcode frontend_linux_exec 2016-02-04 18:28:42 +01:00
twinaphex be94309808 Use execv - seems to work 2016-02-04 17:56:34 +01:00
twinaphex 77d6eb560c Fix 'statement is unreachable' warning 2016-02-04 17:47:56 +01:00
twinaphex 7a5db5a73a Reimplement frontend_driver_set_fork 2016-02-04 17:46:50 +01:00
twinaphex 332f48f2df Hardcode path for now as a test 2016-02-04 17:28:58 +01:00
twinaphex 84c3b5a546 Implement frontend_linux_exitspawn 2016-02-04 17:16:15 +01:00
twinaphex c3c14c162e Change signature of set_fork so that we can optionally implement
restarting RetroArch (or not)
2016-02-04 17:08:09 +01:00
twinaphex b8a418d6f5 Update description 2016-02-04 15:46:52 +01:00
twinaphex 957f58a033 Rename static function 2016-02-04 15:46:24 +01:00
twinaphex cb2a7b59f3 Turn some functions static 2016-02-04 15:44:25 +01:00
twinaphex 94d10f9d4b Seems to be no longer used? 2016-02-04 15:37:41 +01:00
twinaphex 9d9c6827f5 (menu_content.c) Cleanup to menu_content_load_from_playlist 2016-02-04 15:29:37 +01:00
Twinaphex 05dd8eb6b4 Merge pull request #2693 from lakkatv/master
Display genre from tgdb
2016-02-04 15:24:34 +01:00
twinaphex 4e674e15ab Create MENU_CONTENT_CTL_FIND_FIRST_CORE 2016-02-04 15:21:42 +01:00
Jean-André Santoni b1f22127b2 Display genre from tgdb 2016-02-04 21:20:56 +07:00
twinaphex 24a04ce201 Create MENU_CONTENT_CTL_LOAD_PLAYLIST 2016-02-04 15:00:38 +01:00
twinaphex b646b548ff Create menu_content_ctl 2016-02-04 14:51:01 +01:00
twinaphex 8709657d4d Start implementing frontend_linux_exec 2016-02-04 14:10:29 +01:00
twinaphex cad629a36b (Load Core) Show 'No Items' when no core could be found inside the list. 2016-02-04 13:40:07 +01:00
twinaphex 4d8e579779 Add 'elf' as executable extension for Linux when compiling with
non-HAVE_DYNAMIC
2016-02-04 12:52:49 +01:00
Twinaphex f6bcc209ab Merge pull request #2692 from lakkatv/master
Add support for TGDB Rating
2016-02-04 12:04:22 +01:00
Jean-André Santoni ab413672a9 Add support for TGDB Rating 2016-02-04 17:55:08 +07:00
twinaphex dad456afd9 N/A 2016-02-04 11:45:34 +01:00
twinaphex ea28f992ac Refactor frontend_driver_set_fork 2016-02-04 11:44:10 +01:00
twinaphex 8574315f52 N/A 2016-02-04 11:31:34 +01:00
twinaphex 18a8b0f29d Silence warnings with non-HAVE_DYNAMIC 2016-02-04 11:28:12 +01:00
twinaphex a332643003 (Linux) Start adding frontend_linux_set_fork for non-HAVE_DYNAMIC 2016-02-04 11:25:13 +01:00
twinaphex 5d27033b2e Nit 2016-02-04 11:12:57 +01:00
twinaphex 6896e85f01 Attempt to stay within 80-char width limit 2016-02-04 11:11:23 +01:00
twinaphex 0c03ee0afa Style nits 2016-02-04 11:05:34 +01:00
twinaphex 9c547ab541 Move define to top of file 2016-02-04 10:30:12 +01:00
twinaphex 2251517774 Respect 80-char width limit 2016-02-04 10:25:22 +01:00
twinaphex 16ba94b531 Revert "(task_database.c) Style nits"
This reverts commit 0f46d42c26.
2016-02-04 10:17:54 +01:00
twinaphex 24adcc8e68 Create RUNLOOP_CTL_MSG_QUEUE_PUSH 2016-02-03 17:56:40 +01:00
twinaphex e6d04b2fb4 Create RUNLOOP_CTL_MSG_QUEUE_CLEAR 2016-02-03 17:50:53 +01:00
twinaphex 7803b0d925 Create RUNLOOP_CTL_MSG_QUEUE_PULL 2016-02-03 17:48:01 +01:00
twinaphex c57995b3eb Style nits/cleanups 2016-02-03 17:41:04 +01:00
twinaphex 0f46d42c26 (task_database.c) Style nits 2016-02-03 17:31:19 +01:00
twinaphex 52a5ff73fa Style nits 2016-02-03 17:20:36 +01:00
twinaphex ad323a159d Take out outdated log message 2016-02-03 17:17:25 +01:00
twinaphex 32b9303a79 Create RARCH_MENU_CTL_LIST_SET_SELECTION 2016-02-03 17:15:00 +01:00
twinaphex 03ddb7baa2 Style nits 2016-02-03 17:10:54 +01:00
twinaphex d764c51eae Style nits 2016-02-03 17:07:45 +01:00
twinaphex 482740b5fa (netplay) Style nits 2016-02-03 17:05:32 +01:00
twinaphex 66f9295253 Style nits 2016-02-03 17:00:43 +01:00
twinaphex 9b9efc745c Style nit 2016-02-03 16:58:30 +01:00
twinaphex f70a082626 Create event_cmd_exec - get rid of libretro_private.h 2016-02-03 16:58:06 +01:00
twinaphex aeb5a8e32f (screenshot.c) Cleanup 2016-02-03 16:13:37 +01:00
twinaphex f77f66450e (cheevos.c) More style nits 2016-02-03 16:09:53 +01:00
twinaphex 3ea92115bf (cheevos.c) Style nits 2016-02-03 16:09:11 +01:00
twinaphex 45b806aed8 Cleanups 2016-02-03 15:50:51 +01:00
twinaphex f9f0d4abb6 Refactor 2016-02-03 15:47:57 +01:00
twinaphex cca999ecc7 Remove warning 2016-02-03 15:39:44 +01:00
twinaphex d1957789bc (GX) Dehardcode some code here 2016-02-03 15:38:28 +01:00
twinaphex 4a3263986b Style nits 2016-02-03 15:30:17 +01:00
twinaphex 674f17485d (CTR) Fix build 2016-02-03 15:27:31 +01:00
twinaphex d1097ed967 (PSP1) Buildfix 2016-02-03 15:26:35 +01:00
twinaphex 5f3ddb4bfc Fix some warnings with SNC PS3 compiler 2016-02-03 15:25:37 +01:00
twinaphex 7e4f17ef8d (PS3) Fix build 2016-02-03 15:23:13 +01:00
twinaphex 2f6f7d9308 (Gamecube) Silence warnings 2016-02-03 14:42:40 +01:00
twinaphex 48e83ba02a Cleanup 2016-02-03 14:41:39 +01:00
twinaphex 47fc8fe3c0 Cleanup 2016-02-03 14:39:14 +01:00
Twinaphex f080cfe74f Merge pull request #2690 from lakkatv/master
Display Co-op in the database informations
2016-02-03 14:37:09 +01:00
twinaphex 321690b416 Refactors to do with set_fork method 2016-02-03 14:36:34 +01:00
Jean-André Santoni 18cf2f3f88 Display Co-op in the database informations 2016-02-03 19:36:13 +07:00
twinaphex 0e7729c660 Create frontend_driver_get_salamander_basename 2016-02-03 13:36:00 +01:00
twinaphex 7d6ad7435f dynamic.c - Take out one RARCH_CONSOLE ifdef 2016-02-03 12:46:20 +01:00
twinaphex 9a5ce5fdb3 Make HAVE_LIBRETRO_MANAGEMENT define obsolete 2016-02-03 12:31:29 +01:00
twinaphex fbf6b01209 Add frontend_driver_has_fork 2016-02-03 11:56:01 +01:00
twinaphex 2cbb18b4e4 Create RARCH_DRIVER_CTL_FIND_INDEX 2016-02-01 13:15:53 +01:00
twinaphex 668373f9f8 Refactor away some functions 2016-02-01 12:56:17 +01:00
twinaphex 3de0718e3f Turn some functions static 2016-02-01 12:46:46 +01:00
twinaphex d720bba510 Cleanup 2016-02-01 12:43:48 +01:00
Twinaphex 8bc4a69729 Merge pull request #2687 from Monroe88/quick_menu
Keep Quick Menu at the top of the Main Menu
2016-02-01 07:50:55 +01:00
Monroe88 2ce3ed1319 Keep Quick Menu at the top of the Main Menu 2016-01-31 14:36:41 -06:00
radius ed7323ea88 forgot to free this 2016-01-31 02:17:52 -05:00
Twinaphex f64e3e528d Merge pull request #2686 from fr500/master
improve per-game core options
2016-01-31 08:12:04 +01:00
radius 659a3ef5d8 write to game options files if created instead of the main options file 2016-01-31 01:54:57 -05:00
twinaphex f5b7add383 Cleanups 2016-01-30 05:21:05 +01:00
twinaphex 8670c2e405 Create RARCH_CTL_MAIN_INIT and RARCH_CTL_MAIN_DEINIT 2016-01-30 05:03:15 +01:00
twinaphex aa0f0a2738 Fix header include 2016-01-30 04:46:41 +01:00
twinaphex eb5986d332 Cleanup 2016-01-30 04:43:35 +01:00
twinaphex a7a8ff387a (drivers_font_renderer/stb.c) Use retro_read_file 2016-01-30 04:00:46 +01:00
twinaphex f1819b8c13 Replace read_file instances with retro_read_file 2016-01-30 03:59:30 +01:00
twinaphex 9ab31824f8 Use retro_read_file in more places 2016-01-30 03:58:33 +01:00
twinaphex 9371d3ae48 video_texture_image_load_tga - use retro_read_file instead 2016-01-30 03:54:28 +01:00
twinaphex 04c17f1f9a Cleanups 2016-01-30 03:51:24 +01:00
twinaphex 7decd1e230 (GX) Buildfix 2016-01-30 03:30:56 +01:00
twinaphex 101ec57936 movie.c - turn some functions static 2016-01-30 03:29:12 +01:00
twinaphex b0ec812de6 Create two new BSV_MOVIE_CTL_* actions 2016-01-30 03:25:47 +01:00
twinaphex bd39fd252f Fix C89_BUILD 2016-01-30 03:18:18 +01:00
twinaphex 2bade2c933 Cleanup 2016-01-30 03:11:07 +01:00
twinaphex 1674dafe79 Cleanup 2016-01-30 03:10:41 +01:00
twinaphex cc45f5c447 Cleanups 2016-01-30 03:08:33 +01:00
twinaphex 8cf1acb7c6 (gfx/video_texture_image.c) Refactors 2016-01-30 02:48:43 +01:00
twinaphex a267bdfbe3 MOve gfx/image/image.c to gfx/video_texture_image.c 2016-01-30 02:39:08 +01:00
twinaphex e91b325d9d Remove no longer used write_file 2016-01-30 02:20:00 +01:00
twinaphex 8e435a66eb (Netplay) Backport - [PATCH] Should fix few issues with netplay.
One perf fix and 3/4 player fix.
2016-01-30 00:23:22 +01:00
Alcaro 92251dcecb Get the C89 support flags out of ./configure --help. 2016-01-29 18:57:24 +01:00
twinaphex cb2288ebe6 Turn cheevos_locals into static variable 2016-01-29 14:39:38 +01:00
twinaphex b47caeb58b Refactor away runloop_msg_queue_push_new 2016-01-29 14:30:09 +01:00
twinaphex 912b62dca9 Create RARCH_CTL_SET_PATHS 2016-01-29 11:00:01 +01:00
twinaphex 4456cb85f6 (Android) Use strstr for detecting devices by name 2016-01-29 10:56:05 +01:00
twinaphex 195520fcb6 (D3D) Attempt to fix build error 2016-01-29 10:40:37 +01:00
twinaphex 4f94e2b5d8 (Android) Fix APK assets extraction 2016-01-29 09:42:15 +01:00
twinaphex c8d57e98d2 Create libretro GL FF Test 2016-01-29 03:03:12 +01:00
twinaphex 29ae063003 (Libretro GL Test) Improve fixed function example 2016-01-29 02:55:12 +01:00
twinaphex 58f619dc22 (Libretro GL Test) Add fixed-function GL codepath 2016-01-29 02:34:06 +01:00
twinaphex d81d6058cd (Libretro test GL) If we don't call input_state at least once per retro_run then
late input polling behavior won't work
2016-01-29 02:30:09 +01:00
twinaphex 9f21a813bd Remove Emscripten rule 2016-01-29 02:25:35 +01:00
twinaphex 673aab5282 (PATCH) Strip lines with #pragma parameter.
It's not valid GLSL to have quotes in them, and it's meaningless to pass in the #pragmas to the driver.
2016-01-29 02:07:37 +01:00
Alcaro d86bda1ebd Tell which option is unknown. 2016-01-29 00:49:12 +01:00
twinaphex 219dd6c5d5 Cleanup 2016-01-28 18:53:25 +01:00
twinaphex 9e0aad9d5d Cleanups 2016-01-28 18:51:07 +01:00
twinaphex ae1e9acbaf Turn function static 2016-01-28 10:11:33 +01:00
twinaphex 6b1441340c Cleanup 2016-01-28 10:09:26 +01:00
twinaphex c53702e768 Make impl_current into static local variable 2016-01-28 10:08:27 +01:00
twinaphex d61eb7a8db Add TASK_CTL_FIND 2016-01-28 09:57:55 +01:00
twinaphex a5e8615091 Create TASK_CTL_INIT 2016-01-28 09:52:28 +01:00
twinaphex b008750f18 Add TASK_CTL_DEINIT 2016-01-28 09:48:47 +01:00
twinaphex 7a5fbc6948 Create TASK_CTL_CHECK 2016-01-28 09:45:14 +01:00
twinaphex b807b89837 Add TASK_CTL_PUSH 2016-01-28 09:42:55 +01:00
twinaphex 0764b65dc4 Add more TASK_CTL commands 2016-01-28 09:38:21 +01:00
twinaphex ebcae85452 Add task_ctl 2016-01-28 09:35:25 +01:00
twinaphex dbff4e52bc Cleanups 2016-01-28 09:33:09 +01:00
twinaphex 9046626256 Cleanup 2016-01-28 09:24:38 +01:00
twinaphex d9d0c0f842 Cleanup 2016-01-28 08:49:39 +01:00
twinaphex 13c54381e4 Set default poll behavior to 2 (late) 2016-01-28 06:51:18 +01:00
twinaphex 6d45804257 zip_file_decompressed - cleanup #2 2016-01-28 06:36:35 +01:00
twinaphex adbaab9794 Simplify zip_file_decompressed 2016-01-28 06:34:31 +01:00
twinaphex b8212ec196 Fix warning on OSX 2016-01-28 06:30:12 +01:00
twinaphex 3eb71faf64 Nits 2016-01-28 06:21:29 +01:00
twinaphex aad3ddc7a5 Move core_poll_type to libretro_version_1.c 2016-01-28 06:20:44 +01:00
twinaphex 49ac60767a Move core variable to libretro_version_1.c 2016-01-28 04:41:54 +01:00
twinaphex 92a1de2e77 Create CORE_CTL_RETRO_SET_INPUT_STATE 2016-01-28 04:39:38 +01:00
twinaphex 277f08022d Create CORE_CTL_RETRO_CHEAT_SET 2016-01-28 04:34:39 +01:00
twinaphex 0d81f669e0 Add CORE_CTL_RETRO_CHEAT_RESET 2016-01-28 04:29:35 +01:00
twinaphex 857618d672 Implement CORE_CTL_RETRO_API_VERSION 2016-01-28 04:26:17 +01:00
twinaphex ab221f96f1 Create CORE_CTL_SET_POLL_TYPE 2016-01-28 04:17:59 +01:00
twinaphex 1cc5bfbc12 use callbacks 2016-01-28 04:13:31 +01:00
twinaphex eb9be6409f Use core callbacks 2016-01-28 04:07:54 +01:00
twinaphex 7f81d7a4a8 Create CORE_CTL_RETRO_SYMBOLS_INIT 2016-01-28 04:03:02 +01:00
twinaphex eb503e0464 Start getting rid of hardcoded core\. references 2016-01-28 03:41:30 +01:00
twinaphex 6e3041e33c Rewrite uninit_libretro_sym 2016-01-28 03:36:14 +01:00
twinaphex 2542e4a04e Use CORE_CTL_* callbacks 2016-01-28 03:22:23 +01:00
twinaphex 957bf3f60c Refactor autosave.c to use new callback 2016-01-28 03:10:47 +01:00
twinaphex 8da2f273a4 (cheevos.c) Use CORE_CTL_RETRO_GET_MEMORY 2016-01-28 03:06:25 +01:00
twinaphex 93651ae340 Use CORE_CTL_RETRO_GET_MEMORY 2016-01-28 02:58:53 +01:00
twinaphex 737fd4268c Refactor CORE_CTL_RETRO_GET_MEMORY 2016-01-28 02:53:43 +01:00
twinaphex 6f0c4e03d5 Create EVENT_CMD_DISK_APPEND_IMAGE 2016-01-27 20:04:34 +01:00
twinaphex 1d47300f0f Cleanup 2016-01-27 19:58:11 +01:00
twinaphex 4e8ad770e6 Cleanups 2016-01-27 19:56:14 +01:00
twinaphex d1b53a14a1 Create RARCH_CTL_SET_SRAM_ENABLE 2016-01-27 19:53:07 +01:00
twinaphex 8fe012afe4 Modify RARCH_CTL_SET_PATHS_REDIRECT 2016-01-27 19:48:27 +01:00
twinaphex 3728240162 Move some code 2016-01-27 19:45:54 +01:00
twinaphex 3b38e2fe4c Move this above init_libretro_sym 2016-01-27 19:30:13 +01:00
twinaphex 7a896596a1 Move this to CORE_CTL_RETRO_DEINIT 2016-01-27 19:25:44 +01:00
twinaphex f6fcb95dea Create CORE_CTL_RETRO_SET_CONTROLLER_PORT_DEVICE 2016-01-27 19:13:15 +01:00
twinaphex 87176df22a Refactor event_init_controllers 2016-01-27 19:07:58 +01:00
twinaphex f63429601e use CORE_CTL_RETRO_GET_MEMORY in more places 2016-01-27 09:31:31 +01:00
twinaphex ae2cf510cd Create CORE_CTL_RETRO_GET_MEMORY 2016-01-27 09:29:18 +01:00
twinaphex e516a64a0c Create CORE_CTL_RETRO_LOAD_GAME 2016-01-27 09:13:26 +01:00
twinaphex 5e3e0bcbe4 Go through callback 2016-01-27 08:59:54 +01:00
twinaphex fef5ecd97b Create CORE_CTL_RETRO_GET_SYSTEM_INFO 2016-01-27 08:58:31 +01:00
twinaphex a9e71b12e1 Cleanup 2016-01-27 08:50:23 +01:00
twinaphex 9ad2e6fa1f Simplify some code in load_content - only do cheevos calls
when content has been successfully loaded
2016-01-27 08:48:19 +01:00
twinaphex d658c1e09b Cleanup 2016-01-27 08:42:52 +01:00
twinaphex 2c3cb61ca8 Move code to libretro_version_1.c 2016-01-27 08:40:18 +01:00
twinaphex 1e044f38ad Move RARCH_CTL_INIT_SYSTEM_AV_INFO to libretro_version_1.c 2016-01-27 08:21:41 +01:00
twinaphex 6a7b2aed5c Simplifications 2016-01-27 08:17:12 +01:00
twinaphex 392fee9023 Create CORE_CTL_VERIFY_API_VERSION 2016-01-27 08:13:54 +01:00
twinaphex 76f068f852 Simplify RARCH_CTL_VERIFY_API_VERSION 2016-01-27 08:11:42 +01:00
twinaphex 1c3bf435e5 Replace other core.retro_serialize/unserialize references 2016-01-27 07:28:03 +01:00
twinaphex fb3b0bd809 (rewind.c) Use new callbacks 2016-01-27 07:23:50 +01:00
twinaphex c89f10d312 (movie.c) Use new callbacks 2016-01-27 07:21:12 +01:00
twinaphex 24d438ccc1 Start using new callbacks 2016-01-27 07:17:53 +01:00
twinaphex dad9b4abf8 Create CORE_CTL_RETRO_SERIALIZE and CORE_CTL_RETRO_UNSERIALIZE 2016-01-27 07:14:06 +01:00
twinaphex 57d19b21b5 Use CORE_CTL_RETRO_SERIALIZE_SIZE everywhere 2016-01-27 07:09:30 +01:00
twinaphex a4bfd9046c Create CORE_CTL_RETRO_SERIALIZE_SIZE 2016-01-27 06:46:59 +01:00
twinaphex 6750d74e46 Cleanup 2016-01-27 05:55:26 +01:00
twinaphex 6958a23b96 Add RETRO_CTL_RETRO_SET_ENVIRONMENT 2016-01-27 05:19:15 +01:00
twinaphex cb78c1c610 Turn retro_ctx into static local variable of core_ctl 2016-01-27 04:54:22 +01:00
twinaphex 0434c907c4 Replace another reference to retro_ctx 2016-01-27 04:51:47 +01:00
twinaphex 6151e1c425 Create CORE_CTL_RETRO_CTX_FRAME_CB and CORE_CTL_RETRO_CTX_POLL_CB 2016-01-27 04:49:38 +01:00
radius 4165c89385 only check for identical paths, not CRC too 2016-01-26 22:10:42 -05:00
twinaphex 5016ebd344 Create CORE_CTL_RETRO_GET_SYSTEM_AV_INFO 2016-01-27 03:40:02 +01:00
twinaphex adcff5b6ec Start creating more CORE_CTL_ callbacks 2016-01-27 03:35:52 +01:00
twinaphex 489b578bf8 rename CORE_CTL_RUN to CORE_CTL_RETRO_RUN 2016-01-27 03:31:42 +01:00
twinaphex d1ffd1f9cc Create CORE_CTL_RUN 2016-01-27 03:21:36 +01:00
twinaphex 4843e76491 Add CORE_CTL_SET_CBS_REWIND 2016-01-27 03:18:18 +01:00
twinaphex ca00274204 Add CORE_CTL_SET_CBS 2016-01-27 03:17:05 +01:00
twinaphex 1a9479ed04 Create core_ctl commands CORE_CTL_INIT / CORE_CTL_DEINIT 2016-01-27 03:14:36 +01:00
twinaphex 348b14f64f Remove unused retro_flush_audio prototype 2016-01-27 03:10:01 +01:00
twinaphex e132115185 Start creating core_ctl 2016-01-27 03:08:49 +01:00
twinaphex d1ac905248 Return 'ret' at end of load_content instead of hardcoded 'true' 2016-01-27 02:40:11 +01:00
twinaphex 34876ef432 Create 'representation' value for Poll Type Behavior setting 2016-01-27 01:54:43 +01:00
twinaphex 326d5d319a Add Poll Type Behavior setting to Input Settings 2016-01-27 01:51:09 +01:00
twinaphex 11a82481c4 Improve explanation 2016-01-27 01:37:52 +01:00
twinaphex e2b322040f Add some notes to retroarch.cfg 2016-01-27 01:33:28 +01:00
twinaphex 6fd1a98f97 Add input_poll_type_behavior 2016-01-27 01:29:53 +01:00
twinaphex 370f2c087f Nit 2016-01-27 01:17:55 +01:00
twinaphex 9ad50f91e8 Add poll-type - can change it only at compile-time right now 2016-01-27 01:16:53 +01:00
twinaphex cce5d3e900 Cleanup dump_to_file_desperate 2016-01-27 00:06:06 +01:00
twinaphex b80b5c7be3 Fix CXX_BUILD 2016-01-26 21:49:23 +01:00
Twinaphex 23b7bdfea6 Blind attempt at fixing analog for netplay 2016-01-26 21:46:59 +01:00
Twinaphex 5b2a9ef0b3 Merge pull request #2677 from fr500/master
avoid adding duplicates to the database
2016-01-26 21:29:25 +01:00
radius 40e2994fb6 remove log message 2016-01-26 15:24:17 -05:00
radius 2af0708047 do not push entries that are already on the database 2016-01-26 15:22:16 -05:00
twinaphex 68ea128cb5 Turn menu_init into static function 2016-01-26 21:04:05 +01:00
twinaphex f533a986c5 Minor nit 2016-01-26 20:41:13 +01:00
Alcaro 6962c6bb11 This shouldn't be an issue anymore, and even if it is, it's a core bug and don't belong here. 2016-01-26 19:52:36 +01:00
twinaphex f15e03816b Take this out, serves no purpose 2016-01-26 19:49:05 +01:00
twinaphex 8d7290b300 Try to use menu GL driver when SDL GL is selected as context driver 2016-01-26 19:41:54 +01:00
twinaphex ff15d708f6 (libretro-db) Take out testlib.so from main Makefile 2016-01-26 09:36:00 +01:00
twinaphex 8527742b73 Create Makefile.lua 2016-01-26 09:34:43 +01:00
twinaphex 15946c21f9 Start moving Lua files to separate dir 2016-01-26 09:32:49 +01:00
twinaphex 5cf576e2da Remove duplicate line 2016-01-26 09:30:51 +01:00
twinaphex d7e75c9192 Simplify strcmp lines 2016-01-26 09:29:17 +01:00
twinaphex ffec5bf83d (libretro-db) Simplify bintree.c 2016-01-26 09:26:34 +01:00
twinaphex 7baa166adc Change this back 2016-01-26 08:41:07 +01:00
twinaphex 767822bb46 Get rid of leiradel's db converter files 2016-01-26 08:36:44 +01:00
twinaphex beb985dbaa Make this code more robust 2016-01-26 08:21:44 +01:00
twinaphex 158a520edb Cut down on some code duplication 2016-01-26 07:31:48 +01:00
twinaphex b73832ce2e Revert "Cleanup code duplication in zip_file_decompressed"
This reverts commit 173c9fd5ca.
2016-01-26 07:16:44 +01:00
twinaphex 173c9fd5ca Cleanup code duplication in zip_file_decompressed 2016-01-26 07:06:38 +01:00
twinaphex fbc3667f86 zip_file_decompressed - fix need_fullpath codepath 2016-01-26 07:01:26 +01:00
twinaphex 754bf4043d Load_content_from_compressed_archive sets new_path - attempt
to pass it to retro_load_game
2016-01-26 06:49:59 +01:00
Twinaphex b333775611 Merge pull request #2674 from aliaspider/master
(libretro_db) update c_converter:
2016-01-26 06:44:58 +01:00
twinaphex e05f04824c Log calls to retro_load_game and also document some other parts of the code 2016-01-26 06:30:28 +01:00
aliaspider 77e22e9a79 (libretro-db) c_converter: merge list entries sharing the same key
instead of overwriting the old ones.
2016-01-26 06:28:34 +01:00
twinaphex b4f2ff0c42 Another C89_BUILD bugfix 2016-01-26 06:02:08 +01:00
twinaphex a4cb739fc7 Fix C89_BUILD 2016-01-26 06:01:00 +01:00
twinaphex c5597d3c9d Cleanups 2016-01-26 05:59:52 +01:00
twinaphex d1d127728d Style nit 2016-01-26 05:56:53 +01:00
twinaphex 41deaa4af8 Style nits 2016-01-26 05:52:43 +01:00
twinaphex 9c4b927b17 Style nits 2016-01-26 05:48:31 +01:00
twinaphex d8fef4df6e Style nits 2016-01-26 05:44:21 +01:00
twinaphex 317dda00ea Respect 80-char width limit 2016-01-26 05:38:40 +01:00
twinaphex f6ca836e25 Cleanups - respect 80-char width 2016-01-26 05:07:37 +01:00
twinaphex 77a21ba283 Cleanups 2016-01-26 05:06:11 +01:00
twinaphex 302e7d0944 Style nits - respect 80-char width 2016-01-26 05:03:41 +01:00
twinaphex d4d6788381 Use sizeof(variable) instead of hardcoded PATH_MAX_LENGTH 2016-01-26 04:58:40 +01:00
twinaphex 425406537c Fix Android crash 2016-01-26 04:29:19 +01:00
aliaspider 35e54b9777 (libretro-db) c_converter: simplify value_provider:
- use hash-key based lookups.
- allow direct editing of the the dat<->rdb mappings.
2016-01-26 03:17:22 +01:00
twinaphex 6cba7d8d91 Cleanups 2016-01-26 02:42:23 +01:00
twinaphex 2716d9da3e Cleanups 2016-01-26 02:39:54 +01:00
twinaphex 24e577750b Cleanups 2016-01-26 02:38:09 +01:00
twinaphex 390b209cba Cleanups 2016-01-26 02:31:10 +01:00
twinaphex 657565f430 Don't use hardcoded PATH_MAX_LENGTH for length 2016-01-26 02:30:33 +01:00
twinaphex 2a9b2d7759 Cut down on duplicated code surrounding game options files 2016-01-26 02:24:59 +01:00
twinaphex 04616522b9 Cleanup action_ok_option_create 2016-01-26 02:21:03 +01:00
twinaphex 8d1aaa4905 Use fill_string_join 2016-01-26 02:07:39 +01:00
aliaspider 46dc864258 (libretro-db) c_converter: refactor creation/deletion of match_key
objects.
2016-01-26 02:02:37 +01:00
twinaphex ec16640e55 (menu_cbs_ok.c) Use sizeof(variable) for fill_pathname_join and friends 2016-01-26 01:47:35 +01:00
twinaphex f89467ccbf Create fill_string_join 2016-01-26 01:46:15 +01:00
twinaphex e386bc4963 Cleanup 2016-01-26 01:27:23 +01:00
twinaphex 5aca126ffe Fix crash when loading from playlist 2016-01-26 01:24:26 +01:00
twinaphex d8f0df794d Prevent strlcpy if menu_path is NULL 2016-01-26 01:20:08 +01:00
twinaphex 07d65c34ad Simplify menu_content.c 2016-01-25 18:28:19 +01:00
twinaphex 0c235f336b Nits 2016-01-25 18:21:48 +01:00
twinaphex c78d3e0fd7 Cleanups 2016-01-25 18:19:19 +01:00
twinaphex e141b17bf4 Nits 2016-01-25 18:18:00 +01:00
twinaphex e5c1d0d8b5 Respect 80-char width length 2016-01-25 18:14:14 +01:00
twinaphex f31a6a76bd Cleanup action_ok_playlist_entry 2016-01-25 18:11:26 +01:00
twinaphex 5f3b583452 Create CONTENT_CTL_LOAD_RAM_FILE and CONTENT_CTL_SAVE_RAM_FILE 2016-01-25 07:15:05 +01:00
twinaphex bb36ad2772 Take out playlist.h header include from database_info.h 2016-01-25 07:06:58 +01:00
twinaphex 9022724bd5 Fix warnings 2016-01-25 07:04:54 +01:00
twinaphex 2c9daee624 Cleanups 2016-01-25 07:03:45 +01:00
twinaphex 65a5c0c32f Cleanups 2016-01-25 07:02:26 +01:00
twinaphex 67fea1076a Get rid of HAVE_FFMPEG inside dynamic.h 2016-01-25 07:00:24 +01:00
twinaphex dede617727 Create static function load_dynamic_core 2016-01-25 06:58:35 +01:00
twinaphex 6596d15d81 Remove some RARCH_CONSOLE ifdefs 2016-01-25 06:55:15 +01:00
twinaphex 37acfe06ee System Information - add dynamic support 2016-01-25 06:49:37 +01:00
twinaphex 0edda872fe Cleanup 2016-01-25 06:41:58 +01:00
twinaphex c003f63622 Cleanup 2016-01-25 06:39:22 +01:00
twinaphex e7e0187c8a Cleanup 2016-01-25 06:34:02 +01:00
twinaphex ce31c2b02a Add header 2016-01-25 06:17:00 +01:00
twinaphex d3338c5d72 Don't ifdef enum 2016-01-25 06:15:23 +01:00
twinaphex 8cc3eb3193 Refine how 'Start Core' works - if a core supports starting
with no content, 'Start Core' will do somethign
2016-01-25 06:10:37 +01:00
twinaphex 7a0daf2cef Cleanups 2016-01-25 05:58:45 +01:00
twinaphex fd94cbdefe Move rarch_main_init_wrap to frontend.c and turn it into
a static function
2016-01-25 05:45:37 +01:00
twinaphex 854937483d Move rarch_playlist_load_content to menu_content.c 2016-01-25 05:43:27 +01:00
twinaphex 4630d625f1 Move rarch_defer_core to menu_content.c and rename it
menu_content_defer_core
2016-01-25 05:38:22 +01:00
twinaphex 58b6499cca Cleanup 2016-01-25 05:33:42 +01:00
twinaphex 7627a6635a Cleanup 2016-01-25 05:32:23 +01:00
twinaphex 4381370f35 menu_content_load - cleanup 2016-01-25 05:31:21 +01:00
twinaphex 22bf74ff37 Start moving code to menu_content.c 2016-01-25 04:44:54 +01:00
twinaphex 9a6cfe9084 Create menu_content.c 2016-01-25 04:32:52 +01:00
twinaphex e92ee4fba7 action_ok_start_core - clear content path 2016-01-25 04:09:11 +01:00
twinaphex 78395c449b rarch_defer_core: cleanups 2016-01-25 03:52:41 +01:00
aliaspider a0d2272e88 (libretro-db) c_converter: use a hash based lookup in get_match_key. 2016-01-25 03:12:48 +01:00
twinaphex 24216cb54c Get rid of RETRO_ENVIRONMENT_EXEC_ESCAPE 2016-01-25 03:07:23 +01:00
twinaphex d71c782459 Start getting rid of RETRO_ENVIRONMENT_SET_LIBRETRO_PATH 2016-01-25 03:04:42 +01:00
twinaphex b7434c6564 Rename to file_archive_decompress_data 2016-01-25 02:52:03 +01:00
twinaphex 5c1bde0d20 Cleanup 2016-01-25 01:21:04 +01:00
twinaphex 4561a2a43c Revert "Cleanups"
This reverts commit 545501afa0.
2016-01-25 01:19:23 +01:00
twinaphex 545501afa0 Cleanups 2016-01-25 01:18:49 +01:00
twinaphex 0c87b100ea Cleanups 2016-01-25 01:17:18 +01:00
twinaphex 7bc6a0a333 (screenshot.c) Cleanups 2016-01-25 01:01:57 +01:00
twinaphex 5e8b075c15 Cleanups 2016-01-25 01:01:01 +01:00
twinaphex 1edfd798d9 read_7zip_file - move comment 2016-01-25 00:57:08 +01:00
twinaphex 61f0a03ead Simplify compressed_7zip_file_list_new 2016-01-25 00:55:16 +01:00
twinaphex 863b5306f8 CLeanups 2016-01-25 00:06:08 +01:00
twinaphex 9459cf6445 Rename zlib_ to file_archive_ 2016-01-24 22:17:11 +01:00
twinaphex 44ec82362e Cleanup 2016-01-24 22:06:01 +01:00
twinaphex 6878aa0844 Turn file_archive_inflate_data_to_file into static function 2016-01-24 22:04:21 +01:00
twinaphex aae1faf76f Move crc32_calculate to file_archive_zlib.c 2016-01-24 21:50:28 +01:00
twinaphex d53a0c5994 Cleanup 2016-01-24 21:36:01 +01:00
twinaphex 6580c817c2 Cleanup 2016-01-24 21:31:47 +01:00
twinaphex 2bc75715f7 Move zlib_deflate_init to file_archive_zlib.c 2016-01-24 21:26:02 +01:00
twinaphex 1a04bb4532 Add stream_decompress_data_to_file_init and stream-decompress_data_to_file_iterate to
file_archive_zlib.c
2016-01-24 21:23:33 +01:00
twinaphex fe1cbe6a5a (file_ops.c) Create stream_backend variable 2016-01-24 21:15:22 +01:00
twinaphex c1364648e7 Cleanup 2016-01-24 21:12:16 +01:00
twinaphex 7130f0c8d8 Move zlib_set_stream to file_archive_zlib 2016-01-24 21:06:53 +01:00
twinaphex 7d29929819 Move file_archive_inflate_init to file_archive_zlib 2016-01-24 20:18:52 +01:00
twinaphex fa00f51e80 Move zlib_deflate_data_to_file to file_archive_zlib.c 2016-01-24 20:15:17 +01:00
twinaphex d1ef6f032e Create stream_compress_free and add it to file_archive_zlib 2016-01-24 20:12:12 +01:00
twinaphex f264d3d29b Move zlib_stream_ functions to file_archive_zlib.c 2016-01-24 20:08:57 +01:00
twinaphex 064c5ffc3a Move zlib_stream_free to file_archive_zlib.c 2016-01-24 20:01:35 +01:00
twinaphex 9a23d95846 Add zlib_stream_new to file_archive_zlib.c 2016-01-24 19:57:31 +01:00
twinaphex 021d8e6af8 Make file_archive_get_default_file_backend public scope 2016-01-24 19:48:25 +01:00
twinaphex 6f3adc900d Style nits 2016-01-24 19:44:18 +01:00
twinaphex c4fa71ecc3 Move functions 2016-01-24 19:29:34 +01:00
twinaphex 3e3b57200a Cleanup 2016-01-24 19:25:30 +01:00
twinaphex 14e389bccf Improve ZLIB_TRANSFER_DEINIT case 2016-01-24 19:16:26 +01:00
twinaphex b4b686fdff Cleanups/style nits 2016-01-24 19:10:02 +01:00
twinaphex 5c2acea38c Do 'free' on handle->stream in case of an error in file_archive_inflate_data_to_file_init 2016-01-24 18:55:50 +01:00
twinaphex cc69cfe6a7 Use zlib_transfer_t * instead of void * 2016-01-24 18:53:37 +01:00
twinaphex cf94c0b6c0 Move file backend back to file_archive.c 2016-01-24 16:18:18 +01:00
twinaphex 5b343c2a32 (RPNG) Update 2016-01-24 07:47:27 +01:00
twinaphex c0047e643e update 2016-01-24 07:46:30 +01:00
twinaphex 44b4ba9a07 Update Griffin 2016-01-24 07:46:11 +01:00
twinaphex 3c2a45d923 Rename file_extract functions 2016-01-24 07:42:46 +01:00
twinaphex 552e78c9bc Rename file_extract to file_archive 2016-01-24 07:29:11 +01:00
twinaphex 5cfc9c1830 (OSX) Buildfix 2016-01-24 07:19:37 +01:00
twinaphex e0ceccc2b2 Remove unzip.c and ioapi.c now that we no longer need it on RA side 2016-01-24 07:05:45 +01:00
twinaphex da48d9d95a Avoid 'variable may be used uninitialized in this function' warning 2016-01-24 06:58:02 +01:00
twinaphex 09e5dc9c50 Cleanup 2016-01-24 06:55:26 +01:00
twinaphex 5c615f18e1 Turn zlib_inflate_init2 into static function 2016-01-24 06:52:14 +01:00
twinaphex 280e10195c Remove zlib_crc32_adjust - reuse zlib_crc32_calculate for this 2016-01-24 06:50:18 +01:00
twinaphex c6f7afbd9a Adjust zlib_crc32_calculate 2016-01-24 06:47:06 +01:00
twinaphex a0e9a4c68e Cleanups 2016-01-24 06:42:57 +01:00
twinaphex 8a254d0480 (Android) Fix build 2016-01-24 06:28:27 +01:00
twinaphex 78feccd0a3 Split up file extract zlib driver code to separate file 2016-01-24 06:18:53 +01:00
Twinaphex 9561332295 Merge pull request #2668 from aliaspider/master
(libretro-db) c_converter: more performance improvements.
2016-01-24 05:52:38 +01:00
aliaspider 032e67bedf nit. 2016-01-24 05:46:52 +01:00
aliaspider f2267db324 (libretro-db) speed-up the binary tree search by using precomputed hash
values when comparing the keys.
2016-01-24 05:45:54 +01:00
twinaphex 458e3a0fad Fix zlib_extract_first_content_file - we now pass a
new string to zlib_extract_first_content_file which will
fill in the extracted first file's path, we then add this
to temporary_content string list
2016-01-24 05:41:41 +01:00
twinaphex f4dfde8c47 Replace this with string_list_append 2016-01-24 05:34:17 +01:00
twinaphex 220b42332d Allocate temporary_content once before initing/loading content 2016-01-24 05:29:30 +01:00
twinaphex 20cf52a316 read_comprssed_file - cleanups 2016-01-24 04:27:20 +01:00
Twinaphex 6a7674dca1 Merge pull request #2667 from aliaspider/master
(libretro-db) c_converter: improve performance when merging multiple .dat files.
2016-01-24 04:21:21 +01:00
twinaphex fd42722c78 No longer need these files now 2016-01-24 04:21:18 +01:00
twinaphex 7d7c29f0f8 Reimplement read_zip_file - no longer depend on unzip.h 2016-01-24 04:18:47 +01:00
aliaspider 7fb86f47de (libretro-db) c_converter: implement a binary search tree, improves
performance when merging multiple dat files considerably.
2016-01-24 03:16:25 +01:00
twinaphex 6da1be9bc9 (file_ops) Rename archive_path to path 2016-01-24 03:11:14 +01:00
twinaphex a6b616e6d1 (file_ops.c) rename relative_path to needle 2016-01-24 03:07:49 +01:00
twinaphex a56f4ba298 cleanup 2016-01-24 01:59:43 +01:00
twinaphex 1745e71088 Add 'Start Core' option 2016-01-24 01:51:05 +01:00
twinaphex 5cd12a106e Add MENU_LABEL_START_CORE/MENU_LABEL_VALUE_START_CORE 2016-01-24 01:34:34 +01:00
twinaphex 23d99495a4 Add TODO/FIXME 2016-01-24 01:31:40 +01:00
twinaphex 77ebc96f37 Cleanup 2016-01-24 01:30:19 +01:00
twinaphex d085dae5bb Cleanups 2016-01-24 00:56:04 +01:00
twinaphex 6f221fb425 Rename menu_common_load_content to rarch_task_push_content_load_default 2016-01-24 00:51:17 +01:00
twinaphex 48317e66b9 Create task_content.c - WIP 2016-01-24 00:40:34 +01:00
twinaphex ec15a43cf1 N/A 2016-01-24 00:33:06 +01:00
aliaspider 4696d5675f (libretro-db) cleanups. 2016-01-24 00:24:56 +01:00
twinaphex 08f6c9c367 Cleanup compressed_file_list_new 2016-01-24 00:13:58 +01:00
twinaphex 9256cd2fbc Start adding ways to extract only one file from a ZIP 2016-01-24 00:12:05 +01:00
twinaphex a3ae0e9a90 Cleanup 2016-01-24 00:06:50 +01:00
twinaphex 2a8d984d89 Cleanups 2016-01-24 00:02:06 +01:00
twinaphex 87e4e5ecfe Cleanup 2016-01-23 23:41:46 +01:00
twinaphex b4956ac7c1 zlib_get_file_list- cleanup 2016-01-23 23:02:16 +01:00
twinaphex 9c131dfaad Cleanup 2016-01-23 23:00:35 +01:00
twinaphex 365b27caac Simplify zip_extract_cb 2016-01-23 22:57:21 +01:00
twinaphex e86f77692d read_compressed_file - cleanup 2016-01-23 22:35:13 +01:00
twinaphex 0b74956abe read_compressed_file - use string_list 2016-01-23 22:33:09 +01:00
twinaphex f4b22f9fdd Cleanup 2016-01-23 22:00:45 +01:00
twinaphex 97e5d5c61b Cleanups 2016-01-23 21:57:14 +01:00
twinaphex 91f7120604 Cleanup 2016-01-23 19:42:05 +01:00
twinaphex 894da665ad Cleanup 2016-01-23 19:40:43 +01:00
twinaphex 2d6142a01e N/A 2016-01-23 19:39:18 +01:00
twinaphex 473e6ff7b8 Call RETRO_ENVIRONMENT_SHUTDOWN if image can't be loaded 2016-01-23 15:45:40 +01:00
Alcaro 3de1e58592 (Imageviewer) React only to freshly pressed inputs. 2016-01-23 15:32:15 +01:00
Alcaro 328ec2cdca Clean this up. 2016-01-23 15:29:41 +01:00
Alcaro a2118e3938 Fix memory leak. 2016-01-23 15:23:44 +01:00
twinaphex 46156cf372 (libretrodb) Silence some warnings 2016-01-23 15:23:45 +01:00
Twinaphex 10026822fe Merge pull request #2666 from aliaspider/master
(libretro-db) add a dat->rdb converter in C.
2016-01-23 14:27:20 +01:00
aliaspider f7c8304dc3 (libretro-db) Makefile: fix the testlib.so target 2016-01-23 07:49:51 +01:00
aliaspider 8f8b123d06 (libretro-db) c_converter: re-enable tests 2016-01-23 06:42:40 +01:00
aliaspider c95205dbd3 (libretro-db) c_converter: add support for merging multiple dat files
into a single rdb file with a match-key.
2016-01-23 06:21:52 +01:00
twinaphex a15f2519a5 Cleanup 2016-01-23 05:10:47 +01:00
twinaphex df972d0fd5 (shader_glsl.c) Uniquely name functions 2016-01-23 04:53:20 +01:00
aliaspider 1fe10855e9 nit. 2016-01-23 04:26:19 +01:00
aliaspider 964f0f7926 (libretro-db) Makefile: add a DEBUG build option 2016-01-23 04:10:19 +01:00
aliaspider 3f66270fcb (libretro-db) c_converter: allow only one instance per key in a map
list.
2016-01-23 04:05:09 +01:00
aliaspider f8273ba5ba (libretro-db) add a dat->rdb converter in C.
still lacks match key support for merging multiple dat files.
2016-01-23 01:51:09 +01:00
aliaspider 86907fb3b7 (libretro-db) test-lib buildfix. 2016-01-23 01:33:44 +01:00
aliaspider 8207ab56c1 (libretro-db) plug memory leak. 2016-01-23 01:25:09 +01:00
aliaspider 3133b67da5 (libretro-db) cleanup Makefile. 2016-01-23 01:07:35 +01:00
aliaspider 7e4def44fd (libretro-db) prevent lua_converter from generating a random output each
run.
2016-01-23 00:57:51 +01:00
twinaphex 55798b0a58 Fix fall-through bug 2016-01-22 20:27:42 +01:00
twinaphex 9acf3e2309 (Imageviewer) Call RETRO_ENVIRONMENT_SET_GEOMETRY after loading image 2016-01-22 16:50:26 +01:00
twinaphex bb679fa9ca Move member around inside global struct 2016-01-22 16:11:10 +01:00
twinaphex 058c3acbdc Divorce content_crc from global struct 2016-01-22 16:09:48 +01:00
twinaphex 11f7735965 Create RARCH_CTL_INIT_SYSTEM_AV_INFO 2016-01-22 15:43:40 +01:00
twinaphex 87bdb34599 Get rid of some unused variables 2016-01-22 15:36:04 +01:00
twinaphex 372d673a26 Rename event_command to event_cmd_ctl - add second parameter 2016-01-22 15:34:43 +01:00
twinaphex 34eccf3d61 Add HAVE_LAKKA ifdef 2016-01-22 14:56:43 +01:00
twinaphex 107cb53b5a Remove unused variable 2016-01-22 14:43:11 +01:00
twinaphex 287fc9dd2c Cleanups 2016-01-22 14:42:23 +01:00
twinaphex c855e0f3d4 Cleanups 2016-01-22 14:41:22 +01:00
Twinaphex 4dd08e6382 Merge pull request #2660 from duduke/master
Reboot Menu Item
2016-01-22 14:39:21 +01:00
twinaphex 9b47e538c6 libretro_get_system_info_lib - report error if dynamic library
could not be loaded
2016-01-22 06:04:52 +01:00
twinaphex c5b13de208 Change default audio output latency to 128ms for Android 2016-01-22 05:00:22 +01:00
twinaphex 346074ee38 (imageviewer) Cut down on some code duplication 2016-01-22 01:58:21 +01:00
twinaphex eb43efb8e7 (imageviewer) Start creating async job queue 2016-01-22 01:52:53 +01:00
Twinaphex 86741a4eca Merge pull request #2664 from simias/resetfix
Don't lose the core-provided hw_render struct when reseting the context
2016-01-21 23:11:27 +01:00
Lionel Flandrin ad6f98dc15 Don't lose the core-provided hw_render struct when reseting the context 2016-01-21 23:06:13 +01:00
duduke 3aca34d3fb Make Reboot and Shutdown MenuItems available for Lakka only 2016-01-21 23:41:58 +02:00
radius 495ee3aaa5 try to fix android input bugs 2016-01-21 16:39:03 -05:00
twinaphex 8c15834c87 (Imageviewer) New controls:
Up   - +5 images, go to last image if wraparound
Down - -5 images, go back to first image if wraparound
2016-01-21 21:57:30 +01:00
twinaphex 076e55a945 Fix extraction of ZIP files 2016-01-21 21:33:52 +01:00
twinaphex df43c1f99b Try to avoid crash in gfx_ctx_get_metrics 2016-01-21 21:27:54 +01:00
twinaphex c66e721782 (imageviewer) Cleanups 2016-01-21 20:13:24 +01:00
twinaphex c4e821c3a1 (Image viewer) Controls:
Left     - Previous Image
Right    - Next Image
Y button - Toggle slideshow
2016-01-21 20:11:03 +01:00
twinaphex 652d94e9ee Move cores/image_core.c 2016-01-21 19:53:52 +01:00
twinaphex 7924823b32 Fix RUNLOOP_CTL_FRONTEND_KEY_EVENT_GET 2016-01-21 19:45:43 +01:00
twinaphex 4995490588 N/A pt. 2 2016-01-21 19:27:48 +01:00
twinaphex bbb7d1ad52 N/A 2016-01-21 19:26:10 +01:00
twinaphex 2af842401b (menu) Cleanups 2016-01-21 19:21:09 +01:00
twinaphex 191ff2e6d0 Cleanups 2016-01-21 19:19:14 +01:00
twinaphex 23d3af9c5a Nit 2016-01-21 19:13:10 +01:00
twinaphex 71df617bee Cleanup 2016-01-21 19:12:05 +01:00
twinaphex 126a492fd5 read_zip_file - cleanups 2016-01-21 04:05:35 +01:00
Twinaphex 6f49139eba (OSX) Buildfix 2016-01-21 04:02:15 +01:00
twinaphex ee74f697cd Rename setting 'Don't automatically start a core' to 'Automatically start core' 2016-01-21 03:56:02 +01:00
twinaphex 112f564a8f Change setting 2016-01-21 03:49:06 +01:00
twinaphex 99fe70a189 Fix crash in RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK 2016-01-21 03:46:43 +01:00
twinaphex f4d3f47a0a Turn config_save_keybinds into static function, if 0 it out since
it is not used right now
2016-01-21 03:43:32 +01:00
twinaphex 42d0c1f213 Turn function into static one 2016-01-21 03:39:05 +01:00
twinaphex 2e6f71ee6b nits 2016-01-21 03:35:06 +01:00
twinaphex ae2f6f06a0 rarch_task_push_dbscan - prevent possible memleaks 2016-01-21 03:25:00 +01:00
twinaphex a187382ecf Nit 2016-01-21 03:23:14 +01:00
twinaphex 89481d6d2e Plug potential memleaks in rarch_task_push_http_transfer 2016-01-21 03:22:17 +01:00
twinaphex 1f039b53f3 (task_http.c) Cleanups/plug possible memory leaks 2016-01-21 03:19:14 +01:00
twinaphex e8d86ef013 Cleanups/indents 2016-01-21 03:16:48 +01:00
twinaphex c9fc8cd7d3 rarch_task_push_decompress - deal with possible memory leaks 2016-01-21 03:14:22 +01:00
twinaphex f9e389ac56 (Makefile.common) Rearrange conditional 2016-01-21 03:11:00 +01:00
twinaphex fbd2e9aa84 Use string_is_equal more 2016-01-21 02:48:00 +01:00
twinaphex 89b7fb5380 (content.c) Create error goto 2016-01-21 02:41:29 +01:00
twinaphex 33c47f3d39 Remove TODO 2016-01-21 02:39:06 +01:00
twinaphex 9095399aa8 (task_decompress.c) Use path_is_directory 2016-01-21 02:36:58 +01:00
twinaphex 25d63c3167 Get rid of some implicit memsets 2016-01-21 02:19:38 +01:00
twinaphex 6bf373a7c7 Divorce frontend_key_event from global variable 2016-01-21 01:52:02 +01:00
Alcaro 0d77ac3977 Fix code style mismatch. 2016-01-21 01:31:38 +01:00
Alcaro 1229ee0f1b Fix C89 build. 2016-01-21 01:27:49 +01:00
Alcaro 79b3794b93 Rewrite this for fewer malloc. 2016-01-21 01:24:29 +01:00
Alcaro c48dee0d7b If strequal checks for NULL, then striequal should too. 2016-01-21 01:09:05 +01:00
Alcaro 79edafc3aa Clean up those functions a bit. 2016-01-21 01:08:37 +01:00
Twinaphex 82dc569497 Simplify sring_is_empty 2016-01-21 01:04:07 +01:00
Twinaphex 447468a39d Change string_is_equal_noncase to just a strcasecmp wrapper for now 2016-01-21 01:00:47 +01:00
Twinaphex 9e2be63b75 Don't bake this in for __MACH__ 2016-01-21 00:56:47 +01:00
radius 89d9336b08 fix some shaders in GL 2016-01-20 18:52:24 -05:00
radius c32a5c8003 add slideshow mode to imageviewer core 2016-01-20 15:40:08 -05:00
twinaphex 63e2d13b8f Create string_is_equal_noncase - try not to use strcasecmp so much 2016-01-20 17:34:19 +01:00
Twinaphex de513211dc Update input_autodetect.c 2016-01-20 13:28:13 +01:00
twinaphex 09f06613ee (rewind.c) Cleanups - turn functions into static functions that were not used outside 2016-01-20 06:42:01 +01:00
twinaphex 644649853f CLeanup 2016-01-20 06:21:46 +01:00
twinaphex 157eb71606 Use string_is_equal more 2016-01-20 06:16:55 +01:00
twinaphex b638b9bee8 Cleanup 2016-01-20 06:11:47 +01:00
twinaphex d45fd36a0b Cleanup 2016-01-20 06:05:49 +01:00
twinaphex da124969fa More string_is_equal 2016-01-20 06:05:19 +01:00
twinaphex 6cb55231d9 use more string_is_equal 2016-01-20 05:21:52 +01:00
twinaphex 16c48fdc86 Start using string_is_equal more 2016-01-20 04:59:39 +01:00
twinaphex 528a03f6f4 Use string_is_equal more 2016-01-20 04:54:17 +01:00
twinaphex 64e43a9935 Start using string_is_equal in more places 2016-01-20 04:14:55 +01:00
twinaphex a767031651 Use string_is_equal in more places 2016-01-20 04:11:25 +01:00
twinaphex 454abdee48 stdstring - create string_is_equal 2016-01-20 04:07:24 +01:00
twinaphex da2ce48fb2 Silence warning 2016-01-20 03:44:01 +01:00
twinaphex e1ab34d884 Cleanups 2016-01-20 03:38:08 +01:00
twinaphex 9017fe8c50 Simplify this code 2016-01-20 03:32:03 +01:00
twinaphex 3abbe15637 Fix 'Dummy on Core Shutdown' setting 2016-01-20 03:31:19 +01:00
twinaphex 6c5b2ff0b5 Turn corrent_core_type into static variable 2016-01-20 03:15:50 +01:00
twinaphex 3190d8aba2 Create RARCH_CTL_IS_PLAIN_CORE 2016-01-20 03:10:52 +01:00
twinaphex d3d4bc3dda Get rid of texture_load/texture_unload callbacks for menu_display_driver 2016-01-20 02:54:55 +01:00
Twinaphex b1b8f2645f (Apple) Buildfix 2016-01-20 00:38:48 +01:00
twinaphex bcf5d3150e (D3D) Buildfix 2016-01-19 23:46:52 +01:00
twinaphex 2b8520f7ab Remove alot of unused variables 2016-01-19 23:46:09 +01:00
twinaphex 1eac61e9a0 Create RARCH_CTL_IS_DUMMY_CORE 2016-01-19 23:44:32 +01:00
twinaphex 01d58f8681 Create RARCH_CTL_IS_INITED, RARCH_CTL_SET_INITED, RARCH_CTL_UNSET_INITED 2016-01-19 23:26:47 +01:00
twinaphex 5643b7d3d8 Add CONTENT_CTL_DOES_NOT_NEED_CONTENT and CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT 2016-01-19 23:15:19 +01:00
twinaphex a5af9b653a Turn global->content.inited into static local variable
and go through content_ctl
2016-01-19 22:57:18 +01:00
twinaphex 748959c8fc Cleanups 2016-01-19 22:52:31 +01:00
twinaphex b2426f30a6 (content.c) Start using string_is_empty 2016-01-19 22:41:15 +01:00
Alcaro 7b848483c9 Ifdef this thing, fixes #55. Again. 2016-01-19 22:34:45 +01:00
twinaphex f3312d191e Cleanups 2016-01-19 22:34:26 +01:00
twinaphex 4726e3cb4f Cleanups - add more actions to content_ctl 2016-01-19 22:33:37 +01:00
twinaphex 40beb7092a (content.c) Add fallthrough 2016-01-19 22:19:33 +01:00
twinaphex 4df0fb4e07 Turn temporary_content into static local variable of content_ctl 2016-01-19 22:17:54 +01:00
twinaphex ae704048bc Create CONTENT_CTL_INIT 2016-01-19 22:15:00 +01:00
twinaphex 2836c9755a Create content_ctl 2016-01-19 22:12:25 +01:00
Twinaphex 8702689aaa Use __MACH__ codepath now in retro_get_cpu_features for all OSX versions (Intel/PowerPC) and iOS in general 2016-01-19 19:04:29 +01:00
twinaphex 30c7494122 retro_get_cpu_features: __MACH__ - use only one len variable 2016-01-19 18:50:47 +01:00
twinaphex e048cfe016 Upon successful completion, 0 is returned for sysctlbyname 2016-01-19 18:45:22 +01:00
twinaphex c4fabd65a1 Try to come up with better detection 2016-01-19 18:44:24 +01:00
twinaphex 2df84f2887 (__MACH__) Re-set 'len' again after usage 2016-01-19 18:36:55 +01:00
twinaphex 310b2674f5 This requires no compile-time ifdefs 2016-01-19 18:33:29 +01:00
twinaphex dbf162db4e (PowerPC Mac) Add Altivec detection 2016-01-19 18:25:41 +01:00
twinaphex 1603ac1783 Take out ifdef around CPU NEON conditional 2016-01-19 18:12:04 +01:00
twinaphex 33b41e9aea (iOS) Check if NEON support is there 2016-01-19 18:04:26 +01:00
duduke 480519a6e0 Helped by Kivutar, added the missing lines to menu_hash_us.c 2016-01-19 19:04:01 +02:00
twinaphex d4102f2816 rename load_content_need_fullpath to load_content_from_compressed_archive 2016-01-19 17:43:37 +01:00
twinaphex 839bf31c2a Rename load_content_dont_need_fullpath to load_content_into_memory 2016-01-19 17:42:14 +01:00
twinaphex 85e6ba128f Move comment in load_content_dont_need_fullpath to appropriate
place
2016-01-19 17:41:14 +01:00
twinaphex e8e58d841f Cleanup init_content_file_extract 2016-01-19 17:34:47 +01:00
twinaphex 7405535f03 Move attr variable to init_content_file_set_attribs 2016-01-19 17:33:06 +01:00
twinaphex 73e97d119d Cleanups 2016-01-19 17:29:25 +01:00
twinaphex ddc3959e42 Simplify init_content_file_set_attribs 2016-01-19 17:27:02 +01:00
twinaphex 86906cf5e3 Cleanups 2016-01-19 17:24:42 +01:00
twinaphex 78d3bc5015 Call content_temporary_free if init_content_file errors out 2016-01-19 17:15:36 +01:00
twinaphex d7375b88e7 Create load_content_append_to_temporary_content 2016-01-19 17:14:57 +01:00
duduke b5591726c3 Modified hash values in menu_hash.h 2016-01-19 15:17:49 +02:00
duduke eecd14086b another stupid mistake... 2016-01-19 10:43:33 +02:00
duduke b284749016 forgot a comma at command_event.h 2016-01-19 10:06:12 +02:00
duduke ffffc50401 Corrected menu hashes by using djb2 util 2016-01-19 08:26:06 +02:00
twinaphex a8ee8ec0cd Put HAVE_ZLIB ifdef around init_content_file_extract 2016-01-19 01:30:28 +01:00
twinaphex e859c70a24 content.c - More cleanups 2016-01-19 01:22:37 +01:00
twinaphex 29ad7620aa load_content - call string_list_new later 2016-01-19 01:14:17 +01:00
twinaphex a79a2d6e1c Some more impicit memset removed 2016-01-19 00:50:15 +01:00
twinaphex c50e303116 (content.c) remove some implicit memsets 2016-01-19 00:47:27 +01:00
twinaphex 25187a52fb Fix error 2016-01-19 00:42:21 +01:00
twinaphex dd30dd84c3 Cleanups 2016-01-19 00:38:34 +01:00
twinaphex 9fce8e0b72 (content.c) More cleanups 2016-01-19 00:34:43 +01:00
twinaphex 6b12059c6e Create init_content_file_extract - cleanup init_content_file
function some more
2016-01-19 00:26:12 +01:00
twinaphex 2b7cef4fd6 Create init_content_file_subsystem 2016-01-19 00:16:49 +01:00
Alcaro 2ffe03f732 Fix creepy type error. 2016-01-18 23:24:22 +01:00
twinaphex b9b1f16d0f Only show 'OPEN_ARCHIVE' if HAVE_COMPRESSION is defined 2016-01-18 23:17:25 +01:00
twinaphex 3f3a305396 (CocoaTouch) Buildfix 2016-01-18 22:15:19 +01:00
twinaphex 0e1d00a85c (CocoaTouch) Cleanup 2016-01-18 22:13:35 +01:00
twinaphex 91de59c7ff (Cocoa) Cleanups 2016-01-18 22:10:16 +01:00
twinaphex cebea56412 Add UI Companion Enable setting 2016-01-18 21:35:09 +01:00
duduke 7de7c98b27 Added a reboot menu item 2016-01-18 21:31:38 +02:00
aliaspider 2ff854177c (WIN32) build fix 2016-01-18 20:03:34 +01:00
Twinaphex 2679ba55e1 Merge pull request #2657 from aliaspider/master
(WIN32) fix runtime availability check for PowerCreateRequest.
2016-01-18 18:11:26 +01:00
aliaspider ee8e05050a (WIN32) fix runtime availability check for PowerCreateRequest. 2016-01-18 18:05:49 +01:00
twinaphex 32d47d7bd2 Correct database paths 2016-01-18 15:29:47 +01:00
Twinaphex c68e824eb9 This AVFoundation code needs to work for both iOS and OSX 2016-01-18 13:19:28 +01:00
Twinaphex 0703aed61d Merge pull request #2654 from pponso1/master
iOS: Refactoring support for background Music.app.
2016-01-18 11:49:17 +01:00
Phillip Ponson 6ca58a4d6e iOS: Refactoring support for background Music.app. 2016-01-17 19:51:28 -06:00
twinaphex 4de1726bf6 Define CGFloat for versions lower or equal to OSX 10.4 2016-01-17 19:58:31 +01:00
459 changed files with 73583 additions and 21868 deletions

No files matched your search

+3
View File
@@ -62,6 +62,9 @@ menu/driverspzarch.c
/media/shaders_glsl/
/obj-w32/
# Ctags
/tags
# Android
/pkg/android/phoenix/obj/
/pkg/android/phoenix/assets/
+3
View File
@@ -0,0 +1,3 @@
[submodule "deps/glslang/glslang"]
path = deps/glslang/glslang
url = git://github.com/KhronosGroup/glslang.git
+4 -2
View File
@@ -60,7 +60,9 @@ endif
endif
CFLAGS += -Wall $(OPTIMIZE_FLAG) $(INCLUDE_DIRS) $(DEBUG_FLAG) -I.
CXXFLAGS := $(CFLAGS) -std=c++98 -D__STDC_CONSTANT_MACROS
APPEND_CFLAGS := $(CFLAGS)
CXXFLAGS += $(APPEND_CFLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS
OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
ifeq ($(CXX_BUILD), 1)
@@ -127,7 +129,7 @@ $(OBJDIR)/%.o: %.c config.h config.mk
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
$(OBJDIR)/%.o: %.cpp config.h config.mk
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
+193 -102
View File
@@ -19,7 +19,7 @@ ifeq ($(HAVE_LIBRETRODB),)
endif
ifeq ($(HAVE_LIBRETRODB), 1)
DEFINES += -DHAVE_LIBRETRODB
DEFINES += -DHAVE_LIBRETRODB
endif
ifeq ($(HAVE_FBO), 1)
@@ -77,12 +77,13 @@ endif
ifneq ($(findstring Linux,$(OS)),)
LIBS += -lrt
OBJ += input/drivers/linuxraw_input.o \
input/common/linux_common.o \
input/common/epoll_common.o \
input/common/linux_common.o \
input/common/epoll_common.o \
input/drivers_joypad/linuxraw_joypad.o \
frontend/drivers/platform_linux.o
endif
ifeq ($(findstring Haiku,$(OS)),)
LIBS += -lm
DEBUG_FLAG = -g
@@ -109,7 +110,7 @@ OBJ += frontend/frontend.o \
ui/drivers/ui_null.o \
libretro_version_1.o \
retroarch.o \
input/input_keyboard.o \
input/input_keyboard.o \
command_event.o \
msg_hash.o \
intl/msg_hash_de.o \
@@ -122,10 +123,12 @@ OBJ += frontend/frontend.o \
intl/msg_hash_pt.o \
intl/msg_hash_us.o \
runloop.o \
tasks/tasks.o \
libretro-common/queues/task_queue.o \
tasks/tasks_internal.o \
tasks/task_content.o \
tasks/task_file_transfer.o \
content.o \
libretro-common/encodings/encoding_utf.o \
libretro-common/encodings/encoding_utf.o \
libretro-common/file/file_list.o \
libretro-common/file/dir_list.o \
libretro-common/file/retro_dirent.o \
@@ -136,7 +139,6 @@ OBJ += frontend/frontend.o \
libretro-common/memmap/memalign.o \
dir_list_special.o \
string_list_special.o \
file_ops.o \
libretro-common/file/nbio/nbio_stdio.o \
libretro-common/file/file_path.o \
file_path_special.o \
@@ -144,7 +146,7 @@ OBJ += frontend/frontend.o \
audio/audio_driver.o \
input/input_driver.o \
input/input_hid_driver.o \
gfx/video_common.o \
gfx/video_coord_array.o \
gfx/video_driver.o \
camera/camera_driver.o \
location/location_driver.o \
@@ -167,7 +169,7 @@ OBJ += frontend/frontend.o \
libretro-common/queues/fifo_buffer.o \
core_options.o \
libretro-common/compat/compat_fnmatch.o \
libretro-common/compat/compat_posix_string.o \
libretro-common/compat/compat_posix_string.o \
cheats.o \
core_info.o \
libretro-common/file/config_file.o \
@@ -184,8 +186,9 @@ OBJ += frontend/frontend.o \
gfx/video_filter.o \
audio/audio_resampler_driver.o \
audio/audio_dsp_filter.o \
audio/drivers_resampler/sinc.o \
audio/drivers_resampler/nearest.o \
audio/drivers_resampler/sinc_resampler.o \
audio/drivers_resampler/nearest_resampler.o \
audio/drivers_resampler/null_resampler.o \
audio/drivers_resampler/cc_resampler.o \
location/drivers/nulllocation.o \
camera/drivers/nullcamera.o \
@@ -200,7 +203,7 @@ OBJ += frontend/frontend.o \
record/record_driver.o \
record/drivers/record_null.o \
performance.o \
verbosity.o
verbosity.o
ifneq ($(HAVE_GETOPT_LONG), 1)
OBJ += libretro-common/compat/compat_getopt.o
@@ -214,11 +217,11 @@ ifneq ($(HAVE_STRL), 1)
OBJ += libretro-common/compat/compat_strl.o
endif
OBJ += gfx/image/image.o
OBJ += gfx/video_texture_image.o
ifeq ($(HAVE_IMAGEVIEWER), 1)
DEFINES += -DHAVE_IMAGEVIEWER
OBJ += cores/image_core.o
OBJ += cores/libretro-imageviewer/image_core.o
endif
# Qt
@@ -229,6 +232,10 @@ OBJ += ui/drivers/ui_qt.o
LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lglu32 -lopengl32 -L./ui/drivers/qt/wrapper/build/release -lwrapper
endif
ifeq ($(HAVE_SSA),1)
LIBS += -lass
endif
# LibretroDB
ifeq ($(HAVE_LIBRETRODB), 1)
@@ -282,7 +289,7 @@ endif
ifeq ($(HAVE_ALSA), 1)
OBJ += audio/drivers/alsa.o \
audio/drivers/alsathread.o
audio/drivers/alsathread.o
LIBS += $(ALSA_LIBS)
DEFINES += $(ALSA_CFLAGS)
endif
@@ -329,6 +336,7 @@ ifeq ($(HAVE_RSOUND), 1)
endif
ifeq ($(HAVE_DSOUND), 1)
HAVE_DIRECTX=1
OBJ += audio/drivers/dsound.o
DEFINES += -DHAVE_DSOUND
LIBS += -ldxguid -ldsound
@@ -343,14 +351,14 @@ endif
# Audio Resamplers
ifeq ($(HAVE_NEON),1)
OBJ += audio/drivers_resampler/sinc_neon.o \
OBJ += audio/drivers_resampler/sinc_resampler_neon.o \
audio/drivers_resampler/cc_resampler_neon.o
# When compiled without this, tries to attempt to compile sinc lerp,
# which will error out
#
# TODO - we need to make quality levels of sinc
# runtime toggleable instead of going by compile-time
# defines
#
# TODO - we need to make quality levels of sinc
# runtime toggleable instead of going by compile-time
# defines
DEFINES += -DSINC_LOWER_QUALITY
endif
@@ -359,8 +367,19 @@ ifeq ($(HAVE_NEON),1)
OBJ += audio/audio_utils_neon.o
endif
HW_CONTEXT_MENU_DRIVERS=$(HAVE_RGUI)
ifeq ($(HW_CONTEXT_MENU_DRIVERS),0)
ifeq ($(HAVE_GL_CONTEXT),1)
HW_CONTEXT_MENU_DRIVERS=1
endif
ifeq ($(HAVE_VULKAN),1)
HW_CONTEXT_MENU_DRIVERS=1
endif
endif
# XMB and MaterialUI are always enabled if supported and not explicitly disabled
ifeq ($(HAVE_RGUI)$(HAVE_GL_CONTEXT), 11)
ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
ifeq ($(HAVE_ZARCH),)
HAVE_ZARCH = 1
endif
@@ -369,12 +388,17 @@ ifeq ($(HAVE_RGUI)$(HAVE_GL_CONTEXT), 11)
HAVE_MATERIALUI = 1
endif
#ifeq ($(HAVE_ZAHNRAD),)
#HAVE_ZAHNRAD = 1
#endif
ifeq ($(HAVE_XMB),)
HAVE_XMB = 1
endif
else
HAVE_ZARCH = 0
HAVE_MATERIALUI = 0
#HAVE_ZAHNRAD = 0
HAVE_XMB = 0
endif
@@ -386,6 +410,13 @@ ifeq ($(HAVE_MATERIALUI), 1)
OBJ += menu/drivers/materialui.o
DEFINES += -DHAVE_MATERIALUI
endif
ifeq ($(HAVE_ZAHNRAD), 1)
OBJ += deps/zahnrad/zahnrad.o
OBJ += menu/drivers/zr_common.o
OBJ += menu/drivers/zr_menu.o
OBJ += menu/drivers/zr.o
DEFINES += -DHAVE_ZAHNRAD
endif
ifeq ($(HAVE_ZARCH), 1)
OBJ += menu/drivers/zarch.o
DEFINES += -DHAVE_ZARCH
@@ -407,7 +438,8 @@ ifeq ($(HAVE_MENU_COMMON), 1)
PSEUDO_NS :=
endif
OBJ += menu/menu_hash.o \
menu/menu_driver.o \
menu/menu_driver.o \
menu/menu_content.o \
menu/intl/menu_hash_de.o \
menu/intl/menu_hash_es.o \
menu/intl/menu_hash_eo.o \
@@ -449,6 +481,8 @@ endif
ifeq ($(UTF8), 1)
DEFINES += -DHAVE_UTF8
OBJ += intl/msg_hash_ru.o
DEFINES += -finput-charset=UTF-8
endif
ifeq ($(HAVE_STB_FONT), 1)
@@ -463,11 +497,11 @@ endif
ifeq ($(HAVE_THREADS), 1)
OBJ += autosave.o \
libretro-common/rthreads/rthreads.o \
libretro-common/rthreads/rsemaphore.o \
libretro-common/rthreads/async_job.o \
gfx/video_thread_wrapper.o \
audio/audio_thread_wrapper.o
libretro-common/rthreads/rthreads.o \
libretro-common/rthreads/rsemaphore.o \
libretro-common/rthreads/async_job.o \
gfx/video_thread_wrapper.o \
audio/audio_thread_wrapper.o
DEFINES += -DHAVE_THREADS
ifeq ($(findstring Haiku,$(OS)),)
LIBS += -lpthread
@@ -478,20 +512,17 @@ ifeq ($(HAVE_COMMAND), 1)
OBJ += command.o
endif
ifeq ($(HAVE_NETWORK_GAMEPAD), 1)
OBJ += remote.o
endif
#Input
ifeq ($(HAVE_WAYLAND), 1)
#OBJ += input/drivers/wayland.o
OBJ += gfx/drivers_context/wayland_ctx.o
DEFINES += $(WAYLAND_CFLAGS)
LIBS += $(WAYLAND_LIBS)
endif
#Input
ifeq ($(HAVE_DINPUT), 1)
LIBS += -ldinput8 -ldxguid -lole32
HAVE_DIRECTX=1
DEFINES += -DHAVE_DINPUT
OBJ += input/drivers/dinput.o \
input/drivers_joypad/dinput_joypad.o
@@ -503,19 +534,36 @@ ifeq ($(HAVE_XINPUT), 1)
input/autoconf/builtin_win.o
endif
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_X11), 1)
OBJ += input/common/input_x11_common.o \
input/drivers/x11_input.o \
input/drivers/x11_input.o \
gfx/common/x11_common.o \
input/drivers_keyboard/keyboard_event_x11.o
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS)
DEFINES += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
ifeq ($(HAVE_XCB),1)
LIBS += -lX11-xcb
endif
ifneq ($(HAVE_GLES), 1)
OBJ += gfx/drivers_context/x_ctx.o
endif
endif
ifeq ($(HAVE_XCB),1)
DEFINES += $(XCB_CFLAGS)
LIBS += $(XCB_LIBS)
endif
ifeq ($(HAVE_XKBCOMMON), 1)
DEFINES += $(XKBCOMMON_CFLAGS)
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
LIBS += $(XKBCOMMON_LIBS)
endif
@@ -523,37 +571,39 @@ ifeq ($(HAVE_UDEV), 1)
DEFINES += $(UDEV_CFLAGS)
LIBS += $(UDEV_LIBS)
OBJ += input/drivers/udev_input.o \
input/common/udev_common.o \
input/drivers_keyboard/keyboard_event_udev.o \
input/drivers_keyboard/keyboard_event_udev.o \
input/drivers_joypad/udev_joypad.o
endif
ifeq ($(HAVE_LIBUSB), 1)
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
LIBS += -lusb-1.0
HAVE_HID = 1
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
LIBS += -lusb-1.0
HAVE_HID = 1
endif
ifeq ($(HAVE_IOHIDMANAGER), 1)
DEFINES += -DHAVE_IOHIDMANAGER
OBJ += input/drivers_hid/iohidmanager_hid.o
HAVE_HID = 1
LIBS += -framework IOKit
DEFINES += -DHAVE_IOHIDMANAGER
OBJ += input/drivers_hid/iohidmanager_hid.o
HAVE_HID = 1
LIBS += -framework IOKit
endif
ifeq ($(HAVE_CORELOCATION), 1)
DEFINES += -DHAVE_CORELOCATION
LIBS += -framework CoreLocation
DEFINES += -DHAVE_CORELOCATION
LIBS += -framework CoreLocation
endif
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_HID
OBJ += input/connect/joypad_connection.o \
DEFINES += -DHAVE_HID
OBJ += input/connect/joypad_connection.o \
input/connect/connect_ps3.o \
input/connect/connect_ps4.o \
input/connect/connect_wii.o \
input/connect/connect_wiiupro.o
input/connect/connect_nesusb.o \
input/connect/connect_snesusb.o \
input/connect/connect_wiiupro.o \
input/connect/connect_wiiugca.o
endif
ifeq ($(HAVE_PARPORT), 1)
@@ -571,8 +621,15 @@ endif
OBJ += gfx/video_context_driver.o \
gfx/drivers_context/gfx_null_ctx.o \
gfx/video_state_tracker.o \
libretro-common/gfx/math/matrix_4x4.o \
libretro-common/gfx/math/matrix_3x3.o
libretro-common/gfx/math/matrix_4x4.o \
libretro-common/gfx/math/matrix_3x3.o
ifeq ($(HAVE_KMS), 1)
HAVE_AND_WILL_USE_DRM = 1
OBJ += gfx/drivers_context/drm_ctx.o
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
endif
ifeq ($(HAVE_GL_CONTEXT), 1)
DEFINES += -DHAVE_OPENGL -DHAVE_GLSL
@@ -580,16 +637,9 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
gfx/common/gl_common.o \
gfx/drivers_font/gl_raster_font.o \
libretro-common/glsym/rglgen.o
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_gl.o
endif
ifeq ($(HAVE_KMS), 1)
HAVE_AND_WILL_USE_DRM = 1
OBJ += gfx/drivers_context/drm_egl_ctx.o
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_gl.o
endif
ifeq ($(HAVE_VIDEOCORE), 1)
@@ -620,16 +670,8 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifneq ($(HAVE_GLES), 1)
OBJ += gfx/drivers_context/glx_ctx.o
endif
endif
ifeq ($(HAVE_WAYLAND), 1)
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/drivers_context/wayland_ctx.o
endif
endif
ifeq ($(HAVE_GLES), 1)
LIBS += $(GLES_LIBS)
@@ -641,7 +683,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
else
DEFINES += -DHAVE_GL_SYNC
OBJ += libretro-common/glsym/glsym_gl.o
GL_LIBS := -lGL
GL_LIBS := -lGL
ifeq ($(OSX), 1)
GL_LIBS := -framework OpenGL
OBJ += gfx/drivers_context/cgl_ctx.o
@@ -649,7 +691,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
GL_LIBS := -lopengl32 -lgdi32 -lcomdlg32 -lcomctl32
OBJ += gfx/drivers_context/wgl_ctx.o
endif
LIBS += $(GL_LIBS)
LIBS += $(GL_LIBS)
endif
OBJ += gfx/drivers_shader/shader_glsl.o
@@ -657,7 +699,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
endif
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/common/egl_common.o
OBJ += gfx/common/egl_common.o
endif
ifeq ($(HAVE_SDL2), 1)
@@ -693,6 +735,46 @@ ifeq ($(HAVE_SDL2), 1)
HAVE_SDL = 0
endif
ifeq ($(HAVE_VULKAN), 1)
ifeq ($(platform), win)
GLSLANG_PLATFORM := Windows
else
GLSLANG_PLATFORM := Unix
endif
GLSLANG_SOURCES := \
$(wildcard deps/glslang/*.cpp) \
$(wildcard deps/glslang/glslang/SPIRV/*.cpp) \
$(wildcard deps/glslang/glslang/glslang/GenericCodeGen/*.cpp) \
$(wildcard deps/glslang/glslang/OGLCompilersDLL/*.cpp) \
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/*.cpp) \
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
$(wildcard deps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
DEFINES += \
-Ideps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM) \
-Ideps/glslang/glslang \
-Ideps/glslang/glslang/glslang/MachineIndependent \
-Ideps/glslang/glslang/glslang/Public \
-Ideps/glslang/glslang/SPIRV \
-Ideps/glslang
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -I./gfx/include/vulkan
CFLAGS += -I./gfx/include/vulkan
GLSLANG_OBJ := $(GLSLANG_SOURCES:.cpp=.o)
OBJ += gfx/drivers/vulkan.o \
gfx/common/vulkan_common.o \
gfx/drivers_font/vulkan_raster_font.o \
gfx/drivers_shader/shader_vulkan.o \
gfx/drivers_shader/glslang_util.o \
$(GLSLANG_OBJ)
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_vulkan.o
endif
LIBS += -lstdc++
endif
ifeq ($(HAVE_OMAP), 1)
OBJ += gfx/drivers/omap_gfx.o
endif
@@ -702,16 +784,16 @@ ifeq ($(HAVE_EXYNOS), 1)
memory/neon/memcpy-neon.o
LIBS += $(DRM_LIBS) $(EXYNOS_LIBS)
DEFINES += $(DRM_CFLAGS) $(EXYNOS_CFLAGS)
HAVE_AND_WILL_USE_DRM = 1
HAVE_AND_WILL_USE_DRM = 1
endif
ifeq ($(HAVE_AND_WILL_USE_DRM), 1)
OBJ += gfx/common/drm_common.o
OBJ += gfx/common/drm_common.o
endif
ifeq ($(HAVE_DISPMANX), 1)
OBJ += gfx/drivers/dispmanx_gfx.o
HAVE_VIDEOCORE = 1
HAVE_VIDEOCORE = 1
LIBS += $(DISPMANX_LIBS)
DEFINES += $(DISPMANX_CFLAGS)
endif
@@ -733,14 +815,8 @@ ifeq ($(HAVE_XVIDEO), 1)
DEFINES += $(XVIDEO_CFLAGS)
endif
ifeq ($(HAVE_XSHM), 1)
OBJ += gfx/drivers/xshm.o
LIBS += $(XSHM_LIBS)
DEFINES += $(XSHM_CFLAGS)
endif
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o
LIBS += $(CG_LIBS)
endif
@@ -752,12 +828,13 @@ ifeq ($(HAVE_D3D9), 1)
gfx/common/d3d_common.o \
gfx/drivers_font/d3d_w32_font.o \
gfx/drivers_context/d3d_ctx.o
HAVE_DIRECTX=1
DEFINES += -DHAVE_D3D -DHAVE_D3D9
LIBS += -ld3d9 -ld3dx9 -ldxguid
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_d3d.o
endif
OBJ += menu/drivers_display/menu_display_d3d.o
endif
ifeq ($(HAVE_CG), 1)
LIBS += -lcgD3D9
@@ -797,22 +874,23 @@ endif
ifeq ($(HAVE_ZLIB), 1)
OBJ += libretro-common/file/file_extract.o \
OBJ += libretro-common/file/file_archive.o \
libretro-common/file/file_archive_zlib.o \
tasks/task_decompress.o
OBJ += $(ZLIB_OBJS)
DEFINES += -DHAVE_ZLIB
HAVE_RPNG = 1
HAVE_RPNG = 1
HAVE_COMPRESSION = 1
ifeq ($(WANT_ZLIB), 1)
DEFINES += -DWANT_ZLIB
else
LIBS += -lz
HAVE_ZLIB_DEFLATE = 1
HAVE_ZLIB_DEFLATE = 1
endif
endif
ifdef HAVE_RPNG
DEFINES += -DHAVE_RPNG
DEFINES += -DHAVE_RPNG
endif
ifeq ($(HAVE_RPNG), 1)
@@ -841,13 +919,9 @@ ifeq ($(WANT_ZLIB),1)
deps/zlib/inftrees.o \
deps/zlib/trees.o \
deps/zlib/uncompr.o \
deps/zlib/zutil.o \
deps/zlib/ioapi.o \
deps/zlib/unzip.o
deps/zlib/zutil.o
else
ifeq ($(HAVE_ZLIB),1)
ZLIB_OBJS = deps/zlib/unzip.o \
deps/zlib/ioapi.o
OBJ += $(ZLIB_OBJS)
HAVE_ZLIB_DEFLATE = 1
endif
@@ -869,12 +943,21 @@ endif
ifeq ($(HAVE_NETWORKING), 1)
DEFINES += -DHAVE_NETWORKING
OBJ += libretro-common/net/net_compat.o \
libretro-common/net/net_http.o \
net_http_special.o \
tasks/task_http.o
libretro-common/net/net_http.o \
net_http_special.o \
tasks/task_http.o
ifneq ($(HAVE_SOCKET_LEGACY),1)
OBJ += libretro-common/net/net_ifinfo.o
endif
ifeq ($(WANT_IFADDRS), 1)
DEFINES += -DWANT_IFADDRS
OBJ += libretro-common/compat/compat_ifaddrs.o
endif
ifneq ($(findstring Win32,$(OS)),)
LIBS += -lws2_32
LIBS += -lws2_32 -liphlpapi
endif
# Netplay
@@ -885,13 +968,17 @@ ifeq ($(HAVE_NETWORKING), 1)
endif
# Retro Achievements (also depends on threads)
ifeq ($(HAVE_CHEEVOS), 1)
ifeq ($(HAVE_THREADS), 1)
DEFINES += -DHAVE_CHEEVOS
OBJ += cheevos.o libretro-common/utils/md5.o
endif
endif
ifeq ($(HAVE_NETWORK_GAMEPAD), 1)
OBJ += remote.o
endif
endif
ifneq ($(findstring Win32,$(OS)),)
@@ -917,16 +1004,20 @@ ifeq ($(HAVE_FFMPEG), 1)
cores/libretro-ffmpeg/ffmpeg_core.o
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS)
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS)
DEFINES += -DHAVE_FFMPEG -Iffmpeg
DEFINES += -DHAVE_FFMPEG -Iffmpeg
endif
ifeq ($(HAVE_COMPRESSION), 1)
DEFINES += -DHAVE_COMPRESSION
endif
#ifeq ($(HAVE_DIRECTX), 1)
#$DEFINES += -I"$(DXSDK_DIR)/Include"
#endif
ifeq ($(HAVE_COCOA),1)
DEFINES += -DHAVE_MAIN
OBJ += input/drivers/cocoa_input.o \
DEFINES += -DHAVE_MAIN
OBJ += input/drivers/cocoa_input.o \
input/drivers_keyboard/keyboard_event_apple.o \
ui/drivers/ui_cocoa.o \
ui/drivers/cocoa/cocoa_common.o \
-2
View File
@@ -281,8 +281,6 @@ CFLAGS += -I. -Ideps/zlib -Ideps/7zip -Ilibretro-common/include
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE -DSINC_LOWEST_QUALITY
CFLAGS += -DHAVE_GRIFFIN=1 -DHAVE_FILTERS_BUILTIN -DHAVE_MENU -DHAVE_RGUI
CFLAGS += -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_BUILTIN_AUTOCONFIG
#-DHAVE_LIBRETRO_MANAGEMENT -DWANT_RPNG -DHAVE_7ZIP
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
+1 -8
View File
@@ -137,7 +137,6 @@ ifeq ($(platform), wii)
HAVE_WIIUSB_HID := 1
HAVE_RARCH_EXEC := 1
HAVE_RSOUND := 1
HAVE_LIBRETRO_MANAGEMENT := 1
APP_BOOTER_DIR = wii/app_booter
PLATOBJS := $(APP_BOOTER_DIR)/app_booter.binobj
@@ -185,7 +184,6 @@ else ifeq ($(platform), psp1)
LDFLAGS += -Wl,-q
BUILD_PRX = 1
HAVE_LIBRETRO_MANAGEMENT := 1
HAVE_RPNG := 1
HAVE_KERNEL_PRX := 1
RARCH_CONSOLE = 1
@@ -207,14 +205,13 @@ else ifeq ($(platform), vita)
-lSceSysmodule_stub -lSceCtrl_stub -lSceAudio_stub -lUVLoader_stub \
-lScePower_stub -lSceRtc_stub -lSceCommonDialog_stub -lfreetype -lz -lm -lc -lpng
PLATOBJS += audio/audio_utils_neon.o audio/drivers_resampler/sinc_neon.o \
PLATOBJS += audio/audio_utils_neon.o audio/drivers_resampler/sinc_resampler_neon.o \
audio/drivers_resampler/cc_resampler_neon.o
LIBDIRS += -L.
LDFLAGS += -Wl,-q
HAVE_FILTERS_BUILTIN := 1
HAVE_LIBRETRO_MANAGEMENT := 1
HAVE_BUILTIN_AUTOCONFIG := 1
HAVE_RPNG := 1
HAVE_ZLIB := 1
@@ -245,10 +242,6 @@ ifeq ($(platform), vita)
CFLAGS += -DHAVE_SOCKET_LEGACY
endif
ifeq ($(HAVE_LIBRETRO_MANAGEMENT), 1)
CFLAGS += -DHAVE_LIBRETRO_MANAGEMENT
endif
ifeq ($(HAVE_KERNEL_PRX), 1)
CFLAGS += -DHAVE_KERNEL_PRX
endif
+1 -1
View File
@@ -10,7 +10,7 @@ TARGET := retroarch-pandora
LDDIRS = -L. -L$(PNDSDK)/usr/lib
INCDIRS = -I. -I$(PNDSDK)/usr/include
OBJ = griffin/griffin.o audio/resamplers/sinc_neon.o audio/audio_utils_neon.o
OBJ = griffin/griffin.o audio/resamplers/sinc_resampler_neon.o audio/audio_utils_neon.o
LDFLAGS = -L$(PNDSDK)/usr/lib -Wl,-rpath,$(PNDSDK)/usr/lib
LIBS = -lGLESv2 -lEGL -ldl -lm -lpthread -lrt -lasound
+2 -2
View File
@@ -68,7 +68,7 @@ ifeq ($(HAVE_RLAUNCH), 1)
DEFINES += -DHAVE_RLAUNCH
endif
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_MATERIALUI -DHAVE_XMB -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_STB_FONT
DEFINES += -DHAVE_MENU -DHAVE_RGUI -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY
ifeq ($(HAVE_GCMGL), 1)
DEFINES += -DHAVE_GCMGL
@@ -106,7 +106,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LIBRETRODB -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG
ifeq ($(DEBUG), 1)
PPU_OPTIMIZE_LV := -O0 -g
+1 -1
View File
@@ -104,7 +104,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l
PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_OVERLAY -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=0 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
ifeq ($(DEBUG), 1)
PPU_OPTIMIZE_LV := -O0 -g
+1 -1
View File
@@ -23,7 +23,7 @@ INCDIR = deps/zlib deps/7zip libretro-common/include
CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math
ASFLAGS = $(CFLAGS)
RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LIBRETRO_MANAGEMENT -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DWANT_RPNG -DSINC_LOWEST_QUALITY -DHAVE_BUILTIN_AUTOCONFIG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP
RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DWANT_RPNG -DSINC_LOWEST_QUALITY -DHAVE_BUILTIN_AUTOCONFIG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP
LIBDIR =
LDFLAGS =
+3 -34
View File
@@ -1,5 +1,4 @@
TARGET = retroarch.exe
JTARGET = tools/retroarch-joyconfig.exe
HAVE_DINPUT = 1
HAVE_XAUDIO = 1
@@ -84,9 +83,7 @@ OBJDIR := obj-w32
OS := Win32
OBJ :=
JOYCONFIG_OBJ :=
LIBS := -lm
JOYCONFIG_LIBS :=
DEFINES := -I. -Ilibretro-common/include -DRARCH_INTERNAL -DHAVE_OVERLAY
LDFLAGS := -L. -static-libgcc
@@ -137,11 +134,10 @@ else
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
RARCH_JOYCONFIG_OBJ := $(addprefix $(OBJDIR)/,$(JOYCONFIG_OBJ))
all: $(TARGET) $(JTARGET)
all: $(TARGET)
-include $(RARCH_OBJ:.o=.d) $(RARCH_JOYCONFIG_OBJ:.o=.d)
-include $(RARCH_OBJ:.o=.d)
$(TARGET): $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
@@ -170,37 +166,10 @@ $(OBJDIR)/%.o: %.rc $(HEADERS)
@$(if $(Q), $(shell echo echo WINDRES $<),)
$(Q)$(WINDRES) -o $@ $<
$(JTARGET): $(RARCH_JOYCONFIG_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
ifeq ($(CXX_BUILD), 1)
$(Q)$(CXX) -o $@ $(RARCH_JOYCONFIG_OBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JOYCONFIG_LIBS)
else
$(Q)$(CC) -o $@ $(RARCH_JOYCONFIG_OBJ) -ldxguid -ldinput8 -lole32 $(LDFLAGS) $(JOYCONFIG_LIBS)
endif
clean:
rm -rf $(OBJDIR)
rm -f $(TARGET)
rm -f *.d
rm -f tools/retroarch-joyconfig.exe
dist_x86: all
zip -r retroarch-win32-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
dist_x86_64: all
zip -r retroarch-win64-1.0.zip $(TARGET) $(JTARGET) retroarch.cfg
libs_x86:
wget http://themaister.net/retroarch-dl/RetroArch-win32-libs.zip
unzip RetroArch-win32-libs.zip
wget http://themaister.net/retroarch-dl/RetroArch-win32-headers.zip
unzip RetroArch-win32-headers.zip
libs_x86_64:
wget http://themaister.net/retroarch-dl/RetroArch-win64-libs.zip
unzip RetroArch-win64-libs.zip
wget http://themaister.net/retroarch-dl/RetroArch-win64-headers.zip
unzip RetroArch-win64-headers.zip
.PHONY: all install uninstall clean dist_x86 dist_x86_64 libs_x86 libs_x86_64
.PHONY: all install uninstall clean
+8 -2
View File
@@ -55,6 +55,7 @@ RetroArch has been ported to the following platforms outside PC:
- Xbox 360 (Libxenon/XeXDK)
- Xbox 1
- Wii, Gamecube (Libogc)
- Nintendo 3DS
- Raspberry Pi
- Android
- iOS
@@ -62,9 +63,14 @@ RetroArch has been ported to the following platforms outside PC:
## Dependencies (PC)
On Windows, RetroArch can run with only Win32 as dependency. On Linux, you need:
There are no true hard dependencies per se.
- GL headers
On Windows, RetroArch can run with only Win32 as dependency.
On Linux, there are no true dependencies. For optimal usage, the
following dependencies come as recommended:
- GL headers / Vulkan headers
- X11 headers and libs, or EGL/KMS/GBM
OSX port of RetroArch requires latest versions of XCode to build.
+246 -169
View File
@@ -31,6 +31,10 @@
#include "../verbosity.h"
#include "../string_list_special.h"
#ifdef HAVE_NETPLAY
#include "../netplay/netplay.h"
#endif
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
#endif
@@ -40,33 +44,51 @@ typedef struct audio_driver_input_data
float *data;
size_t data_ptr;
size_t chunk_size;
size_t nonblock_chunk_size;
size_t block_chunk_size;
struct
{
size_t size;
size_t nonblock_size;
size_t block_size;
} chunk;
double src_ratio;
float in_rate;
struct
{
float input;
bool control;
struct
{
double original;
double current;
} source_ratio;
} audio_rate;
bool use_float;
float *outsamples;
int16_t *conv_outsamples;
int16_t *rewind_buf;
size_t rewind_ptr;
size_t rewind_size;
struct
{
int16_t *buf;
size_t ptr;
size_t size;
} rewind;
rarch_dsp_filter_t *dsp;
bool rate_control;
double orig_src_ratio;
size_t driver_buffer_size;
float volume_gain;
struct retro_audio_callback audio_callback;
unsigned buffer_free_samples[AUDIO_BUFFER_FREE_SAMPLES_COUNT];
uint64_t buffer_free_samples_count;
struct
{
float *buf;
int16_t *conv_buf;
} output_samples;
struct
{
unsigned buf[AUDIO_BUFFER_FREE_SAMPLES_COUNT];
uint64_t count;
} free_samples;
} audio_driver_input_data_t;
static const audio_driver_t *audio_drivers[] = {
@@ -131,12 +153,10 @@ static const audio_driver_t *audio_drivers[] = {
&audio_null,
NULL,
};
static const rarch_resampler_t *audio_driver_resampler;
static void *audio_driver_resampler_data;
static const audio_driver_t *current_audio;
static void *audio_driver_context_audio_data;
static audio_driver_input_data_t audio_driver_data;
static const audio_driver_t *current_audio = NULL;
static void *audio_driver_context_audio_data = NULL;
/**
* compute_audio_buffer_statistics:
@@ -148,22 +168,25 @@ static void compute_audio_buffer_statistics(void)
{
unsigned i, low_water_size, high_water_size, avg, stddev;
float avg_filled, deviation;
uint64_t accum = 0, accum_var = 0;
unsigned low_water_count = 0, high_water_count = 0;
unsigned samples = min(audio_driver_data.buffer_free_samples_count,
uint64_t accum = 0;
uint64_t accum_var = 0;
unsigned low_water_count = 0;
unsigned high_water_count = 0;
unsigned samples = MIN(
audio_driver_data.free_samples.count,
AUDIO_BUFFER_FREE_SAMPLES_COUNT);
if (samples < 3)
return;
for (i = 1; i < samples; i++)
accum += audio_driver_data.buffer_free_samples[i];
accum += audio_driver_data.free_samples.buf[i];
avg = accum / (samples - 1);
for (i = 1; i < samples; i++)
{
int diff = avg - audio_driver_data.buffer_free_samples[i];
int diff = avg - audio_driver_data.free_samples.buf[i];
accum_var += diff * diff;
}
@@ -176,9 +199,9 @@ static void compute_audio_buffer_statistics(void)
for (i = 1; i < samples; i++)
{
if (audio_driver_data.buffer_free_samples[i] >= low_water_size)
if (audio_driver_data.free_samples.buf[i] >= low_water_size)
low_water_count++;
else if (audio_driver_data.buffer_free_samples[i] <= high_water_size)
else if (audio_driver_data.free_samples.buf[i] <= high_water_size)
high_water_count++;
}
@@ -243,14 +266,15 @@ static bool uninit_audio(void)
audio_driver_context_audio_data = NULL;
}
if (audio_driver_data.conv_outsamples)
free(audio_driver_data.conv_outsamples);
audio_driver_data.conv_outsamples = NULL;
audio_driver_data.data_ptr = 0;
if (audio_driver_data.output_samples.conv_buf)
free(audio_driver_data.output_samples.conv_buf);
audio_driver_data.output_samples.conv_buf = NULL;
audio_driver_data.data_ptr = 0;
if (audio_driver_data.rewind_buf)
free(audio_driver_data.rewind_buf);
audio_driver_data.rewind_buf = NULL;
if (audio_driver_data.rewind.buf)
free(audio_driver_data.rewind.buf);
audio_driver_data.rewind.buf = NULL;
audio_driver_data.rewind.size = 0;
if (!settings->audio.enable)
{
@@ -258,25 +282,24 @@ static bool uninit_audio(void)
return false;
}
rarch_resampler_freep(&audio_driver_resampler,
&audio_driver_resampler_data);
audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_DEINIT, NULL);
if (audio_driver_data.data)
free(audio_driver_data.data);
audio_driver_data.data = NULL;
if (audio_driver_data.outsamples)
free(audio_driver_data.outsamples);
audio_driver_data.outsamples = NULL;
if (audio_driver_data.output_samples.buf)
free(audio_driver_data.output_samples.buf);
audio_driver_data.output_samples.buf = NULL;
event_command(EVENT_CMD_DSP_FILTER_DEINIT);
event_cmd_ctl(EVENT_CMD_DSP_FILTER_DEINIT, NULL);
compute_audio_buffer_statistics();
return true;
}
static bool init_audio(void)
static bool init_audio(bool audio_cb_inited)
{
size_t outsamples_max, max_bufsamples = AUDIO_CHUNK_SIZE_NONBLOCKING * 2;
settings_t *settings = config_get_ptr();
@@ -288,25 +311,25 @@ static bool init_audio(void)
settings->slowmotion_ratio;
/* Used for recording even if audio isn't enabled. */
retro_assert(audio_driver_data.conv_outsamples =
retro_assert(audio_driver_data.output_samples.conv_buf =
(int16_t*)malloc(outsamples_max * sizeof(int16_t)));
if (!audio_driver_data.conv_outsamples)
if (!audio_driver_data.output_samples.conv_buf)
goto error;
audio_driver_data.block_chunk_size = AUDIO_CHUNK_SIZE_BLOCKING;
audio_driver_data.nonblock_chunk_size = AUDIO_CHUNK_SIZE_NONBLOCKING;
audio_driver_data.chunk_size = audio_driver_data.block_chunk_size;
audio_driver_data.chunk.block_size = AUDIO_CHUNK_SIZE_BLOCKING;
audio_driver_data.chunk.nonblock_size = AUDIO_CHUNK_SIZE_NONBLOCKING;
audio_driver_data.chunk.size = audio_driver_data.chunk.block_size;
/* Needs to be able to hold full content of a full max_bufsamples
* in addition to its own. */
retro_assert(audio_driver_data.rewind_buf = (int16_t*)
retro_assert(audio_driver_data.rewind.buf = (int16_t*)
malloc(max_bufsamples * sizeof(int16_t)));
if (!audio_driver_data.rewind_buf)
if (!audio_driver_data.rewind.buf)
goto error;
audio_driver_data.rewind_size = max_bufsamples;
audio_driver_data.rewind.size = max_bufsamples;
if (!settings->audio.enable)
{
@@ -316,10 +339,12 @@ static bool init_audio(void)
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
#ifdef HAVE_THREADS
if (audio_driver_data.audio_callback.callback)
if (audio_cb_inited)
{
RARCH_LOG("Starting threaded audio driver ...\n");
if (!rarch_threaded_audio_init(&current_audio, &audio_driver_context_audio_data,
if (!rarch_threaded_audio_init(
&current_audio,
&audio_driver_context_audio_data,
*settings->audio.device ? settings->audio.device : NULL,
settings->audio.out_rate, settings->audio.latency,
current_audio))
@@ -331,9 +356,10 @@ static bool init_audio(void)
else
#endif
{
audio_driver_context_audio_data = current_audio->init(*settings->audio.device ?
settings->audio.device : NULL,
settings->audio.out_rate, settings->audio.latency);
audio_driver_context_audio_data =
current_audio->init(*settings->audio.device ?
settings->audio.device : NULL,
settings->audio.out_rate, settings->audio.latency);
}
if (!audio_driver_context_audio_data)
@@ -343,29 +369,29 @@ static bool init_audio(void)
}
audio_driver_data.use_float = false;
if (audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL) && current_audio->use_float(audio_driver_context_audio_data))
if ( audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
&& current_audio->use_float(audio_driver_context_audio_data))
audio_driver_data.use_float = true;
if (!settings->audio.sync && audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
{
event_command(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE);
audio_driver_data.chunk_size = audio_driver_data.nonblock_chunk_size;
event_cmd_ctl(EVENT_CMD_AUDIO_SET_NONBLOCKING_STATE, NULL);
audio_driver_data.chunk.size = audio_driver_data.chunk.nonblock_size;
}
if (audio_driver_data.in_rate <= 0.0f)
if (audio_driver_data.audio_rate.input <= 0.0f)
{
/* Should never happen. */
RARCH_WARN("Input rate is invalid (%.3f Hz). Using output rate (%u Hz).\n",
audio_driver_data.in_rate, settings->audio.out_rate);
audio_driver_data.in_rate = settings->audio.out_rate;
audio_driver_data.audio_rate.input, settings->audio.out_rate);
audio_driver_data.audio_rate.input = settings->audio.out_rate;
}
audio_driver_data.orig_src_ratio = audio_driver_data.src_ratio =
(double)settings->audio.out_rate / audio_driver_data.in_rate;
audio_driver_data.audio_rate.source_ratio.original =
audio_driver_data.audio_rate.source_ratio.current =
(double)settings->audio.out_rate / audio_driver_data.audio_rate.input;
if (!rarch_resampler_realloc(&audio_driver_resampler_data,
&audio_driver_resampler,
settings->audio.resampler, audio_driver_data.orig_src_ratio))
if (!audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_INIT, NULL))
{
RARCH_ERR("Failed to initialize resampler \"%s\".\n",
settings->audio.resampler);
@@ -381,16 +407,16 @@ static bool init_audio(void)
audio_driver_data.data_ptr = 0;
retro_assert(settings->audio.out_rate <
audio_driver_data.in_rate * AUDIO_MAX_RATIO);
retro_assert(audio_driver_data.outsamples = (float*)
audio_driver_data.audio_rate.input * AUDIO_MAX_RATIO);
retro_assert(audio_driver_data.output_samples.buf = (float*)
malloc(outsamples_max * sizeof(float)));
if (!audio_driver_data.outsamples)
if (!audio_driver_data.output_samples.buf)
goto error;
audio_driver_data.rate_control = false;
audio_driver_data.audio_rate.control = false;
if (
!audio_driver_data.audio_callback.callback
!audio_cb_inited
&& audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
&& settings->audio.rate_control
)
@@ -401,21 +427,21 @@ static bool init_audio(void)
{
audio_driver_data.driver_buffer_size =
current_audio->buffer_size(audio_driver_context_audio_data);
audio_driver_data.rate_control = true;
audio_driver_data.audio_rate.control = true;
}
else
RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n");
}
event_command(EVENT_CMD_DSP_FILTER_INIT);
event_cmd_ctl(EVENT_CMD_DSP_FILTER_INIT, NULL);
audio_driver_data.buffer_free_samples_count = 0;
audio_driver_data.free_samples.count = 0;
/* Threaded driver is initially stopped. */
if (
audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL)
&& !settings->audio.mute_enable
&& audio_driver_data.audio_callback.callback
&& audio_cb_inited
)
audio_driver_ctl(RARCH_AUDIO_CTL_START, NULL);
@@ -433,10 +459,11 @@ error:
static void audio_driver_readjust_input_rate(void)
{
settings_t *settings = config_get_ptr();
unsigned write_idx = audio_driver_data.buffer_free_samples_count++ &
unsigned write_idx = audio_driver_data.free_samples.count++ &
(AUDIO_BUFFER_FREE_SAMPLES_COUNT - 1);
int half_size = audio_driver_data.driver_buffer_size / 2;
int avail = current_audio->write_avail(audio_driver_context_audio_data);
int avail =
current_audio->write_avail(audio_driver_context_audio_data);
int delta_mid = avail - half_size;
double direction = (double)delta_mid / half_size;
double adjust = 1.0 + settings->audio.rate_control_delta * direction;
@@ -446,12 +473,14 @@ static void audio_driver_readjust_input_rate(void)
(unsigned)(100 - (avail * 100) / audio_driver_data.driver_buffer_size));
#endif
audio_driver_data.buffer_free_samples[write_idx] = avail;
audio_driver_data.src_ratio = audio_driver_data.orig_src_ratio * adjust;
audio_driver_data.free_samples.buf[write_idx] = avail;
audio_driver_data.audio_rate.source_ratio.current =
audio_driver_data.audio_rate.source_ratio.original * adjust;
#if 0
RARCH_LOG_OUTPUT("New rate: %lf, Orig rate: %lf\n",
audio_driver_data.src_ratio, audio_driver_data.orig_src_ratio);
audio_driver_data.audio_rate.source_ratio.current,
audio_driver_data.audio_rate.source_ratio.original);
#endif
}
@@ -465,8 +494,9 @@ void audio_driver_set_nonblocking_state(bool enable)
current_audio->set_nonblock_state(audio_driver_context_audio_data,
settings->audio.sync ? enable : true);
audio_driver_data.chunk_size = enable ? audio_driver_data.nonblock_chunk_size :
audio_driver_data.block_chunk_size;
audio_driver_data.chunk.size = enable ?
audio_driver_data.chunk.nonblock_size :
audio_driver_data.chunk.block_size;
}
/**
@@ -482,11 +512,9 @@ void audio_driver_set_nonblocking_state(bool enable)
**/
static bool audio_driver_flush(const int16_t *data, size_t samples)
{
bool is_slowmotion;
static struct retro_perf_counter audio_convert_s16 = {0};
static struct retro_perf_counter audio_convert_float = {0};
static struct retro_perf_counter audio_dsp = {0};
static struct retro_perf_counter resampler_proc = {0};
struct resampler_data src_data = {0};
struct rarch_dsp_data dsp_data = {0};
const void *output_data = NULL;
@@ -498,7 +526,9 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL) || settings->audio.mute_enable)
return true;
if (!audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL) || !audio_driver_data.data)
if (!audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
return false;
if (!audio_driver_data.data)
return false;
rarch_perf_init(&audio_convert_s16, "audio_convert_s16");
@@ -527,35 +557,30 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
}
}
src_data.data_out = audio_driver_data.outsamples;
src_data.data_out = audio_driver_data.output_samples.buf;
if (audio_driver_data.rate_control)
if (audio_driver_data.audio_rate.control)
audio_driver_readjust_input_rate();
src_data.ratio = audio_driver_data.src_ratio;
src_data.ratio = audio_driver_data.audio_rate.source_ratio.current;
runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, &is_slowmotion);
if (is_slowmotion)
if (runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL))
src_data.ratio *= settings->slowmotion_ratio;
rarch_perf_init(&resampler_proc, "resampler_proc");
retro_perf_start(&resampler_proc);
rarch_resampler_process(audio_driver_resampler, audio_driver_resampler_data, &src_data);
retro_perf_stop(&resampler_proc);
audio_driver_ctl(RARCH_AUDIO_CTL_RESAMPLER_PROCESS, &src_data);
output_data = audio_driver_data.outsamples;
output_data = audio_driver_data.output_samples.buf;
output_frames = src_data.output_frames;
if (!audio_driver_data.use_float)
{
rarch_perf_init(&audio_convert_float, "audio_convert_float");
retro_perf_start(&audio_convert_float);
audio_convert_float_to_s16(audio_driver_data.conv_outsamples,
audio_convert_float_to_s16(audio_driver_data.output_samples.conv_buf,
(const float*)output_data, output_frames * 2);
retro_perf_stop(&audio_convert_float);
output_data = audio_driver_data.conv_outsamples;
output_data = audio_driver_data.output_samples.conv_buf;
output_size = sizeof(int16_t);
}
@@ -578,13 +603,14 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
**/
void audio_driver_sample(int16_t left, int16_t right)
{
audio_driver_data.conv_outsamples[audio_driver_data.data_ptr++] = left;
audio_driver_data.conv_outsamples[audio_driver_data.data_ptr++] = right;
audio_driver_data.output_samples.conv_buf[audio_driver_data.data_ptr++] = left;
audio_driver_data.output_samples.conv_buf[audio_driver_data.data_ptr++] = right;
if (audio_driver_data.data_ptr < audio_driver_data.chunk_size)
if (audio_driver_data.data_ptr < audio_driver_data.chunk.size)
return;
audio_driver_flush(audio_driver_data.conv_outsamples, audio_driver_data.data_ptr);
audio_driver_flush(audio_driver_data.output_samples.conv_buf,
audio_driver_data.data_ptr);
audio_driver_data.data_ptr = 0;
}
@@ -614,13 +640,14 @@ size_t audio_driver_sample_batch(const int16_t *data, size_t frames)
* @left : value of the left audio channel.
* @right : value of the right audio channel.
*
* Audio sample render callback function (rewind version). This callback
* function will be used instead of audio_driver_sample when rewinding is activated.
* Audio sample render callback function (rewind version).
* This callback function will be used instead of
* audio_driver_sample when rewinding is activated.
**/
void audio_driver_sample_rewind(int16_t left, int16_t right)
{
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] = right;
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] = left;
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] = right;
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] = left;
}
/**
@@ -628,8 +655,10 @@ void audio_driver_sample_rewind(int16_t left, int16_t right)
* @data : pointer to audio buffer.
* @frames : amount of audio frames to push.
*
* Batched audio sample render callback function (rewind version). This callback
* function will be used instead of audio_driver_sample_batch when rewinding is activated.
* Batched audio sample render callback function (rewind version).
*
* This callback function will be used instead of
* audio_driver_sample_batch when rewinding is activated.
*
* Returns: amount of frames sampled. Will be equal to @frames
* unless @frames exceeds (AUDIO_CHUNK_SIZE_NONBLOCKING / 2).
@@ -640,7 +669,7 @@ size_t audio_driver_sample_batch_rewind(const int16_t *data, size_t frames)
size_t samples = frames << 1;
for (i = 0; i < samples; i++)
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] = data[i];
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] = data[i];
return frames;
}
@@ -659,7 +688,9 @@ void audio_driver_dsp_filter_free(void)
void audio_driver_dsp_filter_init(const char *device)
{
audio_driver_data.dsp = rarch_dsp_filter_new(device, audio_driver_data.in_rate);
audio_driver_data.dsp = rarch_dsp_filter_new(
device, audio_driver_data.audio_rate.input);
if (!audio_driver_data.dsp)
RARCH_ERR("[DSP]: Failed to initialize DSP filter \"%s\".\n", device);
}
@@ -669,29 +700,6 @@ void audio_driver_set_buffer_size(size_t bufsize)
audio_driver_data.driver_buffer_size = bufsize;
}
void audio_driver_unset_callback(void)
{
audio_driver_data.audio_callback.callback = NULL;
audio_driver_data.audio_callback.set_state = NULL;
}
void audio_driver_set_callback(const void *data)
{
const struct retro_audio_callback *cb =
(const struct retro_audio_callback*)data;
if (cb)
audio_driver_data.audio_callback = *cb;
}
void audio_driver_callback_set_state(bool state)
{
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
return;
if (audio_driver_data.audio_callback.set_state)
audio_driver_data.audio_callback.set_state(state);
}
static void audio_monitor_adjust_system_rates(void)
{
@@ -707,13 +715,13 @@ static void audio_monitor_adjust_system_rates(void)
return;
timing_skew = fabs(1.0f - info->fps / settings->video.refresh_rate);
audio_driver_data.in_rate = info->sample_rate;
audio_driver_data.audio_rate.input = info->sample_rate;
if (timing_skew <= settings->audio.max_timing_skew)
audio_driver_data.in_rate *= (settings->video.refresh_rate / info->fps);
audio_driver_data.audio_rate.input *= (settings->video.refresh_rate / info->fps);
RARCH_LOG("Set audio input rate to: %.2f Hz.\n",
audio_driver_data.in_rate);
audio_driver_data.audio_rate.input);
}
static void audio_driver_setup_rewind(void)
@@ -721,15 +729,15 @@ static void audio_driver_setup_rewind(void)
unsigned i;
/* Push audio ready to be played. */
audio_driver_data.rewind_ptr = audio_driver_data.rewind_size;
audio_driver_data.rewind.ptr = audio_driver_data.rewind.size;
for (i = 0; i < audio_driver_data.data_ptr; i += 2)
{
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] =
audio_driver_data.conv_outsamples[i + 1];
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] =
audio_driver_data.output_samples.conv_buf[i + 1];
audio_driver_data.rewind_buf[--audio_driver_data.rewind_ptr] =
audio_driver_data.conv_outsamples[i + 0];
audio_driver_data.rewind.buf[--audio_driver_data.rewind.ptr] =
audio_driver_data.output_samples.conv_buf[i + 0];
}
audio_driver_data.data_ptr = 0;
@@ -737,9 +745,16 @@ static void audio_driver_setup_rewind(void)
static bool find_audio_driver(void)
{
int i;
driver_ctx_info_t drv;
settings_t *settings = config_get_ptr();
int i = find_driver_index("audio_driver", settings->audio.driver);
drv.label = "audio_driver";
drv.s = settings->audio.driver;
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
i = drv.len;
if (i >= 0)
current_audio = (const audio_driver_t*)audio_driver_find_handle(i);
@@ -764,16 +779,36 @@ static bool find_audio_driver(void)
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
{
static bool audio_driver_active = false;
static bool audio_driver_data_own = false;
settings_t *settings = config_get_ptr();
static struct retro_audio_callback audio_callback;
static struct retro_perf_counter resampler_proc = {0};
static const rarch_resampler_t *audio_driver_resampler = NULL;
static void *audio_driver_resampler_data = NULL;
static bool audio_driver_active = false;
static bool audio_driver_data_own = false;
settings_t *settings = config_get_ptr();
switch (state)
{
case RARCH_AUDIO_CTL_NONE:
case RARCH_AUDIO_CTL_RESAMPLER_DEINIT:
rarch_resampler_freep(&audio_driver_resampler,
&audio_driver_resampler_data);
break;
case RARCH_AUDIO_CTL_RESAMPLER_INIT:
return rarch_resampler_realloc(
&audio_driver_resampler_data,
&audio_driver_resampler,
settings->audio.resampler,
audio_driver_data.audio_rate.source_ratio.original);
case RARCH_AUDIO_CTL_RESAMPLER_PROCESS:
rarch_perf_init(&resampler_proc, "resampler_proc");
retro_perf_start(&resampler_proc);
rarch_resampler_process(audio_driver_resampler,
audio_driver_resampler_data,
(struct resampler_data*)data);
retro_perf_stop(&resampler_proc);
break;
case RARCH_AUDIO_CTL_INIT:
return init_audio();
return init_audio(audio_callback.callback != NULL);
case RARCH_AUDIO_CTL_DESTROY:
audio_driver_active = false;
audio_driver_data_own = false;
@@ -783,57 +818,95 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
audio_driver_context_audio_data = NULL;
break;
case RARCH_AUDIO_CTL_DEINIT:
if (uninit_audio())
return true;
if (!uninit_audio())
return false;
break;
case RARCH_AUDIO_CTL_SETUP_REWIND:
audio_driver_setup_rewind();
return true;
break;
case RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE:
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
return false;
if (audio_callback.set_state)
audio_callback.set_state(true);
break;
case RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE:
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
return false;
if (audio_callback.set_state)
audio_callback.set_state(false);
break;
case RARCH_AUDIO_CTL_HAS_CALLBACK:
return audio_driver_data.audio_callback.callback;
return audio_callback.callback;
case RARCH_AUDIO_CTL_CALLBACK:
if (!audio_driver_ctl(RARCH_AUDIO_CTL_HAS_CALLBACK, NULL))
return false;
if (audio_driver_data.audio_callback.callback)
audio_driver_data.audio_callback.callback();
return true;
if (audio_callback.callback)
audio_callback.callback();
break;
case RARCH_AUDIO_CTL_UNSET_CALLBACK:
audio_callback.callback = NULL;
audio_callback.set_state = NULL;
break;
case RARCH_AUDIO_CTL_SET_CALLBACK:
{
const struct retro_audio_callback *cb =
(const struct retro_audio_callback*)data;
if (recording_driver_get_data_ptr()) /* A/V sync is a must. */
return false;
#ifdef HAVE_NETPLAY
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
return false;
#endif
if (cb)
audio_callback = *cb;
}
break;
case RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES:
audio_monitor_adjust_system_rates();
return true;
break;
case RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE:
{
double new_src_ratio = (double)settings->audio.out_rate /
audio_driver_data.in_rate;
audio_driver_data.audio_rate.input;
audio_driver_data.orig_src_ratio = new_src_ratio;
audio_driver_data.src_ratio = new_src_ratio;
audio_driver_data.audio_rate.source_ratio.original = new_src_ratio;
audio_driver_data.audio_rate.source_ratio.current = new_src_ratio;
}
return true;
break;
case RARCH_AUDIO_CTL_MUTE_TOGGLE:
if (!audio_driver_context_audio_data || !audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
if (!audio_driver_context_audio_data)
return false;
if (!audio_driver_ctl(RARCH_AUDIO_CTL_IS_ACTIVE, NULL))
return false;
settings->audio.mute_enable = !settings->audio.mute_enable;
if (settings->audio.mute_enable)
event_command(EVENT_CMD_AUDIO_STOP);
else if (!event_command(EVENT_CMD_AUDIO_START))
event_cmd_ctl(EVENT_CMD_AUDIO_STOP, NULL);
else if (!event_cmd_ctl(EVENT_CMD_AUDIO_START, NULL))
{
audio_driver_ctl(RARCH_AUDIO_CTL_UNSET_ACTIVE, NULL);
return false;
}
return true;
break;
case RARCH_AUDIO_CTL_ALIVE:
if (!current_audio || !current_audio->alive || !audio_driver_context_audio_data)
if (!current_audio || !current_audio->alive
|| !audio_driver_context_audio_data)
return false;
return current_audio->alive(audio_driver_context_audio_data);
case RARCH_AUDIO_CTL_START:
if (!current_audio || !current_audio->start || !audio_driver_context_audio_data)
if (!current_audio || !current_audio->start
|| !audio_driver_context_audio_data)
return false;
return current_audio->start(audio_driver_context_audio_data);
case RARCH_AUDIO_CTL_STOP:
if (!current_audio || !current_audio->stop || !audio_driver_context_audio_data)
if (!current_audio || !current_audio->stop
|| !audio_driver_context_audio_data)
return false;
return current_audio->stop(audio_driver_context_audio_data);
case RARCH_AUDIO_CTL_FIND_DRIVER:
@@ -856,10 +929,14 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
return audio_driver_active;
case RARCH_AUDIO_CTL_FRAME_IS_REVERSE:
/* We just rewound. Flush rewind audio buffer. */
audio_driver_flush(audio_driver_data.rewind_buf + audio_driver_data.rewind_ptr,
audio_driver_data.rewind_size - audio_driver_data.rewind_ptr);
return true;
audio_driver_flush(
audio_driver_data.rewind.buf + audio_driver_data.rewind.ptr,
audio_driver_data.rewind.size - audio_driver_data.rewind.ptr);
break;
case RARCH_AUDIO_CTL_NONE:
default:
break;
}
return false;
return true;
}
+8 -7
View File
@@ -42,6 +42,10 @@ enum rarch_audio_ctl_state
RARCH_AUDIO_CTL_MONITOR_SET_REFRESH_RATE,
RARCH_AUDIO_CTL_MONITOR_ADJUST_SYSTEM_RATES,
RARCH_AUDIO_CTL_MUTE_TOGGLE,
RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE,
RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE,
RARCH_AUDIO_CTL_SET_CALLBACK,
RARCH_AUDIO_CTL_UNSET_CALLBACK,
RARCH_AUDIO_CTL_CALLBACK,
RARCH_AUDIO_CTL_HAS_CALLBACK,
RARCH_AUDIO_CTL_ALIVE,
@@ -51,7 +55,10 @@ enum rarch_audio_ctl_state
RARCH_AUDIO_CTL_OWNS_DRIVER,
RARCH_AUDIO_CTL_SET_ACTIVE,
RARCH_AUDIO_CTL_UNSET_ACTIVE,
RARCH_AUDIO_CTL_IS_ACTIVE
RARCH_AUDIO_CTL_IS_ACTIVE,
RARCH_AUDIO_CTL_RESAMPLER_DEINIT,
RARCH_AUDIO_CTL_RESAMPLER_INIT,
RARCH_AUDIO_CTL_RESAMPLER_PROCESS
};
typedef struct audio_driver
@@ -147,12 +154,6 @@ void audio_driver_dsp_filter_init(const char *device);
void audio_driver_set_buffer_size(size_t bufsize);
void audio_driver_set_callback(const void *info);
void audio_driver_unset_callback(void);
void audio_driver_callback_set_state(bool state);
extern audio_driver_t audio_rsound;
extern audio_driver_t audio_oss;
extern audio_driver_t audio_alsa;
+11 -8
View File
@@ -25,13 +25,12 @@
#include <file/config_file_userdata.h>
#include <file/dir_list.h>
#include "../performance.h"
#include "audio_dsp_filter.h"
#include "../dynamic.h"
#include "audio_filters/dspfilter.h"
#include "../file_ext.h"
#include "../frontend/frontend_driver.h"
#include "../performance.h"
#include "../dynamic.h"
struct rarch_dsp_plug
{
@@ -226,12 +225,13 @@ static bool append_plugs(rarch_dsp_filter_t *dsp, struct string_list *list)
rarch_dsp_filter_t *rarch_dsp_filter_new(
const char *filter_config, float sample_rate)
{
char basedir[PATH_MAX_LENGTH] = {0};
#if !defined(HAVE_FILTERS_BUILTIN) && defined(HAVE_DYLIB)
char basedir[PATH_MAX_LENGTH];
char ext_name[PATH_MAX_LENGTH];
#endif
struct string_list *plugs = NULL;
rarch_dsp_filter_t *dsp = NULL;
(void)basedir;
dsp = (rarch_dsp_filter_t*)calloc(1, sizeof(*dsp));
if (!dsp)
return NULL;
@@ -243,7 +243,10 @@ rarch_dsp_filter_t *rarch_dsp_filter_new(
#if !defined(HAVE_FILTERS_BUILTIN) && defined(HAVE_DYLIB)
fill_pathname_basedir(basedir, filter_config, sizeof(basedir));
plugs = dir_list_new(basedir, EXT_EXECUTABLES, false, false);
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
goto error;
plugs = dir_list_new(basedir, ext_name, false, false);
if (!plugs)
goto error;
#endif
+1 -1
View File
@@ -107,7 +107,7 @@ static void *echo_init(const struct dspfilter_info *info,
config->get_float_array(userdata, "feedback", &feedback, &num_feedback, default_feedback, 1);
config->get_float(userdata, "amp", &echo->amp, 0.2f);
channels = num_feedback = num_delay = min(num_delay, num_feedback);
channels = num_feedback = num_delay = MIN(num_delay, num_feedback);
echo->channels = (struct echo_channel*)calloc(channels, sizeof(*echo->channels));
if (!echo->channels)
+1 -1
View File
@@ -276,7 +276,7 @@ static void *eq_init(const struct dspfilter_info *info,
filter_path = NULL;
}
num_gain = num_freq = min(num_gain, num_freq);
num_gain = num_freq = MIN(num_gain, num_freq);
gains = (struct eq_gain*)calloc(num_gain, sizeof(*gains));
if (!gains)
+7 -3
View File
@@ -14,12 +14,15 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include <file/config_file_userdata.h>
#include <string/stdstring.h>
#include "audio_resampler_driver.h"
#ifdef RARCH_INTERNAL
#include "../performance.h"
#endif
#include <file/config_file_userdata.h>
#include <string.h>
#ifndef DONT_HAVE_STRING_LIST
#include "../string_list_special.h"
#endif
@@ -28,6 +31,7 @@ static const rarch_resampler_t *resampler_drivers[] = {
&sinc_resampler,
&CC_resampler,
&nearest_resampler,
&null_resampler,
NULL,
};
@@ -54,7 +58,7 @@ static int find_resampler_driver_index(const char *ident)
unsigned i;
for (i = 0; resampler_drivers[i]; i++)
if (strcasecmp(ident, resampler_drivers[i]->ident) == 0)
if (string_is_equal_noncase(ident, resampler_drivers[i]->ident))
return i;
return -1;
}
+1
View File
@@ -140,6 +140,7 @@ typedef struct audio_frame_float
extern rarch_resampler_t sinc_resampler;
extern rarch_resampler_t CC_resampler;
extern rarch_resampler_t nearest_resampler;
extern rarch_resampler_t null_resampler;
#ifndef DONT_HAVE_STRING_LIST
/**
+23 -3
View File
@@ -34,6 +34,7 @@ typedef struct audio_thread
scond_t *cond;
bool alive;
bool stopped;
bool stopped_ack;
bool is_paused;
bool use_float;
@@ -81,6 +82,7 @@ static void audio_thread_loop(void *data)
{
scond_signal(thr->cond);
slock_unlock(thr->lock);
thr->stopped_ack = true;
break;
}
@@ -88,7 +90,14 @@ static void audio_thread_loop(void *data)
{
thr->driver->stop(thr->driver_data);
while (thr->stopped)
{
/* If we stop right after start, we might not be able to properly ack.
* Signal in the loop instead. */
thr->stopped_ack = true;
scond_signal(thr->cond);
scond_wait(thr->cond, thr->lock);
}
thr->driver->start(thr->driver_data);
}
@@ -105,9 +114,18 @@ static void audio_thread_block(audio_thread_t *thr)
if (!thr)
return;
if (thr->stopped)
return;
slock_lock(thr->lock);
thr->stopped_ack = false;
thr->stopped = true;
scond_signal(thr->cond);
/* Wait until audio driver actually goes to sleep. */
while (!thr->stopped_ack)
scond_wait(thr->cond, thr->lock);
slock_unlock(thr->lock);
}
@@ -167,11 +185,12 @@ static bool audio_thread_stop(void *data)
audio_thread_t *thr = (audio_thread_t*)data;
if (!thr)
return false;
return false;
audio_thread_block(thr);
thr->is_paused = true;
audio_driver_callback_set_state(false);
audio_driver_ctl(RARCH_AUDIO_CTL_SET_CALLBACK_DISABLE, NULL);
return true;
}
@@ -183,7 +202,8 @@ static bool audio_thread_start(void *data)
if (!thr)
return false;
audio_driver_callback_set_state(true);
audio_driver_ctl(RARCH_AUDIO_CTL_SET_CALLBACK_ENABLE, NULL);
thr->is_paused = false;
audio_thread_unblock(thr);
+2 -1
View File
@@ -227,7 +227,8 @@ static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size)
while (size)
{
size_t avail_write = min(alsa->buf_size - alsa->buffer_ptr, size);
size_t avail_write = MIN(alsa->buf_size - alsa->buffer_ptr, size);
if (avail_write)
{
memcpy(alsa->buffer[alsa->buffer_index] +
+7 -4
View File
@@ -66,7 +66,7 @@ static void alsa_worker_thread(void *data)
snd_pcm_sframes_t frames;
slock_lock(alsa->fifo_lock);
avail = fifo_read_avail(alsa->buffer);
fifo_size = min(alsa->period_size, avail);
fifo_size = MIN(alsa->period_size, avail);
fifo_read(alsa->buffer, buf, fifo_size);
scond_signal(alsa->cond);
slock_unlock(alsa->fifo_lock);
@@ -252,11 +252,14 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
{
size_t avail;
size_t write_amt;
slock_lock(alsa->fifo_lock);
avail = fifo_write_avail(alsa->buffer);
write_amt = min(avail, size);
avail = fifo_write_avail(alsa->buffer);
write_amt = MIN(avail, size);
fifo_write(alsa->buffer, buf, write_amt);
slock_unlock(alsa->fifo_lock);
return write_amt;
}
else
@@ -278,7 +281,7 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
}
else
{
size_t write_amt = min(size - written, avail);
size_t write_amt = MIN(size - written, avail);
fifo_write(alsa->buffer, (const char*)buf + written, write_amt);
slock_unlock(alsa->fifo_lock);
written += write_amt;
+2 -1
View File
@@ -30,6 +30,7 @@
#include <queues/fifo_buffer.h>
#include <rthreads/rthreads.h>
#include <retro_endianness.h>
#include <string/stdstring.h>
#include "../audio_driver.h"
#include "../../configuration.h"
@@ -174,7 +175,7 @@ static void choose_output_device(coreaudio_t *dev, const char* device)
if (AudioObjectGetPropertyData(devices[i],
&propaddr, 0, 0, &size, device_name) == noErr
&& !strcmp(device_name, device))
&& string_is_equal(device_name, device))
{
AudioUnitSetProperty(dev->dev, kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Global, 0, &devices[i], sizeof(AudioDeviceID));
+1 -14
View File
@@ -31,19 +31,6 @@
#include "../../configuration.h"
#include "../../defines/gx_defines.h"
#define CHUNK_FRAMES 64
#define CHUNK_SIZE (CHUNK_FRAMES * sizeof(uint32_t))
#define BLOCKS 16
#ifdef GEKKO
#define AIInit AUDIO_Init
#define AIInitDMA AUDIO_InitDMA
#define AIStartDMA AUDIO_StartDMA
#define AIStopDMA AUDIO_StopDMA
#define AIRegisterDMACallback AUDIO_RegisterDMACallback
#define AISetDSPSampleRate AUDIO_SetDSPSampleRate
#endif
typedef struct
{
uint32_t data[BLOCKS][CHUNK_FRAMES];
@@ -218,7 +205,7 @@ static void gx_audio_free(void *data)
AIRegisterDMACallback(NULL);
if (wa->cond)
LWP_CloseQueue(wa->cond);
OSCloseThreadQueue(wa->cond);
wa->cond = 0;
free(data);
+1 -1
View File
@@ -162,7 +162,7 @@ static bool al_get_buffer(al_t *al, ALuint *buffer)
static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size)
{
size_t read_size = min(BUFSIZE - al->tmpbuf_ptr, size);
size_t read_size = MIN(BUFSIZE - al->tmpbuf_ptr, size);
memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size);
al->tmpbuf_ptr += read_size;
return read_size;
+1 -1
View File
@@ -255,7 +255,7 @@ static ssize_t sl_write(void *data, const void *buf_, size_t size)
slock_unlock(sl->lock);
}
avail_write = min(sl->buf_size - sl->buffer_ptr, size);
avail_write = MIN(sl->buf_size - sl->buffer_ptr, size);
if (avail_write)
{
+1 -3
View File
@@ -238,9 +238,7 @@ static ssize_t pulse_write(void *data, const void *buf_, size_t size)
pa_threaded_mainloop_lock(pa->mainloop);
while (size)
{
size_t writable = pa_stream_writable_size(pa->stream);
writable = min(size, writable);
size_t writable = MIN(size, pa_stream_writable_size(pa->stream));
if (writable)
{
+1 -1
View File
@@ -194,7 +194,7 @@ static size_t xaudio2_write(xaudio2_t *handle, const void *buf, size_t bytes_)
while (bytes)
{
unsigned need = min(bytes, handle->bufsize - handle->bufptr);
unsigned need = MIN(bytes, handle->bufsize - handle->bufptr);
memcpy(handle->buf + handle->write_buffer * handle->bufsize + handle->bufptr,
buffer, need);
+2 -2
View File
@@ -271,7 +271,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
audio_frame_float_t *inp = (audio_frame_float_t*)data->data_in;
audio_frame_float_t *inp_max = (audio_frame_float_t*)(inp + data->input_frames);
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
float b = min(data->ratio, 1.00); /* cutoff frequency. */
float b = MIN(data->ratio, 1.00); /* cutoff frequency. */
float ratio = 1.0 / data->ratio;
__m128 vec_previous = _mm_loadu_ps((float*)&re->buffer[0]);
__m128 vec_current = _mm_loadu_ps((float*)&re->buffer[2]);
@@ -446,7 +446,7 @@ static void resampler_CC_upsample(void *re_, struct resampler_data *data)
audio_frame_float_t *inp_max = (audio_frame_float_t*)
(inp + data->input_frames);
audio_frame_float_t *outp = (audio_frame_float_t*)data->data_out;
float b = min(data->ratio, 1.00); /* cutoff frequency. */
float b = MIN(data->ratio, 1.00); /* cutoff frequency. */
float ratio = 1.0 / data->ratio;
while (inp != inp_max)
+48
View File
@@ -0,0 +1,48 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2014-2016 - Ali Bouhlel ( [email protected] )
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdint.h>
#include <stdlib.h>
#include <math.h>
#include "../audio_resampler_driver.h"
typedef struct rarch_null_resampler
{
void *empty;
} rarch_null_resampler_t;
static void resampler_null_process(
void *re_, struct resampler_data *data)
{
}
static void resampler_null_free(void *re_)
{
}
static void *resampler_null_init(const struct resampler_config *config,
double bandwidth_mod, resampler_simd_mask_t mask)
{
return (void*)0;
}
rarch_resampler_t null_resampler = {
resampler_null_init,
resampler_null_process,
resampler_null_free,
RESAMPLER_API_VERSION,
"null",
"null"
};
File renamed without changes.
+9 -3
View File
@@ -27,6 +27,7 @@
#include "configuration.h"
#include "msg_hash.h"
#include "runloop.h"
#include "libretro_version_1.h"
#include "verbosity.h"
/* Autosave support. */
@@ -251,15 +252,20 @@ void autosave_event_init(void)
for (i = 0; i < global->savefiles->size; i++)
{
retro_ctx_memory_info_t mem_info;
const char *path = global->savefiles->elems[i].data;
unsigned type = global->savefiles->elems[i].attr.i;
if (core.retro_get_memory_size(type) <= 0)
mem_info.id = type;
core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);
if (mem_info.size <= 0)
continue;
autosave_state.list[i] = autosave_new(path,
core.retro_get_memory_data(type),
core.retro_get_memory_size(type),
mem_info.data,
mem_info.size,
settings->autosave_interval);
if (!autosave_state.list[i])
+107 -128
View File
@@ -17,9 +17,9 @@
#include <string.h>
#include "camera_driver.h"
#include "../general.h"
#include "../string_list_special.h"
#include "../system.h"
#include "../verbosity.h"
static const camera_driver_t *camera_drivers[] = {
@@ -41,9 +41,6 @@ static const camera_driver_t *camera_drivers[] = {
NULL,
};
static const camera_driver_t *camera_driver;
static void *camera_data;
/**
* camera_driver_find_handle:
* @idx : index of driver to get handle to.
@@ -88,138 +85,22 @@ const char* config_get_camera_driver_options(void)
return char_list_new_special(STRING_LIST_CAMERA_DRIVERS, NULL);
}
void find_camera_driver(void)
{
settings_t *settings = config_get_ptr();
int i = find_driver_index("camera_driver", settings->camera.driver);
if (i >= 0)
camera_driver = (const camera_driver_t*)camera_driver_find_handle(i);
else
{
unsigned d;
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n",
settings->camera.driver);
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
for (d = 0; camera_driver_find_handle(d); d++)
RARCH_LOG_OUTPUT("\t%s\n", camera_driver_find_ident(d));
RARCH_WARN("Going to default to first camera driver...\n");
camera_driver = (const camera_driver_t*)camera_driver_find_handle(0);
if (!camera_driver)
retro_fail(1, "find_camera_driver()");
}
}
/**
* driver_camera_start:
*
* Starts camera driver interface.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool driver_camera_start(void)
{
settings_t *settings = config_get_ptr();
if (camera_driver && camera_data && camera_driver->start)
{
if (settings->camera.allow)
return camera_driver->start(camera_data);
runloop_msg_queue_push(
"Camera is explicitly disabled.\n", 1, 180, false);
}
return false;
}
/**
* driver_camera_stop:
*
* Stops camera driver.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void driver_camera_stop(void)
{
if (camera_driver && camera_driver->stop && camera_data)
camera_driver->stop(camera_data);
camera_driver_ctl(RARCH_CAMERA_CTL_START, NULL);
}
/**
* driver_camera_poll:
*
* Call camera driver's poll function.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void driver_camera_poll(void)
bool driver_camera_start(void)
{
rarch_system_info_t *system = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
if (camera_driver && camera_driver->poll && camera_data)
camera_driver->poll(camera_data,
system->camera_callback.frame_raw_framebuffer,
system->camera_callback.frame_opengl_texture);
}
void init_camera(void)
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
/* Resource leaks will follow if camera is initialized twice. */
if (camera_data)
return;
find_camera_driver();
camera_data = camera_driver->init(
*settings->camera.device ? settings->camera.device : NULL,
system->camera_callback.caps,
settings->camera.width ?
settings->camera.width : system->camera_callback.width,
settings->camera.height ?
settings->camera.height : system->camera_callback.height);
if (!camera_data)
{
RARCH_ERR("Failed to initialize camera driver. Will continue without camera.\n");
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL);
}
if (system->camera_callback.initialized)
system->camera_callback.initialized();
}
static void uninit_camera(void)
{
rarch_system_info_t *system = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
if (camera_data && camera_driver)
{
if (system->camera_callback.deinitialized)
system->camera_callback.deinitialized();
if (camera_driver->free)
camera_driver->free(camera_data);
}
camera_data = NULL;
return camera_driver_ctl(RARCH_CAMERA_CTL_START, NULL);
}
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
{
settings_t *settings = config_get_ptr();
static struct retro_camera_callback camera_cb;
static const camera_driver_t *camera_driver = NULL;
static void *camera_data = NULL;
static bool camera_driver_active = false;
static bool camera_driver_data_own = false;
@@ -229,6 +110,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
camera_driver_active = false;
camera_driver_data_own = false;
camera_driver = NULL;
camera_data = NULL;
break;
case RARCH_CAMERA_CTL_SET_OWN_DRIVER:
camera_driver_data_own = true;
@@ -241,13 +123,110 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
case RARCH_CAMERA_CTL_SET_ACTIVE:
camera_driver_active = true;
break;
case RARCH_CAMERA_CTL_FIND_DRIVER:
{
int i;
driver_ctx_info_t drv;
drv.label = "camera_driver";
drv.s = settings->camera.driver;
driver_ctl(RARCH_DRIVER_CTL_FIND_INDEX, &drv);
i = drv.len;
if (i >= 0)
camera_driver = (const camera_driver_t*)camera_driver_find_handle(i);
else
{
unsigned d;
RARCH_ERR("Couldn't find any camera driver named \"%s\"\n",
settings->camera.driver);
RARCH_LOG_OUTPUT("Available camera drivers are:\n");
for (d = 0; camera_driver_find_handle(d); d++)
RARCH_LOG_OUTPUT("\t%s\n", camera_driver_find_ident(d));
RARCH_WARN("Going to default to first camera driver...\n");
camera_driver = (const camera_driver_t*)camera_driver_find_handle(0);
if (!camera_driver)
retro_fail(1, "find_camera_driver()");
}
}
break;
case RARCH_CAMERA_CTL_UNSET_ACTIVE:
camera_driver_active = false;
break;
case RARCH_CAMERA_CTL_IS_ACTIVE:
return camera_driver_active;
case RARCH_CAMERA_CTL_DEINIT:
uninit_camera();
if (camera_data && camera_driver)
{
if (camera_cb.deinitialized)
camera_cb.deinitialized();
if (camera_driver->free)
camera_driver->free(camera_data);
}
camera_data = NULL;
break;
case RARCH_CAMERA_CTL_STOP:
if ( camera_driver
&& camera_driver->stop
&& camera_data)
camera_driver->stop(camera_data);
break;
case RARCH_CAMERA_CTL_START:
if (camera_driver && camera_data && camera_driver->start)
{
if (settings->camera.allow)
return camera_driver->start(camera_data);
runloop_msg_queue_push(
"Camera is explicitly disabled.\n", 1, 180, false);
}
return false;
case RARCH_CAMERA_CTL_POLL:
if (!camera_cb.caps)
return false;
if (!camera_driver || !camera_driver->poll || !camera_data)
return false;
camera_driver->poll(camera_data,
camera_cb.frame_raw_framebuffer,
camera_cb.frame_opengl_texture);
break;
case RARCH_CAMERA_CTL_SET_CB:
{
struct retro_camera_callback *cb =
(struct retro_camera_callback*)data;
camera_cb = *cb;
}
break;
case RARCH_CAMERA_CTL_INIT:
/* Resource leaks will follow if camera is initialized twice. */
if (camera_data)
return false;
camera_driver_ctl(RARCH_CAMERA_CTL_FIND_DRIVER, NULL);
camera_data = camera_driver->init(
*settings->camera.device ? settings->camera.device : NULL,
camera_cb.caps,
settings->camera.width ?
settings->camera.width : camera_cb.width,
settings->camera.height ?
settings->camera.height : camera_cb.height);
if (!camera_data)
{
RARCH_ERR("Failed to initialize camera driver. Will continue without camera.\n");
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL);
}
if (camera_cb.initialized)
camera_cb.initialized();
break;
default:
break;
+9 -33
View File
@@ -35,7 +35,13 @@ enum rarch_camera_ctl_state
RARCH_CAMERA_CTL_OWNS_DRIVER,
RARCH_CAMERA_CTL_SET_ACTIVE,
RARCH_CAMERA_CTL_UNSET_ACTIVE,
RARCH_CAMERA_CTL_IS_ACTIVE
RARCH_CAMERA_CTL_IS_ACTIVE,
RARCH_CAMERA_CTL_FIND_DRIVER,
RARCH_CAMERA_CTL_POLL,
RARCH_CAMERA_CTL_SET_CB,
RARCH_CAMERA_CTL_STOP,
RARCH_CAMERA_CTL_START,
RARCH_CAMERA_CTL_INIT
};
typedef struct camera_driver
@@ -66,36 +72,6 @@ extern camera_driver_t camera_rwebcam;
extern camera_driver_t camera_avfoundation;
extern camera_driver_t camera_null;
/**
* driver_camera_start:
*
* Starts camera driver.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool driver_camera_start(void);
/**
* driver_camera_stop:
*
* Stops camera driver.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void driver_camera_stop(void);
/**
* driver_camera_poll:
*
* Call camera driver's poll function.
* Used by RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE.
*
* Returns: true (1) if successful, otherwise false (0).
**/
void driver_camera_poll(void);
/**
* config_get_camera_driver_options:
*
@@ -125,9 +101,9 @@ const void *camera_driver_find_handle(int index);
**/
const char *camera_driver_find_ident(int index);
void find_camera_driver(void);
void driver_camera_stop(void);
void init_camera(void);
bool driver_camera_start(void);
bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data);
+2 -2
View File
@@ -210,9 +210,9 @@ static bool init_device(void *data)
}
/* VIDIOC_S_FMT may change width, height and pitch. */
v4l->width = fmt.fmt.pix.width;
v4l->width = fmt.fmt.pix.width;
v4l->height = fmt.fmt.pix.height;
v4l->pitch = max(fmt.fmt.pix.bytesperline, v4l->width * 2);
v4l->pitch = MAX(fmt.fmt.pix.bytesperline, v4l->width * 2);
/* Sanity check to see if our assumptions are met.
* It is possible to support whatever the device gives us,
+16 -4
View File
@@ -24,9 +24,9 @@
#include <compat/posix_string.h>
#include "cheats.h"
#include "general.h"
#include "runloop.h"
#include "dynamic.h"
#include "libretro_version_1.h"
#include "verbosity.h"
#ifdef HAVE_CONFIG_H
@@ -72,22 +72,34 @@ unsigned cheat_manager_get_size(void)
void cheat_manager_apply_cheats(void)
{
#ifdef HAVE_CHEEVOS
bool data_bool = false;
#endif
unsigned i, idx = 0;
cheat_manager_t *handle = cheat_manager_state;
if (!handle)
return;
core.retro_cheat_reset();
core_ctl(CORE_CTL_RETRO_CHEAT_RESET, NULL);
for (i = 0; i < handle->size; i++)
{
if (handle->cheats[i].state)
core.retro_cheat_set(idx++, true, handle->cheats[i].code);
{
retro_ctx_cheat_info_t cheat_info;
cheat_info.index = idx++;
cheat_info.enabled = true;
cheat_info.code = handle->cheats[i].code;
core_ctl(CORE_CTL_RETRO_CHEAT_SET, &cheat_info);
}
}
#ifdef HAVE_CHEEVOS
cheevos_apply_cheats(idx != 0);
data_bool = idx != 0;
cheevos_ctl(CHEEVOS_CTL_APPLY_CHEATS, &data_bool);
#endif
}
+509 -279
View File
File diff suppressed because it is too large. Load diff
+25 -9
View File
@@ -19,20 +19,36 @@
#include <stdint.h>
#include <stdlib.h>
int cheevos_load(const void *data);
enum cheevos_ctl_state
{
CHEEVOS_CTL_NONE = 0,
CHEEVOS_CTL_TEST,
CHEEVOS_CTL_LOAD,
#ifdef HAVE_MENU
void cheevos_populate_menu(void *data);
#endif
CHEEVOS_CTL_APPLY_CHEATS,
void cheevos_get_description(unsigned cheevo_ndx, char *str, size_t len);
/* Unload the achievements from memory. */
CHEEVOS_CTL_UNLOAD,
void cheevos_set_cheats(void);
/* Toggle Hardcore Mode */
CHEEVOS_CTL_TOGGLE_HARDCORE_MODE,
void cheevos_apply_cheats(bool enable);
/* Load the achievements into memory if
* the game has content. */
CHEEVOS_CTL_SET_CHEATS,
void cheevos_test(void);
CHEEVOS_CTL_GET_DESCRIPTION,
void cheevos_unload(void);
CHEEVOS_CTL_POPULATE_MENU
};
typedef struct cheevos_ctx_desc
{
unsigned idx;
char *s;
size_t len;
} cheevos_ctx_desc_t;
bool cheevos_ctl(enum cheevos_ctl_state state, void *data);
#endif /* __RARCH_CHEEVOS_H */
+138 -104
View File
@@ -26,6 +26,7 @@
#include <compat/posix_string.h>
#include <file/file_path.h>
#include <net/net_compat.h>
#include <string/stdstring.h>
#include "msg_hash.h"
@@ -35,7 +36,14 @@
#include "verbosity.h"
#define DEFAULT_NETWORK_CMD_PORT 55355
#define STDIN_BUF_SIZE 4096
#define STDIN_BUF_SIZE 4096
#define COMMAND_EXT_GLSL 0x7c976537U
#define COMMAND_EXT_GLSLP 0x0f840c87U
#define COMMAND_EXT_CG 0x0059776fU
#define COMMAND_EXT_CGP 0x0b8865bfU
#define COMMAND_EXT_SLANG 0x105ce63aU
#define COMMAND_EXT_SLANGP 0x1bf9adeaU
struct rarch_cmd
{
@@ -52,6 +60,65 @@ struct rarch_cmd
bool state[RARCH_BIND_LIST_END];
};
struct cmd_map
{
const char *str;
unsigned id;
};
struct cmd_action_map
{
const char *str;
bool (*action)(const char *arg);
const char *arg_desc;
};
static bool cmd_set_shader(const char *arg);
static const struct cmd_action_map action_map[] = {
{ "SET_SHADER", cmd_set_shader, "<shader path>" },
};
static const struct cmd_map map[] = {
{ "FAST_FORWARD", RARCH_FAST_FORWARD_KEY },
{ "FAST_FORWARD_HOLD", RARCH_FAST_FORWARD_HOLD_KEY },
{ "LOAD_STATE", RARCH_LOAD_STATE_KEY },
{ "SAVE_STATE", RARCH_SAVE_STATE_KEY },
{ "FULLSCREEN_TOGGLE", RARCH_FULLSCREEN_TOGGLE_KEY },
{ "QUIT", RARCH_QUIT_KEY },
{ "STATE_SLOT_PLUS", RARCH_STATE_SLOT_PLUS },
{ "STATE_SLOT_MINUS", RARCH_STATE_SLOT_MINUS },
{ "REWIND", RARCH_REWIND },
{ "MOVIE_RECORD_TOGGLE", RARCH_MOVIE_RECORD_TOGGLE },
{ "PAUSE_TOGGLE", RARCH_PAUSE_TOGGLE },
{ "FRAMEADVANCE", RARCH_FRAMEADVANCE },
{ "RESET", RARCH_RESET },
{ "SHADER_NEXT", RARCH_SHADER_NEXT },
{ "SHADER_PREV", RARCH_SHADER_PREV },
{ "CHEAT_INDEX_PLUS", RARCH_CHEAT_INDEX_PLUS },
{ "CHEAT_INDEX_MINUS", RARCH_CHEAT_INDEX_MINUS },
{ "CHEAT_TOGGLE", RARCH_CHEAT_TOGGLE },
{ "SCREENSHOT", RARCH_SCREENSHOT },
{ "MUTE", RARCH_MUTE },
{ "OSK", RARCH_OSK },
{ "NETPLAY_FLIP", RARCH_NETPLAY_FLIP },
{ "SLOWMOTION", RARCH_SLOWMOTION },
{ "VOLUME_UP", RARCH_VOLUME_UP },
{ "VOLUME_DOWN", RARCH_VOLUME_DOWN },
{ "OVERLAY_NEXT", RARCH_OVERLAY_NEXT },
{ "DISK_EJECT_TOGGLE", RARCH_DISK_EJECT_TOGGLE },
{ "DISK_NEXT", RARCH_DISK_NEXT },
{ "DISK_PREV", RARCH_DISK_PREV },
{ "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE },
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
{ "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP },
{ "MENU_DOWN", RETRO_DEVICE_ID_JOYPAD_DOWN },
{ "MENU_LEFT", RETRO_DEVICE_ID_JOYPAD_LEFT },
{ "MENU_RIGHT", RETRO_DEVICE_ID_JOYPAD_RIGHT },
{ "MENU_A", RETRO_DEVICE_ID_JOYPAD_A },
{ "MENU_B", RETRO_DEVICE_ID_JOYPAD_B },
};
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
{
@@ -147,79 +214,11 @@ rarch_cmd_t *rarch_cmd_new(bool stdin_enable,
#if (defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)) || defined(HAVE_STDIN_CMD)
error:
rarch_cmd_free(handle);
rarch_cmd_ctl(RARCH_CMD_CTL_FREE, handle);
return NULL;
#endif
}
void rarch_cmd_free(rarch_cmd_t *handle)
{
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
if (handle && handle->net_fd >= 0)
socket_close(handle->net_fd);
#endif
free(handle);
}
struct cmd_map
{
const char *str;
unsigned id;
};
struct cmd_action_map
{
const char *str;
bool (*action)(const char *arg);
const char *arg_desc;
};
static const struct cmd_map map[] = {
{ "FAST_FORWARD", RARCH_FAST_FORWARD_KEY },
{ "FAST_FORWARD_HOLD", RARCH_FAST_FORWARD_HOLD_KEY },
{ "LOAD_STATE", RARCH_LOAD_STATE_KEY },
{ "SAVE_STATE", RARCH_SAVE_STATE_KEY },
{ "FULLSCREEN_TOGGLE", RARCH_FULLSCREEN_TOGGLE_KEY },
{ "QUIT", RARCH_QUIT_KEY },
{ "STATE_SLOT_PLUS", RARCH_STATE_SLOT_PLUS },
{ "STATE_SLOT_MINUS", RARCH_STATE_SLOT_MINUS },
{ "REWIND", RARCH_REWIND },
{ "MOVIE_RECORD_TOGGLE", RARCH_MOVIE_RECORD_TOGGLE },
{ "PAUSE_TOGGLE", RARCH_PAUSE_TOGGLE },
{ "FRAMEADVANCE", RARCH_FRAMEADVANCE },
{ "RESET", RARCH_RESET },
{ "SHADER_NEXT", RARCH_SHADER_NEXT },
{ "SHADER_PREV", RARCH_SHADER_PREV },
{ "CHEAT_INDEX_PLUS", RARCH_CHEAT_INDEX_PLUS },
{ "CHEAT_INDEX_MINUS", RARCH_CHEAT_INDEX_MINUS },
{ "CHEAT_TOGGLE", RARCH_CHEAT_TOGGLE },
{ "SCREENSHOT", RARCH_SCREENSHOT },
{ "MUTE", RARCH_MUTE },
{ "OSK", RARCH_OSK },
{ "NETPLAY_FLIP", RARCH_NETPLAY_FLIP },
{ "SLOWMOTION", RARCH_SLOWMOTION },
{ "VOLUME_UP", RARCH_VOLUME_UP },
{ "VOLUME_DOWN", RARCH_VOLUME_DOWN },
{ "OVERLAY_NEXT", RARCH_OVERLAY_NEXT },
{ "DISK_EJECT_TOGGLE", RARCH_DISK_EJECT_TOGGLE },
{ "DISK_NEXT", RARCH_DISK_NEXT },
{ "DISK_PREV", RARCH_DISK_PREV },
{ "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE },
{ "MENU_TOGGLE", RARCH_MENU_TOGGLE },
{ "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP },
{ "MENU_DOWN", RETRO_DEVICE_ID_JOYPAD_DOWN },
{ "MENU_LEFT", RETRO_DEVICE_ID_JOYPAD_LEFT },
{ "MENU_RIGHT", RETRO_DEVICE_ID_JOYPAD_RIGHT },
{ "MENU_A", RETRO_DEVICE_ID_JOYPAD_A },
{ "MENU_B", RETRO_DEVICE_ID_JOYPAD_B },
};
#define COMMAND_EXT_GLSL 0x7c976537U
#define COMMAND_EXT_GLSLP 0x0f840c87U
#define COMMAND_EXT_CG 0x0059776fU
#define COMMAND_EXT_CGP 0x0b8865bfU
static bool cmd_set_shader(const char *arg)
{
char msg[256];
@@ -237,6 +236,10 @@ static bool cmd_set_shader(const char *arg)
case COMMAND_EXT_CGP:
type = RARCH_SHADER_CG;
break;
case COMMAND_EXT_SLANG:
case COMMAND_EXT_SLANGP:
type = RARCH_SHADER_SLANG;
break;
default:
return false;
}
@@ -250,10 +253,6 @@ static bool cmd_set_shader(const char *arg)
return video_driver_set_shader(type, arg);
}
static const struct cmd_action_map action_map[] = {
{ "SET_SHADER", cmd_set_shader, "<shader path>" },
};
static bool command_get_arg(const char *tok,
const char **arg, unsigned *index)
{
@@ -261,7 +260,7 @@ static bool command_get_arg(const char *tok,
for (i = 0; i < ARRAY_SIZE(map); i++)
{
if (!strcmp(tok, map[i].str))
if (string_is_equal(tok, map[i].str))
{
if (arg)
*arg = NULL;
@@ -319,7 +318,7 @@ static void parse_sub_msg(rarch_cmd_t *handle, const char *tok)
static void parse_msg(rarch_cmd_t *handle, char *buf)
{
char *save = NULL;
char *save = NULL;
const char *tok = strtok_r(buf, "\n", &save);
while (tok)
@@ -329,17 +328,6 @@ static void parse_msg(rarch_cmd_t *handle, char *buf)
}
}
void rarch_cmd_set(rarch_cmd_t *handle, unsigned id)
{
if (id < RARCH_BIND_LIST_END)
handle->state[id] = true;
}
bool rarch_cmd_get(rarch_cmd_t *handle, unsigned id)
{
return id < RARCH_BIND_LIST_END && handle->state[id];
}
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static void network_cmd_poll(rarch_cmd_t *handle)
{
@@ -380,9 +368,9 @@ static size_t read_stdin(char *buf, size_t size)
{
DWORD i;
DWORD has_read = 0;
DWORD avail = 0;
bool echo = false;
HANDLE hnd = GetStdHandle(STD_INPUT_HANDLE);
DWORD avail = 0;
bool echo = false;
HANDLE hnd = GetStdHandle(STD_INPUT_HANDLE);
if (hnd == INVALID_HANDLE_VALUE)
return 0;
@@ -523,19 +511,6 @@ static void stdin_cmd_poll(rarch_cmd_t *handle)
}
#endif
void rarch_cmd_poll(rarch_cmd_t *handle)
{
memset(handle->state, 0, sizeof(handle->state));
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
network_cmd_poll(handle);
#endif
#ifdef HAVE_STDIN_CMD
stdin_cmd_poll(handle);
#endif
}
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static bool send_udp_packet(const char *host,
uint16_t port, const char *msg)
@@ -611,7 +586,7 @@ static bool verify_command(const char *cmd)
return false;
}
bool network_cmd_send(const char *cmd_)
static bool network_cmd_send(const char *cmd_)
{
bool ret;
char *command = NULL;
@@ -655,3 +630,62 @@ bool network_cmd_send(const char *cmd_)
return ret;
}
#endif
bool rarch_cmd_ctl(enum rarch_cmd_ctl_state state, void *data)
{
switch (state)
{
case RARCH_CMD_CTL_NETWORK_SEND:
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
network_cmd_send((const char*)data);
#endif
break;
case RARCH_CMD_CTL_POLL:
{
rarch_cmd_t *handle = (rarch_cmd_t*)data;
memset(handle->state, 0, sizeof(handle->state));
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
network_cmd_poll(handle);
#endif
#ifdef HAVE_STDIN_CMD
stdin_cmd_poll(handle);
#endif
}
break;
case RARCH_CMD_CTL_SET:
{
rarch_cmd_handle_t *handle = (rarch_cmd_handle_t*)data;
if (!handle || !handle->handle)
return false;
if (handle->id < RARCH_BIND_LIST_END)
handle->handle->state[handle->id] = true;
}
break;
case RARCH_CMD_CTL_GET:
{
rarch_cmd_handle_t *handle = (rarch_cmd_handle_t*)data;
if (!handle || !handle->handle)
return false;
return handle->id < RARCH_BIND_LIST_END
&& handle->handle->state[handle->id];
}
case RARCH_CMD_CTL_FREE:
{
rarch_cmd_t *handle = (rarch_cmd_t*)data;
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
if (handle && handle->net_fd >= 0)
socket_close(handle->net_fd);
#endif
free(handle);
}
break;
case RARCH_CMD_CTL_NONE:
default:
break;
}
return true;
}
+17 -11
View File
@@ -28,22 +28,28 @@
extern "C" {
#endif
enum rarch_cmd_ctl_state
{
RARCH_CMD_CTL_NONE = 0,
RARCH_CMD_CTL_GET,
RARCH_CMD_CTL_SET,
RARCH_CMD_CTL_POLL,
RARCH_CMD_CTL_NETWORK_SEND,
RARCH_CMD_CTL_FREE
};
typedef struct rarch_cmd rarch_cmd_t;
typedef struct rarch_cmd_handle
{
rarch_cmd_t *handle;
unsigned id;
} rarch_cmd_handle_t;
rarch_cmd_t *rarch_cmd_new(bool stdin_enable,
bool network_enable, uint16_t port);
void rarch_cmd_free(rarch_cmd_t *handle);
void rarch_cmd_poll(rarch_cmd_t *handle);
void rarch_cmd_set(rarch_cmd_t *handle, unsigned id);
bool rarch_cmd_get(rarch_cmd_t *handle, unsigned id);
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
bool network_cmd_send(const char *cmd);
#endif
bool rarch_cmd_ctl(enum rarch_cmd_ctl_state state, void *data);
#ifdef __cplusplus
}
+360 -248
View File
File diff suppressed because it is too large. Load diff
+9 -16
View File
@@ -52,6 +52,8 @@ enum event_command
EVENT_CMD_QUIT,
/* Reinitialize all drivers. */
EVENT_CMD_REINIT,
/* Toggles cheevos hardcore mode. */
EVENT_CMD_CHEEVOS_HARDCORE_MODE_TOGGLE,
/* Deinitialize rewind. */
EVENT_CMD_REWIND_DEINIT,
/* Initializes rewind. */
@@ -120,6 +122,8 @@ enum event_command
EVENT_CMD_QUIT_RETROARCH,
/* Shutdown the OS */
EVENT_CMD_SHUTDOWN,
/* Reboot the OS */
EVENT_CMD_REBOOT,
/* Resume RetroArch when in menu. */
EVENT_CMD_RESUME,
/* Toggles pause. */
@@ -176,10 +180,6 @@ enum event_command
EVENT_CMD_REMOTE_INIT,
/* Deinitializes remote gamepad interface. */
EVENT_CMD_REMOTE_DEINIT,
/* Deinitializes drivers. */
EVENT_CMD_DRIVERS_DEINIT,
/* Initializes drivers. */
EVENT_CMD_DRIVERS_INIT,
/* Reinitializes audio driver. */
EVENT_CMD_AUDIO_REINIT,
/* Resizes windowed scale. Will reinitialize video driver. */
@@ -194,6 +194,8 @@ enum event_command
EVENT_CMD_DISK_NEXT,
/* Cycle to previous disk. */
EVENT_CMD_DISK_PREV,
/* Appends disk image to disk image list. */
EVENT_CMD_DISK_APPEND_IMAGE,
/* Stops rumbling. */
EVENT_CMD_RUMBLE_STOP,
/* Toggles mouse grab. */
@@ -201,20 +203,11 @@ enum event_command
/* Toggles fullscreen mode. */
EVENT_CMD_FULLSCREEN_TOGGLE,
EVENT_CMD_PERFCNT_REPORT_FRONTEND_LOG,
EVENT_CMD_REMAPPING_INIT,
EVENT_CMD_REMAPPING_DEINIT,
EVENT_CMD_VOLUME_UP,
EVENT_CMD_VOLUME_DOWN
EVENT_CMD_VOLUME_DOWN,
EVENT_CMD_EXEC
};
/**
* event_disk_control_append_image:
* @path : Path to disk image.
*
* Appends disk image to disk image list.
**/
void event_disk_control_append_image(const char *path);
/**
* event_command:
* @cmd : Command index.
@@ -223,7 +216,7 @@ void event_disk_control_append_image(const char *path);
*
* Returns: true (1) on success, otherwise false (0).
**/
bool event_command(enum event_command action);
bool event_cmd_ctl(enum event_command action, void *data);
#ifdef __cplusplus
}
+16
View File
@@ -29,6 +29,7 @@
enum
{
VIDEO_GL = 0,
VIDEO_VULKAN,
VIDEO_XVIDEO,
VIDEO_SDL,
VIDEO_SDL2,
@@ -508,6 +509,9 @@ static const bool overlay_hide_in_menu = true;
#ifdef HAVE_MENU
static bool default_block_config_read = true;
static unsigned xmb_scale_factor = 100;
static unsigned xmb_alpha_factor = 75;
static bool show_advanced_settings = true;
static const uint32_t menu_entry_normal_color = 0xffffffff;
static const uint32_t menu_entry_hover_color = 0xff64ff64;
@@ -577,6 +581,9 @@ static const bool post_filter_record = false;
/* Screenshots post-shaded GPU output if available. */
static const bool gpu_screenshot = true;
/* Screenshots named automatically. */
static const bool auto_screenshot_filename = true;
/* Record post-shaded GPU output instead of raw game footage if available. */
static const bool gpu_record = false;
@@ -625,7 +632,12 @@ static const char *audio_device = NULL;
/* Desired audio latency in milliseconds. Might not be honored
* if driver can't provide given latency. */
#ifdef ANDROID
/* For most Android devices, 64ms is way too low. */
static const int out_latency = 128;
#else
static const int out_latency = 64;
#endif
/* Will sync audio. (recommended) */
static const bool audio_sync = true;
@@ -751,12 +763,16 @@ static const bool input_descriptor_hide_unbound = false;
static const unsigned input_max_users = 5;
static const unsigned input_poll_type_behavior = 2;
#ifdef IOS
static const bool ui_companion_start_on_boot = false;
#else
static const bool ui_companion_start_on_boot = true;
#endif
static const bool ui_companion_enable = false;
#if defined(ANDROID)
#if defined(ANDROID_ARM)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/";
+6
View File
@@ -74,6 +74,12 @@ static const bool _opengl_supp = true;
static const bool _opengl_supp = false;
#endif
#ifdef HAVE_VULKAN
static const bool _vulkan_supp = true;
#else
static const bool _vulkan_supp = false;
#endif
#if defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3)
static const bool _opengles_supp = true;
#else
+109 -90
View File
@@ -21,6 +21,7 @@
#include <compat/strl.h>
#include <compat/posix_string.h>
#include <retro_stat.h>
#include <retro_assert.h>
#include <string/stdstring.h>
#include "audio/audio_driver.h"
@@ -35,6 +36,10 @@
#include "system.h"
#include "verbosity.h"
#ifdef HAVE_NETPLAY
#include "netplay/netplay.h"
#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -474,6 +479,11 @@ static void config_set_defaults(void)
if (def_menu)
strlcpy(settings->menu.driver,
def_menu, sizeof(settings->menu.driver));
settings->menu.xmb_scale_factor = xmb_scale_factor;
settings->menu.xmb_alpha_factor = xmb_alpha_factor;
settings->menu.xmb_font[0] = '\0';
settings->menu.throttle_framerate = true;
settings->menu.linear_filter = true;
#endif
settings->history_list_enable = def_history_list_enable;
@@ -482,8 +492,9 @@ static void config_set_defaults(void)
#if TARGET_OS_IPHONE
settings->input.small_keyboard_enable = false;
#endif
settings->input.keyboard_gamepad_enable = true;
settings->input.keyboard_gamepad_mapping_type = 1;
settings->input.keyboard_gamepad_enable = true;
settings->input.keyboard_gamepad_mapping_type = 1;
settings->input.poll_type_behavior = 2;
#ifdef HAVE_FFMPEG
settings->multimedia.builtin_mediaplayer_enable = true;
#else
@@ -546,6 +557,7 @@ static void config_set_defaults(void)
settings->video.post_filter_record = post_filter_record;
settings->video.gpu_record = gpu_record;
settings->video.gpu_screenshot = gpu_screenshot;
settings->auto_screenshot_filename = auto_screenshot_filename;
settings->video.rotation = ORIENTATION_NORMAL;
settings->audio.enable = audio_enable;
@@ -612,6 +624,7 @@ static void config_set_defaults(void)
#endif
settings->ui.companion_start_on_boot = ui_companion_start_on_boot;
settings->ui.companion_enable = ui_companion_enable;
settings->ui.menubar_enable = true;
settings->ui.suspend_screensaver_enable = true;
@@ -621,6 +634,7 @@ static void config_set_defaults(void)
#ifdef HAVE_CHEEVOS
settings->cheevos.enable = false;
settings->cheevos.test_unofficial = false;
settings->cheevos.hardcore_mode_enable = false;
*settings->cheevos.username = '\0';
*settings->cheevos.password = '\0';
#endif
@@ -691,7 +705,7 @@ static void config_set_defaults(void)
settings->input.libretro_device[i] = RETRO_DEVICE_JOYPAD;
}
settings->core.set_supports_no_game_enable = true;
settings->set_supports_no_game_enable = true;
video_driver_ctl(RARCH_DISPLAY_CTL_RESET_CUSTOM_VIEWPORT, NULL);
@@ -897,7 +911,7 @@ static void config_set_defaults(void)
rarch_ctl(RARCH_CTL_SET_BLOCK_CONFIG_READ, NULL);
else
rarch_ctl(RARCH_CTL_UNSET_BLOCK_CONFIG_READ, NULL);
first_initialized = false;
}
@@ -1308,6 +1322,10 @@ static bool config_load_file(const char *path, bool set_defaults)
"threaded_data_runloop_enable");
#endif
CONFIG_GET_BOOL_BASE(conf, settings, menu.throttle_framerate,
"menu_throttle_framerate");
CONFIG_GET_BOOL_BASE(conf, settings, menu.linear_filter,
"menu_linear_filter");
CONFIG_GET_BOOL_BASE(conf, settings, menu.dpi.override_enable,
"dpi_override_enable");
CONFIG_GET_INT_BASE (conf, settings, menu.dpi.override_value,
@@ -1342,7 +1360,7 @@ static bool config_load_file(const char *path, bool set_defaults)
&settings->menu.title_color);
config_get_path(conf, "menu_wallpaper",
settings->menu.wallpaper, sizeof(settings->menu.wallpaper));
if (!strcmp(settings->menu.wallpaper, "default"))
if (string_is_equal(settings->menu.wallpaper, "default"))
*settings->menu.wallpaper = '\0';
#endif
@@ -1356,8 +1374,8 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL_BASE(conf, settings, video.black_frame_insertion, "video_black_frame_insertion");
CONFIG_GET_INT_BASE(conf, settings, video.swap_interval, "video_swap_interval");
settings->video.swap_interval = max(settings->video.swap_interval, 1);
settings->video.swap_interval = min(settings->video.swap_interval, 4);
settings->video.swap_interval = MAX(settings->video.swap_interval, 1);
settings->video.swap_interval = MIN(settings->video.swap_interval, 4);
CONFIG_GET_BOOL_BASE(conf, settings, video.threaded, "video_threaded");
CONFIG_GET_BOOL_BASE(conf, settings, video.shared_context, "video_shared_context");
#ifdef GEKKO
@@ -1387,7 +1405,7 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL_BASE(conf, settings, video.force_srgb_disable, "video_force_srgb_disable");
CONFIG_GET_BOOL_BASE(conf, settings, core.set_supports_no_game_enable, "core_set_supports_no_game_enable");
CONFIG_GET_BOOL_BASE(conf, settings, set_supports_no_game_enable, "core_set_supports_no_game_enable");
#ifdef RARCH_CONSOLE
/* TODO - will be refactored later to make it more clean - it's more
@@ -1415,15 +1433,15 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL_BASE(conf, settings, video.gpu_screenshot, "video_gpu_screenshot");
config_get_path(conf, "video_shader_dir", settings->video.shader_dir, sizeof(settings->video.shader_dir));
if (!strcmp(settings->video.shader_dir, "default"))
if (string_is_equal(settings->video.shader_dir, "default"))
*settings->video.shader_dir = '\0';
config_get_path(conf, "video_filter_dir", settings->video.filter_dir, sizeof(settings->video.filter_dir));
if (!strcmp(settings->video.filter_dir, "default"))
if (string_is_equal(settings->video.filter_dir, "default"))
*settings->video.filter_dir = '\0';
config_get_path(conf, "audio_filter_dir", settings->audio.filter_dir, sizeof(settings->audio.filter_dir));
if (!strcmp(settings->audio.filter_dir, "default"))
if (string_is_equal(settings->audio.filter_dir, "default"))
*settings->audio.filter_dir = '\0';
CONFIG_GET_BOOL_BASE(conf, settings, input.back_as_menu_toggle_enable, "back_as_menu_toggle_enable");
@@ -1436,6 +1454,7 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_BOOL_BASE(conf, settings, input.input_descriptor_hide_unbound, "input_descriptor_hide_unbound");
CONFIG_GET_BOOL_BASE(conf, settings, ui.companion_start_on_boot, "ui_companion_start_on_boot");
CONFIG_GET_BOOL_BASE(conf, settings, ui.companion_enable, "ui_companion_enable");
config_get_path(conf, "core_updater_buildbot_url",
settings->network.buildbot_url, sizeof(settings->network.buildbot_url));
@@ -1498,6 +1517,7 @@ static bool config_load_file(const char *path, bool set_defaults)
#ifdef HAVE_CHEEVOS
CONFIG_GET_BOOL_BASE(conf, settings, cheevos.enable, "cheevos_enable");
CONFIG_GET_BOOL_BASE(conf, settings, cheevos.test_unofficial, "cheevos_test_unofficial");
CONFIG_GET_BOOL_BASE(conf, settings, cheevos.hardcore_mode_enable, "cheevos_hardcore_mode_enable");
config_get_array(conf, "cheevos_username", settings->cheevos.username, sizeof(settings->cheevos.username));
config_get_array(conf, "cheevos_password", settings->cheevos.password, sizeof(settings->cheevos.password));
#endif
@@ -1509,6 +1529,9 @@ static bool config_load_file(const char *path, bool set_defaults)
config_get_array(conf, "location_driver", settings->location.driver, sizeof(settings->location.driver));
#ifdef HAVE_MENU
config_get_array(conf, "menu_driver", settings->menu.driver, sizeof(settings->menu.driver));
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_scale_factor, "xmb_scale_factor");
CONFIG_GET_INT_BASE(conf, settings, menu.xmb_alpha_factor, "xmb_alpha_factor");
config_get_path(conf, "xmb_font", settings->menu.xmb_font, sizeof(settings->menu.xmb_font));
#endif
config_get_array(conf, "video_context_driver", settings->video.context_driver, sizeof(settings->video.context_driver));
config_get_array(conf, "audio_driver", settings->audio.driver, sizeof(settings->audio.driver));
@@ -1545,7 +1568,7 @@ static bool config_load_file(const char *path, bool set_defaults)
config_get_path(conf, "screenshot_directory", settings->screenshot_directory, sizeof(settings->screenshot_directory));
if (*settings->screenshot_directory)
{
if (!strcmp(settings->screenshot_directory, "default"))
if (string_is_equal(settings->screenshot_directory, "default"))
*settings->screenshot_directory = '\0';
else if (!path_is_directory(settings->screenshot_directory))
{
@@ -1553,9 +1576,8 @@ static bool config_load_file(const char *path, bool set_defaults)
*settings->screenshot_directory = '\0';
}
}
CONFIG_GET_BOOL_BASE(conf, settings, auto_screenshot_filename, "auto_screenshot_filename");
config_get_path(conf, "input_remapping_path", settings->input.remapping_path,
sizeof(settings->input.remapping_path));
config_get_path(conf, "resampler_directory", settings->resampler_directory,
sizeof(settings->resampler_directory));
config_get_path(conf, "cache_directory", settings->cache_directory,
@@ -1572,24 +1594,24 @@ static bool config_load_file(const char *path, bool set_defaults)
sizeof(settings->boxarts_directory));
config_get_path(conf, "playlist_directory", settings->playlist_directory,
sizeof(settings->playlist_directory));
if (!strcmp(settings->core_assets_directory, "default"))
if (string_is_equal(settings->core_assets_directory, "default"))
*settings->core_assets_directory = '\0';
if (!strcmp(settings->assets_directory, "default"))
if (string_is_equal(settings->assets_directory, "default"))
*settings->assets_directory = '\0';
if (!strcmp(settings->dynamic_wallpapers_directory, "default"))
if (string_is_equal(settings->dynamic_wallpapers_directory, "default"))
*settings->dynamic_wallpapers_directory = '\0';
if (!strcmp(settings->boxarts_directory, "default"))
if (string_is_equal(settings->boxarts_directory, "default"))
*settings->boxarts_directory = '\0';
if (!strcmp(settings->playlist_directory, "default"))
if (string_is_equal(settings->playlist_directory, "default"))
*settings->playlist_directory = '\0';
#ifdef HAVE_MENU
config_get_path(conf, "rgui_browser_directory", settings->menu_content_directory,
sizeof(settings->menu_content_directory));
if (!strcmp(settings->menu_content_directory, "default"))
if (string_is_equal(settings->menu_content_directory, "default"))
*settings->menu_content_directory = '\0';
config_get_path(conf, "rgui_config_directory", settings->menu_config_directory,
sizeof(settings->menu_config_directory));
if (!strcmp(settings->menu_config_directory, "default"))
if (string_is_equal(settings->menu_config_directory, "default"))
*settings->menu_config_directory = '\0';
CONFIG_GET_BOOL_BASE(conf, settings, menu_show_start_screen, "rgui_show_start_screen");
#endif
@@ -1621,6 +1643,7 @@ static bool config_load_file(const char *path, bool set_defaults)
#endif
CONFIG_GET_BOOL_BASE(conf, settings, input.keyboard_gamepad_enable, "keyboard_gamepad_enable");
CONFIG_GET_INT_BASE(conf, settings, input.keyboard_gamepad_mapping_type, "keyboard_gamepad_mapping_type");
CONFIG_GET_INT_BASE(conf, settings, input.poll_type_behavior, "input_poll_type_behavior");
config_get_path(conf, "recording_output_directory", global->record.output_dir,
sizeof(global->record.output_dir));
@@ -1629,7 +1652,7 @@ static bool config_load_file(const char *path, bool set_defaults)
#ifdef HAVE_OVERLAY
config_get_path(conf, "overlay_directory", settings->overlay_directory, sizeof(settings->overlay_directory));
if (!strcmp(settings->overlay_directory, "default"))
if (string_is_equal(settings->overlay_directory, "default"))
*settings->overlay_directory = '\0';
config_get_path(conf, "input_overlay", settings->input.overlay, sizeof(settings->input.overlay));
@@ -1640,7 +1663,7 @@ static bool config_load_file(const char *path, bool set_defaults)
CONFIG_GET_FLOAT_BASE(conf, settings, input.overlay_scale, "input_overlay_scale");
config_get_path(conf, "osk_overlay_directory", global->dir.osk_overlay, sizeof(global->dir.osk_overlay));
if (!strcmp(global->dir.osk_overlay, "default"))
if (string_is_equal(global->dir.osk_overlay, "default"))
*global->dir.osk_overlay = '\0';
config_get_path(conf, "input_osk_overlay", settings->osk.overlay, sizeof(settings->osk.overlay));
@@ -1707,7 +1730,7 @@ static bool config_load_file(const char *path, bool set_defaults)
config_get_bool(conf, tmp, &settings->network_remote_enable_user[i]);
}
CONFIG_GET_INT_BASE(conf, settings, network_remote_base_port, "network_remote_base_port");
#endif
CONFIG_GET_BOOL_BASE(conf, settings, debug_panel_enable, "debug_panel_enable");
@@ -1750,7 +1773,7 @@ static bool config_load_file(const char *path, bool set_defaults)
if (!global->has_set.save_path &&
config_get_path(conf, "savefile_directory", tmp_str, sizeof(tmp_str)))
{
if (!strcmp(tmp_str, "default"))
if (string_is_equal(tmp_str, "default"))
strlcpy(global->dir.savefile, g_defaults.dir.sram,
sizeof(global->dir.savefile));
else if (path_is_directory(tmp_str))
@@ -1769,7 +1792,7 @@ static bool config_load_file(const char *path, bool set_defaults)
if (!global->has_set.state_path &&
config_get_path(conf, "savestate_directory", tmp_str, sizeof(tmp_str)))
{
if (!strcmp(tmp_str, "default"))
if (string_is_equal(tmp_str, "default"))
strlcpy(global->dir.savestate, g_defaults.dir.savestate,
sizeof(global->dir.savestate));
else if (path_is_directory(tmp_str))
@@ -1809,7 +1832,7 @@ static bool config_load_file(const char *path, bool set_defaults)
*settings->system_directory = '\0';
}
if (!strcmp(settings->system_directory, "default"))
if (string_is_equal(settings->system_directory, "default"))
{
RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR\n");
*settings->system_directory = '\0';
@@ -1848,7 +1871,7 @@ static void config_load_core_specific(void)
if (!*settings->libretro)
return;
#ifdef HAVE_DYNAMIC
if (global->inited.core.type == CORE_TYPE_DUMMY)
if (rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
return;
#endif
@@ -1918,10 +1941,10 @@ static void config_load_core_specific(void)
*/
bool config_load_override(void)
{
char buf[PATH_MAX_LENGTH] = {0};
char config_directory[PATH_MAX_LENGTH] = {0}; /* path to the directory containing retroarch.cfg (prefix) */
char core_path[PATH_MAX_LENGTH] = {0}; /* final path for core-specific configuration (prefix+suffix) */
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
char buf[PATH_MAX_LENGTH];
char config_directory[PATH_MAX_LENGTH];
char core_path[PATH_MAX_LENGTH];
char game_path[PATH_MAX_LENGTH];
config_file_t *new_conf = NULL;
const char *core_name = NULL;
const char *game_name = NULL;
@@ -1929,51 +1952,40 @@ bool config_load_override(void)
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
if (!global || !settings || !system)
{
RARCH_ERR("Couldn't load override config file.\n");
return false;
}
/* Early return in case a library isn't loaded */
if (string_is_empty(system->info.library_name) || !strcmp(system->info.library_name,"No Core"))
return false;
core_name = system ? system->info.library_name : NULL;
game_name = global ? path_basename(global->name.base) : NULL;
if (system)
core_name = system->info.library_name;
if (global)
game_name = path_basename(global->name.base);
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
RARCH_LOG("Overrides: core name: %s\n", core_name);
RARCH_LOG("Overrides: game name: %s\n", game_name);
/* Config directory: config_directory.
* Try config directory setting first,
* fallback to the location of the current configuration file. */
if (!string_is_empty(settings->menu_config_directory))
strlcpy(config_directory, settings->menu_config_directory, PATH_MAX_LENGTH);
strlcpy(config_directory,
settings->menu_config_directory, sizeof(config_directory));
else if (!string_is_empty(global->path.config))
fill_pathname_basedir(config_directory, global->path.config, PATH_MAX_LENGTH);
fill_pathname_basedir(config_directory,
global->path.config, sizeof(config_directory));
else
{
RARCH_WARN("Overrides: no config directory set\n");
return false;
}
RARCH_LOG("Overrides: config directory: %s\n", config_directory);
/* Concatenate strings into full paths for core_path, game_path */
fill_pathname_join(core_path, config_directory, core_name, PATH_MAX_LENGTH);
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
strlcat(core_path, ".cfg", PATH_MAX_LENGTH);
fill_pathname_join(game_path,
config_directory, core_name, sizeof(game_path));
fill_string_join(game_path, game_name, sizeof(game_path));
strlcat(game_path, ".cfg", sizeof(game_path));
fill_pathname_join(core_path,
config_directory, core_name, sizeof(core_path));
fill_string_join(core_path, core_name, sizeof(core_path));
strlcat(core_path, ".cfg", sizeof(core_path));
fill_pathname_join(game_path, config_directory, core_name, PATH_MAX_LENGTH);
fill_pathname_join(game_path, game_path, game_name, PATH_MAX_LENGTH);
strlcat(game_path, ".cfg", PATH_MAX_LENGTH);
/* Create a new config file from core_path */
new_conf = config_file_new(core_path);
@@ -2030,7 +2042,7 @@ bool config_load_override(void)
}
#ifdef HAVE_NETPLAY
if (global->netplay.enable)
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
{
RARCH_WARN("Overrides: can't use overrides in conjunction with netplay, disabling overrides\n");
return false;
@@ -2038,7 +2050,7 @@ bool config_load_override(void)
#endif
/* Store the libretro_path we're using since it will be overwritten by the override when reloading */
strlcpy(buf,settings->libretro,sizeof(buf));
strlcpy(buf, settings->libretro, sizeof(buf));
/* Toggle has_save_path to false so it resets */
global->has_set.save_path = false;
@@ -2049,7 +2061,7 @@ bool config_load_override(void)
/* Restore the libretro_path we're using
* since it will be overwritten by the override when reloading. */
strlcpy(settings->libretro,buf,sizeof(settings->libretro));
strlcpy(settings->libretro, buf, sizeof(settings->libretro));
runloop_msg_queue_push("Configuration override loaded", 1, 100, true);
/* Reset save paths */
@@ -2108,24 +2120,22 @@ bool config_load_override(void)
*/
bool config_load_remap(void)
{
char remap_directory[PATH_MAX_LENGTH]; /* path to the directory containing retroarch.cfg (prefix) */
char core_path[PATH_MAX_LENGTH]; /* final path for core-specific configuration (prefix+suffix) */
char game_path[PATH_MAX_LENGTH]; /* final path for game-specific configuration (prefix+suffix) */
config_file_t *new_conf = NULL;
const char *core_name = NULL;
const char *game_name = NULL;
char remap_directory[PATH_MAX_LENGTH] = {0}; /* path to the directory containing retroarch.cfg (prefix) */
char core_path[PATH_MAX_LENGTH] = {0}; /* final path for core-specific configuration (prefix+suffix) */
char game_path[PATH_MAX_LENGTH] = {0}; /* final path for game-specific configuration (prefix+suffix) */
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
/* Early return in case a library isn't loaded or remapping is disabled */
if (!system->info.library_name || !strcmp(system->info.library_name,"No Core"))
return false;
core_name = system ? system->info.library_name : NULL;
game_name = global ? path_basename(global->name.base) : NULL;
if (system)
core_name = system->info.library_name;
if (global)
game_name = path_basename(global->name.base);
if (string_is_empty(core_name) || string_is_empty(game_name))
return false;
@@ -2136,22 +2146,22 @@ bool config_load_remap(void)
/* Remap directory: remap_directory.
* Try remap directory setting, no fallbacks defined */
if (string_is_empty(settings->input_remapping_directory))
{
RARCH_WARN("Remaps: no remap directory set.\n");
return false;
}
strlcpy(remap_directory, settings->input_remapping_directory, PATH_MAX_LENGTH);
strlcpy(remap_directory,
settings->input_remapping_directory, sizeof(remap_directory));
RARCH_LOG("Remaps: remap directory: %s\n", remap_directory);
/* Concatenate strings into full paths for core_path, game_path */
fill_pathname_join(core_path, remap_directory, core_name, PATH_MAX_LENGTH);
fill_pathname_join(core_path, core_path, core_name, PATH_MAX_LENGTH);
strlcat(core_path, ".rmp", PATH_MAX_LENGTH);
fill_pathname_join(core_path,
remap_directory, core_name, sizeof(core_path));
fill_string_join(core_path, core_name, sizeof(core_path));
strlcat(core_path, ".rmp", sizeof(core_path));
fill_pathname_join(game_path, remap_directory, core_name, PATH_MAX_LENGTH);
fill_pathname_join(game_path, game_path, game_name, PATH_MAX_LENGTH);
strlcat(game_path, ".rmp", PATH_MAX_LENGTH);
fill_pathname_join(game_path,
remap_directory, core_name, sizeof(game_path));
fill_string_join(game_path, game_name, sizeof(game_path));
strlcat(game_path, ".rmp", sizeof(game_path));
/* Create a new config file from game_path */
new_conf = config_file_new(game_path);
@@ -2169,7 +2179,6 @@ bool config_load_remap(void)
else
{
RARCH_LOG("Remaps: no game-specific remap found at %s\n", game_path);
*settings->input.remapping_path= '\0';
input_remapping_set_defaults();
}
@@ -2189,7 +2198,6 @@ bool config_load_remap(void)
else
{
RARCH_LOG("Remaps: no core-specific remap found at %s\n", core_path);
*settings->input.remapping_path= '\0';
input_remapping_set_defaults();
}
@@ -2410,6 +2418,7 @@ void config_load(void)
config_load_core_specific();
}
#if 0
/**
* config_save_keybinds_file:
* @path : Path that shall be written to.
@@ -2418,7 +2427,7 @@ void config_load(void)
*
* Returns: true (1) on success, otherwise returns false (0).
**/
bool config_save_keybinds_file(const char *path)
static bool config_save_keybinds_file(const char *path)
{
unsigned i = 0;
bool ret = false;
@@ -2439,6 +2448,7 @@ bool config_save_keybinds_file(const char *path)
config_file_free(conf);
return ret;
}
#endif
/**
@@ -2532,6 +2542,7 @@ bool config_save_file(const char *path)
config_set_float(conf, "input_axis_threshold",
settings->input.axis_threshold);
config_set_bool(conf, "ui_companion_start_on_boot", settings->ui.companion_start_on_boot);
config_set_bool(conf, "ui_companion_enable", settings->ui.companion_enable);
config_set_bool(conf, "video_gpu_record", settings->video.gpu_record);
config_set_bool(conf, "input_remap_binds_enable",
settings->input.remap_binds_enable);
@@ -2614,6 +2625,8 @@ bool config_save_file(const char *path)
settings->threaded_data_runloop_enable);
#endif
config_set_bool(conf, "menu_throttle_framerate", settings->menu.throttle_framerate);
config_set_bool(conf, "menu_linear_filter", settings->menu.linear_filter);
config_set_bool(conf, "dpi_override_enable", settings->menu.dpi.override_enable);
config_set_int (conf, "dpi_override_value", settings->menu.dpi.override_value);
config_set_string(conf,"menu_driver", settings->menu.driver);
@@ -2643,6 +2656,8 @@ bool config_save_file(const char *path)
config_set_path(conf, "screenshot_directory",
*settings->screenshot_directory ?
settings->screenshot_directory : "default");
config_set_bool(conf, "auto_screenshot_filename",
settings->auto_screenshot_filename);
config_set_int(conf, "aspect_ratio_index", settings->video.aspect_ratio_idx);
config_set_string(conf, "audio_device", settings->audio.device);
config_set_string(conf, "video_filter", settings->video.softfilter_plugin);
@@ -2659,6 +2674,7 @@ bool config_save_file(const char *path)
#ifdef HAVE_CHEEVOS
config_set_bool(conf, "cheevos_enable", settings->cheevos.enable);
config_set_bool(conf, "cheevos_test_unofficial", settings->cheevos.test_unofficial);
config_set_bool(conf, "cheevos_hardcore_mode_enable", settings->cheevos.hardcore_mode_enable);
config_set_string(conf, "cheevos_username", settings->cheevos.username);
config_set_string(conf, "cheevos_password", settings->cheevos.password);
#endif
@@ -2694,8 +2710,6 @@ bool config_save_file(const char *path)
settings->cache_directory);
config_set_path(conf, "input_remapping_directory",
settings->input_remapping_directory);
config_set_path(conf, "input_remapping_path",
settings->input.remapping_path);
config_set_path(conf, "resampler_directory",
settings->resampler_directory);
config_set_string(conf, "audio_resampler", settings->audio.resampler);
@@ -2729,6 +2743,10 @@ bool config_save_file(const char *path)
*settings->playlist_directory ?
settings->playlist_directory : "default");
#ifdef HAVE_MENU
config_set_int(conf, "xmb_scale_factor", settings->menu.xmb_scale_factor);
config_set_int(conf, "xmb_alpha_factor", settings->menu.xmb_alpha_factor);
config_set_path(conf, "xmb_font",
!string_is_empty(settings->menu.xmb_font) ? settings->menu.xmb_font : "");
config_set_path(conf, "rgui_browser_directory",
*settings->menu_content_directory ?
settings->menu_content_directory : "default");
@@ -2893,9 +2911,10 @@ bool config_save_file(const char *path)
#endif
config_set_bool(conf, "keyboard_gamepad_enable", settings->input.keyboard_gamepad_enable);
config_set_int(conf, "keyboard_gamepad_mapping_type", settings->input.keyboard_gamepad_mapping_type);
config_set_int(conf, "input_poll_type_behavior", settings->input.poll_type_behavior);
config_set_bool(conf, "core_set_supports_no_game_enable",
settings->core.set_supports_no_game_enable);
settings->set_supports_no_game_enable);
config_set_int(conf, "menu_ok_btn", settings->menu_ok_btn);
config_set_int(conf, "menu_cancel_btn", settings->menu_cancel_btn);
+12 -17
View File
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2016 - Daniel De Matteis
*
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
@@ -112,6 +112,7 @@ typedef struct settings
bool menubar_enable;
bool suspend_screensaver_enable;
bool companion_start_on_boot;
bool companion_enable;
} ui;
#ifdef HAVE_MENU
@@ -163,6 +164,11 @@ typedef struct settings
unsigned entry_normal_color;
unsigned entry_hover_color;
unsigned title_color;
unsigned xmb_scale_factor;
unsigned xmb_alpha_factor;
char xmb_font[PATH_MAX_LENGTH];
bool throttle_framerate;
bool linear_filter;
} menu;
#endif
@@ -252,8 +258,6 @@ typedef struct settings
bool input_descriptor_label_show;
bool input_descriptor_hide_unbound;
char remapping_path[PATH_MAX_LENGTH];
unsigned menu_toggle_gamepad_combo;
bool back_as_menu_toggle_enable;
@@ -262,6 +266,7 @@ typedef struct settings
#endif
bool keyboard_gamepad_enable;
unsigned keyboard_gamepad_mapping_type;
unsigned poll_type_behavior;
} input;
struct
@@ -284,10 +289,7 @@ typedef struct settings
bool buildbot_auto_extract_archive;
} network;
struct
{
bool set_supports_no_game_enable;
} core;
bool set_supports_no_game_enable;
struct
{
@@ -300,6 +302,7 @@ typedef struct settings
{
bool enable;
bool test_unofficial;
bool hardcore_mode_enable;
char username[32];
char password[32];
} cheevos;
@@ -334,6 +337,8 @@ typedef struct settings
char screenshot_directory[PATH_MAX_LENGTH];
char system_directory[PATH_MAX_LENGTH];
bool auto_screenshot_filename;
char cache_directory[PATH_MAX_LENGTH];
char playlist_directory[PATH_MAX_LENGTH];
@@ -520,16 +525,6 @@ bool config_unload_override(void);
*/
bool config_load_remap(void);
/**
* config_save_keybinds_file:
* @path : Path that shall be written to.
*
* Writes a keybinds config file to disk.
*
* Returns: true (1) on success, otherwise returns false (0).
**/
bool config_save_keybinds_file(const char *path);
/**
* config_save_autoconf_profile:
* @path : Path that shall be written to.
+1356 -288
View File
File diff suppressed because it is too large. Load diff
+69 -52
View File
@@ -17,73 +17,90 @@
#ifndef __RARCH_FILE_H
#define __RARCH_FILE_H
#include <boolean.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <sys/types.h>
#include <boolean.h>
#include "frontend/frontend_driver.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Handles files related to libretro. */
enum content_ctl_state
{
CONTENT_CTL_NONE = 0,
/**
* load_state:
* @path : path that state will be loaded from.
*
* Load a state from disk to memory.
*
* Returns: true if successful, false otherwise.
**/
bool load_state(const char *path);
CONTENT_CTL_IS_INITED,
/**
* save_state:
* @path : path of saved state that shall be written to.
*
* Save a state from memory to disk.
*
* Returns: true if successful, false otherwise.
**/
bool save_state(const char *path);
CONTENT_CTL_DOES_NOT_NEED_CONTENT,
/**
* load_ram_file:
* @path : path of RAM state that will be loaded from.
* @type : type of memory
*
* Load a RAM state from disk to memory.
*/
void load_ram_file(const char *path, int type);
CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT,
/**
* save_ram_file:
* @path : path of RAM state that shall be written to.
* @type : type of memory
*
* Save a RAM state from memory to disk.
*
* In case the file could not be written to, a fallback function
* 'dump_to_file_desperate' will be called.
*/
void save_ram_file(const char *path, int type);
CONTENT_CTL_UNSET_DOES_NOT_NEED_CONTENT,
/**
* init_content_file:
*
* Initializes and loads a content file for the currently
* selected libretro core.
*
* global->content_is_init will be set to the return value
* on exit.
*
* Returns : true if successful, otherwise false.
**/
bool init_content_file(void);
/* Initializes and loads a content file for the currently
* selected libretro core. */
CONTENT_CTL_INIT,
void content_temporary_free(void);
CONTENT_CTL_DEINIT,
/* Loads content file and starts up RetroArch.
* If no content file can be loaded, will start up RetroArch
* as-is. */
CONTENT_CTL_LOAD,
CONTENT_CTL_GET_CRC,
/* Load a RAM state from disk to memory. */
CONTENT_CTL_LOAD_RAM_FILE,
/* Save a RAM state from memory to disk. */
CONTENT_CTL_SAVE_RAM_FILE,
/* Load a state from disk to memory. */
CONTENT_CTL_LOAD_STATE,
/* Save a state from memory to disk. */
CONTENT_CTL_SAVE_STATE,
/* Frees temporary content handle. */
CONTENT_CTL_TEMPORARY_FREE,
CONTENT_CTL_STREAM_INIT,
CONTENT_CTL_STREAM_CRC_CALCULATE
};
typedef struct ram_type
{
const char *path;
int type;
} ram_type_t;
typedef struct content_stream
{
uint32_t a;
const uint8_t *b;
size_t c;
uint32_t crc;
} content_stream_t;
typedef struct content_ctx_info
{
int argc; /* Argument count. */
char **argv; /* Argument variable list. */
void *args; /* Arguments passed from callee */
environment_get_t environ_get; /* Function passed for environment_get function */
} content_ctx_info_t;
void content_push_to_history_playlist(bool do_push,
const char *path, void *data);
bool content_ctl(enum content_ctl_state state, void *data);
#ifdef __cplusplus
}
+276 -184
View File
@@ -16,10 +16,14 @@
*/
#include <file/file_path.h>
#include <file/file_extract.h>
#include <file/dir_list.h>
#include <file/file_archive.h>
#include <compat/strl.h>
#include <string/stdstring.h>
#include "core_info.h"
#include "general.h"
#include "configuration.h"
#include "dir_list_special.h"
#include "config.def.h"
@@ -27,6 +31,9 @@
#include "config.h"
#endif
static const char *core_info_tmp_path = NULL;
static const struct string_list *core_info_tmp_list = NULL;
static void core_info_list_resolve_all_extensions(
core_info_list_t *core_info_list)
{
@@ -103,13 +110,91 @@ static void core_info_list_resolve_all_firmware(
}
}
static void core_info_list_free(core_info_list_t *core_info_list)
{
size_t i, j;
if (!core_info_list)
return;
for (i = 0; i < core_info_list->count; i++)
{
core_info_t *info = (core_info_t*)&core_info_list->list[i];
if (!info)
continue;
free(info->path);
free(info->core_name);
free(info->systemname);
free(info->system_manufacturer);
free(info->display_name);
free(info->supported_extensions);
free(info->authors);
free(info->permissions);
free(info->licenses);
free(info->categories);
free(info->databases);
free(info->notes);
if (info->supported_extensions_list)
string_list_free(info->supported_extensions_list);
string_list_free(info->authors_list);
string_list_free(info->note_list);
string_list_free(info->permissions_list);
string_list_free(info->licenses_list);
string_list_free(info->categories_list);
string_list_free(info->databases_list);
config_file_free((config_file_t*)info->config_data);
for (j = 0; j < info->firmware_count; j++)
{
free(info->firmware[j].path);
free(info->firmware[j].desc);
}
free(info->firmware);
}
free(core_info_list->all_ext);
free(core_info_list->list);
free(core_info_list);
}
static config_file_t *core_info_list_iterate(
struct string_list *contents, size_t i)
{
char info_path_base[PATH_MAX_LENGTH];
char info_path[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
if (!contents->elems[i].data)
return NULL;
fill_pathname_base(info_path_base, contents->elems[i].data,
sizeof(info_path_base));
path_remove_extension(info_path_base);
#if defined(RARCH_MOBILE) || (defined(RARCH_CONSOLE) && !defined(PSP))
char *substr = strrchr(info_path_base, '_');
if (substr)
*substr = '\0';
#endif
strlcat(info_path_base, ".info", sizeof(info_path_base));
fill_pathname_join(info_path, (*settings->libretro_info_path) ?
settings->libretro_info_path : settings->libretro_directory,
info_path_base, sizeof(info_path));
return config_file_new(info_path);
}
void core_info_get_name(const char *path, char *s, size_t len)
{
size_t i;
core_info_t *core_info = NULL;
core_info_t *core_info = NULL;
core_info_list_t *core_info_list = NULL;
settings_t *settings = config_get_ptr();
struct string_list *contents = dir_list_new_special(NULL, DIR_LIST_CORES, NULL);
struct string_list *contents = dir_list_new_special(
NULL, DIR_LIST_CORES, NULL);
if (!contents)
return;
@@ -127,35 +212,12 @@ void core_info_get_name(const char *path, char *s, size_t len)
for (i = 0; i < contents->size; i++)
{
config_file_t *conf = NULL;
char info_path_base[PATH_MAX_LENGTH] = {0};
char info_path[PATH_MAX_LENGTH] = {0};
config_file_t *conf = NULL;
core_info[i].path = strdup(contents->elems[i].data);
if (!core_info[i].path)
break;
if (strcmp(core_info[i].path, path) != 0)
continue;
fill_pathname_base(info_path_base, contents->elems[i].data,
sizeof(info_path_base));
path_remove_extension(info_path_base);
#if defined(RARCH_MOBILE) || (defined(RARCH_CONSOLE) && !defined(PSP))
char *substr = strrchr(info_path_base, '_');
if (substr)
*substr = '\0';
#endif
strlcat(info_path_base, ".info", sizeof(info_path_base));
fill_pathname_join(info_path, (*settings->libretro_info_path) ?
settings->libretro_info_path : settings->libretro_directory,
info_path_base, sizeof(info_path));
conf = config_file_new(info_path);
if (!string_is_equal(contents->elems[i].data, path))
continue;
conf = core_info_list_iterate(contents, i);
if (conf)
{
@@ -164,6 +226,8 @@ void core_info_get_name(const char *path, char *s, size_t len)
core_info[i].config_data = (void*)conf;
}
core_info[i].path = strdup(contents->elems[i].data);
strlcpy(s, core_info[i].core_name, len);
}
@@ -174,13 +238,14 @@ error:
core_info_list_free(core_info_list);
}
core_info_list_t *core_info_list_new(void)
static core_info_list_t *core_info_list_new(void)
{
size_t i;
core_info_t *core_info = NULL;
core_info_t *core_info = NULL;
core_info_list_t *core_info_list = NULL;
settings_t *settings = config_get_ptr();
struct string_list *contents = dir_list_new_special(NULL, DIR_LIST_CORES, NULL);
struct string_list *contents =
dir_list_new_special(NULL, DIR_LIST_CORES, NULL);
if (!contents)
return NULL;
@@ -198,35 +263,12 @@ core_info_list_t *core_info_list_new(void)
for (i = 0; i < contents->size; i++)
{
config_file_t *conf = NULL;
char info_path_base[PATH_MAX_LENGTH] = {0};
char info_path[PATH_MAX_LENGTH] = {0};
core_info[i].path = strdup(contents->elems[i].data);
if (!core_info[i].path)
break;
fill_pathname_base(info_path_base, contents->elems[i].data,
sizeof(info_path_base));
path_remove_extension(info_path_base);
#if defined(RARCH_MOBILE) || (defined(RARCH_CONSOLE) && !defined(PSP))
char *substr = strrchr(info_path_base, '_');
if (substr)
*substr = '\0';
#endif
strlcat(info_path_base, ".info", sizeof(info_path_base));
fill_pathname_join(info_path, (*settings->libretro_info_path) ?
settings->libretro_info_path : settings->libretro_directory,
info_path_base, sizeof(info_path));
conf = config_file_new(info_path);
config_file_t *conf = core_info_list_iterate(contents, i);
if (conf)
{
unsigned count = 0;
config_get_string(conf, "display_name",
&core_info[i].display_name);
config_get_string(conf, "corename",
@@ -284,8 +326,11 @@ core_info_list_t *core_info_list_new(void)
core_info[i].config_data = conf;
}
core_info[i].path = strdup(contents->elems[i].data);
if (!core_info[i].display_name)
core_info[i].display_name = strdup(path_basename(core_info[i].path));
core_info[i].display_name =
strdup(path_basename(core_info[i].path));
}
core_info_list_resolve_all_extensions(core_info_list);
@@ -301,54 +346,6 @@ error:
return NULL;
}
void core_info_list_free(core_info_list_t *core_info_list)
{
size_t i, j;
if (!core_info_list)
return;
for (i = 0; i < core_info_list->count; i++)
{
core_info_t *info = (core_info_t*)&core_info_list->list[i];
if (!info)
continue;
free(info->path);
free(info->core_name);
free(info->systemname);
free(info->system_manufacturer);
free(info->display_name);
free(info->supported_extensions);
free(info->authors);
free(info->permissions);
free(info->licenses);
free(info->categories);
free(info->databases);
free(info->notes);
if (info->supported_extensions_list)
string_list_free(info->supported_extensions_list);
string_list_free(info->authors_list);
string_list_free(info->note_list);
string_list_free(info->permissions_list);
string_list_free(info->licenses_list);
string_list_free(info->categories_list);
string_list_free(info->databases_list);
config_file_free((config_file_t*)info->config_data);
for (j = 0; j < info->firmware_count; j++)
{
free(info->firmware[j].path);
free(info->firmware[j].desc);
}
free(info->firmware);
}
free(core_info_list->all_ext);
free(core_info_list->list);
free(core_info_list);
}
size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
{
@@ -359,7 +356,8 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
for (i = 0; i < core_info_list->count; i++)
{
config_file_t *conf = (config_file_t*)core_info_list->list[i].config_data;
config_file_t *conf = (config_file_t*)
core_info_list->list[i].config_data;
num += !!conf;
}
@@ -367,7 +365,7 @@ size_t core_info_list_num_info_files(core_info_list_t *core_info_list)
}
bool core_info_list_get_display_name(core_info_list_t *core_info_list,
const char *path, char *buf, size_t size)
const char *path, char *s, size_t len)
{
size_t i;
@@ -377,10 +375,10 @@ bool core_info_list_get_display_name(core_info_list_t *core_info_list,
for (i = 0; i < core_info_list->count; i++)
{
const core_info_t *info = &core_info_list->list[i];
if (!strcmp(path_basename(info->path), path_basename(path))
if (string_is_equal(path_basename(info->path), path_basename(path))
&& info->display_name)
{
strlcpy(buf, info->display_name, size);
strlcpy(s, info->display_name, len);
return true;
}
}
@@ -428,7 +426,11 @@ error:
return false;
}
bool core_info_list_get_info(core_info_list_t *core_info_list,
/* Shallow-copies internal state.
*
* Data in *info is invalidated when the
* core_info_list is freed. */
static bool core_info_list_get_info(core_info_list_t *core_info_list,
core_info_t *out_info, const char *path)
{
size_t i;
@@ -440,7 +442,9 @@ bool core_info_list_get_info(core_info_list_t *core_info_list,
for (i = 0; i < core_info_list->count; i++)
{
const core_info_t *info = &core_info_list->list[i];
if (!strcmp(path_basename(info->path), path_basename(path)))
if (string_is_equal(path_basename(info->path),
path_basename(path)))
{
*out_info = *info;
return true;
@@ -450,7 +454,7 @@ bool core_info_list_get_info(core_info_list_t *core_info_list,
return false;
}
bool core_info_does_support_any_file(const core_info_t *core,
static bool core_info_does_support_any_file(const core_info_t *core,
const struct string_list *list)
{
size_t i;
@@ -464,7 +468,8 @@ bool core_info_does_support_any_file(const core_info_t *core,
return false;
}
bool core_info_does_support_file(const core_info_t *core, const char *path)
static bool core_info_does_support_file(
const core_info_t *core, const char *path)
{
if (!path || !core || !core->supported_extensions_list)
return false;
@@ -472,27 +477,18 @@ bool core_info_does_support_file(const core_info_t *core, const char *path)
core->supported_extensions_list, ".", path_get_extension(path));
}
const char *core_info_list_get_all_extensions(void)
{
core_info_list_t *list = NULL;
runloop_ctl(RUNLOOP_CTL_CURRENT_CORE_LIST_GET, &list);
if (!list)
return NULL;
return list->all_ext;
}
/* qsort_r() is not in standard C, sadly. */
static const char *core_info_tmp_path;
static const struct string_list *core_info_tmp_list;
static int core_info_qsort_cmp(const void *a_, const void *b_)
{
const core_info_t *a = (const core_info_t*)a_;
const core_info_t *b = (const core_info_t*)b_;
int support_a = core_info_does_support_any_file(a, core_info_tmp_list) ||
core_info_does_support_file(a, core_info_tmp_path);
int support_b = core_info_does_support_any_file(b, core_info_tmp_list) ||
core_info_does_support_file(b, core_info_tmp_path);
int support_a =
core_info_does_support_any_file(a, core_info_tmp_list)
|| core_info_does_support_file(a, core_info_tmp_path);
int support_b =
core_info_does_support_any_file(b, core_info_tmp_list)
|| core_info_does_support_file(b, core_info_tmp_path);
if (support_a != support_b)
return support_b - support_a;
@@ -502,19 +498,19 @@ static int core_info_qsort_cmp(const void *a_, const void *b_)
void core_info_list_get_supported_cores(core_info_list_t *core_info_list,
const char *path, const core_info_t **infos, size_t *num_infos)
{
#ifdef HAVE_ZLIB
struct string_list *list = NULL;
#endif
size_t supported = 0, i;
if (!core_info_list)
return;
(void)list;
core_info_tmp_path = path;
#ifdef HAVE_ZLIB
if (!strcasecmp(path_get_extension(path), "zip"))
list = zlib_get_file_list(path, NULL);
if (string_is_equal_noncase(path_get_extension(path), "zip"))
list = file_archive_get_file_list(path, NULL);
core_info_tmp_list = list;
#endif
@@ -546,30 +542,10 @@ void core_info_list_get_supported_cores(core_info_list_t *core_info_list,
string_list_free(list);
#endif
*infos = core_info_list->list;
*infos = core_info_list->list;
*num_infos = supported;
}
core_info_t *core_info_find(core_info_list_t *list,
const char *core)
{
size_t i;
for (i = 0; i < list->count; i++)
{
core_info_t *info = (core_info_t*)&list->list[i];
if (!info)
continue;
if (!info->path)
continue;
if (!strcmp(info->path, core))
return info;
}
return NULL;
}
core_info_t *core_info_get(core_info_list_t *list, size_t i)
{
core_info_t *info = NULL;
@@ -583,6 +559,55 @@ core_info_t *core_info_get(core_info_list_t *list, size_t i)
return info;
}
static core_info_t *core_info_find(core_info_list_t *list,
const char *core)
{
size_t i;
for (i = 0; i < list->count; i++)
{
core_info_t *info = core_info_get(list, i);
if (!info)
continue;
if (string_is_equal(info->path, core))
return info;
}
return NULL;
}
static bool core_info_list_update_missing_firmware(
core_info_list_t *core_info_list,
const char *core, const char *systemdir)
{
size_t i;
char path[PATH_MAX_LENGTH] = {0};
core_info_t *info = NULL;
if (!core_info_list || !core)
return false;
info = core_info_find(core_info_list, core);
if (!info)
return false;
for (i = 0; i < info->firmware_count; i++)
{
if (!info->firmware[i].path)
continue;
fill_pathname_join(path, systemdir,
info->firmware[i].path, sizeof(path));
info->firmware[i].missing = !path_file_exists(path);
}
return true;
}
#if 0
static int core_info_firmware_cmp(const void *a_, const void *b_)
{
const core_info_firmware_t *a = (const core_info_firmware_t*)a_;
@@ -594,31 +619,10 @@ static int core_info_firmware_cmp(const void *a_, const void *b_)
return strcasecmp(a->path, b->path);
}
void core_info_list_update_missing_firmware(core_info_list_t *core_info_list,
const char *core, const char *systemdir)
{
size_t i;
char path[PATH_MAX_LENGTH] = {0};
core_info_t *info = NULL;
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
if (!core_info_list || !core)
return;
if (!(info = core_info_find(core_info_list, core)))
return;
for (i = 0; i < info->firmware_count; i++)
{
if (!info->firmware[i].path)
continue;
fill_pathname_join(path, systemdir,
info->firmware[i].path, sizeof(path));
info->firmware[i].missing = !path_file_exists(path);
}
}
void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
static void core_info_list_get_missing_firmware(
core_info_list_t *core_info_list,
const char *core, const char *systemdir,
const core_info_firmware_t **firmware, size_t *num_firmware)
{
@@ -639,7 +643,8 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
for (i = 1; i < info->firmware_count; i++)
{
fill_pathname_join(path, systemdir, info->firmware[i].path, sizeof(path));
fill_pathname_join(path, systemdir,
info->firmware[i].path, sizeof(path));
info->firmware[i].missing = !path_file_exists(path);
*num_firmware += info->firmware[i].missing;
}
@@ -647,3 +652,90 @@ void core_info_list_get_missing_firmware(core_info_list_t *core_info_list,
qsort(info->firmware, info->firmware_count, sizeof(*info->firmware),
core_info_firmware_cmp);
}
#endif
bool core_info_ctl(enum core_info_state state, void *data)
{
static core_info_t *core_info_current = NULL;
static core_info_list_t *core_info_curr_list = NULL;
switch (state)
{
case CORE_INFO_CTL_CURRENT_CORE_FREE:
if (core_info_current)
free(core_info_current);
core_info_current = NULL;
break;
case CORE_INFO_CTL_CURRENT_CORE_INIT:
core_info_current = (core_info_t*)calloc(1, sizeof(core_info_t));
if (!core_info_current)
return false;
break;
case CORE_INFO_CTL_CURRENT_CORE_GET:
{
core_info_t **core = (core_info_t**)data;
if (!core)
return false;
*core = core_info_current;
}
break;
case CORE_INFO_CTL_LIST_DEINIT:
if (core_info_curr_list)
core_info_list_free(core_info_curr_list);
core_info_curr_list = NULL;
break;
case CORE_INFO_CTL_LIST_INIT:
core_info_curr_list = core_info_list_new();
break;
case CORE_INFO_CTL_LIST_GET:
{
core_info_list_t **core = (core_info_list_t**)data;
if (!core)
return false;
*core = core_info_curr_list;
}
break;
case CORE_INFO_CTL_LIST_UPDATE_MISSING_FIRMWARE:
{
core_info_ctx_firmware_t *info = (core_info_ctx_firmware_t*)data;
if (!info)
return false;
return core_info_list_update_missing_firmware(core_info_curr_list,
info->path, info->system_directory);
}
case CORE_INFO_CTL_FIND:
{
core_info_ctx_find_t *info = (core_info_ctx_find_t*)data;
if (!info || !core_info_curr_list)
return false;
info->inf = core_info_find(core_info_curr_list, info->path);
if (!info->inf)
return false;
}
break;
case CORE_INFO_CTL_LOAD:
{
core_info_t *core_info = NULL;
core_info_ctx_find_t *info = (core_info_ctx_find_t*)data;
if (!info)
return false;
core_info_ctl(CORE_INFO_CTL_CURRENT_CORE_GET, &core_info);
if (!core_info_curr_list)
return false;
if (!core_info_list_get_info(core_info_curr_list,
core_info, info->path))
return false;
}
break;
case CORE_INFO_CTL_NONE:
default:
break;
}
return true;
}
+28 -27
View File
@@ -24,6 +24,20 @@
extern "C" {
#endif
enum core_info_state
{
CORE_INFO_CTL_NONE = 0,
CORE_INFO_CTL_LIST_DEINIT,
CORE_INFO_CTL_LIST_INIT,
CORE_INFO_CTL_LIST_GET,
CORE_INFO_CTL_LIST_UPDATE_MISSING_FIRMWARE,
CORE_INFO_CTL_CURRENT_CORE_FREE,
CORE_INFO_CTL_CURRENT_CORE_INIT,
CORE_INFO_CTL_CURRENT_CORE_GET,
CORE_INFO_CTL_LOAD,
CORE_INFO_CTL_FIND
};
typedef struct
{
char *path;
@@ -70,41 +84,26 @@ typedef struct
char *all_ext;
} core_info_list_t;
core_info_list_t *core_info_list_new(void);
void core_info_list_free(core_info_list_t *list);
typedef struct core_info_ctx_firmware
{
const char *path;
const char *system_directory;
} core_info_ctx_firmware_t;
typedef struct core_info_ctx_find
{
core_info_t *inf;
const char *path;
} core_info_ctx_find_t;
size_t core_info_list_num_info_files(core_info_list_t *list);
bool core_info_does_support_file(const core_info_t *info,
const char *path);
bool core_info_does_support_any_file(const core_info_t *info,
const struct string_list *list);
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
void core_info_list_get_supported_cores(core_info_list_t *list,
const char *path, const core_info_t **infos, size_t *num_infos);
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
void core_info_list_get_missing_firmware(core_info_list_t *list,
const char *core, const char *systemdir,
const core_info_firmware_t **firmware, size_t *num_firmware);
void core_info_list_update_missing_firmware(core_info_list_t *list,
const char *core, const char *systemdir);
/* Shallow-copies internal state. Data in *info is invalidated when the
* core_info_list is freed. */
bool core_info_list_get_info(core_info_list_t *list,
core_info_t *info, const char *path);
const char *core_info_list_get_all_extensions(void);
core_info_t *core_info_find(core_info_list_t *list,
const char *core);
bool core_info_list_get_display_name(core_info_list_t *list,
const char *path, char *buf, size_t size);
const char *path, char *s, size_t len);
bool core_info_get_display_name(const char *path, char *s, size_t len);
@@ -112,6 +111,8 @@ void core_info_get_name(const char *path, char *s, size_t len);
core_info_t *core_info_get(core_info_list_t *list, size_t i);
bool core_info_ctl(enum core_info_state action, void *data);
#ifdef __cplusplus
}
#endif
+17 -5
View File
@@ -21,6 +21,7 @@
#include <compat/posix_string.h>
#include <compat/strl.h>
#include <retro_miscellaneous.h>
#include <string/stdstring.h>
#include "core_options.h"
@@ -57,9 +58,17 @@ void core_option_free(core_option_manager_t *opt)
for (i = 0; i < opt->size; i++)
{
free(opt->opts[i].desc);
free(opt->opts[i].key);
string_list_free(opt->opts[i].vals);
if (opt->opts[i].desc)
free(opt->opts[i].desc);
if (opt->opts[i].key)
free(opt->opts[i].key);
if (opt->opts[i].vals)
string_list_free(opt->opts[i].vals);
opt->opts[i].desc = NULL;
opt->opts[i].key = NULL;
opt->opts[i].vals = NULL;
}
if (opt->conf)
@@ -79,7 +88,10 @@ void core_option_get(core_option_manager_t *opt, struct retro_variable *var)
for (i = 0; i < opt->size; i++)
{
if (!strcmp(opt->opts[i].key, var->key))
if (string_is_empty(opt->opts[i].key))
continue;
if (string_is_equal(opt->opts[i].key, var->key))
{
var->value = core_option_get_val(opt, i);
return;
@@ -129,7 +141,7 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx,
for (i = 0; i < option->vals->size; i++)
{
if (!strcmp(option->vals->elems[i].data, config_val))
if (string_is_equal(option->vals->elems[i].data, config_val))
{
option->index = i;
break;
+12 -6
View File
@@ -17,11 +17,13 @@
#ifndef CORE_OPTIONS_H__
#define CORE_OPTIONS_H__
#include <boolean.h>
#include "libretro.h"
#include <stddef.h>
#include <boolean.h>
#include <string/string_list.h>
#include "libretro.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -72,7 +74,8 @@ bool core_option_flush(core_option_manager_t *opt);
* Returns: true (1) if core option values could be
* successfully saved to disk, otherwise false (0).
**/
bool core_option_flush_game_specific(core_option_manager_t *opt, char* path);
bool core_option_flush_game_specific(
core_option_manager_t *opt, char* path);
/**
* core_option_free:
@@ -82,7 +85,8 @@ bool core_option_flush_game_specific(core_option_manager_t *opt, char* path);
**/
void core_option_free(core_option_manager_t *opt);
void core_option_get(core_option_manager_t *opt, struct retro_variable *var);
void core_option_get(core_option_manager_t *opt,
struct retro_variable *var);
/**
* core_option_size:
@@ -103,7 +107,8 @@ size_t core_option_size(core_option_manager_t *opt);
*
* Returns: Description for an option.
**/
const char *core_option_get_desc(core_option_manager_t *opt, size_t idx);
const char *core_option_get_desc(core_option_manager_t *opt,
size_t idx);
/**
* core_option_get_val:
@@ -114,7 +119,8 @@ const char *core_option_get_desc(core_option_manager_t *opt, size_t idx);
*
* Returns: Value for an option.
**/
const char *core_option_get_val(core_option_manager_t *opt, size_t idx);
const char *core_option_get_val(core_option_manager_t *opt,
size_t idx);
/**
* core_option_get_vals:
+42 -21
View File
@@ -5,6 +5,12 @@
#include <assert.h>
#include <stdarg.h>
#ifdef RARCH_INTERNAL
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
@@ -792,8 +798,10 @@ static bool codec_id_is_ass(enum AVCodecID id)
#endif
return true;
default:
return false;
break;
}
return false;
}
#endif
@@ -801,14 +809,15 @@ static bool open_codecs(void)
{
unsigned i;
video_stream = -1;
memset(audio_streams, 0, sizeof(audio_streams));
memset(subtitle_streams, 0, sizeof(subtitle_streams));
video_stream = -1;
audio_streams_num = 0;
audio_streams_ptr = 0;
subtitle_streams_num = 0;
subtitle_streams_ptr = 0;
memset(audio_streams, 0, sizeof(audio_streams));
memset(subtitle_streams, 0, sizeof(subtitle_streams));
for (i = 0; i < fctx->nb_streams; i++)
{
switch (fctx->streams[i]->codec->codec_type)
@@ -848,7 +857,7 @@ static bool open_codecs(void)
if (size)
{
ass_extra_data[subtitle_streams_num] = av_malloc(size);
ass_extra_data[subtitle_streams_num] = (uint8_t*)av_malloc(size);
memcpy(ass_extra_data[subtitle_streams_num], (*s)->extradata, size);
}
@@ -858,12 +867,12 @@ static bool open_codecs(void)
break;
case AVMEDIA_TYPE_ATTACHMENT:
{
AVCodecContext *ctx = fctx->streams[i]->codec;
if (codec_id_is_ttf(ctx->codec_id))
append_attachment(ctx->extradata, ctx->extradata_size);
{
AVCodecContext *ctx = fctx->streams[i]->codec;
if (codec_id_is_ttf(ctx->codec_id))
append_attachment(ctx->extradata, ctx->extradata_size);
}
break;
}
default:
break;
@@ -883,7 +892,8 @@ static bool init_media_info(void)
{
media.width = vctx->width;
media.height = vctx->height;
media.aspect = (float)vctx->width * av_q2d(vctx->sample_aspect_ratio) / vctx->height;
media.aspect = (float)vctx->width *
av_q2d(vctx->sample_aspect_ratio) / vctx->height;
}
#ifdef HAVE_SSA
@@ -895,7 +905,8 @@ static bool init_media_info(void)
ass_set_message_cb(ass, ass_msg_cb, NULL);
for (i = 0; i < attachments_size; i++)
ass_add_font(ass, (char*)"", (char*)attachments[i].data, attachments[i].size);
ass_add_font(ass, (char*)"",
(char*)attachments[i].data, attachments[i].size);
ass_render = ass_renderer_init(ass);
ass_set_frame_size(ass_render, media.width, media.height);
@@ -916,7 +927,8 @@ static bool init_media_info(void)
}
static void set_colorspace(struct SwsContext *sws,
unsigned width, unsigned height, enum AVColorSpace default_color, int in_range)
unsigned width, unsigned height,
enum AVColorSpace default_color, int in_range)
{
const int *coeffs = NULL;
@@ -951,7 +963,8 @@ static void set_colorspace(struct SwsContext *sws,
}
}
static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct SwsContext *sws)
static bool decode_video(AVPacket *pkt, AVFrame *frame,
AVFrame *conv, struct SwsContext *sws)
{
int got_ptr = 0;
int ret = avcodec_decode_video2(vctx, frame, &got_ptr, pkt);
@@ -971,7 +984,8 @@ static bool decode_video(AVPacket *pkt, AVFrame *frame, AVFrame *conv, struct Sw
return false;
}
static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt, AVFrame *frame, int16_t *buffer, size_t *buffer_cap,
static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt,
AVFrame *frame, int16_t *buffer, size_t *buffer_cap,
SwrContext *swr)
{
AVPacket pkt_tmp = *pkt;
@@ -1020,7 +1034,9 @@ static int16_t *decode_audio(AVCodecContext *ctx, AVPacket *pkt, AVFrame *frame,
}
}
decode_last_audio_time = pts * av_q2d(fctx->streams[audio_streams[audio_streams_ptr]]->time_base);
decode_last_audio_time = pts * av_q2d(
fctx->streams[audio_streams[audio_streams_ptr]]->time_base);
if (!decode_thread_dead)
fifo_write(audio_decode_fifo, buffer, required_buffer);
@@ -1101,7 +1117,8 @@ static void render_ass_img(AVFrame *conv_frame, ASS_Image *img)
dst_g = (g * src_alpha + dst_g * dst_alpha) >> 8;
dst_b = (b * src_alpha + dst_b * dst_alpha) >> 8;
dst[x] = (0xffu << 24) | (dst_r << 16) | (dst_g << 8) | (dst_b << 0);
dst[x] = (0xffu << 24) | (dst_r << 16) |
(dst_g << 8) | (dst_b << 0);
}
}
}
@@ -1285,7 +1302,8 @@ static void decode_thread(void *data)
for (i = 0; i < sub.num_rects; i++)
{
if (sub.rects[i]->ass)
ass_process_data(ass_track_active, sub.rects[i]->ass, strlen(sub.rects[i]->ass));
ass_process_data(ass_track_active,
sub.rects[i]->ass, strlen(sub.rects[i]->ass));
}
#endif
@@ -1406,14 +1424,16 @@ static void context_reset(void)
#if !defined(HAVE_OPENGLES)
glGenBuffers(1, &frames[i].pbo);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, frames[i].pbo);
glBufferData(GL_PIXEL_UNPACK_BUFFER, media.width * media.height * sizeof(uint32_t), NULL, GL_STREAM_DRAW);
glBufferData(GL_PIXEL_UNPACK_BUFFER, media.width
* media.height * sizeof(uint32_t), NULL, GL_STREAM_DRAW);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
#endif
}
glGenBuffers(1, &vbo);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glBufferData(GL_ARRAY_BUFFER,
sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindTexture(GL_TEXTURE_2D, 0);
@@ -1569,7 +1589,8 @@ bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
if (video_stream >= 0 || is_glfft)
{
video_decode_fifo = fifo_new(media.width * media.height * sizeof(uint32_t) * 32);
video_decode_fifo = fifo_new(media.width
* media.height * sizeof(uint32_t) * 32);
#ifdef HAVE_OPENGL
use_gl = true;
@@ -5,6 +5,9 @@
#include <assert.h>
#include <boolean.h>
#include <file/dir_list.h>
#include <file/file_path.h>
#include <compat/strl.h>
#define STB_IMAGE_IMPLEMENTATION
@@ -17,11 +20,11 @@
#define STBI_SUPPORT_ZLIB
#endif
#include "../deps/stb/stb_image.h"
#include "../../deps/stb/stb_image.h"
#ifdef RARCH_INTERNAL
#include "internal_cores.h"
#include "../libretro.h"
#include "../../libretro.h"
#define IMAGE_CORE_PREFIX(s) libretro_imageviewer_##s
#else
#include "libretro.h"
@@ -35,26 +38,31 @@ static retro_input_state_t IMAGE_CORE_PREFIX(input_state_cb);
static retro_audio_sample_batch_t IMAGE_CORE_PREFIX(audio_batch_cb);
static retro_environment_t IMAGE_CORE_PREFIX(environ_cb);
static bool process_new_image;
static uint32_t* image_buffer;
static int image_width;
static int image_height;
static bool image_uploaded;
static bool slideshow_enable;
struct string_list *file_list;
#if 0
#define DUPE_TEST
#endif
#ifdef RARCH_INTERNAL
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|tga";
#else
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm";
#endif
void IMAGE_CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info)
{
info->library_name = "image display";
info->library_version = "v0.1";
info->need_fullpath = true;
info->block_extract = false;
#ifdef RARCH_INTERNAL
info->valid_extensions = "jpg|jpeg|png|bmp|tga";
#else
info->valid_extensions = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm";
#endif
info->valid_extensions = IMAGE_CORE_PREFIX(valid_extensions);
}
void IMAGE_CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info)
@@ -163,23 +171,42 @@ void IMAGE_CORE_PREFIX(retro_cheat_set)(unsigned a, bool b, const char * c)
{
}
bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
static bool imageviewer_load(const char *path, int image_index)
{
int comp;
uint32_t *buf, *end;
if (image_buffer)
free(image_buffer);
image_buffer = (uint32_t*)stbi_load(
path,
&image_width,
&image_height,
&comp,
4);
if (!image_buffer)
return false;
process_new_image = true;
return true;
}
bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
{
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
image_buffer = (uint32_t*)stbi_load (info->path,&image_width, &image_height, &comp, 4);
/* RGBA > XRGB8888 */
buf = &image_buffer[0];
end = buf + (image_width*image_height*sizeof(uint32_t))/4;
char *dir = strdup(info->path);
slideshow_enable = false;
path_basedir(dir);
file_list = dir_list_new(dir, IMAGE_CORE_PREFIX(valid_extensions),
false,false);
dir_list_sort(file_list, false);
free(dir);
while(buf < end)
{
uint32_t pixel = *buf;
*buf = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff);
buf++;
}
if (!IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
@@ -188,6 +215,8 @@ bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
return false;
}
if (!imageviewer_load(info->path, 0))
return false;
return true;
}
@@ -221,10 +250,133 @@ size_t IMAGE_CORE_PREFIX(retro_get_memory_size)(unsigned id)
return 0;
}
void IMAGE_CORE_PREFIX(retro_run)(void)
{
bool first_image = false;
bool last_image = false;
bool backwards_image = false;
bool forward_image = false;
bool load_image = false;
bool next_image = false;
bool prev_image = false;
static int frames = 0;
static int image_index = 0;
uint16_t input = 0;
static uint16_t previnput;
uint16_t realinput = 0;
int i;
IMAGE_CORE_PREFIX(input_poll_cb)();
if (slideshow_enable)
{
if ((frames % 120 == 0) && image_index < (signed)(file_list->size - 1))
next_image = true;
}
for (i=0;i<16;i++)
{
if (IMAGE_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, i))
{
realinput |= 1<<i;
}
}
input = realinput & ~previnput;
previnput = realinput;
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_UP))
{
if ((image_index + 5) < (signed)(file_list->size - 1))
forward_image = true;
else
last_image = true;
}
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_DOWN))
{
if ((image_index - 5) > 0)
backwards_image = true;
else
first_image = true;
}
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_LEFT))
{
if (image_index > 0)
prev_image = true;
}
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_RIGHT))
{
if (image_index < (signed)(file_list->size - 1))
next_image = true;
}
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_Y))
{
slideshow_enable = !slideshow_enable;
}
if (prev_image)
{
image_index--;
load_image = true;
}
else if (next_image)
{
image_index++;
load_image = true;
}
else if (backwards_image)
{
image_index -= 5;
load_image = true;
}
else if (forward_image)
{
image_index += 5;
load_image = true;
}
else if (first_image)
{
image_index = 0;
load_image = true;
}
else if (last_image)
{
image_index = file_list->size - 1;
load_image = true;
}
if (load_image)
{
if (!imageviewer_load(file_list->elems[image_index].data, image_index))
{
IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
}
}
if (process_new_image)
{
/* RGBA > XRGB8888 */
struct retro_system_av_info info;
uint32_t *buf = &image_buffer[0];
uint32_t *end = buf + (image_width*image_height*sizeof(uint32_t))/4;
while(buf < end)
{
uint32_t pixel = *buf;
*buf = (pixel & 0xff00ff00) | ((pixel << 16) & 0x00ff0000) | ((pixel >> 16) & 0xff);
buf++;
}
IMAGE_CORE_PREFIX(retro_get_system_av_info)(&info);
IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_GEOMETRY, &info.geometry);
process_new_image = false;
}
#ifdef DUPE_TEST
if (!image_uploaded)
{
@@ -236,6 +388,7 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
#else
IMAGE_CORE_PREFIX(video_cb)(image_buffer, image_width, image_height, image_width * sizeof(uint32_t));
#endif
frames++;
}
unsigned IMAGE_CORE_PREFIX(retro_api_version)(void)
@@ -0,0 +1 @@
#include "../internal_cores.h"
+172
View File
@@ -0,0 +1,172 @@
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
TARGET_NAME = testgl_ff
ifeq ($(platform), unix)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
GL_LIB := -lGL
else ifneq (,$(findstring osx,$(platform)))
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
GL_LIB := -framework OpenGL
CFLAGS += -DOSX
ifeq ($(arch),ppc)
CFLAGS += -D__ppc__ -DOSX_PPC
endif
OSXVER = `sw_vers -productVersion | cut -d. -f 2`
OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
fpic += -mmacosx-version-min=10.1
else ifeq ($(platform), pi)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/vmcs_host/linux
GLES := 1
LIBS += -L/opt/vc/lib
else ifneq (,$(findstring ios,$(platform)))
TARGET := $(TARGET_NAME)_libretro_ios.dylib
fpic := -fPIC
SHARED := -dynamiclib
ifeq ($(IOSSDK),)
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
GL_LIB := -framework OpenGLES
DEFINES := -DIOS
CFLAGS += -DGLES $(DEFINES)
CC = cc -arch armv7 -isysroot $(IOSSDK)
ifeq ($(platform),ios9)
CC += -miphoneos-version-min=8.0
CFLAGS += -miphoneos-version-min=8.0
else
CC += -miphoneos-version-min=5.0
CFLAGS += -miphoneos-version-min=5.0
endif
else ifneq (,$(findstring qnx,$(platform)))
TARGET := $(TARGET_NAME)_libretro_qnx.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T
GL_LIB := -lGL
CC = qcc -Vgcc_ntoarmv7le
AR = qcc -Vgcc_ntoarmv7le
CFLAGS += -DGLES
GL_LIB := -lGLESv2
GLES := 1
else ifneq (,$(findstring armv,$(platform)))
CC = gcc
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
CFLAGS += -I.
ifneq (,$(findstring gles,$(platform)))
GLES := 1
else
GL_LIB := -lGL
endif
ifneq (,$(findstring cortexa8,$(platform)))
CFLAGS += -marm -mcpu=cortex-a8
else ifneq (,$(findstring cortexa9,$(platform)))
CFLAGS += -marm -mcpu=cortex-a9
endif
CFLAGS += -marm
ifneq (,$(findstring neon,$(platform)))
CFLAGS += -mfpu=neon
endif
ifneq (,$(findstring softfloat,$(platform)))
CFLAGS += -mfloat-abi=softfp
else ifneq (,$(findstring hardfloat,$(platform)))
CFLAGS += -mfloat-abi=hard
endif
CFLAGS += -DARM
# emscripten
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_emscripten.bc
else
CC = gcc
TARGET := $(TARGET_NAME)_libretro.dll
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
GL_LIB := -lopengl32
CFLAGS += -I..
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
endif
ifneq (,$(findstring qnx,$(platform)))
CFLAGS += -Wc,-std=c99
else
CFLAGS += -std=gnu99
endif
OBJECTS := libretro_gl_ff_test.o ../../libretro-common/glsym/rglgen.o
CFLAGS += -Wall -pedantic $(fpic)
ifeq ($(GLES), 1)
CFLAGS += -DGLES -DHAVE_OPENGLES2
ifeq ($(GLES31), 1)
CFLAGS += -DHAVE_OPENGLES3 -DGLES31 -DGLES3
else ifeq ($(GLES3), 1)
CFLAGS += -DHAVE_OPENGLES3 -DGLES3
endif
LIBS += -lGLESv2 # Still link against GLESv2 when using GLES3 API, at least on desktop Linux.
OBJECTS += ../../libretro-common/glsym/glsym_es2.o
else
OBJECTS += ../../libretro-common/glsym/glsym_gl.o
LIBS += $(GL_LIB)
endif
ifeq ($(CORE), 1)
CFLAGS += -DCORE
endif
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm $(EXTRA_GL_LIBS)
%.o: %.c
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: clean
+27
View File
@@ -0,0 +1,27 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := retro-test-gl-ff
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DANDROID_ARM
LOCAL_ARM_MODE := arm
endif
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += -DANDROID_X86
endif
ifeq ($(TARGET_ARCH),mips)
LOCAL_CFLAGS += -DANDROID_MIPS
endif
GLES_LIB := -lGLESv2
LOCAL_SRC_FILES += $(addprefix ../,$(wildcard *.c) ../../../libretro-common/glsym/rglgen.c ../../../libretro-common/glsym/glsym_es2.c)
LOCAL_CFLAGS += -O2 -Wall -std=gnu99 -ffast-math -DGLES -DHAVE_OPENGLES2 -I../../../libretro-common/include
LOCAL_LDLIBS += $(GLES_LIB)
include $(BUILD_SHARED_LIBRARY)
@@ -0,0 +1,7 @@
APP_ABI := all
ifeq ($(GLES), 3)
APP_PLATFORM := android-18
else
APP_PLATFORM := android-9
endif
@@ -0,0 +1,366 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <glsym/glsym.h>
#include "../../libretro.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
static struct retro_hw_render_callback hw_render;
#if defined(HAVE_PSGL)
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
#define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
#elif defined(OSX_PPC)
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER_EXT
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_EXT
#define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_EXT
#else
#define RARCH_GL_FRAMEBUFFER GL_FRAMEBUFFER
#define RARCH_GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE
#define RARCH_GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0
#endif
#define BASE_WIDTH 320
#define BASE_HEIGHT 240
#ifdef GLES
#define MAX_WIDTH 1024
#define MAX_HEIGHT 1024
#else
#define MAX_WIDTH 2048
#define MAX_HEIGHT 2048
#endif
static unsigned width = BASE_WIDTH;
static unsigned height = BASE_HEIGHT;
void retro_init(void)
{}
void retro_deinit(void)
{}
unsigned retro_api_version(void)
{
return RETRO_API_VERSION;
}
void retro_set_controller_port_device(unsigned port, unsigned device)
{
(void)port;
(void)device;
}
void retro_get_system_info(struct retro_system_info *info)
{
memset(info, 0, sizeof(*info));
info->library_name = "TestCore GL (FF)";
info->library_version = "v1";
info->need_fullpath = false;
info->valid_extensions = NULL; // Anything is fine, we don't care.
}
void retro_get_system_av_info(struct retro_system_av_info *info)
{
info->timing = (struct retro_system_timing) {
.fps = 60.0,
.sample_rate = 30000.0,
};
info->geometry = (struct retro_game_geometry) {
.base_width = BASE_WIDTH,
.base_height = BASE_HEIGHT,
.max_width = MAX_WIDTH,
.max_height = MAX_HEIGHT,
.aspect_ratio = 4.0 / 3.0,
};
}
static retro_video_refresh_t video_cb;
static retro_audio_sample_t audio_cb;
static retro_audio_sample_batch_t audio_batch_cb;
static retro_environment_t environ_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
struct retro_variable variables[] = {
{
"testgl_resolution",
#ifdef GLES
"Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768",
#else
"Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768|1024x1024|1280x720|1280x960|1600x1200|1920x1080|1920x1440|1920x1600|2048x2048",
#endif
},
#ifdef CORE
{ "testgl_multisample", "Multisampling; 1x|2x|4x" },
#endif
{ NULL, NULL },
};
bool no_rom = true;
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_rom);
cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
}
void retro_set_audio_sample(retro_audio_sample_t cb)
{
audio_cb = cb;
}
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)
{
audio_batch_cb = cb;
}
void retro_set_input_poll(retro_input_poll_t cb)
{
input_poll_cb = cb;
}
void retro_set_input_state(retro_input_state_t cb)
{
input_state_cb = cb;
}
void retro_set_video_refresh(retro_video_refresh_t cb)
{
video_cb = cb;
}
static void update_variables(void)
{
struct retro_variable var = {
.key = "testgl_resolution",
};
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
char *pch;
char str[100];
snprintf(str, sizeof(str), "%s", var.value);
pch = strtok(str, "x");
if (pch)
width = strtoul(pch, NULL, 0);
pch = strtok(NULL, "x");
if (pch)
height = strtoul(pch, NULL, 0);
fprintf(stderr, "[libretro-test]: Got size: %u x %u.\n", width, height);
}
#ifdef CORE
var.key = "testgl_multisample";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{
switch (*var.value)
{
case '1':
init_multisample(1);
break;
case '2':
init_multisample(2);
break;
case '4':
init_multisample(4);
break;
}
}
#endif
}
static unsigned frame_count;
void retro_run(void)
{
bool updated = false;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
update_variables();
input_poll_cb();
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
{
}
float ratio = width / (float)height;
glBindFramebuffer(RARCH_GL_FRAMEBUFFER, hw_render.get_current_framebuffer());
glClearColor(0.3, 0.4, 0.5, 1.0);
glViewport(0, 0, width, height);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-ratio, ratio, -1.f, 1.f, 1.f, -1.f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef((float)frame_count * 2, 0.0f, 0.0f, 0.1f);
glLoadIdentity();
glBegin(GL_TRIANGLES);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glVertex2f(-0.5f, -0.5f);
glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
glVertex2f(0.5f, -0.5f);
glColor4f(0.0f, 1.0f, 1.0f, 1.0f);
glVertex2f(-0.5f, 0.5f);
glColor4f(1.0f, 0.0f, 1.0f, 1.0f);
glVertex2f(0.5f, 0.5f);
glEnd();
frame_count++;
video_cb(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0);
}
static void context_reset(void)
{
fprintf(stderr, "Context reset!\n");
rglgen_resolve_symbols(hw_render.get_proc_address);
}
static void context_destroy(void)
{
fprintf(stderr, "Context destroy!\n");
}
#ifdef GLES
static bool retro_init_hw_context(void)
{
#if defined(GLES31)
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES_VERSION;
hw_render.version_major = 3;
hw_render.version_minor = 1;
#elif defined(GLES3)
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES3;
#else
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2;
#endif
hw_render.context_reset = context_reset;
hw_render.context_destroy = context_destroy;
hw_render.depth = true;
hw_render.bottom_left_origin = true;
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
return false;
return true;
}
#else
static bool retro_init_hw_context(void)
{
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL;
hw_render.context_reset = context_reset;
hw_render.context_destroy = context_destroy;
hw_render.depth = true;
hw_render.bottom_left_origin = true;
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
return false;
return true;
}
#endif
bool retro_load_game(const struct retro_game_info *info)
{
update_variables();
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
fprintf(stderr, "XRGB8888 is not supported.\n");
return false;
}
if (!retro_init_hw_context())
{
fprintf(stderr, "HW Context could not be initialized, exiting...\n");
return false;
}
fprintf(stderr, "Loaded game!\n");
(void)info;
return true;
}
void retro_unload_game(void)
{}
unsigned retro_get_region(void)
{
return RETRO_REGION_NTSC;
}
bool retro_load_game_special(unsigned type, const struct retro_game_info *info, size_t num)
{
(void)type;
(void)info;
(void)num;
return false;
}
size_t retro_serialize_size(void)
{
return 0;
}
bool retro_serialize(void *data, size_t size)
{
(void)data;
(void)size;
return false;
}
bool retro_unserialize(const void *data, size_t size)
{
(void)data;
(void)size;
return false;
}
void *retro_get_memory_data(unsigned id)
{
(void)id;
return NULL;
}
size_t retro_get_memory_size(unsigned id)
{
(void)id;
return 0;
}
void retro_reset(void)
{}
void retro_cheat_reset(void)
{}
void retro_cheat_set(unsigned index, bool enabled, const char *code)
{
(void)index;
(void)enabled;
(void)code;
}
+5
View File
@@ -0,0 +1,5 @@
{
global: retro_*;
local: *;
};
+1 -5
View File
@@ -1,7 +1,3 @@
ifneq ($(EMSCRIPTEN),)
platform = emscripten
endif
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
@@ -140,7 +136,7 @@ else
CFLAGS += -std=gnu99
endif
OBJECTS := libretro-test.o ../../libretro-common/glsym/rglgen.o
OBJECTS := libretro_gl_test.o ../../libretro-common/glsym/rglgen.o
CFLAGS += -Wall -pedantic $(fpic)
ifeq ($(GLES), 1)
@@ -35,13 +35,13 @@ static struct retro_hw_render_callback hw_render;
#define MAX_HEIGHT 2048
#endif
static unsigned width = BASE_WIDTH;
static unsigned width = BASE_WIDTH;
static unsigned height = BASE_HEIGHT;
static GLuint prog;
static GLuint vbo;
#ifdef CORE
#if defined(CORE)
static bool context_alive;
static bool multisample_fbo;
static unsigned multisample;
@@ -49,10 +49,7 @@ static GLuint vao;
static GLuint fbo;
static GLuint rbo_color, rbo_depth_stencil;
#endif
#ifdef CORE
static const char *vertex_shader[] = {
"#version 140\n"
"uniform mat4 uMVP;",
@@ -114,7 +111,7 @@ static void compile_program(void)
glDeleteShader(frag);
}
#ifdef CORE
#if defined(CORE)
static void init_multisample(unsigned samples)
{
multisample = samples;
@@ -184,7 +181,7 @@ static void setup_vao(void)
1.0, 0.0, 1.0, 1.0,
};
#ifdef CORE
#if defined(CORE)
glGenVertexArrays(1, &vao);
#endif
@@ -342,6 +339,8 @@ static void update_variables(void)
#endif
}
static unsigned frame_count;
void retro_run(void)
{
bool updated = false;
@@ -350,6 +349,11 @@ void retro_run(void)
input_poll_cb();
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
{
}
#ifdef CORE
glBindVertexArray(vao);
if (multisample_fbo)
@@ -377,8 +381,6 @@ void retro_run(void)
int loc = glGetUniformLocation(prog, "uMVP");
static unsigned frame_count;
frame_count++;
float angle = frame_count / 100.0;
float cos_angle = cos(angle);
float sin_angle = sin(angle);
@@ -421,6 +423,9 @@ void retro_run(void)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
}
#endif
frame_count++;
video_cb(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0);
}
@@ -428,6 +433,7 @@ static void context_reset(void)
{
fprintf(stderr, "Context reset!\n");
rglgen_resolve_symbols(hw_render.get_proc_address);
compile_program();
setup_vao();
#ifdef CORE
@@ -478,7 +484,7 @@ static bool retro_init_hw_context(void)
#else
static bool retro_init_hw_context(void)
{
#ifdef CORE
#if defined(CORE)
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL_CORE;
hw_render.version_major = 3;
hw_render.version_minor = 1;
+65
View File
@@ -0,0 +1,65 @@
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
TARGET_NAME = testvulkan
ifeq ($(platform), unix)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
VULKAN_LIB := -lvulkan
else
CC = gcc
TARGET := $(TARGET_NAME)_libretro.dll
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
VULKAN_LIB := -lvulkan
CFLAGS += -I..
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
endif
CFLAGS += -std=gnu99
OBJECTS := libretro-test.o
CFLAGS += -Wall -pedantic $(fpic)
LIBS += $(VULKAN_LIB)
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm $(EXTRA_VULKAN_LIBS)
%.o: %.c
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: clean
+790
View File
@@ -0,0 +1,790 @@
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define VK_PROTOTYPES
#include "../../libretro_vulkan.h"
#include "shaders/triangle.vert.inc"
#include "shaders/triangle.frag.inc"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
static struct retro_hw_render_callback hw_render;
static const struct retro_hw_render_interface_vulkan *vulkan;
#define BASE_WIDTH 320
#define BASE_HEIGHT 240
#define MAX_SYNC 8
struct buffer
{
VkBuffer buffer;
VkDeviceMemory memory;
};
struct vulkan_data
{
unsigned index;
unsigned num_swapchain_images;
uint32_t swapchain_mask;
struct buffer vbo;
struct buffer ubo[MAX_SYNC];
VkPhysicalDeviceMemoryProperties memory_properties;
VkPhysicalDeviceProperties gpu_properties;
VkDescriptorSetLayout set_layout;
VkDescriptorPool desc_pool;
VkDescriptorSet desc_set[MAX_SYNC];
VkPipelineCache pipeline_cache;
VkPipelineLayout pipeline_layout;
VkRenderPass render_pass;
VkPipeline pipeline;
struct retro_vulkan_image images[MAX_SYNC];
VkDeviceMemory image_memory[MAX_SYNC];
VkFramebuffer framebuffers[MAX_SYNC];
VkCommandPool cmd_pool[MAX_SYNC];
VkCommandBuffer cmd[MAX_SYNC];
};
static struct vulkan_data vk;
void retro_init(void)
{}
void retro_deinit(void)
{}
unsigned retro_api_version(void)
{
return RETRO_API_VERSION;
}
void retro_set_controller_port_device(unsigned port, unsigned device)
{
(void)port;
(void)device;
}
void retro_get_system_info(struct retro_system_info *info)
{
memset(info, 0, sizeof(*info));
info->library_name = "TestCore Vulkan";
info->library_version = "v1";
info->need_fullpath = false;
info->valid_extensions = NULL; // Anything is fine, we don't care.
}
void retro_get_system_av_info(struct retro_system_av_info *info)
{
info->timing = (struct retro_system_timing) {
.fps = 60.0,
.sample_rate = 30000.0,
};
info->geometry = (struct retro_game_geometry) {
.base_width = BASE_WIDTH,
.base_height = BASE_HEIGHT,
.max_width = BASE_WIDTH,
.max_height = BASE_HEIGHT,
.aspect_ratio = (float)BASE_WIDTH / (float)BASE_HEIGHT,
};
}
static retro_video_refresh_t video_cb;
static retro_audio_sample_t audio_cb;
static retro_audio_sample_batch_t audio_batch_cb;
static retro_environment_t environ_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
bool no_rom = true;
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_rom);
}
void retro_set_audio_sample(retro_audio_sample_t cb)
{
audio_cb = cb;
}
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)
{
audio_batch_cb = cb;
}
void retro_set_input_poll(retro_input_poll_t cb)
{
input_poll_cb = cb;
}
void retro_set_input_state(retro_input_state_t cb)
{
input_state_cb = cb;
}
void retro_set_video_refresh(retro_video_refresh_t cb)
{
video_cb = cb;
}
static uint32_t find_memory_type_from_requirements(
uint32_t device_requirements, uint32_t host_requirements)
{
const VkPhysicalDeviceMemoryProperties *props = &vk.memory_properties;
for (uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; i++)
{
if (device_requirements & (1u << i))
{
if ((props->memoryTypes[i].propertyFlags & host_requirements) == host_requirements)
{
return i;
}
}
}
return 0;
}
static void update_ubo(void)
{
static unsigned frame;
float c = cosf(frame * 0.01f);
float s = sinf(frame * 0.01f);
frame++;
float tmp[16] = {0.0f};
tmp[ 0] = c;
tmp[ 1] = s;
tmp[ 4] = -s;
tmp[ 5] = c;
tmp[10] = 1.0f;
tmp[15] = 1.0f;
float *mvp = NULL;
vkMapMemory(vulkan->device, vk.ubo[vk.index].memory,
0, 16 * sizeof(float), 0, (void**)&mvp);
memcpy(mvp, tmp, sizeof(tmp));
vkUnmapMemory(vulkan->device, vk.ubo[vk.index].memory);
}
static void vulkan_test_render(void)
{
update_ubo();
VkCommandBuffer cmd = vk.cmd[vk.index];
VkCommandBufferBeginInfo begin_info = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
begin_info.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
vkResetCommandBuffer(cmd, 0);
vkBeginCommandBuffer(cmd, &begin_info);
VkImageMemoryBarrier prepare_rendering = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
prepare_rendering.srcAccessMask = 0;
prepare_rendering.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
prepare_rendering.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
prepare_rendering.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
prepare_rendering.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
prepare_rendering.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
prepare_rendering.image = vk.images[vk.index].create_info.image;
prepare_rendering.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
prepare_rendering.subresourceRange.levelCount = 1;
prepare_rendering.subresourceRange.layerCount = 1;
vkCmdPipelineBarrier(cmd,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
false,
0, NULL,
0, NULL,
1, &prepare_rendering);
VkClearValue clear_value;
clear_value.color.float32[0] = 0.8f;
clear_value.color.float32[1] = 0.6f;
clear_value.color.float32[2] = 0.2f;
clear_value.color.float32[3] = 1.0f;
VkRenderPassBeginInfo rp_begin = { VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO };
rp_begin.renderPass = vk.render_pass;
rp_begin.framebuffer = vk.framebuffers[vk.index];
rp_begin.renderArea.extent.width = BASE_WIDTH;
rp_begin.renderArea.extent.height = BASE_HEIGHT;
rp_begin.clearValueCount = 1;
rp_begin.pClearValues = &clear_value;
vkCmdBeginRenderPass(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
vk.pipeline_layout, 0,
1, &vk.desc_set[vk.index], 0, NULL);
VkViewport vp = { 0 };
vp.x = 0.0f;
vp.y = 0.0f;
vp.width = BASE_WIDTH;
vp.height = BASE_HEIGHT;
vp.minDepth = 0.0f;
vp.maxDepth = 1.0f;
vkCmdSetViewport(cmd, 0, 1, &vp);
VkRect2D scissor;
memset(&scissor, 0, sizeof(scissor));
scissor.extent.width = BASE_WIDTH;
scissor.extent.height = BASE_HEIGHT;
vkCmdSetScissor(cmd, 0, 1, &scissor);
VkDeviceSize offset = 0;
vkCmdBindVertexBuffers(cmd, 0, 1, &vk.vbo.buffer, &offset);
vkCmdDraw(cmd, 3, 1, 0, 0);
vkCmdEndRenderPass(cmd);
VkImageMemoryBarrier prepare_presentation = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
prepare_presentation.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
prepare_presentation.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
prepare_presentation.oldLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
prepare_presentation.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
prepare_presentation.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
prepare_presentation.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
prepare_presentation.image = vk.images[vk.index].create_info.image;
prepare_presentation.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
prepare_presentation.subresourceRange.levelCount = 1;
prepare_presentation.subresourceRange.layerCount = 1;
vkCmdPipelineBarrier(cmd, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
false,
0, NULL,
0, NULL,
1, &prepare_presentation);
vkEndCommandBuffer(cmd);
}
static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsageFlags usage)
{
struct buffer buffer;
VkDevice device = vulkan->device;
VkBufferCreateInfo info = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
info.usage = usage;
info.size = size;
vkCreateBuffer(device, &info, NULL, &buffer.buffer);
VkMemoryRequirements mem_reqs;
vkGetBufferMemoryRequirements(device, buffer.buffer, &mem_reqs);
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
alloc.allocationSize = mem_reqs.size;
alloc.memoryTypeIndex = find_memory_type_from_requirements(mem_reqs.memoryTypeBits,
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
vkAllocateMemory(device, &alloc, NULL, &buffer.memory);
vkBindBufferMemory(device, buffer.buffer, buffer.memory, 0);
if (initial)
{
void *ptr;
vkMapMemory(device, buffer.memory, 0, size, 0, &ptr);
memcpy(ptr, initial, size);
vkUnmapMemory(device, buffer.memory);
}
return buffer;
}
static void init_vertex_buffer(void)
{
static const float data[] = {
-0.5f, -0.5f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, // vec4 position, vec4 color
-0.5f, +0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f,
+0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f,
};
vk.vbo = create_buffer(data, sizeof(data), VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
}
static void init_uniform_buffer(void)
{
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vk.ubo[i] = create_buffer(NULL, 16 * sizeof(float),
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT);
}
}
static VkShaderModule create_shader_module(const uint8_t *data, size_t size)
{
VkShaderModuleCreateInfo module_info = { VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO };
VkShaderModule module;
module_info.codeSize = size;
module_info.pCode = (const uint32_t*)data;
vkCreateShaderModule(vulkan->device, &module_info, NULL, &module);
return module;
}
static void init_descriptor(void)
{
VkDevice device = vulkan->device;
VkDescriptorSetLayoutBinding binding = {0};
binding.binding = 0;
binding.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
binding.descriptorCount = 1;
binding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
binding.pImmutableSamplers = NULL;
const VkDescriptorPoolSize pool_sizes[1] = {
{ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, vk.num_swapchain_images },
};
VkDescriptorSetLayoutCreateInfo set_layout_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO };
set_layout_info.bindingCount = 1;
set_layout_info.pBindings = &binding;
vkCreateDescriptorSetLayout(device, &set_layout_info, NULL, &vk.set_layout);
VkPipelineLayoutCreateInfo layout_info = { VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO };
layout_info.setLayoutCount = 1;
layout_info.pSetLayouts = &vk.set_layout;
vkCreatePipelineLayout(device, &layout_info, NULL, &vk.pipeline_layout);
VkDescriptorPoolCreateInfo pool_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO };
pool_info.maxSets = vk.num_swapchain_images;
pool_info.poolSizeCount = 1;
pool_info.pPoolSizes = pool_sizes;
pool_info.flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT;
vkCreateDescriptorPool(device, &pool_info, NULL, &vk.desc_pool);
VkDescriptorSetAllocateInfo alloc_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO };
alloc_info.descriptorPool = vk.desc_pool;
alloc_info.descriptorSetCount = 1;
alloc_info.pSetLayouts = &vk.set_layout;
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vkAllocateDescriptorSets(device, &alloc_info, &vk.desc_set[i]);
VkWriteDescriptorSet write = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
VkDescriptorBufferInfo buffer_info;
write.dstSet = vk.desc_set[i];
write.dstBinding = 0;
write.descriptorCount = 1;
write.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
write.pBufferInfo = &buffer_info;
buffer_info.buffer = vk.ubo[i].buffer;
buffer_info.offset = 0;
buffer_info.range = 16 * sizeof(float);
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
}
}
static void init_pipeline(void)
{
VkDevice device = vulkan->device;
VkPipelineInputAssemblyStateCreateInfo input_assembly = { VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO };
input_assembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
VkVertexInputAttributeDescription attributes[2] = {{ 0 }};
attributes[0].location = 0;
attributes[0].binding = 0;
attributes[0].format = VK_FORMAT_R32G32B32A32_SFLOAT;
attributes[0].offset = 0;
attributes[1].location = 1;
attributes[1].binding = 0;
attributes[1].format = VK_FORMAT_R32G32B32A32_SFLOAT;
attributes[1].offset = 4 * sizeof(float);
VkVertexInputBindingDescription binding = { 0 };
binding.binding = 0;
binding.stride = sizeof(float) * 8;
binding.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
VkPipelineVertexInputStateCreateInfo vertex_input = { VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO };
vertex_input.vertexBindingDescriptionCount = 1;
vertex_input.pVertexBindingDescriptions = &binding;
vertex_input.vertexAttributeDescriptionCount = 2;
vertex_input.pVertexAttributeDescriptions = attributes;
VkPipelineRasterizationStateCreateInfo raster = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO };
raster.polygonMode = VK_POLYGON_MODE_FILL;
raster.cullMode = VK_CULL_MODE_BACK_BIT;
raster.frontFace = VK_FRONT_FACE_COUNTER_CLOCKWISE;
raster.depthClampEnable = false;
raster.rasterizerDiscardEnable = false;
raster.depthBiasEnable = false;
raster.lineWidth = 1.0f;
VkPipelineColorBlendAttachmentState blend_attachment = { 0 };
blend_attachment.blendEnable = false;
blend_attachment.colorWriteMask = 0xf;
VkPipelineColorBlendStateCreateInfo blend = { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO };
blend.attachmentCount = 1;
blend.pAttachments = &blend_attachment;
VkPipelineViewportStateCreateInfo viewport = { VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO };
viewport.viewportCount = 1;
viewport.scissorCount = 1;
VkPipelineDepthStencilStateCreateInfo depth_stencil = { VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO };
depth_stencil.depthTestEnable = false;
depth_stencil.depthWriteEnable = false;
depth_stencil.depthBoundsTestEnable = false;
depth_stencil.stencilTestEnable = false;
VkPipelineMultisampleStateCreateInfo multisample = { VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO };
multisample.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
static const VkDynamicState dynamics[] = {
VK_DYNAMIC_STATE_VIEWPORT,
VK_DYNAMIC_STATE_SCISSOR,
};
VkPipelineDynamicStateCreateInfo dynamic = { VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO };
dynamic.pDynamicStates = dynamics;
dynamic.dynamicStateCount = sizeof(dynamics) / sizeof(dynamics[0]);
VkPipelineShaderStageCreateInfo shader_stages[2] = {
{ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO },
{ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO },
};
shader_stages[0].stage = VK_SHADER_STAGE_VERTEX_BIT;
shader_stages[0].module = create_shader_module(triangle_vert_spv, triangle_vert_spv_len);
shader_stages[0].pName = "main";
shader_stages[1].stage = VK_SHADER_STAGE_FRAGMENT_BIT;
shader_stages[1].module = create_shader_module(triangle_frag_spv, triangle_frag_spv_len);
shader_stages[1].pName = "main";
VkGraphicsPipelineCreateInfo pipe = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO };
pipe.stageCount = 2;
pipe.pStages = shader_stages;
pipe.pVertexInputState = &vertex_input;
pipe.pInputAssemblyState = &input_assembly;
pipe.pRasterizationState = &raster;
pipe.pColorBlendState = &blend;
pipe.pMultisampleState = &multisample;
pipe.pViewportState = &viewport;
pipe.pDepthStencilState = &depth_stencil;
pipe.pDynamicState = &dynamic;
pipe.renderPass = vk.render_pass;
pipe.layout = vk.pipeline_layout;
vkCreateGraphicsPipelines(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
vkDestroyShaderModule(device, shader_stages[0].module, NULL);
vkDestroyShaderModule(device, shader_stages[1].module, NULL);
}
static void init_render_pass(VkFormat format)
{
VkAttachmentDescription attachment = { 0 };
attachment.format = format;
attachment.samples = VK_SAMPLE_COUNT_1_BIT;
attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
attachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
attachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
attachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
attachment.initialLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
attachment.finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
VkAttachmentReference color_ref = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
VkSubpassDescription subpass = { 0 };
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpass.colorAttachmentCount = 1;
subpass.pColorAttachments = &color_ref;
VkRenderPassCreateInfo rp_info = { VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO };
rp_info.attachmentCount = 1;
rp_info.pAttachments = &attachment;
rp_info.subpassCount = 1;
rp_info.pSubpasses = &subpass;
vkCreateRenderPass(vulkan->device, &rp_info, NULL, &vk.render_pass);
}
static void init_swapchain(void)
{
VkDevice device = vulkan->device;
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
VkImageCreateInfo image = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
image.imageType = VK_IMAGE_TYPE_2D;
image.flags |= VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
image.format = VK_FORMAT_R8G8B8A8_UNORM;
image.extent.width = BASE_WIDTH;
image.extent.height = BASE_HEIGHT;
image.extent.depth = 1;
image.samples = VK_SAMPLE_COUNT_1_BIT;
image.tiling = VK_IMAGE_TILING_OPTIMAL;
image.usage =
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT |
VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
image.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
image.mipLevels = 1;
image.arrayLayers = 1;
vkCreateImage(device, &image, NULL, &vk.images[i].create_info.image);
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
VkMemoryRequirements mem_reqs;
vkGetImageMemoryRequirements(device, vk.images[i].create_info.image, &mem_reqs);
alloc.allocationSize = mem_reqs.size;
alloc.memoryTypeIndex = find_memory_type_from_requirements(
mem_reqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
vkAllocateMemory(device, &alloc, NULL, &vk.image_memory[i]);
vkBindImageMemory(device, vk.images[i].create_info.image, vk.image_memory[i], 0);
vk.images[i].create_info.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
vk.images[i].create_info.viewType = VK_IMAGE_VIEW_TYPE_2D;
vk.images[i].create_info.format = VK_FORMAT_R8G8B8A8_UNORM;
vk.images[i].create_info.subresourceRange.baseMipLevel = 0;
vk.images[i].create_info.subresourceRange.baseArrayLayer = 0;
vk.images[i].create_info.subresourceRange.levelCount = 1;
vk.images[i].create_info.subresourceRange.layerCount = 1;
vk.images[i].create_info.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
vk.images[i].create_info.components.r = VK_COMPONENT_SWIZZLE_R;
vk.images[i].create_info.components.g = VK_COMPONENT_SWIZZLE_G;
vk.images[i].create_info.components.b = VK_COMPONENT_SWIZZLE_B;
vk.images[i].create_info.components.a = VK_COMPONENT_SWIZZLE_A;
vkCreateImageView(device, &vk.images[i].create_info,
NULL, &vk.images[i].image_view);
vk.images[i].image_layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
VkFramebufferCreateInfo fb_info = { VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO };
fb_info.renderPass = vk.render_pass;
fb_info.attachmentCount = 1;
fb_info.pAttachments = &vk.images[i].image_view;
fb_info.width = BASE_WIDTH;
fb_info.height = BASE_HEIGHT;
fb_info.layers = 1;
vkCreateFramebuffer(device, &fb_info, NULL, &vk.framebuffers[i]);
}
}
static void init_command(void)
{
VkCommandPoolCreateInfo pool_info = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO };
VkCommandBufferAllocateInfo info = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO };
pool_info.queueFamilyIndex = vulkan->queue_index;
pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vkCreateCommandPool(vulkan->device, &pool_info, NULL, &vk.cmd_pool[i]);
info.commandPool = vk.cmd_pool[i];
info.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
info.commandBufferCount = 1;
vkAllocateCommandBuffers(vulkan->device, &info, &vk.cmd[i]);
}
}
static void vulkan_test_init(void)
{
vkGetPhysicalDeviceProperties(vulkan->gpu, &vk.gpu_properties);
vkGetPhysicalDeviceMemoryProperties(vulkan->gpu, &vk.memory_properties);
unsigned num_images = 0;
uint32_t mask = vulkan->get_sync_index_mask(vulkan->handle);
for (unsigned i = 0; i < 32; i++)
if (mask & (1u << i))
num_images = i + 1;
vk.num_swapchain_images = num_images;
vk.swapchain_mask = mask;
init_uniform_buffer();
init_vertex_buffer();
init_command();
init_descriptor();
VkPipelineCacheCreateInfo pipeline_cache_info = { VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
vkCreatePipelineCache(vulkan->device, &pipeline_cache_info,
NULL, &vk.pipeline_cache);
init_render_pass(VK_FORMAT_R8G8B8A8_UNORM);
init_pipeline();
init_swapchain();
}
static void vulkan_test_deinit(void)
{
VkDevice device = vulkan->device;
vkDeviceWaitIdle(device);
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vkDestroyFramebuffer(device, vk.framebuffers[i], NULL);
vkDestroyImageView(device, vk.images[i].image_view, NULL);
vkFreeMemory(device, vk.image_memory[i], NULL);
vkDestroyImage(device, vk.images[i].create_info.image, NULL);
vkFreeMemory(device, vk.ubo[i].memory, NULL);
vkDestroyBuffer(device, vk.ubo[i].buffer, NULL);
}
vkFreeDescriptorSets(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
vkDestroyDescriptorPool(device, vk.desc_pool, NULL);
vkDestroyRenderPass(device, vk.render_pass, NULL);
vkDestroyPipeline(device, vk.pipeline, NULL);
vkDestroyPipelineLayout(device, vk.pipeline_layout, NULL);
vkFreeMemory(device, vk.vbo.memory, NULL);
vkDestroyBuffer(device, vk.vbo.buffer, NULL);
vkDestroyPipelineCache(device, vk.pipeline_cache, NULL);
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vkFreeCommandBuffers(device, vk.cmd_pool[i], 1, &vk.cmd[i]);
vkDestroyCommandPool(device, vk.cmd_pool[i], NULL);
}
memset(&vk, 0, sizeof(vk));
}
void retro_run(void)
{
input_poll_cb();
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
{
}
/* Very lazy way to do this. */
if (vulkan->get_sync_index_mask(vulkan->handle) != vk.swapchain_mask)
{
vulkan_test_deinit();
vulkan_test_init();
}
vulkan->wait_sync_index(vulkan->handle);
vk.index = vulkan->get_sync_index(vulkan->handle);
vulkan_test_render();
vulkan->set_image(vulkan->handle, &vk.images[vk.index], 0, NULL);
vulkan->set_command_buffers(vulkan->handle, 1, &vk.cmd[vk.index]);
video_cb(RETRO_HW_FRAME_BUFFER_VALID, BASE_WIDTH, BASE_HEIGHT, 0);
}
static void context_reset(void)
{
fprintf(stderr, "Context reset!\n");
if (!environ_cb(RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE, (void**)&vulkan) || !vulkan)
{
fprintf(stderr, "Failed to get HW rendering interface!\n");
return;
}
vulkan_test_init();
}
static void context_destroy(void)
{
fprintf(stderr, "Context destroy!\n");
vulkan_test_deinit();
vulkan = NULL;
memset(&vk, 0, sizeof(vk));
}
static bool retro_init_hw_context(void)
{
hw_render.context_type = RETRO_HW_CONTEXT_VULKAN;
hw_render.version_major = VK_API_VERSION;
hw_render.version_minor = 0;
hw_render.context_reset = context_reset;
hw_render.context_destroy = context_destroy;
hw_render.cache_context = true;
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
return false;
return true;
}
bool retro_load_game(const struct retro_game_info *info)
{
if (!retro_init_hw_context())
{
fprintf(stderr, "HW Context could not be initialized, exiting...\n");
return false;
}
fprintf(stderr, "Loaded game!\n");
(void)info;
return true;
}
void retro_unload_game(void)
{}
unsigned retro_get_region(void)
{
return RETRO_REGION_NTSC;
}
bool retro_load_game_special(unsigned type, const struct retro_game_info *info, size_t num)
{
(void)type;
(void)info;
(void)num;
return false;
}
size_t retro_serialize_size(void)
{
return 0;
}
bool retro_serialize(void *data, size_t size)
{
(void)data;
(void)size;
return false;
}
bool retro_unserialize(const void *data, size_t size)
{
(void)data;
(void)size;
return false;
}
void *retro_get_memory_data(unsigned id)
{
(void)id;
return NULL;
}
size_t retro_get_memory_size(unsigned id)
{
(void)id;
return 0;
}
void retro_reset(void)
{}
void retro_cheat_reset(void)
{}
void retro_cheat_set(unsigned index, bool enabled, const char *code)
{
(void)index;
(void)enabled;
(void)code;
}
+5
View File
@@ -0,0 +1,5 @@
{
global: retro_*;
local: *;
};
@@ -0,0 +1,23 @@
VERT_SHADERS := $(wildcard *.vert)
FRAG_SHADERS := $(wildcard *.frag)
SPIRV := $(VERT_SHADERS:.vert=.vert.spv) $(FRAG_SHADERS:.frag=.frag.spv)
INCLUDES := $(SPIRV:.spv=.inc)
GLSLANG := glslangValidator
all: $(INCLUDES)
%.frag.spv: %.frag
$(GLSLANG) -V -o $@ $<
%.vert.spv: %.vert
$(GLSLANG) -V -o $@ $<
%.inc: %.spv
xxd -i $< $@
clean:
rm -f $(INCLUDES)
rm -f $(SPIRV)
.PHONY: clean
@@ -0,0 +1,9 @@
#version 310 es
precision mediump float;
layout(location = 0) in vec4 vColor;
layout(location = 0) out vec4 FragColor;
void main()
{
FragColor = vColor;
}
@@ -0,0 +1,38 @@
unsigned char triangle_frag_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x09, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00,
0x01, 0x00, 0x00, 0x00, 0x36, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x72, 0x61, 0x67,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x76, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00,
0x47, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00,
0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x3b, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
0x09, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
0x38, 0x00, 0x01, 0x00
};
unsigned int triangle_frag_spv_len = 412;
@@ -0,0 +1,15 @@
#version 310 es
layout(location = 0) in vec4 Position;
layout(location = 1) in vec4 Color;
layout(location = 0) out vec4 vColor;
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
};
void main()
{
gl_Position = MVP * Position;
vColor = Color;
}
@@ -0,0 +1,83 @@
unsigned char triangle_vert_spv[] = {
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x08, 0x00,
0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x1b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00,
0x36, 0x01, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00,
0x08, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50, 0x65, 0x72, 0x56, 0x65,
0x72, 0x74, 0x65, 0x78, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x06, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50,
0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x06, 0x00, 0x07, 0x00,
0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x6c, 0x5f, 0x50,
0x6f, 0x69, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x55, 0x42, 0x4f, 0x00,
0x06, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4d, 0x56, 0x50, 0x00, 0x05, 0x00, 0x03, 0x00, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x15, 0x00, 0x00, 0x00,
0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x04, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x76, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00,
0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x47, 0x00, 0x03, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x48, 0x00, 0x04, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x48, 0x00, 0x05, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x47, 0x00, 0x03, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x10, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00,
0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, 0x04, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x04, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x13, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x17, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00,
0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0x3b, 0x00, 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x15, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x18, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x03, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x0f, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x20, 0x00, 0x04, 0x00, 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x0d, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x14, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x14, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x20, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00, 0x18, 0x00, 0x00, 0x00,
0x1a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
0x14, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
0x05, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x11, 0x00, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x12, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00,
0x16, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x91, 0x00, 0x05, 0x00,
0x07, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x16, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x18, 0x00, 0x00, 0x00,
0x19, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x3e, 0x00, 0x03, 0x00, 0x19, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00,
0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x1b, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x1a, 0x00, 0x00, 0x00,
0x1c, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00
};
unsigned int triangle_vert_spv_len = 960;
+2
View File
@@ -120,6 +120,8 @@ else
CFLAGS += -std=gnu99
endif
CFLAGS += -I../../libretro-common/include
all: $(TARGET)
$(TARGET): $(OBJECTS)
+28 -10
View File
@@ -9,7 +9,7 @@
#include "../../libretro.h"
static uint16_t *frame_buf;
static uint32_t *frame_buf;
static struct retro_log_callback logging;
static retro_log_printf_t log_cb;
static bool use_audio_cb;
@@ -27,7 +27,7 @@ static void fallback_log(enum retro_log_level level, const char *fmt, ...)
void retro_init(void)
{
frame_buf = calloc(320 * 240, sizeof(uint16_t));
frame_buf = calloc(320 * 240, sizeof(uint32_t));
}
void retro_deinit(void)
@@ -278,11 +278,29 @@ static void update_input(void)
static void render_checkered(void)
{
uint16_t color_r = 31 << 11;
uint16_t color_g = 63 << 5;
/* Try rendering straight into VRAM if we can. */
uint32_t *buf = NULL;
unsigned stride = 0;
struct retro_framebuffer fb = {0};
fb.width = 320;
fb.height = 240;
fb.access_flags = RETRO_MEMORY_ACCESS_WRITE;
if (environ_cb(RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER, &fb) && fb.format == RETRO_PIXEL_FORMAT_XRGB8888)
{
buf = fb.data;
stride = fb.pitch >> 2;
}
else
{
buf = frame_buf;
stride = 320;
}
uint16_t *line = frame_buf;
for (unsigned y = 0; y < 240; y++, line += 320)
uint32_t color_r = 0xff << 16;
uint32_t color_g = 0xff << 8;
uint32_t *line = buf;
for (unsigned y = 0; y < 240; y++, line += stride)
{
unsigned index_y = ((y - y_coord) >> 4) & 1;
for (unsigned x = 0; x < 320; x++)
@@ -294,9 +312,9 @@ static void render_checkered(void)
for (unsigned y = mouse_rel_y - 5; y <= mouse_rel_y + 5; y++)
for (unsigned x = mouse_rel_x - 5; x <= mouse_rel_x + 5; x++)
frame_buf[y * 320 + x] = 0x1f;
buf[y * stride + x] = 0xff;
video_cb(frame_buf, 320, 240, 320 << 1);
video_cb(buf, 320, 240, stride << 2);
}
static void check_variables(void)
@@ -381,10 +399,10 @@ bool retro_load_game(const struct retro_game_info *info)
environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc);
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
log_cb(RETRO_LOG_INFO, "RGB565 is not supported.\n");
log_cb(RETRO_LOG_INFO, "XRGB8888 is not supported.\n");
return false;
}
+12 -2
View File
@@ -67,7 +67,7 @@ else ifeq ($(LIBRETRO), catsfc)
APP_PRODUCT_CODE = RARCH-CATSFC
APP_UNIQUE_ID = 0xBAC07
APP_ICON = ctr/assets/catsfc.png
#APP_BANNER = ctr/assets/libretro_banner.png
APP_BANNER = ctr/assets/catsfc_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), mednafen_wswan)
@@ -117,7 +117,7 @@ else ifeq ($(LIBRETRO), picodrive)
APP_PRODUCT_CODE = RARCH-PICODRIVE
APP_UNIQUE_ID = 0xBAC0C
APP_ICON = ctr/assets/picodrive.png
#APP_BANNER = ctr/assets/libretro_banner.png
APP_BANNER = ctr/assets/picodrive_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), snes9x_next)
@@ -262,6 +262,16 @@ else ifeq ($(LIBRETRO), pocketsnes)
APP_PRODUCT_CODE = RARCH-POCKETSNES
APP_UNIQUE_ID = 0xBAC1A
APP_ICON = ctr/assets/pocketsnes.png
APP_BANNER = ctr/assets/pocketsnes_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), dosbox)
APP_TITLE = DosBox
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = various
APP_PRODUCT_CODE = RARCH-DOSBOX
APP_UNIQUE_ID = 0xBAC1B
APP_ICON = ctr/assets/dosbox.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+13 -2
View File
@@ -17,13 +17,11 @@
#include <stdint.h>
#include <file/file_extract.h>
#include <retro_endianness.h>
#include "dir_list_special.h"
#include "database_info.h"
#include "msg_hash.h"
#include "general.h"
#include "verbosity.h"
#ifdef HAVE_CONFIG_H
@@ -51,6 +49,7 @@
#define DB_CURSOR_ROM_NAME 0x16bbcf13U
#define DB_CURSOR_NAME 0x7c9b0c46U
#define DB_CURSOR_DESCRIPTION 0x91b0c789U
#define DB_CURSOR_GENRE 0x0f802156U
#define DB_CURSOR_PUBLISHER 0x5e099013U
#define DB_CURSOR_DEVELOPER 0x1783d2abU
#define DB_CURSOR_ORIGIN 0x1315e3edU
@@ -68,10 +67,12 @@
#define DB_CURSOR_EDGE_MAGAZINE_RATING 0xd30dc4feU
#define DB_CURSOR_EDGE_MAGAZINE_ISSUE 0xa0f30d42U
#define DB_CURSOR_FAMITSU_MAGAZINE_RATING 0x0a50ca62U
#define DB_CURSOR_TGDB_RATING 0x8d61458aU
#define DB_CURSOR_MAX_USERS 0x1084ff77U
#define DB_CURSOR_RELEASEDATE_MONTH 0x790ad76cU
#define DB_CURSOR_RELEASEDATE_YEAR 0x7fd06ed7U
#define DB_CURSOR_RUMBLE_SUPPORTED 0x1a4dc3ecU
#define DB_CURSOR_COOP_SUPPORTED 0x7c953ff6U
#define DB_CURSOR_ANALOG_SUPPORTED 0xf220fc17U
#define DB_CURSOR_SIZE 0x7c9dede0U
#define DB_CURSOR_SERIAL 0x1b843ec5U
@@ -238,6 +239,7 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
db_info->analog_supported = -1;
db_info->rumble_supported = -1;
db_info->coop_supported = -1;
for (i = 0; i < item.val.map.len; i++)
{
@@ -265,6 +267,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
case DB_CURSOR_DESCRIPTION:
db_info->description = strdup(val->val.string.buff);
break;
case DB_CURSOR_GENRE:
db_info->genre = strdup(val->val.string.buff);
break;
case DB_CURSOR_PUBLISHER:
db_info->publisher = strdup(val->val.string.buff);
break;
@@ -307,6 +312,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
case DB_CURSOR_FAMITSU_MAGAZINE_RATING:
db_info->famitsu_magazine_rating = val->val.uint_;
break;
case DB_CURSOR_TGDB_RATING:
db_info->tgdb_rating = val->val.uint_;
break;
case DB_CURSOR_MAX_USERS:
db_info->max_users = val->val.uint_;
break;
@@ -319,6 +327,9 @@ static int database_cursor_iterate(libretrodb_cursor_t *cur,
case DB_CURSOR_RUMBLE_SUPPORTED:
db_info->rumble_supported = val->val.uint_;
break;
case DB_CURSOR_COOP_SUPPORTED:
db_info->coop_supported = val->val.uint_;
break;
case DB_CURSOR_ANALOG_SUPPORTED:
db_info->analog_supported = val->val.uint_;
break;
+9 -8
View File
@@ -20,10 +20,10 @@
#include <stdint.h>
#include <stddef.h>
#include <boolean.h>
#include <file/file_extract.h>
#include <file/file_archive.h>
#include "libretro-db/libretrodb.h"
#include "playlist.h"
#ifdef __cplusplus
extern "C" {
@@ -55,7 +55,7 @@ typedef struct
size_t list_ptr;
struct string_list *list;
#ifdef HAVE_ZLIB
zlib_transfer_t state;
file_archive_transfer_t state;
#endif
} database_info_handle_t;
@@ -65,6 +65,7 @@ typedef struct
char *rom_name;
char *serial;
char *description;
char *genre;
char *publisher;
struct string_list *developer;
char *origin;
@@ -86,8 +87,10 @@ typedef struct
unsigned max_users;
unsigned releasemonth;
unsigned releaseyear;
unsigned tgdb_rating;
int analog_supported;
int rumble_supported;
int coop_supported;
void *userdata;
} database_info_t;
@@ -113,10 +116,8 @@ void database_info_free(database_info_handle_t *handle);
int database_info_build_query(
char *query, size_t len, const char *label, const char *path);
/*
* NOTE: Allocates memory, it is the caller's responsibility to free the
* memory after it is no longer required.
*/
/* NOTE: Allocates memory, it is the caller's responsibility to free the
* memory after it is no longer required. */
char *bin_to_hex_alloc(const uint8_t *data, size_t len);
#ifdef __cplusplus
-1
View File
@@ -77,5 +77,4 @@ struct defaults
/* Public data structures. */
extern struct defaults g_defaults;
#endif
+45 -95
View File
@@ -16,95 +16,12 @@
#ifndef _GX_DEFINES_H
#define _GX_DEFINES_H
#define _SHIFTL(v, s, w) ((uint32_t) (((uint32_t)(v) & ((0x01 << (w)) - 1)) << (s)))
#define _SHIFTR(v, s, w) ((uint32_t)(((uint32_t)(v) >> (s)) & ((0x01 << (w)) - 1)))
#ifndef __lhbrx
#define __lhbrx(base,index) \
({ register u16 res; \
__asm__ volatile ("lhbrx %0,%1,%2" : "=r"(res) : "b%"(index), "r"(base) : "memory"); \
res; })
#endif
#ifndef __sthbrx
#define __sthbrx(base,index,value) \
__asm__ volatile ("sthbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory")
#endif
#ifndef __stwbrx
#define __stwbrx(base,index,value) \
__asm__ volatile ("stwbrx %0,%1,%2" : : "r"(value), "b%"(index), "r"(base) : "memory")
#endif
#ifndef _sync
#define _sync() asm volatile("sync")
#endif
#ifndef _nop
#define _nop() asm volatile("nop")
#endif
#ifndef ppcsync
#define ppcsync() asm volatile("sc")
#endif
#ifndef ppchalt
#define ppchalt() ({ \
_sync(); \
while(1) { \
_nop(); \
asm volatile("li 3,0"); \
_nop(); \
} \
})
#endif
#ifndef _CPU_ISR_Enable
#define _CPU_ISR_Enable() \
{ register u32 _val = 0; \
__asm__ __volatile__ ( \
"mfmsr %0\n" \
"ori %0,%0,0x8000\n" \
"mtmsr %0" \
: "=&r" ((_val)) : "0" ((_val)) \
); \
}
#endif
#ifndef _CPU_ISR_Disable
#define _CPU_ISR_Disable( _isr_cookie ) \
{ register u32 _disable_mask = 0; \
_isr_cookie = 0; \
__asm__ __volatile__ ( \
"mfmsr %0\n" \
"rlwinm %1,%0,0,17,15\n" \
"mtmsr %1\n" \
"extrwi %0,%0,1,16" \
: "=&r" ((_isr_cookie)), "=&r" ((_disable_mask)) \
: "0" ((_isr_cookie)), "1" ((_disable_mask)) \
); \
}
#endif
#ifndef _CPU_ISR_Restore
#define _CPU_ISR_Restore( _isr_cookie ) \
{ register u32 _enable_mask = 0; \
__asm__ __volatile__ ( \
" cmpwi %0,0\n" \
" beq 1f\n" \
" mfmsr %1\n" \
" ori %1,%1,0x8000\n" \
" mtmsr %1\n" \
"1:" \
: "=r"((_isr_cookie)),"=&r" ((_enable_mask)) \
: "0"((_isr_cookie)),"1" ((_enable_mask)) \
); \
}
#endif
#ifdef GEKKO
extern void __lwp_thread_stopmultitasking(void (*exitfunc)());
#define SYSMEM1_SIZE 0x01800000
#define _SHIFTL(v, s, w) ((uint32_t) (((uint32_t)(v) & ((0x01 << (w)) - 1)) << (s)))
#define _SHIFTR(v, s, w) ((uint32_t)(((uint32_t)(v) >> (s)) & ((0x01 << (w)) - 1)))
#define OSThread lwp_t
#define OSCond lwpq_t
@@ -120,19 +37,52 @@ extern void __lwp_thread_stopmultitasking(void (*exitfunc)());
#define OSWaitCond(cond, mutex) LWP_CondWait(cond, mutex)
#define OSInitThreadQueue(queue) LWP_InitQueue(queue)
#define OSCloseThreadQueue(queue) LWP_CloseQueue(queue)
#define OSSleepThread(queue) LWP_ThreadSleep(queue)
#define OSJoinThread(thread, val) LWP_JoinThread(thread, val)
#define OSCreateThread(thread, func, intarg, ptrarg, stackbase, stacksize, priority, attrs) LWP_CreateThread(thread, func, ptrarg, stackbase, stacksize, priority)
#define VISetPostRetraceCallback(cb) VIDEO_SetPostRetraceCallback(cb)
#define VISetBlack(black) VIDEO_SetBlack(black)
#define VIFlush() VIDEO_Flush()
#define VISetNextFrameBuffer(fb) VIDEO_SetNextFramebuffer(fb)
#define VIWaitForRetrace() VIDEO_WaitVSync()
#define VIConfigure(rm) VIDEO_Configure(rm)
#define VIInit() VIDEO_Init()
#define VIPadFrameBufferWidth(width) VIDEO_PadFramebufferWidth(width)
#define BLIT_LINE_16(off) \
{ \
const uint32_t *tmp_src = src; \
uint32_t *tmp_dst = dst; \
for (unsigned x = 0; x < width2 >> 1; x++, tmp_src += 2, tmp_dst += 8) \
{ \
tmp_dst[ 0 + off] = BLIT_LINE_16_CONV(tmp_src[0]); \
tmp_dst[ 1 + off] = BLIT_LINE_16_CONV(tmp_src[1]); \
} \
src += tmp_pitch; \
}
#define BLIT_LINE_32(off) \
{ \
const uint16_t *tmp_src = src; \
uint16_t *tmp_dst = dst; \
for (unsigned x = 0; x < width2 >> 3; x++, tmp_src += 8, tmp_dst += 32) \
{ \
tmp_dst[ 0 + off] = tmp_src[0] | 0xFF00; \
tmp_dst[ 16 + off] = tmp_src[1]; \
tmp_dst[ 1 + off] = tmp_src[2] | 0xFF00; \
tmp_dst[ 17 + off] = tmp_src[3]; \
tmp_dst[ 2 + off] = tmp_src[4] | 0xFF00; \
tmp_dst[ 18 + off] = tmp_src[5]; \
tmp_dst[ 3 + off] = tmp_src[6] | 0xFF00; \
tmp_dst[ 19 + off] = tmp_src[7]; \
} \
src += tmp_pitch; \
}
#define CHUNK_FRAMES 64
#define CHUNK_SIZE (CHUNK_FRAMES * sizeof(uint32_t))
#define BLOCKS 16
#define AIInit AUDIO_Init
#define AIInitDMA AUDIO_InitDMA
#define AIStartDMA AUDIO_StartDMA
#define AIStopDMA AUDIO_StopDMA
#define AIRegisterDMACallback AUDIO_RegisterDMACallback
#define AISetDSPSampleRate AUDIO_SetDSPSampleRate
#endif
Vendored Submodule
+1
Submodule deps/glslang/glslang added at f2d8a5c53f.
+384
View File
@@ -0,0 +1,384 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2016 - 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 <http://www.gnu.org/licenses/>.
*/
#include "glslang.hpp"
#include "ShaderLang.h"
#include "GlslangToSpv.h"
#include <vector>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include "../../general.h"
using namespace glslang;
using namespace std;
struct SlangProcess
{
public:
SlangProcess();
TBuiltInResource& GetResources() { return Resources; }
~SlangProcess() { FinalizeProcess(); }
private:
TBuiltInResource Resources;
};
SlangProcess::SlangProcess()
{
InitializeProcess();
char DefaultConfig[] =
"MaxLights 32\n"
"MaxClipPlanes 6\n"
"MaxTextureUnits 32\n"
"MaxTextureCoords 32\n"
"MaxVertexAttribs 64\n"
"MaxVertexUniformComponents 4096\n"
"MaxVaryingFloats 64\n"
"MaxVertexTextureImageUnits 32\n"
"MaxCombinedTextureImageUnits 80\n"
"MaxTextureImageUnits 32\n"
"MaxFragmentUniformComponents 4096\n"
"MaxDrawBuffers 32\n"
"MaxVertexUniformVectors 128\n"
"MaxVaryingVectors 8\n"
"MaxFragmentUniformVectors 16\n"
"MaxVertexOutputVectors 16\n"
"MaxFragmentInputVectors 15\n"
"MinProgramTexelOffset -8\n"
"MaxProgramTexelOffset 7\n"
"MaxClipDistances 8\n"
"MaxComputeWorkGroupCountX 65535\n"
"MaxComputeWorkGroupCountY 65535\n"
"MaxComputeWorkGroupCountZ 65535\n"
"MaxComputeWorkGroupSizeX 1024\n"
"MaxComputeWorkGroupSizeY 1024\n"
"MaxComputeWorkGroupSizeZ 64\n"
"MaxComputeUniformComponents 1024\n"
"MaxComputeTextureImageUnits 16\n"
"MaxComputeImageUniforms 8\n"
"MaxComputeAtomicCounters 8\n"
"MaxComputeAtomicCounterBuffers 1\n"
"MaxVaryingComponents 60\n"
"MaxVertexOutputComponents 64\n"
"MaxGeometryInputComponents 64\n"
"MaxGeometryOutputComponents 128\n"
"MaxFragmentInputComponents 128\n"
"MaxImageUnits 8\n"
"MaxCombinedImageUnitsAndFragmentOutputs 8\n"
"MaxCombinedShaderOutputResources 8\n"
"MaxImageSamples 0\n"
"MaxVertexImageUniforms 0\n"
"MaxTessControlImageUniforms 0\n"
"MaxTessEvaluationImageUniforms 0\n"
"MaxGeometryImageUniforms 0\n"
"MaxFragmentImageUniforms 8\n"
"MaxCombinedImageUniforms 8\n"
"MaxGeometryTextureImageUnits 16\n"
"MaxGeometryOutputVertices 256\n"
"MaxGeometryTotalOutputComponents 1024\n"
"MaxGeometryUniformComponents 1024\n"
"MaxGeometryVaryingComponents 64\n"
"MaxTessControlInputComponents 128\n"
"MaxTessControlOutputComponents 128\n"
"MaxTessControlTextureImageUnits 16\n"
"MaxTessControlUniformComponents 1024\n"
"MaxTessControlTotalOutputComponents 4096\n"
"MaxTessEvaluationInputComponents 128\n"
"MaxTessEvaluationOutputComponents 128\n"
"MaxTessEvaluationTextureImageUnits 16\n"
"MaxTessEvaluationUniformComponents 1024\n"
"MaxTessPatchComponents 120\n"
"MaxPatchVertices 32\n"
"MaxTessGenLevel 64\n"
"MaxViewports 16\n"
"MaxVertexAtomicCounters 0\n"
"MaxTessControlAtomicCounters 0\n"
"MaxTessEvaluationAtomicCounters 0\n"
"MaxGeometryAtomicCounters 0\n"
"MaxFragmentAtomicCounters 8\n"
"MaxCombinedAtomicCounters 8\n"
"MaxAtomicCounterBindings 1\n"
"MaxVertexAtomicCounterBuffers 0\n"
"MaxTessControlAtomicCounterBuffers 0\n"
"MaxTessEvaluationAtomicCounterBuffers 0\n"
"MaxGeometryAtomicCounterBuffers 0\n"
"MaxFragmentAtomicCounterBuffers 1\n"
"MaxCombinedAtomicCounterBuffers 1\n"
"MaxAtomicCounterBufferSize 16384\n"
"MaxTransformFeedbackBuffers 4\n"
"MaxTransformFeedbackInterleavedComponents 64\n"
"MaxCullDistances 8\n"
"MaxCombinedClipAndCullDistances 8\n"
"MaxSamples 4\n"
"nonInductiveForLoops 1\n"
"whileLoops 1\n"
"doWhileLoops 1\n"
"generalUniformIndexing 1\n"
"generalAttributeMatrixVectorIndexing 1\n"
"generalVaryingIndexing 1\n"
"generalSamplerIndexing 1\n"
"generalVariableIndexing 1\n"
"generalConstantMatrixVectorIndexing 1\n";
const char *delims = " \t\n\r";
const char *token = strtok(DefaultConfig, delims);
while (token)
{
const char *value_str = strtok(0, delims);
int value = strtoul(value_str, nullptr, 0);
if (strcmp(token, "MaxLights") == 0)
Resources.maxLights = value;
else if (strcmp(token, "MaxClipPlanes") == 0)
Resources.maxClipPlanes = value;
else if (strcmp(token, "MaxTextureUnits") == 0)
Resources.maxTextureUnits = value;
else if (strcmp(token, "MaxTextureCoords") == 0)
Resources.maxTextureCoords = value;
else if (strcmp(token, "MaxVertexAttribs") == 0)
Resources.maxVertexAttribs = value;
else if (strcmp(token, "MaxVertexUniformComponents") == 0)
Resources.maxVertexUniformComponents = value;
else if (strcmp(token, "MaxVaryingFloats") == 0)
Resources.maxVaryingFloats = value;
else if (strcmp(token, "MaxVertexTextureImageUnits") == 0)
Resources.maxVertexTextureImageUnits = value;
else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0)
Resources.maxCombinedTextureImageUnits = value;
else if (strcmp(token, "MaxTextureImageUnits") == 0)
Resources.maxTextureImageUnits = value;
else if (strcmp(token, "MaxFragmentUniformComponents") == 0)
Resources.maxFragmentUniformComponents = value;
else if (strcmp(token, "MaxDrawBuffers") == 0)
Resources.maxDrawBuffers = value;
else if (strcmp(token, "MaxVertexUniformVectors") == 0)
Resources.maxVertexUniformVectors = value;
else if (strcmp(token, "MaxVaryingVectors") == 0)
Resources.maxVaryingVectors = value;
else if (strcmp(token, "MaxFragmentUniformVectors") == 0)
Resources.maxFragmentUniformVectors = value;
else if (strcmp(token, "MaxVertexOutputVectors") == 0)
Resources.maxVertexOutputVectors = value;
else if (strcmp(token, "MaxFragmentInputVectors") == 0)
Resources.maxFragmentInputVectors = value;
else if (strcmp(token, "MinProgramTexelOffset") == 0)
Resources.minProgramTexelOffset = value;
else if (strcmp(token, "MaxProgramTexelOffset") == 0)
Resources.maxProgramTexelOffset = value;
else if (strcmp(token, "MaxClipDistances") == 0)
Resources.maxClipDistances = value;
else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0)
Resources.maxComputeWorkGroupCountX = value;
else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0)
Resources.maxComputeWorkGroupCountY = value;
else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0)
Resources.maxComputeWorkGroupCountZ = value;
else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0)
Resources.maxComputeWorkGroupSizeX = value;
else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0)
Resources.maxComputeWorkGroupSizeY = value;
else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0)
Resources.maxComputeWorkGroupSizeZ = value;
else if (strcmp(token, "MaxComputeUniformComponents") == 0)
Resources.maxComputeUniformComponents = value;
else if (strcmp(token, "MaxComputeTextureImageUnits") == 0)
Resources.maxComputeTextureImageUnits = value;
else if (strcmp(token, "MaxComputeImageUniforms") == 0)
Resources.maxComputeImageUniforms = value;
else if (strcmp(token, "MaxComputeAtomicCounters") == 0)
Resources.maxComputeAtomicCounters = value;
else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0)
Resources.maxComputeAtomicCounterBuffers = value;
else if (strcmp(token, "MaxVaryingComponents") == 0)
Resources.maxVaryingComponents = value;
else if (strcmp(token, "MaxVertexOutputComponents") == 0)
Resources.maxVertexOutputComponents = value;
else if (strcmp(token, "MaxGeometryInputComponents") == 0)
Resources.maxGeometryInputComponents = value;
else if (strcmp(token, "MaxGeometryOutputComponents") == 0)
Resources.maxGeometryOutputComponents = value;
else if (strcmp(token, "MaxFragmentInputComponents") == 0)
Resources.maxFragmentInputComponents = value;
else if (strcmp(token, "MaxImageUnits") == 0)
Resources.maxImageUnits = value;
else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0)
Resources.maxCombinedImageUnitsAndFragmentOutputs = value;
else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0)
Resources.maxCombinedShaderOutputResources = value;
else if (strcmp(token, "MaxImageSamples") == 0)
Resources.maxImageSamples = value;
else if (strcmp(token, "MaxVertexImageUniforms") == 0)
Resources.maxVertexImageUniforms = value;
else if (strcmp(token, "MaxTessControlImageUniforms") == 0)
Resources.maxTessControlImageUniforms = value;
else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0)
Resources.maxTessEvaluationImageUniforms = value;
else if (strcmp(token, "MaxGeometryImageUniforms") == 0)
Resources.maxGeometryImageUniforms = value;
else if (strcmp(token, "MaxFragmentImageUniforms") == 0)
Resources.maxFragmentImageUniforms = value;
else if (strcmp(token, "MaxCombinedImageUniforms") == 0)
Resources.maxCombinedImageUniforms = value;
else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0)
Resources.maxGeometryTextureImageUnits = value;
else if (strcmp(token, "MaxGeometryOutputVertices") == 0)
Resources.maxGeometryOutputVertices = value;
else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0)
Resources.maxGeometryTotalOutputComponents = value;
else if (strcmp(token, "MaxGeometryUniformComponents") == 0)
Resources.maxGeometryUniformComponents = value;
else if (strcmp(token, "MaxGeometryVaryingComponents") == 0)
Resources.maxGeometryVaryingComponents = value;
else if (strcmp(token, "MaxTessControlInputComponents") == 0)
Resources.maxTessControlInputComponents = value;
else if (strcmp(token, "MaxTessControlOutputComponents") == 0)
Resources.maxTessControlOutputComponents = value;
else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0)
Resources.maxTessControlTextureImageUnits = value;
else if (strcmp(token, "MaxTessControlUniformComponents") == 0)
Resources.maxTessControlUniformComponents = value;
else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0)
Resources.maxTessControlTotalOutputComponents = value;
else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0)
Resources.maxTessEvaluationInputComponents = value;
else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0)
Resources.maxTessEvaluationOutputComponents = value;
else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0)
Resources.maxTessEvaluationTextureImageUnits = value;
else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0)
Resources.maxTessEvaluationUniformComponents = value;
else if (strcmp(token, "MaxTessPatchComponents") == 0)
Resources.maxTessPatchComponents = value;
else if (strcmp(token, "MaxPatchVertices") == 0)
Resources.maxPatchVertices = value;
else if (strcmp(token, "MaxTessGenLevel") == 0)
Resources.maxTessGenLevel = value;
else if (strcmp(token, "MaxViewports") == 0)
Resources.maxViewports = value;
else if (strcmp(token, "MaxVertexAtomicCounters") == 0)
Resources.maxVertexAtomicCounters = value;
else if (strcmp(token, "MaxTessControlAtomicCounters") == 0)
Resources.maxTessControlAtomicCounters = value;
else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0)
Resources.maxTessEvaluationAtomicCounters = value;
else if (strcmp(token, "MaxGeometryAtomicCounters") == 0)
Resources.maxGeometryAtomicCounters = value;
else if (strcmp(token, "MaxFragmentAtomicCounters") == 0)
Resources.maxFragmentAtomicCounters = value;
else if (strcmp(token, "MaxCombinedAtomicCounters") == 0)
Resources.maxCombinedAtomicCounters = value;
else if (strcmp(token, "MaxAtomicCounterBindings") == 0)
Resources.maxAtomicCounterBindings = value;
else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0)
Resources.maxVertexAtomicCounterBuffers = value;
else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0)
Resources.maxTessControlAtomicCounterBuffers = value;
else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0)
Resources.maxTessEvaluationAtomicCounterBuffers = value;
else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0)
Resources.maxGeometryAtomicCounterBuffers = value;
else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0)
Resources.maxFragmentAtomicCounterBuffers = value;
else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0)
Resources.maxCombinedAtomicCounterBuffers = value;
else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0)
Resources.maxAtomicCounterBufferSize = value;
else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0)
Resources.maxTransformFeedbackBuffers = value;
else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0)
Resources.maxTransformFeedbackInterleavedComponents = value;
else if (strcmp(token, "MaxCullDistances") == 0)
Resources.maxCullDistances = value;
else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
Resources.maxCombinedClipAndCullDistances = value;
else if (strcmp(token, "MaxSamples") == 0)
Resources.maxSamples = value;
else if (strcmp(token, "nonInductiveForLoops") == 0)
Resources.limits.nonInductiveForLoops = (value != 0);
else if (strcmp(token, "whileLoops") == 0)
Resources.limits.whileLoops = (value != 0);
else if (strcmp(token, "doWhileLoops") == 0)
Resources.limits.doWhileLoops = (value != 0);
else if (strcmp(token, "generalUniformIndexing") == 0)
Resources.limits.generalUniformIndexing = (value != 0);
else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0)
Resources.limits.generalAttributeMatrixVectorIndexing = (value != 0);
else if (strcmp(token, "generalVaryingIndexing") == 0)
Resources.limits.generalVaryingIndexing = (value != 0);
else if (strcmp(token, "generalSamplerIndexing") == 0)
Resources.limits.generalSamplerIndexing = (value != 0);
else if (strcmp(token, "generalVariableIndexing") == 0)
Resources.limits.generalVariableIndexing = (value != 0);
else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0)
Resources.limits.generalConstantMatrixVectorIndexing = (value != 0);
token = strtok(0, delims);
}
}
bool glslang::compile_spirv(const string &source, Stage stage, std::vector<uint32_t> *spirv)
{
static SlangProcess process;
TProgram program;
EShLanguage language;
switch (stage)
{
case StageVertex: language = EShLangVertex; break;
case StageTessControl: language = EShLangTessControl; break;
case StageTessEvaluation: language = EShLangTessEvaluation; break;
case StageGeometry: language = EShLangGeometry; break;
case StageFragment: language = EShLangFragment; break;
case StageCompute: language = EShLangCompute; break;
default: return false;
}
TShader shader(language);
const char *src = source.c_str();
shader.setStrings(&src, 1);
string msg;
if (!shader.preprocess(&process.GetResources(), 100, ENoProfile, false, false, EShMsgDefault, &msg, TShader::ForbidInclude()))
{
fprintf(stderr, "%s\n", msg.c_str());
return {};
}
if (!shader.parse(&process.GetResources(), 100, false, EShMsgDefault))
{
RARCH_ERR("%s\n", shader.getInfoLog());
RARCH_ERR("%s\n", shader.getInfoDebugLog());
return false;
}
program.addShader(&shader);
if (!program.link(EShMsgDefault))
{
RARCH_ERR("%s\n", program.getInfoLog());
RARCH_ERR("%s\n", program.getInfoDebugLog());
return false;
}
GlslangToSpv(*program.getIntermediate(language), *spirv);
return true;
}
+24
View File
@@ -0,0 +1,24 @@
#ifndef GLSLANG_COMPILER_HPP
#define GLSLANG_COMPILER_HPP
#include <vector>
#include <string>
#include <stdint.h>
namespace glslang
{
enum Stage
{
StageVertex = 0,
StageTessControl,
StageTessEvaluation,
StageGeometry,
StageFragment,
StageCompute
};
bool compile_spirv(const std::string &source, Stage stage, std::vector<uint32_t> *spirv);
}
#endif
+7499
View File
File diff suppressed because it is too large. Load diff
+357
View File
@@ -0,0 +1,357 @@
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program 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 Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
ATTRIBUTE = 258,
VARYING = 259,
CONST = 260,
BOOL = 261,
FLOAT = 262,
DOUBLE = 263,
INT = 264,
UINT = 265,
BREAK = 266,
CONTINUE = 267,
DO = 268,
ELSE = 269,
FOR = 270,
IF = 271,
DISCARD = 272,
RETURN = 273,
SWITCH = 274,
CASE = 275,
DEFAULT = 276,
SUBROUTINE = 277,
BVEC2 = 278,
BVEC3 = 279,
BVEC4 = 280,
IVEC2 = 281,
IVEC3 = 282,
IVEC4 = 283,
UVEC2 = 284,
UVEC3 = 285,
UVEC4 = 286,
VEC2 = 287,
VEC3 = 288,
VEC4 = 289,
MAT2 = 290,
MAT3 = 291,
MAT4 = 292,
CENTROID = 293,
IN = 294,
OUT = 295,
INOUT = 296,
UNIFORM = 297,
PATCH = 298,
SAMPLE = 299,
BUFFER = 300,
SHARED = 301,
COHERENT = 302,
VOLATILE = 303,
RESTRICT = 304,
READONLY = 305,
WRITEONLY = 306,
DVEC2 = 307,
DVEC3 = 308,
DVEC4 = 309,
DMAT2 = 310,
DMAT3 = 311,
DMAT4 = 312,
NOPERSPECTIVE = 313,
FLAT = 314,
SMOOTH = 315,
LAYOUT = 316,
MAT2X2 = 317,
MAT2X3 = 318,
MAT2X4 = 319,
MAT3X2 = 320,
MAT3X3 = 321,
MAT3X4 = 322,
MAT4X2 = 323,
MAT4X3 = 324,
MAT4X4 = 325,
DMAT2X2 = 326,
DMAT2X3 = 327,
DMAT2X4 = 328,
DMAT3X2 = 329,
DMAT3X3 = 330,
DMAT3X4 = 331,
DMAT4X2 = 332,
DMAT4X3 = 333,
DMAT4X4 = 334,
ATOMIC_UINT = 335,
SAMPLER1D = 336,
SAMPLER2D = 337,
SAMPLER3D = 338,
SAMPLERCUBE = 339,
SAMPLER1DSHADOW = 340,
SAMPLER2DSHADOW = 341,
SAMPLERCUBESHADOW = 342,
SAMPLER1DARRAY = 343,
SAMPLER2DARRAY = 344,
SAMPLER1DARRAYSHADOW = 345,
SAMPLER2DARRAYSHADOW = 346,
ISAMPLER1D = 347,
ISAMPLER2D = 348,
ISAMPLER3D = 349,
ISAMPLERCUBE = 350,
ISAMPLER1DARRAY = 351,
ISAMPLER2DARRAY = 352,
USAMPLER1D = 353,
USAMPLER2D = 354,
USAMPLER3D = 355,
USAMPLERCUBE = 356,
USAMPLER1DARRAY = 357,
USAMPLER2DARRAY = 358,
SAMPLER2DRECT = 359,
SAMPLER2DRECTSHADOW = 360,
ISAMPLER2DRECT = 361,
USAMPLER2DRECT = 362,
SAMPLERBUFFER = 363,
ISAMPLERBUFFER = 364,
USAMPLERBUFFER = 365,
SAMPLERCUBEARRAY = 366,
SAMPLERCUBEARRAYSHADOW = 367,
ISAMPLERCUBEARRAY = 368,
USAMPLERCUBEARRAY = 369,
SAMPLER2DMS = 370,
ISAMPLER2DMS = 371,
USAMPLER2DMS = 372,
SAMPLER2DMSARRAY = 373,
ISAMPLER2DMSARRAY = 374,
USAMPLER2DMSARRAY = 375,
SAMPLEREXTERNALOES = 376,
SAMPLER = 377,
SAMPLERSHADOW = 378,
TEXTURE1D = 379,
TEXTURE2D = 380,
TEXTURE3D = 381,
TEXTURECUBE = 382,
TEXTURE1DARRAY = 383,
TEXTURE2DARRAY = 384,
ITEXTURE1D = 385,
ITEXTURE2D = 386,
ITEXTURE3D = 387,
ITEXTURECUBE = 388,
ITEXTURE1DARRAY = 389,
ITEXTURE2DARRAY = 390,
UTEXTURE1D = 391,
UTEXTURE2D = 392,
UTEXTURE3D = 393,
UTEXTURECUBE = 394,
UTEXTURE1DARRAY = 395,
UTEXTURE2DARRAY = 396,
TEXTURE2DRECT = 397,
ITEXTURE2DRECT = 398,
UTEXTURE2DRECT = 399,
TEXTUREBUFFER = 400,
ITEXTUREBUFFER = 401,
UTEXTUREBUFFER = 402,
TEXTURECUBEARRAY = 403,
ITEXTURECUBEARRAY = 404,
UTEXTURECUBEARRAY = 405,
TEXTURE2DMS = 406,
ITEXTURE2DMS = 407,
UTEXTURE2DMS = 408,
TEXTURE2DMSARRAY = 409,
ITEXTURE2DMSARRAY = 410,
UTEXTURE2DMSARRAY = 411,
SUBPASSINPUT = 412,
SUBPASSINPUTMS = 413,
ISUBPASSINPUT = 414,
ISUBPASSINPUTMS = 415,
USUBPASSINPUT = 416,
USUBPASSINPUTMS = 417,
IMAGE1D = 418,
IIMAGE1D = 419,
UIMAGE1D = 420,
IMAGE2D = 421,
IIMAGE2D = 422,
UIMAGE2D = 423,
IMAGE3D = 424,
IIMAGE3D = 425,
UIMAGE3D = 426,
IMAGE2DRECT = 427,
IIMAGE2DRECT = 428,
UIMAGE2DRECT = 429,
IMAGECUBE = 430,
IIMAGECUBE = 431,
UIMAGECUBE = 432,
IMAGEBUFFER = 433,
IIMAGEBUFFER = 434,
UIMAGEBUFFER = 435,
IMAGE1DARRAY = 436,
IIMAGE1DARRAY = 437,
UIMAGE1DARRAY = 438,
IMAGE2DARRAY = 439,
IIMAGE2DARRAY = 440,
UIMAGE2DARRAY = 441,
IMAGECUBEARRAY = 442,
IIMAGECUBEARRAY = 443,
UIMAGECUBEARRAY = 444,
IMAGE2DMS = 445,
IIMAGE2DMS = 446,
UIMAGE2DMS = 447,
IMAGE2DMSARRAY = 448,
IIMAGE2DMSARRAY = 449,
UIMAGE2DMSARRAY = 450,
STRUCT = 451,
VOID = 452,
WHILE = 453,
IDENTIFIER = 454,
TYPE_NAME = 455,
FLOATCONSTANT = 456,
DOUBLECONSTANT = 457,
INTCONSTANT = 458,
UINTCONSTANT = 459,
BOOLCONSTANT = 460,
LEFT_OP = 461,
RIGHT_OP = 462,
INC_OP = 463,
DEC_OP = 464,
LE_OP = 465,
GE_OP = 466,
EQ_OP = 467,
NE_OP = 468,
AND_OP = 469,
OR_OP = 470,
XOR_OP = 471,
MUL_ASSIGN = 472,
DIV_ASSIGN = 473,
ADD_ASSIGN = 474,
MOD_ASSIGN = 475,
LEFT_ASSIGN = 476,
RIGHT_ASSIGN = 477,
AND_ASSIGN = 478,
XOR_ASSIGN = 479,
OR_ASSIGN = 480,
SUB_ASSIGN = 481,
LEFT_PAREN = 482,
RIGHT_PAREN = 483,
LEFT_BRACKET = 484,
RIGHT_BRACKET = 485,
LEFT_BRACE = 486,
RIGHT_BRACE = 487,
DOT = 488,
COMMA = 489,
COLON = 490,
EQUAL = 491,
SEMICOLON = 492,
BANG = 493,
DASH = 494,
TILDE = 495,
PLUS = 496,
STAR = 497,
SLASH = 498,
PERCENT = 499,
LEFT_ANGLE = 500,
RIGHT_ANGLE = 501,
VERTICAL_BAR = 502,
CARET = 503,
AMPERSAND = 504,
QUESTION = 505,
INVARIANT = 506,
PRECISE = 507,
HIGH_PRECISION = 508,
MEDIUM_PRECISION = 509,
LOW_PRECISION = 510,
PRECISION = 511,
PACKED = 512,
RESOURCE = 513,
SUPERP = 514
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 66 "glslang/glslang/MachineIndependent/glslang.y" /* yacc.c:1909 */
struct {
glslang::TSourceLoc loc;
union {
glslang::TString *string;
int i;
unsigned int u;
bool b;
double d;
};
glslang::TSymbol* symbol;
} lex;
struct {
glslang::TSourceLoc loc;
glslang::TOperator op;
union {
TIntermNode* intermNode;
glslang::TIntermNodePair nodePair;
glslang::TIntermTyped* intermTypedNode;
};
union {
glslang::TPublicType type;
glslang::TFunction* function;
glslang::TParameter param;
glslang::TTypeLoc typeLine;
glslang::TTypeList* typeList;
glslang::TArraySizes* arraySizes;
glslang::TIdentifierList* identifierList;
};
} interm;
#line 346 "glslang_tab.cpp.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
int yyparse (glslang::TParseContext* pParseContext);
#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */
Vendored Executable
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
bison --defines=glslang_tab.cpp.h -o glslang_tab.cpp -t glslang/glslang/MachineIndependent/glslang.y
+43
View File
@@ -0,0 +1,43 @@
CONTRIBUTING
============
## Submitting changes
Please send a GitHub Pull Request with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)).
## Features
If you have an idea for new features just [open an issue](https://github.com/vurtun/zahnrad/issues) with your suggestion.
* Find and correct spelling mistakes
* Add (insert your favorite platform or render backend here) demo implementation (some possibilities: DirectX 9/DirectX 10/DirectX 11 and win32 with OpenGL)
* Add clipboard user callbacks back into all demos
* Add additional widgets [some possible widgets](http://doc.qt.io/qt-5/widget-classes.html#the-widget-classes)
* Add support for multiple pointers for touch input devices (probably requires to rewrite mouse handling in `struct zr_input`)
* Extend xlib demo to support image drawing with arbitrary image width and height
* Change cursor in `zr_widget_edit_box` and `zr_widget_edit_field` to thin standard cursor version used in editors
* Extend piemenu to support submenus (another ring around the first ring or something like [this:](http://gdj.gdj.netdna-cdn.com/wp-content/uploads/2013/02/ui+concepts+13.gif)) and turn it into a default library widget.
* Add label describing the currently active piemenu entry
* Maybe write a piemenu text only version for platforms that do not want or can use images
* Rewrite the chart API to support a better range of charts (maybe take notes from Javascript chart frameworks)
* Create an API to allow scaling between groups (maybe extend and convert the demo example)
* Add multiple Tab support (maybe use `zr_group` and add a header)
* Come up with a better way to provide and create widget and window styles
* Add tables with scaleable column width
* Extend context to not only support overlapping windows but tiled windows as well
## Bugs
* Seperator widget is currently bugged and does not work as intended
* Text handling is still a little bit janky and probably needs to be further tested and polished
* `zr_edit_buffer` with multiline flag is bugged for '\n', need to differentiate between visible and non-visible characters
## Coding conventions
* Only use C89 (ANSI C)
* Do not use any compiler specific extensions
* For indent use four spaces
* Do not typedef structs, unions and enums
* Variable, object and function names should always be lowercase and use underscores instead of camel case
* Whitespace after for, while, if, do and switch
* Always use parentheses if you use the sizeof operator (e.g: sizeof(struct zr_context) and not sizeof struct zr_context)
* Beginning braces on the new line for functions and on the same line otherwise.
* If function becomes to big either a.) create a subblock inside the function and comment or b.) write a functional function
* Only use fixed size types (zr_uint, zr_size, ...) if you really need to and use basic types otherwise
* Do not include any header files in either zahnrad.h or zahnrad.c
* Do not add dependencies rather write your own version if possible
* Write correct commit messages: (http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
+17
View File
@@ -0,0 +1,17 @@
Copyright (c) 2016 Micha Mettke
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
+89
View File
@@ -0,0 +1,89 @@
# Zahnrad
[![Coverity Status](https://scan.coverity.com/projects/5863/badge.svg)](https://scan.coverity.com/projects/5863)
This is a minimal state immediate mode graphical user interface toolkit
written in ANSI C and licensed under zlib. It was designed as a simple embeddable user interface for
application and does not have any direct dependencies,
a default renderbackend or OS window and input handling but instead provides a very modular
library approach by using simple input state for input and draw
commands describing primitive shapes as output. So instead of providing a
layered library that tries to abstract over a number of platform and
render backends it only focuses on the actual UI.
## Features
- Immediate mode graphical user interface toolkit
- Written in C89 (ANSI C)
- Small codebase (~9kLOC)
- Focus on portability, efficiency and simplicity
- No dependencies (not even the standard library)
- No global or hidden state
- Configurable style and colors
- UTF-8 support
## Optional
- Vertex buffer output
- Font handling
## Building
The library is self-contained within four different files that only have to be
copied and compiled into your application. Files zahnrad.c and zahnrad.h make up
the core of the library, while stb_rect_pack.h and stb_truetype.h are
for a optional font handling implementation and can be removed if not needed.
- zahnrad.c
- zahnrad.h
- stb_rect_pack.h (optional)
- stb_truetype.h (optional)
There are no dependencies or a particular building process required. You just have
to compile the .c file and #include zahnrad.h into your project. To actually
run you have to provide the input state, configuration style and memory
for draw commands to the library. After the GUI was executed all draw commands
have to be either executed or optionally converted into a vertex buffer to
draw the GUI.
## Gallery
![screenshot](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif)
![demo](https://cloud.githubusercontent.com/assets/8057201/11282359/3325e3c6-8eff-11e5-86cb-cf02b0596087.png)
![node](https://cloud.githubusercontent.com/assets/8057201/9976995/e81ac04a-5ef7-11e5-872b-acd54fbeee03.gif)
![transparency](https://cloud.githubusercontent.com/assets/8057201/12779619/2a20d72c-ca69-11e5-95fe-4edecf820d5c.png)
## Example
```c
/* init gui state */
struct zr_context ctx;
zr_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
enum {EASY, HARD};
int op = EASY;
float value = 0.6f;
int i = 20;
struct zr_layout layout;
zr_begin(&ctx, &layout, "Show", zr_rect(50, 50, 220, 220),
ZR_WINDOW_BORDER|ZR_WINDOW_MOVEABLE|ZR_WINDOW_CLOSEABLE);
{
/* fixed widget pixel width */
zr_layout_row_static(&ctx, 30, 80, 1);
if (zr_button_text(&ctx, "button", ZR_BUTTON_DEFAULT)) {
/* event handling */
}
/* fixed widget window ratio width */
zr_layout_row_dynamic(&ctx, 30, 2);
if (zr_option(&ctx, "easy", op == EASY)) op = EASY;
if (zr_option(&ctx, "hard", op == HARD)) op = HARD;
/* custom widget pixel width */
zr_layout_row_begin(&ctx, ZR_STATIC, 30, 2);
{
zr_layout_row_push(&ctx, 50);
zr_label(&ctx, "Volume:", ZR_TEXT_LEFT);
zr_layout_row_push(&ctx, 110);
zr_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
}
zr_layout_row_end(&ctx);
}
zr_end(ctx);
```
![example](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+545
View File
@@ -0,0 +1,545 @@
/* stb_rect_pack.h - v0.05 - public domain - rectangle packing */
/* Sean Barrett 2014 */
/* */
/* Useful for e.g. packing rectangular textures into an atlas. */
/* Does not do rotation. */
/* */
/* Not necessarily the awesomest packing method, but better than */
/* the totally naive one in stb_truetype (which is primarily what */
/* this is meant to replace). */
/* */
/* Has only had a few tests run, may have issues. */
/* */
/* More docs to come. */
/* */
/* No memory allocations; uses qsort() and assert() from stdlib. */
/* */
/* This library currently uses the Skyline Bottom-Left algorithm. */
/* */
/* Please note: better rectangle packers are welcome! Please */
/* implement them to the same API, but with a different init */
/* function. */
/* */
/* Version history: */
/* */
/* 0.05: added STBRP_ASSERT to allow replacing assert */
/* 0.04: fixed minor bug in STBRP_LARGE_RECTS support */
/* 0.01: initial release */
/*//////////////////////////////////////////////////////////////////////////// */
/* */
/* INCLUDE SECTION */
#ifndef STB_INCLUDE_STB_RECT_PACK_H
#define STB_INCLUDE_STB_RECT_PACK_H
#define STB_RECT_PACK_VERSION 1
#ifdef STBRP_STATIC
#define STBRP_DEF static
#else
#define STBRP_DEF extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct stbrp_context stbrp_context;
typedef struct stbrp_node stbrp_node;
typedef struct stbrp_rect stbrp_rect;
#ifdef STBRP_LARGE_RECTS
typedef int stbrp_coord;
#else
typedef unsigned short stbrp_coord;
#endif
STBRP_DEF void stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
/* Assign packed locations to rectangles. The rectangles are of type */
/* 'stbrp_rect' defined below, stored in the array 'rects', and there */
/* are 'num_rects' many of them. */
/* */
/* Rectangles which are successfully packed have the 'was_packed' flag */
/* set to a non-zero value and 'x' and 'y' store the minimum location */
/* on each axis (i.e. bottom-left in cartesian coordinates, top-left */
/* if you imagine y increasing downwards). Rectangles which do not fit */
/* have the 'was_packed' flag set to 0. */
/* */
/* You should not try to access the 'rects' array from another thread */
/* while this function is running, as the function temporarily reorders */
/* the array while it executes. */
/* */
/* To pack into another rectangle, you need to call stbrp_init_target */
/* again. To continue packing into the same rectangle, you can call */
/* this function again. Calling this multiple times with multiple rect */
/* arrays will probably produce worse packing results than calling it */
/* a single time with the full rectangle array, but the option is */
/* available. */
struct stbrp_rect
{
/* reserved for your use: */
int id;
/* input: */
stbrp_coord w, h;
/* output: */
stbrp_coord x, y;
int was_packed; /* non-zero if valid packing */
}; /* 16 bytes, nominally */
STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
/* Initialize a rectangle packer to: */
/* pack a rectangle that is 'width' by 'height' in dimensions */
/* using temporary storage provided by the array 'nodes', which is 'num_nodes' long */
/* */
/* You must call this function every time you start packing into a new target. */
/* */
/* There is no "shutdown" function. The 'nodes' memory must stay valid for */
/* the following stbrp_pack_rects() call (or calls), but can be freed after */
/* the call (or calls) finish. */
/* */
/* Note: to guarantee best results, either: */
/* 1. make sure 'num_nodes' >= 'width' */
/* or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1' */
/* */
/* If you don't do either of the above things, widths will be quantized to multiples */
/* of small integers to guarantee the algorithm doesn't run out of temporary storage. */
/* */
/* If you do #2, then the non-quantized algorithm will be used, but the algorithm */
/* may run out of temporary storage and be unable to pack some rectangles. */
STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
/* Optionally call this function after init but before doing any packing to */
/* change the handling of the out-of-temp-memory scenario, described above. */
/* If you call init again, this will be reset to the default (false). */
STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
/* Optionally select which packing heuristic the library should use. Different */
/* heuristics will produce better/worse results for different data sets. */
/* If you call init again, this will be reset to the default. */
enum
{
STBRP_HEURISTIC_Skyline_default=0,
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
STBRP_HEURISTIC_Skyline_BF_sortHeight
};
/*//////////////////////////////////////////////////////////////////////////// */
/* */
/* the details of the following structures don't matter to you, but they must */
/* be visible so you can handle the memory allocations for them */
struct stbrp_node
{
stbrp_coord x,y;
stbrp_node *next;
};
struct stbrp_context
{
int width;
int height;
int align;
int init_mode;
int heuristic;
int num_nodes;
stbrp_node *active_head;
stbrp_node *free_head;
stbrp_node extra[2]; /* we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' */
};
#ifdef __cplusplus
}
#endif
#endif
/*//////////////////////////////////////////////////////////////////////////// */
/* */
/* IMPLEMENTATION SECTION */
/* */
#ifdef STB_RECT_PACK_IMPLEMENTATION
#include <stdlib.h>
#ifndef STBRP_ASSERT
#include <assert.h>
#define STBRP_ASSERT assert
#endif
enum
{
STBRP__INIT_skyline = 1
};
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
{
switch (context->init_mode) {
case STBRP__INIT_skyline:
STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
context->heuristic = heuristic;
break;
default:
STBRP_ASSERT(0);
}
}
STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
{
if (allow_out_of_mem)
/* if it's ok to run out of memory, then don't bother aligning them; */
/* this gives better packing, but may fail due to OOM (even though */
/* the rectangles easily fit). @TODO a smarter approach would be to only */
/* quantize once we've hit OOM, then we could get rid of this parameter. */
context->align = 1;
else {
/* if it's not ok to run out of memory, then quantize the widths */
/* so that num_nodes is always enough nodes. */
/* */
/* I.e. num_nodes * align >= width */
/* align >= width / num_nodes */
/* align = ceil(width/num_nodes) */
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
}
}
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
{
int i;
#ifndef STBRP_LARGE_RECTS
STBRP_ASSERT(width <= 0xffff && height <= 0xffff);
#endif
for (i=0; i < num_nodes-1; ++i)
nodes[i].next = &nodes[i+1];
nodes[i].next = NULL;
context->init_mode = STBRP__INIT_skyline;
context->heuristic = STBRP_HEURISTIC_Skyline_default;
context->free_head = &nodes[0];
context->active_head = &context->extra[0];
context->width = width;
context->height = height;
context->num_nodes = num_nodes;
stbrp_setup_allow_out_of_mem(context, 0);
/* node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) */
context->extra[0].x = 0;
context->extra[0].y = 0;
context->extra[0].next = &context->extra[1];
context->extra[1].x = (stbrp_coord) width;
#ifdef STBRP_LARGE_RECTS
context->extra[1].y = (1<<30);
#else
context->extra[1].y = 65535;
#endif
context->extra[1].next = NULL;
}
/* find minimum y position if it starts at x1 */
static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
{
stbrp_node *node = first;
int x1 = x0 + width;
int min_y, visited_width, waste_area;
STBRP_ASSERT(first->x <= x0);
(void)c;
#if 0
/* skip in case we're past the node */
while (node->next->x <= x0)
++node;
#else
STBRP_ASSERT(node->next->x > x0); /* we ended up handling this in the caller for efficiency */
#endif
STBRP_ASSERT(node->x <= x0);
min_y = 0;
waste_area = 0;
visited_width = 0;
while (node->x < x1) {
if (node->y > min_y) {
/* raise min_y higher. */
/* we've accounted for all waste up to min_y, */
/* but we'll now add more waste for everything we've visted */
waste_area += visited_width * (node->y - min_y);
min_y = node->y;
/* the first time through, visited_width might be reduced */
if (node->x < x0)
visited_width += node->next->x - x0;
else
visited_width += node->next->x - node->x;
} else {
/* add waste area */
int under_width = node->next->x - node->x;
if (under_width + visited_width > width)
under_width = width - visited_width;
waste_area += under_width * (min_y - node->y);
visited_width += under_width;
}
node = node->next;
}
*pwaste = waste_area;
return min_y;
}
typedef struct
{
int x,y;
stbrp_node **prev_link;
} stbrp__findresult;
static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
{
int best_waste = (1<<30), best_x, best_y = (1 << 30);
stbrp__findresult fr;
stbrp_node **prev, *node, *tail, **best = NULL;
/* align to multiple of c->align */
width = (width + c->align - 1);
width -= width % c->align;
STBRP_ASSERT(width % c->align == 0);
node = c->active_head;
prev = &c->active_head;
while (node->x + width <= c->width) {
int y,waste;
y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { /* actually just want to test BL */
/* bottom left */
if (y < best_y) {
best_y = y;
best = prev;
}
} else {
/* best-fit */
if (y + height <= c->height) {
/* can only use it if it first vertically */
if (y < best_y || (y == best_y && waste < best_waste)) {
best_y = y;
best_waste = waste;
best = prev;
}
}
}
prev = &node->next;
node = node->next;
}
best_x = (best == NULL) ? 0 : (*best)->x;
/* if doing best-fit (BF), we also have to try aligning right edge to each node position */
/* */
/* e.g, if fitting */
/* */
/* ____________________ */
/* |____________________| */
/* */
/* into */
/* */
/* | | */
/* | ____________| */
/* |____________| */
/* */
/* then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned */
/* */
/* This makes BF take about 2x the time */
if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
tail = c->active_head;
node = c->active_head;
prev = &c->active_head;
/* find first node that's admissible */
while (tail->x < width)
tail = tail->next;
while (tail) {
int xpos = tail->x - width;
int y,waste;
STBRP_ASSERT(xpos >= 0);
/* find the left position that matches this */
while (node->next->x <= xpos) {
prev = &node->next;
node = node->next;
}
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
if (y + height < c->height) {
if (y <= best_y) {
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
best_x = xpos;
STBRP_ASSERT(y <= best_y);
best_y = y;
best_waste = waste;
best = prev;
}
}
}
tail = tail->next;
}
}
fr.prev_link = best;
fr.x = best_x;
fr.y = best_y;
return fr;
}
static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
{
/* find best position according to heuristic */
stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
stbrp_node *node, *cur;
/* bail if: */
/* 1. it failed */
/* 2. the best node doesn't fit (we don't always check this) */
/* 3. we're out of memory */
if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
res.prev_link = NULL;
return res;
}
/* on success, create new node */
node = context->free_head;
node->x = (stbrp_coord) res.x;
node->y = (stbrp_coord) (res.y + height);
context->free_head = node->next;
/* insert the new node into the right starting point, and */
/* let 'cur' point to the remaining nodes needing to be */
/* stiched back in */
cur = *res.prev_link;
if (cur->x < res.x) {
/* preserve the existing one, so start testing with the next one */
stbrp_node *next = cur->next;
cur->next = node;
cur = next;
} else {
*res.prev_link = node;
}
/* from here, traverse cur and free the nodes, until we get to one */
/* that shouldn't be freed */
while (cur->next && cur->next->x <= res.x + width) {
stbrp_node *next = cur->next;
/* move the current node to the free list */
cur->next = context->free_head;
context->free_head = cur;
cur = next;
}
/* stitch the list back in */
node->next = cur;
if (cur->x < res.x + width)
cur->x = (stbrp_coord) (res.x + width);
#ifdef _DEBUG
cur = context->active_head;
while (cur->x < context->width) {
STBRP_ASSERT(cur->x < cur->next->x);
cur = cur->next;
}
STBRP_ASSERT(cur->next == NULL);
{
stbrp_node *L1 = NULL, *L2 = NULL;
int count=0;
cur = context->active_head;
while (cur) {
L1 = cur;
cur = cur->next;
++count;
}
cur = context->free_head;
while (cur) {
L2 = cur;
cur = cur->next;
++count;
}
STBRP_ASSERT(count == context->num_nodes+2);
}
#endif
return res;
}
static int rect_height_compare(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
if (p->h > q->h)
return -1;
if (p->h < q->h)
return 1;
return (p->w > q->w) ? -1 : (p->w < q->w);
}
static int rect_width_compare(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
if (p->w > q->w)
return -1;
if (p->w < q->w)
return 1;
return (p->h > q->h) ? -1 : (p->h < q->h);
}
static int rect_original_order(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}
#ifdef STBRP_LARGE_RECTS
#define STBRP__MAXVAL 0xffffffff
#else
#define STBRP__MAXVAL 0xffff
#endif
STBRP_DEF void stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
{
int i;
/* we use the 'was_packed' field internally to allow sorting/unsorting */
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = i;
#ifndef STBRP_LARGE_RECTS
STBRP_ASSERT(rects[i].w <= 0xffff && rects[i].h <= 0xffff);
#endif
}
/* sort according to heuristic */
qsort(rects, (size_t)num_rects, sizeof(rects[0]), rect_height_compare);
for (i=0; i < num_rects; ++i) {
stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
if (fr.prev_link) {
rects[i].x = (stbrp_coord) fr.x;
rects[i].y = (stbrp_coord) fr.y;
} else {
rects[i].x = rects[i].y = STBRP__MAXVAL;
}
}
/* unsort */
qsort(rects, (size_t)num_rects, sizeof(rects[0]), rect_original_order);
/* set was_packed flags */
for (i=0; i < num_rects; ++i)
rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
}
#endif
Loaded 100 of 459 files, more files were not shown because too many files have changed in this diff. Show more