Compare commits

...
819 Commits
Author SHA1 Message Date
twinaphex 6690711ace Fix label for 'Download Content' 2016-05-02 22:17:12 +02:00
twinaphex da72a96041 Implement labels for Input User Binds List 2016-05-02 22:15:25 +02:00
twinaphex 2eb4571290 Move this code to net_compat.c 2016-05-02 19:44:12 +02:00
twinaphex 70d3bce2bf (command.c) Nit 2016-05-02 19:36:02 +02:00
twinaphex dbd56997f4 Changes to getaddrinfo_retro 2016-05-02 19:30:12 +02:00
twinaphex a643952554 netlogger - cleanups 2016-05-02 19:15:04 +02:00
twinaphex 7869072dd9 (netlogger) Cleanups 2016-05-02 19:12:26 +02:00
twinaphex 9c44bbd9ee netlogger - cleanups 2016-05-02 19:09:42 +02:00
twinaphex 44cfa6d876 Cleanup 2016-05-02 19:04:03 +02:00
twinaphex bb45bf9a66 Cleanups 2016-05-02 19:02:32 +02:00
twinaphex b25b2a0e6c Some code de-duplication 2016-05-02 18:54:55 +02:00
twinaphex 00a49d068e Implement TCP protocol for socket_create 2016-05-02 18:47:34 +02:00
twinaphex 317ecabadf (Retropad) Use socket_create 2016-05-02 18:45:05 +02:00
twinaphex 18f8ded154 Flesh out socket_create some more 2016-05-02 18:42:13 +02:00
twinaphex 62508eca77 Create socket_create 2016-05-02 18:37:08 +02:00
twinaphex 0badc3ffd2 Cleanup 2016-05-02 17:48:17 +02:00
twinaphex e0c7bd2e57 (menu_displaylist.c) Cleanups 2016-05-02 17:33:29 +02:00
twinaphex ff5190ac76 menu_displaylist_ctl - cleanups 2016-05-02 17:28:20 +02:00
Twinaphex 54427bd377 (gl_raster_font.c) Avoid another static code analysis warning 2016-05-02 17:10:21 +02:00
Twinaphex 4039bc89d6 (gl_raster_font.c) Cleanups 2016-05-02 17:08:40 +02:00
Twinaphex 0fc31d2616 (menu_cbs.c) More cleanups 2016-05-02 17:02:09 +02:00
Twinaphex eeeec23c66 (OSX) Static code analyzer cleanups 2016-05-02 16:57:53 +02:00
twinaphex c9eac5cdc0 (Frontend / Linux) Create config dir by default 2016-05-02 15:24:06 +02:00
twinaphex 1e47961420 Cleanups 2016-05-02 15:21:30 +02:00
twinaphex da6a301a6e (Frontend) Cleanups 2016-05-02 15:20:20 +02:00
Twinaphex 84f9a4c1d7 (OSX) Path fix 2016-05-02 15:10:20 +02:00
twinaphex ce5d065014 Cast as NSUInteger 2016-05-02 14:54:08 +02:00
twinaphex 53fc458795 (Cocoa) Store idiom type inside unsigned variable 2016-05-02 14:53:23 +02:00
twinaphex 78c13f59d0 (iOS) Build fix 2016-05-02 14:52:26 +02:00
twinaphex 5d31e561a2 Remove 'for further information' line 2016-05-02 14:50:26 +02:00
Twinaphex e15bcabc10 Merge pull request #2936 from gouchi/master
add audio hdmi output
2016-05-02 14:45:34 +02:00
twinaphex da8a9bfeba Standardize config/remaps directories 2016-05-02 14:45:23 +02:00
twinaphex fbe43730b8 (Thumbnails Updater) Fix name string 2016-05-02 14:16:47 +02:00
twinaphex e62c63cc0e Cleanup 2016-05-02 13:53:09 +02:00
twinaphex 6c243ef6fe Cleanups 2016-05-02 13:23:47 +02:00
gouchi 56180af727 add audio hdmi output 2016-05-02 12:11:47 +02:00
radius 6534f71238 building now on linux, untested 2016-05-01 23:07:12 -05:00
radius 74937e4a52 remove itoa dependency and other window specific code 2016-05-01 22:00:54 -05:00
radius 41a731967f remove the winsock2 dependency
I guess it should work on linux now
2016-05-01 21:39:27 -05:00
twinaphex c3e9f64bc2 Rename some settings 2016-05-02 04:24:26 +02:00
twinaphex 7f871d6e9a (PowerPC Mac) Fall back to shader pipeline 1 for OSX PowerPC - too slow otherwise 2016-05-02 04:05:03 +02:00
twinaphex 3be2491232 (Windows 10) Windows 10 should be major number 10 2016-05-02 03:16:46 +02:00
twinaphex 906b94966b Fix default path 2016-05-02 03:07:13 +02:00
twinaphex 8ff81312ad Fix fill_pathname_application_data 2016-05-02 02:48:37 +02:00
twinaphex 96723f3a57 Cleanup 2016-05-02 02:10:45 +02:00
twinaphex 31f3fc0abb Create socket_receive_all_nonblocking 2016-05-02 02:09:22 +02:00
Twinaphex fab90f4b96 (iOS) Avoid warning for unhandled CarPlay enum value 2016-05-02 01:55:02 +02:00
twinaphex fe8a502488 (autosave.c) Cleanups 2016-05-02 01:39:59 +02:00
twinaphex 0bd38a5e1d Remove some obsolete RARCH_CONSOLE ifdefs 2016-05-02 01:35:28 +02:00
twinaphex 2d348f68f9 Cleanup 2016-05-02 01:33:47 +02:00
twinaphex 3dd9a9ff98 Cleanup 2016-05-02 01:26:19 +02:00
twinaphex 72ec71a71c Cleanup 2016-05-02 01:23:42 +02:00
twinaphex 8c28ec0867 (remote.c) Refactor code 2016-05-02 01:13:25 +02:00
twinaphex e00de48e92 Cleanups 2016-05-02 00:21:13 +02:00
twinaphex e29b915536 Cleanups 2016-05-02 00:18:39 +02:00
twinaphex 3adbbc0bde (netlogger.c) Start using net_socket 2016-05-02 00:05:33 +02:00
twinaphex c2d6ecdc86 Include header 2016-05-01 23:52:55 +02:00
Alcaro f11a240190 Clean up the error handlers around here. 2016-05-01 23:50:20 +02:00
twinaphex 2e1fa648b8 Create socket_connect 2016-05-01 23:45:59 +02:00
twinaphex 2b3eeef2fa Avoid warnings 2016-05-01 23:37:49 +02:00
Twinaphex d0708fc832 (Netplay) Buildfixes 2016-05-01 23:21:30 +02:00
twinaphex bd9dd06ddd Get rid of duplicate function net_http_send 2016-05-01 23:17:17 +02:00
twinaphex 3d7b7f6afa init_udp_socket - cleanups 2016-05-01 23:01:41 +02:00
twinaphex b979af0a8c (netplay.c) Reuse it another time 2016-05-01 23:00:54 +02:00
twinaphex f4762f6f33 (netplay.c) Use socket_bind 2016-05-01 22:59:35 +02:00
twinaphex 004d9a613c Create socket_bind 2016-05-01 22:57:44 +02:00
twinaphex 78bb85e2f3 Reuse socket_init for net_http code 2016-05-01 22:45:32 +02:00
twinaphex 8b9456f419 Add socket_type to socket_init 2016-05-01 22:25:23 +02:00
Twinaphex d2a80e26db Buildfixes 2016-05-01 21:38:19 +02:00
twinaphex 0268212d40 Move socket code to net_socket.c 2016-05-01 21:36:28 +02:00
twinaphex a7b856b65f (libretro-common) Create net_socket 2016-05-01 21:18:45 +02:00
twinaphex ad71c56ea4 Create socket_init 2016-05-01 21:05:09 +02:00
twinaphex b7447b1dfc Cleanup 2016-05-01 20:54:30 +02:00
twinaphex f1098d8f6a Style nit 2016-05-01 20:50:26 +02:00
twinaphex 16a6142577 (Menu) Turn on XMB shadows for non-Lakka 2016-05-01 17:47:10 +02:00
twinaphex 07e1f6e748 Only show 'Download Core' so far when no core is yet added 2016-05-01 17:43:37 +02:00
Twinaphex 1b9d9647b0 Add 'Download Core' entry in 'Load Core' list 2016-05-01 17:36:40 +02:00
twinaphex d6443431c6 Ability to press left/right for Thumbnail Updater 2016-05-01 17:30:16 +02:00
twinaphex 73d198ed7f Set default thumbnail setting to 'boxart' 2016-05-01 16:56:15 +02:00
twinaphex d4d2f7fa6b Set default thumbnails setting to 1 2016-05-01 16:49:13 +02:00
Twinaphex 01c59cf0eb Merge pull request #2933 from lakkatv/master
(Lakka) Fix samba and bluetooth service management
2016-05-01 16:43:30 +02:00
Jean-André Santoni bede7cfe2b (Lakka) Fix samba and bluetooth service management 2016-05-01 21:33:31 +07:00
twinaphex f9462ed562 Update autoconfig path 2016-05-01 16:09:46 +02:00
twinaphex f59420094a Simplify dump_to_file_desperate 2016-05-01 16:05:07 +02:00
twinaphex 4372d55325 Change ifdef to ifndef RARCH_CONSOLE 2016-05-01 16:01:03 +02:00
twinaphex 3a23afcaa9 Buildfix for consoles 2016-05-01 15:59:55 +02:00
twinaphex be7da8d626 (menu_setting.c) Add config.h 2016-05-01 15:46:42 +02:00
twinaphex 09f5ccf050 open_default_config_file - cleanup 2016-05-01 15:33:48 +02:00
Twinaphex e135f0b209 (iOS) Add default directory for playlists 2016-05-01 15:30:25 +02:00
Twinaphex 65dfddd910 (OSX) Start using Library/Application Support for config file settings 2016-05-01 15:28:45 +02:00
twinaphex e9f0ff08fe (file_path_special.c) Add config.h 2016-05-01 15:08:31 +02:00
twinaphex 7d99e7cd51 Create fill_pathname_application_data 2016-05-01 15:07:45 +02:00
twinaphex 5032c677e6 (Net) Only comment out printf 2016-05-01 14:44:12 +02:00
twinaphex 8dd4333e16 (net_http) Comment out debug logging 2016-05-01 14:38:23 +02:00
radius 2931ae3d17 add a few more ports 2016-04-30 23:33:32 -05:00
radius a1ac5af8af allow configuration of port & IP 2016-04-30 23:23:56 -05:00
radius 7f004aee71 Complete basic implementation of retropad remote (windows only atm) 2016-04-30 22:49:51 -05:00
radius dd2bb5a17b add basic retropad remote 2016-04-30 22:42:50 -05:00
twinaphex 729b1bf64b (Menu) Rename more xmb_ variables 2016-05-01 04:46:16 +02:00
twinaphex 6d720ff337 (XMB/Shader pipeline) Rename some variables and enable ribbon by default 2016-05-01 04:40:20 +02:00
radius 1a9206ea51 android platform driver refinement 2016-04-30 16:39:29 -05:00
radius 96bc0111c8 revert the default config 2016-04-30 14:34:48 -05:00
radius c0a97eeb60 Modified
android:
- save thumbnails on the sdcard if writable
- save cheats on the sdcard if writable
- save remaps on the sdcard if writable
- save playlists on the sdcard if writable

windows:
- stub out defaults for save/state/system
2016-04-30 14:33:02 -05:00
Andrés 9baba9183c Merge pull request #2930 from lakkatv/master
Keep thumbnails at the root, since they have their own repo, for the …
2016-04-30 21:04:57 +02:00
Jean-André Santoni 0c09050760 Keep thumbnails at the root, since they have their own repo, for the sake of consistency with libretro-fetch 2016-05-01 02:03:17 +07:00
radius ec9aea1189 bump up version 2016-04-30 10:12:28 -05:00
radius cc215061fc fix wallpapers dir 2016-04-30 10:10:22 -05:00
radius 0ef416970c use relative paths whenever possible in the windows platform driver 2016-04-30 10:09:47 -05:00
Twinaphex f9417b9442 Merge pull request #2929 from lakkatv/master
Use autoconfig everywhere instead of autoconf
2016-04-30 16:28:11 +02:00
twinaphex 865e5b78dc (platform_linux.c) Cleanup 2016-04-30 16:12:37 +02:00
twinaphex 9a4eb1b3d1 Add HAVE_MENU ifdef 2016-04-30 16:11:28 +02:00
twinaphex 928767c5f3 (Win32) If built with OpenGL support, default to XMB menu driver 2016-04-30 16:11:17 +02:00
Jean-André Santoni 92985a4405 Use autoconfig everywhere instead of autoconf 2016-04-30 17:11:03 +07:00
Twinaphex aa96995171 Merge pull request #2927 from lakkatv/master
(OSX) Add a default path for the thumbnails dir. May fix #2924
2016-04-30 11:51:17 +02:00
Jean-André Santoni 7b8c108b5f (OSX) Add a default path for the thumbnails dir. May fix #2924 2016-04-30 14:33:57 +07:00
Andrés 6eda5a9e3f Merge pull request #2921 from lakkatv/master
(Lakka) Use a faster mirror for the firmware upgrades
2016-04-29 05:24:08 +02:00
Jean-André Santoni 7128037670 (Lakka) Use a faster mirror for the firmware upgrades 2016-04-29 10:20:39 +07:00
Andrés 874dabd475 Merge pull request #2919 from diablodiab/master
Change ALooper_pollAll in android_input_poll from a non blocking call…
2016-04-29 02:49:05 +02:00
Diablodiab 58c5cc6f46 Change ALooper_pollAll in android_input_poll from a non blocking call into a 1 ms
blocking call. For some reason this allows more input events to queue up in the
input queue for processing making it easier to press multiple gamepad buttons and
have it register within a single frame.
2016-04-29 00:42:09 +02:00
Andrés fd5861d79c Merge pull request #2915 from lakkatv/master
(XMB) Forgot to rename the gradient
2016-04-29 00:40:09 +02:00
Jean-André Santoni b058ca5263 (XMB) Forgot to rename the gradient 2016-04-29 05:38:24 +07:00
Andrés 96de4b3e0e Merge pull request #2914 from lakkatv/master
(XMB) Yet another gradient, for high contrast
2016-04-29 00:09:25 +02:00
Jean-André Santoni 0dc69d4721 (XMB) Yet another gradient, for high contrast 2016-04-29 05:06:32 +07:00
radius e576296131 make it possible to stop retroarch from creating default dirs for users with custom setups 2016-04-28 16:48:58 -05:00
twinaphex 2aad6bf2bb Improve action_switch_thumbnail - if thumbnail mode is 'off', then
pressing 'Y button' will do nothing. If not, you can cycle between
all thumbnail modes (except for Off)
2016-04-28 23:19:32 +02:00
twinaphex 6db13ab51d (udev) cleanup 2016-04-28 22:50:02 +02:00
twinaphex 02ea0a8a80 Use new_path 2016-04-28 21:47:33 +02:00
twinaphex cedb005c93 let's see if this works 2016-04-28 21:46:13 +02:00
Twinaphex 28cc81bfe7 Merge pull request #2913 from lakkatv/master
Copy alsa device list implementation to alsathread
2016-04-28 21:33:26 +02:00
Jean-André Santoni cacc8451a6 Copy alsa device list implementation to alsathread 2016-04-29 02:28:57 +07:00
twinaphex 61d6fb57e6 Buildfixes 2016-04-28 20:55:26 +02:00
twinaphex 48eb86cb47 (Win32) Buildfix 2016-04-28 20:52:30 +02:00
Twinaphex e3dfa361f0 (iOS/OSX) Buildfixes 2016-04-28 20:51:08 +02:00
twinaphex 895783d854 Move some variables 2016-04-28 20:49:13 +02:00
twinaphex 65dec874a8 Move some path settings 2016-04-28 19:52:25 +02:00
Twinaphex 829656391a (OSX) Fix build 2016-04-28 19:29:21 +02:00
twinaphex 11cc280239 (Win32) Buildfix 2016-04-28 19:27:17 +02:00
twinaphex 7dffc6286b Internally change directory settings 2016-04-28 19:26:02 +02:00
Twinaphex bd11c241ec Merge pull request #2911 from lakkatv/master
Update the thumbnails URLs
2016-04-28 17:29:28 +02:00
Jean-André Santoni b497e2ea5a Update the thumbnails URLs 2016-04-28 22:27:32 +07:00
radius 4734234dc5 fix win32 build 2016-04-28 09:00:43 -05:00
twinaphex 05d9e6a47d (Win32) Add default paths 2016-04-28 15:13:52 +02:00
twinaphex 5d449d5024 (libretro-common) net_http - cleanups 2016-04-28 11:58:44 +02:00
twinaphex ba415b6d3a Silence warnings 2016-04-27 23:07:36 +02:00
Twinaphex e69c43f2a8 C89_BUILD fixes 2016-04-27 23:03:49 +02:00
twinaphex f3521e4cc8 Fix CXX_BUILD 2016-04-27 22:54:33 +02:00
twinaphex cf74d1b853 (audio device code) Cleanups 2016-04-27 22:40:02 +02:00
Twinaphex 617b69d81f Merge pull request #2909 from gouchi/master
Adding audio device to menu setting
2016-04-27 22:35:29 +02:00
Twinaphex b0e9266416 Merge pull request #2908 from lakkatv/master
(XMB) Finalize the thumbnail type switching on keypress
2016-04-27 22:34:31 +02:00
gouchi b76c724872 Adding audio device to menu setting 2016-04-27 22:29:58 +02:00
Jean-André Santoni 7150ea5df2 (XMB) Finalize the thumbnail type switching on keypress 2016-04-28 03:26:09 +07:00
Alcaro 68a17c5401 Fix HTTP protocol violation. 2016-04-27 21:04:16 +02:00
twinaphex eb53356522 Add __INTEL_COMPILER ifdef to retro_inline.h 2016-04-27 16:05:24 +02:00
twinaphex 1efff4bdc3 CXX_BUILD fix 2016-04-27 14:52:28 +02:00
Twinaphex 6b6a2b93fa C89_BUILD fix for OSX 2016-04-27 14:43:42 +02:00
Twinaphex 2c221e747e (libretro_common) Include retro_common_api.h - interface_stream.h 2016-04-27 14:37:03 +02:00
twinaphex 3b9c406123 Add rule for OSX/iOS - ssize_t 2016-04-27 14:35:59 +02:00
twinaphex 15a30dae70 CLeanups 2016-04-27 14:29:28 +02:00
twinaphex 0264863520 (menu_displaylist.c) Cleanup 2016-04-27 14:26:45 +02:00
twinaphex 060478184b Cleanups 2016-04-27 14:20:09 +02:00
twinaphex dd4f24ecde Add need_entries_refresh and need_navigation_clear to
menu_displaylist_info strruct
2016-04-27 13:45:13 +02:00
twinaphex a5dc73dfde (menu_displaylist) Cleanup 2016-04-27 13:36:44 +02:00
twinaphex 27b4e72613 Button Y can now switch between Thumbnails modes (Boxart/Screenshots/Title) 2016-04-27 13:19:03 +02:00
twinaphex 4fd2fee2a7 np_is_server/np_is_spectate - cleanups 2016-04-27 11:30:50 +02:00
twinaphex 6cc60a2d02 CXX_BUILD fixes 2016-04-27 11:11:53 +02:00
twinaphex d4a50935d2 C89_BUILD fix 2016-04-27 10:58:38 +02:00
twinaphex b4f4720f51 (Cg) Update Cg simple ribbon courtesy of teepee 2016-04-26 22:11:58 +02:00
twinaphex 3f526ed625 Initialize device list after initializing audio driver 2016-04-26 18:10:52 +02:00
twinaphex d20a2edcb4 Add RARCH_AUDIO_CTL_DEVICES_LIST_NEW/RARCH_AUDIO_CTL_DEVICES_LIST_FREE/RARCH_AUDIO_CTL_DEVICES_LIST_GET 2016-04-26 18:08:25 +02:00
twinaphex f4b40cd108 (Audio) Add device_list_new/device_list_free to audio drivers 2016-04-26 17:55:20 +02:00
twinaphex e93924b0e2 Fix d3d_draw_pipeline 2016-04-26 12:47:00 +02:00
twinaphex aa55c1a7d9 Fix draw_pipeline 2016-04-26 12:46:16 +02:00
twinaphex 7c4df601f8 (Cg) Call gl_cg_set_program_base_attrib for XMB pipeline shaders 2016-04-26 09:16:25 +02:00
Twinaphex af1e9c4157 Merge pull request #2900 from t-paul/uniform-lookup-fix
Add uniform lookup for menu shaders.
2016-04-26 07:50:08 +02:00
Torsten Paul fdd6d26d85 Add uniform lookup for menu shaders.
This fixes the mix-up of parameter assignments for the XMB ribbon shader
which was caused by all 4 uniform locations set to 0.
2016-04-26 00:08:24 +02:00
Twinaphex b2ed32d664 Merge pull request #2899 from lakkatv/master
(XMB) Temporary patch for the messagebox glitch
2016-04-25 19:29:42 +02:00
Jean-André Santoni 2010e57279 (XMB) Complete the previous patch 2016-04-26 00:19:23 +07:00
Jean-André Santoni 90d31a527c (XMB) Temporary patch for the messagebox glitch 2016-04-26 00:09:30 +07:00
twinaphex 76d00b8b66 Fixes regression 2016-04-25 18:00:24 +02:00
twinaphex 2ce247f11a Revert "Revert "(XMB) Thumbnails shadows""
This reverts commit faa717a8ab.
2016-04-25 17:55:18 +02:00
twinaphex faa717a8ab Revert "(XMB) Thumbnails shadows"
This reverts commit ee076f848e.
2016-04-25 17:52:17 +02:00
Twinaphex 5f4687d16c Merge pull request #2898 from lakkatv/master
(XMB) Thumbnails shadows
2016-04-25 17:42:01 +02:00
Jean-André Santoni ee076f848e (XMB) Thumbnails shadows 2016-04-25 22:39:00 +07:00
twinaphex 89d4a5761a Add HAVE_SYSTEMD ifdefs 2016-04-25 15:21:39 +02:00
Twinaphex 936c0bb3b0 Merge pull request #2897 from lakkatv/master
(Lakka) Control systemd services. Touching the files was not enough.
2016-04-25 15:16:30 +02:00
twinaphex e15a385e70 Add HAVE_SYSTEMD check 2016-04-25 15:16:06 +02:00
twinaphex 576415d762 (Nuklear) Rename zr_ to nk_ 2016-04-25 15:01:58 +02:00
twinaphex 748f5dc74b (Nuklear/Zahnrad) Rename to 'nuklear' 2016-04-25 14:58:47 +02:00
twinaphex 68265f6c52 Add 'draw_pipeline to menu/drivers_display 2016-04-25 13:56:12 +02:00
twinaphex 54c0ca4bf5 C89_BUILD fixes 2016-04-25 13:45:53 +02:00
twinaphex a83e6b3405 (Cg) Cleanups 2016-04-25 13:02:05 +02:00
twinaphex 0a3ca14fde (Cg) Rename cg_data to cg 2016-04-25 12:51:01 +02:00
twinaphex 43943fe794 (Cg) Cleanups 2016-04-25 12:33:38 +02:00
twinaphex d4184df592 (Cg) Call gl_cg_reset_attribs before initializing Cg shader backend 2016-04-25 12:22:55 +02:00
twinaphex 01a9185a2d (Cg) Cleanups 2016-04-25 12:07:23 +02:00
twinaphex 9ff8a3c8e2 (Cg) Cleanups 2016-04-25 11:59:46 +02:00
twinaphex 65359297d8 Change 'Off' to 'OFF' 2016-04-25 11:37:34 +02:00
Jean-André Santoni a6acc7b31b (Lakka) Control systemd services. Touching the files was not enough. 2016-04-25 15:49:25 +07:00
twinaphex 242e579b89 (Cg/GLSL) Name some variables the same 2016-04-25 10:15:57 +02:00
twinaphex 78d48c53d2 Rename MENU_DISPLAY_CTL_DRAW_RIBBON to MENU_DISPLAY_CTL_DRAW_PIPELINE 2016-04-24 23:05:24 +02:00
twinaphex 18b0fb1422 (Menu) Cleanups 2016-04-24 22:56:28 +02:00
twinaphex bb43c8115f Rename XMB Ribbon Enable to 'Menu Shader Pipeline' 2016-04-24 22:49:15 +02:00
twinaphex a8485d451a (config.def.h) Set ribbon enable mode to 1 by default for GLES2 2016-04-24 22:16:54 +02:00
twinaphex 8cb66dd021 Add way to switch back and forth between shader pipeline 2016-04-24 22:03:39 +02:00
twinaphex b00202a83d (GLES2) Use XMB ribbon simple shader for GLES2 2016-04-24 20:29:42 +02:00
twinaphex d7b3e9cc8f Add old shader versions of XMB ribbon 2016-04-24 20:25:56 +02:00
Twinaphex 5fbcb50b5e Merge pull request #2896 from lakkatv/master
(Menu) Fix the index download animation bug for all download lists
2016-04-24 12:55:25 +02:00
Jean-André Santoni 20888aee7f (Menu) Fix the index download animation bug for all download lists 2016-04-24 17:30:23 +07:00
Twinaphex 43ce4756a1 Merge pull request #2895 from lakkatv/master
(Menu) Fix the animation bug when downloading index
2016-04-24 09:03:50 +02:00
Twinaphex d28763a89a Merge pull request #2894 from sergiobenrocha2/master
Sane default path for thumbnails [on linux].
2016-04-24 09:03:20 +02:00
radius 1d82b08af0 [nk] update font code 2016-04-24 01:07:51 -05:00
radius aa7ee86da6 [nk] update nuklear 2016-04-24 01:07:50 -05:00
Jean-André Santoni 9a356d85a0 (Menu) Fix the animation bug when downloading index
The menu was forcing a navigation selection clear on OK pressed without letting the menu driver perform it's animations. This patch separate the two events, OK is pressed, the index is downloaded, the menu driver animates the transition to the new list, and finally the navigation selection is cleared. In the right order. DISPLAYLIST_GENERIC should progressively disapear in profit of DISPLAYLIST_PENDING_CLEAR for more flexibility in the menus.
2016-04-24 07:23:07 +07:00
Andrés fbc1134a6e Fix the thumbnail downloader URL 2016-04-23 17:50:47 -05:00
sergiobenrocha2 7db1d2047b Sane default path for thumbnails [on linux]. 2016-04-23 19:20:16 -03:00
Alcaro bbb7871028 Why exactly are we iterating over this string one character per frame? 2016-04-23 22:50:46 +02:00
twinaphex dcd5391a75 (Thumbnails Updater) Added Thumbnails Updater 2016-04-23 22:31:39 +02:00
twinaphex a34ce90940 (d3d_common.cpp) Include d3dx9tex.h instead 2016-04-23 19:09:15 +02:00
twinaphex 6083f850aa (D3D) Buildfix 2016-04-23 19:04:19 +02:00
twinaphex cc7f661f9c (D3D) Buildfixes 2016-04-23 19:02:40 +02:00
Twinaphex 493b6850a5 Use include dir d3d/cg files 2016-04-23 18:19:35 +02:00
twinaphex 33cf9ce023 Add more d3dx9 header files 2016-04-23 18:17:28 +02:00
twinaphex 161b19cb73 Add gfx/include/d3d9 2016-04-23 18:11:22 +02:00
twinaphex d94a0a912c (D3D) Cleanups 2016-04-23 14:17:55 +02:00
twinaphex 7242d8dcf7 Revert "(D3D) Cleanups"
This reverts commit 64559154cf.
2016-04-23 11:34:30 +02:00
twinaphex 64559154cf (D3D) Cleanups 2016-04-23 11:21:38 +02:00
twinaphex 08b7ac500b (libretro-common) Updates 2016-04-23 10:40:46 +02:00
twinaphex 3902a6715a (D3D) Buildfix 2016-04-23 10:22:23 +02:00
twinaphex 38bc378c4d (D3D) Some buildfixes 2016-04-23 10:18:46 +02:00
twinaphex 61a71e91e0 (D3D common) Add C versions of functions 2016-04-23 09:26:38 +02:00
Twinaphex 5a0d656a47 (XMB) Rename noise2 to xmb_noise2 - fixes shader compilation
on OSX
2016-04-23 05:21:40 +02:00
Twinaphex d0153fb024 Merge pull request #2892 from t-paul/fix
Ensure the menu shader is activated.
2016-04-23 05:13:00 +02:00
Torsten Paul 6b049681b6 Ensure the menu shader is activated. 2016-04-23 05:04:50 +02:00
Twinaphex b6a51f006a Merge pull request #2890 from lakkatv/master
(XMB) Ribbon lighting + readability tweaks
2016-04-23 04:11:45 +02:00
Jean-André Santoni 422c6d8984 (XMB) Ribbon lighting + readability tweaks 2016-04-23 05:24:44 +07:00
twinaphex ce077533c2 (GLSL) Increase attrib array size 2016-04-22 15:22:27 +02:00
Twinaphex bfcfb40a7b Merge pull request #2888 from lakkatv/master
(XMB) Make gradient opaque unless libretro is running
2016-04-22 15:11:19 +02:00
Jean-André Santoni be6cdbc3c0 (XMB) Make gradient opaque unless libretro is running 2016-04-22 20:05:56 +07:00
twinaphex 99246ae3e8 (Cg) Cleanup 2016-04-22 14:37:11 +02:00
twinaphex 63f0e998db (Cg) Code deduplication cleanups 2016-04-22 14:05:45 +02:00
twinaphex 4250161327 (GLSL/Cg) Simplify some variables 2016-04-22 14:00:30 +02:00
Twinaphex 012c4006b1 (XMB) Remove unused variable 2016-04-22 13:35:47 +02:00
twinaphex f3f6e6ff70 (Cg) Make cg_attribs bigger - would lead to overflows when sending
XMB ribbon to it
2016-04-22 13:27:50 +02:00
Twinaphex 1e2917a78c Merge pull request #2887 from lakkatv/master
(XMB) Animation polishing
2016-04-22 13:18:18 +02:00
Jean-André Santoni 9cd0d46476 (XMB) Add back the red gradient 2016-04-22 18:16:31 +07:00
Jean-André Santoni 339a0cdef4 (XMB) Increase the delay for xmb_toggle to make the animation more noticeable 2016-04-22 18:11:39 +07:00
Jean-André Santoni 0f6c3564dc (XMB) Use an easing function closer to the one used in PS3 2016-04-22 18:10:20 +07:00
Twinaphex 0f38dc8e3e Merge pull request #2886 from lakkatv/master
(XMB) Code cleaning
2016-04-22 12:56:21 +02:00
Jean-André Santoni f47c020946 (XMB) Code cleaning 2016-04-22 17:43:23 +07:00
Twinaphex 818009e75c Merge pull request #2885 from lakkatv/master
(Menu) Refactoring
2016-04-22 12:31:23 +02:00
Jean-André Santoni c7f8df9327 (Menu) Use MENU_DISPLAY_CTL_LIBRETRO_RUNNING in all menu drivers 2016-04-22 17:25:02 +07:00
Jean-André Santoni a06ebe33e4 (Menu) Remove useless variables 2016-04-22 17:21:52 +07:00
Jean-André Santoni d76cca7a47 (XMB) Use MENU_DISPLAY_CTL_LIBRETRO_RUNNING 2016-04-22 17:14:34 +07:00
Jean-André Santoni dad5215d93 (XMB) Rename variables 2016-04-22 17:11:56 +07:00
Twinaphex 397861ee7e Merge pull request #2884 from lakkatv/master
(XMB) Gradient improvements
2016-04-22 10:23:58 +02:00
Jean-André Santoni f8f8650349 (XMB) More gradients 2016-04-22 15:20:08 +07:00
Jean-André Santoni 171453ac1d (XMB) Use MENU_DISPLAY_CTL_DRAW instead of MENU_DISPLAY_CTL_DRAW_BG in xmb_draw_dark_layer 2016-04-22 14:27:34 +07:00
Jean-André Santoni fe255f103e (XMB) Use a separate function to darken the screen 2016-04-22 14:05:18 +07:00
Jean-André Santoni a4308640a2 (XMB) Gradient switching 2016-04-22 13:47:14 +07:00
twinaphex 9a1fed8598 Don't bake in strlcpy/strlcat for OSX 2016-04-22 08:13:13 +02:00
twinaphex c11f06e584 (MaterialUI) Cleanups 2016-04-22 08:07:03 +02:00
twinaphex d9ddb92a90 (egl_common.c) Silence warning 2016-04-22 07:56:32 +02:00
Jean-André Santoni 989823691e (XMB) Normalize the shadows setting name 2016-04-22 12:46:56 +07:00
Twinaphex 9e686299d2 Merge pull request #2883 from lakkatv/master
(XMB) Ribbon Enable setting
2016-04-22 07:37:47 +02:00
Jean-André Santoni a1e91ff606 (XMB) Ribbon Enable setting 2016-04-22 12:32:32 +07:00
twinaphex b34da03281 Update 2016-04-22 05:31:56 +02:00
twinaphex ac18671ead Update libretro-common 2016-04-22 05:28:49 +02:00
twinaphex 4750e87c76 (GLSM) Add comments 2016-04-21 22:47:48 +02:00
twinaphex 0c0134d4d6 Revert "Cleanups"
This reverts commit d239bee4e8.
2016-04-21 21:24:14 +02:00
twinaphex d0a87a236d Do blending begin/end only once instead of for every item 2016-04-21 10:16:21 +02:00
twinaphex a908cf4101 Do blending begin / end only once for horizontal tabs 2016-04-21 10:14:46 +02:00
twinaphex d239bee4e8 Cleanups 2016-04-21 09:39:36 +02:00
twinaphex 15530a351b (MaterialUI) Cleanups 2016-04-21 09:28:22 +02:00
twinaphex 2c75c45f3b Refactor xmb_draw_icon 2016-04-21 09:18:03 +02:00
twinaphex ba91ae5909 (XMB) Refactor icon code 2016-04-21 09:14:25 +02:00
twinaphex 4f2d1d7c93 Silence warning 'val may be unused uninitialized in this function' 2016-04-21 07:22:26 +02:00
twinaphex 1add138dae (XMB) Cleanups 2016-04-21 07:02:30 +02:00
twinaphex 9ba0cbfac7 Cleanup menu_display_draw_cursor 2016-04-21 05:08:36 +02:00
twinaphex af976d5da3 Cleanup xmb_draw_bg 2016-04-21 05:04:01 +02:00
twinaphex 3ddb5d51b3 Cleanups 2016-04-21 04:54:07 +02:00
twinaphex c9ed624078 Create menu_display_set_alpha 2016-04-21 04:34:02 +02:00
twinaphex 02776fed31 (XMB) Cleanups 2016-04-21 04:17:45 +02:00
twinaphex f2ed54fcf3 (XMB) cleanups 2016-04-21 04:12:24 +02:00
Twinaphex 39305b920c Merge pull request #2881 from lakkatv/master
(XMB) Ribbon alpha improvements
2016-04-20 23:45:03 +02:00
Jean-André Santoni 033ccf4803 (XMB) Remove dont_replace_coords 2016-04-21 03:36:35 +07:00
Jean-André Santoni d22b72a892 (XMB) Ribbon alpha improvements
Honor the xmb alpha setting, and the fade in animation.
2016-04-21 03:21:59 +07:00
Twinaphex ec19f27971 Merge pull request #2880 from lakkatv/master
(XMB) Fix some icons in the quick menu
2016-04-20 21:56:54 +02:00
Jean-André Santoni 01dcf48c5b (XMB) Fix some icons in the quick menu 2016-04-21 02:53:42 +07:00
twinaphex 8de7fa63ae Remove this - seems to be unnecessary 2016-04-20 21:40:30 +02:00
twinaphex cb3a3a7980 Expand ifdef 2016-04-20 21:34:42 +02:00
twinaphex 06c1fb2a5c Add ifdefs around shader code 2016-04-20 21:23:39 +02:00
Twinaphex d1d3bd6e4b Merge pull request #2879 from lakkatv/master
(XMB) Ribbon refactoring
2016-04-20 20:33:25 +02:00
Jean-André Santoni 343824858b (XMB) Disable ribbon 2016-04-21 01:29:37 +07:00
Jean-André Santoni 04370c6597 (XMB) Separate xmb_draw_bg and xmb_draw_ribbon. Fixes the black help layer. 2016-04-21 01:20:52 +07:00
Jean-André Santoni 252414f4d7 (XMB) Move the ribbon display code to menu_display 2016-04-21 01:18:30 +07:00
Twinaphex 5530f7fe63 Merge pull request #2877 from lakkatv/master
(XMB) Temporary fix for the GLSL ribbon on OSX
2016-04-20 19:30:17 +02:00
Jean-André Santoni 0bdf68d0ea (XMB) Temporary fix for the GLSL ribbon on OSX 2016-04-21 00:26:05 +07:00
Twinaphex 6de2827b57 Merge pull request #2876 from lakkatv/master
(Menu) Fix a regression in xmb_draw_text
2016-04-20 18:38:13 +02:00
Jean-André Santoni 29d07d1ba6 (Menu) Fix a regression in xmb_draw_text 2016-04-20 23:25:52 +07:00
twinaphex a912a64514 (XMB) Cleanups 2016-04-20 17:37:31 +02:00
twinaphex a7142680ca (XMB) Cleanup 2016-04-20 17:34:15 +02:00
twinaphex a713325459 (XMB) Clenaups 2016-04-20 08:01:51 +02:00
Twinaphex 6fe8637f6a Merge pull request #2875 from fr500/master
[zr] update to the new toolkit
2016-04-20 07:52:58 +02:00
radius 2443c34ae2 [nk] make it render something again 2016-04-20 00:46:41 -05:00
twinaphex 9af9a1c89e Cleanups 2016-04-20 07:31:26 +02:00
twinaphex d7e6ada920 Rename mui_blit_line 2016-04-20 07:07:14 +02:00
twinaphex a1969de2c3 Create menu_display_draw_text 2016-04-20 06:56:19 +02:00
twinaphex 4325a323e5 Remove duplicate blending 2016-04-19 23:40:36 +02:00
twinaphex a29ac9598a (XMB) Don't need to include glsym anymore 2016-04-19 23:15:17 +02:00
twinaphex 1bbc2f09b5 (courtesy of teepee) Rewrite the ribbon code to use the coordinate
array
2016-04-19 23:00:55 +02:00
twinaphex b479903e3f Simplify Resume Content/ Close Content / Restart Content 2016-04-19 18:31:48 +02:00
twinaphex 30c1cd8de9 Remae Quick Menu options 2016-04-19 18:13:32 +02:00
twinaphex 4a29f71272 (Menu) Cleanups 2016-04-19 17:40:03 +02:00
twinaphex 65bd8194cd Cleanup 2016-04-19 17:37:27 +02:00
twinaphex 3387a0d678 (menu display) Create bind texture functions 2016-04-19 08:53:48 +02:00
twinaphex 17273493ef (Menu) Create viewport function callback 2016-04-19 08:50:35 +02:00
twinaphex cddeabd4ec (Zarch) Cleanup 2016-04-19 08:36:20 +02:00
twinaphex f3d072cdcf Add dont_replace_coords to menu_display_ctx_draw_t 2016-04-19 08:08:40 +02:00
twinaphex 1aa8a950ef Set draw->x/draw->y outside before calling MENU_DISPLAY_CTL_DRAW_BG 2016-04-19 07:58:50 +02:00
twinaphex cbcbd895d2 Create menu_display_draw_cursor - code de-duplication 2016-04-19 07:41:05 +02:00
twinaphex 528eddbed5 Cleanups for cursor code 2016-04-19 07:35:26 +02:00
twinaphex 846bea4074 (XMB) Cleanup 2016-04-19 07:24:37 +02:00
twinaphex 0283a87560 (XMB) Disable XMB ribbon 2016-04-19 07:17:39 +02:00
twinaphex ee639d8b20 (XMB/Zarch) Use same coord array for XMB/Zarch 2016-04-19 07:17:17 +02:00
twinaphex 03de4a0b35 Change argument order of menu_display_push_quad 2016-04-19 07:04:00 +02:00
twinaphex c761b14eb4 Move zarch_zui_push_quad and zarch_zui_snow to menu_display 2016-04-19 06:57:53 +02:00
twinaphex 1d1b868103 Simplify MENU_DISPLAY_CTL_DRAW_GRADIENT 2016-04-19 06:30:10 +02:00
radius 86388cddfe [zr] start moving to the new version 2016-04-18 18:46:33 -05:00
radius ddd8e29d87 [zr] start moving to the new version 2016-04-18 18:00:13 -05:00
radius 47b37e949f [zr] start moving to the new version 2016-04-18 17:59:45 -05:00
radius 8b302c369e [zr] start moving to the new version 2016-04-18 17:59:32 -05:00
aliaspider 7f63016ccb (3DS) osSetSpeedupEnable should always be called. 2016-04-18 19:26:18 +01:00
Twinaphex 9d0047798d Merge pull request #2874 from aliaspider/master
(3DS) gfx driver: improvements / fixes.
2016-04-18 18:10:40 +02:00
aliaspider 0ffba39280 (3DS) restore state correctly when suspending/exiting app. (fixes #2207) 2016-04-18 16:38:32 +01:00
aliaspider 4f54025a50 (3DS) 3D slider display mode selection tweaks. 2016-04-18 15:55:34 +01:00
aliaspider 0f8895bcc3 (3DS) the parallax layer register can be written to from userland with
GSPGPU_WriteHWRegs.
2016-04-18 15:22:41 +01:00
twinaphex 2d69615f1d Add some compatibility defines for XMB ribbon pipeline shader 2016-04-18 03:56:08 +02:00
twinaphex faa3e3557c Exclude SDL for C89_BUILD 2016-04-18 03:23:47 +02:00
twinaphex acf9f7aad1 C89/C90_BUILD fixes 2016-04-18 03:00:23 +02:00
twinaphex c75143a62f CXX_BUILD fixes 2016-04-18 02:56:42 +02:00
twinaphex ab1c26d532 (XMB) Cleanups 2016-04-18 02:27:46 +02:00
twinaphex a8b8ca7a96 Cleanup mui_context_reset_textures 2016-04-18 02:24:37 +02:00
twinaphex 06796bcc14 Refactor xmb_context_reset_textures 2016-04-18 02:20:54 +02:00
twinaphex 8a8a270159 (XMB) Cleanups 2016-04-18 02:10:24 +02:00
twinaphex c7be8edd89 (XMB) Cleanups 2016-04-18 01:53:50 +02:00
twinaphex 38cc90d0e0 (XMB) Refactor ribbon 2016-04-18 01:52:16 +02:00
twinaphex 3264426a96 (XMB) Add coord_array 2016-04-17 23:23:48 +02:00
Twinaphex 25c2acb98d Merge pull request #2873 from lakkatv/master
(XMB) Fix the ribbon with GLES
2016-04-17 21:58:57 +02:00
Jean-André Santoni 8e4934edae (XMB) Fix the ribbon with GLES 2016-04-18 02:50:48 +07:00
Twinaphex 1b111feb9e Merge pull request #2872 from aliaspider/master
(3DS) add more display modes for the top screen that can be controlled by the 3D slider.
2016-04-17 21:16:07 +02:00
aliaspider 4994de806a (3DS) add more display modes for the top screen that can be controlled
by the 3D slider.
2016-04-17 20:10:21 +01:00
twinaphex 34389dbd22 Remove useless glVertexPointer call 2016-04-17 20:42:12 +02:00
twinaphex 2fc465ea83 Disable Ribbon by default 2016-04-17 20:14:12 +02:00
Twinaphex 287fa45e73 Merge pull request #2871 from lakkatv/master
(XMB) Ribbon: use gfx_coords_t, and unhardcode some numbers
2016-04-17 20:11:29 +02:00
Jean-André Santoni 0410d7a59e (XMB) Ribbon: use gfx_coords_t, and unhardcode some numbers 2016-04-18 01:05:27 +07:00
twinaphex 7b3b4de3b9 Ribbon GLSL fragment shader - remove this unused line 2016-04-17 18:25:25 +02:00
twinaphex 09b0a09ca2 Alpha needs to be set to 0.90 for gradient ribbon background,
otherwise fadeout will not work properly when we are at the info
screen
2016-04-17 18:20:41 +02:00
twinaphex ec4f961348 (XMB Cg) Ribbon works with Cg now too 2016-04-17 17:59:40 +02:00
aliaspider 1465cf1ffc (3DS) allow setting a start offset in the texture 2016-04-17 15:30:44 +01:00
twinaphex 05f2153549 Change uniform_info's uniform type to unsigned 2016-04-17 16:07:32 +02:00
aliaspider a609a748db (3DS) move shaders to a subdirectory. 2016-04-17 13:27:55 +01:00
aliaspider 27fc306b19 (3DS) refactor shaders. 2016-04-17 13:23:56 +01:00
Twinaphex 66ba52eab0 CXX_BUILD fixes 2016-04-17 07:49:54 +02:00
Twinaphex c8d97d05e7 (shader_glsl.c) Fix warnings 2016-04-17 07:45:37 +02:00
twinaphex 0f21ab247c header cleanup 2016-04-17 07:37:00 +02:00
twinaphex 97d5a971a4 Change header includes 2016-04-17 07:34:01 +02:00
twinaphex 811a2d1419 Create input_defines.h 2016-04-17 07:32:08 +02:00
twinaphex ef835f93d5 Change function signature for set_coords 2016-04-17 07:12:48 +02:00
twinaphex e48e294009 (XMB Ribbon) Make gradient background transparent when libretro
core is running
2016-04-17 06:56:26 +02:00
twinaphex 71df73e640 (video_shader_driver.h) Cleanup 2016-04-17 06:17:23 +02:00
twinaphex 58f145282e (XMB) Set uniform to vertex program and add 'add_prefix' to uniform_info struct 2016-04-17 06:11:48 +02:00
twinaphex 6579b5f3c8 Add XMB shader compilation to shader_gl_cg.c 2016-04-17 05:52:26 +02:00
twinaphex 30ade96fc0 Add Cg conversions of XMB ribbon/Zahnrad 2016-04-17 05:48:06 +02:00
twinaphex 641a37ce06 Change some function parameters for gl_ff_matrix/gl_ff_vertex 2016-04-17 05:00:42 +02:00
twinaphex 46b2100132 gl_cg_set_mvp - cleanup 2016-04-17 04:55:58 +02:00
twinaphex 07d28091a2 (GLSL) CLeanups 2016-04-17 04:52:13 +02:00
twinaphex 19367da0ae (GLSL) Cleanups 2016-04-17 04:37:38 +02:00
Twinaphex 0f337d49c8 (XMB) Remove unused variable 2016-04-17 04:29:37 +02:00
twinaphex 1515c299f1 Add connect_ps2adapter to Makefile.common 2016-04-17 04:14:52 +02:00
twinaphex 9386fb2fa0 Move D3D9 HLSL font shader to file 2016-04-17 04:13:23 +02:00
Twinaphex b6c12e5b85 Merge pull request #2870 from netux79/master
Added PS2/PSX Controller Adapter for HID driver.
2016-04-17 04:08:26 +02:00
twinaphex e7ab158a3b (Cg) Refactor/cleanups 2016-04-17 03:56:20 +02:00
twinaphex ade309d1f1 (D3D Cg) Cleanups 2016-04-17 03:51:24 +02:00
twinaphex b3220cf53e Move zahnrad shaders to separate files 2016-04-17 02:36:07 +02:00
Ernesto Ramirez c4f2de321a (GX) Added PS2/PSX Controller Adapter for HID driver. 2016-04-16 19:33:17 -05:00
Twinaphex 8616b21e1f Merge pull request #2869 from aliaspider/master
(3DS) change shader format/assembler
2016-04-17 00:18:00 +02:00
twinaphex e9d16655f0 Create d3d_shaders 2016-04-17 00:16:32 +02:00
twinaphex 02e0be55a8 Move GL stock shader to gfx/drivers/gl_shaders 2016-04-17 00:11:52 +02:00
twinaphex f0f60901ff Move all shader files to header files (gfx/drivers/gl_shaders) 2016-04-17 00:08:45 +02:00
twinaphex 8b6abde2f9 Start moving GL shaders to gfx/drivers/gl_shaders 2016-04-16 23:57:37 +02:00
aliaspider ad0d73d8f0 (3DS) refactor shaders. simplify texture combiner usage. 2016-04-16 22:38:13 +01:00
Twinaphex 6144ca0e31 Merge pull request #2868 from libretro/revert-2867-master
Revert "(XMB) Apply  the fade in animation on the ribbon when launching RA or…"
2016-04-16 23:18:33 +02:00
Twinaphex 3a717adbf9 Revert "(XMB) Apply the fade in animation on the ribbon when launching RA or…" 2016-04-16 23:18:25 +02:00
Twinaphex a8032a6c4c Merge pull request #2867 from lakkatv/master
(XMB) Apply  the fade in animation on the ribbon when launching RA or…
2016-04-16 23:01:28 +02:00
Jean-André Santoni 6f4e3079bd (XMB) Apply the fade in animation on the ribbon when launching RA or toggling the menu 2016-04-17 03:46:39 +07:00
Twinaphex e1512cc473 Merge pull request #2866 from lakkatv/master
XMB ribbon improvements
2016-04-16 22:09:29 +02:00
Jean-André Santoni 8317c5849c (XMB) Draw gradient 2016-04-17 03:06:20 +07:00
Jean-André Santoni 1b0381ca02 (XMB) Slower the ribbon 2016-04-17 02:54:00 +07:00
Jean-André Santoni 5bdd9be52b (XMB) Refactor ribbon init 2016-04-17 02:50:17 +07:00
aliaspider c370afd861 (3DS) start porting shaders to the picasso format. 2016-04-16 20:26:05 +01:00
twinaphex a969547e81 Add XMB_RIBBON_ENABLE switch to XMB 2016-04-16 21:09:54 +02:00
twinaphex d8de78231b Add SHADER_CTL_SET_PARAMETER 2016-04-16 21:04:13 +02:00
twinaphex 5d6b4d0a56 (GLSL) Refactor more code 2016-04-16 20:41:52 +02:00
twinaphex 3b5c4d963a (shader_glsl.c) Lessen calls to glGetUniformLocation 2016-04-16 20:39:57 +02:00
twinaphex a99dcaa929 (Cg) Get rid of pragma_cg_params 2016-04-16 20:35:08 +02:00
twinaphex 6d7dab2e66 (Cg) Fix Cg named parameter lookup 2016-04-16 20:32:45 +02:00
twinaphex 0b4ae30f6b Fix erroneous loop variable passing 2016-04-16 20:23:55 +02:00
twinaphex 7f9249830a set_uniform_parameter - implement parameter lookup properly 2016-04-16 20:06:18 +02:00
twinaphex 4e63113f72 Cleanups 2016-04-16 19:50:23 +02:00
twinaphex d562bf38cb Cleanups 2016-04-16 19:44:44 +02:00
twinaphex 0b7ee2fcf7 Change callback prototype 2016-04-16 19:41:48 +02:00
twinaphex 1230edf1ee Add callback for setting single uniform parameter 2016-04-16 19:38:35 +02:00
twinaphex ae218cf1a5 Expand uniform_set_parameter functions 2016-04-16 19:29:45 +02:00
twinaphex ad627701da (XMB) Cleanups 2016-04-16 17:57:51 +02:00
Twinaphex e0cf1ab450 Merge pull request #2865 from aliaspider/master
(3DS) update.
2016-04-16 15:06:33 +02:00
aliaspider 6be66507d6 (3DS) patch services access for xml takeovers. 2016-04-16 12:44:45 +01:00
aliaspider a5e2585fdc (3DS) update svchax. 2016-04-16 12:27:10 +01:00
aliaspider 864f9d7c2c (3DS) make svchax optional. 2016-04-16 12:06:37 +01:00
twinaphex f45d2db0b1 Change function signature of uniform_set_parameter 2016-04-16 07:39:41 +02:00
twinaphex 00c7d918e9 (XMB) Comment out unused variables 2016-04-16 07:33:56 +02:00
Twinaphex ae561de0c8 (Griffin) Buildfixes 2016-04-16 07:32:39 +02:00
Twinaphex 5bba5813cf Cleanups - remove unused variables 2016-04-16 07:27:47 +02:00
twinaphex 87e8c28749 Favoritize GLSL as default shader type when available 2016-04-16 07:24:22 +02:00
twinaphex 92faefbccc (GL) Cleanups - gl_set_shader 2016-04-16 07:19:21 +02:00
twinaphex dfe723c727 gl_shader_init - cleanup 2016-04-16 07:16:32 +02:00
twinaphex 4e041ff3d0 (GL) gl_shader_init - Cleanups 2016-04-16 05:36:09 +02:00
twinaphex 1dfb29ddaf Add video_shader_set_backend 2016-04-16 05:20:41 +02:00
twinaphex 7b88378952 Add params to video_shader_ctx_init 2016-04-16 05:14:39 +02:00
twinaphex 6f0011fd9f xmb_thumbnails_ident - cleanup 2016-04-16 05:07:08 +02:00
twinaphex 1f7e6690e3 compile_program - if 'program' is NULL, then try to set program
to built-in shader program slot
2016-04-16 04:58:03 +02:00
twinaphex 86cb092b02 Add SHADER_CTL_COMPILE_PROGRAM 2016-04-16 04:56:15 +02:00
twinaphex 79ef0268e5 (Cg) Cleanups 2016-04-16 04:34:32 +02:00
twinaphex 1439b38b20 (Cg shader) Cleanups 2016-04-16 04:31:24 +02:00
twinaphex 2479699131 Cleanups 2016-04-16 01:51:46 +02:00
twinaphex 8a90e2777c Rename GL_SHADER_STOCK_BLEND to VIDEO_SHADER_STOCK_BLEND 2016-04-16 01:50:20 +02:00
Twinaphex 7f6ff3ba84 Merge pull request #2863 from aliaspider/master
(3DS) fixes argc/argv related crashes
2016-04-15 23:49:56 +02:00
aliaspider 3913adbe99 nit. 2016-04-15 22:43:31 +01:00
aliaspider 8bd789389f (3DS) better handling of argc/argv, fixes crash in CIA builds. 2016-04-15 22:40:34 +01:00
Twinaphex 6241f52b90 Merge pull request #2862 from lakkatv/master
(XMB) Thumbnails: workaround for titles containing slashes
2016-04-15 21:38:54 +02:00
Jean-André Santoni b5dc5470a4 (XMB) Thumbnails: workaround for titles containing slashes 2016-04-16 02:10:30 +07:00
aliaspider c85e44d597 (3DS) build fix. 2016-04-15 18:46:10 +01:00
twinaphex 6f6330576c (zr_common.c) Cleanups 2016-04-15 07:45:59 +02:00
twinaphex 9d85afd358 Refactor SHADER_CTL_USE 2016-04-15 07:37:06 +02:00
twinaphex 0f65518118 Add set_active to 'use' function callback for shader driver 2016-04-15 05:08:03 +02:00
twinaphex 934681614f Cleanup 2016-04-15 05:01:32 +02:00
twinaphex 5c0f7876b8 Cleanups 2016-04-15 04:48:07 +02:00
twinaphex b3f486ae44 (Menu drivers display) Cleanups 2016-04-15 04:43:48 +02:00
twinaphex d7cbb4472e Cleanups 2016-04-15 04:20:57 +02:00
twinaphex 84eb56892f Cleanups 2016-04-15 04:17:31 +02:00
twinaphex 31c6bba86a Cut down on code duplication - draw_bg callback no longer necessary 2016-04-15 03:35:19 +02:00
twinaphex 0e984f6c95 Cleanups 2016-04-15 03:31:59 +02:00
twinaphex 3cb6117226 (Menu display) Cleanups 2016-04-15 03:24:21 +02:00
twinaphex f4f839f776 Cleanups 2016-04-15 03:14:18 +02:00
Twinaphex 1583f7de97 Merge pull request #2860 from lakkatv/master
Fix arcade LPL generation
2016-04-15 00:57:00 +02:00
Jean-André Santoni 86cf3243aa Fix arcade LPL generation 2016-04-15 05:55:11 +07:00
Twinaphex 14a8ec050d Merge pull request #2859 from lakkatv/master
Arcade scanning
2016-04-15 00:30:54 +02:00
Jean-André Santoni 4f74976cac Arcade scanning 2016-04-15 05:28:44 +07:00
twinaphex 6a39d504e0 Change signature of uniform_set_parameters 2016-04-14 06:24:36 +02:00
twinaphex 7cd10fd707 Start creating stub hlsl_uniform_set_parameter 2016-04-14 03:52:29 +02:00
twinaphex f418c7fde1 Cleanups 2016-04-14 03:41:53 +02:00
twinaphex b9bb75c193 (HLSL) Refactor hlsl_compile_program 2016-04-14 03:38:45 +02:00
twinaphex e61e617e80 (HLSL) Cleanups 2016-04-14 03:20:19 +02:00
twinaphex a2acb0e6f0 Cleanups 2016-04-14 03:16:24 +02:00
twinaphex c6292a38f5 Cleanups 2016-04-14 03:11:13 +02:00
twinaphex 8701af084a (HLSL) Cleanups 2016-04-14 03:09:15 +02:00
twinaphex 5cc1b85f70 (HLSL) Cleanups 2016-04-14 03:06:59 +02:00
twinaphex 930b854272 Refactor compile_programs functions 2016-04-14 01:53:23 +02:00
twinaphex 5f98068e7d Add shader_program_data 2016-04-14 01:33:43 +02:00
twinaphex 90018dbbe0 (Cg) Cleanups 2016-04-14 01:18:27 +02:00
twinaphex 0093e0cbf9 (Cg) Fix state tracker params too 2016-04-14 01:15:16 +02:00
twinaphex 74be1f5906 (Cg) Should fix pragma parameters 2016-04-14 01:12:14 +02:00
Twinaphex 899db8fb37 (libretro-common) Buildfix for OSX 2016-04-13 22:08:23 +02:00
twinaphex 511fbcda93 (Shaders) Refactor shader program compiling code 2016-04-13 20:14:25 +02:00
twinaphex 1e9aed1683 Create struct shader_program_info 2016-04-13 20:06:43 +02:00
twinaphex f28c0475b5 (Shaders) Refactors 2016-04-13 19:58:40 +02:00
twinaphex 29495d4973 (Shaders) Cleanups 2016-04-13 19:27:04 +02:00
twinaphex 7321a9431b Cleanup 2016-04-13 18:24:31 +02:00
twinaphex dfe08c7148 Use menu_entries_prepend 2016-04-13 17:03:13 +02:00
twinaphex b63a3f8fcc (GLSL) CLeanups 2016-04-13 06:52:36 +02:00
twinaphex f2e3789c8e (GLSL) Update 2016-04-13 06:40:59 +02:00
twinaphex 45d4718406 (GLSL) Refactor/cleanup 2016-04-13 06:40:40 +02:00
twinaphex f7c0225e1a (GLSL) More cleanups 2016-04-13 06:30:00 +02:00
twinaphex 015c166b1d (GLSL) Cleanups 2016-04-13 06:25:49 +02:00
twinaphex 9218d57b9d (GLSL) Cleanups 2016-04-13 06:18:53 +02:00
twinaphex 53dad5bc73 (GLSL) Cleanups 2016-04-13 06:04:29 +02:00
twinaphex edcf3fd1ee Cleanups 2016-04-13 05:11:22 +02:00
twinaphex 49e43dd085 (GLSL) Cleanup 2016-04-13 05:06:24 +02:00
twinaphex ea824bdee1 Start implementing glsl_uniform_set_parameter 2016-04-13 04:44:08 +02:00
twinaphex bf39033bc3 Add 'enabled' attribute to uniform_params 2016-04-13 04:21:17 +02:00
twinaphex c3f77efb2c Prepare new GLSL uniform code 2016-04-13 04:16:49 +02:00
twinaphex c5e4c90e88 (Cg) Flesh out uniform switch 2016-04-13 02:54:01 +02:00
twinaphex 960783987d (GLSL) Rename gl_uniforms and glsl_vbo 2016-04-13 02:36:00 +02:00
twinaphex f68d98a6a4 Move uniform info structs to video_shader_driver.h 2016-04-13 02:31:49 +02:00
twinaphex 06ccd36b2f (PS3) Cut down on warnings 2016-04-13 01:49:38 +02:00
twinaphex 928f4e9e65 (Cg) Cleanup 2016-04-13 01:46:29 +02:00
twinaphex df90f233a4 (GL Cg) Refactor uniform param code 2016-04-13 01:42:40 +02:00
twinaphex 1c1cf4535d Remove this too 2016-04-12 22:25:45 +02:00
twinaphex e1a3ceaaee draw_bg operation should not implicitly enable/disable blending -
should be done outside
2016-04-12 22:24:33 +02:00
twinaphex 9976077895 (menu display vulkan) Take out set viewport call 2016-04-12 20:19:13 +02:00
twinaphex 83efd732dd (XMB) Move set viewport call outside 2016-04-12 20:17:50 +02:00
twinaphex 033cecf08c (menu_display) Cleanups 2016-04-12 20:07:23 +02:00
twinaphex 19e86256a7 (menu display GL) Attach white texture to draw info struct if NULL 2016-04-12 19:55:31 +02:00
twinaphex 5f0aa1852e This needs to be properly refactored later 2016-04-12 17:56:34 +02:00
twinaphex c390794452 (XMB) Change types 2016-04-12 16:26:36 +02:00
twinaphex 64f53d8237 (XMB) Refactor blend begin/end 2016-04-12 16:25:13 +02:00
Twinaphex fff07d46b3 Merge pull request #2854 from lakkatv/master
(XMB) White texture that will be used for the ribbon
2016-04-12 04:54:32 +02:00
Jean-André Santoni 0e393211f3 (XMB) White texture that will be used for the ribbon 2016-04-12 09:53:51 +07:00
twinaphex 08632c89b6 Comment this out again now that the test works 2016-04-12 03:19:17 +02:00
twinaphex 8d4d0d16c6 (libretro-common) Update GLSM 2016-04-12 02:22:12 +02:00
Twinaphex 9239c2b349 Merge pull request #2853 from lakkatv/master
(Menu) Move the white texture stuff to menu_display
2016-04-11 23:32:29 +02:00
Jean-André Santoni ea6bd2797c (Menu) Move the white texture stuff to menu_display 2016-04-12 04:30:25 +07:00
twinaphex 3e4d7c404a Should hopefully fix file_list_prepend 2016-04-11 22:35:45 +02:00
Twinaphex 00b398f6d2 Merge pull request #2851 from lakkatv/master
List prepend
2016-04-11 20:50:07 +02:00
Jean-André Santoni 1dea1fa0e2 Rename file_list_push to file_list_prepend 2016-04-12 01:40:48 +07:00
Jean-André Santoni 8e86d11f57 Add list_prepend to the menu ctx drivers 2016-04-11 23:31:49 +07:00
Jean-André Santoni 01c82a09f0 Rename menu_entries_push to menu_entries_prepend 2016-04-11 23:18:16 +07:00
twinaphex a58c77113f Change text 2016-04-11 18:04:24 +02:00
twinaphex a430c7f543 Add experimental menu_entries_push/file_list_push 2016-04-11 18:02:50 +02:00
twinaphex 7e7a1fa5f9 Rename menu_entries_push to menu_entries_add 2016-04-11 05:49:39 +02:00
twinaphex f25581e88d Add print_buf_lines_extended and have core updater use it 2016-04-11 03:09:17 +02:00
twinaphex e555295681 (Shaders) Only show supported shaders 2016-04-10 22:00:50 +02:00
twinaphex 94c042f686 (driver.c) Cleanups 2016-04-10 16:40:36 +02:00
twinaphex 7660b67ad4 (netplay) Cleanups 2016-04-10 16:35:25 +02:00
twinaphex 494ceee05e Update glsm 2016-04-10 16:31:08 +02:00
Twinaphex 2bcc36b387 Remove unused variables 2016-04-10 16:25:24 +02:00
twinaphex 695a93e071 Cleanups 2016-04-10 15:52:06 +02:00
twinaphex 00dce981c8 (runloop.c) Create static functions 2016-04-10 15:40:46 +02:00
twinaphex c015711090 content.c - cleanups 2016-04-10 15:33:04 +02:00
Twinaphex d818578076 Merge pull request #2845 from lakkatv/master
(XMB) Add support for the RetroActive theme
2016-04-09 13:34:26 +02:00
Jean-André Santoni 64e2f9e2f0 (XMB) Subtler drop shadows 2016-04-09 13:23:59 +07:00
Jean-André Santoni 8c02d63f2e (XMB) Add support for the RetroActive theme 2016-04-09 12:46:40 +07:00
twinaphex 6a814229e1 Attempt to fix flip users 2016-04-09 03:16:23 +02:00
Twinaphex 7086277c56 Merge pull request #2843 from lakkatv/master
(XMB) Polish thumbnails settings
2016-04-08 12:53:59 +02:00
Jean-André Santoni 0f8e406a05 (XMB) Polish thumbnails settings 2016-04-08 17:50:20 +07:00
twinaphex 8e2dada12a (libretro-common) message_queue.c - cleanups 2016-04-08 02:59:06 +02:00
twinaphex 8ba1f2fca6 (libretro-common) archive_file_zlib.c - cleanup 2016-04-08 02:54:37 +02:00
twinaphex e88e580832 (libretro-common) archive_file.c - Cleanups 2016-04-08 02:51:17 +02:00
Twinaphex 5218be3a0c Merge pull request #2842 from lakkatv/master
(XMB) Thumbnail type switching
2016-04-07 20:48:19 +02:00
Jean-André Santoni 7dfb3c373a (XMB) Thumbnail type switching 2016-04-08 01:42:53 +07:00
Twinaphex 013e9cd8cb Merge pull request #2841 from lakkatv/master
(XMB) Shadows
2016-04-07 19:32:40 +02:00
Jean-André Santoni 53a1369dba (XMB) Shadows 2016-04-08 00:24:55 +07:00
Twinaphex 01f83ba289 Merge pull request #2840 from lakkatv/master
(XMB) Refactoring, draw_icon can call draw_icon_predone
2016-04-07 18:48:19 +02:00
Jean-André Santoni e96c2b4ef3 (XMB) Refactoring, draw_icon can call draw_icon_predone 2016-04-07 23:43:04 +07:00
twinaphex 175d601a4e Make it possible to initialize memory stream interface in
writable mode
2016-04-07 05:06:41 +02:00
twinaphex 9b4bb51c2e Cleanup filestream_tell 2016-04-07 04:20:09 +02:00
twinaphex 55a28eb8a3 Cleanup filestream_seek 2016-04-07 04:16:46 +02:00
twinaphex 2e66300320 Cleanup filestream_get_fd 2016-04-07 03:35:12 +02:00
twinaphex b20a03f3b9 Add unimplemented message 2016-04-07 03:30:02 +02:00
twinaphex 502c2a41a9 Only define HAVE_BUFFERED_IO if platform is not PS3/PSP or Vita 2016-04-07 03:29:17 +02:00
twinaphex bf017e3a0c Add intfstream_putc 2016-04-07 03:24:41 +02:00
twinaphex 2bb90f3702 Add filestream_putc 2016-04-07 03:23:01 +02:00
twinaphex f0a1b94a11 Update memory_stream.c with FCEUmm update code 2016-04-07 03:07:23 +02:00
twinaphex a8144abbce Add intfstream_tell 2016-04-07 02:44:21 +02:00
twinaphex 0da67ad4f9 Add intfstream_close 2016-04-07 02:30:09 +02:00
twinaphex 99a9769014 Add intfstream_rewind 2016-04-07 02:27:33 +02:00
twinaphex ea037799a4 Add memstream_rewind 2016-04-07 02:24:31 +02:00
twinaphex f51e0f62e5 Add intfstream_seek 2016-04-07 02:21:43 +02:00
twinaphex 67cf1153c6 (streams/memory_stream.c) Cleanup 2016-04-07 02:15:48 +02:00
twinaphex 2a3bba34e0 Add intfstream_gets/intfstream_getc 2016-04-07 02:13:40 +02:00
twinaphex a20a2da85e Add intfstream_read/intfstream_write 2016-04-07 02:06:04 +02:00
twinaphex 554ca4f087 (libretro-common) Add intfstream_open 2016-04-07 01:58:54 +02:00
twinaphex 5eb3bb05f7 Start adding streams/interface_stream.c 2016-04-06 21:58:23 +02:00
twinaphex 7fe34b97a6 (libretro-common) streams - cleanups 2016-04-06 17:03:17 +02:00
twinaphex 734ef07fcc (file_stream.c) Cleanups 2016-04-06 16:55:17 +02:00
twinaphex cce0320bb5 (libretro-common) Cleanups 2016-04-06 16:48:51 +02:00
twinaphex dba04c73e4 Move core options variable 2016-04-06 02:30:20 +02:00
Twinaphex f42911cab7 Remove gloval variable 2016-04-06 01:59:00 +02:00
twinaphex 6e3416b990 Add RARCH_CTL_{USERNAME} 2016-04-06 01:58:11 +02:00
twinaphex c7a9182d59 Create CORE_CTL_{INPUT_DESCRIPTORS} 2016-04-06 01:57:02 +02:00
twinaphex 9a90008543 Frame time needs to be reset back to defaults after we close the
core and its contents - this was causing a crash when jumping
from a core that supports frame time callback (2048) to a core
that doesn't (Mupen64plus)
2016-04-06 01:29:32 +02:00
twinaphex 92dee9b3aa (Android) Refactor argc/argv passed to rarch_main 2016-04-05 23:45:31 +02:00
twinaphex 43860e384a Fixes crash on Close Content on Android.
Bizarre usage of -L argument caused it along with --menu
2016-04-05 23:22:33 +02:00
Twinaphex 20706b51de (iOS) Fix iOS - pass argc/argv 2016-04-05 21:22:23 +02:00
Twinaphex cf9d8a8adb (iOS) rewrite this 2016-04-05 20:58:17 +02:00
twinaphex c536e0fbdc (iOS) argv needs to always be non-NULL 2016-04-05 20:53:02 +02:00
twinaphex 001aa3ba4a Add ssem_get - SDL_SemValue equivalent 2016-04-05 19:08:41 +02:00
twinaphex db24cb1ec5 (libretro-common) Update 2016-04-05 18:52:58 +02:00
twinaphex 78426895db (libretro-common) std=c99 compatibility for rsemaphore.c 2016-04-05 18:42:16 +02:00
twinaphex 26d37e006a (libretro-common) This should allow rthreads.c to compile with -std=c99 2016-04-05 17:52:23 +02:00
twinaphex 15fa7f9cd1 GFX_CTL_CHECK_WINDOW - prevent null pointer dereferences 2016-04-02 20:53:13 +02:00
Twinaphex 90b1db7178 (iOS) Gets past the crash at startup if argv is NULL 2016-04-02 01:05:24 +02:00
twinaphex 490a2f77ae Update libretro-common 2016-03-31 13:27:54 +02:00
Twinaphex ffed6b2dd0 Merge pull request #2826 from Themaister/master
Vulkan: Add proc address query functions to HW interface.
2016-03-29 16:38:44 +02:00
Hans-Kristian Arntzen 38a305bb6e Vulkan: Add proc address query functions to HW interface.
Allows cores to avoid linking directly against any extra library.
Update HW interface version to 2 to signal ABI change.

Note that the interface is still experimental and can change at any time.
2016-03-29 16:35:31 +02:00
Twinaphex 7e7eb233a5 Merge pull request #2825 from Themaister/master
Remove dead code with full_x/full_y.
2016-03-29 15:51:27 +02:00
Hans-Kristian Arntzen 87a5fd2e44 win32_set_style: Fix broken pointer-to-pointer.
This can't possibly have worked in any sensible way before ...
2016-03-29 15:36:08 +02:00
Hans-Kristian Arntzen 1ff4445ba0 Remove dead code with full_x/full_y.
Very confusing and no longer serves any purpose anyways.
2016-03-29 15:28:13 +02:00
Twinaphex 577f210b30 Merge pull request #2823 from Themaister/master
Vulkan: Add explicit render target format support.
2016-03-26 23:54:19 +01:00
Hans-Kristian Arntzen 8c2664e5fb Vulkan: Add explicit render target format support.
Supports all required formats in Vulkan 1.0 as well as GLES 3.x/GL 3.x
(for future).
2016-03-26 23:49:57 +01:00
Hans-Kristian Arntzen 236200ef63 Vulkan: Add format enum for various possible RT formats.
Include all formats which are required to be supported in Vulkan 1.0 and
GLES 3.x. Not all these formats are supported in GLES2, but that's up to
shaders to decide whether they want to support GLES2 or not.
2016-03-26 22:52:32 +01:00
Twinaphex b454192a43 Merge pull request #2822 from libretro/staging
Vulkan: Another stab at cleaning up implicit menu vs. loading content handling
2016-03-26 20:20:11 +01:00
Twinaphex 8572fb622e Merge pull request #2821 from Themaister/master
Vulkan: Use single UBO for all passes and sync indices.
2016-03-26 20:17:34 +01:00
Hans-Kristian Arntzen 82db5a4950 Vulkan: Use single UBO for all passes and sync indices.
Significantly reduces number of allocations.
2016-03-26 19:39:51 +01:00
Twinaphex 786bdacd4c Merge pull request #2820 from Themaister/master
Vulkan: Further work on shader backend.
2016-03-26 18:46:41 +01:00
Hans-Kristian Arntzen 200b88c3ca Vulkan: Add detection for non-causal filter chains. 2016-03-26 18:27:17 +01:00
Hans-Kristian Arntzen b1bd0f7b7f Ignore known pragmas. 2016-03-26 18:07:59 +01:00
Hans-Kristian Arntzen 7d5eb2bc27 Vulkan: Add pass name handling.
Add #pragma name.
2016-03-26 18:00:09 +01:00
Hans-Kristian Arntzen b96d365968 Only set CORE_TYPE_PLAIN for non-directory -L.
Fixes crash on Android startup which uses -L <core-dir> CLI argument.

-L can also set core directory, even though it's not supposed to
be used anymore.

Also, on Android, the cores directory might not be populated, so ignore
arguments which are not valid.
2016-03-25 23:57:11 +01:00
Hans-Kristian Arntzen 21c7ff99d1 Vulkan: Add semantic name remapping.
Will be useful for custom named passes.
2016-03-25 23:15:23 +01:00
Hans-Kristian Arntzen 3838b3c045 Vulkan: Add frame count suport. 2016-03-25 22:06:31 +01:00
Twinaphex 9083ede9b5 Merge pull request #2819 from Themaister/master
Vulkan: Implement universal FBO feedback.
2016-03-25 19:58:43 +01:00
Hans-Kristian Arntzen b7b03c531a Vulkan: Use single VBO in filter chain.
No need to have two separate buffers here.
2016-03-25 19:23:58 +01:00
Hans-Kristian Arntzen 939bc70ac6 Vulkan: Properly resize and clear feedback textures. 2016-03-25 19:16:39 +01:00
Hans-Kristian Arntzen ca62f342b0 Vulkan: Fix original history.
Verified to work now.
2016-03-25 18:50:49 +01:00
Hans-Kristian Arntzen 79f5e9ca98 Vulkan: Add logging about feedback/history. 2016-03-25 17:45:30 +01:00
Hans-Kristian Arntzen 92601a0fb8 Vulkan: Set arrayed semantic textures. 2016-03-25 17:39:24 +01:00
Hans-Kristian Arntzen 80df588cf0 Vulkan: Implement feedback/history. 2016-03-25 15:32:04 +01:00
Hans-Kristian Arntzen e35e0e0f23 Vulkan: Nits. 2016-03-25 14:53:47 +01:00
Hans-Kristian Arntzen 83ab0d799f Vulkan: Begin implementing history and feedback. 2016-03-25 14:51:37 +01:00
Hans-Kristian Arntzen 4f3ade1b95 Vulkan: Begin sketching out support for complete filter chain. 2016-03-25 13:26:36 +01:00
twinaphex d3f0ca76bc Remove source settings 2016-03-24 19:55:33 +01:00
Twinaphex f23b42b437 Merge pull request #2803 from gouchi/master
Fix inconsistency with parameters
2016-03-24 19:37:25 +01:00
twinaphex 1d5955bced (libretro-common) Update comments 2016-03-24 05:57:48 +01:00
radius 80ea008e77 [zr] make the wizard step 3 match the other steps 2016-03-23 23:46:05 -05:00
radius 9b1ada22b9 remove unused variable 2016-03-23 23:38:22 -05:00
radius 8fcfa3659a add gamepad POC panel 2016-03-23 23:32:49 -05:00
twinaphex 6dc267ef1c Turn cheat_manager_new into static function 2016-03-24 04:51:45 +01:00
twinaphex c142b123a1 (autosave) cleanup 2016-03-24 04:48:40 +01:00
twinaphex 84ff9207f9 (autosave) turn some functions static 2016-03-24 04:47:35 +01:00
twinaphex 1b289c0f05 (libretro-common) Update 2016-03-24 04:23:17 +01:00
twinaphex e41127459e Rename 'filestream' functions 2016-03-24 04:09:25 +01:00
twinaphex 89d896339c Don't need to include system.h 2016-03-24 03:47:22 +01:00
twinaphex d04940a159 (input_keyboard.c) Refactor more functions into static functions 2016-03-24 03:45:16 +01:00
twinaphex ce9573e4c3 Create RARCH_INPUT_KEYBOARD_CTL_LINE_FREE 2016-03-24 03:36:38 +01:00
twinaphex 870bce981d (gl.c) Indenting nits 2016-03-24 03:32:00 +01:00
twinaphex 60681195f8 Fix some concurrency bugs 2016-03-24 03:06:03 +01:00
Twinaphex 0ab6350610 Merge pull request #2818 from lakkatv/master
(XMB) Use a PSP-like layout for screen smaller than 640px
2016-03-24 01:48:23 +01:00
Jean-André Santoni 2640748b89 (XMB) Use a PSP-like layout for screen smaller than 640px 2016-03-24 07:23:04 +07:00
Twinaphex 6f424ebc4c Merge pull request #2816 from lakkatv/master
More Lakka services
2016-03-24 00:21:36 +01:00
Jean-André Santoni 61b044b124 Refactoring 2016-03-24 01:20:26 +07:00
twinaphex c20e9fd6bd Start updating audio/test/Makefile 2016-03-23 18:54:17 +01:00
twinaphex a2f50174dd Update audio/test/Makefile 2016-03-23 18:45:44 +01:00
Jean-André Santoni ab09ebe687 Allow passing LAKKA_PROJECT directly to make 2016-03-23 21:47:10 +07:00
Jean-André Santoni adfb0b5a6d (Menu) Unhardcode Lakka Update Dir 2016-03-23 21:40:41 +07:00
Jean-André Santoni cb7ef6615c (Menu) Remove useless code 2016-03-23 20:24:26 +07:00
Jean-André Santoni 17e2458903 Typo 2016-03-23 20:07:13 +07:00
Jean-André Santoni 288c2c3996 (Menu) Lakka Services : Bluetooth 2016-03-23 20:06:53 +07:00
Jean-André Santoni b82976b206 (Menu) Lakka Services, allow enabling or disabling SAMBA 2016-03-23 19:58:01 +07:00
twinaphex 072d6ff125 Rename gfx_coord_array_add to gfx_coord_array_append 2016-03-23 07:01:54 +01:00
twinaphex e1c47a68fe Take prototype declaration out of video_driver.h 2016-03-23 06:57:29 +01:00
twinaphex 69bcac61dd input_hid_driver.h - cleanups 2016-03-23 06:54:37 +01:00
twinaphex 76d06c89ca Make some functions static 2016-03-23 06:53:19 +01:00
twinaphex 8f7f40b86c Move more functionality to input_keyboard_ctl 2016-03-23 06:44:00 +01:00
twinaphex 56c47bbe56 Change input_driver_ctl calls to input_keyboard_ctl 2016-03-23 06:19:33 +01:00
twinaphex 2fee5edba4 Move linefeed enable enums to input_keyboard.c 2016-03-23 06:18:09 +01:00
twinaphex 92d2765157 Create input_keyboard_ctl 2016-03-23 06:11:39 +01:00
twinaphex 0b9595b7e1 Should fix input_keyboard_wait_keys still being active after
we bind a button with the gamepad
2016-03-23 05:49:38 +01:00
twinaphex e13fd6da41 vsnprintf_s needs to have stdio.h included 2016-03-23 03:47:18 +01:00
twinaphex 9e06843127 Typo fix 2016-03-23 03:45:02 +01:00
twinaphex b6941a045d isblank is available since MSVC 2013 2016-03-23 03:44:31 +01:00
twinaphex 5fe9f8dc11 We need the roundf macro for MSVC versions lower than 1800 2016-03-23 03:40:47 +01:00
Twinaphex 57981b2990 Merge pull request #2814 from Themaister/master
Vulkan: Reflection improvements
2016-03-23 00:32:17 +01:00
Hans-Kristian Arntzen 23c8150b6e Reintroduce new parse_input scheme.
This reverts commit 2323cef8d1.
2016-03-23 00:29:52 +01:00
gouchi c1a7419469 Revert text to Libretro library used 2016-03-23 00:28:23 +01:00
Hans-Kristian Arntzen ce34c4bba8 Vulkan: Expose number of components for semantics. 2016-03-23 00:19:24 +01:00
Hans-Kristian Arntzen d5dc50c436 Vulkan: Allow no UBO even if it makes little sense. 2016-03-23 00:19:24 +01:00
Hans-Kristian Arntzen c17755ab1a Vulkan: Default construct slang_reflection instead.
We will use non-POD when dealing with user-defined inputs.
2016-03-23 00:19:24 +01:00
Hans-Kristian Arntzen 2427351afb Vulkan: Log semantic use for debugging. 2016-03-23 00:19:24 +01:00
Hans-Kristian Arntzen 39149b36b2 Vulkan: Clean up semantic parsing a lot.
Split up into two kinds of semantics, textured and not.
2016-03-23 00:19:24 +01:00
twinaphex 2323cef8d1 Revert "Attempt properly handling CLI options ..."
This reverts commit 6f8a1e8ab2.
2016-03-22 21:42:30 +01:00
twinaphex 3e72b89021 (Android) Disable Vulkan until things can start bulding, compiling
and working properly again
2016-03-22 20:33:12 +01:00
Twinaphex a3007b1604 Merge pull request #2810 from lakkatv/master
Lakka Services
2016-03-22 20:08:24 +01:00
Jean-André Santoni 60f9f8329c (Menu) Forgot that 2016-03-23 01:25:27 +07:00
Jean-André Santoni 6b3a8112d1 (Menu) Fixes for Lakka Services 2016-03-23 01:23:51 +07:00
twinaphex 3b377f2e41 (Android) glslang_tab.cpp got moved 2016-03-22 18:39:26 +01:00
twinaphex 6a6caff671 Update this too 2016-03-22 18:37:40 +01:00
twinaphex 439b3e5007 Take out glslang_tab.cpp 2016-03-22 18:36:48 +01:00
twinaphex f8ac103888 (Android) Change APPL_STL back too 2016-03-22 16:40:47 +01:00
twinaphex 77143179b5 Change back Android.mk file 2016-03-22 16:40:02 +01:00
Jean-André Santoni d5816cb298 (Menu) More ifdef for Lakka Services, and create files with w mode. 2016-03-22 17:10:06 +07:00
twinaphex 3e3cc9f2f2 Replace zr_common_file_load again 2016-03-22 05:58:16 +01:00
twinaphex 2e11895ef9 (zahnrad) Add HAVE_OPENGL ifdef 2016-03-22 05:52:46 +01:00
twinaphex 1af81201a0 Go back to this 2016-03-22 05:50:40 +01:00
twinaphex 4cc122648c Header include cleanup 2016-03-22 04:09:46 +01:00
twinaphex 2064681a67 Cleanup 2016-03-22 04:07:05 +01:00
twinaphex 7fa6b946ce Move defines to audio_driver.h 2016-03-22 04:00:18 +01:00
twinaphex bf9add6325 Header cleanups 2016-03-22 03:51:14 +01:00
twinaphex ab1c4d0c4d Header include cleanups 2016-03-22 03:49:05 +01:00
twinaphex cf7687b49c Cleanups 2016-03-22 03:32:00 +01:00
twinaphex 2e14d0979b Header include cleanups 2016-03-22 03:13:33 +01:00
twinaphex 6360b0ef25 (menu_setting.h) Take out libretro.h header include 2016-03-22 03:08:05 +01:00
twinaphex 6f37163675 CXX_BUILD warning fixes 2016-03-22 02:59:13 +01:00
twinaphex 4c14267f5b Create core_type.h 2016-03-22 02:56:06 +01:00
twinaphex 61bae588fb Header include changes 2016-03-22 02:45:25 +01:00
twinaphex 1303a310e8 retroarch.h - don't include retro_miscellaneous.h 2016-03-22 02:33:49 +01:00
twinaphex bb993c3f27 (menu_displaylist.h) Don't include retro_miscellaneous.h 2016-03-22 02:32:02 +01:00
twinaphex fa0ba621d7 Take out menu_setting_find_prehashed 2016-03-22 02:24:00 +01:00
twinaphex 1e3aba3494 (Linux) Buildfix 2016-03-22 01:58:51 +01:00
twinaphex 33b0a189f5 Changed this back - caused multiple warnings 2016-03-22 01:57:58 +01:00
twinaphex 6f5be6b3b3 (zahnrad) Style nits 2016-03-22 01:40:09 +01:00
twinaphex b00878a595 (zr_common.c) Cleanups 2016-03-22 01:20:41 +01:00
twinaphex ddb912b373 Use uintptr_t instead of GLuint 2016-03-22 01:17:00 +01:00
twinaphex e9fd6863ce Rewrite zr_common_file_load to use file_stream.h 2016-03-22 01:16:08 +01:00
twinaphex 79008d4fd6 (Zahnrad) We don't need the VAO 2016-03-22 01:04:00 +01:00
twinaphex c18da3039f zr_common_image_load - go through video_texture_image_load/video_driver_texture_load 2016-03-22 01:00:34 +01:00
Alcaro b4c6831b56 No need to copy that argument.
The copy also lacked the NUL terminator, wouldn't surprise me if it crashed. Let's just clean it up.
2016-03-22 00:01:25 +01:00
Twinaphex 43c8fc50be Merge pull request #2811 from Themaister/master
Various collection of fixes
2016-03-21 23:51:38 +01:00
Jean-André Santoni 24af521bf1 (Menu) Add a first Lakka Service setting: SSH Enable 2016-03-22 05:46:36 +07:00
Hans-Kristian Arntzen 75003b65f1 Revamp Android NDK build system.
Split up into separate modules to avoid the pain with cross-defines from
C and C++.

Move to c++_static STL. It's the recommended way since a while back and
fixes some build issues as well.
2016-03-21 23:43:59 +01:00
Hans-Kristian Arntzen ef79734e7c Use same system as dynamic cores to get system info. 2016-03-21 22:58:13 +01:00
Hans-Kristian Arntzen fdaf6ffead Remove bison file. 2016-03-21 22:58:13 +01:00
Hans-Kristian Arntzen 6bd88e6848 Update glslang. 2016-03-21 22:58:13 +01:00
twinaphex 5eba4984cf (zr_common.c) Refactor 2016-03-21 21:51:24 +01:00
twinaphex 42725179ec Refactor zr_common.c 2016-03-21 21:50:23 +01:00
twinaphex e83d460997 (zr_common) Call menu_display_ctl for blend end 2016-03-21 21:45:06 +01:00
twinaphex f27d2b70f6 (menu_navigation.c) Cleanup 2016-03-21 21:36:49 +01:00
twinaphex 8a7c233e3f (menu_navigation.c) Simplify 2016-03-21 21:34:49 +01:00
Jean-André Santoni 1cb8faf6c9 (Menu) Add a setting group for Lakka Services 2016-03-22 03:31:34 +07:00
twinaphex 7b48a0c57e (XMB) Prevent symbol collission 2016-03-21 21:18:25 +01:00
Twinaphex cf0dd7f5e8 Merge pull request #2809 from lakkatv/master
(XMB) Theme switching
2016-03-21 20:56:53 +01:00
twinaphex 7cc6c477b8 Start using menu_setting_find_prehashed 2016-03-21 20:56:11 +01:00
Jean-André Santoni 66544dcea4 (XMB) Theme switching 2016-03-22 02:54:16 +07:00
twinaphex 552959933d Create menu_setting_find_internal 2016-03-21 20:53:07 +01:00
twinaphex b961a2b2b2 menu_displaylist_info - add hash for label 2016-03-21 20:50:06 +01:00
twinaphex 908e266cc4 Generate hash for setting_bool_setting/setting_int_setting 2016-03-21 20:43:27 +01:00
twinaphex b80b52b806 Rename file_list_push to file_list_append 2016-03-21 20:20:24 +01:00
twinaphex d5a0819aba Nit 2016-03-21 19:53:48 +01:00
twinaphex 3d7bc4f7fe (playlist.c) Style nits 2016-03-21 19:52:33 +01:00
twinaphex 5a37033803 (libretro-common) Update 2016-03-21 19:46:14 +01:00
twinaphex 483699357d (RPNG) cleanups 2016-03-21 19:43:29 +01:00
twinaphex 4d30df7a64 Header cleanup 2016-03-21 19:23:45 +01:00
twinaphex ca63357b54 (X11) Do not keep appending to suspend screensaver if not available 2016-03-21 19:12:16 +01:00
twinaphex b20989d31d (libretro-common) Update headers 2016-03-21 18:51:44 +01:00
twinaphex c8f4d97839 Move config_file_userdata outside libretro-common 2016-03-21 18:49:50 +01:00
twinaphex f960e9ad26 Move files 2016-03-21 18:37:19 +01:00
twinaphex 32a8b57826 Move test files 2016-03-21 18:27:02 +01:00
twinaphex 12e51eb4b5 (libretrodb) Add headers and cleanups 2016-03-21 18:16:05 +01:00
Hans-Kristian Arntzen 6f8a1e8ab2 Attempt properly handling CLI options ... 2016-03-21 17:59:40 +01:00
Twinaphex 0af195c2df Merge pull request #2807 from libretro/revert-2806-master
Revert "Fix "retroarch --verbose"."
2016-03-21 17:21:33 +01:00
Twinaphex 2c8b558dac Revert "Fix "retroarch --verbose"." 2016-03-21 17:21:17 +01:00
Twinaphex 570bd93eed Merge pull request #2806 from Themaister/master
Fix "retroarch --verbose".
2016-03-21 17:19:19 +01:00
Hans-Kristian Arntzen fd443082a7 Fix "retroarch --verbose".
We want to go straight to menu in this case, so make a special case
for this fairly common pattern.
2016-03-21 17:11:39 +01:00
Twinaphex dfeef5b78d Merge pull request #2805 from Themaister/master
Vulkan: Fix lots of dubious barrier usage and add initial SPIR-V shader reflection
2016-03-21 17:05:17 +01:00
Hans-Kristian Arntzen f1a5725f66 Vulkan: Host writes are implicitly flushed on submit.
Use TOP_OF_PIPE/0 access instead to work
around spammy asserts on Anvil.

We still have to invalidate the caches however.
2016-03-21 16:57:04 +01:00
Hans-Kristian Arntzen 6add83e3ec Vulkan: Use reflection output for source/original.
Fix some logging messages in reflection.
2016-03-21 16:18:43 +01:00
Hans-Kristian Arntzen dce96d0869 Vulkan: Find OutputSize semantic uniform as well. 2016-03-21 15:31:01 +01:00
Hans-Kristian Arntzen 1822f3bf90 Vulkan: Begin hooking up SPIR-V reflection. 2016-03-21 15:12:12 +01:00
Twinaphex 3b97ee2c75 Merge pull request #2804 from lakkatv/master
(Lakka) Disable UI settings, and history boolean with HAVE_LAKKA
2016-03-21 13:34:06 +01:00
Jean-André Santoni c2b0f8faea (Lakka) Disable UI settings, and history boolean with HAVE_LAKKA 2016-03-21 18:50:34 +07:00
Hans-Kristian Arntzen 72cdd37ad2 Vulkan: Add #include support to slang shaders. 2016-03-21 12:14:11 +01:00
Hans-Kristian Arntzen 5dcb78ea21 Vulkan: Include spir2cross in shader_vulkan.cpp. 2016-03-21 11:56:09 +01:00
Hans-Kristian Arntzen 7899d449e6 Vulkan: Also invalidate fragment uniform buffer 2016-03-21 11:49:27 +01:00
Hans-Kristian Arntzen 840278796e Vulkan: Refactor out common resources in filter chain. 2016-03-21 11:45:59 +01:00
Hans-Kristian Arntzen 6f01b8dc2c Add spir2cross submodule. 2016-03-21 11:22:31 +01:00
Hans-Kristian Arntzen a21687b5d7 Vulkan: Ensure vertex caches are invalidated. 2016-03-21 10:10:29 +01:00
Hans-Kristian Arntzen fa7eeb57b8 Vulkan: Use 1.0.6.
1.0.2 is pre public release version I think ...
2016-03-21 10:03:15 +01:00
Hans-Kristian Arntzen 84923a0465 Vulkan: Tighten up pipeline barrier usage.
Lots of memory barriers used with TOP_OF_PIPE which is not valid.
2016-03-21 10:02:00 +01:00
Hans-Kristian Arntzen 07524fe433 Vulkan: Log about format use. 2016-03-21 09:29:41 +01:00
twinaphex f9992c5e47 Update libretro-common 2016-03-21 05:44:45 +01:00
twinaphex 1114e3960e Add HAVE_CHEEVOS ifdef 2016-03-21 04:40:49 +01:00
gouchi 0b8afdd5b4 Adding more space 2016-03-21 00:12:56 +01:00
gouchi 05d5e8b7dd Fix inconsistency with parameters 2016-03-20 23:51:07 +01:00
twinaphex 26a858b66c Cleanups 2016-03-20 20:46:34 +01:00
twinaphex 26bcd42698 Cleanup menu_setting_new_internal 2016-03-20 20:45:06 +01:00
twinaphex 4ba6dcd69b (menu_setting.c) Cleanups 2016-03-20 19:56:03 +01:00
twinaphex a1225c570f (menu_setting.c) Cleanups 2016-03-20 19:54:16 +01:00
twinaphex b0434b4811 Cleanup menu_setting_new 2016-03-20 19:29:59 +01:00
twinaphex 6e9e5b6907 Put up with deprecations 2016-03-20 19:14:58 +01:00
twinaphex a8f34c6960 (record_ffmpeg.c) Try to avoid some deprecation warnings 2016-03-20 18:05:14 +01:00
twinaphex bfef3b6191 Get rid of unused file_list_get_entry_index 2016-03-20 17:52:47 +01:00
radius fba912834d bump up version 2016-03-20 11:48:10 -05:00
twinaphex 1164adb902 (gfx/video_coord_array.c) Cleanups 2016-03-20 17:46:53 +01:00
twinaphex f59e334ceb Cleanups 2016-03-20 17:44:13 +01:00
twinaphex 5c0f4f4ac8 Cleanups 2016-03-20 17:41:28 +01:00
twinaphex ac6362cae4 Combine list_special files 2016-03-20 17:28:24 +01:00
twinaphex 972d3faabb (libretro-common) Cleanups 2016-03-20 17:15:40 +01:00
twinaphex f55ee11554 (libretro-common) Header updates 2016-03-20 17:13:31 +01:00
twinaphex 7508eab655 (CXX_BUILD) Avoid some C++ warnings + buildfix 2016-03-20 17:01:15 +01:00
twinaphex 0955fac195 (ffmpeg core) Avoid some deprecation warnings 2016-03-20 16:59:09 +01:00
twinaphex f0fd3895b6 Updates 2016-03-20 16:36:39 +01:00
twinaphex 3720cf87e7 Rename retro_file to file_stream 2016-03-20 16:29:14 +01:00
twinaphex be9bf7dc44 (libretro-common) Move memory_stream 2016-03-20 16:17:44 +01:00
twinaphex c7e13e2bcd (libretro-common) Rename file_archive to archive_file 2016-03-20 16:14:40 +01:00
twinaphex 435aa5ee7c (libretro-common) file_list.c - update function description 2016-03-20 15:59:38 +01:00
twinaphex f7d4cc25e5 (libretro-common) file_list.c 2016-03-20 15:56:33 +01:00
Twinaphex 43b931129d (iOS) Buildfix 2016-03-20 15:07:49 +01:00
twinaphex 93b7dc1bdd (libretro-common) move 'lists' files to lists/ 2016-03-20 14:53:54 +01:00
twinaphex ef4a1a3c0f (libretro-common) Rename fifo_buffer to fifo_queue 2016-03-20 14:06:21 +01:00
twinaphex 87840e5b6c (rbmp) Change typedef enum 2016-03-20 05:35:52 +01:00
twinaphex 70bb4c69f3 CXX_BUILD - silence some warnings 2016-03-20 05:26:16 +01:00
twinaphex 8b4a41155d C89_BUILD buildfixes 2016-03-20 05:24:05 +01:00
twinaphex 6b3c3f326a Cleanups 2016-03-20 05:12:53 +01:00
twinaphex 48347053cd (Griffin) Add compat_snprint for Griffin 2016-03-20 04:52:15 +01:00
twinaphex 1270d8f96a Update libretro-common 2016-03-20 04:50:29 +01:00
twinaphex b40b169098 Copy over libretro-common changes 2016-03-20 04:49:59 +01:00
twinaphex 97981c7a9d Header cleanups 2016-03-20 04:44:29 +01:00
twinaphex c46032c63a Some header cleanups 2016-03-20 04:29:40 +01:00
twinaphex ea7cf9d9ca (file_archive.c) Style nits 2016-03-20 04:21:47 +01:00
twinaphex 84c62cfb2b CONFIG_STRING_OPTIONS - driver changes get applied now 2016-03-20 03:07:51 +01:00
twinaphex 34958ec39a (Vulkan) Don't use VK_API_VERSION any more 2016-03-20 03:04:52 +01:00
twinaphex 41cf1df5a9 Update 2016-03-20 02:53:51 +01:00
twinaphex efb8649027 Add representations for config string options 2016-03-20 02:51:41 +01:00
radius 52b6d73c5a update version script 2016-03-19 13:18:53 -05:00
Twinaphex 1c56e86da4 Merge pull request #2800 from joolswills/config_save
fix config path saving when saving new config - can't use overlapping…
2016-03-19 04:55:46 +01:00
Jools Wills 797e62f604 fix config path saving when saving new config - can't use overlapping buffers in snprintf - fixes #2793 2016-03-19 03:30:04 +00:00
radius 2169f89946 - save osd color so it's copied correctly between per-core configs
- don't save nor load libretro core name
2016-03-18 20:28:49 -05:00
radius 7f5a6cdbf9 use string_is_empty instead 2016-03-18 20:28:48 -05:00
twinaphex 8d06c32d18 Clean this up 2016-03-18 23:32:40 +01:00
twinaphex 1bf76bc1f6 Create MENU_SETTING_CTL_ACTION_RIGHT 2016-03-18 23:31:11 +01:00
twinaphex 033cf569e4 Add MENU_SETTING_CTL_NEW 2016-03-18 22:31:14 +01:00
twinaphex a5cbafe0e5 Add MENU_SETTING_CTL_FREE 2016-03-18 22:27:40 +01:00
twinaphex 71f2fa531c Add MENU_SETTING_CTL_IS_OF_PATH_TYPE 2016-03-18 22:23:51 +01:00
twinaphex 6b01dd86ae Add menu_setting_ctl 2016-03-18 22:16:57 +01:00
twinaphex 9259b141a6 (menu_setting.c) Try to use 'string target' as little as possible 2016-03-18 20:45:25 +01:00
Twinaphex da7430be52 Merge pull request #2798 from DannyGlover/master
Fix compilation issue on iOS
2016-03-18 20:27:37 +01:00
Danny Glover 9102a9d999 Fix compilation issue on iOS
- Compilation failed out of the box due to a missing directory added
to the copy build phase
2016-03-18 18:39:24 +00:00
twinaphex e2fc8900b5 (menu_setting.c) Add source setting 2016-03-18 19:04:49 +01:00
twinaphex 2af2b4eebf (menu_setting.c) Add 'target' pointers 2016-03-18 19:01:42 +01:00
twinaphex 2c7cc41f1b Prevent null pointer dereference 2016-03-18 18:04:21 +01:00
Alcaro f8c31dd56a No point checking this twice. 2016-03-18 17:19:30 +01:00
Alcaro ba90c4afaf Fix some use-after-free holes. 2016-03-18 17:18:45 +01:00
radius 160118ff6c fix android build error 2016-03-17 20:31:33 -05:00
radius 90b7875f21 add banner 2016-03-17 20:29:09 -05:00
radius e02cc9ae5f make xmb default on atv 2016-03-17 20:10:03 -05:00
radius 6df0249d3e make xmb default on atv 2016-03-17 20:08:00 -05:00
radius 9b6e97f967 remove stray OSD message 2016-03-17 19:06:19 -05:00
radius 9fea079af3 update manifest 2016-03-17 19:03:27 -05:00
twinaphex a446f9040b Push these updates 2016-03-18 00:32:57 +01:00
twinaphex 91d14cbb62 Revert "Create RARCH_NETPLAY_CTL_IS_ENABLED, RARCH_NETPLAY_CTL_SET_ENABLE,"
This reverts commit 1a978b0f3c.
2016-03-18 00:32:02 +01:00
466 changed files with 52631 additions and 40758 deletions

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
[submodule "deps/glslang/glslang"]
path = deps/glslang/glslang
url = git://github.com/KhronosGroup/glslang.git
[submodule "deps/spir2cross"]
path = deps/spir2cross
url = git://github.com/ARM-software/spir2cross
+3 -1
View File
@@ -67,7 +67,9 @@ OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS
ifeq ($(CXX_BUILD), 1)
LINK = $(CXX)
CFLAGS := $(CXXFLAGS) -xc++
CFLAGS := $(CXXFLAGS) -xc++
CFLAGS += -DCXX_BUILD
CXXFLAGS += -DCXX_BUILD
else
ifeq ($(findstring Win32,$(OS)),)
LINK = $(CC)
+30 -21
View File
@@ -129,16 +129,17 @@ OBJ += frontend/frontend.o \
tasks/task_file_transfer.o \
content.o \
libretro-common/encodings/encoding_utf.o \
libretro-common/file/file_list.o \
libretro-common/file/dir_list.o \
libretro-common/lists/file_list.o \
libretro-common/lists/dir_list.o \
libretro-common/file/retro_dirent.o \
libretro-common/file/retro_file.o \
libretro-common/streams/file_stream.o \
libretro-common/streams/interface_stream.o \
libretro-common/streams/memory_stream.o \
libretro-common/file/retro_stat.o \
libretro-common/string/string_list.o \
libretro-common/lists/string_list.o \
libretro-common/string/stdstring.o \
libretro-common/memmap/memalign.o \
dir_list_special.o \
string_list_special.o \
list_special.o \
libretro-common/file/nbio/nbio_stdio.o \
libretro-common/file/file_path.o \
file_path_special.o \
@@ -166,14 +167,14 @@ OBJ += frontend/frontend.o \
tasks/task_overlay.o \
input/input_overlay.o \
patch.o \
libretro-common/queues/fifo_buffer.o \
libretro-common/queues/fifo_queue.o \
core_options.o \
libretro-common/compat/compat_fnmatch.o \
libretro-common/compat/compat_posix_string.o \
cheats.o \
core_info.o \
libretro-common/file/config_file.o \
libretro-common/file/config_file_userdata.o \
config_file_userdata.o \
screenshot.o \
libretro-common/gfx/scaler/scaler.o \
gfx/drivers_shader/shader_null.o \
@@ -388,8 +389,8 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
HAVE_MATERIALUI = 1
endif
#ifeq ($(HAVE_ZAHNRAD),)
#HAVE_ZAHNRAD = 1
#ifeq ($(HAVE_NUKLEAR),)
#HAVE_NUKLEAR = 1
#endif
ifeq ($(HAVE_XMB),)
@@ -398,7 +399,7 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
else
HAVE_ZARCH = 0
HAVE_MATERIALUI = 0
#HAVE_ZAHNRAD = 0
#HAVE_NUKLEAR = 0
HAVE_XMB = 0
endif
@@ -410,12 +411,11 @@ 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
ifeq ($(HAVE_NUKLEAR), 1)
OBJ += menu/drivers/nk_common.o
OBJ += menu/drivers/nk_menu.o
OBJ += menu/drivers/nuklear.o
DEFINES += -DHAVE_NUKLEAR
endif
ifeq ($(HAVE_ZARCH), 1)
OBJ += menu/drivers/zarch.o
@@ -429,6 +429,7 @@ endif
ifeq ($(HAVE_LAKKA), 1)
DEFINES += -DHAVE_LAKKA
DEFINES += -DLAKKA_PROJECT=$(LAKKA_PROJECT)
endif
ifeq ($(HAVE_MENU_COMMON), 1)
@@ -597,6 +598,7 @@ endif
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_HID
OBJ += input/connect/joypad_connection.o \
input/connect/connect_ps2adapter.o \
input/connect/connect_ps3.o \
input/connect/connect_ps4.o \
input/connect/connect_wii.o \
@@ -750,25 +752,31 @@ ifeq ($(HAVE_VULKAN), 1)
$(wildcard deps/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \
$(wildcard deps/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp)
SPIR2CROSS_SOURCES := deps/spir2cross/spir2cross.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
-Ideps/glslang \
-Ideps/spir2cross
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)
SPIR2CROSS_OBJ := $(SPIR2CROSS_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)
gfx/drivers_shader/slang_reflection.o \
$(GLSLANG_OBJ) \
$(SPIR2CROSS_OBJ)
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_vulkan.o
endif
@@ -874,8 +882,8 @@ endif
ifeq ($(HAVE_ZLIB), 1)
OBJ += libretro-common/file/file_archive.o \
libretro-common/file/file_archive_zlib.o \
OBJ += libretro-common/file/archive_file.o \
libretro-common/file/archive_file_zlib.o \
tasks/task_decompress.o
OBJ += $(ZLIB_OBJS)
DEFINES += -DHAVE_ZLIB
@@ -944,6 +952,7 @@ ifeq ($(HAVE_NETWORKING), 1)
DEFINES += -DHAVE_NETWORKING
OBJ += libretro-common/net/net_compat.o \
libretro-common/net/net_http.o \
libretro-common/net/net_socket.o \
net_http_special.o \
tasks/task_http.o
+41 -34
View File
@@ -21,20 +21,32 @@ APP_RSF = ctr/tools/template.rsf
APP_SYSTEM_MODE = 64MB
APP_SYSTEM_MODE_EXT = 124MB
APP_BIG_TEXT_SECTION = 0
APP_USE_SVCHAX = 0
include ctr/Makefile.cores
OBJS :=
OBJS += gfx/drivers/ctr_sprite.o
OBJS += gfx/drivers/ctr_shaders/ctr_sprite.o
OBJS += ctr/ctr_system.o
OBJS += ctr/ctr_memory.o
OBJS += ctr/ctr_linear.o
OBJS += ctr/ctr_svchax.o
ifeq ($(APP_BIG_TEXT_SECTION), 1)
APP_USE_SVCHAX = 1
LDFLAGS += -Wl,--defsym,__ctr_patch_services=__service_ptr
endif
ifeq ($(APP_USE_SVCHAX), 1)
OBJS += ctr/ctr_svchax.o
endif
ifeq ($(GRIFFIN_BUILD), 1)
OBJS += griffin/griffin.o
else
OBJS += libretro-common/file/file_extract.o
CFLAGS += -DHAVE_COMPRESSION
OBJS += libretro-common/file/archive_file.o
OBJS += libretro-common/file/archive_file_zlib.o
OBJS += libretro-common/encodings/encoding_utf.o
OBJS += verbosity.o
OBJS += performance.o
OBJS += libretro-common/compat/compat_getopt.o
@@ -43,13 +55,13 @@ else
OBJS += libretro-common/compat/compat_fnmatch.o
OBJS += libretro-common/memmap/memalign.o
OBJS += libretro-common/file/config_file.o
OBJS += libretro-common/file/config_file_userdata.o
OBJS += config_file_userdata.o
OBJS += core_options.o
OBJS += cheats.o
OBJS += libretro-common/hash/rhash.o
OBJS += gfx/video_context_driver.o
OBJS += gfx/drivers_context/gfx_null_ctx.o
OBJS += gfx/image/image.o
OBJS += gfx/video_texture_image.o
OBJS += libretro-common/formats/tga/rtga.o
OBJS += libretro-common/formats/png/rpng.o
OBJS += libretro-common/formats/png/rpng_encode.o
@@ -75,10 +87,11 @@ else
OBJS += input/drivers_joypad/hid_joypad.o
OBJS += input/drivers_hid/null_hid.o
OBJS += gfx/video_state_tracker.o
OBJS += libretro-common/queues/fifo_buffer.o
OBJS += libretro-common/queues/fifo_queue.o
OBJS += audio/audio_resampler_driver.o
OBJS += audio/drivers_resampler/sinc.o
OBJS += audio/drivers_resampler/nearest.o
OBJS += audio/drivers_resampler/sinc_resampler.o
OBJS += audio/drivers_resampler/nearest_resampler.o
OBJS += audio/drivers_resampler/null_resampler.o
OBJS += audio/drivers_resampler/cc_resampler.o
OBJS += camera/drivers/nullcamera.o
OBJS += location/drivers/nulllocation.o
@@ -86,7 +99,7 @@ else
OBJS += audio/drivers/ctr_dsp_audio.o
OBJS += audio/drivers/nullaudio.o
OBJS += gfx/video_driver.o
OBJS += gfx/video_common.o
OBJS += gfx/video_coord_array.o
OBJS += input/input_driver.o
OBJS += audio/audio_driver.o
OBJS += camera/camera_driver.o
@@ -122,17 +135,15 @@ else
OBJS += content.o
OBJS += libretro-common/file/file_path.o
OBJS += file_path_special.o
OBJS += libretro-common/file/dir_list.o
OBJS += libretro-common/lists/dir_list.o
OBJS += libretro-common/file/retro_dirent.o
OBJS += libretro-common/file/retro_file.o
OBJS += libretro-common/streams/file_stream.o
OBJS += libretro-common/file/retro_stat.o
OBJS += dir_list_special.o
OBJS += string_list_special.o
OBJS += libretro-common/string/string_list.o
OBJS += list_special.o
OBJS += libretro-common/lists/string_list.o
OBJS += libretro-common/string/stdstring.o
OBJS += file_ops.o
OBJS += libretro-common/file/nbio/nbio_stdio.o
OBJS += libretro-common/file/file_list.o
OBJS += libretro-common/lists/file_list.o
OBJS += libretro-common/queues/message_queue.o
OBJS += patch.o
OBJS += configuration.o
@@ -147,7 +158,8 @@ else
OBJS += libretro_version_1.o
OBJS += retroarch.o
OBJS += runloop.o
OBJS += tasks/tasks.o
OBJS += libretro-common/queues/task_queue.o
OBJS += tasks/tasks_internal.o
OBJS += msg_hash.o
OBJS += intl/msg_hash_de.o
OBJS += intl/msg_hash_es.o
@@ -161,8 +173,9 @@ else
OBJS += movie.o
OBJS += record/record_driver.o
OBJS += record/drivers/record_null.o
OBJS += tasks/task_decompress.o
OBJS += tasks/task_content.o
OBJS += tasks/task_file_transfer.o
OBJS += tasks/task_decompress.o
OBJS += screenshot.o
OBJS += playlist.o
OBJS += menu/menu_driver.o
@@ -172,6 +185,7 @@ else
OBJS += menu/menu_entries.o
OBJS += menu/menu_setting.o
OBJS += menu/menu_cbs.o
OBJS += menu/menu_content.o
OBJS += menu/cbs/menu_cbs_ok.o
OBJS += menu/cbs/menu_cbs_cancel.o
OBJS += menu/cbs/menu_cbs_select.o
@@ -220,8 +234,6 @@ else
OBJS += deps/zlib/trees.o
OBJS += deps/zlib/uncompr.o
OBJS += deps/zlib/zutil.o
OBJS += deps/zlib/ioapi.o
OBJS += deps/zlib/unzip.o
OBJS += audio/audio_utils.o
endif
@@ -285,7 +297,7 @@ CFLAGS += -DHAVE_ZLIB -DHAVE_RPNG -DWANT_ZLIB -DHAVE_BUILTIN_AUTOCONFIG
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH) -O3
LDFLAGS = -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
CFLAGS += -std=gnu99 -ffast-math
@@ -313,11 +325,6 @@ $(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA)
$(TARGET).3dsx: $(TARGET).elf
$(TARGET).elf: $(OBJS) libretro_ctr.a
ctr_sprite_shader_shbin.h: gfx/drivers/ctr_sprite.o
gfx/drivers/ctr_gfx.c: ctr_sprite_shader_shbin.h
griffin/griffin.o: gfx/drivers/ctr_gfx.c
PREFIX := $(DEVKITARM)/bin/arm-none-eabi-
CC := $(PREFIX)gcc
@@ -340,14 +347,15 @@ else
BANNERTOOL = ctr/tools/bannertool.exe
endif
%.o: %.shader
python $(AEMSTRO)/aemstro_as.py $< $(notdir $<).shbin
$(DEVKITARM)/bin/bin2s $(notdir $<).shbin | $(PREFIX)as -o $@
echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo $(notdir $<).shbin | tr . _)`.h
echo "extern const u8" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo $(notdir $<).shbin | tr . _)`.h
echo "extern const u32" `(echo $(notdir $<).shbin | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo $(notdir $<).shbin | tr . _)`.h
rm $(notdir $<).shbin
%.o: %.vsh %.gsh
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
rm $*.shbin
%.o: %.vsh
$(DEVKITARM)/bin/picasso $^ -o $*.shbin
$(DEVKITARM)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
rm $*.shbin
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
@@ -403,7 +411,6 @@ clean:
rm -f $(TARGET).smdh
rm -f $(TARGET).bnr
rm -f $(TARGET).icn
rm -f *_shader_shbin.h
rm -f ctr/ctr_config_*.o
rm -f ctr/3dsx_custom_crt0.o
+6 -4
View File
@@ -24,20 +24,22 @@ PPU_SRCS = frontend/frontend_salamander.c \
frontend/drivers/platform_ps3.c \
frontend/drivers/platform_null.c \
libretro-common/file/file_path.c \
libretro-common/file/dir_list.c \
libretro-common/lists/dir_list.c \
libretro-common/lists/string_list.c \
libretro-common/file/retro_dirent.c \
libretro-common/file/retro_stat.c \
libretro-common/hash/rhash.c \
libretro-common/string/stdstring.c \
libretro-common/string/string_list.c \
libretro-common/compat/compat_strl.c \
libretro-common/file/retro_file.c \
libretro-common/streams/file_stream.c \
libretro-common/file/config_file.c \
verbosity.c
ifeq ($(HAVE_LOGGER), 1)
PPU_CFLAGS += -DHAVE_LOGGER
PPU_SRCS += netlogger.c
PPU_SRCS += netlogger.c \
libretro-common/net/net_compat.c \
libretro-common/net/net_socket.c
endif
PPU_TARGET = retroarch-salamander_ps3.elf
+3 -3
View File
@@ -37,12 +37,12 @@ OBJS = frontend/frontend_salamander.o \
frontend/drivers/platform_null.o \
libretro-common/file/file_path.o \
libretro-common/string/stdstring.o \
libretro-common/string/string_list.o \
libretro-common/file/dir_list.o \
libretro-common/lists/string_list.o \
libretro-common/lists/dir_list.o \
libretro-common/file/retro_dirent.o \
libretro-common/compat/compat_strl.o \
libretro-common/file/config_file.o \
libretro-common/file/retro_file.o \
libretro-common/streams/file_stream.o \
libretro-common/file/retro_stat.o \
libretro-common/hash/rhash.o \
verbosity.o \
+6 -4
View File
@@ -47,9 +47,9 @@ OBJ = frontend/frontend_salamander.o \
libretro-common/file/file_path.o \
libretro-common/hash/rhash.o \
libretro-common/string/stdstring.o \
libretro-common/string/string_list.o \
libretro-common/file/dir_list.o \
libretro-common/file/retro_file.o \
libretro-common/lists/string_list.o \
libretro-common/lists/dir_list.o \
libretro-common/streams/file_stream.o \
libretro-common/file/retro_dirent.o \
libretro-common/file/retro_stat.o \
libretro-common/compat/compat_strl.o \
@@ -60,7 +60,9 @@ OBJ = frontend/frontend_salamander.o \
ifeq ($(HAVE_LOGGER), 1)
CFLAGS += -DHAVE_LOGGER
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
OBJ += logger/netlogger.o
OBJ += logger/netlogger.o \
libretro-common/net/net_compat.o \
libretro-common/net/net_socket.o
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
+36 -7
View File
@@ -18,6 +18,8 @@
#include <retro_assert.h>
#include <lists/string_list.h>
#include "audio_driver.h"
#include "audio_resampler_driver.h"
#include "../record/record_driver.h"
@@ -26,14 +28,11 @@
#include "../command_event.h"
#include "../configuration.h"
#include "../general.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../performance.h"
#include "../verbosity.h"
#include "../string_list_special.h"
#ifdef HAVE_NETPLAY
#include "../netplay/netplay.h"
#endif
#include "../list_special.h"
#ifndef AUDIO_BUFFER_FREE_SAMPLES_COUNT
#define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024)
@@ -780,6 +779,7 @@ static bool find_audio_driver(void)
bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
{
static struct retro_audio_callback audio_callback;
static struct string_list *audio_driver_devices_list = NULL;
static struct retro_perf_counter resampler_proc = {0};
static const rarch_resampler_t *audio_driver_resampler = NULL;
static void *audio_driver_resampler_data = NULL;
@@ -793,6 +793,31 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
rarch_resampler_freep(&audio_driver_resampler,
&audio_driver_resampler_data);
break;
case RARCH_AUDIO_CTL_DEVICES_LIST_FREE:
if (!current_audio || !current_audio->device_list_free
|| !audio_driver_context_audio_data)
return false;
current_audio->device_list_free(audio_driver_context_audio_data,
audio_driver_devices_list);
audio_driver_devices_list = NULL;
break;
case RARCH_AUDIO_CTL_DEVICES_LIST_NEW:
if (!current_audio || !current_audio->device_list_new
|| !audio_driver_context_audio_data)
return false;
audio_driver_devices_list = (struct string_list*)
current_audio->device_list_new(audio_driver_context_audio_data);
if (!audio_driver_devices_list)
return false;
break;
case RARCH_AUDIO_CTL_DEVICES_LIST_GET:
{
struct string_list**ptr = (struct string_list**)data;
if (!ptr)
return false;
*ptr = audio_driver_devices_list;
}
break;
case RARCH_AUDIO_CTL_RESAMPLER_INIT:
return rarch_resampler_realloc(
&audio_driver_resampler_data,
@@ -818,6 +843,7 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
audio_driver_context_audio_data = NULL;
break;
case RARCH_AUDIO_CTL_DEINIT:
audio_driver_ctl(RARCH_AUDIO_CTL_DEVICES_LIST_FREE, NULL);
if (!uninit_audio())
return false;
break;
@@ -854,12 +880,15 @@ bool audio_driver_ctl(enum rarch_audio_ctl_state state, void *data)
{
const struct retro_audio_callback *cb =
(const struct retro_audio_callback*)data;
#ifdef HAVE_NETPLAY
global_t *global = global_get_ptr();
#endif
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))
if (global->netplay.enable)
return false;
#endif
if (cb)
+17 -1
View File
@@ -27,6 +27,13 @@
extern "C" {
#endif
#define AUDIO_CHUNK_SIZE_BLOCKING 512
/* So we don't get complete line-noise when fast-forwarding audio. */
#define AUDIO_CHUNK_SIZE_NONBLOCKING 2048
#define AUDIO_MAX_RATIO 16
enum rarch_audio_ctl_state
{
RARCH_AUDIO_CTL_NONE = 0,
@@ -58,7 +65,10 @@ enum rarch_audio_ctl_state
RARCH_AUDIO_CTL_IS_ACTIVE,
RARCH_AUDIO_CTL_RESAMPLER_DEINIT,
RARCH_AUDIO_CTL_RESAMPLER_INIT,
RARCH_AUDIO_CTL_RESAMPLER_PROCESS
RARCH_AUDIO_CTL_RESAMPLER_PROCESS,
RARCH_AUDIO_CTL_DEVICES_LIST_NEW,
RARCH_AUDIO_CTL_DEVICES_LIST_FREE,
RARCH_AUDIO_CTL_DEVICES_LIST_GET
};
typedef struct audio_driver
@@ -100,6 +110,12 @@ typedef struct audio_driver
/* Human-readable identifier. */
const char *ident;
/* Optional. Get audio device list (allocates, caller has to free this) */
void *(*device_list_new)(void *data);
/* Optional. Frees audio device list */
void (*device_list_free)(void *data, void *data2);
/* Optional. */
size_t (*write_avail)(void *data);
+2 -2
View File
@@ -22,12 +22,12 @@
#include <dynamic/dylib.h>
#include <file/file_path.h>
#include <file/config_file_userdata.h>
#include <file/dir_list.h>
#include <lists/dir_list.h>
#include "audio_dsp_filter.h"
#include "audio_filters/dspfilter.h"
#include "../config_file_userdata.h"
#include "../frontend/frontend_driver.h"
#include "../performance.h"
#include "../dynamic.h"
+2 -2
View File
@@ -16,15 +16,15 @@
#include <string.h>
#include <file/config_file_userdata.h>
#include <string/stdstring.h>
#include "audio_resampler_driver.h"
#include "../config_file_userdata.h"
#ifdef RARCH_INTERNAL
#include "../performance.h"
#endif
#ifndef DONT_HAVE_STRING_LIST
#include "../string_list_special.h"
#include "../list_special.h"
#endif
static const rarch_resampler_t *resampler_drivers[] = {
+1 -1
View File
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "audio_thread_wrapper.h"
+62
View File
@@ -15,6 +15,8 @@
#include <stdlib.h>
#include <lists/string_list.h>
#include <alsa/asoundlib.h>
#include "../audio_driver.h"
@@ -324,6 +326,64 @@ static size_t alsa_buffer_size(void *data)
return alsa->buffer_size;
}
static void *alsa_device_list_new(void *data)
{
void **hints, **n;
union string_list_elem_attr attr;
struct string_list *s = string_list_new();
if (!s)
return NULL;
attr.i = 0;
if (snd_device_name_hint(-1, "pcm", &hints) != 0)
goto error;
n = hints;
while (*n != NULL)
{
char *name = snd_device_name_get_hint(*n, "NAME");
char *io = snd_device_name_get_hint(*n, "IOID");
char *desc = snd_device_name_get_hint(*n, "DESC");
/* description of device IOID - input / output identifcation
* ("Input" or "Output"), NULL means both) */
if (!io || !strcmp(io,"Output"))
string_list_append(s, name, attr);
if (name)
free(name);
if (io)
free(io);
if (desc)
free(desc);
n++;
}
/* free hint buffer too */
snd_device_name_free_hint(hints);
return s;
error:
string_list_free(s);
return NULL;
}
static void alsa_device_list_free(void *data, void *array_list_data)
{
struct string_list *s = (struct string_list*)array_list_data;
if (!s)
return;
string_list_free(s);
}
audio_driver_t audio_alsa = {
alsa_init,
alsa_write,
@@ -334,6 +394,8 @@ audio_driver_t audio_alsa = {
alsa_free,
alsa_use_float,
"alsa",
alsa_device_list_new,
alsa_device_list_free,
alsa_write_avail,
alsa_buffer_size,
};
+2
View File
@@ -377,6 +377,8 @@ audio_driver_t audio_alsa = {
alsa_qsa_free,
alsa_qsa_use_float,
"alsa",
NULL,
NULL,
alsa_qsa_write_avail,
alsa_qsa_buffer_size,
};
+63 -1
View File
@@ -16,10 +16,12 @@
#include <stdlib.h>
#include <lists/string_list.h>
#include <alsa/asoundlib.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../configuration.h"
@@ -342,6 +344,64 @@ static size_t alsa_thread_buffer_size(void *data)
return alsa->buffer_size;
}
static void *alsa_device_list_new(void *data)
{
void **hints, **n;
union string_list_elem_attr attr;
struct string_list *s = string_list_new();
if (!s)
return NULL;
attr.i = 0;
if (snd_device_name_hint(-1, "pcm", &hints) != 0)
goto error;
n = hints;
while (*n != NULL)
{
char *name = snd_device_name_get_hint(*n, "NAME");
char *io = snd_device_name_get_hint(*n, "IOID");
char *desc = snd_device_name_get_hint(*n, "DESC");
/* description of device IOID - input / output identifcation
* ("Input" or "Output"), NULL means both) */
if (!io || !strcmp(io,"Output"))
string_list_append(s, name, attr);
if (name)
free(name);
if (io)
free(io);
if (desc)
free(desc);
n++;
}
/* free hint buffer too */
snd_device_name_free_hint(hints);
return s;
error:
string_list_free(s);
return NULL;
}
static void alsa_device_list_free(void *data, void *array_list_data)
{
struct string_list *s = (struct string_list*)array_list_data;
if (!s)
return;
string_list_free(s);
}
audio_driver_t audio_alsathread = {
alsa_thread_init,
alsa_thread_write,
@@ -352,6 +412,8 @@ audio_driver_t audio_alsathread = {
alsa_thread_free,
alsa_thread_use_float,
"alsathread",
alsa_device_list_new,
alsa_device_list_free,
alsa_thread_write_avail,
alsa_thread_buffer_size,
};
+14 -1
View File
@@ -27,7 +27,7 @@
#include <AudioUnit/AUComponent.h>
#include <boolean.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include <retro_endianness.h>
#include <string/stdstring.h>
@@ -440,6 +440,17 @@ static size_t coreaudio_buffer_size(void *data)
return dev->buffer_size;
}
static void *coreaudio_device_list_new(void *data)
{
/* TODO/FIXME */
return NULL;
}
static void coreaudio_device_list_free(void *data, void *array_list_data)
{
/* TODO/FIXME */
}
audio_driver_t audio_coreaudio = {
coreaudio_init,
coreaudio_write,
@@ -450,6 +461,8 @@ audio_driver_t audio_coreaudio = {
coreaudio_free,
coreaudio_use_float,
"coreaudio",
coreaudio_device_list_new,
coreaudio_device_list_free,
coreaudio_write_avail,
coreaudio_buffer_size,
};
+2
View File
@@ -300,6 +300,8 @@ audio_driver_t audio_ctr_csnd = {
ctr_csnd_audio_free,
ctr_csnd_audio_use_float,
"csnd",
NULL,
NULL,
ctr_csnd_audio_write_avail,
ctr_csnd_audio_buffer_size
};
+2
View File
@@ -214,6 +214,8 @@ audio_driver_t audio_ctr_dsp = {
ctr_dsp_audio_free,
ctr_dsp_audio_use_float,
"dsp",
NULL,
NULL,
ctr_dsp_audio_write_avail,
ctr_dsp_audio_buffer_size
};
+3 -1
View File
@@ -32,7 +32,7 @@
#include <retro_inline.h>
#include <retro_miscellaneous.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../configuration.h"
@@ -489,6 +489,8 @@ audio_driver_t audio_dsound = {
dsound_free,
dsound_use_float,
"dsound",
NULL,
NULL,
dsound_write_avail,
dsound_buffer_size,
};
+2
View File
@@ -241,6 +241,8 @@ audio_driver_t audio_gx = {
gx_audio_free,
gx_audio_use_float,
"gx",
NULL,
NULL,
gx_audio_write_avail,
gx_audio_buffer_size,
};
+2
View File
@@ -362,6 +362,8 @@ audio_driver_t audio_jack = {
ja_free,
ja_use_float,
"jack",
NULL,
NULL,
ja_write_avail,
ja_buffer_size,
};
+2
View File
@@ -85,6 +85,8 @@ audio_driver_t audio_null = {
null_audio_free,
null_audio_use_float,
"null",
NULL,
NULL,
null_audio_write_avail,
NULL
};
+2
View File
@@ -267,6 +267,8 @@ audio_driver_t audio_openal = {
al_free,
al_use_float,
"openal",
NULL,
NULL,
al_write_avail,
al_buffer_size,
};
+2
View File
@@ -313,6 +313,8 @@ audio_driver_t audio_opensl = {
sl_free,
sl_use_float,
"opensl",
NULL,
NULL,
sl_write_avail,
sl_buffer_size,
};
+2
View File
@@ -212,6 +212,8 @@ audio_driver_t audio_oss = {
oss_free,
oss_use_float,
"oss",
NULL,
NULL,
oss_write_avail,
oss_buffer_size,
};
+3 -1
View File
@@ -17,7 +17,7 @@
#include <stdlib.h>
#include <string.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "../audio_driver.h"
#include "../../configuration.h"
@@ -247,6 +247,8 @@ audio_driver_t audio_ps3 = {
ps3_audio_free,
ps3_audio_use_float,
"ps3",
NULL,
NULL,
ps3_audio_write_avail,
NULL
};
+2
View File
@@ -286,6 +286,8 @@ audio_driver_t audio_psp = {
#else
"psp",
#endif
NULL,
NULL,
psp_write_avail,
psp_buffer_size,
};
+2
View File
@@ -343,6 +343,8 @@ audio_driver_t audio_pulse = {
pulse_free,
pulse_use_float,
"pulse",
NULL,
NULL,
pulse_write_avail,
pulse_buffer_size,
};
+2
View File
@@ -142,6 +142,8 @@ audio_driver_t audio_roar = {
ra_free,
ra_use_float,
"roar",
NULL,
NULL,
ra_write_avail,
NULL
};
+3 -1
View File
@@ -17,7 +17,7 @@
#include <boolean.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "../audio_driver.h"
@@ -233,6 +233,8 @@ audio_driver_t audio_rsound = {
rs_free,
rs_use_float,
"rsound",
NULL,
NULL,
rs_write_avail,
rs_buffer_size,
};
+1 -1
View File
@@ -32,7 +32,7 @@ extern "C" {
#include <stdint.h>
#include <stddef.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#ifdef _WIN32
#define RSD_DEFAULT_HOST "127.0.0.1" /* Stupid Windows. */
+2
View File
@@ -110,6 +110,8 @@ audio_driver_t audio_rwebaudio = {
rwebaudio_free,
rwebaudio_use_float,
"rwebaudio",
NULL,
NULL,
rwebaudio_write_avail,
rwebaudio_buffer_size,
};
+3 -1
View File
@@ -23,7 +23,7 @@
#include <boolean.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include <retro_inline.h>
#include "../audio_driver.h"
@@ -253,6 +253,8 @@ audio_driver_t audio_sdl = {
#else
"sdl",
#endif
NULL,
NULL,
sdl_audio_write_avail,
NULL
};
+2
View File
@@ -347,6 +347,8 @@ audio_driver_t audio_xa = {
xa_free,
xa_use_float,
"xaudio",
NULL,
NULL,
xa_write_avail,
xa_buffer_size,
};
+2
View File
@@ -146,6 +146,8 @@ audio_driver_t audio_xenon360 = {
xenon360_audio_free,
xenon360_use_float,
"xenon360",
NULL,
NULL,
xenon360_write_avail,
NULL
};
+23 -26
View File
@@ -20,22 +20,19 @@ CFLAGS += -I$(LIBRETRO_COMM_DIR)/include -I../../
LDFLAGS += -lm
SHAREDOBJ += $(LIBRETRO_COMM_DIR)/memmap/memalign.o \
$(LIBRETRO_COMM_DIR)/string/string_list.o \
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.o \
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
../..//config_file_userdata.o \
../audio_resampler_driver.o \
$(LIBRETRO_COMM_DIR)/file/config_file.o \
$(LIBRETRO_COMM_DIR)/file/retro_file.o \
$(LIBRETRO_COMM_DIR)/streams/file_stream.o \
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
$(LIBRETRO_COMM_DIR)/file/file_path.o \
$(LIBRETRO_COMM_DIR)/compat/compat.o \
$(LIBRETRO_COMM_DIR)/file/retro_stat.o \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.o \
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
all: $(TESTS)
resampler-sinc.o: ../audio_resampler_driver.c $(SHAREDOBJ)
$(CC) -c -o $@ $< $(CFLAGS)
resampler-cc.o: ../audio_resampler_driver.c $(SHAREDOBJ)
$(CC) -c -o $@ $< $(CFLAGS) -DRESAMPLER_IDENT='"CC"'
main-cc.o: main.c
$(CC) -c -o $@ $< $(CFLAGS) -DRESAMPLER_IDENT='"CC"'
@@ -45,16 +42,16 @@ snr-cc.o: snr.c
cc-resampler.o: ../drivers_resampler/cc_resampler.c
$(CC) -c -o $@ $< $(CFLAGS)
sinc-lowest.o: ../drivers_resampler/sinc.c
sinc-lowest.o: ../drivers_resampler/sinc_resampler.c
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_LOWEST_QUALITY
sinc-lower.o: ../drivers_resampler/sinc.c
sinc-lower.o: ../drivers_resampler/sinc_resampler.c
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_LOWER_QUALITY
sinc.o: ../drivers_resampler/sinc.c
sinc.o: ../drivers_resampler/sinc_resampler.c
$(CC) -c -o $@ $< $(CFLAGS)
nearest.o: ../drivers_resampler/nearest.c
nearest_resampler.o: ../drivers_resampler/nearest_resampler.c
$(CC) -c -o $@ $< $(CFLAGS)
sinc-higher.o: ../drivers_resampler/sinc.c
@@ -63,40 +60,40 @@ sinc-higher.o: ../drivers_resampler/sinc.c
sinc-highest.o: ../drivers_resampler/sinc.c
$(CC) -c -o $@ $< $(CFLAGS) -DSINC_HIGHEST_QUALITY
test-sinc-lowest: sinc-lowest.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-sinc-lowest: sinc-lowest.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-snr-sinc-lowest: sinc-lowest.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-snr-sinc-lowest: sinc-lowest.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-sinc-lower: sinc-lower.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-sinc-lower: sinc-lower.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-snr-sinc-lower: sinc-lower.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-snr-sinc-lower: sinc-lower.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-sinc: sinc.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-sinc: sinc.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-snr-sinc: sinc.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-snr-sinc: sinc.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-sinc-higher: sinc-higher.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-sinc-higher: sinc-higher.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-snr-sinc-higher: sinc-higher.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-snr-sinc-higher: sinc-higher.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-sinc-highest: sinc-highest.o ../audio_utils.o main.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-sinc-highest: sinc-highest.o ../audio_utils.o main.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-snr-sinc-highest: sinc-highest.o ../audio_utils.o snr.o resampler-sinc.o resampler-cc.o nearest.o $(SHAREDOBJ)
test-snr-sinc-highest: sinc-highest.o ../audio_utils.o snr.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-cc: cc-resampler.o ../audio_utils.o main-cc.o resampler-cc.o resampler-cc.o sinc.o nearest.o $(SHAREDOBJ)
test-cc: cc-resampler.o ../audio_utils.o main-cc.o resampler-cc.o sinc.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
test-snr-cc: cc-resampler.o ../audio_utils.o snr-cc.o resampler-cc.o sinc.o nearest.o $(SHAREDOBJ)
test-snr-cc: cc-resampler.o ../audio_utils.o snr-cc.o resampler-cc.o sinc.o nearest_resampler.o $(SHAREDOBJ)
$(CC) -o $@ $^ $(LDFLAGS)
%.o: %.c
+24 -39
View File
@@ -20,7 +20,7 @@
#include <boolean.h>
#include <string/string_list.h>
#include <lists/string_list.h>
#include <rthreads/rthreads.h>
#include "autosave.h"
@@ -55,28 +55,6 @@ struct autosave
static struct autosave_st autosave_state;
/**
* autosave_lock:
* @handle : pointer to autosave object
*
* Locks autosave.
**/
static void autosave_lock(autosave_t *handle)
{
slock_lock(handle->lock);
}
/**
* autosave_unlock:
* @handle : pointer to autosave object
*
* Unlocks autosave.
**/
static void autosave_unlock(autosave_t *handle)
{
slock_unlock(handle->lock);
}
/**
* autosave_thread:
* @data : pointer to autosave object
@@ -85,19 +63,19 @@ static void autosave_unlock(autosave_t *handle)
**/
static void autosave_thread(void *data)
{
bool first_log = true;
bool first_log = true;
autosave_t *save = (autosave_t*)data;
while (!save->quit)
{
bool differ;
autosave_lock(save);
slock_lock(save->lock);
differ = memcmp(save->buffer, save->retro_buffer,
save->bufsize) != 0;
if (differ)
memcpy(save->buffer, save->retro_buffer, save->bufsize);
autosave_unlock(save);
slock_unlock(save->lock);
if (differ)
{
@@ -149,12 +127,13 @@ static void autosave_thread(void *data)
* Returns: pointer to new autosave_t object if successful, otherwise
* NULL.
**/
autosave_t *autosave_new(const char *path, const void *data, size_t size,
static autosave_t *autosave_new(const char *path,
const void *data, size_t size,
unsigned interval)
{
autosave_t *handle = (autosave_t*)calloc(1, sizeof(*handle));
autosave_t *handle = (autosave_t*)calloc(1, sizeof(*handle));
if (!handle)
return NULL;
goto error;
handle->bufsize = size;
handle->interval = interval;
@@ -163,10 +142,8 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
handle->retro_buffer = data;
if (!handle->buffer)
{
free(handle);
return NULL;
}
goto error;
memcpy(handle->buffer, handle->retro_buffer, handle->bufsize);
handle->lock = slock_new();
@@ -176,6 +153,11 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
handle->thread = sthread_create(autosave_thread, handle);
return handle;
error:
if (handle)
free(handle);
return NULL;
}
/**
@@ -184,7 +166,7 @@ autosave_t *autosave_new(const char *path, const void *data, size_t size,
*
* Frees autosave object.
**/
void autosave_free(autosave_t *handle)
static void autosave_free(autosave_t *handle)
{
if (!handle)
return;
@@ -215,7 +197,7 @@ void lock_autosave(void)
for (i = 0; i < autosave_state.num; i++)
{
if (autosave_state.list[i])
autosave_lock(autosave_state.list[i]);
slock_lock(autosave_state.list[i]->lock);
}
}
@@ -231,24 +213,27 @@ void unlock_autosave(void)
for (i = 0; i < autosave_state.num; i++)
{
if (autosave_state.list[i])
autosave_unlock(autosave_state.list[i]);
slock_unlock(autosave_state.list[i]->lock);
}
}
void autosave_event_init(void)
{
unsigned i;
autosave_t **list = NULL;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
if (settings->autosave_interval < 1 || !global->savefiles)
return;
if (!(autosave_state.list = (autosave_t**)calloc(global->savefiles->size,
sizeof(*autosave_state.list))))
list = (autosave_t**)calloc(global->savefiles->size,
sizeof(*autosave_state.list));
if (!list)
return;
autosave_state.num = global->savefiles->size;
autosave_state.list = list;
autosave_state.num = global->savefiles->size;
for (i = 0; i < global->savefiles->size; i++)
{
-23
View File
@@ -25,29 +25,6 @@ extern "C" {
typedef struct autosave autosave_t;
/**
* autosave_new:
* @path : path to autosave file
* @data : pointer to buffer
* @size : size of @data buffer
* @interval : interval at which saves should be performed.
*
* Create and initialize autosave object.
*
* Returns: pointer to new autosave_t object if successful, otherwise
* NULL.
**/
autosave_t *autosave_new(const char *path, const void *data,
size_t size, unsigned interval);
/**
* autosave_free:
* @handle : pointer to autosave object
*
* Frees autosave object.
**/
void autosave_free(autosave_t *handle);
/**
* lock_autosave:
*
+4 -2
View File
@@ -18,8 +18,10 @@
#include "camera_driver.h"
#include "../general.h"
#include "../string_list_special.h"
#include "../configuration.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../list_special.h"
#include "../verbosity.h"
static const camera_driver_t *camera_drivers[] = {
+33 -32
View File
@@ -130,7 +130,7 @@ bool cheat_manager_save(const char *path)
settings_t *settings = config_get_ptr();
cheat_manager_t *handle = cheat_manager_state;
fill_pathname_join(buf, settings->cheat_database,
fill_pathname_join(buf, settings->path.cheat_database,
path, sizeof(buf));
fill_pathname_noext(cheats_file, buf, ".cht", sizeof(cheats_file));
@@ -177,6 +177,38 @@ bool cheat_manager_save(const char *path)
return ret;
}
static cheat_manager_t *cheat_manager_new(unsigned size)
{
unsigned i;
cheat_manager_t *handle = (cheat_manager_t*)
calloc(1, sizeof(struct cheat_manager));
if (!handle)
return NULL;
handle->buf_size = size;
handle->size = size;
handle->cheats = (struct item_cheat*)
calloc(handle->buf_size, sizeof(struct item_cheat));
if (!handle->cheats)
{
handle->buf_size = 0;
handle->size = 0;
handle->cheats = NULL;
return handle;
}
for (i = 0; i < handle->size; i++)
{
handle->cheats[i].desc = NULL;
handle->cheats[i].code = NULL;
handle->cheats[i].state = false;
}
return handle;
}
bool cheat_manager_load(const char *path)
{
unsigned cheats = 0, i;
@@ -230,37 +262,6 @@ bool cheat_manager_load(const char *path)
return true;
}
cheat_manager_t *cheat_manager_new(unsigned size)
{
unsigned i;
cheat_manager_t *handle = (cheat_manager_t*)
calloc(1, sizeof(struct cheat_manager));
if (!handle)
return NULL;
handle->buf_size = size;
handle->size = size;
handle->cheats = (struct item_cheat*)
calloc(handle->buf_size, sizeof(struct item_cheat));
if (!handle->cheats)
{
handle->buf_size = 0;
handle->size = 0;
handle->cheats = NULL;
return handle;
}
for (i = 0; i < handle->size; i++)
{
handle->cheats[i].desc = NULL;
handle->cheats[i].code = NULL;
handle->cheats[i].state = false;
}
return handle;
}
bool cheat_manager_realloc(unsigned new_size)
{
-2
View File
@@ -27,8 +27,6 @@ typedef struct cheat_manager cheat_manager_t;
unsigned cheat_manager_get_size(void);
cheat_manager_t *cheat_manager_new(unsigned size);
bool cheat_manager_load(const char *path);
/**
+40 -36
View File
@@ -17,7 +17,7 @@
#include <ctype.h>
#include <formats/jsonsax.h>
#include <retro_file.h>
#include <streams/file_stream.h>
#include <rhash.h>
#include <rthreads/async_job.h>
@@ -1688,7 +1688,7 @@ static size_t cheevos_eval_md5(
}
else
{
RFILE *file = retro_fopen(info->path, RFILE_MODE_READ, 0);
RFILE *file = filestream_open(info->path, RFILE_MODE_READ, 0);
size_t size = 0;
if (!file)
@@ -1697,7 +1697,7 @@ static size_t cheevos_eval_md5(
for (;;)
{
uint8_t buffer[4096];
ssize_t num_read = retro_fread(file,
ssize_t num_read = filestream_read(file,
(void*)buffer, sizeof(buffer));
if (num_read <= 0)
@@ -1707,7 +1707,7 @@ static size_t cheevos_eval_md5(
size += num_read;
}
retro_fclose(file);
filestream_close(file);
return size;
}
}
@@ -1825,14 +1825,14 @@ static unsigned cheevos_find_game_id_nes(
}
else
{
RFILE *file = retro_fopen(info->path, RFILE_MODE_READ, 0);
RFILE *file = filestream_open(info->path, RFILE_MODE_READ, 0);
ssize_t num_read;
if (!file)
return 0;
num_read = retro_fread(file, (void*)&header, sizeof(header));
retro_fclose(file);
num_read = filestream_read(file, (void*)&header, sizeof(header));
filestream_close(file);
if (num_read < (ssize_t)sizeof(header))
return 0;
@@ -1861,7 +1861,15 @@ static unsigned cheevos_find_game_id_nes(
}
else
{
RFILE *file = retro_fopen(info->path, RFILE_MODE_READ, 0);
unsigned bytes;
ssize_t num_read;
int i, mapper_no;
int not_power2[] =
{
53, 198, 228
};
bool round = true;
RFILE *file = filestream_open(info->path, RFILE_MODE_READ, 0);
uint8_t * data = (uint8_t *) malloc(rom_size << 14);
if (!file || !data)
@@ -1871,36 +1879,32 @@ static unsigned cheevos_find_game_id_nes(
memset(data, 0xFF, rom_size << 14);
/* from fceu core - compute size using the cart mapper */
int MapperNo = (header.rom_type >> 4);
MapperNo |= (header.rom_type2 & 0xF0);
mapper_no = (header.rom_type >> 4);
mapper_no |= (header.rom_type2 & 0xF0);
int not_power2[] =
{
53, 198, 228
};
bool round = true;
for (int i = 0; i != sizeof(not_power2) / sizeof(not_power2[0]); ++i) {
//for games not to the power of 2, so we just read enough
//prg rom from it, but we have to keep ROM_size to the power of 2
//since PRGCartMapping wants ROM_size to be to the power of 2
//so instead if not to power of 2, we just use head.ROM_size when
//we use FCEU_read
if (not_power2[i] == MapperNo) {
for (i = 0; i != sizeof(not_power2) / sizeof(not_power2[0]); ++i)
{
/* for games not to the power of 2, so we just read enough
* PRG rom from it, but we have to keep ROM_size to the power of 2
* since PRGCartMapping wants ROM_size to be to the power of 2
* so instead if not to power of 2, we just use head.ROM_size when
* we use FCEU_read. */
if (not_power2[i] == mapper_no) {
round = false;
break;
}
}
MD5_Init(&ctx);
retro_fseek(file, sizeof(header), SEEK_SET);
filestream_seek(file, sizeof(header), SEEK_SET);
/* from fceu core - check if Trainer included in ROM data */
if (header.rom_type & 4)
retro_fseek(file, sizeof(header), SEEK_CUR);
filestream_seek(file, sizeof(header), SEEK_CUR);
unsigned bytes = (round) ? rom_size : header.rom_size;
ssize_t num_read = retro_fread(file, (void*) data, 0x4000 * bytes );
retro_fclose(file);
bytes = (round) ? rom_size : header.rom_size;
num_read = filestream_read(file, (void*) data, 0x4000 * bytes );
filestream_close(file);
if (num_read <= 0)
return 0;
@@ -2105,9 +2109,9 @@ static void cheevos_populate_menu(void *data)
settings_t *settings = config_get_ptr();
menu_displaylist_info_t *info = (menu_displaylist_info_t*)data;
menu_entries_push(info->list, "Unlocked Achievements:",
menu_entries_add(info->list, "Unlocked Achievements:",
"", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
menu_entries_push(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
menu_entries_add(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
cheevo = cheevos_locals.core.cheevos;
end = cheevos_locals.core.cheevos + cheevos_locals.core.count;
@@ -2115,7 +2119,7 @@ static void cheevos_populate_menu(void *data)
for (i = 0; cheevo < end; i++, cheevo++)
{
if (!cheevo->active)
menu_entries_push(info->list, cheevo->title,
menu_entries_add(info->list, cheevo->title,
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
}
@@ -2128,15 +2132,15 @@ static void cheevos_populate_menu(void *data)
for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++)
{
if (!cheevo->active)
menu_entries_push(info->list, cheevo->title,
menu_entries_add(info->list, cheevo->title,
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
}
}
menu_entries_push(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
menu_entries_push(info->list, "Locked Achievements:", "",
menu_entries_add(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
menu_entries_add(info->list, "Locked Achievements:", "",
MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
menu_entries_push(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
menu_entries_add(info->list, "", "", MENU_SETTINGS_CHEEVOS_NONE, 0, 0);
cheevo = cheevos_locals.core.cheevos;
end = cheevos_locals.core.cheevos + cheevos_locals.core.count;
@@ -2144,7 +2148,7 @@ static void cheevos_populate_menu(void *data)
for (i = 0; cheevo < end; i++, cheevo++)
{
if (cheevo->active)
menu_entries_push(info->list, cheevo->title,
menu_entries_add(info->list, cheevo->title,
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
}
@@ -2157,7 +2161,7 @@ static void cheevos_populate_menu(void *data)
for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++)
{
if (cheevo->active)
menu_entries_push(info->list, cheevo->title,
menu_entries_add(info->list, cheevo->title,
cheevo->description, MENU_SETTINGS_CHEEVOS_START + i, 0, 0);
}
}
+7 -29
View File
@@ -26,6 +26,7 @@
#include <compat/posix_string.h>
#include <file/file_path.h>
#include <net/net_compat.h>
#include <net/net_socket.h>
#include <string/stdstring.h>
#include "msg_hash.h"
@@ -122,41 +123,23 @@ static const struct cmd_map map[] = {
#if defined(HAVE_NETWORK_CMD) && defined(HAVE_NETPLAY)
static bool cmd_init_network(rarch_cmd_t *handle, uint16_t port)
{
struct addrinfo hints = {0};
char port_buf[16] = {0};
int fd;
struct addrinfo *res = NULL;
int yes = 1;
if (!network_init())
return false;
RARCH_LOG("Bringing up command interface on port %hu.\n",
(unsigned short)port);
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
hints.ai_family = AF_INET;
#else
hints.ai_family = AF_UNSPEC;
#endif
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_PASSIVE;
fd = socket_init((void**)&res, port, NULL, SOCKET_TYPE_DATAGRAM);
snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port);
if (getaddrinfo_retro(NULL, port_buf, &hints, &res) < 0)
if (fd < 0)
goto error;
handle->net_fd = socket(res->ai_family,
res->ai_socktype, res->ai_protocol);
if (handle->net_fd < 0)
goto error;
handle->net_fd = fd;
if (!socket_nonblock(handle->net_fd))
goto error;
setsockopt(handle->net_fd, SOL_SOCKET,
SO_REUSEADDR, (const char*)&yes, sizeof(int));
if (bind(handle->net_fd, res->ai_addr, res->ai_addrlen) < 0)
if (!socket_bind(handle->net_fd, (void*)res))
{
RARCH_ERR("Failed to bind socket.\n");
goto error;
@@ -522,11 +505,6 @@ static bool send_udp_packet(const char *host,
int fd = -1;
bool ret = true;
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
hints.ai_family = AF_INET;
#else
hints.ai_family = AF_UNSPEC;
#endif
hints.ai_socktype = SOCK_DGRAM;
snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port);
@@ -547,7 +525,7 @@ static bool send_udp_packet(const char *host,
goto end;
}
len = strlen(msg);
len = strlen(msg);
ret_len = sendto(fd, msg, len, 0, tmp->ai_addr, tmp->ai_addrlen);
if (ret_len < len)
+49 -37
View File
@@ -17,11 +17,12 @@
#include <compat/strl.h>
#include <file/file_path.h>
#include <file/dir_list.h>
#include <lists/dir_list.h>
#include <string/stdstring.h>
#include "command_event.h"
#include "defaults.h"
#include "frontend/frontend_driver.h"
#include "audio/audio_driver.h"
#include "record/record_driver.h"
@@ -38,7 +39,7 @@
#include "rewind.h"
#include "system.h"
#include "ui/ui_companion_driver.h"
#include "dir_list_special.h"
#include "list_special.h"
#ifdef HAVE_CHEEVOS
#include "cheevos.h"
@@ -461,8 +462,7 @@ static void event_load_auto_state(void)
global_t *global = global_get_ptr();
#ifdef HAVE_NETPLAY
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)
&& !global->netplay.is_spectate)
if (global->netplay.enable && !global->netplay.is_spectate)
return;
#endif
@@ -670,11 +670,10 @@ static bool event_save_core_config(void)
global_t *global = global_get_ptr();
*config_dir = '\0';
if (*settings->menu_config_directory)
strlcpy(config_dir, settings->menu_config_directory,
if (!string_is_empty(settings->directory.menu_config))
strlcpy(config_dir, settings->directory.menu_config,
sizeof(config_dir));
else if (*global->path.config) /* Fallback */
else if (!string_is_empty(global->path.config)) /* Fallback */
fill_pathname_basedir(config_dir, global->path.config,
sizeof(config_dir));
else
@@ -683,18 +682,23 @@ static bool event_save_core_config(void)
RARCH_ERR("%s\n", msg_hash_to_str(MSG_CONFIG_DIRECTORY_NOT_SET));
return false;
}
/* Infer file name based on libretro core. */
if (*settings->libretro && path_file_exists(settings->libretro))
if (!string_is_empty(settings->path.libretro)
&& path_file_exists(settings->path.libretro))
{
unsigned i;
RARCH_LOG("Using core name for new config\n");
/* In case of collision, find an alternative name. */
for (i = 0; i < 16; i++)
{
char tmp[64];
fill_pathname_base(config_name, settings->libretro,
fill_pathname_base(
config_name,
settings->path.libretro,
sizeof(config_name));
path_remove_extension(config_name);
fill_pathname_join(config_path, config_dir, config_name,
sizeof(config_path));
@@ -703,7 +707,7 @@ static bool event_save_core_config(void)
else
strlcpy(tmp, ".cfg", sizeof(tmp));
snprintf(config_path, sizeof(config_path), "%s%s", config_path, tmp);
strlcat(config_path, tmp, sizeof(config_path));
if (!path_file_exists(config_path))
{
found_path = true;
@@ -766,7 +770,7 @@ void event_save_current_config(void)
global_t *global = global_get_ptr();
bool ret = false;
if (settings->config_save_on_exit && *global->path.config)
if (settings->config_save_on_exit && !string_is_empty(global->path.config))
{
/* Save last core-specific config to the default config location,
* needed on consoles for core switching and reusing last good
@@ -779,22 +783,21 @@ void event_save_current_config(void)
ret = config_save_file(global->path.core_specific_config);
else
ret = config_save_file(global->path.config);
}
if (ret)
{
snprintf(msg, sizeof(msg), "Saved new config to \"%s\".",
global->path.config);
RARCH_LOG("%s\n", msg);
}
else
{
snprintf(msg, sizeof(msg), "Failed saving config to \"%s\".",
global->path.config);
RARCH_ERR("%s\n", msg);
}
if (ret)
{
snprintf(msg, sizeof(msg), "Saved new config to \"%s\".",
global->path.config);
RARCH_LOG("%s\n", msg);
runloop_msg_queue_push(msg, 1, 180, true);
}
else
{
snprintf(msg, sizeof(msg), "Failed saving config to \"%s\".",
global->path.config);
RARCH_ERR("%s\n", msg);
}
runloop_msg_queue_push(msg, 1, 180, true);
}
/**
@@ -985,7 +988,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
#else
char *fullpath = NULL;
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, settings->libretro);
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, settings->path.libretro);
event_cmd_ctl(EVENT_CMD_EXEC, (void*)fullpath);
event_cmd_ctl(EVENT_CMD_QUIT, NULL);
#endif
@@ -1010,13 +1013,17 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
core_info_ctx_find_t info_find;
#if defined(HAVE_DYNAMIC)
if (!(*settings->libretro))
if (!(*settings->path.libretro))
return false;
libretro_get_system_info(settings->libretro, system,
libretro_get_system_info(
settings->path.libretro,
system,
ptr);
#else
libretro_get_system_info_static(system, ptr);
#endif
info_find.path = settings->libretro;
info_find.path = settings->path.libretro;
if (!core_info_ctl(CORE_INFO_CTL_LOAD, &info_find))
return false;
@@ -1191,7 +1198,12 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
break;
case EVENT_CMD_AUTOSAVE_DEINIT:
#ifdef HAVE_THREADS
autosave_event_deinit();
{
global_t *global = global_get_ptr();
if (!global->sram.use)
return false;
autosave_event_deinit();
}
#endif
break;
case EVENT_CMD_AUTOSAVE_INIT:
@@ -1260,9 +1272,9 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
break;
case EVENT_CMD_DSP_FILTER_INIT:
event_cmd_ctl(EVENT_CMD_DSP_FILTER_DEINIT, NULL);
if (!*settings->audio.dsp_plugin)
if (!*settings->path.audio_dsp_plugin)
break;
audio_driver_dsp_filter_init(settings->audio.dsp_plugin);
audio_driver_dsp_filter_init(settings->path.audio_dsp_plugin);
break;
case EVENT_CMD_GPU_RECORD_DEINIT:
video_driver_ctl(RARCH_DISPLAY_CTL_GPU_RECORD_DEINIT, NULL);
@@ -1290,9 +1302,9 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
return false;
RARCH_LOG("%s: [%s].\n",
msg_hash_to_str(MSG_LOADING_HISTORY_FILE),
settings->content_history_path);
settings->path.content_history);
g_defaults.history = content_playlist_init(
settings->content_history_path,
settings->path.content_history,
settings->content_history_size);
break;
case EVENT_CMD_CORE_INFO_DEINIT:
@@ -1301,7 +1313,7 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
case EVENT_CMD_CORE_INFO_INIT:
event_cmd_ctl(EVENT_CMD_CORE_INFO_DEINIT, NULL);
if (*settings->libretro_directory)
if (*settings->directory.libretro)
core_info_ctl(CORE_INFO_CTL_LIST_INIT, NULL);
break;
case EVENT_CMD_CORE_DEINIT:
+18 -1
View File
@@ -18,7 +18,6 @@
#define __CONFIG_DEF_H
#include <boolean.h>
#include "libretro.h"
#include "driver.h"
#include "gfx/video_driver.h"
@@ -126,6 +125,7 @@ enum
MENU_XUI,
MENU_MATERIALUI,
MENU_XMB,
MENU_NUKLEAR,
RECORD_FFMPEG,
RECORD_NULL
@@ -511,6 +511,21 @@ static bool default_block_config_read = true;
static unsigned xmb_scale_factor = 100;
static unsigned xmb_alpha_factor = 75;
static unsigned xmb_theme = 0;
#ifdef HAVE_LAKKA
static bool xmb_shadows_enable = false;
#else
static bool xmb_shadows_enable = true;
#endif
static unsigned menu_background_gradient = 4;
#if defined(HAVE_OPENGLES2) || defined(OSX_PPC)
static unsigned menu_shader_pipeline = 1;
#else
static unsigned menu_shader_pipeline = 2;
#endif
static bool show_advanced_settings = true;
static const uint32_t menu_entry_normal_color = 0xffffffff;
@@ -765,6 +780,8 @@ static const unsigned input_max_users = 5;
static const unsigned input_poll_type_behavior = 2;
static const unsigned menu_thumbnails_default = 3;
#ifdef IOS
static const bool ui_companion_start_on_boot = false;
#else
@@ -1,4 +1,4 @@
/* Copyright (C) 2010-2015 The RetroArch team
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (config_file_userdata.c).
@@ -20,9 +20,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <file/config_file_userdata.h>
#include <file/file_path.h>
#include <string/string_list.h>
#include <lists/string_list.h>
#include "config_file_userdata.h"
#define get_array_setup() \
char key[2][256]; \
@@ -1,4 +1,4 @@
/* Copyright (C) 2010-2015 The RetroArch team
/* Copyright (C) 2010-2016 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (config_file_userdata.h).
@@ -25,7 +25,7 @@
#include <string.h>
#include "config_file.h"
#include <file/config_file.h>
struct config_file_userdata
{
+442 -389
View File
File diff suppressed because it is too large. Load diff
+60 -43
View File
@@ -72,17 +72,12 @@ typedef struct settings
unsigned aspect_ratio_idx;
unsigned rotation;
char shader_path[PATH_MAX_LENGTH];
bool shader_enable;
char softfilter_plugin[PATH_MAX_LENGTH];
float refresh_rate;
bool threaded;
char filter_dir[PATH_MAX_LENGTH];
char shader_dir[PATH_MAX_LENGTH];
char font_path[PATH_MAX_LENGTH];
float font_size;
bool font_enable;
float msg_pos_x;
@@ -123,9 +118,8 @@ typedef struct settings
bool timedate_enable;
bool core_enable;
bool dynamic_wallpaper_enable;
bool boxart_enable;
unsigned thumbnails;
bool throttle;
char wallpaper[PATH_MAX_LENGTH];
struct
{
@@ -166,6 +160,10 @@ typedef struct settings
unsigned title_color;
unsigned xmb_scale_factor;
unsigned xmb_alpha_factor;
unsigned xmb_theme;
unsigned background_gradient;
bool xmb_shadows_enable;
unsigned shader_pipeline;
char xmb_font[PATH_MAX_LENGTH];
bool throttle_framerate;
bool linear_filter;
@@ -196,22 +194,20 @@ typedef struct settings
struct
{
char driver[32];
char resampler[32];
char device[PATH_MAX_LENGTH];
bool enable;
bool mute_enable;
unsigned out_rate;
unsigned block_frames;
char device[PATH_MAX_LENGTH];
unsigned latency;
bool sync;
char dsp_plugin[PATH_MAX_LENGTH];
char filter_dir[PATH_MAX_LENGTH];
bool rate_control;
float rate_control_delta;
float max_timing_skew;
float volume; /* dB scale. */
char resampler[32];
} audio;
struct
@@ -219,6 +215,7 @@ typedef struct settings
char driver[32];
char joypad_driver[32];
char keyboard_layout[64];
char device_names[MAX_USERS][64];
unsigned remap_ids[MAX_USERS][RARCH_BIND_LIST_END];
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
@@ -239,7 +236,6 @@ typedef struct settings
float axis_threshold;
unsigned joypad_map[MAX_USERS];
unsigned device[MAX_USERS];
char device_names[MAX_USERS][64];
unsigned device_name_index[MAX_USERS];
bool autodetect_enable;
bool netplay_client_swap_input;
@@ -250,11 +246,9 @@ typedef struct settings
bool overlay_enable;
bool overlay_enable_autopreferred;
bool overlay_hide_in_menu;
char overlay[PATH_MAX_LENGTH];
float overlay_opacity;
float overlay_scale;
char autoconfig_dir[PATH_MAX_LENGTH];
bool input_descriptor_label_show;
bool input_descriptor_hide_unbound;
@@ -272,7 +266,6 @@ typedef struct settings
struct
{
bool enable;
char overlay[PATH_MAX_LENGTH];
float opacity;
float scale;
} osk;
@@ -313,35 +306,58 @@ typedef struct settings
bool bundle_assets_extract_enable;
unsigned bundle_assets_extract_version_current;
unsigned bundle_assets_extract_last_version;
char bundle_assets_src_path[PATH_MAX_LENGTH];
char bundle_assets_dst_path[PATH_MAX_LENGTH];
char bundle_assets_dst_path_subdir[PATH_MAX_LENGTH];
char core_options_path[PATH_MAX_LENGTH];
char content_history_path[PATH_MAX_LENGTH];
char content_history_directory[PATH_MAX_LENGTH];
struct
{
char cheat_database[PATH_MAX_LENGTH];
char content_database[PATH_MAX_LENGTH];
char libretro[PATH_MAX_LENGTH];
char osk_overlay[PATH_MAX_LENGTH];
char overlay[PATH_MAX_LENGTH];
char menu_wallpaper[PATH_MAX_LENGTH];
char audio_dsp_plugin[PATH_MAX_LENGTH];
char softfilter_plugin[PATH_MAX_LENGTH];
char core_options[PATH_MAX_LENGTH];
char content_history[PATH_MAX_LENGTH];
char libretro_info[PATH_MAX_LENGTH];
char cheat_settings[PATH_MAX_LENGTH];
char bundle_assets_src[PATH_MAX_LENGTH];
char bundle_assets_dst[PATH_MAX_LENGTH];
char bundle_assets_dst_subdir[PATH_MAX_LENGTH];
char shader[PATH_MAX_LENGTH];
char font[PATH_MAX_LENGTH];
} path;
struct
{
char audio_filter[PATH_MAX_LENGTH];
char autoconfig[PATH_MAX_LENGTH];
char video_filter[PATH_MAX_LENGTH];
char video_shader[PATH_MAX_LENGTH];
char content_history[PATH_MAX_LENGTH];
char libretro[PATH_MAX_LENGTH];
char cursor[PATH_MAX_LENGTH];
char input_remapping[PATH_MAX_LENGTH];
char overlay[PATH_MAX_LENGTH];
char resampler[PATH_MAX_LENGTH];
char screenshot[PATH_MAX_LENGTH];
char system[PATH_MAX_LENGTH];
char cache[PATH_MAX_LENGTH];
char playlist[PATH_MAX_LENGTH];
char core_assets[PATH_MAX_LENGTH];
char assets[PATH_MAX_LENGTH];
char dynamic_wallpapers[PATH_MAX_LENGTH];
char thumbnails[PATH_MAX_LENGTH];
char menu_config[PATH_MAX_LENGTH];
char menu_content[PATH_MAX_LENGTH];
} directory;
unsigned content_history_size;
char libretro[PATH_MAX_LENGTH];
char libretro_directory[PATH_MAX_LENGTH];
unsigned libretro_log_level;
char libretro_info_path[PATH_MAX_LENGTH];
char content_database[PATH_MAX_LENGTH];
char cheat_database[PATH_MAX_LENGTH];
char cursor_directory[PATH_MAX_LENGTH];
char cheat_settings_path[PATH_MAX_LENGTH];
char input_remapping_directory[PATH_MAX_LENGTH];
char overlay_directory[PATH_MAX_LENGTH];
char resampler_directory[PATH_MAX_LENGTH];
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];
bool history_list_enable;
bool rewind_enable;
size_t rewind_buffer_size;
@@ -366,13 +382,7 @@ typedef struct settings
unsigned network_remote_base_port;
bool debug_panel_enable;
char core_assets_directory[PATH_MAX_LENGTH];
char assets_directory[PATH_MAX_LENGTH];
char dynamic_wallpapers_directory[PATH_MAX_LENGTH];
char boxarts_directory[PATH_MAX_LENGTH];
char menu_config_directory[PATH_MAX_LENGTH];
#if defined(HAVE_MENU)
char menu_content_directory[PATH_MAX_LENGTH];
bool menu_show_start_screen;
#endif
bool fps_show;
@@ -398,6 +408,13 @@ typedef struct settings
unsigned int user_language;
bool config_save_on_exit;
#ifdef HAVE_SYSTEMD
bool ssh_enable;
bool samba_enable;
bool bluetooth_enable;
#endif
} settings_t;
/**
+69 -55
View File
@@ -40,18 +40,19 @@
#include <compat/posix_string.h>
#include <file/file_path.h>
#ifdef HAVE_COMPRESSION
#include <file/file_archive.h>
#include <file/archive_file.h>
#endif
#include <string/stdstring.h>
#include <retro_miscellaneous.h>
#include <retro_file.h>
#include <streams/file_stream.h>
#include <retro_stat.h>
#include <retro_assert.h>
#include <string/string_list.h>
#include <lists/string_list.h>
#include <string/stdstring.h>
#include "defaults.h"
#include "msg_hash.h"
#include "content.h"
#include "general.h"
@@ -61,6 +62,7 @@
#include "system.h"
#include "retroarch.h"
#include "command_event.h"
#include "file_path_special.h"
#include "libretro_version_1.h"
#include "verbosity.h"
@@ -229,7 +231,7 @@ static int content_7zip_file_read(
{
const void *ptr = (const void*)(output + offset);
if (!retro_write_file(optional_outfile, ptr, outsize))
if (!filestream_write_file(optional_outfile, ptr, outsize))
{
RARCH_ERR("Could not open outfilepath %s.\n",
optional_outfile);
@@ -488,7 +490,8 @@ static int content_zip_file_decompressed(
{
RARCH_LOG("Extracting file : %s\n", st->opt_file);
memcpy(buf, handle.data, size);
if (!retro_write_file(st->opt_file, buf, size))
if (!filestream_write_file(st->opt_file, buf, size))
goto_error = true;
}
@@ -641,7 +644,7 @@ error:
* @length : Number of items read, -1 on error.
*
* Read the contents of a file into @buf. Will call content_file_compressed_read
* if path contains a compressed file, otherwise will call retro_read_file().
* if path contains a compressed file, otherwise will call filestream_read_file().
*
* Returns: 1 if file read, 0 on error.
*/
@@ -654,7 +657,7 @@ static int content_file_read(const char *path, void **buf, ssize_t *length)
return 1;
}
#endif
return retro_read_file(path, buf, length);
return filestream_read_file(path, buf, length);
}
struct string_list *compressed_file_list_new(const char *path,
@@ -677,13 +680,22 @@ struct string_list *compressed_file_list_new(const char *path,
static void check_defaults_dir_create_dir(const char *path)
{
if (path_is_directory(path))
char new_path[PATH_MAX_LENGTH];
fill_pathname_expand_special(new_path,
path, sizeof(new_path));
if (path_is_directory(new_path))
return;
path_mkdir(path);
path_mkdir(new_path);
}
static void check_defaults_dirs(void)
static void check_default_dirs(void)
{
/* early return for people with a custom folder setup
so it doesn't create unnecessary directories
*/
if (path_file_exists("custom.ini"))
return;
if (*g_defaults.dir.core_assets)
check_defaults_dir_create_dir(g_defaults.dir.core_assets);
if (*g_defaults.dir.remap)
@@ -732,6 +744,8 @@ static void check_defaults_dirs(void)
check_defaults_dir_create_dir(g_defaults.dir.cursor);
if (*g_defaults.dir.cheats)
check_defaults_dir_create_dir(g_defaults.dir.cheats);
if (*g_defaults.dir.thumbnails)
check_defaults_dir_create_dir(g_defaults.dir.thumbnails);
}
void content_push_to_history_playlist(bool do_push,
@@ -751,7 +765,7 @@ void content_push_to_history_playlist(bool do_push,
content_playlist_push(g_defaults.history,
path,
NULL,
settings->libretro,
settings->path.libretro,
info->library_name,
NULL,
NULL);
@@ -884,7 +898,7 @@ static bool content_load(content_ctx_info_t *info)
event_cmd_ctl(EVENT_CMD_RESUME, NULL);
event_cmd_ctl(EVENT_CMD_VIDEO_SET_ASPECT_RATIO, NULL);
check_defaults_dirs();
check_default_dirs();
frontend_driver_process_args(rarch_argc_ptr, rarch_argv_ptr);
frontend_driver_content_loaded();
@@ -965,26 +979,22 @@ static bool dump_to_file_desperate(const void *data,
{
time_t time_;
char timebuf[256];
char application_data[PATH_MAX_LENGTH];
char path[PATH_MAX_LENGTH];
#if defined(_WIN32) && !defined(_XBOX)
const char *base = getenv("APPDATA");
#elif defined(__CELLOS_LV2__) || defined(_XBOX)
const char *base = NULL;
#else
const char *base = getenv("HOME");
#endif
if (!base)
if (!fill_pathname_application_data(application_data,
sizeof(application_data)))
return false;
snprintf(path, sizeof(path), "%s/RetroArch-recovery-%u", base, type);
snprintf(path, sizeof(path), "%s/RetroArch-recovery-%u",
application_data, type);
time(&time_);
strftime(timebuf, sizeof(timebuf), "%Y-%m-%d-%H-%M-%S", localtime(&time_));
strlcat(path, timebuf, sizeof(path));
if (!retro_write_file(path, data, size))
if (!filestream_write_file(path, data, size))
return false;
RARCH_WARN("Succeeded in saving RAM data to \"%s\".\n", path);
@@ -1031,7 +1041,7 @@ static bool content_save_state(const char *path)
ret = core_ctl(CORE_CTL_RETRO_SERIALIZE, &serial_info);
if (ret)
ret = retro_write_file(path, data, info.size);
ret = filestream_write_file(path, data, info.size);
else
{
RARCH_ERR("%s \"%s\".\n",
@@ -1062,7 +1072,7 @@ static bool content_load_state(const char *path)
struct sram_block *blocks = NULL;
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
bool ret = retro_read_file(path, &buf, &size);
bool ret = filestream_read_file(path, &buf, &size);
RARCH_LOG("%s: \"%s\".\n",
msg_hash_to_str(MSG_LOADING_STATE),
@@ -1188,7 +1198,7 @@ static bool load_ram_file(void *data)
if (mem_info.size == 0 || !mem_info.data)
return false;
if (!retro_read_file(ram->path, &buf, &rc))
if (!filestream_read_file(ram->path, &buf, &rc))
return false;
if (rc > 0)
@@ -1224,6 +1234,9 @@ static bool save_ram_file(ram_type_t *ram)
{
retro_ctx_memory_info_t mem_info;
if (!ram)
return false;
mem_info.id = ram->type;
core_ctl(CORE_CTL_RETRO_GET_MEMORY, &mem_info);
@@ -1231,7 +1244,7 @@ static bool save_ram_file(ram_type_t *ram)
if (!mem_info.data || mem_info.size == 0)
return false;
if (!retro_write_file(ram->path, mem_info.data, mem_info.size))
if (!filestream_write_file(ram->path, mem_info.data, mem_info.size))
{
RARCH_ERR("%s.\n",
msg_hash_to_str(MSG_FAILED_TO_SAVE_SRAM));
@@ -1311,7 +1324,7 @@ static bool load_content_from_compressed_archive(
RARCH_LOG("Compressed file in case of need_fullpath."
" Now extracting to temporary directory.\n");
strlcpy(new_basedir, settings->cache_directory,
strlcpy(new_basedir, settings->directory.cache,
sizeof(new_basedir));
if (string_is_empty(new_basedir) || !path_is_directory(new_basedir))
@@ -1527,8 +1540,8 @@ static bool init_content_file_extract(
if (!file_archive_extract_first_content_file(temp_content,
sizeof(temp_content), valid_ext,
*settings->cache_directory ?
settings->cache_directory : NULL,
*settings->directory.cache ?
settings->directory.cache : NULL,
new_path, sizeof(new_path)))
{
RARCH_ERR("Failed to extract content from zipped file: %s.\n",
@@ -1609,7 +1622,7 @@ static bool init_content_file_set_attribs(
*
* Returns : true if successful, otherwise false.
**/
static bool content_init_file(struct string_list *temporary_content)
static bool content_file_init(struct string_list *temporary_content)
{
unsigned i;
struct retro_game_info *info = NULL;
@@ -1658,9 +1671,31 @@ error:
return ret;
}
bool content_ctl(enum content_ctl_state state, void *data)
static bool content_file_free(struct string_list *temporary_content)
{
unsigned i;
if (!temporary_content)
return false;
for (i = 0; i < temporary_content->size; i++)
{
const char *path = temporary_content->elems[i].data;
RARCH_LOG("%s: %s.\n",
msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path);
if (remove(path) < 0)
RARCH_ERR("%s: %s.\n",
msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE),
path);
}
string_list_free(temporary_content);
return true;
}
bool content_ctl(enum content_ctl_state state, void *data)
{
static const struct file_archive_file_backend *stream_backend = NULL;
static struct string_list *temporary_content = NULL;
static bool content_is_inited = false;
@@ -1672,13 +1707,7 @@ bool content_ctl(enum content_ctl_state state, void *data)
case CONTENT_CTL_LOAD_RAM_FILE:
return load_ram_file(data);
case CONTENT_CTL_SAVE_RAM_FILE:
{
ram_type_t *ram = (ram_type_t*)data;
if (!ram)
return false;
save_ram_file(ram);
}
break;
return save_ram_file((ram_type_t*)data);
case CONTENT_CTL_DOES_NOT_NEED_CONTENT:
return core_does_not_need_content;
case CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT:
@@ -1722,7 +1751,7 @@ bool content_ctl(enum content_ctl_state state, void *data)
temporary_content = string_list_new();
if (!temporary_content)
return false;
if (content_init_file(temporary_content))
if (content_file_init(temporary_content))
{
content_is_inited = true;
return true;
@@ -1730,22 +1759,7 @@ bool content_ctl(enum content_ctl_state state, void *data)
content_ctl(CONTENT_CTL_DEINIT, NULL);
return false;
case CONTENT_CTL_TEMPORARY_FREE:
if (!temporary_content)
return false;
for (i = 0; i < temporary_content->size; i++)
{
const char *path = temporary_content->elems[i].data;
RARCH_LOG("%s: %s.\n",
msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path);
if (remove(path) < 0)
RARCH_ERR("%s: %s.\n",
msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE),
path);
}
string_list_free(temporary_content);
content_file_free(temporary_content);
temporary_content = NULL;
break;
case CONTENT_CTL_STREAM_INIT:
+6 -6
View File
@@ -16,15 +16,15 @@
*/
#include <file/file_path.h>
#include <file/dir_list.h>
#include <file/file_archive.h>
#include <lists/dir_list.h>
#include <file/archive_file.h>
#include <compat/strl.h>
#include <string/stdstring.h>
#include "core_info.h"
#include "configuration.h"
#include "dir_list_special.h"
#include "list_special.h"
#include "config.def.h"
#ifdef HAVE_CONFIG_H
@@ -181,8 +181,8 @@ static config_file_t *core_info_list_iterate(
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,
fill_pathname_join(info_path, (*settings->path.libretro_info) ?
settings->path.libretro_info : settings->directory.libretro,
info_path_base, sizeof(info_path));
return config_file_new(info_path);
@@ -702,7 +702,7 @@ bool core_info_ctl(enum core_info_state state, void *data)
return false;
return core_info_list_update_missing_firmware(core_info_curr_list,
info->path, info->system_directory);
info->path, info->directory.system);
}
case CORE_INFO_CTL_FIND:
{
+6 -1
View File
@@ -20,6 +20,8 @@
#include <stddef.h>
#include <lists/string_list.h>
#ifdef __cplusplus
extern "C" {
#endif
@@ -87,7 +89,10 @@ typedef struct
typedef struct core_info_ctx_firmware
{
const char *path;
const char *system_directory;
struct
{
const char *system;
} directory;
} core_info_ctx_firmware_t;
typedef struct core_info_ctx_find
+10 -23
View File
@@ -17,12 +17,15 @@
#include <string.h>
#include <file/config_file.h>
#include <file/dir_list.h>
#include <lists/dir_list.h>
#include <lists/string_list.h>
#include <compat/posix_string.h>
#include <compat/strl.h>
#include <retro_miscellaneous.h>
#include <string/stdstring.h>
#include "libretro.h"
#include "core_options.h"
struct core_option
@@ -77,9 +80,10 @@ void core_option_free(core_option_manager_t *opt)
free(opt);
}
void core_option_get(core_option_manager_t *opt, struct retro_variable *var)
void core_option_get(core_option_manager_t *opt, void *data)
{
size_t i;
struct retro_variable *var = (struct retro_variable*)data;
if (!opt)
return;
@@ -166,11 +170,12 @@ static bool parse_variable(core_option_manager_t *opt, size_t idx,
* Returns: handle to new core manager handle, otherwise NULL.
**/
core_option_manager_t *core_option_new(const char *conf_path,
const struct retro_variable *vars)
const void *data)
{
const struct retro_variable *var;
size_t size = 0;
core_option_manager_t *opt = (core_option_manager_t*)
const struct retro_variable *vars = (const struct retro_variable*)data;
size_t size = 0;
core_option_manager_t *opt = (core_option_manager_t*)
calloc(1, sizeof(*opt));
if (!opt)
@@ -324,24 +329,6 @@ const char *core_option_get_val(core_option_manager_t *opt, size_t idx)
return option->vals->elems[option->index].data;
}
/**
* core_option_get_vals:
* @opt : pointer to core option manager object.
* @idx : idx of core option.
*
* Gets list of core option values from core option at index @idx.
*
* Returns: string list of core option values if successful, otherwise
* NULL.
**/
struct string_list *core_option_get_vals(
core_option_manager_t *opt, size_t idx)
{
if (!opt)
return NULL;
return opt->opts[idx].vals;
}
void core_option_set_val(core_option_manager_t *opt,
size_t idx, size_t val_idx)
{
+2 -19
View File
@@ -20,9 +20,6 @@
#include <stddef.h>
#include <boolean.h>
#include <string/string_list.h>
#include "libretro.h"
#ifdef __cplusplus
extern "C" {
@@ -40,7 +37,7 @@ typedef struct core_option_manager core_option_manager_t;
* Returns: handle to new core manager handle, otherwise NULL.
**/
core_option_manager_t *core_option_new(const char *conf_path,
const struct retro_variable *vars);
const void *data);
/**
* core_option_updated:
@@ -85,8 +82,7 @@ bool core_option_flush_game_specific(
**/
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, void *data);
/**
* core_option_size:
@@ -122,19 +118,6 @@ const char *core_option_get_desc(core_option_manager_t *opt,
const char *core_option_get_val(core_option_manager_t *opt,
size_t idx);
/**
* core_option_get_vals:
* @opt : pointer to core option manager object.
* @idx : idx of core option.
*
* Gets list of core option values from core option at index @idx.
*
* Returns: string list of core option values if successful, otherwise
* NULL.
**/
struct string_list *core_option_get_vals(
core_option_manager_t *opt, size_t idx);
void core_option_set_val(core_option_manager_t *opt,
size_t idx, size_t val_idx);
+27
View File
@@ -0,0 +1,27 @@
/* RetroArch - A frontend for libretro.
* 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.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __CORE_TYPE_H
#define __CORE_TYPE_H
enum rarch_core_type
{
CORE_TYPE_PLAIN = 0,
CORE_TYPE_DUMMY,
CORE_TYPE_FFMPEG,
CORE_TYPE_IMAGEVIEWER
};
#endif
+4 -3
View File
@@ -18,6 +18,7 @@ extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
#include <libavutil/imgutils.h>
#include <libavutil/time.h>
#include <libavutil/opt.h>
#include <libavdevice/avdevice.h>
@@ -39,7 +40,7 @@ extern "C" {
#endif
#include <rthreads/rthreads.h>
#include <queues/fifo_buffer.h>
#include <queues/fifo_queue.h>
#include "libretro.h"
#ifdef RARCH_INTERNAL
@@ -899,7 +900,7 @@ static bool init_media_info(void)
#ifdef HAVE_SSA
if (sctx[0])
{
size_t i;
unsigned i;
ass = ass_library_init();
ass_set_message_cb(ass, ass_msg_cb, NULL);
@@ -914,7 +915,7 @@ static bool init_media_info(void)
ass_set_fonts(ass_render, NULL, NULL, 1, NULL, 1);
ass_set_hinting(ass_render, ASS_HINTING_LIGHT);
for (i = 0; i < subtitle_streams_num; i++)
for (i = 0; i < (unsigned)subtitle_streams_num; i++)
{
ass_track[i] = ass_new_track(ass);
ass_process_codec_private(ass_track[i], (char*)ass_extra_data[i],
+1 -1
View File
@@ -5,7 +5,7 @@
#include <assert.h>
#include <boolean.h>
#include <file/dir_list.h>
#include <lists/dir_list.h>
#include <file/file_path.h>
#include <compat/strl.h>
+1 -4
View File
@@ -30,12 +30,10 @@ 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
@@ -48,12 +46,11 @@ 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)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LIBS) -lm
%.o: %.c
$(CC) -I../../libretro-common/include $(CFLAGS) -c -o $@ $<
+362 -62
View File
@@ -4,7 +4,6 @@
#include <string.h>
#include <math.h>
#define VK_PROTOTYPES
#include "../../libretro_vulkan.h"
#include "shaders/triangle.vert.inc"
#include "shaders/triangle.frag.inc"
@@ -17,6 +16,294 @@ static const struct retro_hw_render_interface_vulkan *vulkan;
#define BASE_HEIGHT 240
#define MAX_SYNC 8
/* We'll probably want a libretro common solution for this, but this will do for now. */
#define VK_GET_DEVICE_PROC_ADDR(entrypoint) do { \
vkcfp.vk##entrypoint = (PFN_vk##entrypoint) vulkan->get_device_proc_addr(vulkan->device, \
"vk" #entrypoint); \
} while(0)
#define VK_GET_INSTANCE_PROC_ADDR(entrypoint) do { \
vkcfp.vk##entrypoint = (PFN_vk##entrypoint) vulkan->get_instance_proc_addr(vulkan->instance, \
"vk" #entrypoint); \
} while(0)
typedef struct vulkan_context_fp
{
/* Device */
PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
/* Device Memory */
PFN_vkAllocateMemory vkAllocateMemory;
PFN_vkFreeMemory vkFreeMemory;
/* Command Function Pointers */
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
/* Buffers */
PFN_vkCreateBuffer vkCreateBuffer;
PFN_vkDestroyBuffer vkDestroyBuffer;
/* Fences */
PFN_vkCreateFence vkCreateFence;
PFN_vkDestroyFence vkDestroyFence;
PFN_vkResetFences vkResetFences;
PFN_vkWaitForFences vkWaitForFences;
/* Semaphores */
PFN_vkCreateSemaphore vkCreateSemaphore;
PFN_vkDestroySemaphore vkDestroySemaphore;
/* Images */
PFN_vkCreateImage vkCreateImage;
PFN_vkDestroyImage vkDestroyImage;
PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
/* Images (Resource Memory Association) */
PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
PFN_vkBindBufferMemory vkBindBufferMemory;
PFN_vkBindImageMemory vkBindImageMemory;
/* Image Views */
PFN_vkCreateImageView vkCreateImageView;
PFN_vkDestroyImageView vkDestroyImageView;
/* Image Views (Resource Memory Association) */
PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
/* Queues */
PFN_vkGetDeviceQueue vkGetDeviceQueue;
PFN_vkQueueWaitIdle vkQueueWaitIdle;
/* Pipelines */
PFN_vkDestroyPipeline vkDestroyPipeline;
PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
/* Pipeline Layouts */
PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
/* Pipeline Cache */
PFN_vkCreatePipelineCache vkCreatePipelineCache;
PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
/* Pipeline Barriers */
PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
/* Descriptor pools */
PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
/* Descriptor sets */
PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
PFN_vkFreeDescriptorSets vkFreeDescriptorSets;
PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
/* Descriptor Set Layout */
PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
/* Command Buffers */
PFN_vkCreateCommandPool vkCreateCommandPool;
PFN_vkDestroyCommandPool vkDestroyCommandPool;
PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
PFN_vkEndCommandBuffer vkEndCommandBuffer;
PFN_vkResetCommandBuffer vkResetCommandBuffer;
PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
/* Command Buffer Submission */
PFN_vkQueueSubmit vkQueueSubmit;
/* Framebuffers */
PFN_vkCreateFramebuffer vkCreateFramebuffer;
PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
/* Memory allocation */
PFN_vkMapMemory vkMapMemory;
PFN_vkUnmapMemory vkUnmapMemory;
/* Samplers */
PFN_vkCreateSampler vkCreateSampler;
PFN_vkDestroySampler vkDestroySampler;
/* Render Passes */
PFN_vkCreateRenderPass vkCreateRenderPass;
PFN_vkDestroyRenderPass vkDestroyRenderPass;
/* Image commands */
PFN_vkCmdCopyImage vkCmdCopyImage;
PFN_vkCmdClearColorImage vkCmdClearColorImage;
/* Pipeline commands */
PFN_vkCmdBindPipeline vkCmdBindPipeline;
/* Vertex input descriptions */
PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
/* Render Pass commands */
PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
/* Clear commands */
PFN_vkCmdClearAttachments vkCmdClearAttachments;
/* Drawing commands */
PFN_vkCmdDraw vkCmdDraw;
/* Fragment operations */
PFN_vkCmdSetScissor vkCmdSetScissor;
/* Fixed-function vertex postprocessing */
PFN_vkCmdSetViewport vkCmdSetViewport;
/* Shaders */
PFN_vkCreateShaderModule vkCreateShaderModule;
PFN_vkDestroyShaderModule vkDestroyShaderModule;
PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
} vulkan_context_fp_t;
static vulkan_context_fp_t vkcfp;
#define VKFUNC(sym) (vkcfp.sym)
static void load_device_symbols(void)
{
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceProperties);
VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceMemoryProperties);
/* Memory */
VK_GET_DEVICE_PROC_ADDR(AllocateMemory);
VK_GET_DEVICE_PROC_ADDR(FreeMemory);
/* Waiting */
VK_GET_DEVICE_PROC_ADDR(DeviceWaitIdle);
/* Queues */
VK_GET_DEVICE_PROC_ADDR(GetDeviceQueue);
VK_GET_DEVICE_PROC_ADDR(QueueWaitIdle);
VK_GET_DEVICE_PROC_ADDR(QueueSubmit);
/* Semaphores */
VK_GET_DEVICE_PROC_ADDR(CreateSemaphore);
VK_GET_DEVICE_PROC_ADDR(DestroySemaphore);
/* Buffers */
VK_GET_DEVICE_PROC_ADDR(CreateBuffer);
VK_GET_DEVICE_PROC_ADDR(DestroyBuffer);
/* Fences */
VK_GET_DEVICE_PROC_ADDR(CreateFence);
VK_GET_DEVICE_PROC_ADDR(DestroyFence);
VK_GET_DEVICE_PROC_ADDR(ResetFences);
VK_GET_DEVICE_PROC_ADDR(WaitForFences);
/* Images */
VK_GET_DEVICE_PROC_ADDR(CreateImage);
VK_GET_DEVICE_PROC_ADDR(DestroyImage);
VK_GET_DEVICE_PROC_ADDR(GetImageSubresourceLayout);
/* Images (Resource Memory Association) */
VK_GET_DEVICE_PROC_ADDR(GetBufferMemoryRequirements);
VK_GET_DEVICE_PROC_ADDR(BindBufferMemory);
VK_GET_DEVICE_PROC_ADDR(BindImageMemory);
/* Image Views */
VK_GET_DEVICE_PROC_ADDR(CreateImageView);
VK_GET_DEVICE_PROC_ADDR(DestroyImageView);
/* Resource Memory Associations */
VK_GET_DEVICE_PROC_ADDR(GetImageMemoryRequirements);
/* Descriptor pools */
VK_GET_DEVICE_PROC_ADDR(CreateDescriptorPool);
VK_GET_DEVICE_PROC_ADDR(DestroyDescriptorPool);
/* Descriptor sets */
VK_GET_DEVICE_PROC_ADDR(AllocateDescriptorSets);
VK_GET_DEVICE_PROC_ADDR(FreeDescriptorSets);
VK_GET_DEVICE_PROC_ADDR(UpdateDescriptorSets);
/* Descriptor Set Layout */
VK_GET_DEVICE_PROC_ADDR(CreateDescriptorSetLayout);
VK_GET_DEVICE_PROC_ADDR(DestroyDescriptorSetLayout);
/* Framebuffers */
VK_GET_DEVICE_PROC_ADDR(CreateFramebuffer);
VK_GET_DEVICE_PROC_ADDR(DestroyFramebuffer);
VK_GET_DEVICE_PROC_ADDR(AllocateCommandBuffers);
VK_GET_DEVICE_PROC_ADDR(FreeCommandBuffers);
/* Memory allocation */
VK_GET_DEVICE_PROC_ADDR(MapMemory);
VK_GET_DEVICE_PROC_ADDR(UnmapMemory);
/* Render Passes */
VK_GET_DEVICE_PROC_ADDR(CreateRenderPass);
VK_GET_DEVICE_PROC_ADDR(DestroyRenderPass);
/* Pipelines */
VK_GET_DEVICE_PROC_ADDR(DestroyPipeline);
VK_GET_DEVICE_PROC_ADDR(CreateGraphicsPipelines);
/* Shaders */
VK_GET_DEVICE_PROC_ADDR(CreateShaderModule);
VK_GET_DEVICE_PROC_ADDR(DestroyShaderModule);
/* Pipeline Layouts */
VK_GET_DEVICE_PROC_ADDR(CreatePipelineLayout);
VK_GET_DEVICE_PROC_ADDR(DestroyPipelineLayout);
/* Pipeline Cache */
VK_GET_DEVICE_PROC_ADDR(CreatePipelineCache);
VK_GET_DEVICE_PROC_ADDR(DestroyPipelineCache);
/* Command buffers */
VK_GET_DEVICE_PROC_ADDR(CreateCommandPool);
VK_GET_DEVICE_PROC_ADDR(DestroyCommandPool);
VK_GET_DEVICE_PROC_ADDR(BeginCommandBuffer);
VK_GET_DEVICE_PROC_ADDR(ResetCommandBuffer);
VK_GET_DEVICE_PROC_ADDR(EndCommandBuffer);
/* Image commands */
VK_GET_DEVICE_PROC_ADDR(CmdCopyImage);
VK_GET_DEVICE_PROC_ADDR(CmdClearColorImage);
/* Vertex input descriptions */
VK_GET_DEVICE_PROC_ADDR(CmdBindVertexBuffers);
/* Descriptor Set commands */
VK_GET_DEVICE_PROC_ADDR(CmdBindDescriptorSets);
/* Fragment operations */
VK_GET_DEVICE_PROC_ADDR(CmdSetScissor);
/* Render Pass commands */
VK_GET_DEVICE_PROC_ADDR(CmdBeginRenderPass);
VK_GET_DEVICE_PROC_ADDR(CmdEndRenderPass);
/* Samplers */
VK_GET_DEVICE_PROC_ADDR(CreateSampler);
VK_GET_DEVICE_PROC_ADDR(DestroySampler);
/* Fixed-function vertex postprocessing */
VK_GET_DEVICE_PROC_ADDR(CmdSetViewport);
/* Clear commands */
VK_GET_DEVICE_PROC_ADDR(CmdClearAttachments);
/* Pipeline */
VK_GET_DEVICE_PROC_ADDR(CmdBindPipeline);
/* Pipeline Barriers */
VK_GET_DEVICE_PROC_ADDR(CmdPipelineBarrier);
/* Drawing commands */
VK_GET_DEVICE_PROC_ADDR(CmdDraw);
}
struct buffer
{
VkBuffer buffer;
@@ -167,10 +454,10 @@ static void update_ubo(void)
tmp[15] = 1.0f;
float *mvp = NULL;
vkMapMemory(vulkan->device, vk.ubo[vk.index].memory,
VKFUNC(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);
VKFUNC(vkUnmapMemory)(vulkan->device, vk.ubo[vk.index].memory);
}
static void vulkan_test_render(void)
@@ -181,12 +468,12 @@ static void vulkan_test_render(void)
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);
VKFUNC(vkResetCommandBuffer)(cmd, 0);
VKFUNC(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.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT;
prepare_rendering.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
prepare_rendering.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
prepare_rendering.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
@@ -195,7 +482,7 @@ static void vulkan_test_render(void)
prepare_rendering.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
prepare_rendering.subresourceRange.levelCount = 1;
prepare_rendering.subresourceRange.layerCount = 1;
vkCmdPipelineBarrier(cmd,
VKFUNC(vkCmdPipelineBarrier)(cmd,
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
false,
0, NULL,
@@ -215,10 +502,10 @@ static void vulkan_test_render(void)
rp_begin.renderArea.extent.height = BASE_HEIGHT;
rp_begin.clearValueCount = 1;
rp_begin.pClearValues = &clear_value;
vkCmdBeginRenderPass(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
VKFUNC(vkCmdBeginRenderPass)(cmd, &rp_begin, VK_SUBPASS_CONTENTS_INLINE);
vkCmdBindPipeline(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
VKFUNC(vkCmdBindPipeline)(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, vk.pipeline);
VKFUNC(vkCmdBindDescriptorSets)(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS,
vk.pipeline_layout, 0,
1, &vk.desc_set[vk.index], 0, NULL);
@@ -229,20 +516,20 @@ static void vulkan_test_render(void)
vp.height = BASE_HEIGHT;
vp.minDepth = 0.0f;
vp.maxDepth = 1.0f;
vkCmdSetViewport(cmd, 0, 1, &vp);
VKFUNC(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);
VKFUNC(vkCmdSetScissor)(cmd, 0, 1, &scissor);
VkDeviceSize offset = 0;
vkCmdBindVertexBuffers(cmd, 0, 1, &vk.vbo.buffer, &offset);
VKFUNC(vkCmdBindVertexBuffers)(cmd, 0, 1, &vk.vbo.buffer, &offset);
vkCmdDraw(cmd, 3, 1, 0, 0);
VKFUNC(vkCmdDraw)(cmd, 3, 1, 0, 0);
vkCmdEndRenderPass(cmd);
VKFUNC(vkCmdEndRenderPass)(cmd);
VkImageMemoryBarrier prepare_presentation = { VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER };
prepare_presentation.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
@@ -256,14 +543,14 @@ static void vulkan_test_render(void)
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,
VKFUNC(vkCmdPipelineBarrier)(cmd, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
false,
0, NULL,
0, NULL,
1, &prepare_presentation);
vkEndCommandBuffer(cmd);
VKFUNC(vkEndCommandBuffer)(cmd);
}
static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsageFlags usage)
@@ -275,10 +562,10 @@ static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsa
info.usage = usage;
info.size = size;
vkCreateBuffer(device, &info, NULL, &buffer.buffer);
VKFUNC(vkCreateBuffer)(device, &info, NULL, &buffer.buffer);
VkMemoryRequirements mem_reqs;
vkGetBufferMemoryRequirements(device, buffer.buffer, &mem_reqs);
VKFUNC(vkGetBufferMemoryRequirements)(device, buffer.buffer, &mem_reqs);
VkMemoryAllocateInfo alloc = { VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO };
alloc.allocationSize = mem_reqs.size;
@@ -286,15 +573,15 @@ static struct buffer create_buffer(const void *initial, size_t size, VkBufferUsa
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);
VKFUNC(vkAllocateMemory)(device, &alloc, NULL, &buffer.memory);
VKFUNC(vkBindBufferMemory)(device, buffer.buffer, buffer.memory, 0);
if (initial)
{
void *ptr;
vkMapMemory(device, buffer.memory, 0, size, 0, &ptr);
VKFUNC(vkMapMemory)(device, buffer.memory, 0, size, 0, &ptr);
memcpy(ptr, initial, size);
vkUnmapMemory(device, buffer.memory);
VKFUNC(vkUnmapMemory)(device, buffer.memory);
}
return buffer;
@@ -326,7 +613,7 @@ static VkShaderModule create_shader_module(const uint8_t *data, size_t size)
VkShaderModule module;
module_info.codeSize = size;
module_info.pCode = (const uint32_t*)data;
vkCreateShaderModule(vulkan->device, &module_info, NULL, &module);
VKFUNC(vkCreateShaderModule)(vulkan->device, &module_info, NULL, &module);
return module;
}
@@ -348,19 +635,19 @@ static void init_descriptor(void)
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);
VKFUNC(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);
VKFUNC(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);
VKFUNC(vkCreateDescriptorPool)(device, &pool_info, NULL, &vk.desc_pool);
VkDescriptorSetAllocateInfo alloc_info = { VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO };
alloc_info.descriptorPool = vk.desc_pool;
@@ -368,7 +655,7 @@ static void init_descriptor(void)
alloc_info.pSetLayouts = &vk.set_layout;
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vkAllocateDescriptorSets(device, &alloc_info, &vk.desc_set[i]);
VKFUNC(vkAllocateDescriptorSets)(device, &alloc_info, &vk.desc_set[i]);
VkWriteDescriptorSet write = { VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET };
VkDescriptorBufferInfo buffer_info;
@@ -383,7 +670,7 @@ static void init_descriptor(void)
buffer_info.offset = 0;
buffer_info.range = 16 * sizeof(float);
vkUpdateDescriptorSets(device, 1, &write, 0, NULL);
VKFUNC(vkUpdateDescriptorSets)(device, 1, &write, 0, NULL);
}
}
@@ -479,10 +766,10 @@ static void init_pipeline(void)
pipe.renderPass = vk.render_pass;
pipe.layout = vk.pipeline_layout;
vkCreateGraphicsPipelines(vulkan->device, vk.pipeline_cache, 1, &pipe, NULL, &vk.pipeline);
VKFUNC(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);
VKFUNC(vkDestroyShaderModule)(device, shader_stages[0].module, NULL);
VKFUNC(vkDestroyShaderModule)(device, shader_stages[1].module, NULL);
}
static void init_render_pass(VkFormat format)
@@ -509,7 +796,7 @@ static void init_render_pass(VkFormat format)
rp_info.pAttachments = &attachment;
rp_info.subpassCount = 1;
rp_info.pSubpasses = &subpass;
vkCreateRenderPass(vulkan->device, &rp_info, NULL, &vk.render_pass);
VKFUNC(vkCreateRenderPass)(vulkan->device, &rp_info, NULL, &vk.render_pass);
}
static void init_swapchain(void)
@@ -536,17 +823,17 @@ static void init_swapchain(void)
image.mipLevels = 1;
image.arrayLayers = 1;
vkCreateImage(device, &image, NULL, &vk.images[i].create_info.image);
VKFUNC(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);
VKFUNC(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);
VKFUNC(vkAllocateMemory)(device, &alloc, NULL, &vk.image_memory[i]);
VKFUNC(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;
@@ -561,7 +848,7 @@ static void init_swapchain(void)
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,
VKFUNC(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;
@@ -573,7 +860,7 @@ static void init_swapchain(void)
fb_info.height = BASE_HEIGHT;
fb_info.layers = 1;
vkCreateFramebuffer(device, &fb_info, NULL, &vk.framebuffers[i]);
VKFUNC(vkCreateFramebuffer)(device, &fb_info, NULL, &vk.framebuffers[i]);
}
}
@@ -587,18 +874,18 @@ static void init_command(void)
for (unsigned i = 0; i < vk.num_swapchain_images; i++)
{
vkCreateCommandPool(vulkan->device, &pool_info, NULL, &vk.cmd_pool[i]);
VKFUNC(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]);
VKFUNC(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);
VKFUNC(vkGetPhysicalDeviceProperties)(vulkan->gpu, &vk.gpu_properties);
VKFUNC(vkGetPhysicalDeviceMemoryProperties)(vulkan->gpu, &vk.memory_properties);
unsigned num_images = 0;
uint32_t mask = vulkan->get_sync_index_mask(vulkan->handle);
@@ -614,7 +901,7 @@ static void vulkan_test_init(void)
init_descriptor();
VkPipelineCacheCreateInfo pipeline_cache_info = { VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO };
vkCreatePipelineCache(vulkan->device, &pipeline_cache_info,
VKFUNC(vkCreatePipelineCache)(vulkan->device, &pipeline_cache_info,
NULL, &vk.pipeline_cache);
init_render_pass(VK_FORMAT_R8G8B8A8_UNORM);
@@ -624,35 +911,38 @@ static void vulkan_test_init(void)
static void vulkan_test_deinit(void)
{
if (!vulkan)
return;
VkDevice device = vulkan->device;
vkDeviceWaitIdle(device);
VKFUNC(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);
VKFUNC(vkDestroyFramebuffer)(device, vk.framebuffers[i], NULL);
VKFUNC(vkDestroyImageView)(device, vk.images[i].image_view, NULL);
VKFUNC(vkFreeMemory)(device, vk.image_memory[i], NULL);
VKFUNC(vkDestroyImage)(device, vk.images[i].create_info.image, NULL);
vkFreeMemory(device, vk.ubo[i].memory, NULL);
vkDestroyBuffer(device, vk.ubo[i].buffer, NULL);
VKFUNC(vkFreeMemory)(device, vk.ubo[i].memory, NULL);
VKFUNC(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);
VKFUNC(vkFreeDescriptorSets)(device, vk.desc_pool, vk.num_swapchain_images, vk.desc_set);
VKFUNC(vkDestroyDescriptorPool)(device, vk.desc_pool, NULL);
vkDestroyRenderPass(device, vk.render_pass, NULL);
vkDestroyPipeline(device, vk.pipeline, NULL);
vkDestroyPipelineLayout(device, vk.pipeline_layout, NULL);
VKFUNC(vkDestroyRenderPass)(device, vk.render_pass, NULL);
VKFUNC(vkDestroyPipeline)(device, vk.pipeline, NULL);
VKFUNC(vkDestroyPipelineLayout)(device, vk.pipeline_layout, NULL);
vkFreeMemory(device, vk.vbo.memory, NULL);
vkDestroyBuffer(device, vk.vbo.buffer, NULL);
vkDestroyPipelineCache(device, vk.pipeline_cache, NULL);
VKFUNC(vkFreeMemory)(device, vk.vbo.memory, NULL);
VKFUNC(vkDestroyBuffer)(device, vk.vbo.buffer, NULL);
VKFUNC(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);
VKFUNC(vkFreeCommandBuffers)(device, vk.cmd_pool[i], 1, &vk.cmd[i]);
VKFUNC(vkDestroyCommandPool)(device, vk.cmd_pool[i], NULL);
}
memset(&vk, 0, sizeof(vk));
@@ -690,6 +980,16 @@ static void context_reset(void)
fprintf(stderr, "Failed to get HW rendering interface!\n");
return;
}
if (vulkan->interface_version != RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION)
{
fprintf(stderr, "HW render interface mismatch, expected %u, got %u!\n",
RETRO_HW_RENDER_INTERFACE_VULKAN_VERSION, vulkan->interface_version);
vulkan = NULL;
return;
}
load_device_symbols();
vulkan_test_init();
}
@@ -704,7 +1004,7 @@ static void context_destroy(void)
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_major = VK_MAKE_VERSION(1, 0, 6);
hw_render.version_minor = 0;
hw_render.context_reset = context_reset;
hw_render.context_destroy = context_destroy;
+146
View File
@@ -0,0 +1,146 @@
STATIC_LINKING := 0
AR := ar
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
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 := retropad
LIBM = -lm
ifeq ($(ARCHFLAGS),)
ifeq ($(archs),ppc)
ARCHFLAGS = -arch ppc -arch ppc64
else
ARCHFLAGS = -arch i386 -arch x86_64
endif
endif
ifeq ($(platform), osx)
ifndef ($(NOUNIVERSAL))
CFLAGS += $(ARCHFLAGS)
LFLAGS += $(ARCHFLAGS)
endif
endif
ifeq ($(STATIC_LINKING), 1)
EXT := a
endif
ifeq ($(platform), unix)
EXT ?= so
TARGET := $(TARGET_NAME)_libretro.$(EXT)
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
else ifeq ($(platform), linux-portable)
TARGET := $(TARGET_NAME)_libretro.$(EXT)
fpic := -fPIC -nostdlib
SHARED := -shared -Wl,--version-script=link.T
LIBM :=
else ifneq (,$(findstring osx,$(platform)))
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
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
DEFINES := -DIOS
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 -Wl,--no-undefined
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_emscripten.bc
fpic := -fPIC
SHARED := -shared -Wl,--version-script=link.T -Wl,--no-undefined
else ifeq ($(platform), vita)
TARGET := $(TARGET_NAME)_vita.a
CC = arm-vita-eabi-gcc
AR = arm-vita-eabi-ar
CFLAGS += -Wl,-q -Wall -O3
STATIC_LINKING = 1
else
CC = gcc
TARGET := $(TARGET_NAME)_libretro.dll
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=link.T -Wl,--no-undefined
endif
LDFLAGS += $(LIBM)
ifeq ($(platform), win)
LDFLAGS += -lws2_32
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
endif
OBJECTS := ../../libretro-common/net/net_compat.o ../../libretro-common/net/net_socket.o retropad.o
CFLAGS += -I../../libretro-common/include -Wall -pedantic $(fpic)
ifneq (,$(findstring qnx,$(platform)))
CFLAGS += -Wc,-std=c99
else
CFLAGS += -std=gnu99
endif
CFLAGS += -I../../libretro-common/include
all: $(TARGET)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS)
endif
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: clean
+25
View File
@@ -0,0 +1,25 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
APP_DIR := ../../src
LOCAL_MODULE := retro
ifeq ($(TARGET_ARCH),arm)
LOCAL_CFLAGS += -DANDROID_ARM
endif
ifeq ($(TARGET_ARCH),x86)
LOCAL_CFLAGS += -DANDROID_X86
endif
ifeq ($(TARGET_ARCH),mips)
LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__
endif
LOCAL_SRC_FILES += ../libretro-test.c
LOCAL_CFLAGS += -O3 -std=gnu99 -ffast-math -funroll-loops
include $(BUILD_SHARED_LIBRARY)
+1
View File
@@ -0,0 +1 @@
APP_ABI := all
+5
View File
@@ -0,0 +1,5 @@
{
global: retro_*;
local: *;
};
+327
View File
@@ -0,0 +1,327 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2015 - Daniel De Matteis
* Copyright (C) 2016 - Andrés Suárez
*
* 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/>.
*/
/*
* To-do:
* - Analog support
* - Some sort of connection control, it only sends packets
* but there is no acknoledgement of a connection o keepalives
* - Send player name
* - Render something on-screen maybe a gui to configure IP and port
instead of the ridiculously long strings we're using now
* - Allow changing IP address and port in runtime
* - Support other platforms
* - Input recording / Combos
*/
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <math.h>
#include <net/net_compat.h>
#include <net/net_socket.h>
#include <retro_miscellaneous.h>
#include "../../libretro.h"
#ifndef SOCKET_ERROR
#define SOCKET_ERROR -1
#endif
struct retro_log_callback logger;
retro_log_printf_t log_cb;
static uint16_t *frame_buf;
struct sockaddr_in si_other;
int s, slen=sizeof(si_other);
char message[64];
char server[64];
int port;
int input_state = 0;
void retro_init(void)
{
frame_buf = (uint16_t*)calloc(320 * 240, sizeof(uint16_t));
log_cb(RETRO_LOG_INFO, "Initialising sockets...\n");
network_init();
}
void retro_deinit(void)
{
if (frame_buf)
free(frame_buf);
frame_buf = NULL;
}
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 = "RetroPad Remote";
info->library_version = "0.01";
info->need_fullpath = false;
info->valid_extensions = ""; /* Nothing. */
}
void retro_get_system_av_info(
struct retro_system_av_info *info)
{
info->timing.fps = 60.0;
info->timing.sample_rate = 30000.0;
info->geometry.base_width = 320;
info->geometry.base_height = 240;
info->geometry.max_width = 320;
info->geometry.max_height = 240;
info->geometry.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 update_input()
{
input_state = 0;
input_poll_cb();
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B))
input_state += 1;
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A))
input_state += 2;
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT))
input_state += pow(2, 2);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START))
input_state += pow(2, 3);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP))
input_state += pow(2, 4);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN))
input_state += pow(2, 5);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT))
input_state += pow(2, 6);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT))
input_state += pow(2, 7);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y))
input_state += pow(2, 8);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X))
input_state += pow(2, 9);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L))
input_state += pow(2, 10);
if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R))
input_state += pow(2, 11);
}
void retro_set_environment(retro_environment_t cb)
{
static const struct retro_variable vars[] = {
{ "port", "Port; 55400|55401|55402|55403|55404|55405|55406|55407|55408|55409|55410|55411|55412|55413|55414|55415|55416|55417|55418|55419|55420" },
{ "ip_octet1", "IP address part 1; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
{ "ip_octet2", "IP address part 2; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
{ "ip_octet3", "IP address part 3; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
{ "ip_octet4", "IP address part 4; 0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|35|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|135|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|235|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255" },
{ NULL, NULL },
};
cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
environ_cb = cb;
bool no_content = true;
cb(RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME, &no_content);
environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt);
if (cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &logger))
log_cb = logger.log;
}
static void check_variables(void)
{
struct retro_variable var, var2, var3, var4, port_var;
var.key = "ip_octet1";
var2.key = "ip_octet2";
var3.key = "ip_octet3";
var4.key = "ip_octet4";
port_var.key = "port";
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var);
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var2);
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var3);
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var4);
environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &port_var);
snprintf(server, sizeof(server), "%s.%s.%s.%s", var.value, var2.value, var3.value, var4.value);
port = atoi(port_var.value);
}
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;
}
void retro_reset(void)
{}
void retro_run(void)
{
unsigned i;
update_input();
snprintf(message, sizeof(message), "%d", input_state);
/* send the message */
if (sendto(s, message, strlen(message) , 0 , (struct sockaddr *) &si_other, slen)==-1)
log_cb(RETRO_LOG_INFO, "Error sending data\n");
for (i = 0; i < 320 * 240; i++)
frame_buf[i] = 4 << 5;
video_cb(frame_buf, 320, 240, 640);
}
bool retro_load_game(const struct retro_game_info *info)
{
(void)info;
check_variables();
s = socket_create(
"retropad",
SOCKET_DOMAIN_INET,
SOCKET_TYPE_DATAGRAM,
SOCKET_PROTOCOL_UDP);
if (s == SOCKET_ERROR)
log_cb(RETRO_LOG_INFO, "socket failed");
/* setup address structure */
memset((char *) &si_other, 0, sizeof(si_other));
si_other.sin_family = AF_INET;
si_other.sin_port = htons(port);
#if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY)
si_other.sin_addr.S_un.S_addr = inet_addr(server);
#else
si_other.sin_addr.s_addr = inet_addr(server);
inet_aton(server , &si_other.sin_addr);
#endif
log_cb(RETRO_LOG_INFO, "Server IP Address: %s\n" , server);
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_cheat_reset(void)
{}
void retro_cheat_set(unsigned idx,
bool enabled, const char *code)
{
(void)idx;
(void)enabled;
(void)code;
}
+4 -97
View File
@@ -1,278 +1,185 @@
ifeq ($(LIBRETRO), gambatte)
APP_TITLE = Gambatte Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-GAMBATTE
APP_UNIQUE_ID = 0xBAC01
APP_ICON = ctr/assets/gambatte.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), gpsp)
APP_TITLE = gpSP Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-GPSP
APP_UNIQUE_ID = 0xBAC02
APP_ICON = ctr/assets/gpsp.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_USE_SVCHAX = 1
else ifeq ($(LIBRETRO), fceumm)
APP_TITLE = FCeumm Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-FCEUMM
APP_UNIQUE_ID = 0xBAC03
APP_ICON = ctr/assets/fceumm.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), nestopia)
APP_TITLE = Nestopia Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-NESTOPIA
APP_UNIQUE_ID = 0xBAC04
APP_ICON = ctr/assets/nestopia.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), nxengine)
APP_TITLE = NXengine Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-NXENGINE
APP_UNIQUE_ID = 0xBAC05
APP_ICON = ctr/assets/nxengine.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), genesis_plus_gx)
APP_TITLE = Genesis Plus GX Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-GENPLUSGX
APP_UNIQUE_ID = 0xBAC06
APP_ICON = ctr/assets/genesis_plus_gx.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), catsfc)
APP_TITLE = CATSFC Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-CATSFC
APP_UNIQUE_ID = 0xBAC07
APP_ICON = ctr/assets/catsfc.png
APP_BANNER = ctr/assets/catsfc_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), mednafen_wswan)
APP_TITLE = Mednafen wswan Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-M-WSWAN
APP_UNIQUE_ID = 0xBAC08
APP_ICON = ctr/assets/mednafen_wswan.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), mednafen_vb)
APP_TITLE = Mednafen VB Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-M-VB
APP_UNIQUE_ID = 0xBAC09
APP_ICON = ctr/assets/mednafen_vb.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), mednafen_ngp)
APP_TITLE = Mednafen NGP Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-M-NGP
APP_UNIQUE_ID = 0xBAC0A
APP_ICON = ctr/assets/mednafen_ngp.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), 2048)
APP_TITLE = 2048 Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-2048
APP_UNIQUE_ID = 0xBAC0B
APP_ICON = ctr/assets/2048.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), picodrive)
APP_TITLE = Picodrive Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-PICODRIVE
APP_UNIQUE_ID = 0xBAC0C
APP_ICON = ctr/assets/picodrive.png
APP_BANNER = ctr/assets/picodrive_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_USE_SVCHAX = 1
else ifeq ($(LIBRETRO), snes9x_next)
APP_TITLE = Snes9x Next Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-SNES9XNEXT
APP_UNIQUE_ID = 0xBAC0D
APP_ICON = ctr/assets/snes9x_next.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), mgba)
APP_TITLE = mGBA Libretro
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Jeffrey Pfau
APP_PRODUCT_CODE = RARCH-MGBA
APP_UNIQUE_ID = 0xBAC0E
APP_ICON = ctr/assets/mgba.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), quicknes)
APP_TITLE = QuickNES Libretro
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = blargg, kode54
APP_PRODUCT_CODE = RARCH-QUICKNES
APP_UNIQUE_ID = 0xBAC0F
APP_ICON = ctr/assets/quicknes.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), fb_alpha_neo)
APP_TITLE = Neo Geo (FB Alpha)
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Team FB Alpha
APP_PRODUCT_CODE = RARCH-FBANEOGEO
APP_UNIQUE_ID = 0xBAC10
APP_ICON = ctr/assets/fb_alpha_neo.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_SYSTEM_MODE = 80MB
else ifeq ($(LIBRETRO), fb_alpha_cps1)
APP_TITLE = Final Burn Alpha - CPS-1
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Team FB Alpha
APP_PRODUCT_CODE = RARCH-FBACPS1
APP_UNIQUE_ID = 0xBAC11
APP_ICON = ctr/assets/fb_alpha_cps1.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), fb_alpha_cps2)
APP_TITLE = Final Burn Alpha - CPS-2
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Team FB Alpha
APP_PRODUCT_CODE = RARCH-FBACPS2
APP_UNIQUE_ID = 0xBAC12
APP_ICON = ctr/assets/fb_alpha_cps2.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_SYSTEM_MODE = 80MB
else ifeq ($(LIBRETRO), catsfc_plus)
APP_TITLE = CATSFC Plus Libretro
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-CATSFCPLUS
APP_UNIQUE_ID = 0xBAC13
APP_ICON = ctr/assets/catsfc_plus.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), mednafen_pce_fast)
APP_TITLE = Mednafen/Beetle PCE FAST
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Ryphecha
APP_PRODUCT_CODE = RARCH-M-PCE-FAST
APP_UNIQUE_ID = 0xBAC14
APP_ICON = ctr/assets/mednafen_pce_fast.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), pcsx_rearmed)
APP_TITLE = PCSX ReARMed
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = PCSX Team, notaz, Exophase
APP_PRODUCT_CODE = RARCH-PCSXRARMD
APP_UNIQUE_ID = 0xBAC15
APP_ICON = ctr/assets/pcsx_rearmed.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_USE_SVCHAX = 1
else ifeq ($(LIBRETRO), fmsx)
APP_TITLE = fMSX
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Marat Fayzullin
APP_PRODUCT_CODE = RARCH-FMSX
APP_UNIQUE_ID = 0xBAC16
APP_ICON = ctr/assets/fmsx.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
else ifeq ($(LIBRETRO), fb_alpha)
APP_TITLE = Final Burn Alpha
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = Team FB Alpha
APP_PRODUCT_CODE = RARCH-FBA
APP_UNIQUE_ID = 0xBAC17
#APP_ICON = ctr/assets/default.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_BIG_TEXT_SECTION = 1
else ifeq ($(LIBRETRO), mame2003)
APP_TITLE = MAME-2003
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-MAME2003
APP_UNIQUE_ID = 0xBAC18
APP_ICON = ctr/assets/mame.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_BIG_TEXT_SECTION = 1
else ifeq ($(LIBRETRO), mame2000)
APP_TITLE = MAME-2000
#APP_DESCRIPTION = Retroarch 3DS
#APP_AUTHOR = Team Libretro
APP_PRODUCT_CODE = RARCH-MAME2000
APP_UNIQUE_ID = 0xBAC19
APP_ICON = ctr/assets/mame.png
#APP_BANNER = ctr/assets/libretro_banner.png
#APP_AUDIO = ctr/assets/silent.wav
APP_BIG_TEXT_SECTION = 1
else ifeq ($(LIBRETRO), pocketsnes)
APP_TITLE = Pocket Snes
#APP_DESCRIPTION = Retroarch 3DS
APP_AUTHOR = various
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
endif
+424 -62
View File
@@ -1,8 +1,385 @@
#include <3ds.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
static void svchax_gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
#define CURRENT_KTHREAD 0xFFFF9000
#define CURRENT_KPROCESS 0xFFFF9004
#define CURRENT_KPROCESS_HANDLE 0xFFFF8001
#define RESOURCE_LIMIT_THREADS 0x2
#define MCH2_THREAD_COUNT_MAX 0x20
#define MCH2_THREAD_STACKS_SIZE 0x1000
#define SVC_ACL_OFFSET(svc_id) (((svc_id) >> 5) << 2)
#define SVC_ACL_MASK(svc_id) (0x1 << ((svc_id) & 0x1F))
#define THREAD_PAGE_ACL_OFFSET 0xF38
u32 __ctr_svchax = 0;
u32 __ctr_svchax_srv = 0;
extern void* __service_ptr;
extern Handle gspEvents[GSPGPU_EVENT_MAX];
typedef u32(*backdoor_fn)(u32 arg0, u32 arg1);
__attribute((naked))
static u32 svc_7b(backdoor_fn entry_fn, ...) // can pass up to two arguments to entry_fn(...)
{
__asm__ volatile(
"push {r0, r1, r2} \n\t"
"mov r3, sp \n\t"
"add r0, pc, #12 \n\t"
"svc 0x7B \n\t"
"add sp, sp, #8 \n\t"
"ldr r0, [sp], #4 \n\t"
"bx lr \n\t"
"cpsid aif \n\t"
"ldr r2, [r3], #4 \n\t"
"ldmfd r3!, {r0, r1} \n\t"
"push {r3, lr} \n\t"
"blx r2 \n\t"
"pop {r3, lr} \n\t"
"str r0, [r3, #-4]! \n\t"
"bx lr \n\t");
return 0;
}
static void k_enable_all_svcs(u32 isNew3DS)
{
u32* thread_ACL = *(*(u32***)CURRENT_KTHREAD + 0x22) - 0x6;
u32* process_ACL = *(u32**)CURRENT_KPROCESS + (isNew3DS ? 0x24 : 0x22);
memset(thread_ACL, 0xFF, 0x10);
memset(process_ACL, 0xFF, 0x10);
}
static u32 k_read_kaddr(u32* kaddr)
{
return *kaddr;
}
static u32 read_kaddr(u32 kaddr)
{
return svc_7b((backdoor_fn)k_read_kaddr, kaddr);
}
static u32 k_write_kaddr(u32* kaddr, u32 val)
{
*kaddr = val;
return 0;
}
static void write_kaddr(u32 kaddr, u32 val)
{
svc_7b((backdoor_fn)k_write_kaddr, kaddr, val);
}
__attribute__((naked))
static u32 get_thread_page(void)
{
__asm__ volatile(
"sub r0, sp, #8 \n\t"
"mov r1, #1 \n\t"
"mov r2, #0 \n\t"
"svc 0x2A \n\t"
"mov r0, r1, LSR#12 \n\t"
"mov r0, r0, LSL#12 \n\t"
"bx lr \n\t");
return 0;
}
typedef struct
{
Handle started_event;
Handle lock;
volatile u32 target_kaddr;
volatile u32 target_val;
} mch2_thread_args_t;
typedef struct
{
u32* stack_top;
Handle handle;
bool keep;
mch2_thread_args_t args;
} mch2_thread_t;
typedef struct
{
u32 old_cpu_time_limit;
u8 isNew3DS;
u32 kernel_fcram_mapping_offset;
Handle arbiter;
volatile u32 alloc_address;
volatile u32 alloc_size;
u8* flush_buffer;
Handle dummy_threads_lock;
Handle target_threads_lock;
Handle main_thread_lock;
u32* thread_page_va;
u32 thread_page_kva;
u32 threads_limit;
Handle alloc_thread;
Handle poll_thread;
mch2_thread_t threads[MCH2_THREAD_COUNT_MAX];
} mch2_vars_t;
static void alloc_thread_entry(mch2_vars_t* mch2)
{
u32 tmp;
svcControlMemory(&tmp, mch2->alloc_address, 0x0, mch2->alloc_size, MEMOP_ALLOC, MEMPERM_READ | MEMPERM_WRITE);
svcExitThread();
}
static void dummy_thread_entry(Handle lock)
{
svcWaitSynchronization(lock, U64_MAX);
svcExitThread();
}
static void check_tls_thread_entry(bool* keep)
{
*keep = !((u32)getThreadLocalStorage() & 0xFFF);
svcExitThread();
}
static void target_thread_entry(mch2_thread_args_t* args)
{
svcSignalEvent(args->started_event);
svcWaitSynchronization(args->lock, U64_MAX);
if (args->target_kaddr)
write_kaddr(args->target_kaddr, args->target_val);
svcExitThread();
}
static u32 get_first_free_basemem_page(bool isNew3DS)
{
s64 v1;
int memused_base;
int memused_base_linear; // guessed
memused_base = osGetMemRegionUsed(MEMREGION_BASE);
svcGetSystemInfo(&v1, 2, 0);
memused_base_linear = 0x6C000 + v1 +
(osGetKernelVersion() > SYSTEM_VERSION(2, 49, 0) ? (isNew3DS ? 0x2000 : 0x1000) : 0x0);
return (osGetKernelVersion() > SYSTEM_VERSION(2, 40, 0) ? 0xE0000000 : 0xF0000000) // kernel FCRAM mapping
+ (isNew3DS ? 0x10000000 : 0x08000000) // FCRAM size
- (memused_base - memused_base_linear) // memory usage for pages allocated without the MEMOP_LINEAR flag
- 0x1000; // skip to the start addr of the next free page
}
static u32 get_threads_limit(void)
{
Handle resource_limit_handle;
s64 thread_limit_current;
s64 thread_limit_max;
u32 thread_limit_name = RESOURCE_LIMIT_THREADS;
svcGetResourceLimit(&resource_limit_handle, CURRENT_KPROCESS_HANDLE);
svcGetResourceLimitCurrentValues(&thread_limit_current, resource_limit_handle, &thread_limit_name, 1);
svcGetResourceLimitLimitValues(&thread_limit_max, resource_limit_handle, &thread_limit_name, 1);
svcCloseHandle(resource_limit_handle);
if (thread_limit_max > MCH2_THREAD_COUNT_MAX)
thread_limit_max = MCH2_THREAD_COUNT_MAX;
return thread_limit_max - thread_limit_current;
}
static void do_memchunkhax2(void)
{
static u8 flush_buffer[0x8000];
static u8 thread_stacks[MCH2_THREAD_STACKS_SIZE];
int i;
u32 tmp;
mch2_vars_t mch2 = {0};
mch2.flush_buffer = flush_buffer;
mch2.threads_limit = get_threads_limit();
mch2.kernel_fcram_mapping_offset = (osGetKernelVersion() > SYSTEM_VERSION(2, 40, 0)) ? 0xC0000000 : 0xD0000000;
for (i = 0; i < MCH2_THREAD_COUNT_MAX; i++)
mch2.threads[i].stack_top = (u32*)((u32)thread_stacks + (i + 1) * (MCH2_THREAD_STACKS_SIZE / MCH2_THREAD_COUNT_MAX));
aptOpenSession();
APT_CheckNew3DS(&mch2.isNew3DS);
APT_GetAppCpuTimeLimit(&mch2.old_cpu_time_limit);
APT_SetAppCpuTimeLimit(5);
aptCloseSession();
for (i = 0; i < mch2.threads_limit; i++)
{
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)check_tls_thread_entry, (u32)&mch2.threads[i].keep,
mch2.threads[i].stack_top, 0x18, 0);
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
}
for (i = 0; i < mch2.threads_limit; i++)
if (!mch2.threads[i].keep)
svcCloseHandle(mch2.threads[i].handle);
svcCreateEvent(&mch2.dummy_threads_lock, 1);
svcClearEvent(mch2.dummy_threads_lock);
for (i = 0; i < mch2.threads_limit; i++)
if (!mch2.threads[i].keep)
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)dummy_thread_entry, mch2.dummy_threads_lock,
mch2.threads[i].stack_top, 0x3F - i, 0);
svcSignalEvent(mch2.dummy_threads_lock);
for (i = mch2.threads_limit - 1; i >= 0; i--)
if (!mch2.threads[i].keep)
{
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
svcCloseHandle(mch2.threads[i].handle);
mch2.threads[i].handle = 0;
}
svcCloseHandle(mch2.dummy_threads_lock);
u32 fragmented_address = 0;
mch2.arbiter = __sync_get_arbiter();
u32 linear_buffer;
svcControlMemory(&linear_buffer, 0, 0, 0x1000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
u32 linear_size = 0xF000;
u32 skip_pages = 2;
mch2.alloc_size = ((((linear_size - (skip_pages << 12)) + 0x1000) >> 13) << 12);
u32 mem_free = osGetMemRegionFree(MEMREGION_APPLICATION);
u32 fragmented_size = mem_free - linear_size;
extern u32 __heapBase;
extern u32 __heap_size;
fragmented_address = __heapBase + __heap_size;
u32 linear_address;
mch2.alloc_address = fragmented_address + fragmented_size;
svcControlMemory(&linear_address, 0x0, 0x0, linear_size, MEMOP_ALLOC_LINEAR,
MEMPERM_READ | MEMPERM_WRITE);
if (fragmented_size)
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size, MEMOP_ALLOC,
MEMPERM_READ | MEMPERM_WRITE);
if (skip_pages)
svcControlMemory(&tmp, (u32)linear_address, 0x0, (skip_pages << 12), MEMOP_FREE, MEMPERM_DONTCARE);
for (i = skip_pages; i < (linear_size >> 12) ; i += 2)
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
u32 alloc_address_kaddr = osConvertVirtToPhys((void*)linear_address) + mch2.kernel_fcram_mapping_offset;
mch2.thread_page_kva = get_first_free_basemem_page(mch2.isNew3DS) - 0x10000; // skip down 16 pages
((u32*)linear_buffer)[0] = 1;
((u32*)linear_buffer)[1] = mch2.thread_page_kva;
((u32*)linear_buffer)[2] = alloc_address_kaddr + (((mch2.alloc_size >> 12) - 3) << 13) + (skip_pages << 12);
u32 dst_memchunk = linear_address + (((mch2.alloc_size >> 12) - 2) << 13) + (skip_pages << 12);
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
GSPGPU_InvalidateDataCache((void*)dst_memchunk, 16);
GSPGPU_FlushDataCache((void*)linear_buffer, 16);
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
svcClearEvent(gspEvents[GSPGPU_EVENT_PPF]);
svcCreateThread(&mch2.alloc_thread, (ThreadFunc)alloc_thread_entry, (u32)&mch2,
mch2.threads[MCH2_THREAD_COUNT_MAX - 1].stack_top, 0x3F, 1);
while ((u32) svcArbitrateAddress(mch2.arbiter, mch2.alloc_address, ARBITRATION_WAIT_IF_LESS_THAN_TIMEOUT, 0,
0) == 0xD9001814);
GX_TextureCopy((void*)linear_buffer, 0, (void*)dst_memchunk, 0, 16, 8);
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
svcWaitSynchronization(gspEvents[GSPGPU_EVENT_PPF], U64_MAX);
svcWaitSynchronization(mch2.alloc_thread, U64_MAX);
svcCloseHandle(mch2.alloc_thread);
u32* mapped_page = (u32*)(mch2.alloc_address + mch2.alloc_size - 0x1000);
volatile u32* thread_ACL = &mapped_page[THREAD_PAGE_ACL_OFFSET >> 2];
svcCreateEvent(&mch2.main_thread_lock, 0);
svcCreateEvent(&mch2.target_threads_lock, 1);
svcClearEvent(mch2.target_threads_lock);
for (i = 0; i < mch2.threads_limit; i++)
{
if (mch2.threads[i].keep)
continue;
mch2.threads[i].args.started_event = mch2.main_thread_lock;
mch2.threads[i].args.lock = mch2.target_threads_lock;
mch2.threads[i].args.target_kaddr = 0;
thread_ACL[0] = 0;
GSPGPU_FlushDataCache((void*)thread_ACL, 16);
GSPGPU_InvalidateDataCache((void*)thread_ACL, 16);
svcClearEvent(mch2.main_thread_lock);
svcCreateThread(&mch2.threads[i].handle, (ThreadFunc)target_thread_entry, (u32)&mch2.threads[i].args,
mch2.threads[i].stack_top, 0x18, 0);
svcWaitSynchronization(mch2.main_thread_lock, U64_MAX);
if (thread_ACL[0])
{
thread_ACL[SVC_ACL_OFFSET(0x7B) >> 2] = SVC_ACL_MASK(0x7B);
GSPGPU_FlushDataCache((void*)thread_ACL, 16);
GSPGPU_InvalidateDataCache((void*)thread_ACL, 16);
mch2.threads[i].args.target_kaddr = get_thread_page() + THREAD_PAGE_ACL_OFFSET + SVC_ACL_OFFSET(0x7B);
mch2.threads[i].args.target_val = SVC_ACL_MASK(0x7B);
break;
}
}
svcSignalEvent(mch2.target_threads_lock);
for (i = 0; i < mch2.threads_limit; i++)
{
if (!mch2.threads[i].handle)
continue;
if (!mch2.threads[i].keep)
svcWaitSynchronization(mch2.threads[i].handle, U64_MAX);
svcCloseHandle(mch2.threads[i].handle);
}
svcCloseHandle(mch2.target_threads_lock);
svcCloseHandle(mch2.main_thread_lock);
svcControlMemory(&tmp, mch2.alloc_address, 0, mch2.alloc_size, MEMOP_FREE, MEMPERM_DONTCARE);
write_kaddr(alloc_address_kaddr + linear_size - 0x3000 + 0x4, alloc_address_kaddr + linear_size - 0x1000);
svcControlMemory(&tmp, (u32)fragmented_address, 0x0, fragmented_size, MEMOP_FREE, MEMPERM_DONTCARE);
for (i = 1 + skip_pages; i < (linear_size >> 12) ; i += 2)
svcControlMemory(&tmp, (u32)linear_address + (i << 12), 0x0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
svcControlMemory(&tmp, linear_buffer, 0, 0x1000, MEMOP_FREE, MEMPERM_DONTCARE);
aptOpenSession();
APT_SetAppCpuTimeLimit(mch2.old_cpu_time_limit);
aptCloseSession();
}
static void gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
{
extern Handle gspEvents[GSPGPU_EVENT_MAX];
@@ -12,7 +389,7 @@ static void svchax_gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
svcClearEvent(gspEvents[GSPGPU_EVENT_PPF]);
GX_TextureCopy((void*)src, 0, (void*)dst, 0, size, 8);
GX_TextureCopy((void*)src, 0, (void*)dst, 0, size, 8);
svcWaitSynchronization(gspEvents[GSPGPU_EVENT_PPF], U64_MAX);
memcpy(flush_buffer, flush_buffer + 0x4000, 0x4000);
@@ -31,7 +408,7 @@ static void svchax_gspwn(u32 dst, u32 src, u32 size, u8* flush_buffer)
// X-X--X-X
// X-XXXX-X
static void memchunkhax_write_pair(u32 val1, u32 val2)
static void memchunkhax1_write_pair(u32 val1, u32 val2)
{
u32 linear_buffer;
u8* flush_buffer;
@@ -52,25 +429,25 @@ static void memchunkhax_write_pair(u32 val1, u32 val2)
svcControlMemory(&tmp, linear_buffer + 0x6000, 0, 0x1000, MEMOP_FREE, 0);
next_ptr1 = (u32*)(linear_buffer + 0x0004);
svchax_gspwn(linear_buffer + 0x0000, linear_buffer + 0x1000, 16, flush_buffer);
gspwn(linear_buffer + 0x0000, linear_buffer + 0x1000, 16, flush_buffer);
next_ptr3 = (u32*)(linear_buffer + 0x2004);
prev_ptr3 = (u32*)(linear_buffer + 0x2008);
svchax_gspwn(linear_buffer + 0x2000, linear_buffer + 0x3000, 16, flush_buffer);
gspwn(linear_buffer + 0x2000, linear_buffer + 0x3000, 16, flush_buffer);
prev_ptr6 = (u32*)(linear_buffer + 0x5008);
svchax_gspwn(linear_buffer + 0x5000, linear_buffer + 0x6000, 16, flush_buffer);
gspwn(linear_buffer + 0x5000, linear_buffer + 0x6000, 16, flush_buffer);
*next_ptr1 = *next_ptr3;
*prev_ptr6 = *prev_ptr3;
*prev_ptr3 = val1 - 4;
*next_ptr3 = val2;
svchax_gspwn(linear_buffer + 0x3000, linear_buffer + 0x2000, 16, flush_buffer);
gspwn(linear_buffer + 0x3000, linear_buffer + 0x2000, 16, flush_buffer);
svcControlMemory(&tmp, 0, 0, 0x2000, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
svchax_gspwn(linear_buffer + 0x1000, linear_buffer + 0x0000, 16, flush_buffer);
svchax_gspwn(linear_buffer + 0x6000, linear_buffer + 0x5000, 16, flush_buffer);
gspwn(linear_buffer + 0x1000, linear_buffer + 0x0000, 16, flush_buffer);
gspwn(linear_buffer + 0x6000, linear_buffer + 0x5000, 16, flush_buffer);
svcControlMemory(&tmp, linear_buffer + 0x0000, 0, 0x1000, MEMOP_FREE, 0);
svcControlMemory(&tmp, linear_buffer + 0x2000, 0, 0x4000, MEMOP_FREE, 0);
@@ -78,68 +455,53 @@ static void memchunkhax_write_pair(u32 val1, u32 val2)
}
static inline u32 get_7B_access_ctrl_ptr(void)
static void do_memchunkhax1(void)
{
register u32 r0 __asm__("r0");
__asm__ volatile (
"sub r0, sp, #8 \n\t"
"mov r1, #1 \n\t"
"mov r2, #0 \n\t"
"svc 0x2A \n\t"
"orr r0, r1, #0xF00 \n\t"
"bic r0, r0, #0x0FF \n\t"
"add r0, r0, #0x044 \n\t"
:::"r0","r1","r2");
return r0;
u32 saved_vram_value = *(u32*)0x1F000008;
// 0x1F000000 contains the enable bit for svc 0x7B
memchunkhax1_write_pair(get_thread_page() + THREAD_PAGE_ACL_OFFSET + SVC_ACL_OFFSET(0x7B), 0x1F000000);
write_kaddr(0x1F000008, saved_vram_value);
}
static u32 saved_vram_value;
static s32 k_restore_vram_value(void)
Result svchax_init(bool patch_srv)
{
__asm__ volatile("cpsid aif \n\t");
u8 isNew3DS;
aptOpenSession();
APT_CheckNew3DS(&isNew3DS);
aptCloseSession();
*(u32*)0x1F000008 = saved_vram_value;
u32 kver = osGetKernelVersion();
return 0;
}
static s32 k_enable_all_svc(void)
{
__asm__ volatile("cpsid aif");
u32* svc_access_control = *(*(u32***)0xFFFF9000 + 0x22) - 0x6;
svc_access_control[0]=0xFFFFFFFE;
svc_access_control[1]=0xFFFFFFFF;
svc_access_control[2]=0xFFFFFFFF;
svc_access_control[3]=0x3FFFFFFF;
return 0;
}
u32 __ctr_svchax = 0;
void svchax_init(void)
{
extern void* __service_ptr;
if (__ctr_svchax)
return;
if(__service_ptr)
if (!__ctr_svchax)
{
if((*(u8*)0x1FF80002 > 0x2F) || (*(u8*)0x1FF80003 != 0x2))
return;
if (__service_ptr)
{
if (kver > SYSTEM_VERSION(2, 50, 11))
return -1;
else if (kver > SYSTEM_VERSION(2, 46, 0))
do_memchunkhax2();
else
do_memchunkhax1();
}
saved_vram_value = *(u32*)0x1F000008;
memchunkhax_write_pair(get_7B_access_ctrl_ptr(), 0x1F000000);
svcBackdoor(k_restore_vram_value);
svc_7b((backdoor_fn)k_enable_all_svcs, isNew3DS);
__ctr_svchax = 1;
}
svcBackdoor(k_enable_all_svc);
if (patch_srv && !__ctr_svchax_srv)
{
u32 PID_kaddr = read_kaddr(CURRENT_KPROCESS) + (isNew3DS ? 0xBC : (kver > SYSTEM_VERSION(2, 40, 0)) ? 0xB4 : 0xAC);
u32 old_PID = read_kaddr(PID_kaddr);
write_kaddr(PID_kaddr, 0);
srvExit();
srvInit();
write_kaddr(PID_kaddr, old_PID);
__ctr_svchax = 1;
__ctr_svchax_srv = 1;
}
return 0;
}
+77 -75
View File
@@ -5,6 +5,7 @@
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include "ctr_debug.h"
#define CTR_APPMEMALLOC_PTR ((u32*)0x1FF80040)
@@ -33,7 +34,7 @@ void __system_allocateHeaps();
void __system_initArgv();
void __ctru_exit(int rc);
int __libctru_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz);
int __libctru_gtod(struct _reent* ptr, struct timeval* tp, struct timezone* tz);
void (*__system_retAddr)(void);
extern void* __service_ptr;
@@ -44,24 +45,25 @@ Result __sync_init(void) __attribute__((weak));
void __attribute__((weak)) __libctru_init(void (*retAddr)(void))
{
// Store the return address
__system_retAddr = envIsHomebrew() ? retAddr : NULL;
// Store the return address
__system_retAddr = envIsHomebrew() ? retAddr : NULL;
// Initialize the synchronization subsystem
__sync_init();
// Initialize the synchronization subsystem
__sync_init();
// Initialize newlib support system calls
__system_initSyscalls();
// Initialize newlib support system calls
__system_initSyscalls();
// Allocate application and linear heaps
__system_allocateHeaps();
// Allocate application and linear heaps
__system_allocateHeaps();
// Build argc/argv if present
__system_initArgv();
// Build argc/argv if present
__system_initArgv();
}
void __system_allocateHeaps() {
u32 tmp=0;
void __system_allocateHeaps()
{
u32 tmp = 0;
MemInfo stack_memInfo;
PageInfo stack_pageInfo;
@@ -72,7 +74,7 @@ void __system_allocateHeaps() {
__stacksize__ += 0xFFF;
__stacksize__ &= ~0xFFF;
__stack_size_extra = __stacksize__ > stack_memInfo.size ? __stacksize__ - stack_memInfo.size: 0;
__stack_size_extra = __stacksize__ > stack_memInfo.size ? __stacksize__ - stack_memInfo.size : 0;
__stack_bottom = stack_memInfo.base_addr - __stack_size_extra;
if (__stack_size_extra)
@@ -81,13 +83,13 @@ void __system_allocateHeaps() {
memset((void*)__stack_bottom, 0xFC, __stack_size_extra);
}
// setup the application heap
__heapBase = 0x08000000;
// setup the application heap
__heapBase = 0x08000000;
__heap_size = 0;
// Allocate the linear heap
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
// Set up newlib heap
// Allocate the linear heap
svcControlMemory(&__linear_heap, 0x0, 0x0, __linear_heap_size, MEMOP_ALLOC_LINEAR, MEMPERM_READ | MEMPERM_WRITE);
// Set up newlib heap
extern char* fake_heap_end;
fake_heap_end = (char*)0x13F00000;
@@ -98,32 +100,32 @@ Result __sync_fini(void) __attribute__((weak));
extern char** __system_argv;
void __attribute__((noreturn)) __libctru_exit(int rc)
{
u32 tmp=0;
u32 tmp = 0;
if(__system_argv)
if (__system_argv)
free(__system_argv);
// Unmap the linear heap
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
// Unmap the linear heap
svcControlMemory(&tmp, __linear_heap, 0x0, __linear_heap_size, MEMOP_FREE, 0x0);
// Unmap the application heap
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size, MEMOP_FREE, 0x0);
// Unmap the application heap
svcControlMemory(&tmp, __heapBase, 0x0, __heap_size, MEMOP_FREE, 0x0);
if (__stack_size_extra)
svcControlMemory(&tmp, __stack_bottom, 0x0, __stack_size_extra, MEMOP_FREE, 0x0);
// Close some handles
envDestroyHandles();
// Close some handles
envDestroyHandles();
if (__sync_fini)
__sync_fini();
__sync_fini();
// Jump to the loader if it provided a callback
if (__system_retAddr)
__system_retAddr();
// Jump to the loader if it provided a callback
if (__system_retAddr)
__system_retAddr();
// Since above did not jump, end this process
svcExitProcess();
// Since above did not jump, end this process
svcExitProcess();
}
#include <3ds/types.h>
@@ -135,50 +137,48 @@ int __system_argc;
char** __system_argv;
extern const char* __system_arglist;
//extern char* fake_heap_start;
extern char* fake_heap_end;
void __system_initArgv()
{
int i;
const char* temp = __system_arglist;
int i;
struct
{
u32 argc;
char args[];
}*arg_struct = (void*)__system_arglist;
// Check if the argument list is present
if (!temp)
return;
__system_argc = 0;
// Retrieve argc
__system_argc = *(u32*)temp;
temp += sizeof(u32);
if (arg_struct)
__system_argc = arg_struct->argc;
// Find the end of the argument data
for (i = 0; i < __system_argc; i ++)
{
for (; *temp; temp ++);
temp ++;
}
if (__system_argc)
{
__system_argv = (char**) malloc((__system_argc + 1) * sizeof(char**));
__system_argv[0] = arg_struct->args;
for (i = 1; i < __system_argc; i++)
__system_argv[i] = __system_argv[i - 1] + strlen(__system_argv[i - 1]) + 1;
// Reserve heap memory for argv data
u32 argSize = temp - __system_arglist - sizeof(u32);
// __system_argv = (char**)fake_heap_start;
// fake_heap_start += sizeof(char**)*(__system_argc + 1);
// char* argCopy = fake_heap_start;
// fake_heap_start += argSize;
__system_argv = malloc(sizeof(char**)*(__system_argc + 1) + argSize);
char* argCopy = (char*)__system_argv + sizeof(char**)*(__system_argc + 1);
// Fill argv array
memcpy(argCopy, &__system_arglist[4], argSize);
temp = argCopy;
for (i = 0; i < __system_argc; i ++)
{
__system_argv[i] = (char*)temp;
for (; *temp; temp ++);
temp ++;
}
__system_argv[__system_argc] = NULL;
i = __system_argc - 1;
__system_argc = 1;
while (i)
{
if(__system_argv[i] && isalnum(__system_argv[i][0])
&& strncmp(__system_argv[i], "3dslink:/", 9))
{
__system_argv[1] = __system_argv[i];
__system_argc = 2;
break;
}
i--;
}
}
else
{
__system_argc = 1;
__system_argv = (char**) malloc(sizeof(char**) * 2);
__system_argv[0] = "sdmc:/retroarch/retroarch";
}
__system_argv[__system_argc] = NULL;
}
void initSystem(void (*retAddr)(void))
@@ -195,7 +195,8 @@ void __attribute__((noreturn)) __ctru_exit(int rc)
__libctru_exit(rc);
}
typedef union{
typedef union
{
struct
{
unsigned description : 10;
@@ -205,7 +206,7 @@ typedef union{
unsigned level : 5;
};
Result val;
}ctr_result_value;
} ctr_result_value;
void dump_result_value(Result val)
{
@@ -225,7 +226,7 @@ void wait_for_input(void)
printf("\n\nPress Start.\n\n");
fflush(stdout);
while(aptMainLoop())
while (aptMainLoop())
{
u32 kDown;
@@ -238,6 +239,7 @@ void wait_for_input(void)
if (kDown & KEY_SELECT)
exit(0);
#if 0
select_pressed = true;
#endif
@@ -249,7 +251,7 @@ void wait_for_input(void)
long sysconf(int name)
{
switch(name)
switch (name)
{
case _SC_NPROCESSORS_ONLN:
return 2;
+1 -1
View File
@@ -19,7 +19,7 @@
#include <retro_endianness.h>
#include "dir_list_special.h"
#include "list_special.h"
#include "database_info.h"
#include "msg_hash.h"
#include "verbosity.h"
+1 -1
View File
@@ -21,7 +21,7 @@
#include <stdint.h>
#include <stddef.h>
#include <file/file_archive.h>
#include <file/archive_file.h>
#include "libretro-db/libretrodb.h"
+2
View File
@@ -50,6 +50,7 @@ struct defaults
char remap[PATH_MAX_LENGTH];
char cache[PATH_MAX_LENGTH];
char wallpapers[PATH_MAX_LENGTH];
char thumbnails[PATH_MAX_LENGTH];
char database[PATH_MAX_LENGTH];
char cursor[PATH_MAX_LENGTH];
char cheats[PATH_MAX_LENGTH];
@@ -67,6 +68,7 @@ struct defaults
int out_latency;
float video_refresh_rate;
bool video_threaded_enable;
char menu[PATH_MAX_LENGTH];
} settings;
#ifndef IS_SALAMANDER
-2
View File
@@ -20,8 +20,6 @@
#if defined(HAVE_D3D9)
/* Direct3D 9 */
#include <d3d9.h>
#include <d3dx9.h>
#include <d3dx9core.h>
#define LPDIRECT3D LPDIRECT3D9
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
+2 -1
View File
@@ -356,7 +356,8 @@ bool glslang::compile_spirv(const string &source, Stage stage, std::vector<uint3
shader.setStrings(&src, 1);
string msg;
if (!shader.preprocess(&process.GetResources(), 100, ENoProfile, false, false, EShMsgDefault, &msg, TShader::ForbidInclude()))
auto forbid_include = TShader::ForbidInclude();
if (!shader.preprocess(&process.GetResources(), 100, ENoProfile, false, false, EShMsgDefault, &msg, forbid_include))
{
fprintf(stderr, "%s\n", msg.c_str());
return {};
-7499
View File
File diff suppressed because it is too large. Load diff
-357
View File
@@ -1,357 +0,0 @@
/* 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 */
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
bison --defines=glslang_tab.cpp.h -o glslang_tab.cpp -t glslang/glslang/MachineIndependent/glslang.y
Vendored Submodule
+1
Submodule deps/spir2cross added at 0ae2bcc3d0.
-43
View File
@@ -1,43 +0,0 @@
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
@@ -1,17 +0,0 @@
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
@@ -1,89 +0,0 @@
# 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.
+19498
View File
File diff suppressed because it is too large. Load diff
-545
View File
@@ -1,545 +0,0 @@
/* 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
-3218
View File
File diff suppressed because it is too large. Load diff
-14266
View File
File diff suppressed because it is too large. Load diff
-2017
View File
File diff suppressed because it is too large. Load diff
-78
View File
@@ -1,78 +0,0 @@
/* 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.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <file/dir_list.h>
#include "dir_list_special.h"
#include "frontend/frontend_driver.h"
#include "configuration.h"
#include "core_info.h"
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter)
{
char ext_name[PATH_MAX_LENGTH];
const char *dir = NULL;
const char *exts = NULL;
bool include_dirs = false;
settings_t *settings = config_get_ptr();
(void)input_dir;
(void)settings;
switch (type)
{
case DIR_LIST_CORES:
dir = settings->libretro_directory;
if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
return NULL;
exts = ext_name;
break;
case DIR_LIST_CORE_INFO:
{
core_info_list_t *list = NULL;
core_info_ctl(CORE_INFO_CTL_LIST_GET, &list);
dir = input_dir;
exts = list->all_ext;
}
break;
case DIR_LIST_SHADERS:
dir = settings->video.shader_dir;
exts = "cg|cgp|glsl|glslp|slang|slangp";
break;
case DIR_LIST_COLLECTIONS:
dir = settings->playlist_directory;
exts = "lpl";
break;
case DIR_LIST_DATABASES:
dir = settings->content_database;
exts = "rdb";
break;
case DIR_LIST_PLAIN:
dir = input_dir;
exts = filter;
break;
case DIR_LIST_NONE:
default:
return NULL;
}
return dir_list_new(dir, exts, include_dirs, type == DIR_LIST_CORE_INFO);
}
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh
RARCH_VERSION=1.3.0
RARCH_VERSION=1.3.4
PLATFORM=$1
SALAMANDER=no
MAKEFILE_GRIFFIN=no
+13 -4
View File
@@ -288,10 +288,6 @@ static void menu_update_libretro_info(void)
if (!info)
return;
#ifndef HAVE_DYNAMIC
retro_get_system_info(info);
#endif
event_cmd_ctl(EVENT_CMD_CORE_INFO_INIT, NULL);
event_cmd_ctl(EVENT_CMD_LOAD_CORE_PERSIST, NULL);
}
@@ -342,7 +338,10 @@ static void init_drivers(int flags)
}
if (flags & DRIVER_AUDIO)
{
audio_driver_ctl(RARCH_AUDIO_CTL_INIT, NULL);
audio_driver_ctl(RARCH_AUDIO_CTL_DEVICES_LIST_NEW, NULL);
}
/* Only initialize camera driver if we're ever going to use it. */
if ((flags & DRIVER_CAMERA) && camera_driver_ctl(RARCH_CAMERA_CTL_IS_ACTIVE, NULL))
@@ -447,6 +446,11 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
uninit_drivers(*flags);
}
break;
case RARCH_DRIVER_CTL_UNINIT_ALL:
{
int flags = DRIVERS_CMD_ALL;
return driver_ctl(RARCH_DRIVER_CTL_UNINIT, &flags);
}
case RARCH_DRIVER_CTL_INIT:
{
int *flags = (int*)data;
@@ -455,6 +459,11 @@ bool driver_ctl(enum driver_ctl_state state, void *data)
init_drivers(*flags);
}
break;
case RARCH_DRIVER_CTL_INIT_ALL:
{
int flags = DRIVERS_CMD_ALL;
return driver_ctl(RARCH_DRIVER_CTL_INIT, &flags);
}
case RARCH_DRIVER_CTL_INIT_PRE:
audio_driver_ctl(RARCH_AUDIO_CTL_FIND_DRIVER, NULL);
video_driver_ctl(RARCH_DISPLAY_CTL_FIND_DRIVER, NULL);
+7 -59
View File
@@ -28,61 +28,12 @@
#include "config.h"
#endif
#include "input/input_defines.h"
#ifdef __cplusplus
extern "C" {
#endif
#define AUDIO_CHUNK_SIZE_BLOCKING 512
/* So we don't get complete line-noise when fast-forwarding audio. */
#define AUDIO_CHUNK_SIZE_NONBLOCKING 2048
#define AUDIO_MAX_RATIO 16
/* Specialized _MOUSE that targets the full screen regardless of viewport.
*/
#define RARCH_DEVICE_MOUSE_SCREEN (RETRO_DEVICE_MOUSE | 0x10000)
/* Specialized _POINTER that targets the full screen regardless of viewport.
* Should not be used by a libretro implementation as coordinates returned
* make no sense.
*
* It is only used internally for overlays. */
#define RARCH_DEVICE_POINTER_SCREEN (RETRO_DEVICE_POINTER | 0x10000)
#define RARCH_DEVICE_ID_POINTER_BACK (RETRO_DEVICE_ID_POINTER_PRESSED | 0x10000)
/* libretro has 16 buttons from 0-15 (libretro.h)
* Analog binds use RETRO_DEVICE_ANALOG, but we follow the same scheme
* internally in RetroArch for simplicity, so they are mapped into [16, 23].
*/
#define RARCH_FIRST_CUSTOM_BIND 16
#define RARCH_FIRST_META_KEY RARCH_CUSTOM_BIND_LIST_END
#define AXIS_NEG(x) (((uint32_t)(x) << 16) | UINT16_C(0xFFFF))
#define AXIS_POS(x) ((uint32_t)(x) | UINT32_C(0xFFFF0000))
#define AXIS_NONE UINT32_C(0xFFFFFFFF)
#define AXIS_DIR_NONE UINT16_C(0xFFFF)
#define AXIS_NEG_GET(x) (((uint32_t)(x) >> 16) & UINT16_C(0xFFFF))
#define AXIS_POS_GET(x) ((uint32_t)(x) & UINT16_C(0xFFFF))
#define NO_BTN UINT16_C(0xFFFF)
#define HAT_UP_SHIFT 15
#define HAT_DOWN_SHIFT 14
#define HAT_LEFT_SHIFT 13
#define HAT_RIGHT_SHIFT 12
#define HAT_UP_MASK (1 << HAT_UP_SHIFT)
#define HAT_DOWN_MASK (1 << HAT_DOWN_SHIFT)
#define HAT_LEFT_MASK (1 << HAT_LEFT_SHIFT)
#define HAT_RIGHT_MASK (1 << HAT_RIGHT_SHIFT)
#define HAT_MAP(x, hat) ((x & ((1 << 12) - 1)) | hat)
#define HAT_MASK (HAT_UP_MASK | HAT_DOWN_MASK | HAT_LEFT_MASK | HAT_RIGHT_MASK)
#define GET_HAT_DIR(x) (x & HAT_MASK)
#define GET_HAT(x) (x & (~HAT_MASK))
#define DRIVERS_CMD_ALL \
( DRIVER_AUDIO \
| DRIVER_VIDEO \
@@ -152,14 +103,6 @@ enum
RARCH_BIND_LIST_END_NULL
};
enum analog_dpad_mode
{
ANALOG_DPAD_NONE = 0,
ANALOG_DPAD_LSTICK,
ANALOG_DPAD_RSTICK,
ANALOG_DPAD_LAST
};
enum
{
DRIVER_AUDIO = 1 << 0,
@@ -179,10 +122,15 @@ enum driver_ctl_state
* @data is a bitmask which determines
* which drivers get deinitialized. */
RARCH_DRIVER_CTL_UNINIT,
RARCH_DRIVER_CTL_UNINIT_ALL,
/* Initializes drivers.
* @data is a bitmask which determines
* which drivers get initialized. */
RARCH_DRIVER_CTL_INIT,
RARCH_DRIVER_CTL_INIT_ALL,
/* Attempts to find a default driver for
* all driver types.
*
+69 -30
View File
@@ -29,7 +29,9 @@
#include "config.h"
#endif
#include "dynamic.h"
#include "command_event.h"
#include "audio/audio_driver.h"
#include "camera/camera_driver.h"
#include "location/location_driver.h"
@@ -113,7 +115,23 @@ libretro_find_controller_description(
return NULL;
}
#ifdef HAVE_DYNAMIC
/**
* libretro_free_system_info:
* @info : Pointer to system info information.
*
* Frees system information.
**/
void libretro_free_system_info(struct retro_system_info *info)
{
if (!info)
return;
free((void*)info->library_name);
free((void*)info->library_version);
free((void*)info->valid_extensions);
memset(info, 0, sizeof(*info));
}
static bool *load_no_content_hook;
static bool environ_cb_get_system_info(unsigned cmd, void *data)
@@ -131,6 +149,42 @@ static bool environ_cb_get_system_info(unsigned cmd, void *data)
return true;
}
#ifndef HAVE_DYNAMIC
bool libretro_get_system_info_static(struct retro_system_info *info,
bool *load_no_content)
{
struct retro_system_info dummy_info = {0};
if (load_no_content)
{
load_no_content_hook = load_no_content;
/* load_no_content gets set in this callback. */
retro_set_environment(environ_cb_get_system_info);
/* It's possible that we just set get_system_info callback
* to the currently running core.
*
* Make sure we reset it to the actual environment callback.
* Ignore any environment callbacks here in case we're running
* on the non-current core. */
ignore_environment_cb = true;
retro_set_environment(rarch_environment_cb);
ignore_environment_cb = false;
}
retro_get_system_info(&dummy_info);
memcpy(info, &dummy_info, sizeof(*info));
info->library_name = strdup(dummy_info.library_name);
info->library_version = strdup(dummy_info.library_version);
if (dummy_info.valid_extensions)
info->valid_extensions = strdup(dummy_info.valid_extensions);
return true;
}
#endif
#ifdef HAVE_DYNAMIC
/**
* libretro_get_environment_info:
* @func : Function pointer for get_environment_info.
@@ -238,22 +292,6 @@ bool libretro_get_system_info(const char *path,
return true;
}
/**
* libretro_free_system_info:
* @info : Pointer to system info information.
*
* Frees system information.
**/
void libretro_free_system_info(struct retro_system_info *info)
{
if (!info)
return;
free((void*)info->library_name);
free((void*)info->library_version);
free((void*)info->valid_extensions);
memset(info, 0, sizeof(*info));
}
static void load_dynamic_core(void)
{
settings_t *settings = config_get_ptr();
@@ -271,7 +309,7 @@ static void load_dynamic_core(void)
retro_fail(1, "init_libretro_sym()");
}
if (!*settings->libretro)
if (!*settings->path.libretro)
{
RARCH_ERR("RetroArch is built for dynamic libretro cores, but "
"libretro_path is not set. Cannot continue.\n");
@@ -281,15 +319,15 @@ static void load_dynamic_core(void)
/* Need to use absolute path for this setting. It can be
* saved to content history, and a relative path would
* break in that scenario. */
path_resolve_realpath(settings->libretro, sizeof(settings->libretro));
path_resolve_realpath(settings->path.libretro, sizeof(settings->path.libretro));
RARCH_LOG("Loading dynamic libretro core from: \"%s\"\n",
settings->libretro);
lib_handle = dylib_load(settings->libretro);
settings->path.libretro);
lib_handle = dylib_load(settings->path.libretro);
if (!lib_handle)
{
RARCH_ERR("Failed to open libretro core: \"%s\"\n",
settings->libretro);
settings->path.libretro);
RARCH_ERR("Error(s): %s\n", dylib_error());
retro_fail(1, "load_dynamic()");
}
@@ -538,6 +576,7 @@ void uninit_libretro_sym(struct retro_core_t *current_core)
runloop_ctl(RUNLOOP_CTL_CORE_OPTIONS_DEINIT, NULL);
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_FREE, NULL);
runloop_ctl(RUNLOOP_CTL_FRAME_TIME_FREE, NULL);
camera_driver_ctl(RARCH_CAMERA_CTL_UNSET_ACTIVE, NULL);
location_driver_ctl(RARCH_LOCATION_CTL_UNSET_ACTIVE, NULL);
@@ -676,7 +715,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
break;
case RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY:
if (string_is_empty(settings->system_directory))
if (string_is_empty(settings->directory.system))
{
char *fullpath = NULL;
runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath);
@@ -692,9 +731,9 @@ bool rarch_environment_cb(unsigned cmd, void *data)
}
else
{
*(const char**)data = settings->system_directory;
*(const char**)data = settings->directory.system;
RARCH_LOG("Environ SYSTEM_DIRECTORY: \"%s\".\n",
settings->system_directory);
settings->directory.system);
}
break;
@@ -835,7 +874,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
}
}
global->has_set.input_descriptors = true;
core_ctl(CORE_CTL_SET_INPUT_DESCRIPTORS, NULL);
break;
}
@@ -969,7 +1008,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
const char **path = (const char**)data;
*path = NULL;
#ifdef HAVE_DYNAMIC
*path = settings->libretro;
*path = settings->path.libretro;
#endif
break;
}
@@ -1088,10 +1127,10 @@ bool rarch_environment_cb(unsigned cmd, void *data)
{
const char **dir = (const char**)data;
*dir = *settings->core_assets_directory ?
settings->core_assets_directory : NULL;
*dir = *settings->directory.core_assets ?
settings->directory.core_assets : NULL;
RARCH_LOG("Environ CORE_ASSETS_DIRECTORY: \"%s\".\n",
settings->core_assets_directory);
settings->directory.core_assets);
break;
}
+16 -9
View File
@@ -19,20 +19,13 @@
#include <boolean.h>
#include "core_type.h"
#include "libretro.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
enum rarch_core_type
{
CORE_TYPE_PLAIN = 0,
CORE_TYPE_DUMMY,
CORE_TYPE_FFMPEG,
CORE_TYPE_IMAGEVIEWER
};
#ifdef __cplusplus
extern "C" {
#endif
@@ -72,6 +65,21 @@ void libretro_get_environment_info(void (*)(retro_environment_t),
**/
bool libretro_get_system_info(const char *path,
struct retro_system_info *info, bool *load_no_content);
#else
/**
* libretro_get_system_info_static:
* @info : System info information.
* @load_no_content : If true, core should be able to auto-start
* without any content loaded.
*
* Gets system info from the current statically linked libretro library.
* The struct returned must be freed as strings are allocated dynamically.
*
* Returns: true (1) if successful, otherwise false (0).
**/
bool libretro_get_system_info_static(struct retro_system_info *info,
bool *load_no_content);
#endif
/**
* libretro_free_system_info:
@@ -80,7 +88,6 @@ bool libretro_get_system_info(const char *path,
* Frees system information.
**/
void libretro_free_system_info(struct retro_system_info *info);
#endif
/**
* libretro_get_current_core_pathname:
+51
View File
@@ -13,6 +13,10 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <boolean.h>
#include <string.h>
@@ -137,6 +141,53 @@ void fill_pathname_abbreviate_special(char *out_path,
retro_assert(strlcpy(out_path, in_path, size) < size);
}
bool fill_pathname_application_data(char *s, size_t len)
{
#if defined(_WIN32) && !defined(_XBOX)
const char *appdata = getenv("APPDATA");
if (appdata)
{
strlcpy(s, appdata, len);
return true;
}
#elif defined(OSX)
const char *appdata = getenv("HOME");
if (appdata)
{
fill_pathname_join(s, appdata,
"Library/Application Support/RetroArch", len);
return true;
}
#elif !defined(RARCH_CONSOLE)
const char *xdg = getenv("XDG_CONFIG_HOME");
const char *appdata = getenv("HOME");
/* XDG_CONFIG_HOME falls back to $HOME/.config. */
if (xdg)
{
fill_pathname_join(s, xdg, "retroarch", len);
return true;
}
if (appdata)
{
#ifdef __HAIKU__
fill_pathname_join(s, appdata,
"config/settings/retroarch/", len);
#else
fill_pathname_join(s, appdata,
".config/retroarch/", len);
#endif
return true;
}
#endif
return false;
}
#if !defined(RARCH_CONSOLE)
void fill_pathname_application_path(char *s, size_t len)
{
+5 -16
View File
@@ -14,25 +14,14 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DIR_LIST_SPECIAL_H
#define _DIR_LIST_SPECIAL_H
#ifndef _FILE_PATH_SPECIAL_H
#define _FILE_PATH_SPECIAL_H
#include <stdint.h>
#include <stddef.h>
#include <string/string_list.h>
#include <boolean.h>
enum dir_list_type
{
DIR_LIST_NONE = 0,
DIR_LIST_CORES,
DIR_LIST_CORE_INFO,
DIR_LIST_DATABASES,
DIR_LIST_COLLECTIONS,
DIR_LIST_PLAIN,
DIR_LIST_SHADERS
};
struct string_list *dir_list_new_special(const char *input_dir,
enum dir_list_type type, const char *filter);
bool fill_pathname_application_data(char *s, size_t len);
#endif
+42 -31
View File
@@ -23,7 +23,7 @@
#include <file/file_path.h>
#ifndef IS_SALAMANDER
#include <file/file_list.h>
#include <lists/file_list.h>
#endif
#include "../frontend_driver.h"
@@ -74,33 +74,14 @@ static void frontend_ctr_get_environment_settings(int *argc, char *argv[],
"system", sizeof(g_defaults.dir.system));
fill_pathname_join(g_defaults.dir.playlist, g_defaults.dir.core,
"playlists", sizeof(g_defaults.dir.playlist));
fill_pathname_join(g_defaults.dir.menu_config, g_defaults.dir.port,
"config", sizeof(g_defaults.dir.menu_config));
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.port,
"remaps", sizeof(g_defaults.dir.remap));
"config/remaps", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.dir.video_filter, g_defaults.dir.port,
"filters", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.path.config, g_defaults.dir.port,
"retroarch.cfg", sizeof(g_defaults.path.config));
#ifndef IS_SALAMANDER
/* clean-up argc/argv */
if(*argc)
{
int i = *argc - 1;
*argc = 0;
while (i)
{
if(argv[i] && isalnum(argv[i][0])
&& strncmp(argv[i], "3dslink:/", 9))
{
argv[1] = argv[i];
argv[2] = NULL;
*argc = 2;
break;
}
i--;
}
}
#endif
}
static void frontend_ctr_deinit(void *data)
@@ -130,9 +111,14 @@ static void frontend_ctr_deinit(void *data)
svcCloseHandle(lcd_handle);
}
u32 parallax_layer_reg_state = (*(float*)0x1FF81080 == 0.0)? 0x0 : 0x00010001;
GSPGPU_WriteHWRegs(0x202000, &parallax_layer_reg_state, 4);
cfguExit();
ndspExit();
csndExit();
gfxTopRightFramebuffers[0] = NULL;
gfxTopRightFramebuffers[1] = NULL;
gfxExit();
#endif
}
@@ -192,7 +178,10 @@ static void ctr_check_dspfirm(void)
}
}
void svchax_init(void);
__attribute__((weak)) Result svchax_init(bool patch_srv);
__attribute__((weak)) u32 __ctr_patch_services;
void gfxSetFramebufferInfo(gfxScreen_t screen, u8 id);
static void frontend_ctr_init(void *data)
{
@@ -202,16 +191,38 @@ static void frontend_ctr_init(void *data)
*verbose = true;
#if 0
APT_SetAppCpuTimeLimit(NULL, 80);
#endif
gfxInit(GSP_BGR8_OES,GSP_RGB565_OES,false);
gfxSet3D(false);
u32 topSize = 400 * 240 * 3;
u32 bottomSize = 320 * 240 * 2;
linearFree(gfxTopLeftFramebuffers[0]);
linearFree(gfxTopLeftFramebuffers[1]);
linearFree(gfxBottomFramebuffers[0]);
linearFree(gfxBottomFramebuffers[1]);
linearFree(gfxTopRightFramebuffers[0]);
linearFree(gfxTopRightFramebuffers[1]);
gfxTopLeftFramebuffers[0]=linearAlloc(topSize * 2);
gfxTopRightFramebuffers[0] = gfxTopLeftFramebuffers[0] + topSize;
gfxTopLeftFramebuffers[1]=linearAlloc(topSize * 2);
gfxTopRightFramebuffers[1] = gfxTopLeftFramebuffers[1] + topSize;
gfxBottomFramebuffers[0]=linearAlloc(bottomSize);
gfxBottomFramebuffers[1]=linearAlloc(bottomSize);
gfxSetFramebufferInfo(GFX_TOP, 0);
gfxSetFramebufferInfo(GFX_BOTTOM, 0);
gfxSet3D(true);
consoleInit(GFX_BOTTOM, NULL);
/* enable access to all service calls when possible. */
osSetSpeedupEnable(false);
svchax_init();
if(svchax_init)
{
osSetSpeedupEnable(false);
svchax_init(__ctr_patch_services);
}
osSetSpeedupEnable(true);
audio_driver_t* dsp_audio_driver = &audio_ctr_dsp;
@@ -247,7 +258,7 @@ static int frontend_ctr_parse_drive_list(void *data)
if (!list)
return -1;
menu_entries_push(list,
menu_entries_add(list,
"sdmc:/", "", MENU_FILE_DIRECTORY, 0, 0);
#endif
+34 -22
View File
@@ -46,9 +46,11 @@
#include <rhash.h>
#include "../frontend_driver.h"
#include "../../ui/ui_companion_driver.h"
#include "../../file_path_special.h"
#include "../../defaults.h"
#include "../../general.h"
#include "../../verbosity.h"
#include "../../ui/ui_companion_driver.h"
#ifdef HAVE_MENU
#include "../../menu/menu_driver.h"
@@ -359,36 +361,46 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
fill_pathname_join(g_defaults.dir.core_assets, home_dir_buf, "downloads", sizeof(g_defaults.dir.core_assets));
fill_pathname_join(g_defaults.dir.assets, home_dir_buf, "assets", sizeof(g_defaults.dir.assets));
fill_pathname_join(g_defaults.dir.system, home_dir_buf, "system", sizeof(g_defaults.dir.system));
fill_pathname_join(g_defaults.dir.menu_config, home_dir_buf, "configs", sizeof(g_defaults.dir.menu_config));
fill_pathname_join(g_defaults.dir.menu_config, home_dir_buf, "config", sizeof(g_defaults.dir.menu_config));
fill_pathname_join(g_defaults.path.config, g_defaults.dir.menu_config, "retroarch.cfg", sizeof(g_defaults.path.config));
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.menu_config, "remaps", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.dir.database, home_dir_buf, "database/rdb", sizeof(g_defaults.dir.database));
fill_pathname_join(g_defaults.dir.cursor, home_dir_buf, "database/cursors", sizeof(g_defaults.dir.cursor));
fill_pathname_join(g_defaults.dir.cheats, home_dir_buf, "cht", sizeof(g_defaults.dir.cheats));
fill_pathname_join(g_defaults.dir.thumbnails, home_dir_buf, "thumbnails", sizeof(g_defaults.dir.thumbnails));
fill_pathname_join(g_defaults.dir.sram, home_dir_buf, "saves", sizeof(g_defaults.dir.sram));
fill_pathname_join(g_defaults.dir.savestate, home_dir_buf, "states", sizeof(g_defaults.dir.savestate));
fill_pathname_join(g_defaults.dir.remap, home_dir_buf, "remaps", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.dir.menu_config, home_dir_buf, "config", sizeof(g_defaults.dir.menu_config));
#if defined(IOS)
fill_pathname_join(g_defaults.dir.playlist, home_dir_buf, "playlists", sizeof(g_defaults.dir.playlist));
#endif
#if defined(OSX)
char application_data[PATH_MAX_LENGTH];
fill_pathname_application_data(application_data, sizeof(application_data));
#ifdef HAVE_CG
fill_pathname_join(g_defaults.dir.shader, home_dir_buf, "shaders_cg", sizeof(g_defaults.dir.shader));
#endif
fill_pathname_join(g_defaults.dir.audio_filter, home_dir_buf, "audio_filters", sizeof(g_defaults.dir.audio_filter));
fill_pathname_join(g_defaults.dir.video_filter, home_dir_buf, "video_filters", sizeof(g_defaults.dir.video_filter));
fill_pathname_join(g_defaults.dir.playlist, home_dir_buf, "playlists", sizeof(g_defaults.dir.playlist));
fill_pathname_join(g_defaults.dir.playlist, application_data, "playlists", sizeof(g_defaults.dir.playlist));
fill_pathname_join(g_defaults.dir.thumbnails, application_data, "thumbnails", sizeof(g_defaults.dir.thumbnails));
fill_pathname_join(g_defaults.dir.menu_config, application_data, "config", sizeof(g_defaults.dir.menu_config));
fill_pathname_join(g_defaults.path.config, g_defaults.dir.menu_config, "retroarch.cfg", sizeof(g_defaults.path.config));
fill_pathname_join(g_defaults.dir.remap, g_defaults.dir.menu_config, "remaps", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.dir.core_assets, application_data, "downloads", sizeof(g_defaults.dir.core_assets));
fill_pathname_join(g_defaults.dir.screenshot, application_data, "screenshots", sizeof(g_defaults.dir.screenshot));
#if defined(RELEASE_BUILD)
fill_pathname_join(g_defaults.dir.remap, bundle_path_buf, "Contents/Resources/remaps", sizeof(g_defaults.dir.remap));
fill_pathname_join(g_defaults.dir.playlist, bundle_path_buf, "Contents/Resources/playlists", sizeof(g_defaults.dir.playlist));
fill_pathname_join(g_defaults.dir.shader, bundle_path_buf, "Contents/Resources/shaders", sizeof(g_defaults.dir.shader));
fill_pathname_join(g_defaults.dir.core, bundle_path_buf, "Contents/Resources/cores", sizeof(g_defaults.dir.core));
fill_pathname_join(g_defaults.dir.core_info, bundle_path_buf, "Contents/Resources/info", sizeof(g_defaults.dir.core_info));
fill_pathname_join(g_defaults.dir.overlay, bundle_path_buf, "Contents/Resources/overlays", sizeof(g_defaults.dir.overlay));
fill_pathname_join(g_defaults.dir.autoconfig, bundle_path_buf, "Contents/Resources/autoconfig", sizeof(g_defaults.dir.autoconfig));
fill_pathname_join(g_defaults.dir.core_assets, bundle_path_buf, "Contents/Resources/downloads", sizeof(g_defaults.dir.core_assets));
fill_pathname_join(g_defaults.dir.assets, bundle_path_buf, "Contents/Resources/assets", sizeof(g_defaults.dir.assets));
fill_pathname_join(g_defaults.dir.menu_config, bundle_path_buf, "Contents/Resources/configs", sizeof(g_defaults.dir.menu_config));
fill_pathname_join(g_defaults.path.config, g_defaults.dir.menu_config, "retroarch.cfg", sizeof(g_defaults.path.config));
fill_pathname_join(g_defaults.dir.database, bundle_path_buf, "Contents/Resources/database/rdb", sizeof(g_defaults.dir.database));
fill_pathname_join(g_defaults.dir.cursor, bundle_path_buf, "Contents/Resources/database/cursors", sizeof(g_defaults.dir.cursor));
fill_pathname_join(g_defaults.dir.cheats, bundle_path_buf, "Contents/Resources/cht", sizeof(g_defaults.dir.cheats));
fill_pathname_join(g_defaults.dir.shader, bundle_path_buf, "Contents/Resources/shaders", sizeof(g_defaults.dir.shader));
fill_pathname_join(g_defaults.dir.core, bundle_path_buf, "Contents/Resources/cores", sizeof(g_defaults.dir.core));
fill_pathname_join(g_defaults.dir.core_info, bundle_path_buf, "Contents/Resources/info", sizeof(g_defaults.dir.core_info));
fill_pathname_join(g_defaults.dir.overlay, bundle_path_buf, "Contents/Resources/overlays", sizeof(g_defaults.dir.overlay));
fill_pathname_join(g_defaults.dir.autoconfig, bundle_path_buf, "Contents/Resources/autoconfig", sizeof(g_defaults.dir.autoconfig));
fill_pathname_join(g_defaults.dir.assets, bundle_path_buf, "Contents/Resources/assets", sizeof(g_defaults.dir.assets));
fill_pathname_join(g_defaults.dir.database, bundle_path_buf, "Contents/Resources/database/rdb", sizeof(g_defaults.dir.database));
fill_pathname_join(g_defaults.dir.cursor, bundle_path_buf, "Contents/Resources/database/cursors", sizeof(g_defaults.dir.cursor));
fill_pathname_join(g_defaults.dir.cheats, bundle_path_buf, "Contents/Resources/cht", sizeof(g_defaults.dir.cheats));
#endif
#endif
@@ -408,8 +420,8 @@ static void frontend_darwin_get_environment_settings(int *argc, char *argv[],
RARCH_LOG("Assets ZIP found at [%s], setting up bundle assets extraction...\n", assets_zip_path);
RARCH_LOG("Extraction dir will be: %s\n", home_dir_buf);
strlcpy(settings->bundle_assets_src_path, assets_zip_path, sizeof(settings->bundle_assets_src_path));
strlcpy(settings->bundle_assets_dst_path, home_dir_buf, sizeof(settings->bundle_assets_dst_path));
strlcpy(settings->path.bundle_assets_src, assets_zip_path, sizeof(settings->path.bundle_assets_src));
strlcpy(settings->path.bundle_assets_dst, home_dir_buf, sizeof(settings->path.bundle_assets_dst));
settings->bundle_assets_extract_version_current = 130; /* TODO/FIXME: Just hardcode this for now */
}
#endif
@@ -635,9 +647,9 @@ static int frontend_darwin_parse_drive_list(void *data)
CFSearchPathForDirectoriesInDomains(CFDocumentDirectory, CFUserDomainMask, 1, home_dir_buf, sizeof(home_dir_buf));
menu_entries_push(list,
menu_entries_add(list,
home_dir_buf, "", MENU_FILE_DIRECTORY, 0, 0);
menu_entries_push(list, "/", "",
menu_entries_add(list, "/", "",
MENU_FILE_DIRECTORY, 0, 0);
ret = 0;
+1
View File
@@ -19,6 +19,7 @@
#include <file/config_file.h>
#include "../../defaults.h"
#include "../../general.h"
#include "../../content.h"
#include "../frontend.h"
Loaded 100 of 466 files, more files were not shown because too many files have changed in this diff. Show more