Compare commits

...
1669 Commits
Author SHA1 Message Date
github-actions 69a4f0ea1e Fetch translations from Crowdin 2025-11-20 00:17:08 +00:00
Eric Warmenhoven cc335202a8 Add scanner support for Philips CD-i disc images (#18424)
CD-i discs have a unique quirk: they store data in tracks labeled as
AUDIO in both CUE and CHD formats. The scanner normally skips AUDIO
tracks when looking for data, causing CD-i games to never match the
database.
2025-11-19 16:18:06 +01:00
Craig 12eebedf1f webOS: fix logging, pass mouse buttons, gamepad, function keys to RetroArch (#18419)
* webOS: fix logging crash on startup

* webOS: fix for webOS 8.3 - 10+ to receive all mouse/pad/keyboard keys
2025-11-19 16:17:41 +01:00
Joe Osborn fbc972b39e Fix compressed size calculation for the zstd condition (#18420)
There was a variable shadowing issue.

I also fixed a few clang analyzer warnings.
2025-11-19 16:16:44 +01:00
Eric Warmenhoven 97dea65a8c Fix a couple minor Saturn scanning bugs (#18421) 2025-11-19 16:16:10 +01:00
zoltanvb 8c339fd900 Do not use size hint for CHD for now. 2025-11-19 07:33:15 -05:00
sonninnos 931e3fcabd Fix core suggestion with manual core load (#18423) 2025-11-19 06:17:40 +02:00
github-actions 2e8b001dd9 Fetch translations from Crowdin 2025-11-19 00:17:24 +00:00
Eric Warmenhoven 1efcc55bff Android: Add HAVE_CHEEVOS_RVZ 2025-11-18 14:11:47 -05:00
sonninnos 39b75272f3 XMB: Left thumbnail top align adjustment 2025-11-18 17:13:03 +02:00
sonninnos 59b05fa034 Android: Final missing zstd piece 2025-11-18 16:26:46 +02:00
sonninnos d95fbb2655 Android: zstd include path fix 2025-11-18 16:20:05 +02:00
sonninnos 9c2f39a129 Android: Add zstd include dirs 2025-11-18 16:10:08 +02:00
sonninnos 2d9f6a916a Android: Add HAVE_ZSTD 2025-11-18 15:53:58 +02:00
Eric Warmenhoven 447daab3b2 minor cleanup of now-unused config value 2025-11-17 22:15:20 -05:00
Eric Warmenhoven 3ceed07cd0 Merge remote-tracking branch 'lucascanero/enable-cloudsync-libnx' into warmenhoven/dev/nx 2025-11-17 22:10:01 -05:00
Eric Warmenhoven d848490295 add cheevos_rvz 2025-11-17 20:58:08 -05:00
github-actions 37be83913b Fetch translations from Crowdin 2025-11-18 00:17:18 +00:00
libretroadmin b5e2956a5a Fix uninitialized variable warning 2025-11-18 00:15:48 +01:00
Joe Osborn cf30bc29bb fix -Wshorten64-to-32 warnings in bsvmovie (#18416) 2025-11-17 20:22:42 +01:00
libretroadmin a609b709eb Bump to version 1.22.2 2025-11-17 14:22:57 +01:00
sonninnos 83c663e5e9 Revert "Shorten stb_vorbis.h"
This reverts commit 53dfaa1f85.
2025-11-17 08:07:20 +02:00
sonninnos dd8973f1e6 Revert "Simplify stb_vorbis.h"
This reverts commit 7fc802698a.
2025-11-17 08:07:11 +02:00
sonninnos f382d8d321 XMB: Left thumbnail + handheld mode fixes (#18414) 2025-11-17 08:05:42 +02:00
github-actions 5ed53646b9 Fetch translations from Crowdin 2025-11-17 00:17:18 +00:00
zoltanvb cf3c678de5 Fix Enter not working in menu on Android keyboards (#18405) 2025-11-16 20:59:32 +01:00
zoltanvb acd3fa1172 Change size to 64-bit (#18410)
Several rom sizes could exceed 32-bit. Database uses uint64_t, so let's align.
2025-11-16 20:59:18 +01:00
github-actions 72b7f058a3 Fetch translations from Crowdin 2025-11-16 00:17:59 +00:00
libretroadmin 9f9a984b99 Use strlcpy instead of strncpy in places 2025-11-15 16:28:41 +01:00
Craig 1be2ba8d20 Replace single strncpy with strlcpy in features_cpu (#18400) 2025-11-15 13:39:30 +01:00
libretroadmin 01cc7b3104 Revert "Further reduce size of dr_flac - only include it once in C file"
This reverts commit 1e66e9d16b.
2025-11-15 03:48:18 +01:00
libretroadmin 0a30809931 Revert "Compile stb_rect_pack/stb_truetype once separately instead"
This reverts commit 85245e5514.
2025-11-15 03:47:59 +01:00
libretroadmin 8675fcd79a Revert "Buildfix"
This reverts commit 0e14bba04c.
2025-11-15 03:47:38 +01:00
libretroadmin 4668afca71 Revert "Need to use RETRO_BEGIN_DECLS/RETRO_END_DECL for MSVC C++"
This reverts commit 81555b9da6.
2025-11-15 03:47:29 +01:00
libretroadmin 81555b9da6 Need to use RETRO_BEGIN_DECLS/RETRO_END_DECL for MSVC C++
backwards compatibility
2025-11-15 03:34:13 +01:00
libretroadmin 0e14bba04c Buildfix 2025-11-15 03:29:44 +01:00
libretroadmin 85245e5514 Compile stb_rect_pack/stb_truetype once separately instead
of including them in several files
2025-11-15 03:21:49 +01:00
libretroadmin 1e66e9d16b Further reduce size of dr_flac - only include it once in C file
instead of including it at least twice
2025-11-15 02:46:51 +01:00
libretroadmin b8372337a0 Slim down on dr_mp3 2025-11-15 02:37:41 +01:00
libretroadmin b1e10faa01 (dr_flac) Cleanups 2025-11-15 02:20:22 +01:00
libretroadmin a15217dbaf Bump version 2025-11-15 01:56:28 +01:00
libretroadmin 6d5672c669 (drflac) Slim down dr_flac 2025-11-15 01:49:07 +01:00
github-actions 4fd47962c8 Fetch translations from Crowdin 2025-11-15 00:15:44 +00:00
Eric Warmenhoven 749bc23ecd fix null pointer crash in xmb when scrolling 2025-11-14 18:41:06 -05:00
libretroadmin 2a08e0104d Slim down stb_rect_pack/stb_truetype 2025-11-14 23:15:07 +01:00
libretroadmin 7fc802698a Simplify stb_vorbis.h 2025-11-14 22:05:25 +01:00
libretroadmin 53dfaa1f85 Shorten stb_vorbis.h 2025-11-14 21:43:19 +01:00
libretroadmin 3df2dfa095 Buildfix stb_vorbis.h 2025-11-14 20:04:34 +01:00
libretroadmin 906dbd8cc0 Recommit file 2025-11-14 19:40:38 +01:00
libretroadmin 28783c657a Remove if 0 2025-11-14 19:37:58 +01:00
libretroadmin b5e767acaa Remove if 0 2025-11-14 19:05:13 +01:00
LibretroAdmin 703321e807 Update CHANGELOG 2025-11-14 16:58:25 +01:00
aitchFactor 9a0abbed5d Add 800px mode for New 3DS models (#18380)
* Update 800x240 mode for n3DS models

- Backported 800x240 display settings from libctru
- Removed/renamed old 800x240 display functionality
- Readded menu option for non-2DS models

* replace bannertool.exe with a working version

* Update ctr_defines.h

* Fix missed rename
2025-11-14 16:55:47 +01:00
Eric Warmenhoven 9f45a4a4ac fix clamping bug in jpeg decode (#18389)
fixes #6611
2025-11-14 16:54:35 +01:00
github-actions a6e7ff2fe8 Fetch translations from Crowdin 2025-11-14 00:16:44 +00:00
sonninnos 40b4503e93 State slot hotkey adjustments (#18388)
* Allow Auto slot with state hotkeys

* Hide state thumbnail widget on state load

* State slot msg reformat
2025-11-14 01:15:53 +02:00
libretroadmin 5650d91608 Silence warnings 2025-11-13 19:24:27 +01:00
libretroadmin 74c03d26d2 (BSV) Cleanups 2025-11-13 18:55:49 +01:00
libretroadmin 6fc1091ff6 Cleanups; replace some instances of strncpy with strlcpy, other
cleanups
2025-11-13 18:32:17 +01:00
sonninnos 994a5cda7a Fix pointer Resume trigger 2025-11-13 19:29:46 +02:00
github-actions 46c53538c6 Fetch translations from Crowdin 2025-11-13 00:17:03 +00:00
LibretroAdmin b5509769c2 Revert "Use RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE for rewind savesta…" (#18383)
This reverts commit aa89097cc0.
2025-11-12 22:41:24 +01:00
Craig 38dc5d8267 Improved webOS CPU info and fix version number in IPK (#18381)
* Fix version parsing in Makefile.webos

* webOS: add output of lscpu, as some boards will give less than helpful /proc/cpuinfo
2025-11-12 21:33:56 +01:00
libretroadmin c0be192868 (gfx_widgets) Remove unused variable# Please enter the commit message for your changes. Lines starting 2025-11-12 05:11:18 +01:00
Robin Morgan 05175a487c Fix for vulkan_create_swapchain() not clearing flag (fixes random crashes with fast forwarding) (#18295)
* improved vulkan_create_swapchain() to handle swapchain creation better and avoid crashes

* As requested by PR review, reverted back to original create_swapchain function with only minimal changes made for this bug fix on Android only

* fixed oepsie with copy paste

* fixed oepsie with copy paste

* Fixed random crash on Android when destroying old swapchain before new one is created with minimal changes to original vulkan_create_swapchain() function

* Restored all my initial changes without all the reformatting of the code (#3)

* The VK_DATA_FLAG_CREATED_NEW_SWAPCHAIN should be cleared otherwise every call to this function can be handled as a new swapchain creation while it might not be the case, it fixes crashes on Android
2025-11-12 04:05:49 +01:00
Craig 36a4c83b88 webOS: produce 2 artifacts, one with GLES v2 and another with GLES v3 (#18378) 2025-11-12 04:03:30 +01:00
github-actions c58528696c Fetch translations from Crowdin 2025-11-12 00:16:50 +00:00
libretroadmin 325393aaa1 Update 2025-11-11 21:43:40 +01:00
Eric Warmenhoven fdb283845d mfi: try harder to own the home button (#18374) 2025-11-11 21:40:26 +01:00
Eric Warmenhoven 95680d8b3f xmb improvements for mobile/touch (#18375) 2025-11-11 21:40:15 +01:00
libretroadmin 0a253e341f Silence warnings backport 2025-11-11 19:28:40 +01:00
libretroadmin 59d74a0c8b Buildfixes 2025-11-10 20:08:19 +01:00
libretroadmin 11018c8356 Warning fix 2025-11-10 19:37:10 +01:00
libretroadmin 6af74f3b55 More casting fixes for CXX_BUILD 2025-11-10 19:35:23 +01:00
libretroadmin c2d5bd57f7 C89_BUILD fixes 2025-11-10 19:28:21 +01:00
libretroadmin 7ad9852bc5 More CXX_BUILD fixes 2025-11-10 19:09:44 +01:00
libretroadmin 2526b375e7 More CXX_BUILD buildfixes 2025-11-10 19:03:03 +01:00
libretroadmin 16025e51b8 C89_BUILD buildfixes
CXX_BUILD buildfixes
Fix for conflicting types in uncompress prototype
2025-11-10 18:52:42 +01:00
Joe Osborn cf7824e0fd Remove an old emscripten hack around atomics (#18324)
In talking with @BinBashBanana it became clear this wasn't necessary,
and it has started to conflict with some code in emscripten's
libpthread in recent versions.
2025-11-10 17:31:51 +01:00
libretroadmin 77076ae3c9 C89_BUILD buildfix 2025-11-10 12:21:39 +01:00
cyanosin 2827bb5d0d VK_EXT_full_screen_exclusive (#18368) 2025-11-10 11:03:19 +01:00
Craig 5388b0628e webOS: fix GLES 3/3.1/3.2 option, enable 64-bit option (#18369) 2025-11-10 11:02:08 +01:00
github-actions eb75997cbb Fetch translations from Crowdin 2025-11-10 00:17:43 +00:00
libretroadmin 7a4214d9fc Bump version 2025-11-10 00:56:29 +01:00
Eric Warmenhoven a9da1bc664 fix sha1 name conflict 2025-11-09 00:00:00 -05:00
Eric Warmenhoven ac6eb4bb08 iOS: use native keyboard in search 2025-11-09 00:00:00 -05:00
Eric Warmenhoven 58f4d04bb9 tvOS: continue to use draw observer 2025-11-08 23:59:59 -05:00
Lucas f97d6c9d63 improve cloudsync settings and missing labels 2025-11-09 01:42:19 +00:00
github-actions f01a03c586 Fetch translations from Crowdin 2025-11-09 00:18:09 +00:00
zoltanvb 458a059eb5 Change list up to Nov. 8 (#18366) 2025-11-08 23:14:06 +01:00
github-actions 850cc56196 Fetch translations from Crowdin 2025-11-08 00:15:06 +00:00
Lucas Cañero 5048003e20 Add cloudsync "sync now" button and related settings (cloudsync startup) 2025-11-07 21:55:33 +00:00
Lucas Cañero 09a7ec737d enable CloudSync and SSL for libnx 2025-11-07 21:54:27 +00:00
Eric Warmenhoven cbed0afd39 net_http: avoid sthread_detach 2025-11-07 10:57:14 -05:00
github-actions 35bb3f869b Fetch translations from Crowdin 2025-11-07 00:17:32 +00:00
Eric Warmenhoven b38369e9ff iOS/tvOS: don't use draw observer unless fast forwarding (#18362) 2025-11-06 08:03:26 +01:00
github-actions 91aedbe24e Fetch translations from Crowdin 2025-11-06 00:16:37 +00:00
Eric Warmenhoven 943be3352b apple: safer cleanup of haptic engines 2025-11-05 17:17:24 -05:00
sonninnos 4979c66d50 Task widget adjustments 2025-11-05 20:18:55 +02:00
Keith Bourdon 5acda87142 strip bom (#18358) 2025-11-05 19:15:11 +01:00
zoltanvb 0a2c684849 Warn when scanning with no database present + indicate task failure with icon (#18359) 2025-11-05 19:13:56 +01:00
刘皓 ee59a4e58c Fix a bug in the open() function in the Storage Access Framework VFS backend (#18360) 2025-11-05 19:13:43 +01:00
sonninnos 04e06f7457 Fix widget icon alpha 2025-11-05 19:58:23 +02:00
github-actions 1f2bf72734 Fetch translations from Crowdin 2025-11-05 00:17:24 +00:00
Eric Warmenhoven 7d223f6061 fix heap corruption in wii rvz ra hash 2025-11-04 17:23:18 -05:00
Eric Warmenhoven b3620f14b4 iOS: small followup to 357fce853e, restore haptics after background 2025-11-04 15:25:51 -05:00
libretroadmin bbe9f3244c (vita2d_gfx) silence warnings 2025-11-04 20:24:55 +01:00
sonninnos 4b796f3bd9 Turbo fire port bind sign crash fix 2025-11-04 18:55:39 +02:00
Nicholas Martin 081ced9940 Use hotkeys from core port 0 (#18353) 2025-11-04 08:57:18 +01:00
Eric Warmenhoven c699b28151 mobile: set default OSK overlay (#18346) 2025-11-04 08:53:20 +01:00
Eric Warmenhoven 5ae5641fc2 Add RVZ Wii retroachievements hashing (#18339) 2025-11-04 08:53:06 +01:00
Joe Osborn 1fb62ff4ac fix v0 replay sync and a crash that occurs at the end of playback (#18347) 2025-11-04 08:52:14 +01:00
Joe Osborn ff7b84ba5a Improve backwards scanning to skip no more than one checkpoint (#18328) 2025-11-04 08:51:54 +01:00
zoltanvb 7b2912b014 Set 272 for RGUI framebuffer size on Vita. (#18338) 2025-11-04 08:51:38 +01:00
zoltanvb 768c2bf355 Scanning optimization (#18341) 2025-11-04 08:51:27 +01:00
Joe Osborn 3c7cd3511c Maybe make bsvmovie more tolerant of msgpack encoding (#18342) 2025-11-04 08:51:13 +01:00
Eric Warmenhoven ef9dc83041 iOS: remove down arrow menu (#18350) 2025-11-04 08:51:00 +01:00
Eric Warmenhoven 7d5c1b5085 iOS/tvOS: use native keyboard (#18355) 2025-11-04 08:50:40 +01:00
Bobby Smith a6d765d959 Remove interval for XInput rumbles (#18313) 2025-11-04 03:30:28 +02:00
sonninnos a019b92f26 Ozone: Fix sidebar background color dimensions 2025-11-03 19:55:54 +02:00
Eric Warmenhoven ccf0f97e17 coreaudio mic: minor cleanup to remove unused function 2025-11-02 22:24:23 -05:00
github-actions 61e951e367 Fetch translations from Crowdin 2025-11-03 00:17:35 +00:00
github-actions 68c5d3c109 Fetch translations from Crowdin 2025-11-02 00:18:20 +00:00
sonninnos be43a2464b Remove obsolete device type from default list 2025-11-01 22:22:31 +02:00
sonninnos e618d3d932 Fix crash when taking a screenshot right after video reinit 2025-11-01 21:55:44 +02:00
Eric Warmenhoven 53f90ba5f2 apple: attempt to fix coremidi xpc crashes 2025-11-01 13:20:30 -04:00
Eric Warmenhoven 357fce853e iOS: stronger haptics, obey strength setting
fixes #15625
2025-11-01 12:14:58 -04:00
hunterk 683899e5dc menu_state_get_ptr() needs to be behind HAVE_MENU (#18349)
it gets treated as an int instead of a pointer because the actual declaration (included from menu/menu_driver.h) is gated behind HAVE_MENU.
2025-11-01 17:25:53 +02:00
sonninnos 4ed05b0d43 Turbo fire remapping fixes 2025-11-01 07:30:39 +02:00
sonninnos fcded627b3 Remote RetroPad:
- Show pointer in all screens
- Add pointer idle timer
- Remove sleep from retro_run
2025-11-01 06:39:52 +02:00
sonninnos d18adfd2c0 Refactor remap menu left-right callbacks (#18340) 2025-11-01 05:22:49 +02:00
Eric Warmenhoven 6217684ade ios: minor factor to collapse redunant preprocessor macros 2025-10-31 12:18:52 -04:00
Joe Osborn 575754d584 Fix x11 undefined behavior (#18323)
* Fix an OOB memory access in x11 input if >16 devices

It looks like the mouse device list was meant to be initialized with
-1, but the mouse device list should contain only up to `j` values
where j is the number of actual mice.

* Also make sure j stays under max mouse idx

This is just to be safe in case we have... more than 16 master pointers
2025-10-31 04:12:35 +01:00
github-actions 044c9f8fa9 Fetch translations from Crowdin 2025-10-31 00:16:32 +00:00
刘皓 a74b8d058c Implement support for the Storage Access Framework on Android (#18336)
* Add a work-in-progress Storage Access Framework backend to libretro-common/vfs

* Fix compilation error in `retro_vfs_file_open_impl()` on Windows

* Don't gate the contents of vfs_implementation_saf.h behind `HAVE_SAF`

* Add a button to the file browser on Android for opening a directory picker

* Fix a bug in `retro_vfs_path_split_saf()`

* Don't include inaccessible directories in the file browser in Google Play Android builds

* Fix missing return statement in `action_ok_open_picker()`

* Improve the documentation for the SAF VFS backend in libretro-common

* Implement opening the path in the file browser when selected using the SAF tree picker

* Change indentation style in VfsImplementationSaf.java to 3 spaces

* Check if `vfs_saf_get_jni_env` is null in vfs_implementation_saf.c before performing VFS operations

* Fix stat function in SAF VFS backend

* Don't gate the definition of `safTreeAdded()` behind `HAVE_SAF`

* Fix memory leak when calling `retro_vfs_closedir_impl()` on a SAF directory

* Fix `NullPointerException` in `SafStat` constructor

* Create global references for all Java classes used by the SAF VFS backend

* Improve the readdir implementation for the SAF VFS backend

* Fix a bug in `retro_vfs_path_join_saf()`

* Show the list of SAF trees that the app can access in the file browser on Android

* Improve error handling in VfsImplementationSaf.java

* Check if the directory already exists in the mkdir implementation in VfsImplementationSaf.java

* Enforce a minimum Android API level of 21 in VfsImplementationSaf.java

* Remove the comma at the end of `enum vfs_scheme` in libretro-common/include/vfs/vfs.h

* Fix nonstandard C89 in libretro-common/vfs/vfs_implementation.c

* Fix mkdir implementation in VfsImplementationSaf.java

* Fix open implementation in VfsImplementationSaf.java not creating files that don't exist
2025-10-30 03:52:59 +01:00
github-actions 7e0d99f745 Fetch translations from Crowdin 2025-10-29 00:16:51 +00:00
github-actions 1472478af8 Fetch translations from Crowdin 2025-10-28 00:15:58 +00:00
sonninnos 79a627a172 Fix overlay turbo fire (#18333) 2025-10-27 19:43:35 +02:00
zoltanvb 477cb705b2 Init randomness (#18309) (#18327) 2025-10-27 19:42:01 +02:00
sonninnos 11d4e46e9f Handle save state and disc insert resume also on release 2025-10-25 16:35:07 +03:00
github-actions bfa603828d Fetch translations from Crowdin 2025-10-25 00:15:17 +00:00
sonninnos 4c7a1a5322 SegaCD scan crash fix 2025-10-24 17:06:57 +03:00
sonninnos 63c4a393c0 RGUI: Playlist secondary thumbnail cycle improvement 2025-10-24 03:35:43 +03:00
github-actions f4e2cea399 Fetch translations from Crowdin 2025-10-24 00:15:06 +00:00
sonninnos cbd1c06b1a Playlist secondary thumbnail cycle correction 2025-10-24 03:03:53 +03:00
sonninnos 933baca92b Smart integer scaling fixup 2025-10-23 19:09:37 +03:00
InquisitiveCoder f189ed5fec New Smart integer scaling implementation to address #18154 (#18296)
* New Smart integer scaling implementation to address #18154

* Fixed C89 compliance errors.
2025-10-23 19:08:34 +03:00
zoltanvb fc1acf4d6c Log files with no match during scanning. (#18322) 2025-10-23 08:18:30 +02:00
github-actions 26eb19b31a Fetch translations from Crowdin 2025-10-23 00:16:16 +00:00
刘皓 d43a6410c6 Use app-specific storage for Google Play versions of the Android app (#18321) 2025-10-22 12:01:16 +02:00
zoltanvb cd23c32a83 Add support for min/max query. (#18314) 2025-10-22 12:00:59 +02:00
zoltanvb 82f4f67617 Add support for archived file size query along with crc32 (#18315) 2025-10-22 12:00:39 +02:00
github-actions b62ee31508 Fetch translations from Crowdin 2025-10-22 00:16:14 +00:00
Eric Warmenhoven fcf0cc7483 rvz hashing for retroachievements (#18319) 2025-10-21 23:40:19 +02:00
zoltanvb 8c10eaa250 Prevent uninitialized memory. (#18320) 2025-10-20 13:20:18 +02:00
zoltanvb ff025a8d6e Changes up to Oct. 16. (#18318) 2025-10-20 13:20:07 +02:00
github-actions 2d1f5070ee Fetch translations from Crowdin 2025-10-17 00:16:35 +00:00
github-actions 053ced8d1c Fetch translations from Crowdin 2025-10-16 00:16:28 +00:00
gouchi 656ab420d1 sdl : Fix typo SDL_SUPPORTS_RUMBLE 2025-10-15 19:36:16 -04:00
Eric Warmenhoven 6bf2950b16 apple: clean up coremidi lifetime a little bit 2025-10-15 13:33:46 -04:00
Bobby Smith 9fdd60a6bc Fix default hotkeys (#18311) 2025-10-15 18:03:00 +03:00
github-actions ba95a1f611 Fetch translations from Crowdin 2025-10-15 00:16:16 +00:00
Eric Warmenhoven 08ed87c587 macos: fix icon on macos26, take 2 2025-10-14 09:26:27 -04:00
Eric Warmenhoven d3bbe88450 ios/tvos: try to include dSYM symbols in app store builds 2025-10-13 21:55:30 -04:00
Eric Warmenhoven 5d066f65fd macos: fix icon on macos26 2025-10-13 16:00:25 -04:00
Eric Warmenhoven 6d1c26a572 macos: restore window size properly 2025-10-13 14:57:35 -04:00
Eric Warmenhoven 8d16395de9 apple: fix display server resolution/refresh rates on macos/ios 2025-10-13 14:23:56 -04:00
Eric Warmenhoven 64ff381f72 macos: account for window manager decorations in frame size (#13254) 2025-10-13 11:56:34 -04:00
Eric Warmenhoven 8036fed21f ios: disable jit checks on ios 26 for now 2025-10-13 11:48:37 -04:00
github-actions 4fe5509c65 Fetch translations from Crowdin 2025-10-13 00:17:21 +00:00
sonninnos 100c69d4c8 Silence warning 2025-10-13 01:44:58 +03:00
libretroadmin b3a2f802b9 Remove unused variables/warnings 2025-10-12 20:31:56 +02:00
sonninnos 43abea5661 Add HAVE_BSV_MOVIE for Android 2025-10-12 17:51:03 +03:00
github-actions 328e4ce825 Fetch translations from Crowdin 2025-10-11 00:14:28 +00:00
github-actions cfcece201c Fetch translations from Crowdin 2025-10-10 00:16:07 +00:00
Jamiras 2aad8ad8e6 update to rcheevos 12.1 (#18298) 2025-10-09 16:27:02 +02:00
github-actions 8ec8b7c797 Fetch translations from Crowdin 2025-10-09 00:15:26 +00:00
github-actions 5fe9836007 Fetch translations from Crowdin 2025-10-08 00:15:51 +00:00
Eric Warmenhoven b9b085de97 apple: trivial xcode scheme updates
Xcode 26 keeps reordering things, I don't know why, I'm tired of
fighting it.

The Metal capture doesn't work with tvOS 13 so default disable that,
it's easy to turn back on if needed. Only affects debugging.
2025-10-07 12:22:11 -04:00
github-actions b300f72905 Fetch translations from Crowdin 2025-10-07 00:16:08 +00:00
sonninnos deb9cd35c9 Core updater logging formatting 2025-10-07 00:29:04 +03:00
Jamiras 8f73291977 (cheevos) change expired token message from info to error; clear token (#18294) 2025-10-06 17:16:28 +02:00
github-actions df1ccb9497 Fetch translations from Crowdin 2025-10-06 00:16:30 +00:00
github-actions ff5fd9d527 Fetch translations from Crowdin 2025-10-05 00:17:10 +00:00
nfp0 1cb11b52a4 Wayland: Remove splash screen if HAVE_LIBDECOR_H to fix fullscreen on Auto monitor index (#18252) 2025-10-04 19:41:35 +02:00
github-actions e15bd1dcb9 Fetch translations from Crowdin 2025-10-04 00:15:03 +00:00
github-actions 14288e1162 Fetch translations from Crowdin 2025-10-03 00:15:18 +00:00
github-actions 5ace54acc4 Fetch translations from Crowdin 2025-10-01 00:17:59 +00:00
zoltanvb 1a01ea7e53 Debug logs for catching #17087 (#18288) 2025-09-30 13:02:30 +02:00
github-actions 03a3fe5963 Fetch translations from Crowdin 2025-09-30 00:15:58 +00:00
github-actions 636b98feea Fetch translations from Crowdin 2025-09-29 00:16:39 +00:00
github-actions a9ba292d9e Fetch translations from Crowdin 2025-09-27 00:14:56 +00:00
github-actions 87d8866f54 Fetch translations from Crowdin 2025-09-26 00:15:27 +00:00
Stern cdd98f5ac4 UWP/WinRT: Fix XInput controller detection for late-arriving controllers (#18282) 2025-09-24 22:18:56 +02:00
github-actions 3f19b2a107 Fetch translations from Crowdin 2025-09-24 00:15:42 +00:00
github-actions 8141b31151 Fetch translations from Crowdin 2025-09-23 00:16:15 +00:00
Bobby Smith 6c1b32de42 Make sure correct type is used when calling retroarch_get_flags() (#18279) 2025-09-22 18:31:52 +02:00
github-actions a16d651ba7 Fetch translations from Crowdin 2025-09-22 00:17:02 +00:00
pstef 8de17098d1 Ctr fixes (#18276) 2025-09-21 23:55:55 +02:00
github-actions b73d76445f Fetch translations from Crowdin 2025-09-21 00:16:56 +00:00
github-actions 19bbc713ed Fetch translations from Crowdin 2025-09-20 00:14:59 +00:00
Andre Leiradella aa89097cc0 Use RETRO_SAVESTATE_CONTEXT_RUNAHEAD_SAME_INSTANCE for rewind savestates (#18271) 2025-09-20 01:41:03 +02:00
BinBashBanana cfc59dbbd9 Improve GLSL ES version detection (#18272) 2025-09-20 01:06:35 +02:00
github-actions 7c7edb7191 Fetch translations from Crowdin 2025-09-19 00:16:05 +00:00
BinBashBanana f54bcf3ef4 Don't clear default core info on missing list (#18269) 2025-09-18 12:34:02 +02:00
github-actions 1ff174b885 Fetch translations from Crowdin 2025-09-18 00:14:50 +00:00
David G. F. 9504583ae5 Push room info to lobby when publicly hosting (#18267)
* Announce netplay player information to the lobby server

This information is optional and merely informational. The lobby
might ignore it (and it ignores it at the current version).

* Display lobby information on player/spectator counts
2025-09-18 01:33:35 +02:00
Eric Warmenhoven 4d87f25bf6 ios/tvos: stop including hid controller driver
it's left over from BTStack/cydia days
2025-09-17 13:33:20 -04:00
Colin Kinloch d2df617ed1 wayland: Move followup roundtrip out of registry::global (#18264) 2025-09-17 09:41:58 +02:00
Eric Warmenhoven 6fc0e56f05 fix compilation with xcode 26 2025-09-16 16:22:03 -04:00
Joe Osborn e416cfb763 Fix an off-by-one error in replay checkpoint loading. (#18261)
The issue is that a replay frame read on core frame K stores the
inputs for frame K along with the core state as of *the end of frame
K*, in other words the beginning of frame K+1. To fix it, and to make
sure existing replays play back properly, the `core_unserialize` call
in bsvmovie.c has been deferred to the following invocation of
`bsv_movie_read_next_events`, so that frame K+1 is deserialized just
before reading the inputs for frame K+1.

Some refactoring has also been done to simplify the number and timing
of calls to bsv_movie functions from runloop.c.
2025-09-16 19:57:12 +02:00
Joe Osborn 9c3966eb66 Fix use-after-free in gfx_widgets. (#18262)
Holding on to the task pointer is risky, because when the task queue
is popped a message is pushed but the task may be freed.  I made a
very small-scale fix to just the new use-after-free that started
happening with the alternative look.
2025-09-16 19:28:34 +02:00
Eric Warmenhoven 3fa2648ff3 net_http: remove unnecessary receive in connection pool polling (#18260) 2025-09-16 19:04:15 +02:00
BinBashBanana 1d63c4934e Fix OpenAL blocking regression (#18258) 2025-09-16 19:04:01 +02:00
github-actions 62a09b5a07 Fetch translations from Crowdin 2025-09-16 00:15:09 +00:00
zoltanvb db88400ee9 Changes up to 09-14 (#18254) 2025-09-15 06:06:14 +02:00
Eric Warmenhoven d2c6f80f69 sdl: add support for controller sensors (#18255) 2025-09-15 06:05:59 +02:00
github-actions 5aa36630bc Fetch translations from Crowdin 2025-09-14 00:16:44 +00:00
BinBashBanana a650525e6e Emscripten core switching (#18174)
* Emscripten core switching

* Update changelog

* Add comments (#18174)

* Better core switching for HTML dropdown
2025-09-13 18:56:53 +02:00
github-actions d049191990 Fetch translations from Crowdin 2025-09-13 00:14:37 +00:00
libretroadmin d11766a205 input_get_sensor_state - cleanup 2025-09-12 09:11:05 +02:00
Eric Warmenhovenandoshaboy 2fe04daaea add settings for gyroscope/accelerometer sensitivity (#18245)
Co-authored-by: oshaboy <[email protected]>
2025-09-12 09:10:15 +02:00
libretroadmin c4b655a583 Rename success variables to ret 2025-09-12 05:41:22 +02:00
github-actions 3dfa5cb02d Fetch translations from Crowdin 2025-09-12 00:15:53 +00:00
libretroadmin 21776a2e59 Attempt to fix ffmpeg 8.0 build errors 2025-09-12 01:44:51 +02:00
libretroadmin 79f0b052c7 rename result variables to ret 2025-09-12 01:18:23 +02:00
libretroadmin f41f46726e ffmpeg3 - improved checks, change variable names from 'result' to
'ret'
2025-09-12 01:01:09 +02:00
libretroadmin b4bf792e24 Update documentation 2025-09-11 23:30:07 +02:00
libretroadmin ac8ab50ada Implement RETRO_ENVIRONMENT_GET_TARGET_SAMPLE_RATE - optional to implement.
Lets the core query the frontend for the desired target output samplerate.
Will return false if the output samplerate cannot be queried,  will return
true if it's implemented. data returned will be of unsigned type
2025-09-11 23:28:14 +02:00
github-actions a0732357ff Fetch translations from Crowdin 2025-09-11 00:15:53 +00:00
github-actions 41b144ef38 Fetch translations from Crowdin 2025-09-10 00:16:03 +00:00
sonninnos 89f15a7b0e Show File Browser Settings under Load Content according to setting 2025-09-09 17:14:08 +03:00
sonninnos 97f99c5f19 Task widget improvements (#18243) 2025-09-09 15:56:23 +02:00
Joe Osborn fa42321488 Seek backwards/forwards in replays by checkpoint (#18238)
* Add save checkpoint, prev/next checkpoint commands and hotkeys

* Fix copy paste error in meta binds

* Implement save_replay_checkpoint command

* Implement prev/next checkpoint commands

* Update per @jamiras review

* add command to seek to a specific frame number

* Add message queue toasts for seek forward/back

* Fix basis for seek, produce full message on reply

* fix bugs seeking back during record

* Tidy up

* Allow back and forwards seeking of recording replays while paused

* Update changelog
2025-09-09 07:53:08 +02:00
github-actions 3d7d6c93b5 Fetch translations from Crowdin 2025-09-09 00:15:57 +00:00
Eric Warmenhoven d95ed2343c macos: more attempts at correct modifier key handling
Fixes #13880
2025-09-08 15:30:25 -04:00
Eric Warmenhoven e69ee5af05 apple: netplay udp lan discovery 2025-09-08 13:58:32 -04:00
github-actions 5fd3c01325 Fetch translations from Crowdin 2025-09-08 00:16:36 +00:00
github-actions 1fbcf87f02 Fetch translations from Crowdin 2025-09-07 00:16:53 +00:00
Eric Warmenhoven 4ff2f1de0f ios/tvos: kscrash crash reporting 2025-09-06 18:42:52 -04:00
Eric Warmenhoven 989417d706 macos: fix startup on versions <13.0 2025-09-06 18:42:46 -04:00
github-actions a773c506b6 Fetch translations from Crowdin 2025-09-06 00:14:57 +00:00
sonninnos 4c9357fff0 Runtime logging cleanup 2025-09-05 18:37:32 +03:00
sonninnos 313f057fb7 Override logging cleanup 2025-09-05 18:14:46 +03:00
sonninnos 46db791ceb Ozone footer correction 2025-09-05 16:59:47 +03:00
github-actions 4159da6cc9 Fetch translations from Crowdin 2025-09-05 00:16:11 +00:00
Eric Warmenhoven b2ec648a71 ios: whoops, forgot to enable CloudDocuments entitlement. 2025-09-04 15:34:16 -04:00
sonninnos 0b11934691 Localize and log failed playlist launch 2025-09-04 16:59:58 +03:00
sonninnos 69d4c9ac85 Single-click playlist return from invalid path 2025-09-04 16:49:00 +03:00
sonninnos 8c39c8856b Single-click playlist return from failed launch 2025-09-04 16:28:43 +03:00
github-actions 6ee880614d Fetch translations from Crowdin 2025-09-04 00:15:01 +00:00
sonninnos f91d3d5bfb Prioritize slang over glsl in auto preset loader 2025-09-03 18:21:47 +03:00
Matt Akins bd56674b51 Add activity state detection to prevent parameter conflicts when resuming from home screen after external game launch (#18231)
* Simplified onNewIntent content detection logic and added activity state tracking

* Added activity state detection to prevent parameter conflicts when resuming from home screen
2025-09-03 16:16:07 +02:00
bulzipke 1834795e9b Remove east asian relay server (#18233) 2025-09-03 16:15:50 +02:00
sonninnos 7866687476 Invert custom viewport y position when suitable 2025-09-03 16:59:49 +03:00
sonninnos a17bf5ed39 Viewport bias padding offset fix 2025-09-03 04:30:52 +03:00
github-actions 30b36c5943 Fetch translations from Crowdin 2025-09-03 00:15:14 +00:00
sonninnos 3d007f9afc Autoconf menu toggle fix 2025-09-02 23:14:31 +03:00
sonninnos 098fe99ded Viewport bias custom aspect fixes 2025-09-02 21:18:02 +03:00
sonninnos c32aa80cea Shader toggle cleanup 2025-09-02 20:20:14 +03:00
sonninnos c93af63186 Widget icon color adjustments 2025-09-02 16:46:20 +03:00
sonninnos 5c981d3f5c Single-click playlist hold delay timer 2025-09-02 12:57:37 +03:00
github-actions a684db7b17 Fetch translations from Crowdin 2025-09-02 00:16:25 +00:00
sonninnos 9c604a2814 Preserve Explore location on close content hotkey 2025-09-01 21:41:22 +03:00
sonninnos e2ff006ad7 Single-click playlist Explore fixes 2025-09-01 21:20:49 +03:00
sonninnos 05b24cce09 Single-click playlist contentless core return fix 2025-09-01 21:20:49 +03:00
Eric Warmenhoven a7f1107631 apple: better verbosity refactor 2025-09-01 10:47:27 -04:00
Eric Warmenhoven 69668a2afc apple: refactoring verbosity for apple platforms 2025-08-31 23:24:06 -04:00
github-actions a990bb38fa Fetch translations from Crowdin 2025-09-01 00:19:10 +00:00
sonninnos f5b63a4bb7 Kiosk mode fixes (#18224) 2025-09-01 00:59:11 +02:00
sonninnos 601fd41ba5 Fix single-click playlist Enter select 2025-08-31 14:52:36 +03:00
github-actions f01b6063a9 Fetch translations from Crowdin 2025-08-31 00:17:38 +00:00
sonninnos 03c63c581f Ozone: Animation blocking fix 2025-08-31 02:11:05 +03:00
sonninnos 42ccdc0d25 Fix single-click playlist mouse select 2025-08-31 01:21:49 +03:00
sonninnos 3ebc2f7db2 Also ignore initial mouse position after refresh rate change 2025-08-30 22:17:52 +03:00
Joe Osborn ab898468be Do not skip over frame backrefs for version-1 and older movies (#18220) 2025-08-30 21:27:42 +03:00
Joe Osborn e341333593 Fix crashes when scanning rdb/rmsgpack files using stack storage (#18219)
I had mistakenly allocated only 128 bytes, not 128 * sizeof(pointer) bytes.
2025-08-30 21:27:14 +03:00
sonninnos ec573825b8 Add 'Single-Click Playlists' option (#18218) 2025-08-30 19:38:12 +02:00
Joe Osborn 9b4168deff Deprecate intfstream_open_writable_memory (#18216) 2025-08-30 12:35:29 +02:00
Joe Osborn 5b6c93a5bc Incremental statestream checkpoints for replays (#18213) 2025-08-30 12:35:08 +02:00
github-actions 7c30935ed6 Fetch translations from Crowdin 2025-08-29 00:16:32 +00:00
Eric Warmenhoven a1d830f7c4 apple: allow for updated mbedtls library 2025-08-28 16:01:47 -04:00
Matt Akins 699b808b4c Add onNewIntent handler to support launching games with FLAG_ACTIVITY_CLEAR_TOP (#18210)
Enables launchers to use the FLAG_ACTIVITY_CLEAR_TOP launch flag to open games. It checks if the launched game is already running or if it's a new game to launch over the existing one. This provides an alternative to launchers using FLAG_ACTIVITY_CLEAR_TASK which results in a crash on many Android 13 devices if RetroArch is already running in the background.
2025-08-28 02:17:32 +02:00
github-actions 2494e9af6f Fetch translations from Crowdin 2025-08-28 00:16:14 +00:00
sonninnos 5a29ee2c8f Auto-enable GPU record with HW context cores (#18209) 2025-08-27 18:51:53 +03:00
sonninnos 8a86817047 Shader menu rework (#18208) 2025-08-27 13:22:58 +02:00
sonninnos aa1988088c Non-unified dupe key event fix 2025-08-27 05:34:40 +03:00
Eric Warmenhoven a1de9d2051 apple: fix ffmpeg camera driver (#18203) 2025-08-26 22:53:35 +02:00
github-actions a5b06a3885 Fetch translations from Crowdin 2025-08-26 00:16:22 +00:00
sonninnos f4dc12e323 Add 'No items' item to empty Main Menu 2025-08-26 02:44:56 +03:00
sonninnos 8a72e2b1a7 Remote RetroPad:
- Core option variable check in retro_run
- Reset validated states on reset
- Tab cleanups
2025-08-26 02:22:38 +03:00
sonninnos d3c81605be Ozone: Background opacity fix 2025-08-26 01:40:13 +03:00
sonninnos d5c3b1cc1a Allow dupebinding menu toggle and hotkey enabler (#18202) 2025-08-26 01:37:11 +03:00
zoltanvb b54b95a04d Fix for potential crash in autodetect (#18198) 2025-08-25 12:07:38 +02:00
zoltanvb 84c5722180 Change list update until 2025-08-22 (#18193) 2025-08-24 10:36:19 +02:00
gouchi d1e36d9f11 Update com.libretro.RetroArch.desktop (#18195) 2025-08-24 10:36:09 +02:00
Eric Warmenhoven 3f21e88f09 apple: include ClownMDEmu in App Store builds 2025-08-23 23:29:33 -04:00
github-actions 6e4924bce6 Fetch translations from Crowdin 2025-08-24 00:18:06 +00:00
zoltanvb 5ac96e8c62 Refine input driver selection: enable fallback to linuxraw in more cases. (#18196) 2025-08-24 00:57:58 +02:00
github-actions 6c120d07a8 Fetch translations from Crowdin 2025-08-22 00:16:25 +00:00
zoltanvb f7877df578 Extend autoconfig matching with a physical identifier (#18190) 2025-08-21 18:13:37 +02:00
github-actions 853bd62730 Fetch translations from Crowdin 2025-08-21 00:15:26 +00:00
github-actions 42b33fd1c4 Fetch translations from Crowdin 2025-08-19 00:16:29 +00:00
github-actions cd6ee1b251 Fetch translations from Crowdin 2025-08-18 00:18:40 +00:00
sonninnos adc8739ccb msg_hash reorderings and cleanups 2025-08-17 17:39:56 +03:00
BinBashBanana 1cf24c5afe update emscripten get_proc_address (#18180) 2025-08-17 06:34:40 +02:00
sonninnos 79dbd3f1c0 Add option for returning to Main Menu from tabs (#18184) 2025-08-17 06:34:07 +02:00
github-actions c31727344a Fetch translations from Crowdin 2025-08-17 00:18:32 +00:00
github-actions e6328b5707 Fetch translations from Crowdin 2025-08-16 00:16:02 +00:00
sonninnos 631eca2ba6 Content load failure logging cleanup 2025-08-15 18:13:32 +03:00
sonninnos 07f8777fa5 More widget category type corrections 2025-08-15 17:41:03 +03:00
sonninnos 79b5778c7a Menu Remember Selection ifdef cleanup 2025-08-15 16:17:17 +03:00
sonninnos dc782cadb2 Widget message error type corrections 2025-08-15 16:12:51 +03:00
sonninnos ac47eb2bce Increase playlist sublabel tmp size (#18177) 2025-08-15 15:49:59 +03:00
sonninnos 3111f62521 Add menu startup page option (#18175) 2025-08-15 13:37:20 +02:00
github-actions 44746d541b Fetch translations from Crowdin 2025-08-15 00:17:50 +00:00
Aleksey Samoilov f0370a1bfb ui/qt6: replace deprecated count() with size() (#18169)
* Bump required wayland-protocols

* ui/qt: replace deprecated count with size
2025-08-12 20:35:14 +02:00
github-actions e31f9c2963 Fetch translations from Crowdin 2025-08-12 00:17:11 +00:00
Eric Warmenhoven a35f91d95f apple: AppIntents (Siri, Shortcuts) (#18167) 2025-08-11 21:41:11 +02:00
zoltanvb 9c9f5aa8d0 Touchscreen support for PS Vita (#18165) 2025-08-11 10:47:44 +02:00
sonninnos 887effcb76 Smaller widget size for refresh rate change 2025-08-10 15:20:28 +03:00
sonninnos b00ae41e41 Logging format unifications 2025-08-10 15:18:42 +03:00
sonninnos 7cdb5aefaf No core reloading without dynamic 2025-08-10 15:13:14 +03:00
sonninnos 80319a9918 GLUI: Show thumbnails in Explore (#18166) 2025-08-10 15:10:01 +03:00
github-actions 719a643fb2 Fetch translations from Crowdin 2025-08-10 00:19:18 +00:00
Eric Warmenhoven e6514de3a7 (audio) minor follow up fix to 3aa8db2.
Fixes #18164
2025-08-09 11:58:02 -04:00
Eric Warmenhoven c404e22a79 apple: default audio/mic drivers are coreaudio 2025-08-07 23:11:25 -04:00
Eric Warmenhoven 4bdaf7fd4c Merge pull request #18162 from warmenhoven/warmenhoven/pr/macOS-Core-Audio-Mic-Fix
macos coreaudio mic fix
2025-08-07 22:56:03 -04:00
Eric Warmenhoven 752de1e2c5 Merge remote-tracking branch 'libretro/master' into warmenhoven/dev/macOS-Core-Audio-Mic-Fix 2025-08-07 22:51:24 -04:00
Eric Warmenhoven 282308d800 macos: fix coreaudio mic default device 2025-08-07 22:51:03 -04:00
libretroadmin 5e6a2984c7 Replace some usage of strchr with memchr 2025-08-08 04:12:08 +02:00
libretroadmin 07388c5ab2 slang_get_include_file - avoid strlen call 2025-08-08 03:51:41 +02:00
libretroadmin 448b6e3aa0 (net_http) Style nits/cleanups 2025-08-08 03:39:33 +02:00
libretroadmin 23d1e4977a net_http_urlencode_full - exit out of the loop after the last slash
isntead of always iterating over it 3 times
2025-08-08 03:20:51 +02:00
Eric Warmenhoven 9728e5914d Merge remote-tracking branch 'libretro/master' into warmenhoven/dev/macOS-Core-Audio-Mic-Fix 2025-08-07 18:04:21 -04:00
刘皓 6775559c25 Fix deadlock in flush_wayland_fd() when using Wayland Vulkan driver (#18161) 2025-08-07 21:41:49 +02:00
libretroadmin b6c5615c58 (configuration.c) Remove more gotos 2025-08-07 18:55:46 +02:00
libretroadmin 57cf4011ec Reduce gotos in command.c/core_backup.c 2025-08-07 18:42:38 +02:00
libretroadmin 3aa8db2c08 (Audio) SOme control flow changes (no functional changes) and some cleanups 2025-08-07 17:35:00 +02:00
libretroadmin e3a5c5ea46 (XAudio2) Don't make xa_use_float hardcoded anymore 2025-08-07 16:24:33 +02:00
github-actions 31e54cabfe Fetch translations from Crowdin 2025-08-07 00:18:24 +00:00
刘皓 46045a1165 Fix FBO texture format in GLCore driver when using Cg/GLSL shaders (#18158) 2025-08-06 18:15:46 +02:00
Craig e4f1f25d10 webOS: Update to use new buildroot naming, add libatomic (#18157)
* webOS: add libatomic from toolchain for ppsspp

* webOS: Update naming scheme for buildroot
2025-08-06 18:15:29 +02:00
sonninnos 64c15f545f Use 'generic message' widget style in Disc Control 2025-08-06 15:29:02 +03:00
libretroadmin 9b6ddfb727 Turn iteration variables from unsigned to size_t or int 2025-08-06 08:04:11 +02:00
libretroadmin fe5ea7ad45 (rcheevos) CXX_BUILD compatibility 2025-08-06 04:53:00 +02:00
libretroadmin 7736095525 Update for CXX_BUILD 2025-08-06 04:44:32 +02:00
libretroadmin 4f70c5aa2a We dont need to use av_strlcpy - we already have libretro-common
strlcpy
2025-08-06 03:25:54 +02:00
libretroadmin b5530658a4 (Record FFMPEG) Get rid of all the cplusplus ifdefs 2025-08-06 03:21:02 +02:00
sonninnos 8376b06611 Fix broken replay checkpoint interval dropdown 2025-08-06 04:05:56 +03:00
sonninnos d5b33d8e29 Do screenshot widget aspect ratio correction always 2025-08-06 03:55:23 +03:00
sonninnos b129c605f6 Remove useless dupe rec state ptr get 2025-08-06 03:50:20 +03:00
sonninnos 39f840eedc Disable overlay mouse cursor by default 2025-08-06 03:43:31 +03:00
sonninnos 3164cdb352 Tab cleanup 2025-08-06 03:40:39 +03:00
sonninnos 02e932e21f Allow full savestate support without info file 2025-08-06 03:40:39 +03:00
github-actions 129616be88 Fetch translations from Crowdin 2025-08-06 00:18:18 +00:00
libretroadmin 9e78ad0c88 (AVFoundation/Camera) Fix some header includes 2025-08-06 01:01:36 +02:00
libretroadmin cf3de275a3 (FFMPEG) Linker fixes for CXX_BUILD 2025-08-06 00:59:11 +02:00
libretroadmin 50e8308027 CXX_BUILD buildfix for shader_Gl3 2025-08-06 00:42:28 +02:00
libretroadmin 661e5b55cb Some more malloc/realloc casts for C++ 2025-08-06 00:31:42 +02:00
libretroadmin 151d49311d Some CXX_BUILD buildfixes 2025-08-06 00:12:21 +02:00
libretroadmin 6efdb108ae Naming convention standardizations 2025-08-05 22:54:18 +02:00
libretroadmin 98d4d5faec slang_preprocess_parse_parameters - no more gotos 2025-08-05 22:11:50 +02:00
libretroadmin 8181583298 Try to reserve 'error' keyword for goto labels, use 'err' for
variables and arguments instead
2025-08-05 21:02:49 +02:00
sonninnos 93bd70cd48 Don't overwrite existing builtin playlist 2025-08-05 21:38:11 +03:00
libretroadmin 21773761d7 Silence some more code analysis warnings 2025-08-05 20:05:25 +02:00
libretroadmin 52e6566300 Some code analysis fixes 2025-08-05 19:52:00 +02:00
sonninnos d67da2d1b1 State slot hotkey refactor (#18152) 2025-08-05 19:47:11 +02:00
刘皓 351fd6a66b Destroy feedback framebuffer/texture when GLCore driver is destroyed (#18153) 2025-08-05 19:46:52 +02:00
libretroadmin 83c3e589e5 Fix OpenAL logs 2025-08-05 19:45:55 +02:00
libretroadmin 27f27c351f Turn C++ comments to C comments 2025-08-05 19:14:03 +02:00
刘皓 c8ab73607c Add support for Cg and GLSL shaders in the glcore video driver (#18151) 2025-08-05 18:55:29 +02:00
libretroadmin 248af45eaf Fix more static code analysis warnings - bunch of garbage values
and double frees fixed in core_info.c
2025-08-05 17:51:25 +02:00
libretroadmin 1d4f663506 Silence code analysis warnings 2025-08-05 17:32:30 +02:00
libretroadmin a39ed1a822 (SDL_audio) Add missing header include 2025-08-05 07:27:36 +02:00
libretroadmin d59adf7643 (SDL_Audio) Add device_list_new/device_list_free 2025-08-05 07:09:22 +02:00
刘皓 65d617e378 Implement fallback OpenGL symbol loader for Linux devices with EGL < 1.5 (#18135)
* Implement fallback OpenGL symbol loader for Linux devices with EGL < 1.5

The `eglGetProcAddress` in old versions of EGL can only get extension
functions, so we need to supplement it with another symbol loader that
can get non-extension functions.

* Close `g_egl_gl_dll` if `egl_init_context()` fails

* Close `g_egl_gl_dll` when VideoCore driver is destroyed

* Defer loading of `g_egl_gl_dll` until needed

* Fix typo in `egl_destroy_gl_dll`

* Remove redundant `ptr` variable in `egl_init_context`

* Remove redundant call to `egl_destroy_gl_dll` in `egl_init_context`

* Remove another redundant call to `egl_destroy_gl_dll` in `egl_init_context`
2025-08-05 06:50:22 +02:00
libretroadmin 5477ad32f6 (OpenAL) You're able to select the audio device now from the menu
and for it to be set on the fly
2025-08-05 04:49:55 +02:00
libretroadmin babd363987 Style nits/cleanups - control flow refactors 2025-08-05 04:22:41 +02:00
sonninnos 44bd3b21d5 Error widget category and size corrections 2025-08-05 03:22:11 +03:00
github-actions f39914de4a Fetch translations from Crowdin 2025-08-05 00:18:29 +00:00
sonninnos 95df52bf6b Load content widget fixes and cleanups 2025-08-05 03:10:51 +03:00
libretroadmin c14708e3ed (libretro-db) Get rid of goto 2025-08-05 00:01:35 +02:00
libretroadmin 546388a5bd Reduce some gotos in tasks 2025-08-04 23:34:53 +02:00
libretroadmin 274139dff1 (tasks) Get rid of some gotos 2025-08-04 23:34:53 +02:00
sonninnos 38fa199f7a Put these core info init things back 2025-08-05 00:23:32 +03:00
sonninnos 5fb551ae2e XMB: Fix dynamic wallpaper unwanted reset 2025-08-04 23:43:38 +03:00
sonninnos 85d59c0b65 XMB: Make sure wallpaper path is empty on init 2025-08-04 23:20:13 +03:00
sonninnos 139dd38f9d Always use the same swap button default 2025-08-04 21:42:11 +03:00
libretroadmin 10c6d45850 vulkan_draw_quad - buildfix 2025-08-04 19:42:55 +02:00
libretroadmin 7dabae94c5 Buildfix 2025-08-04 19:40:24 +02:00
libretroadmin 03dbcc53e7 Get rid of superfluous macros around memcmp and strcpy 2025-08-04 19:30:03 +02:00
sonninnos 563b687db8 Auto+entry state sanity checks and reorderings 2025-08-04 19:17:12 +03:00
Eric Warmenhoven 8b11aec44d apple: include gam4980 core in App Store builds 2025-08-04 07:45:53 -04:00
libretroadmin e3435221d8 (OpenAL) Implement device_list_new/device_list_free 2025-08-04 07:49:26 +02:00
libretroadmin d9d951b92e Silence another warning 2025-08-04 07:14:10 +02:00
libretroadmin 917e29c039 Try to silence some more warnings 2025-08-04 06:57:29 +02:00
libretroadmin 86e65d10be (XAudio2) Buildfix, and implement non-mmdevice codepath for querying
the samplerate of the device
2025-08-04 06:49:16 +02:00
sonninnos d66dd00078 RGUI: Layout + date format adjustments (#18147) 2025-08-04 06:39:32 +02:00
libretroadmin cb9ed749db (XAudio) Replicate behavior of WASAPI - selecting the audio
device will set the samplerate set by the OS as well
NOTE: There is still something wrong with the XAudio2 driver
and the 'devices' it enumerates and shows in the menu. It seems
the index is wrong, i.e. the entries seem swapped around. This
was an issue even before this commit. WASAPI seems to work correctly
2025-08-04 05:33:06 +02:00
github-actions 780eac62e6 Fetch translations from Crowdin 2025-08-04 00:25:08 +00:00
libretroadmin fc98e894a6 Fix Griffin builds - MMDevice should be OK from Vista and up 2025-08-04 01:34:58 +02:00
libretroadmin 732f598fd0 Define LEGACY_WIN32 only in the files that need it 2025-08-04 00:54:15 +02:00
libretroadmin 537712a634 (MMDevice) Changes:
* Add mmdevice_samplerate
* _WIN32_WINNT checks will fail on modern MSYS2/MIngw-w64 setups (Win10/11) -
_WINN32_WINNT will be 0x0601 (1537) - i.e. Win7 and up. We can assume MMDevice
is available since Vista, so lower these checks to Vista and up
2025-08-03 22:07:33 +02:00
libretroadmin 1cb78161a6 (WASAPI/MMDevice) Move MMDevice specific code over to mmdevice_common.c 2025-08-03 16:34:35 +02:00
zoltanvb 3706c3b22d Enable sdl12-compat and sdl-compat detection (#18142) 2025-08-03 15:47:08 +02:00
Eric Warmenhoven 7dc3d1ed9b ios9: fix loading cores 2025-08-03 00:47:18 -04:00
sonninnos 0990e25022 Auto load state playlist entry band-aid 2025-08-03 05:23:38 +03:00
libretroadmin 51cc74d0e0 (Xaudio2) Move the set wave format up earlier before CreateMasteringVoice,
override the 'sampling rate' variable, and set the new sampling rate in
case it gest overwritten by a new value. Next step will be to query the
OS device's default sampling rate and use that
2025-08-03 02:42:19 +02:00
github-actions a30b3ce1e2 Fetch translations from Crowdin 2025-08-03 00:19:32 +00:00
sonninnos 5eca25067a Add play count to runtime log (#18141) 2025-08-03 01:19:37 +02:00
sonninnos 405c3476f5 Save state slot improvements (#18140)
* Stop polluting playlists with redundant entry_slot numbers

* Playlist entry_slot improvements and cleanups

* Save current state slot to runtime log
2025-08-02 23:38:18 +02:00
libretroadmin ecbc05de6b (Audio drivers) Some cleanups 2025-08-02 21:18:50 +02:00
libretroadmin a018f54559 (DirectSound) Set DirectSound back to signed 16bit integer 2025-08-02 19:27:12 +02:00
libretroadmin f8e35e5f11 (DirectSound) Some refactors 2025-08-02 19:25:46 +02:00
libretroadmin a3754306c9 (WASAPI) Unique namespacing of functions
(XAudio2) More logging
2025-08-02 18:41:13 +02:00
Jamiras 0e3c82ecd6 use new hook for chd intercept (#18139) 2025-08-02 18:11:47 +02:00
libretroadmin 84b07468f3 (Xaudio2) Refinement of initialization code - add some logs and make it more
like WASAPI
2025-08-02 18:09:46 +02:00
libretroadmin e7944cc1a8 (XAudio) xa_write - return what is being written 2025-08-02 16:35:15 +02:00
libretroadmin 24eb75dda0 (audio) Audio chunk sizes in this file seem to be only used for
cores that implement non-batch audio callback
2025-08-02 15:22:43 +02:00
libretroadmin d89988f7d7 (GX) Move audio chunk size defines to gx_audio.c 2025-08-02 15:07:49 +02:00
libretroadmin a485bf7f16 Namespace cleanups and style nits 2025-08-02 15:00:43 +02:00
libretroadmin 63a146f0ea (Pipewire) Namespace all static globals and functions with 'pwire_' 2025-08-02 14:23:15 +02:00
libretroadmin 3e29213d5e (WASAPI) Fix mistake 2025-08-02 07:58:44 +02:00
zoltanvb 108bbc3879 Favor mouse coordinates for lightgun on Android. (#18134)
If mouse is detected, use the respective coordinates for reporting lightgun state.
Coordinate conversion adjusted to other input drivers.
2025-08-01 22:18:27 +02:00
libretroadmin 83cdca400b Turn iteration variables into int/size_t types 2025-08-01 21:53:52 +02:00
libretroadmin 320bb32406 use int types for iteration variables 2025-08-01 20:20:06 +02:00
libretroadmin 88e0a0e8ca return variable name consistency 2025-08-01 19:52:38 +02:00
libretroadmin 9567f3cbd9 (audioio) Add TODO/FIXME 2025-08-01 19:50:26 +02:00
libretroadmin ab47260fca (Audio) write functions - return variable name consistency 2025-08-01 19:48:34 +02:00
libretroadmin 34bc60e6d4 (openAL) More correct way of removing tmpbuf 2025-08-01 17:32:09 +02:00
libretroadmin 77185a734d (OpenAL) Unroll al_fill_internal_buf into al_write 2025-08-01 16:52:04 +02:00
libretroadmin dc2bf1226e (SDL_Audio) Make (reasonable) assumption that AUDIO_F32SYS (float)
is unavailable for SDL1
2025-08-01 16:25:51 +02:00
libretroadmin 4bcf5dd1a2 (SDL) Buildfix 2025-08-01 16:17:53 +02:00
libretroadmin 0f510fad39 Revert "(OpenAL) Don't need to copy into intermediary buffer anymore (tmpbuf)"
This reverts commit ab7a3e9ffa.
2025-08-01 16:16:54 +02:00
libretroadmin c6622f5f0a (OpenAL) Changes: don't need has_float variable anymore 2025-08-01 14:23:00 +02:00
libretroadmin 5d43932aee (SDL_Audio) Changes:
* Clean up some log messages
* More robust implementation of float/s16 buffer size determination
2025-08-01 14:20:52 +02:00
libretroadmin 5fec502174 (SDL_Audio) Changes:
* Put back log messages but this time implement them properly, we first
show the requested spec, then show the received spec afterwards
* Implement floating point sample support, should be more optimal
2025-08-01 14:16:18 +02:00
libretroadmin 80f2d91ef3 (SDL_Audio) Changes:
* sdl_microphone_find_num_frames - duplicate function
* Duplicate log message
2025-08-01 14:02:18 +02:00
libretroadmin ab7a3e9ffa (OpenAL) Don't need to copy into intermediary buffer anymore (tmpbuf) 2025-08-01 12:42:55 +02:00
libretroadmin ef69296be3 Rewrite al_fill_internal_buf - only call memcpy if 3rd argument
is non-0
2025-08-01 04:59:58 +02:00
libretroadmin 318e3ca9c1 (OpenAL) Bugfix: sizeof should be float for float sample format 2025-08-01 03:41:18 +02:00
libretroadmin 4d76e042ad (OpenAL) Implement float sample format support - query support with
alIsExtensionPresent("AL_EXT_FLOAT32")
2025-08-01 02:41:48 +02:00
libretroadmin 1e2500f736 (openAL) Changes:
* Don't use alGetError anymore in hot loop
* Turn off looping (doesn't seem to be needed?)
* Some loop optimization
2025-08-01 00:25:54 +02:00
libretroadmin 8f4990e835 (WASAPI) Changes/style nits:
* Value that gets returned gets called _len
* Less calls to macro FIFO_WRITE_AVAIL
2025-07-31 19:17:33 +02:00
libretroadmin 072d953b01 Only increment written if ir is > 0 2025-07-31 14:32:52 +02:00
libretroadmin b425abd0bb (WASAPI) Small cleanups:
* written variable changed from 'ssize_t' to 'size_t'
* for loop rewritten to while
2025-07-31 14:26:55 +02:00
Fancy2209 817428b772 Fix psl1ght target of dist-cores.sh (#18130) 2025-07-31 11:39:38 +02:00
github-actions 1191c964b1 Fetch translations from Crowdin 2025-07-31 00:17:44 +00:00
Jamiras 3acebdac0a fix invalid pointer reference when iterator gets cloned (#18129) 2025-07-30 10:57:13 +02:00
github-actions 09b9aec72e Fetch translations from Crowdin 2025-07-30 00:18:24 +00:00
Eric Warmenhoven 77f2d8cce5 fix webOS github action 2025-07-28 22:15:25 -04:00
Eric Warmenhoven 1d17a50a9d ios: fix crash when scanning files 2025-07-28 21:52:51 -04:00
github-actions 4a256179ad Fetch translations from Crowdin 2025-07-29 00:19:49 +00:00
zoltanvb 85aa59dc4f Enable database filter for genre and region (#18122) 2025-07-28 10:48:06 +02:00
github-actions 5e5f047e5b Fetch translations from Crowdin 2025-07-27 00:19:32 +00:00
github-actions 58dcecea08 Fetch translations from Crowdin 2025-07-26 00:16:51 +00:00
github-actions 0747dc6eb0 Fetch translations from Crowdin 2025-07-25 00:18:00 +00:00
zoltanvb 7280859069 Change "Start in fullscreen" item name (#18116)
* Change "Start in fullscreen" item name

https://github.com/libretro/RetroArch/issues/9515

I agree that current wording does not cover the functionality, this may be better.

* Refine fullscreen menu items.
2025-07-24 05:26:41 +02:00
github-actions 2364ef7827 Fetch translations from Crowdin 2025-07-24 00:18:08 +00:00
libretroadmin 590a945cc2 fifo_read - only call memcpy if 3rd argument is greater than 0 2025-07-23 16:03:55 +02:00
Jamiras 3829672dc1 (cheevos) upgrade to rcheevos 12.0 (#18117) 2025-07-23 04:04:15 +02:00
sonninnos a86c031410 Make reset and close content follow quit confirm logic (#18118) 2025-07-23 04:03:54 +02:00
libretroadmin 312550f499 (task_content.c) Cut down on some gotos 2025-07-22 17:51:37 +02:00
libretroadmin d9dba4e376 Revert "(task_content) Silence warning"
This reverts commit c1862dccc8.
2025-07-22 17:29:13 +02:00
libretroadmin 8dfc31461e Revert "* task_content.c"
This reverts commit 9b1d67c03a.
2025-07-22 17:27:04 +02:00
libretroadmin 5ba1e7077e Revert "content_init - don't need the switch when error_enum is not null"
This reverts commit e18b01302d.
2025-07-22 17:26:54 +02:00
libretroadmin 4c3a88a2f8 Revert "No longer shows unnecessary content info runloop message"
This reverts commit a6b7cf459e.
2025-07-22 17:26:25 +02:00
libretroadmin 051c5cff77 Revert "(task_content.c) Get rid of some more unnecessary gotos"
This reverts commit 903501f183.
2025-07-22 17:26:15 +02:00
libretroadmin 13c6eb53c9 Some more static code analysis fixes/cleanups 2025-07-22 17:17:20 +02:00
libretroadmin c1862dccc8 (task_content) Silence warning 2025-07-22 16:43:45 +02:00
libretroadmin 903501f183 (task_content.c) Get rid of some more unnecessary gotos 2025-07-22 16:42:23 +02:00
libretroadmin a6b7cf459e No longer shows unnecessary content info runloop message 2025-07-22 16:02:16 +02:00
libretroadmin e18b01302d content_init - don't need the switch when error_enum is not null 2025-07-22 15:42:05 +02:00
libretroadmin 9b1d67c03a * task_content.c
* content_file_load refactor - simplify
* error_string no longer needs to be dynamically allocated, make
a small local string and pass it around
2025-07-22 15:39:46 +02:00
libretroadmin 9e31b35f1b (task_content) content_file_list_append_temporary - simplify 2025-07-22 15:14:43 +02:00
libretroadmin e453abc71b standardize return variable names 2025-07-22 14:36:50 +02:00
libretroadmin 327621938b Cut down on gotos 2025-07-22 14:16:31 +02:00
libretroadmin 341f6d3df4 task_autodetect - cleanups - get rid of gotos 2025-07-22 04:14:20 +02:00
LibretroAdmin 9e0b21da5e Revert "Optimize wastefully encoded raster image files (#18113)" (#18114)
This reverts commit af28b06d02.
2025-07-22 03:25:27 +02:00
Peter J. Mello af28b06d02 Optimize wastefully encoded raster image files (#18113)
Apply an aggressive set of ultimately deterministic optimizations to
raster image files where an actual file size reduction of not less than
50% was possible without the removal of intrinsic properties such as
alpha channels. Rendered image dimensions were always left unchanged.

The primary mechanisms employed during optimization are:
- PNG color mode conversion from TrueColor to indexed palette
  + Accomplished using NeuQuant neural-net color quantization algorithm
- Stripping of data blocks containing irrelevant information, such as:
  + XMP metadata fields
  + Embedded comment fields
  + ICC color profiles (simple graphics with basic color schemes only)
  + EXIF profiles
- Re-compression using "best" or "smallest" profile presets

All modifications are performed on lossless image formats and closely
visually inspected after processing to ensure no loss of apparent
details or introduction of new, unwanted artifacts.

Toolset used:
- RIOT (Radical Image Optimization Tool), v2024.1.0 64-bit
- AdvanceCOMP (part of the Advance Projects), v2.6 64-bit
- optiPNG, v7.9.1 64-bit
- PNGOUT, v2015.02.13 32-bit

Signed-off-by: Peter J. Mello <[email protected]>
2025-07-22 03:15:29 +02:00
sonninnos d452cb843b Database scan logging cleanups 2025-07-22 03:50:27 +03:00
sonninnos 5afbd5f53d Widget color unifications 2025-07-22 03:40:17 +03:00
github-actions 26293387c4 Fetch translations from Crowdin 2025-07-22 00:18:18 +00:00
sonninnos d3756624c8 Menu ticker spacer simplifications 2025-07-22 01:47:14 +03:00
libretroadmin 4b77ad663a task_content.c - small cleanups, initialize variables being passed 2025-07-21 05:59:09 +02:00
libretroadmin e24ca9da66 (task_content.c) replace one magic number 2025-07-21 05:38:18 +02:00
libretroadmin f1198c65a3 (task_content.c) Get rid of some of the obtuse macros 2025-07-21 05:20:46 +02:00
github-actions d99d8a8547 Fetch translations from Crowdin 2025-07-21 00:19:14 +00:00
sonninnos 2153ab55ad Ozone Buildfix 2025-07-20 21:52:30 +03:00
sonninnos 9ab7cd6a62 Ozone: Fix sidebar non-playlist font ticker 2025-07-20 21:38:47 +03:00
sonninnos 8e30bbe3e2 Fix quick playlist manager builtin paths 2025-07-20 21:04:46 +03:00
libretroadmin eb6f0c8dba Get rid of winraw_scancodes enums 2025-07-20 12:52:12 +02:00
libretroadmin dc9ffcce66 (sinc resampler) style nits 2025-07-20 09:37:15 +02:00
libretroadmin 99fe15be46 Fix wasapi_microphone 2025-07-20 08:31:12 +02:00
libretroadmin 7b66dec4f0 core_info_list_new - fix potential leak on error 2025-07-20 08:24:18 +02:00
libretroadmin b0e344a423 Silence some code analysis warnings 2025-07-20 08:11:36 +02:00
libretroadmin 6182e39938 Split libretro_d3d.h up into two separate files 2025-07-20 06:26:12 +02:00
libretroadmin d821ce1062 Some UCRT64 buildfixes 2025-07-20 06:19:58 +02:00
LibretroAdmin 26b806f860 Rewrite file_list_insert - use memmove instead of a malloc and copy (#18097)
* Rewrite file_list_insert - use memmove instead of a malloc and copy

* Use INLINE keyword - C89 buildfix
2025-07-20 05:22:49 +02:00
libretroadmin fa2ce70c5b fifo_write - only do second memcpy call if rest_write > 0 2025-07-20 03:26:50 +02:00
libretroadmin 954d202637 string_remove_all_chars - only write if the character is not the
one to remove
2025-07-20 03:14:20 +02:00
libretroadmin 02f3f31121 scaler_gen_filter - small simplification 2025-07-20 02:38:04 +02:00
github-actions 974c016241 Fetch translations from Crowdin 2025-07-20 00:19:40 +00:00
LibretroAdmin e011e710bd Make last_slash concatenation parts consistent (#18102) 2025-07-19 23:37:31 +02:00
libretroadmin ff652ce22d Fix typo 2025-07-19 22:54:51 +02:00
libretroadmin f8840774e3 (WASAPI) Get rid of IFACE_RELEASE macro 2025-07-19 22:51:49 +02:00
libretroadmin 99e7a80314 Inline uwpgdi.h into wgl_ctx.c 2025-07-19 21:59:54 +02:00
libretroadmin 4b5b214dea Move gdi_texture to gdi_gfx.c 2025-07-19 21:51:58 +02:00
libretroadmin 8ecb7eefd7 Merge rsx_defines.h into rsx_gfx.c 2025-07-19 21:47:56 +02:00
libretroadmin c9452d9263 (d3d9_common) Simplifications 2025-07-19 21:41:22 +02:00
neil4 c89a44b15b Overlays: Dedicate each touch pointer to hitboxes or pointing devices (#18108)
- A touch pointer controlling the mouse/lightgun/pointer will ignore hitboxes if it slides into any.
- A touch pointer pressing a button will not control the mouse/lightgun/pointer if it slides out of the hitbox.
2025-07-19 20:20:29 +02:00
zoltanvb e04985162a Change list update up to July 18. (#18107) 2025-07-19 20:18:48 +02:00
libretroadmin 0efe022e9d Remove audio/common/alsathread.h 2025-07-19 20:18:06 +02:00
libretroadmin ae8dfc789d (CTR) Buildfix #2 2025-07-19 10:16:22 +02:00
libretroadmin dd5dc60520 (CTR) Attempted buildfix 2025-07-19 10:10:17 +02:00
libretroadmin d500a3ecc7 Remove some more gfx/common/ define files 2025-07-19 09:59:54 +02:00
Viačasłaŭ 43cec217b9 PipeWire buildfix (#18106) 2025-07-19 09:44:18 +02:00
libretroadmin 55a7e07959 Remove d3d8_defines.h 2025-07-19 07:03:59 +02:00
libretroadmin 9308f6650c (GX2) Header buildfixes 2025-07-19 07:00:21 +02:00
libretroadmin cb2f0ecbd2 Merge files 2025-07-19 06:58:33 +02:00
libretroadmin eff70a32e5 Merge D3D10 common files into D3D drivers 2025-07-19 05:07:42 +02:00
libretroadmin 59fd200b2c Merge files 2025-07-19 04:58:35 +02:00
libretroadmin d17f6eee1e Buildfixes 2025-07-19 04:53:32 +02:00
libretroadmin d86c1a89b8 Move structs to needed file 2025-07-19 04:42:10 +02:00
libretroadmin 9542a71c89 Move defines to source files 2025-07-19 03:41:09 +02:00
github-actions fb6f6467e0 Fetch translations from Crowdin 2025-07-19 00:16:50 +00:00
sonninnos 9187520222 Move SET_ROTATION env call to info log level 2025-07-19 02:53:02 +03:00
LibretroAdmin 58b686f661 Go back to old rthreads TLS code for now 2025-07-18 18:18:30 +02:00
LibretroAdmin 25546f864a Revert "Move code around"
This reverts commit a018f935d0.
2025-07-18 18:16:27 +02:00
LibretroAdmin b156ce2a42 Revert "Get rid of Inout_opt_bytecount"
This reverts commit 40671b293e.
2025-07-18 18:16:19 +02:00
LibretroAdmin 40671b293e Get rid of Inout_opt_bytecount 2025-07-18 17:46:40 +02:00
LibretroAdmin a018f935d0 Move code around 2025-07-18 17:24:46 +02:00
LibretroAdmin 57a8a731da More UCRT buildfixes 2025-07-18 16:07:10 +02:00
LibretroAdmin c9931cd936 Merge microphone drivers (#18103)
* Merge microphone drivers

* Some buildfixes

* * Merge audio/common/wasapi.c into audio/drivers/wassapi.c
* Buildfix for alsa/drivers/alsathread.c

* Merge more files

* Attempted buildfix

* Try to use enum values instead of eRender/eCapture

* Simplification of mmdevice_name
2025-07-18 15:47:31 +02:00
LibretroAdmin 25edbe17d2 Some UCRT buildfixes 2025-07-18 13:44:56 +02:00
libretroadmin 8bd60af8b7 Put input_st variable behind HAVE_BSV_MOVIE ifdef 2025-07-18 11:26:05 +02:00
libretroadmin cc408864af Silence some code analysis warnings 2025-07-18 10:06:16 +02:00
libretroadmin cd0f159238 Static code analysis warning fixes 2025-07-18 09:26:26 +02:00
LibretroAdmin 180b39cd3d Merge pull request #18100 from saulfabregwiivc/lvorbis-link-libogc-platforms
allow passing HAVE_OGG_OGC to link to needed OGG libs in PPC portlibs on libOGC platforms (GameCube/Wii), needed for a few cores.
2025-07-18 08:13:20 +02:00
LibretroAdmin 6019fc863b Merge pull request #18101 from RogueScholar/desktop-entry-file
Add full complement of key/value pairs to Desktop Entry file
2025-07-18 08:12:29 +02:00
libretroadmin 80b3ccebba Silence some static code analysis warnings + code formatting/style nits 2025-07-18 08:11:25 +02:00
Peter J. Mello a4535c4eac Add all relevant KV pairs to Desktop Entry file
This commit extends the RetroArch desktop entry
file—responsible for integrating the app with
Linux desktop environments—to include all relevant
properties. Some notable aspects:

- **`TryExec`**/**`Exec`**: TryExec _should_
  contain the canonical path to the executable,
  however the RA buildsystem lacks a ready
  mechanism for populating the correct value for
  the target at build time, so we fallback to
  searching $PATH here. To Exec we add the %F
  token, meaning that RA is a "file handler" that
  users are able to drag files onto the launcher
  icon that become arguments to the launch command.
- **`MimeType`**: This key determines which file
  extensions the system should offer to open with RA.
  It should be regularly reviewed for any new MIME
  registrations which need to be represented going
  forward.
- **`PrefersNonDefaultGPU`**: Linux by default offers
  hardware to processes in order from least capable to
  most performant. This key reverses that behavior so
  more demanding emulation cores will run more
  smoothly.
- **`SingleMainWindow`**: Changes the default behavior
  when the launcher is clicked while an instance is
  already running from launch a second instance to
  elevate the main window of the already running one.

Version 1.5 of the Freedesktop [Desktop Entry
Specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/) was the reference for these changes.

Signed-off-by: Peter J. Mello <[email protected]>
2025-07-18 03:54:57 +01:00
github-actions dddc66c797 Fetch translations from Crowdin 2025-07-18 00:17:38 +00:00
libretroadmin b23cbf0a57 glslang_read_shader_file - small cleanup 2025-07-18 01:58:40 +02:00
libretroadmin 2f5d95b0cf Move non-essential string_list functions out of file 2025-07-18 01:43:03 +02:00
saulfabreg Wii VC Project 5ed20207f5 allow passing HAVE_OGG_OGC to link to needed OGG libs in PPC portlibs, needed for a few cores. 2025-07-17 18:28:49 -05:00
libretroadmin 9ca8e1c1c1 * Change variable names for characters being written
* menu_cbs_sublabel - skip some unnecessary copies
2025-07-18 00:00:43 +02:00
libretroadmin ae2465f0db Variable name changes 2025-07-17 23:41:27 +02:00
libretroadmin d822cf58a1 C89_BUILD buildfix 2025-07-17 23:03:59 +02:00
libretroadmin ab9535c827 Code analysis cleanups/fixes 2025-07-17 22:28:48 +02:00
libretroadmin dd480aac94 Silence some more code analysis warnings 2025-07-17 12:33:47 +02:00
libretroadmin 4c07e26649 Code analysis fixes - fix some warnings and prevent garbage data 2025-07-17 12:11:31 +02:00
libretroadmin 162d00d73b (libretro-db) Fix code analysis warning 2025-07-17 10:29:58 +02:00
libretroadmin 7b093cc55e More code analysis warning fixes 2025-07-17 10:00:39 +02:00
libretroadmin 195c19a1c9 Fix more static code analysis errors/warnings 2025-07-17 09:44:19 +02:00
libretroadmin 03573db27c Some more static code analysis warning fixes 2025-07-17 09:09:30 +02:00
libretroadmin f45fd77d68 Fix errors and warnings pointed out by static code analysis (Clang) 2025-07-17 08:49:53 +02:00
libretroadmin c6d72062e2 remove dead code 2025-07-17 08:02:06 +02:00
LibretroAdmin 3f4fd3b086 Merge pull request #18099 from JoeOsborn/replay-same-timeline-check
Add "same timeline check" and "future state check" for replays
2025-07-17 07:17:54 +02:00
LibretroAdmin b7479e934b Merge pull request #18092 from JoeOsborn/replay-compress-checkpoints
Compress checkpoints in replays
2025-07-17 07:17:46 +02:00
libretroadmin efc1f7f8e1 Variable naming cleanups 2025-07-17 06:10:48 +02:00
libretroadmin 807866d799 Style nit 2025-07-17 05:54:24 +02:00
libretroadmin daeb46cf5a Variable name cleanups 2025-07-17 05:36:20 +02:00
libretroadmin cc826c4ca6 Cleanup some variable names and some other cleanups 2025-07-17 05:11:00 +02:00
libretroadmin d8725d77bb Small variable cleanups - should make no functional difference 2025-07-17 04:40:42 +02:00
Joseph C. Osborn 7c05359933 c89 fixes 2025-07-16 10:35:33 -07:00
Joseph C. Osborn 1cc76cd64d Add "same timeline check" and "future state check" for replays
When loading and saving states taken during a replay, their contents
should be compared with the current replay.

- If in playback mode, states from past the end of the current replay
should be disallowed, as should states from an alternate timeline of
the current replay (inconsistent input history)
  - This is because in playback mode, RA replays are read-only
- If in recording mode, states from the future or from another
timeline should overwrite the current replay's data with a warning
- In either playback or recording, loads of states from the past that
have a consistent series of inputs (same timeline) should be loaded
and the replay should be rewound (and truncated in case of recording)

This behavior is as specified in
https://tasvideos.org/LawsOfTAS/OnSavestates

The existing code only implemented some of these checks.
2025-07-16 10:09:09 -07:00
sonninnos 19f6d94a78 Limit core suggestion option only for dynamic platforms 2025-07-16 06:16:43 +03:00
LibretroAdmin df808f7663 Merge pull request #18095 from libretro/libretro-common-refactors
libretro-common refactors: file_path
2025-07-16 04:37:43 +02:00
github-actions c8cb58f1d2 Fetch translations from Crowdin 2025-07-16 00:17:38 +00:00
libretroadmin 2770470695 Rewrite find_last_slash - use one loop, skip two strrchr calls 2025-07-16 01:31:29 +02:00
libretroadmin 047f926540 use last_slash in file_path 2025-07-16 00:31:09 +02:00
libretroadmin d37068cfb8 Move code back 2025-07-15 23:35:37 +02:00
LibretroAdmin 3162b6a438 Merge pull request #18094 from pastalian/fix-disable-pipewire
Fix build with disable-pipewire on systems with pipewire installed
2025-07-15 18:35:53 +02:00
Takuya Wakazono 027564a0c9 Fix build with disable-pipewire on systems with pipewire installed
On systems where pipewire is installed but the build is configured with
--disable-pipewire, HAVE_PIPEWIRE_STABLE is set to 1 while HAVE_PIPEWIRE
is 0. Checking only HAVE_PIPEWIRE_STABLE leads to a build failure.

```
LD retroarch
/usr/lib/gcc/x86_64-pc-linux-gnu/15/../../../../x86_64-pc-linux-gnu/bin/ld: obj-unix/release/camera/camera_driver.o:(.data.rel+0x0): undefined reference to `camera_pipewire'
collect2: error: ld returned 1 exit status
```

Downstream Bug: https://bugs.gentoo.org/960043
2025-07-15 23:27:10 +09:00
Joseph C. Osborn 1e0c723ba3 Fix warnings under many platforms, unpack nested ifdefs in includes. 2025-07-15 07:25:09 -07:00
libretroadmin 14906fc489 Revert "- Cut down on strrchr calls inside loops"
This reverts commit f73d9dead3.
2025-07-15 09:30:13 +02:00
github-actions 6010c74559 Fetch translations from Crowdin 2025-07-15 00:17:55 +00:00
Joseph C. Osborn 6227156e73 Add new replay token type CHECKPOINT2
This can optionally encode and compress checkpoints.  For now, only
raw encoding is supported, but e.g. delta encoding, block-based
encoding, or deduplicated encoding could be supported in the future.

Three compression schemes are included (selected automatically based
on compilation flags): ZSTD, ZLIB, or NONE.

All three schemes are supported for decompression if available.

For compression, ZSTD is preferred over ZLIB is preferred over NONE.
2025-07-14 14:32:53 -07:00
Joseph C. Osborn 46be205b75 add zstd compression library (single-threaded only) 2025-07-14 14:32:48 -07:00
libretroadmin f73d9dead3 - Cut down on strrchr calls inside loops
- Replace string_replace_all_chars calls
2025-07-14 22:31:36 +02:00
LibretroAdmin 6fa73c3431 Merge pull request #18090 from JoeOsborn/fix-replay-rewind
fix three bugs with replays and rewinding
2025-07-14 19:31:53 +02:00
LibretroAdmin ad5a98f2d3 Merge pull request #18091 from JoeOsborn/emscripten-makefile-includedirs
Emscripten makefile should use INCLUDE_DIRS from Makefile.common
2025-07-14 19:31:30 +02:00
libretroadmin 4099b49483 (menu_cbs_title) SANITIZE_TO_STRING rewrite:
* Turn macro into function
* Don't use strchr (O(n^2), switch to single pass loop instead
2025-07-14 19:13:11 +02:00
libretroadmin 6e5e63b6d4 Reduce some strrchr double calls 2025-07-14 19:05:11 +02:00
libretroadmin 1cc0f3273f (file_path) Optimize find_last_slash:
* Do one loop iteration inside the function instead of two
strrchr(s) for finding the forward and backwards slash
2025-07-14 18:44:49 +02:00
libretroadmin 9b6641c951 (file_path) fill_pathname_join_special - small tweak 2025-07-14 17:37:33 +02:00
libretroadmin 2d632fed54 file_path changes:
* improve fill_pathname_slash, no longer call strlcat
  - strlcat call would have been done in strlcat regardless
2025-07-14 17:26:15 +02:00
Joseph C. Osborn 246caaec3f Emscripten makefile should use INCLUDE_DIRS from Makefile.common
With this change, HAVE_ZSTD or HAVE_CHD can successfully be set for
emscripten builds.

This mirrors how other Makefiles use Makefile.common.
2025-07-14 08:19:57 -07:00
Joseph C. Osborn 27f141a7a5 fix some bugs with replays and rewinding
- rewinding past the start clobbers part of the header
- during recording & rewind, should not push input events
- during recording or playback, getting to the end of the rewind
  buffer should not halt the movie
2025-07-14 08:09:25 -07:00
libretroadmin 3eb8589550 (file_list) Optimizations:
* file_list_insert - use memmove instead of malloc to add new
file item on top of the existing one
2025-07-14 17:04:44 +02:00
libretroadmin 9cfcc5ec8e Revert video_coord_array code 2025-07-14 06:00:44 +02:00
libretroadmin 215219dc51 Change libretro-common code back 2025-07-14 05:50:17 +02:00
libretroadmin 9c82213d19 Remove some else statements 2025-07-14 04:43:36 +02:00
libretroadmin b7db9a65af video_viewport_get_scaled_aspect2 - cleanup 2025-07-14 03:55:07 +02:00
libretroadmin 6010a53fec gfx_animation_ticker_loop - small refactor 2025-07-14 03:26:00 +02:00
libretroadmin 435849d00f (libetro-common) scaler simplifications 2025-07-14 03:00:08 +02:00
github-actions de298b18c4 Fetch translations from Crowdin 2025-07-14 00:18:31 +00:00
libretroadmin 3226361c1d Prevent some nbio windows mmap memory leaks when failing 2025-07-14 01:19:39 +02:00
libretroadmin 86b55c14ec (file_list)
Performance improvements:
* Various optimizations
* Reduced memory allocations - file_list_insert would call malloc
for every single item that would need to be shifted downwards. instead
it does a memmove call now
2025-07-14 00:17:12 +02:00
libretroadmin 2f9b0181dd video coord array improvements:
* single memory block allocation vs. several
* reduced memcpy calls
* simplified pointer arithmetic
* simplified code
2025-07-13 23:13:42 +02:00
libretroadmin f6da101330 (resampler) indentation cleanups 2025-07-13 18:40:11 +02:00
Eric Warmenhoven 43031d2154 apple: avfoundation camera driver fixes
better permissions check, delay starting camera until _start
2025-07-13 08:40:29 -04:00
libretroadmin de76511ee7 (file_path) Cleanups / refactors 2025-07-13 08:02:28 +02:00
LibretroAdmin 228f4b346d Merge pull request #18087 from neil4/overlay-fix-speed-limit
Fix input_overlay_track_touch_inputs
2025-07-13 06:24:53 +02:00
nfore dabf543cde Fix input_overlay_track_touch_inputs
- Fixes bug introduced in 31014e99c0. Unmatched pointers were not considered outliers
2025-07-12 22:59:16 -05:00
libretroadmin 55bada6bda Rewrite strlcpy - add early return for len == 0 2025-07-13 04:59:24 +02:00
libretroadmin 311a64a413 (audio_conversion) small cleanups 2025-07-13 03:21:13 +02:00
github-actions e683017f45 Fetch translations from Crowdin 2025-07-13 00:19:28 +00:00
libretroadmin 4973e47cac (Resampler) Style nits/cleanups 2025-07-13 01:59:36 +02:00
libretroadmin 04af1a1e98 Put header includes inside ifdef guard 2025-07-12 22:08:09 +02:00
LibretroAdmin 72ff77347f Merge pull request #18086 from neil4/overlay-touch-tracking-speed-limit 2025-07-12 21:27:47 +02:00
nfore 31014e99c0 Overlays: Put a speed limit on touch pointer tracking
A pointer is considered new if it travels ~25% of the screen in one poll.
2025-07-12 14:11:22 -05:00
libretroadmin 4a7b00f43e Rewrite string_list_join_concat and menu_entries_append function 2025-07-12 20:53:48 +02:00
libretroadmin 0d854fef31 remove strlcats from string_list_join_concat_special 2025-07-12 20:36:58 +02:00
libretroadmin cb02d1ffcf Stop using strlen_size, just use regular strlen 2025-07-12 20:27:41 +02:00
sonninnos 743e0406bd Environ logging cleanups 2025-07-12 08:41:54 +03:00
sonninnos 419007c1ca Smaller regular widget notification option (#18085) 2025-07-12 04:37:38 +03:00
github-actions 1808a38deb Fetch translations from Crowdin 2025-07-12 00:16:34 +00:00
Eric Warmenhoven 4bdb68b9d9 apple: fix coretext bounds checking 2025-07-11 11:57:34 -04:00
libretroadmin 2dbb9f62d8 * Change some variable naming conventions
* Make return control paths less dependent on variables
2025-07-11 02:15:12 +02:00
libretroadmin bca5cafaa6 Rewrite nested_list functio
Rewrite core_info function - no more strlcat usage
2025-07-10 22:34:45 +02:00
sonninnos b2ca569521 Logging unification cleanups 2025-07-10 05:59:06 +03:00
github-actions 40e3b56d04 Fetch translations from Crowdin 2025-07-10 00:17:32 +00:00
sonninnos 3885f4f8a5 Core updater logging cleanups 2025-07-09 17:49:24 +03:00
sonninnos d5a5681612 More room for widget task progress percentage 2025-07-09 17:45:26 +03:00
Eric Warmenhoven 47bc1188ae apple: fix some coretext alignment and rendering issues 2025-07-08 23:49:54 -04:00
Eric Warmenhoven d4fe2055f9 ios/tvos: no webserver/webdav server on simulator 2025-07-08 23:49:53 -04:00
sonninnos ac959fef26 Safety for menu_shader_get() 2025-07-08 22:36:38 +03:00
sonninnos 48f5677417 Auto Frame Delay tweaking 2025-07-08 19:53:21 +03:00
Eric Warmenhoven f10818b243 ios: fix iphone landscape rendering 2025-07-07 22:03:59 -04:00
libretroadmin 3e3f989d45 Turn some strlcats into strlcpy 2025-07-08 02:57:28 +02:00
github-actions 90f2c1f456 Fetch translations from Crowdin 2025-07-08 00:16:57 +00:00
Eric Warmenhoven d316c2cbc9 ipad: don't force fullscreen, allow multitasking 2025-07-07 10:36:26 -04:00
LibretroAdmin 0a2c1b2272 Merge pull request #18075 from warmenhoven/warmenhoven/pr/coretext
apple: fix coretext font renderer unicode handling, make default
2025-07-06 14:45:41 +02:00
LibretroAdmin 1dea6dfbf0 Merge pull request #18073 from XerTheSquirrel/fix-vfs-mmap-seekend
Correct SEEK_CUR and SEEK_END for memory mapped VFS files.
2025-07-06 13:56:35 +02:00
Eric Warmenhoven 7d09e380f4 apple: fix coretext font renderer unicode handling, make default 2025-07-06 01:07:03 -04:00
Eric Warmenhoven fd7f561fb6 griffin: fix debug build when including zstd 2025-07-06 01:07:02 -04:00
Eric Warmenhoven 0ca114701b fix webOS github action 2025-07-06 01:02:47 -04:00
github-actions 0ba251b7f2 Fetch translations from Crowdin 2025-07-06 00:18:47 +00:00
Stephanie Gawroriski 4704961eb9 Correct SEEK_CUR and SEEK_END for memory mapped VFS files as neither of their conditions were correct, SEEK_CUR never failed and SEEK_END effectively always failed. 2025-07-05 16:48:26 -04:00
Eric Warmenhoven 6046e29919 net_http: don't include port in Host header unnecessarily 2025-07-05 00:21:09 -04:00
github-actions f1d95f2deb Fetch translations from Crowdin 2025-07-05 00:15:54 +00:00
github-actions d165787296 Fetch translations from Crowdin 2025-07-04 00:16:56 +00:00
github-actions 68d8f98d47 Fetch translations from Crowdin 2025-07-03 00:17:11 +00:00
LibretroAdmin 5367d3ab63 Merge pull request #18065 from alphanu1/gameoride
CRT - Added Switchres Game Overrides
2025-07-02 12:05:04 +02:00
alphanu1 71dc58d20a Added Switchres Game Overrides 2025-07-01 21:07:27 +01:00
github-actions d8012c901b Fetch translations from Crowdin 2025-07-01 00:19:22 +00:00
LibretroAdmin c61845895e Merge pull request #18054 from webosbrew/feature/update-sdl
[webOS] Update to SDL 2.30.12
2025-06-30 23:49:40 +02:00
github-actions 135da9597b Fetch translations from Crowdin 2025-06-30 00:18:07 +00:00
sonninnos 1389c15280 Fix filestream_copy+cmp 2025-06-29 10:41:20 +03:00
github-actions d40625b87c Fetch translations from Crowdin 2025-06-28 00:16:06 +00:00
Eric Warmenhoven 371ddf5889 macos build fix 2025-06-27 15:33:04 -04:00
Eric Warmenhoven 9ff5aaa679 macos x86 build fix 2025-06-27 15:07:48 -04:00
Mariotaku 70a39217c1 set EGL_PLATFORM if not set 2025-06-28 00:41:30 +09:00
Mariotaku 6c2a2a1b2c Updated to SDL 2.30.12 2025-06-28 00:41:30 +09:00
Eric Warmenhoven eea37466fc apple: better mfi controller disconnect handling 2025-06-27 11:17:33 -04:00
Eric Warmenhoven 1e109e2927 apple: include zstd and nearest resampler 2025-06-27 11:17:25 -04:00
github-actions 4161099ddb Fetch translations from Crowdin 2025-06-27 00:17:02 +00:00
LibretroAdmin b365ab02a6 Merge pull request #18055 from JoeOsborn/rmsgpack-intfstream
Change RFILE to intfstream_t in libretro-db
2025-06-26 23:24:06 +02:00
Joseph C. Osborn f5e81aa01d Add more C files to libretrodb makefile 2025-06-26 10:15:57 -07:00
libretroadmin 6dcb727c62 Remove unused buffer (?) 2025-06-26 16:57:04 +02:00
Joseph C. Osborn f4bba523ab Change RFILE to intfstream_t in libretro-db 2025-06-26 06:44:59 -07:00
libretroadmin e13140ba04 Rewrite some strlcat calls into strlcpy 2025-06-26 14:47:53 +02:00
github-actions a8caac7142 Fetch translations from Crowdin 2025-06-26 00:16:49 +00:00
LibretroAdmin 46fd8f6532 Merge pull request #18053 from sonninnos/filestream-copy-cmp
Built-in playlist migration rework
2025-06-25 20:28:14 +02:00
sonninnos bc3f1c6487 Built-in playlist migration rework 2025-06-25 20:38:24 +03:00
LibretroAdmin b0294736ed Merge pull request #18052 from Uukrull/zstd
webOS: Enable ZStandard
2025-06-25 13:35:23 +02:00
Uukrull c680a72a18 webOS: Enable ZStandard 2025-06-25 12:28:31 +02:00
LibretroAdmin c30d790854 Merge pull request #18049 from Skirlez/fix-32bit-cheats 2025-06-25 08:39:01 +02:00
github-actions 2590cc9120 Fetch translations from Crowdin 2025-06-25 00:17:08 +00:00
Skirlez f1289f60ef Avoid creating huge list of numbers for cheat-related settings 2025-06-25 00:53:10 +03:00
LibretroAdmin 69b82e1fc2 Merge pull request #18046 from sonninnos/database-multidisk
Improve multidisk game scanning
2025-06-24 21:18:01 +02:00
sonninnos 0fbce9680a Fix playlist json flags (#18048) 2025-06-24 18:19:40 +03:00
Eric Warmenhoven 5e578f9fc4 apple: better mfi controller disconnect handling 2025-06-23 22:45:45 -04:00
sonninnos 6056a0e602 Improve multidisk game scanning 2025-06-24 05:36:05 +03:00
github-actions 6e1597970b Fetch translations from Crowdin 2025-06-24 00:17:04 +00:00
LibretroAdmin 243ed9d171 Merge pull request #18045 from zoltanvb/android_keyboard_fixes
Minor Android keymap fixes
2025-06-23 12:34:29 +02:00
github-actions 2553927119 Fetch translations from Crowdin 2025-06-23 00:18:05 +00:00
zoltanvb 69a9e05067 Minor Android keymap fixes
Some enhancement possibilities found while investigating another
issue - shift keys were swapped (especially noticeable in menu),
enter may be mapped to DPAD_CENTER by the system, but unfortunately
the 102. key can not be mapped separately.
2025-06-22 21:14:49 +02:00
Eric Warmenhoven 185971182d apple: provide option to disable metal argument buffers 2025-06-22 12:29:17 -04:00
LibretroAdmin c27e815808 Merge pull request #18040 from sonninnos/libchdr-zstd
Add Zstandard support + libchdr update
2025-06-22 15:48:52 +02:00
sonninnos 0575ee99c6 Fix info disable button (#18043) 2025-06-22 14:19:47 +03:00
Eric Warmenhoven 12599993c0 apple: speed up cloud sync 2025-06-21 23:57:03 -04:00
sonninnos 8c6744145e Capitalization fix 2025-06-22 05:12:57 +03:00
github-actions f30947840e Fetch translations from Crowdin 2025-06-22 00:18:29 +00:00
sonninnos ece640fd87 MSVC buildfix attempt 2025-06-22 01:47:13 +03:00
sonninnos 75719b2177 Buildfix attempt 2025-06-22 00:21:19 +03:00
sonninnos b3b8b1e340 Add ZStandard support + libchdr update 2025-06-22 00:03:01 +03:00
LibretroAdmin ac46d10e4a Merge pull request #18039 from warmenhoven/warmenhoven/pr/reminiscence-vitaquake2-store 2025-06-21 22:11:57 +02:00
Eric Warmenhoven c16840444e apple: add reminiscence and vitaquake2 to App Store builds 2025-06-21 14:08:10 -04:00
Eric Warmenhoven d9d874712c apple: extremely minor cleanup 2025-06-21 13:27:22 -04:00
LibretroAdmin cc4373d7a4 Merge pull request #18037 from DisasterMo/add-irish-language
Add Irish Gaelic as a language option
2025-06-21 15:03:39 +02:00
github-actions dea40e01bc Fetch translations from Crowdin 2025-06-21 00:16:25 +00:00
DisasterMo 883d93f04c Add Irish Gaelic as a language option 2025-06-20 22:37:46 +02:00
sonninnos 3b7bea875e Log also analogs in SET_INPUT_DESCRIPTORS 2025-06-20 17:35:24 +03:00
github-actions cc2440fe7f Fetch translations from Crowdin 2025-06-20 00:16:25 +00:00
LibretroAdmin d3635843c9 Merge pull request #18030 from Ryunam/ozone-font-scale
Ozone: Add options to scale font size
2025-06-19 23:52:34 +02:00
github-actions e92be2a89d Fetch translations from Crowdin 2025-06-19 00:16:59 +00:00
Eric Warmenhoven 9e5f6f4d8a apple: fix bundle id display 2025-06-18 10:48:47 -04:00
github-actions 21c00e79f9 Fetch translations from Crowdin 2025-06-18 00:16:45 +00:00
sonninnos 6126413e92 Revert "Silence ffmpeg camera warnings"
This reverts commit 1f5804cb59.
2025-06-18 01:05:06 +03:00
sonninnos 1f5804cb59 Silence ffmpeg camera warnings 2025-06-18 00:36:29 +03:00
LibretroAdmin f85b738258 Merge pull request #18023 from schellingb/make_lists_static
Make a few large read-only arrays in menu code static
2025-06-17 23:05:53 +02:00
LibretroAdmin 26f6f7200a Merge pull request #18024 from sonninnos/playlists-path-cleanups
Built-in playlist path rework
2025-06-17 23:05:37 +02:00
LibretroAdmin ceb99a0644 Merge pull request #18031 from webosbrew/webos
webOS: Improve compatibility, add debug build option, fix wrong arg removed, fix LF on Makefile.webos
2025-06-17 23:04:41 +02:00
Craig C. 9b9788873c Merge pull request #11 from webosbrew/feature/debug-build
Enable Debug Build for webOS
2025-06-17 13:37:43 +01:00
Mariotaku 5907714842 Don't Remove First Argument if There is None on webOS 2025-06-17 18:33:34 +09:00
Mariotaku 8ba7a585cc build without strip if debug is on 2025-06-17 18:26:55 +09:00
github-actions ab543fb8bd Fetch translations from Crowdin 2025-06-17 00:17:00 +00:00
Craig Carnell 0e4136537b Add environment variables missing from webOS 3 - 5 2025-06-17 00:48:19 +01:00
Ryunam d471cbce8a Ozone: Add options to scale font size 2025-06-16 22:15:49 +02:00
Eric Warmenhoven 42704b9311 apple: include correct git hash when uploading testflight build 2025-06-16 15:00:01 -04:00
sonninnos 383daa31cb Built-in playlist path rework 2025-06-16 19:18:55 +03:00
sonninnos db5c4d2758 Handle default config save path differently 2025-06-16 19:14:45 +03:00
Eric Warmenhoven b490195e0b iOS9: fix crash fetching refresh rate 2025-06-16 10:05:08 -04:00
sonninnos 9595904af1 Add missing path clear 2025-06-16 06:06:15 +03:00
sonninnos 2329cd10d0 Fix vanishing 'Load Core' 2025-06-16 05:57:29 +03:00
github-actions 3e3e4e6ce5 Fetch translations from Crowdin 2025-06-16 00:17:50 +00:00
sonninnos 293ca23197 Glui: Icon fixings 2025-06-15 15:22:16 +03:00
sonninnos bb0551bf1e Android crash fix attempt 2025-06-15 05:43:37 +03:00
sonninnos 3faf744b0f Unused variable cleanup buildfix 2025-06-15 05:12:28 +03:00
sonninnos 0785dd7548 Unused variable cleanups 2025-06-15 05:08:24 +03:00
github-actions fae1c6bcf6 Fetch translations from Crowdin 2025-06-15 00:18:32 +00:00
sonninnos b774a26bae Ozone: Add menu font selection 2025-06-15 01:11:26 +03:00
sonninnos 0fc847a176 Ozone: Entry ticker length correction 2025-06-14 23:51:06 +03:00
sonninnos fc6b1b9fab Show 'save as' config last 2025-06-14 21:20:08 +03:00
sonninnos c9eb36d4db Win32: Unused variable cleanup 2025-06-14 17:37:08 +03:00
sonninnos a7c195901f Better default config path deciding 2025-06-14 17:28:40 +03:00
sonninnos a034e9b61b Ozone+XMB: Blank dummy core output 2025-06-14 17:16:05 +03:00
sonninnos f86ae06c10 Ozone: Add horizontal padding factor option (#18022) 2025-06-14 17:14:07 +03:00
Bernhard Schelling 771fc523b2 Make large read-only arrays static
This can avoid unnecessary waste of performance at runtime to use static data instead of filling out an array on the stack every time. Some of the CBS functions are called for every menu item created so this improves performance of menu navigation, especially large menus like playlists.
2025-06-14 16:26:24 +09:00
github-actions 45c3f93e8b Fetch translations from Crowdin 2025-06-14 00:15:55 +00:00
sonninnos 2e4c29264e Prevent menu input when using toggle combos (#18017) 2025-06-14 00:07:16 +03:00
Eric Warmenhoven f9c99288da android: try to avoid build-time heap space problems 2025-06-13 16:21:09 -04:00
github-actions 75a8193e62 Fetch translations from Crowdin 2025-06-13 00:16:53 +00:00
sonninnos 5cfb0a3e42 Add 'save as' and main config replacing options (#18014) 2025-06-13 03:03:36 +03:00
sonninnos 9d09ec3478 Show undo save/load state items order non-submenu addition 2025-06-12 16:06:28 +03:00
sonninnos 366bf083e4 Shader logging cleanup 2025-06-12 06:37:23 +03:00
sonninnos 9c7203bd6f Input bind+remap analog stick label unifications 2025-06-12 06:10:25 +03:00
sonninnos b65737f923 Show undo save/load state items in the same order 2025-06-12 05:25:07 +03:00
sonninnos a8de4dbe49 Show core info md5 note rows as sublabels (#18011) 2025-06-12 05:17:46 +03:00
github-actions 57fe5598b7 Fetch translations from Crowdin 2025-06-12 00:16:43 +00:00
sonninnos 68ffc370a9 Adaptive VSync menu cleanup 2025-06-12 01:32:58 +03:00
sonninnos 8fd0d552ca D3D: Add alternative max frame latency hack mode (#18010) 2025-06-11 22:25:42 +03:00
Eric Warmenhoven aebfff2166 apple: better mfi controller disconnect handling 2025-06-11 11:01:28 -04:00
github-actions 46b7026978 Fetch translations from Crowdin 2025-06-11 00:17:03 +00:00
LibretroAdmin c5851487cc Merge pull request #18008 from alphanu1/Geom 2025-06-11 00:08:58 +02:00
alphanu 0b001e46c0 Added temporary switch for windows geometry adjustments 2025-06-10 13:00:49 -07:00
LibretroAdmin 4abd8fa816 Merge pull request #17997 from libretro/warmenhoven/pr/mbedtls
minor mbedtls update
2025-06-10 19:59:00 +02:00
Joseph Mattiello 3344af01d7 extract delay to define, 10ms 2025-06-10 12:21:13 -04:00
LibretroAdmin 97ab384c00 Merge pull request #18001 from libretro/warmenhoven/pr/macos-jit 2025-06-10 12:58:14 +02:00
LibretroAdmin 166c394cf2 Merge pull request #18004 from libretro/warmenhoven/pr/macos-mem 2025-06-10 12:57:36 +02:00
LibretroAdmin 5f606b9df0 Merge pull request #18003 from libretro/warmenhoven/pr/emacs-dir-locals 2025-06-10 12:57:24 +02:00
LibretroAdmin a78826ee9e Merge pull request #18002 from libretro/warmenhoven/pr/xcode-tweaks 2025-06-10 12:56:58 +02:00
LibretroAdmin 9795fd2daa Merge pull request #17999 from libretro/warmenhoven/pr/apple-bundle-id 2025-06-10 12:56:24 +02:00
LibretroAdmin fec832a03c Merge pull request #17998 from libretro/warmenhoven/pr/info-debug 2025-06-10 12:56:12 +02:00
LibretroAdmin 0c279b9dbc Merge pull request #17995 from alphanu1/Geom 2025-06-10 12:55:59 +02:00
Eric Warmenhoven 8d579bba30 net_http: minor lock refactor 2025-06-09 23:49:49 -04:00
Eric Warmenhoven cc408b7ad5 macOS: better memory reporting 2025-06-09 22:34:33 -04:00
Eric Warmenhoven c1f7982ec0 add .dir-locals.el for emacs formatting 2025-06-09 22:25:48 -04:00
Eric Warmenhoven bb6a0c5772 apple: Xcode tweaks 2025-06-09 22:25:14 -04:00
Eric Warmenhoven 52bfb2a7c3 macOS: minor JIT debugging niceties 2025-06-09 22:24:40 -04:00
Eric Warmenhoven 631f318e28 apple: bundle identifier in Information menu 2025-06-09 22:23:06 -04:00
Eric Warmenhoven 4e4855b44c include "DEBUG" string in information menu for debug builds 2025-06-09 22:21:28 -04:00
Eric Warmenhoven e8da8f8d29 minor mbedtls update
This brings it in line with 2.6.0. Previously it had been taken from a
development branch somewhere between 2.5.1 and 2.6.0.

Only return VERIFY_FAILED from a single point

Everything else is a fatal error. Also improve documentation about that for
the vrfy callback.

Improve comments

Update doc of return value of verify()

Fix potential integer overflow parsing DER CRL

This patch prevents a potential signed integer overflow during the
CRL version verification checks.

Fix potential integer overflow parsing DER CRT

This patch prevents a potential signed integer overflow during the
certificate version verification checks.

Prevent signed integer overflow in CSR parsing

Modify the function mbedtls_x509_csr_parse_der() so that it checks the
parsed CSR version integer before it increments the value. This prevents
a potential signed integer overflow, as these have undefined behaviour
in the C standard.

Rename time and index parameter to avoid name conflict.

As noted in #557, several functions use 'index' resp. 'time'
as parameter names in their declaration and/or definition, causing name
conflicts with the functions in the C standard library of the same
name some compilers warn about.

This commit renames the arguments accordingly.

Update version number to 2.6.0
2025-06-09 22:20:05 -04:00
github-actions a21643b7fa Fetch translations from Crowdin 2025-06-10 00:17:11 +00:00
sonninnos 8b82cccb7a Remove unused var 2025-06-10 02:18:15 +03:00
alphanu 3f59af3f99 Fixed issues with warnings when compiling menu_cbs_sublabel.c after CRT geometry adjust PR 2025-06-09 10:32:21 -07:00
LibretroAdmin 30b0b39df1 Merge pull request #17992 from sonninnos/frame-delay-cleanup 2025-06-09 17:37:48 +02:00
sonninnos 3543080194 Frame Delay auto improvements 2025-06-09 17:35:51 +03:00
LibretroAdmin 84a5ded33c Merge pull request #17987 from alphanu1/Geom
Added Horizontal and vertical geometry adjustments
2025-06-09 06:30:54 +02:00
LibretroAdmin 1fba899657 Merge pull request #17988 from zoltanvb/changelist_update
Change list updates up to 2025-06-08
2025-06-09 06:30:35 +02:00
Joseph Mattiello 663f318d5f enable mic on macos
add mic usage to info.plist

enable micorphone in xcconfig

mic device selection macos

snapshot

revert ios driver

macos only driver, doesn’t deadlock now

macos driver seems to be doing something

looooooop

well, at least it doesn’t spin lock, no audio

audio capture working!

seems to be working now

cleanup some extra logging

clean up some extra logging

rename ios driver for clarity

remove some locks

better performance, but some noise

remove unused fifo_lock

clear the fifo

fix noise in buffer

some improvements, might not need

remove superfulous silent check

reduce latency

Signed-off-by: Joseph Mattiello <[email protected]>
2025-06-08 22:12:22 -04:00
github-actions ba156cee4d Fetch translations from Crowdin 2025-06-09 00:17:53 +00:00
zoltanvb 446a847aab Missed one item from changes 2025-06-08 20:48:07 +02:00
zoltanvb 2561737403 Updates up to 2025-06-08 2025-06-08 20:38:25 +02:00
alphanu 4389c611ef Fixed horizontal offest. Removed action menu due to iteration bug 2025-06-08 10:44:34 -07:00
alphanu d6c9698353 Added Horizontal and vertical geometry adjustments 2025-06-08 08:33:24 -07:00
github-actions e613e2c08e Fetch translations from Crowdin 2025-06-08 00:18:20 +00:00
LibretroAdmin 67a46ae077 Merge pull request #17984 from libretro/revert-17980-master
Revert "Kiosk Mode Hotkey and Bug Fix ( For Empty Main Menu )"
2025-06-07 18:00:27 +02:00
LibretroAdmin c9360262ec Revert "Kiosk Mode Hotkey and Bug Fix ( For Empty Main Menu )" 2025-06-07 18:00:14 +02:00
LibretroAdmin 5aefb761eb Merge pull request #17982 from alphanu1/master 2025-06-07 07:49:34 +02:00
LibretroAdmin 28300fc606 Merge pull request #17980 from Lhaete/master 2025-06-07 07:49:11 +02:00
LibretroAdmin b353e8d972 Merge pull request #17977 from j0ki/master 2025-06-07 07:48:59 +02:00
LibretroAdmin 20c932e236 Merge pull request #17975 from Uukrull/coredump 2025-06-07 07:48:44 +02:00
github-actions 5dfd11257e Fetch translations from Crowdin 2025-06-07 00:16:17 +00:00
alphanu 434f41b935 Updated CRT menu items and added new CRT menu
item for upcomming Switchres changes.
2025-06-06 13:39:40 -07:00
Eric Warmenhoven ca405929ad Merge pull request #17981 from warmenhoven/warmenhoven/pr/MicCoreAudio
Add Microphone CoreAudio driver for iOS
2025-06-06 14:40:45 -04:00
Eric Warmenhoven a0263db217 iOS: fix/enable coreaudio microphone driver 2025-06-06 14:10:02 -04:00
Eric Warmenhoven 720f5bca59 Merge remote-tracking branch 'libretro/master' into warmenhoven/dev/MicCoreAudio 2025-06-06 14:09:19 -04:00
Lhaete 49d4a580d9 Update xmb.c with kiosk mode
Linux Fix for mixing declaration and code, missed them the first time oops again!
2025-06-06 08:56:37 -04:00
Lhaete 67b5da6a50 Update retroarch.c with kiosk mode fix
Changed string check to function string_is_empty for PS4 compliance!
2025-06-06 08:46:48 -04:00
Lhaete 3315e96b2d Update xmb.c with kiosk mode
Fixed Linux bug for mixing declaration with code, oops.
2025-06-06 08:41:03 -04:00
Lhaete 1ca2e08590 Update xmb.c with kiosk mode fix
Forgot to add the    settings_t *settings       = config_get_ptr(); ptr in xmb list cache
2025-06-06 08:24:27 -04:00
Lhaete 76b515cd38 Update retroarch.c wiht Kiosk Mode
Added kiosk hotkey case and function
2025-06-06 07:07:02 -04:00
Lhaete 824182a54a Update command.h with kiosk mode
added kiosk mode
2025-06-06 07:01:19 -04:00
Lhaete 6cae1c91cb Update configuration.c with kiosk mode
added the kiosk_toggle bind
2025-06-06 06:59:52 -04:00
Lhaete a6aa14208b Update msg_hash_us.h with kiosk mode
added meta_kiosk
2025-06-06 06:58:42 -04:00
Lhaete d236ecfa28 Update msg_hash.h with kiosk mode
added input_meta_kiosk
2025-06-06 06:56:33 -04:00
Lhaete 390f1d3760 Update input_defines.h with kiosk mode 2025-06-06 06:54:40 -04:00
Lhaete 2d16bbd5a2 Update config.def.keybinds.h with Kiosk Mode
I used f5 as the hotkey, this conflicts with companion UI hotkey, so def needs changing..
2025-06-06 06:53:49 -04:00
Lhaete 19df62e737 Update win32_common.c with kiosk mode
added kiosk mode
2025-06-06 06:51:31 -04:00
Lhaete 9bc3d5e656 Update ui_win32_resource.h with kiosk mode
there needs to be an empty line as the last line! added kiosk mode
2025-06-06 06:49:28 -04:00
Lhaete 5531f743ea Update rarch.rc with kiosk mode 2025-06-06 06:48:01 -04:00
Lhaete b63e982712 Update all_binds_empty.cfg with Kiosk Toggle
added kiosk toggle input hotkey test, f5 is used by companion so might have to use different hotkey
2025-06-06 06:45:58 -04:00
Lhaete 59442128a6 Update runloop.c wth Kiosk Mode Hotkey
added hotkey check cmd
2025-06-06 06:44:18 -04:00
Lhaete 01a3203a3a Update menu_setting.c with "Kiosk Mode Fix"
added kiosk mode fixes
2025-06-06 06:41:05 -04:00
Lhaete 274f253e75 Update menu_displaylist.c with "Kiosk Mode Fix"
added Kiosk Mode fixes
2025-06-06 06:39:08 -04:00
Lhaete 3cbe9fa5c2 Update xmb.c with "Kiosk Mode Fix"
Added Kiosk Mode Fix
2025-06-06 06:34:12 -04:00
Eric Warmenhoven c74164c6d0 android: enable ssl
https://github.com/Mbed-TLS/mbedtls/commit/0c4bbda16abae83b5365a1ddd50625f54586b147
2025-06-05 22:53:33 -04:00
sonninnos dcf4286d06 Port bind turbo fire icon + label cleanup (#17979) 2025-06-06 05:06:30 +03:00
j0ki 482b8241b8 udev_input.c: restore linux terminal in udev_input_free
Linux terminal settings were lost after restarting via menu.
This was caused by udev_input_init calling linux_terminal_disable_input multiple times.

New code follows the restore pattern of linuxraw_input.c
2025-06-06 02:18:20 +02:00
github-actions 9c7347c509 Fetch translations from Crowdin 2025-06-06 00:16:34 +00:00
sonninnos b2f86fa45f Integer scale half scaling improvements (#17976) 2025-06-05 19:56:40 +03:00
Uukrull 04eb45b413 webOS: Disable core dumps 2025-06-05 11:21:48 +02:00
github-actions 2899bd183a Fetch translations from Crowdin 2025-06-05 00:16:53 +00:00
Eric Warmenhoven 01a3511445 iOS: rely on core info to re-find cores from old directory structure 2025-06-04 14:52:01 -04:00
Eric Warmenhoven 86f63e1f59 android: revert of enabling ssl 2025-06-04 14:52:01 -04:00
LibretroAdmin 9aac188d2c Merge pull request #17972 from warmenhoven/warmenhoven/pr/android-ssl 2025-06-04 17:21:13 +02:00
LibretroAdmin a44c65f44c Merge pull request #17973 from j0ki/master 2025-06-04 17:20:56 +02:00
j0ki bdd80921b5 video4linux2.c: do not close before open.
With no camera connected this would call close(0), causing  problems later.
2025-06-04 15:47:57 +02:00
Eric Warmenhoven 98852bd427 android: enable builtin mbed-tls
fixes #16847
2025-06-03 23:03:37 -04:00
github-actions 4b7806afe7 Fetch translations from Crowdin 2025-06-03 00:16:44 +00:00
github-actions 83130f47b5 Fetch translations from Crowdin 2025-06-02 00:17:08 +00:00
github-actions 9be49b9390 Fetch translations from Crowdin 2025-06-01 00:20:13 +00:00
Eric Warmenhoven 38a3b924ae iOS/tvOS: enable HAVE_NETWORK_COMMAND 2025-05-31 16:05:41 -04:00
github-actions 19398209ed Fetch translations from Crowdin 2025-05-31 00:15:57 +00:00
github-actions ca19b79960 Fetch translations from Crowdin 2025-05-30 00:16:44 +00:00
LibretroAdmin 0a4ff8187a Merge pull request #17961 from zoltanvb/android_network_cmd
Enable HAVE_NETWORK_CMD for Android.
2025-05-29 23:33:00 +02:00
zoltanvb 15f4f1e63c Enable HAVE_NETWORK_CMD for Android. 2025-05-29 21:46:25 +02:00
Uukrull b7a29bd17c Fix argv for webOS (#17960) 2025-05-29 21:21:56 +03:00
LibretroAdmin 6c54b2183b Merge pull request #17956 from webosbrew/webos
Add target cpu and tune for webOS
2025-05-29 09:53:51 +02:00
sonninnos dd8fff113b Runloop content path cleanups 2025-05-29 08:40:23 +01:00
libretroadmin 15819612f7 Fix semicolon near end of conditional 2025-05-29 09:22:42 +02:00
libretroadmin 18ca0e671d (XInput) More C89 fixes and style nits 2025-05-29 09:17:52 +02:00
libretroadmin 82dde53f7d Forgot to update default.txt for tagged release 2025-05-29 07:22:16 +02:00
libretroadmin f1f50bf7f7 (audio_driver) Cache slowmotion_ratio variable into local variable -
used inside loop
2025-05-29 06:51:49 +02:00
libretroadmin 1ff8346eb5 Silence warnings/style nits 2025-05-29 06:19:04 +02:00
libretroadmin bd04f9154b C89 buildfix 2025-05-29 06:11:08 +02:00
libretroadmin c372dfad8b Rework xinput_joypad_rumble somewhat 2025-05-29 05:59:46 +02:00
libretroadmin b1ad554a14 C89_BUILD fixes 2025-05-29 04:59:41 +02:00
LibretroAdmin 2e91214404 Merge pull request #17954 from Ryunam/xinput-rumble-fix
XInput: Fix rumble performance drops on Bluetooth and reduce unnecessary polling
2025-05-29 04:53:50 +02:00
sonninnos dc4dd657f9 Runloop content path cleanups 2025-05-29 04:47:32 +03:00
github-actions f9db98194b Fetch translations from Crowdin 2025-05-29 00:16:15 +00:00
Ryunam 7ad10258f0 XInput: Reduce unnecessary polling and optimize performance 2025-05-29 00:21:43 +02:00
sonninnos fd7f8a3ea1 Use the existing ldci define 2025-05-29 01:21:26 +03:00
LibretroAdmin 8894d551e7 Merge pull request #17955 from sonninnos/menu-input-joypad-driver
Add input+controller driver under input settings
2025-05-29 00:18:59 +02:00
sonninnos 686c7997bc Add input+controller driver under input settings 2025-05-29 01:03:48 +03:00
libretroadmin c9bc941830 move microphone_driver.c inside audio_driver.c. This way we can move
some of the defines from audio_defines.h into audio_driver.c
2025-05-28 17:32:14 +02:00
Ryunam bd9561d93c XInput: Fix rumble overload by limiting on state changes and interval 2025-05-28 17:20:33 +02:00
libretroadmin 08c0221c27 (audio driver) Cleanups 2025-05-28 17:19:32 +02:00
libretroadmin 13790a0fad (Audio) Some cleanups 2025-05-28 16:40:56 +02:00
github-actions 4e30df6392 Fetch translations from Crowdin 2025-05-28 00:16:15 +00:00
LibretroAdmin 74599fd776 Merge pull request #17953 from sonninnos/import-content-rework
Default Import Content back to playlist sidebar/tabs
2025-05-28 01:53:29 +02:00
sonninnos cfa839f5b6 Default Import Content back to playlist sidebar/tabs 2025-05-28 01:01:11 +03:00
sonninnos a1a50afc9e Dinput: Ignore first mouse click on focus 2025-05-27 23:47:06 +03:00
sonninnos b3fd3e15ed WinRaw: Prevent stuck mouse buttons on unfocus 2025-05-27 22:43:15 +03:00
sonninnos 03be66836e GLUI: Even better entry height value 2025-05-27 21:08:23 +03:00
sonninnos 7426251263 GLUI: Minor entry height adjustment (#17952) 2025-05-27 18:32:22 +03:00
sonninnos 49ee835c82 Better menu mouse startup position ignore 2025-05-27 18:13:16 +03:00
sonninnos 0f664c739b Ignore menu mouse startup position before moving (#17951) 2025-05-27 16:48:03 +03:00
sonninnos 4529d06a5a Fix menu usage when OK/Cancel has mouse binds (#17950) 2025-05-27 14:01:09 +03:00
libretroadmin 5cb15e1cd7 Reapply "Allow Start button to quick manage media playlists (#17948)"
This reverts commit f877adb5d9.
2025-05-27 12:40:32 +02:00
libretroadmin f877adb5d9 Revert "Allow Start button to quick manage media playlists (#17948)"
This reverts commit 7d3740d4c0.
2025-05-27 12:39:52 +02:00
sonninnos 7d3740d4c0 Allow Start button to quick manage media playlists (#17948) 2025-05-27 04:25:16 +03:00
github-actions 3b44efe122 Fetch translations from Crowdin 2025-05-27 00:16:23 +00:00
sonninnos 1c0f945c21 Add media history playlists to playlist manager (#17945) 2025-05-26 23:18:16 +03:00
sonninnos d2a824c1a7 Playlists settings menu reorganizing 2025-05-26 17:42:18 +03:00
sonninnos 158ad0c4bc Enable savestate thumbnails by default for x64 (#17944) 2025-05-26 16:51:25 +03:00
LibretroAdmin cd4894d627 Merge pull request #17928 from BinBashBanana/master
Rewrite RWebAudio driver
2025-05-26 12:53:27 +02:00
Eric Warmenhoven d8cd500316 macOS: Prompt for local network access 2025-05-26 00:40:56 -04:00
github-actions 0514f203eb Fetch translations from Crowdin 2025-05-26 00:17:13 +00:00
BinBashBanana 86308ef670 RWebAudio scheduling adjustments 2025-05-25 12:42:41 -07:00
LibretroAdmin 65f76bd514 Update audio_driver.c 2025-05-25 15:41:17 +02:00
LibretroAdmin a4f73c622d Update audio_driver.c 2025-05-25 15:36:42 +02:00
LibretroAdmin 990cc9b0b2 Update audio_driver.c - small cleanup for code readability
Makes it apparent that these variables are rewind-specific
2025-05-25 15:31:46 +02:00
sonninnos e5d86c0ffb One more missing deprecation cleanup 2025-05-25 15:54:48 +03:00
sonninnos 3f2021249b Deprecated msg hash cleanups 2025-05-25 15:49:49 +03:00
LibretroAdmin df42b13bbc Merge pull request #17901 from zoltanvb/lock_core_description
Lock core and save state explanations.
2025-05-25 14:47:54 +02:00
github-actions 1956b6e01f Fetch translations from Crowdin 2025-05-25 00:18:18 +00:00
sonninnos dd45f8cb0c Rewind logging cleanup 2025-05-24 22:18:49 +03:00
github-actions d5699457ca Fetch translations from Crowdin 2025-05-24 00:15:33 +00:00
sonninnos 4ba004a1e8 Add 'Show Favorites First' visibility option (#17933) 2025-05-23 16:06:53 +03:00
sonninnos 766f895948 Turbo fire override corrections (#17932) 2025-05-23 14:51:23 +03:00
github-actions 5514f71a00 Fetch translations from Crowdin 2025-05-23 00:16:34 +00:00
LibretroAdmin 99b4b66174 Merge pull request #17926 from warmenhoven/warmenhoven/pr/apple-gear
apple: add gearcoleco, geargrafx cores to app store builds
2025-05-22 12:32:19 +02:00
LibretroAdmin 65435d1703 Merge pull request #17927 from warmenhoven/warmenhoven/pr/apple-same
apple: add sameduck core to app store builds
2025-05-22 12:32:10 +02:00
Eric Warmenhoven 7e52201fb6 apple: add sameduck core to app store builds 2025-05-22 01:38:56 -04:00
Eric Warmenhoven 0c872e7c94 apple: add gearcoleco, geargrafx cores to app store builds 2025-05-22 00:11:54 -04:00
LibretroAdmin 91608d6bd0 Merge pull request #17925 from warmenhoven/warmenhoven/pr/macos-quit
macos: followup to runloop observer
2025-05-22 04:55:32 +02:00
Eric Warmenhoven 0a6db1088a macos: followup to runloop observer 2025-05-21 21:38:29 -04:00
BinBashBanana c2d7366ea1 Rewrite RWebAudio driver 2025-05-21 18:05:05 -07:00
github-actions ca190dbe0a Fetch translations from Crowdin 2025-05-22 00:16:17 +00:00
Eric Warmenhoven 79a05ef286 macos build fix for steam 2025-05-21 12:31:08 -04:00
sonninnos 610a6d0026 Internal core logging newlines 2025-05-21 18:18:14 +03:00
sonninnos 5afbca8904 video_driver_build_info crash fix 2025-05-21 16:46:45 +03:00
LibretroAdmin 8cfdfebb03 Merge pull request #17922 from warmenhoven/warmenhoven/pr/macos-run
macOS: use CFRunLoopObserver for running runloop
2025-05-21 10:16:22 +02:00
Eric Warmenhoven 14c5956ff8 macOS: use CFRunLoopObserver for running runloop 2025-05-20 23:44:11 -04:00
github-actions e2b725b5a3 Fetch translations from Crowdin 2025-05-21 00:17:00 +00:00
zoltanvb f5280fe526 Lock core and save state explanations. 2025-05-20 22:01:33 +02:00
sonninnos 0e4cf00d1f Add option for suggesting cores when a core is loaded (#17920) 2025-05-20 15:54:22 +03:00
github-actions 7d98987f9d Fetch translations from Crowdin 2025-05-20 00:16:59 +00:00
LibretroAdmin 072142b5af Merge pull request #17918 from Jamiras/feature/unsupported_warning
(cheevos) show additional warning message when unsupported achievements are detected
2025-05-19 22:33:14 +02:00
Jamiras 5568a1e25d show additional warning message when unsupported achievements are detected 2025-05-19 07:44:56 -06:00
github-actions 531a8d75a7 Fetch translations from Crowdin 2025-05-19 00:17:26 +00:00
LibretroAdmin ac3c83eca1 Merge pull request #17914 from warmenhoven/warmenhoven/pr/server-hash
cloud sync: don't always trust the server hash
2025-05-18 16:14:08 +02:00
LibretroAdmin f0dcd6810c Merge pull request #17911 from pstef/psl1ght-make 2025-05-18 10:36:31 +02:00
Eric Warmenhoven 48f77a948f vulkan: fix hdr (#17915)
fixes #17912
2025-05-18 06:09:06 +03:00
Eric Warmenhoven b632a1373e cloud sync: don't always trust the server hash 2025-05-17 21:59:27 -04:00
sonninnos 97bc2da36c Fix menu core unload 2025-05-17 18:53:33 +03:00
pstef 537bc2dbe9 Fix broken logic in the clean target 2025-05-17 09:17:07 +00:00
Craig Carnell f1538b1326 Add target cpu and tune for webOS 2025-05-16 12:53:10 +01:00
Aleksey Samoilov a77049b022 Bump required wayland-protocols (#17908) 2025-05-15 19:52:02 +03:00
LibretroAdmin 19239287bf Merge pull request #17907 from sonninnos/menu-input-latency-cleanup
Clean up input + latency menus
2025-05-15 07:16:39 +02:00
github-actions 13616bafe0 Fetch translations from Crowdin 2025-05-15 00:15:17 +00:00
sonninnos b5cbe6eaed Clean up input + latency menus 2025-05-14 23:40:43 +03:00
sonninnos cc57bbc06e Turbo mode corrections (#17905) 2025-05-14 22:37:05 +03:00
LibretroAdmin 45764673c7 Merge pull request #17904 from webosbrew/webos 2025-05-14 20:19:13 +02:00
Craig Carnell 667b16964b Add artifact build for webOS 2025-05-14 17:18:43 +01:00
Craig Carnell 9c9d68ae20 Fix missing package name on webos 2025-05-14 17:07:57 +01:00
Ningyuan Li 5b0fb96443 added release workflow 2025-05-14 17:07:37 +01:00
Ningyuan Li f260d3edab changed package version #7 2025-05-14 17:05:54 +01:00
Ningyuan Li ce406353cc added webOS default fonts 2025-05-14 17:05:42 +01:00
Ningyuan Li b1da352de6 Properly ships libSDL2 for webOS
Updated some build config
2025-05-14 17:03:59 +01:00
LibretroAdmin bd5f47afbb Merge pull request #17902 from sonninnos/frame-delay-menu-fix
Frame delay menu string fix
2025-05-14 17:12:54 +02:00
sonninnos 1886f76bba Frame delay menu string fix 2025-05-14 15:12:04 +03:00
LibretroAdmin 7bc992437c Merge pull request #17899 from sonninnos/bfi-shdrsub-stringrep-cleanup 2025-05-14 06:54:45 +02:00
LibretroAdmin 4f22a04436 Merge pull request #17898 from zoltanvb/core_options_reset_v2b 2025-05-14 06:54:28 +02:00
github-actions cd78050c79 Fetch translations from Crowdin 2025-05-14 00:16:16 +00:00
sonninnos 0f65f2f0f3 Display bfi + shader subframes strings without translations 2025-05-14 01:13:42 +03:00
sonninnos ee11b79738 Improve playlist thumbnail cycling (#17897)
* Improve playlist thumbnail cycling

* GLUI: Thumbnail cycling fixes
2025-05-13 22:14:49 +03:00
zoltanvb 30ffb042c6 Hide core reset from Configuration File when no core is loaded. 2025-05-13 19:48:45 +02:00
LibretroAdmin 57acb067b8 Merge pull request #17896 from zoltanvb/core_options_reset_v2 2025-05-13 04:29:46 +02:00
github-actions 0900cd7540 Fetch translations from Crowdin 2025-05-13 00:16:26 +00:00
zoltanvb c794376223 Move core options reset from Settings/Configuration to Main Menu / Configuration Files 2025-05-12 22:14:38 +02:00
Eric Warmenhoven 906c0be946 macos/ios: Enable icloud_drive cloud sync backend 2025-05-12 09:17:16 -04:00
Davide Andreoli 2f1ae73dd4 feat: added iCloud Drive Cloud Sync 2025-05-12 08:54:06 -04:00
github-actions 6ade319137 Fetch translations from Crowdin 2025-05-12 00:17:23 +00:00
sonninnos 1b61b88274 Refine menu info+search disable buttons (#17889) 2025-05-11 22:18:44 +03:00
sonninnos 5e03ef57ec Ozone+XMB: Fix content icons when playlist tabs hidden (#17888) 2025-05-11 21:22:32 +03:00
Eric Warmenhoven 874cc00c2e macos: fix app store packaging 2025-05-11 12:01:20 -04:00
LibretroAdmin 1be64020f5 Merge pull request #17886 from BinBashBanana/master
RWebCam hotfix
2025-05-11 03:10:33 +02:00
github-actions 45e13e3f2d Fetch translations from Crowdin 2025-05-11 00:17:21 +00:00
BinBashBanana 84a52677b5 RWebCam hotfix 2025-05-10 13:52:09 -07:00
github-actions b590d843bc Fetch translations from Crowdin 2025-05-10 00:15:02 +00:00
sonninnos 0818feb131 Wasapi: Buffer correction 2025-05-09 19:09:55 +03:00
LibretroAdmin c90804c2ad Merge pull request #17884 from Sunderland93/fix_libdecor 2025-05-09 17:10:50 +02:00
Aleksey Samoilov 759104acd4 Fix build with libdecor enabled 2025-05-09 19:01:31 +04:00
LibretroAdmin 79d78a6860 Merge pull request #17880 from Sunderland93/wayland_toplevel_icon
[Wayland]: Add support for xdg-toplevel-icon-v1
2025-05-09 06:14:58 +02:00
LibretroAdmin 73426f823d Merge pull request #17872 from BinBashBanana/master
Emscripten improvements pt. 4
2025-05-09 02:49:30 +02:00
github-actions 8e154e0df6 Fetch translations from Crowdin 2025-05-09 00:16:12 +00:00
sonninnos df1c342cb2 Ozone: C89 buildfix 2025-05-09 02:05:44 +03:00
sonninnos cacff13799 Ozone: Improve metadata background fade 2025-05-09 01:44:20 +03:00
sonninnos ae9e8ba75c Ozone: Skip thumbnail background for metadata display 2025-05-09 01:29:57 +03:00
Aleksey Samoilov 6be300b07c Additional check for xdg-toplevel-icon for libdecor 2025-05-09 02:20:07 +04:00
Aleksey Samoilov 7264709776 Set toplevel icon for libdecor frame 2025-05-09 02:15:22 +04:00
Michael Burgardt f9bdd7bc87 Update language list in sample files (#17829) 2025-05-09 00:57:00 +03:00
sonninnos 7b37f85a99 XMB: Add temporary thumbnail toggle (#17881) 2025-05-09 00:56:13 +03:00
sonninnos c3cb4a8b5d D3D11+12: Minor cleanups 2025-05-08 22:11:53 +03:00
BinBashBanana 2d3c18e48d Emscripten improvements pt. 4 2025-05-08 11:01:43 -07:00
Aleksey Samoilov 9cf03289ec Check if icon_buffer is created 2025-05-08 18:55:51 +04:00
Aleksey Samoilov c4ee58a81a Fix intend 2025-05-08 18:10:28 +04:00
Aleksey Samoilov 6c7b648570 [Wayland]: Add support for xdg-toplevel-icon-v1 2025-05-08 17:58:20 +04:00
github-actions 7cffc6bb60 Fetch translations from Crowdin 2025-05-08 00:15:58 +00:00
sonninnos a8d65325a7 Set default lightgun Start+Select keybinds for port 1 (#17877) 2025-05-08 01:06:34 +03:00
sonninnos 10738f532c Add shader hold hotkey and improve toggling logic (#17840) 2025-05-08 00:56:59 +03:00
sonninnos 0b547bdd49 Remove language mention from User menu sublabel (#17876) 2025-05-08 00:26:54 +03:00
pstefandpstef d3cf9aa651 Improve CLI --entryslot (#17874)
Accepted values are 0 to 999. Rewrite this part to use strtol and test
for values in that range.

Co-authored-by: pstef <[email protected]>
2025-05-08 00:15:39 +03:00
sonninnos eb35401e1a Merge pull request #17868 from sonninnos/auto-swap-interval-fix
Auto swap interval correction
2025-05-08 00:07:37 +03:00
github-actions 67a2793ab4 Fetch translations from Crowdin 2025-05-07 00:16:24 +00:00
github-actions 3bfed628ff Fetch translations from Crowdin 2025-05-06 00:16:38 +00:00
sonninnos 2ddd9330fe Frame delay + swap interval correction 2025-05-05 15:50:45 +03:00
sonninnos ba8b97041e Auto swap interval correction 2025-05-05 15:50:42 +03:00
LibretroAdmin 0670d6d87e Merge pull request #17853 from sonninnos/menu-thumbnail-background 2025-05-05 14:45:11 +02:00
LibretroAdmin 5ba3fa6fd4 Merge pull request #17855 from kwyxz/camera_haiku 2025-05-05 14:44:51 +02:00
LibretroAdmin 28f81e8e71 Merge pull request #17857 from jecaro/fix-nmcli-wifi-driver 2025-05-05 14:44:34 +02:00
LibretroAdmin 463770c3c2 Merge pull request #17854 from pstef/thumbnails-selection 2025-05-05 14:44:12 +02:00
jecaro 3637f49ddc Fix nmcli wifi driver
- Use the password stored in the connection profile instead of asking
  each time to the user

- `Disconnect` menu item wasn't shown even when connected

   When entering the Wi-Fi menu first, `nmcli_connection_info` is called with
   `NULL`. If we return `false` here, the menu doesn't show the `Disconnect`
   menu item even when the wifi is on and connected.

- Don't consider wired connections when checking if the device is connected

   `cmd_file = popen("nmcli -f NAME c show --active | tail -n+2", "r");`

   That command returns all active connections, even the wired ones. That
   means that if the wifi is not connected but we have a wired connection,
   retroarch shows the Disconnect menu item to disconnect ... a
   non-existent wifi connection.
2025-05-05 12:38:12 +02:00
github-actions 19257e2190 Fetch translations from Crowdin 2025-05-05 00:17:08 +00:00
kwyxz e78898f379 default to FFmpeg libavfilter virtual input device 2025-05-04 01:48:15 +00:00
github-actions 015e515e9e Fetch translations from Crowdin 2025-05-04 00:17:35 +00:00
pstef 583687081c Revisit selection and size_t to silence warnings
There is a type mismatch between selection (size_t) and how it's passed
to some functions. In 4f3ae82 I got it backwards and changed the type in
savestate thumbnail function definitions to size_t, but in that case we
can assume that there won't be more than 999. So in this case it's OK to
keep the unsigned int and cast selection to that type.

Thumbnails on playlists are the other case and the limit is not so clear
to me, so I assume it's reasonable to promote the type of the function
parameter i from unsigned to size_t.
2025-05-03 19:08:56 +00:00
sonninnos e3583cbcbb Add common Thumbnail Background option for all menu drivers 2025-05-03 19:12:10 +03:00
LibretroAdmin 2a225a20dc Merge pull request #17851 from pstef/ffast-math
Pop fast-math at the end of the file
2025-05-03 16:48:59 +02:00
LibretroAdmin 34e68a44ab Merge pull request #17852 from pstef/mean-and-mean
Reapply "Define WIN32_LEAN_AND_MEAN to avoid collision with winsock2"
2025-05-03 16:48:46 +02:00
pstef 0c1402d92a Reapply "Define WIN32_LEAN_AND_MEAN to avoid collision with winsock2"
It was reverted in 309c67a205 because it
was suspected of breaking Windows releases, but the reason was
different.
2025-05-03 13:28:49 +00:00
pstef 2e868fc00b Pop fast-math at the end of the file
so that it doesn't affect the rest of the code in Griffin builds.

This is unfortunately GCC-only, but Clang will miss only 1 vectorization.
2025-05-03 12:29:42 +00:00
github-actions 63487e8ed8 Fetch translations from Crowdin 2025-05-03 00:15:28 +00:00
LibretroAdmin 4c30e94aa2 Merge pull request #17850 from pstef/ffast-math
Make -ffast-math exclusive to sinc_resampler.c
2025-05-03 00:12:06 +02:00
pstef 6bfb7862e7 Make -ffast-math exclusive to sinc_resampler.c
-ffast-math was added in ff14092d8d with a comment that it "helps SINC
resampler to auto-vectorize". The flag is an alias for "-fno-math-errno
-funsafe-math-optimizations -ffp-contract=fast -fno-honor-infinities
-fno-honor-nans". The last two of those cause compiler complaints
because while the flag was meant for this file, it's shared across the
codebase that includes statements that operate on infinities and NaNs.

GCC 13.3 with -fopt-info-vec reports 18 vectorizations for `-O3
-ffast-math`, 17 for `-O3 -fno-math-errno -funsafe-math-optimizations
-ffp-contract=fast` and also 17 for plain `-O3`. So using the subset of
-ffast-math without the offending flags buys nothing and loses 1
vectorization.

Both GCC and Clang provide the "fast-math" pragma directive, which I add
to this one file that benefits from it, under the condition that it's
supported. -ffast-math is removed from most of the makefiles.
2025-05-02 17:26:19 +00:00
github-actions 14c78b6c32 Fetch translations from Crowdin 2025-05-02 00:15:30 +00:00
LibretroAdmin 4b6d315ad6 Merge pull request #17844 from JoeOsborn/add-save-load-sram-commands 2025-05-02 00:09:31 +02:00
LibretroAdmin 28a300d00f Merge pull request #17841 from pstef/silenter-makefiles 2025-05-02 00:08:41 +02:00
LibretroAdmin 811a32b982 Merge pull request #17843 from pstef/ozone-selection 2025-05-02 00:07:57 +02:00
github-actions baee906ef3 Fetch translations from Crowdin 2025-05-01 00:17:50 +00:00
pstef c968c1a51d Use size_t for new_selection as done everywhere else 2025-04-30 23:48:39 +00:00
Joseph C. Osborn fe5defea71 add new error message for sram load during hardcore cheevo 2025-04-30 15:05:39 -07:00
Joseph C. Osborn fb94043d48 Report errors from save/load, disable loads under hard cheevos 2025-04-30 14:44:56 -07:00
Joseph C. Osborn 6235f3138b Add command.h commands for saving/loading sram 2025-04-30 12:33:40 -07:00
github-actions 05f94af415 Fetch translations from Crowdin 2025-04-30 00:16:22 +00:00
pstef 48f842f307 CI: use the info target
These makefiles provide the info target that will print contents of each
variable that is not printed (unless V=1, which is not the case here) on
command invocation. Making this information available in the logs should
help debugging, but it doesn't need to be printed on each command
invocation.
2025-04-29 18:54:24 +00:00
pstef 0c838c14e9 Makefiles: don't print info unconditionally
The point of making the default "semi-silent" (each target is printed,
but not the entire invocation verbatim) was to factor out information
about invocation to a one-time target (info) and not repeating it ever
again. With V=1, the info target is silent, because each command
invocation will be printed verbatim, which needs no herald.

The undesired side effect of me introducing the info target and making
it a dependency of the default all target is that info doesn't respect
the --silent make option, so in this use case it was more noisy, not
less.

I believe the most elegant solution that satisfies all use cases is to
stop printing info unconditionally, and instead list it explicitly in
make invocations in CI, together with the all target. Then this info is
kept available for inspection from logs, but it's not repeated on each
invocation. The intention was to make the logs easier to read and scroll
in search for new compiler warnings.
2025-04-29 18:36:48 +00:00
github-actions 54af661d95 Fetch translations from Crowdin 2025-04-28 00:16:34 +00:00
LibretroAdmin a7fab4a394 Merge pull request #17833 from white-axe/emscripten-argb8
Fix feature test for `GL_CAPS_ARGB8` in Emscripten builds
2025-04-27 09:54:33 +02:00
github-actions 633ee296e7 Fetch translations from Crowdin 2025-04-27 00:17:17 +00:00
刘皓 ebd79bfa72 Fix feature test for GL_CAPS_ARGB8 in Emscripten builds 2025-04-26 19:11:19 -04:00
LibretroAdmin 3036fecc7c Merge pull request #17831 from pstef/Makefile.ctr
3DS: enable cloud sync
2025-04-26 12:32:57 +02:00
pstef fdcd4e78e8 3DS: enable Cloud Sync 2025-04-26 01:11:11 +00:00
pstef 57845fd3cf Remove commented-out needless HAVE_ features 2025-04-26 01:10:16 +00:00
github-actions 30aad19fae Fetch translations from Crowdin 2025-04-26 00:15:12 +00:00
github-actions 8af10c25a1 Fetch translations from Crowdin 2025-04-25 00:16:20 +00:00
LibretroAdmin 3ee6dd6481 Merge pull request #17828 from JoeOsborn/fix-uninitialized-variable
Fixes an uninitialized variable in extra wasmfs/fetchfs feature
2025-04-25 02:08:30 +02:00
Joseph C. Osborn 55f9f92eaf Fixes an uninitialized variable in extra wasmfs/fetchfs feature
Under some optimizations, this would lead to games using fetchfs
backend just crashing due to calling wasmfs functions on a garbage pointer.
2025-04-24 10:14:16 -07:00
LibretroAdmin 92fecf68b1 Merge pull request #17827 from white-axe/emscripten-webgl-get-proc-address 2025-04-24 07:25:17 -07:00
刘皓 1a5eb6e8b9 Implement get_proc_address for emscriptenwebgl_ctx 2025-04-23 22:12:10 -04:00
github-actions b2a5e97923 Fetch translations from Crowdin 2025-04-24 00:16:04 +00:00
github-actions ab515cd22d Fetch translations from Crowdin 2025-04-23 00:15:54 +00:00
github-actions 03525ffd5f Fetch translations from Crowdin 2025-04-22 00:15:59 +00:00
github-actions 547d739db4 Fetch translations from Crowdin 2025-04-21 00:16:40 +00:00
github-actions a2e512a094 Fetch translations from Crowdin 2025-04-20 00:17:09 +00:00
github-actions 76e7c9a3d9 Fetch translations from Crowdin 2025-04-19 00:15:24 +00:00
LibretroAdmin 056153ca5b Merge pull request #17821 from pstef/mean-and-mean 2025-04-18 15:42:35 -07:00
pstef 309c67a205 Revert "Define WIN32_LEAN_AND_MEAN to avoid collision with winsock2"
The Windows builds have been missing some libraries, notably
avdevice-58.dll, avfilter-7.dll, and prostproc-55.dll as reported by a
user on Discord.  I suspect it's caused by cc842fd, although I don't
fully understand why that would happen.
2025-04-18 21:12:17 +00:00
LibretroAdmin 21c5c5db36 Merge pull request #17815 from DisasterMo/master
Update the core localisation sync scripts, workflows and instructions
2025-04-18 09:01:36 -07:00
LibretroAdmin 60c8a34039 Merge pull request #17820 from zoltanvb/menu_driver_warning_fix
Avoid format length warning in menu_driver.c.
2025-04-18 09:00:57 -07:00
zoltanvb 6160b71ecc Avoid format length warning. 2025-04-18 17:33:55 +02:00
github-actions 0d66d4b1b3 Fetch translations from Crowdin 2025-04-18 00:15:29 +00:00
LibretroAdmin 0fef644219 Merge pull request #17818 from zoltanvb/msg_state_size
Fix core descriptions not showing
2025-04-17 15:06:10 -07:00
zoltanvb 597405ba89 Fix core descriptions not showing
In core downloader, description can be brought up by pressing
Select. However, for those cores where the description is longer
than what would be possible to display, nothing was displayed.
Several such cores exist, one example is Dosbox-Core.

Since this array is used for the messagebox, it is needless to make
it larger than what would be displayed anyway, and it makes other
safeguards act reasonably, so now there is info, just truncated.
2025-04-17 22:27:23 +02:00
LibretroAdmin c14016d6a2 Merge pull request #17817 from pstef/changelog 2025-04-17 00:23:09 -07:00
pstef ce36ea176a Add a few 3DS items 2025-04-17 06:25:30 +00:00
Joseph Mattiello 3eaa9f15a9 Add Microphone CoreAudio driver for iOS and macOS
Signed-off-by: Joseph Mattiello <[email protected]>
2025-04-16 15:37:11 -04:00
DisasterMo 453348afad Update the core localisation sync scripts, workflows and instructions 2025-04-16 18:58:02 +02:00
LibretroAdmin 94149644f9 Merge pull request #17812 from viachaslavic/fix_qt_dispatcher
Fix qt6 dispatcher
2025-04-16 07:24:16 -07:00
LibretroAdmin a5ddb4b007 Merge pull request #17813 from pstef/3ds-mrboom-audiomixer
Restore HAVE_AUDIOMIXER to fix MrBoom build
2025-04-16 07:24:01 -07:00
pstef 93b1d2c8d7 Restore HAVE_AUDIOMIXER to fix MrBoom build 2025-04-16 13:57:15 +00:00
LibretroAdmin f6cd9469ed Merge pull request #17811 from pstef/new_selection-int 2025-04-16 05:58:14 -07:00
LibretroAdmin d3b2c08e8b Merge pull request #17809 from pstef/3ds-compress-clean 2025-04-16 05:57:55 -07:00
Viačasłaŭ Chalikin 1736184f15 Fix qt6 dispatcher 2025-04-16 15:35:01 +03:00
pstef b9bee801fd Revert "Use size_t for new_selection as done everywhere else"
At least `case MENU_ACTION_UP` compares new_selection against 0, the
type needs to be signed. Revert 5710a7f6 now and revisit after a deeper
look.
2025-04-16 11:29:06 +00:00
pstef 4032fb47e8 Add missing compress.o object
Statically built cores like blueMSX call compress().
2025-04-16 06:30:25 +00:00
pstef fc15fce531 Fix logic in the clean target 2025-04-16 06:30:25 +00:00
LibretroAdmin 203fff1a11 Bump version 2025-04-14 23:04:09 -07:00
LibretroAdmin d14bf2f40d Update CHANGES.md 2025-04-14 17:37:11 -07:00
github-actions fd54639965 Fetch translations from Crowdin 2025-04-15 00:16:12 +00:00
LibretroAdmin 7b99a7ce85 Merge pull request #17807 from pstef/fixes 2025-04-14 04:52:59 -07:00
pstef 011469d7ef Fix broken logic in the clean target 2025-04-14 08:07:55 +00:00
github-actions f9d79b6afd Fetch translations from Crowdin 2025-04-14 00:16:58 +00:00
LibretroAdmin 7a1c9bd0b1 Merge pull request #17805 from zoltanvb/x11_multimouse
Extend X11 input driver with XInput2 extensions for multi-mouse
2025-04-13 06:03:07 -07:00
LibretroAdmin d36bbb6b91 Merge pull request #17803 from tekdahl/tekdahl-video-processor-magewell-patch 2025-04-13 04:39:38 -07:00
zoltanvb 1678e25af0 Extend X11 input driver with XInput2 extensions for multi-mouse
Add multi-mouse support for X11, by using XInput2 extensions. Only
master pointers are considered as mice.

New behavior put behind HAVE_XI2 and configure script extended with
necessary detection.
2025-04-13 12:16:53 +02:00
github-actions 69f319d16e Fetch translations from Crowdin 2025-04-13 00:40:20 +00:00
tekdahl 4e35a3749e Update video_processor_v4l2.c replaced/fixed list_resolutions function with code from pstef 2025-04-12 18:45:07 -05:00
pstef 6d2e7e4ec9 Remove unused variable 2025-04-12 23:02:22 +00:00
pstef cc842fd4b2 Define WIN32_LEAN_AND_MEAN to avoid collision with winsock2 2025-04-12 22:11:53 +00:00
pstef 89218d5640 Revert "Silence a -Wformat warning"
This reverts commit 4f9e86d24b.

Since uintmax_t is also a C99 feature, some other compiler complains.
2025-04-12 22:11:53 +00:00
LibretroAdmin 2ab308765d Merge pull request #17802 from warmenhoven/warmenhoven/pr/ios-build-fix
ios: build fix
2025-04-12 14:56:03 -07:00
Eric Warmenhoven 41d33e631b ios: build fix 2025-04-12 16:45:04 -04:00
LibretroAdmin 274d8732ab Merge pull request #17797 from pstef/makefiles 2025-04-12 10:10:26 -07:00
LibretroAdmin c6995c0b1d Merge pull request #17801 from pstef/win32-socket 2025-04-12 10:09:56 -07:00
LibretroAdmin a3ba931113 Merge pull request #17799 from tekdahl/tekdahl-video-processor-magewell-patch
video_processor_v4l2.c updates to make it work with my magewell card and added resolution options
2025-04-12 06:13:40 -07:00
LibretroAdmin ca850d09fe Merge pull request #17798 from warmenhoven/warmenhoven/pr/ios-man-scan
iOS: fix rescanning manual playlists after app update
2025-04-12 06:13:24 -07:00
LibretroAdmin 570290893b Merge pull request #17800 from pstef/fixes
Corrections after recent fixes
2025-04-12 06:13:15 -07:00
pstef d6cc1847bf Finish converting to SOCKET type in _WIN32 code
fixes c048a21
2025-04-12 10:45:08 +00:00
pstef 66aa1424f0 Define WIN32_LEAN_AND_MEAN to avoid collision with winsock2 2025-04-12 10:45:08 +00:00
pstef ea9b86c9e7 dr: import upstream change to silence a spurious warning 2025-04-12 10:30:36 +00:00
pstef 57726895dd Finish converting selection variables to size_t
fixes 5710a7f6e5
2025-04-12 10:30:36 +00:00
pstef ab3b321c66 cpuid: finish converting to int32_t
fixes b25cb6ea63
2025-04-12 10:30:36 +00:00
github-actions 05adec60da Fetch translations from Crowdin 2025-04-12 00:14:47 +00:00
tekdahl c63bab4c02 video_processor_v4l2.c
Added resolution picker/forcing.
Rewrote logic for finding ALSA audio devices in enumerate_audio_devices function
Added a skip for some of the interface queries that fail and aren't required for magewell usb.
2025-04-11 18:32:56 -05:00
Eric Warmenhoven 7998511c41 iOS: fix rescanning manual playlists after app update 2025-04-11 18:07:48 -04:00
pstef 34a1b824b6 Github CI: use silent mode for Wii U
It's not clear why it was turned on just for this target.
2025-04-11 17:12:08 +00:00
pstef de280cad9a Makefile.wiiu: print variables once in silent mode 2025-04-11 17:12:08 +00:00
pstef c93a050465 Makefile.wii: make one more target silenceable 2025-04-11 17:12:08 +00:00
pstef eb6305136d Makefile.wii: print variables once in silent mode 2025-04-11 17:12:08 +00:00
pstef 308593693c Makefile.wii: don't print all objects removed by the clean target in silent mode 2025-04-11 17:12:08 +00:00
pstef 25a1f1bb41 Makefile.webos: print variables once in silent mode 2025-04-11 17:12:08 +00:00
pstef e08ecd6f94 Makefile.webos: don't print all objects removed by the clean target in silent mode 2025-04-11 17:12:07 +00:00
pstef 192ca4179b Makefile.webos: make silent mode toggable 2025-04-11 17:12:07 +00:00
pstef 7f3f0106de Makefile.vita: implement silent mode 2025-04-11 17:12:07 +00:00
pstef 4b2196af6c Makefile.rs90: print variables once in silent mode 2025-04-11 17:12:07 +00:00
pstef 6e68e2f0da Makefile.rs90: don't print all objects removed by the clean target in silent mode 2025-04-11 17:12:07 +00:00
pstef f9de17b7ed Makefile.rs90: make silent mode toggable 2025-04-11 17:12:07 +00:00
pstef eb53b4174f Makefile.retrofw: print variables once in silent mode 2025-04-11 17:12:07 +00:00
pstef e907399419 Makefile.retrofw: don't print all objects removed by the clean target in silent mode 2025-04-11 17:12:07 +00:00
pstef edbe0f032c Makefile.retrofw: make silent mode toggable 2025-04-11 17:12:07 +00:00
pstef 58dc568c24 Makefile.psl1ght: implement silent mode 2025-04-11 17:12:07 +00:00
pstef 29072a3ac8 Makefile.ps2: implement silent mode 2025-04-11 17:12:07 +00:00
pstef d631a5b632 Makefile.orbis: implement silent mode 2025-04-11 17:12:07 +00:00
pstef e7c5eef862 Makefile.ngc: silence more targets in silent mode 2025-04-11 17:12:07 +00:00
pstef 941173c0df Makefile.ngc: print variables once in silent mode 2025-04-11 17:12:07 +00:00
pstef d373adc873 Makefile.ngc: don't print all objects removed by the clean target in silent mode 2025-04-11 17:12:07 +00:00
pstef d25aaac625 Makefile.miyoo: print variables once in silent mode 2025-04-11 17:12:07 +00:00
pstef cc75358335 Makefile.miyoo: don't list all objects removed by the clean target in silent mode 2025-04-11 17:12:07 +00:00
pstef 685b937e2f Makefile.miyoo: make silent mode toggable 2025-04-11 17:12:07 +00:00
pstef 41bbbc55db Makefile.dos: implement silent mode 2025-04-11 17:12:07 +00:00
pstef 6a8338efe9 Makefile.ctr: silence more targets in silent mode 2025-04-11 17:12:06 +00:00
pstef ddcf5285d1 Makefile.ctr: print variables once in silent mode 2025-04-11 17:12:06 +00:00
pstef fbf97b2326 Makefile: don't print all objects removed by the clean target 2025-04-11 17:12:06 +00:00
pstef ab2e577c66 Makefile: print variables once in silent mode 2025-04-11 17:12:06 +00:00
LibretroAdmin 4c0744b644 Merge pull request #17795 from pstef/selection-size_t 2025-04-10 20:25:55 -07:00
LibretroAdmin d76c015e9a Merge pull request #17796 from pstef/silence-warnings 2025-04-10 20:23:43 -07:00
github-actions ccc68a98bb Fetch translations from Crowdin 2025-04-11 00:15:51 +00:00
pstef c048a21aa4 Use platform-specific checks for invalid descriptors
Check network fd/socket validity using INVALID_SOCKET on Windows
(requiring conditional winsock2.h include) and < 0 otherwise.
Fixes -Wsign-compare warning.
2025-04-10 21:10:45 +00:00
pstef 6a302d0602 PSVita: add missing include 2025-04-10 21:10:45 +00:00
pstef b25cb6ea63 Use int32_t for x86_cpuid flags and handle MSVC types
Change the flags parameter to int32_t for explicit sizing. Add a check
and cast for MSVC __cpuid compatibility when int is 32-bit.

This silences a -Wincompatible-pointer-types warning where int32_t is
long int.
2025-04-10 21:10:45 +00:00
pstef 317c80a257 Silence a shorten-64-to-32 warning
The result of this multiplication will fit into a 32-bit int.
2025-04-10 21:10:45 +00:00
pstef 5710a7f6e5 Use size_t for new_selection as done everywhere else 2025-04-10 21:10:45 +00:00
pstef b5a4a0da79 Don't redefine _BSD_SOURCE
Imported from upstream.
2025-04-10 21:10:45 +00:00
pstef 620e440ab1 Silence an incompatible-pointer-types warning 2025-04-10 21:10:45 +00:00
pstef bcdb644bce Silence a discarded-qualifiers warning
waitUntilDeviceIsReady() should take a const char pointer as a
parameter, because it doesn't use it for writing. Since the function
prototype asks for a char pointer, cast it here.
2025-04-10 21:10:45 +00:00
pstef 4f9e86d24b Silence a -Wformat warning
Use %ju format specifier and cast the value to uintmax_t so that they
match on all platforms.
2025-04-10 21:10:45 +00:00
pstef 4d6c012009 Make space for three characters after a strlcpy call 2025-04-10 21:10:45 +00:00
pstef 187673fb2a Guard definition of an array just like its use is guarded 2025-04-10 21:10:45 +00:00
pstef bcc3ae448f Silence a -Waddress warning 2025-04-10 21:10:45 +00:00
pstef fbb093255a Check for string truncation to silence a warning 2025-04-10 21:10:44 +00:00
pstef 4f3ae82ed3 Savestate thumbnails: selection is usually size_t 2025-04-10 19:20:56 +00:00
LibretroAdmin 7a17ed09ee Merge pull request #17736 from MrHuu/ctr_core_load_unload 2025-04-10 03:36:07 -07:00
LibretroAdmin 82d8b9630a Merge pull request #17750 from BinBashBanana/master 2025-04-10 03:35:45 -07:00
github-actions aec5d1addd Fetch translations from Crowdin 2025-04-10 00:16:10 +00:00
LibretroAdmin af50c2fccb Merge pull request #17792 from pstef/wii-fixes
Wii fixes
2025-04-09 15:36:02 -07:00
pstef 6f95b974ba Bring in changes for GEKKO from upstream 2025-04-09 20:43:09 +00:00
pstef 7dce21c7d5 Copy quiet compilation mode from other Makefiles 2025-04-09 20:43:09 +00:00
pstef d65c17f6b8 Add missing includes
malloc.h for memalign() and unistd.h for usleep().
2025-04-09 20:43:09 +00:00
pstef e8d43b3d99 Add missing function declarations
They are absent even in upstream, so I decided against copying to the
local copy of libogc. And a couple of function prototypes doesn't seem
to warrant a new header file.
2025-04-09 20:43:09 +00:00
pstef b28a805f9c Remove remnants of a rejected idea
This was replaced simply by importing 3DS support from upstream.
2025-04-09 20:43:09 +00:00
LibretroAdmin 4bf8855fda Merge pull request #17754 from zoltanvb/udev_to_linuxraw_fallback
Save fallback to linuxraw driver in case of first boot.
2025-04-09 13:26:34 -07:00
LibretroAdmin 17ac0529c2 Merge pull request #17762 from pstef/ctr-mbedtls
3DS: enable mbedTLS
2025-04-09 13:25:38 -07:00
LibretroAdmin 634a0a9654 Merge pull request #17753 from pstef/ctr-nogriffin
Fix non-griffin build for 3DS and make it the default
2025-04-09 13:25:30 -07:00
pstefandpstef b98a730413 Use fabsf and intended threshold for refresh rate check (#17791)
Discussed with sonninnos

Co-authored-by: pstef <[email protected]>
2025-04-09 23:22:00 +03:00
LibretroAdmin 036df1e9b1 Merge pull request #17790 from pstef/gx2-update-uniform-block
Fix variable name collision
2025-04-09 10:55:34 -07:00
LibretroAdmin a10dbbc1d0 Merge pull request #17787 from warmenhoven/warmenhoven/pr/ios9-build-fix
ios: ios9 build fix
2025-04-09 10:55:22 -07:00
pstef 3b3065f736 Fix variable name collision
const char *id overshadowed the function parameter int id.
2025-04-09 16:59:49 +00:00
Eric Warmenhoven 0533debeab ios: ios9 build fix 2025-04-09 08:50:43 -04:00
LibretroAdmin 3fb20b49c8 Merge pull request #17786 from zoltanvb/android-patch-fix 2025-04-09 03:08:12 -07:00
zoltanvb 4ceea9d6ca Follow patched file changes. 2025-04-09 06:35:37 +02:00
LibretroAdmin de775c501c Merge pull request #17780 from pstef/cheat-manager 2025-04-08 18:46:51 -07:00
LibretroAdmin b5424e7448 Merge pull request #17783 from pstef/switch-performance-profiles 2025-04-08 18:44:20 -07:00
LibretroAdmin 973cb76c1c Merge pull request #17784 from warmenhoven/warmenhoven/pr/ios-screen-orient 2025-04-08 18:44:07 -07:00
github-actions bbafb16ea4 Fetch translations from Crowdin 2025-04-09 00:16:07 +00:00
Eric Warmenhoven afc32f02dc ios: screen orientation lock through display server 2025-04-08 15:39:04 -04:00
Ryunam fbd05aa185 Fix very minor build warning (#17781) 2025-04-08 20:24:51 +03:00
pstef e523a6c0be Relocate Switch CPU profile definitions
Move SWITCH_CPU_* array definitions from header to platform_switch.c.
Use extern declarations in the header. Add NULL/0 terminators to the
arrays and update size calculation and loops to use the terminators
where the number of elements can't be calculated.

The motivation for this change is to remove code duplication and silence
warnings about unused arrays in translation units that only used a
subset of them.
2025-04-08 17:12:03 +00:00
pstef 59c71b8db4 Rewrite part of cheat_manager_load_cb_second_pass()
This is to silence a stringop warning that I believe to be a false
positive.  Nevertheless, this change reduces verbosity of the code
and introduces a couple of checks that weren't there previously.

Note that the base parameter of this strtoul call is changed from 0
to 10, because previously the while loop rejected characters other
than 0-9 so strtoul didn't have to. Now that the loop is gone, the
call has to reject characters that are not decimal digits to keep
the logic as it was.
2025-04-08 06:16:59 +00:00
github-actions dc67ff6418 Fetch translations from Crowdin 2025-04-08 00:15:05 +00:00
LibretroAdmin 7ff7e49f56 Merge pull request #17776 from zoltanvb/delete_core_options
Enable core options reset without starting a core.
2025-04-07 16:02:50 -07:00
LibretroAdmin aca2d3a544 Merge pull request #17777 from JesseTG/jtg/fix-ffmpeg-camera-condition 2025-04-07 02:33:31 -07:00
github-actions 55df20c845 Fetch translations from Crowdin 2025-04-07 00:16:31 +00:00
Jesse Talavera 334519167b Make the condition for using camera_ffmpeg consistent with the Makefile
- Should fix a link error
2025-04-06 19:05:34 -04:00
zoltanvb 000c5dcd76 Enable core options reset before starting a core.
Add "Reset core options" menu to two more places:
- Manage Cores, where it can delete the options for the selected core
- Configuration, where it can delete the options for the loaded core

Current reset function is updated to delete the core options file if
reset is wanted for a specific core, or core was loaded but not yet
started. Meant as a recovery method for possibly fatal core option
changes.
2025-04-06 21:53:01 +02:00
pstef 1f26793fde 3DS: enable mbedTLS 2025-04-06 18:48:10 +00:00
pstef 4354fc331c Fix non-griffin build for 3DS and make it the default
While here:
* remove input_overlay and task_overlay from linking blacklist
* move -Werror to CC invocation since C++ refuses to use it
* copy the quiet build mode from the main Makefile and make it the
  default
* temporarily define DEPRECATED for gpu_old.h to allow succesful build
* replace the call to command_event() with one to retroarch_main_quit()
  in a failure case
2025-04-06 18:48:07 +00:00
pstef 70aaa0a55c Fix non-griffin build for 3DS and make it the default
While here:
* remove input_overlay and task_overlay from linking blacklist
* move -Werror to CC invocation since C++ refuses to use it
* copy the quiet build mode from the main Makefile and make it the
  default
* temporarily define DEPRECATED for gpu_old.h to allow succesful build
* replace the call to command_event() with one to retroarch_main_quit()
  in a failure case
* add missing uncompr.o in Makefile.common for HAVE_BUILTINZLIB
2025-04-06 18:35:41 +00:00
LibretroAdmin c9998dfb32 Merge pull request #17752 from neil4/fix-overlay-mouse-lightgun 2025-04-06 01:53:55 -07:00
LibretroAdmin d15c7f5669 Merge pull request #17772 from pstef/gamecube-fixes 2025-04-06 01:36:19 -07:00
pstef af8765cb3b Fix DCFlushRange size calculation
by correcting the operator precedence
2025-04-06 01:04:06 +00:00
pstef 3130717626 Don't redefine _SHIFTL and _SHIFTR macros 2025-04-06 00:59:15 +00:00
pstef a33542719f Guard nanosleep prototype behind _POSIX_TIMERS 2025-04-06 00:58:15 +00:00
pstef b3f1152049 Fix a callback function's type to enable compilation with GCC14 2025-04-06 00:57:34 +00:00
pstef 39fd1176dd Add a missing malloc.h include for memalign() 2025-04-06 00:56:04 +00:00
pstef 3c9d9373d2 Copy quiet compilation mode from other Makefiles 2025-04-06 00:55:37 +00:00
github-actions 44666bae9a Fetch translations from Crowdin 2025-04-06 00:17:06 +00:00
LibretroAdmin eca7fdcc99 Merge pull request #17770 from pstef/achievements-badges
Restore cheevos_badges_enable for HAVE_GFX_WIDGETS builds
2025-04-05 11:09:08 -07:00
pstef 9c4efa9af0 Restore cheevos_badges_enable for HAVE_GFX_WIDGETS builds
This change reduces stuttering when starting a game with
retroachievements enabled. I assume the stuttering is just postponed
until the badges are downloaded on demand, but it lets users pick their
poison.

This change helps but doesn't fix
https://github.com/libretro/RetroArch/issues/16470
https://github.com/libretro/RetroArch/issues/17027
https://github.com/libretro/RetroArch/issues/17758
2025-04-05 10:32:22 +00:00
github-actions d50825e5c7 Fetch translations from Crowdin 2025-04-05 00:14:42 +00:00
LibretroAdmin 3888bfd453 Merge pull request #17766 from pstef/pcsx_rearmed
CTR: fix type to re-enable compilation
2025-04-04 09:39:17 -07:00
odditude42 b8b11a6187 Excludes msvc compilation of Win11/MSYS2-specific registry-reading code to resolve (#17769)
MSVC2010 build issues.
2025-04-04 13:12:48 +03:00
github-actions 873ed01b7d Fetch translations from Crowdin 2025-04-04 00:16:08 +00:00
odditude42 9de225ed45 Moved declarations to fix MSVC2010 builds (C89 compliance) (#17768) 2025-04-04 01:42:02 +03:00
BinBashBanana f5a056b086 Fix safari file uploads 2025-04-03 10:24:06 -07:00
pstef 327ee894f4 CTR: fix type to re-enable compilation
with GCC14
2025-04-03 15:56:13 +00:00
LibretroAdmin 7a5fcd460d Merge pull request #17764 from zoltanvb/qt_nonpng_display
Enable non-png thumbnails also for Qt interface.
2025-04-02 16:17:29 -07:00
LibretroAdmin a3eb6afe8d Merge pull request #17765 from pstef/net-http-resolve-entry
Fix crash in net_http_resolve() in single-thread mode
2025-04-02 16:17:12 -07:00
pstef 71ddadfcfb Fix crash in net_http_resolve() in single-thread mode
Pass the right object to the resolving function
2025-04-02 21:32:11 +00:00
zoltanvb fb9aad1a3e Enable non-png thumbnails also for Qt interface. 2025-04-02 22:43:25 +02:00
github-actions d1a53e7d05 Fetch translations from Crowdin 2025-04-02 00:16:30 +00:00
zoltanvb 3bbbeca957 Save fallback to linuxraw driver in case of first boot.
When no devices can be detected and it is the initial boot, make
sure the driver is set to linuxraw, if supported.
2025-04-01 21:55:14 +02:00
LibretroAdmin 454dedf034 Merge pull request #17757 from kokoko3k/master
FIX shader wildcards.
2025-04-01 05:54:11 -07:00
LibretroAdmin 029469b3d9 Merge pull request #17760 from white-axe/vita-pic-veneer
Use `-Wl,--pic-veneer` instead of `-fno-optimize-sibling-calls` in Makefile.vita
2025-04-01 05:53:45 -07:00
刘皓 665d930823 Use -Wl,--pic-veneer instead of -fno-optimize-sibling-calls in Makefile.vita 2025-03-31 23:05:59 -04:00
BinBashBanana 4d95024bd6 Makefile compatibility fixes 2025-03-31 18:13:15 -07:00
github-actions 031a315329 Fetch translations from Crowdin 2025-04-01 00:18:16 +00:00
Antonio Orefice 97725bfac3 remove a debug message 2025-03-31 18:23:56 +02:00
Antonio Orefice d7c00869fb FIX shader wildcards.
All wildcards: Use strlen() because STRLEN_CONST cannot work on wildcard_tokens[i].token_name
CORE and VID-DRV wildcards: correctly update _len
2025-03-31 18:19:18 +02:00
github-actions 06eabf2d13 Fetch translations from Crowdin 2025-03-31 00:15:56 +00:00
BinBashBanana 393e1b4b98 Fixes for #17750 2025-03-30 13:15:50 -07:00
LibretroAdmin 1b3973edbc Merge pull request #17747 from pstef/video-frame-delay-setting-rewrite 2025-03-30 01:11:13 -07:00
github-actions 57b1d5880f Fetch translations from Crowdin 2025-03-30 00:16:43 +00:00
nfore b9beaa8564 Fix overlay lightgun, mouse & pointer
- Ensure other touchscreen input is blocked when overlay buttons pressed
- Limit physical+overlay mouse input to iOS for now
- Reset overlay mouse deltas when there is no touch input
- Disable touch mouse in android_input.c for now. Too buggy
2025-03-29 08:56:35 -05:00
MrHuu 736e1b30f3 Static core loading 2025-03-29 11:26:58 +01:00
LibretroAdmin 76598f1016 Merge pull request #17745 from pstef/silence-warnings
Silence warnings
2025-03-29 03:12:00 -07:00
LibretroAdmin a3c144d6ca Merge pull request #17749 from odditude42/master
Updated platform_win32.c to properly detect OS version info on Win11.
2025-03-29 03:11:51 -07:00
BinBashBanana 05cefc9a4d AudioWorklet driver, misc. emscripten fixes 2025-03-28 19:41:40 -07:00
odditude42 c23e6ff017 Updated platform_win32.c to properly detect OS version info on Win11.
Removed .vscode config files which were still cached in the index
  prior to the directory being added to .gitignore.
2025-03-28 19:25:25 -04:00
pstef bf1ff07fd0 Rewrite setting_get_string_representation_video_frame_delay()
Reduce indentation, squash a warning, simplify code.
2025-03-28 17:30:53 +00:00
pstef 80a74cca68 Remove unused variable
sonninnos says it might have been a copy and paste leftover.
2025-03-28 17:09:14 +00:00
pstef 83e974077f Guarantee space for string characters after strlcpy
to silence a couple of stringop-overflow warnings (3DS).
2025-03-28 11:11:09 +00:00
pstef 59a0665a20 Remove unused variable
unused since b5e01422e1
2025-03-28 10:57:53 +00:00
pstef df6e3dbda8 Silence warnings about sign mismatch 2025-03-28 10:57:53 +00:00
pstef b59b038a3e Silence an unreferenced local variable warning
Not used here since 106dc5d8b7
2025-03-28 09:48:21 +00:00
pstef a25a4d29a8 Silence a -Waddress warning 2025-03-28 09:48:21 +00:00
pstef 2daad9f89f Remove unused variables
They were never used and seem to have been copied from
action_ok_push_dropdown_item_input_device_type().
2025-03-28 09:48:21 +00:00
pstef 3bf6635ec6 Make printf format match the type 2025-03-28 09:48:20 +00:00
LibretroAdmin cb69d250b0 Merge pull request #17739 from zoltanvb/linuxraw_keyboard
Extend keyboard input for linuxraw input driver
2025-03-27 17:05:20 -07:00
pstef aa94f571e2 Silence an unused variable warning
This is not used since 73abaddd9c
2025-03-27 23:21:19 +00:00
pstef 5ef2b5a442 Silence a defined-but-not-used-function warning
Enclose the static function definitions in an ifdef like the one used
where they are called.
2025-03-27 19:06:28 +00:00
pstef c6fb0871e9 Simplify save_keybind_axis()
Also use matching sprintf format and type to silence a format warning.
2025-03-27 18:47:52 +00:00
pstef 626ef6ce4b Remove unused variable
It would be used only once in this context, so just remove it.
2025-03-27 18:33:55 +00:00
zoltanvb 5b2904930b Extend keyboard input for linuxraw input driver
The keyboard support for linuxraw driver was a bit spotty. Extended
with missing keyboard query, callback, and a few fixes against
over-indexing the status array.
2025-03-27 15:04:19 +01:00
github-actions a3b690ec58 Fetch translations from Crowdin 2025-03-27 00:15:32 +00:00
LibretroAdmin 999de04ace Merge pull request #17733 from pstef/ozone-footer-label 2025-03-25 21:45:08 -07:00
LibretroAdmin f0aeeb7732 Merge pull request #17734 from pstef/silence-warnings 2025-03-25 21:44:30 -07:00
LibretroAdmin fbed58ff08 Merge pull request #17735 from pstef/freeze-ui-3ds 2025-03-25 21:43:17 -07:00
github-actions 0d39aa3d88 Fetch translations from Crowdin 2025-03-26 00:15:49 +00:00
pstef eb8819867b Partially revert 0033224c25
font_driver_get_message_width() can return -1 if it fails,
ozone_cache_footer_label() has a fallback for this case
2025-03-25 21:02:29 +00:00
pstef 870d57445a Move INLINE earlier in function declarations
to silence a warning.
2025-03-25 20:20:37 +00:00
pstef 052acd4e38 Reorder arguments in calls to calloc
to silence calloc-tran sposed-args warnings.
2025-03-25 20:15:20 +00:00
pstef ac38cfe8da Silence -Waddress
This is a continuation of c9149895f5
2025-03-25 20:06:33 +00:00
pstef 50ecf3877c Fix UI freeze when threaded rendering is enabled on 3DS
Before this change, there was at least one scenario in which the UI
would seemingly freeze and a restart was needed. That's when an update
of cores was attempted with threaded rendering enabled.

Fixes https://github.com/libretro/RetroArch/issues/17727
2025-03-25 17:18:29 +00:00
pstef a4bfd84cc7 Silence warnings about sign mismatch 2025-03-25 16:55:39 +00:00
pstef 281dff8956 Silence a stringop-overflow warning
Guard against an unlikely case.
2025-03-25 16:55:39 +00:00
pstef 39495ced67 Silence a type-limits warning
Before this change, an 8-bit value was guaranteed to be lesser than the
size of this array (256). Instead of removing the check, I make it
meaningful by reducing the size of the array.
2025-03-25 16:55:39 +00:00
LibretroAdmin 962afed9dd Merge pull request #17729 from pstef/limit-stack-usage 2025-03-25 04:40:14 -07:00
LibretroAdmin 873c467240 Merge pull request #17728 from pstef/signed-slot 2025-03-25 04:39:59 -07:00
github-actions 2406935a58 Fetch translations from Crowdin 2025-03-25 00:16:11 +00:00
github-actions f6076a4203 Fetch translations from Crowdin 2025-03-24 00:16:01 +00:00
pstef b995db627b Change the type of slot to int
Everywhere around this function it is an int, and within this function
there is also a check for sign, which makes me think unsigned was a
mistake.
2025-03-23 22:33:17 +00:00
pstef b0109b5829 Reduce stack usage in task_database_cue.c
Move disc_data from stack to heap.
2025-03-23 13:28:28 +00:00
pstef d5ba7902a4 Reduce stack usage in command.c
by using PATH_MAX_LENGTH to define the length of buffers that store
paths.
2025-03-23 09:31:08 +00:00
LibretroAdmin 99af19b6fe Merge pull request #17722 from pstef/extensions-rewrite
File extension list generation rewrite
2025-03-23 02:30:47 -07:00
LibretroAdmin a1ce57f11f Merge pull request #17723 from pstef/cmd-special
Push the compiler to reserve space for negative commands
2025-03-23 02:29:55 -07:00
LibretroAdmin 8ae97ac91e Merge pull request #17724 from pstef/negative-accumulator
Allow frame_time_accumulator to go negative
2025-03-23 02:29:41 -07:00
github-actions b0507c0235 Fetch translations from Crowdin 2025-03-23 00:16:41 +00:00
pstef d14801d65b File extension list generation rewrite
Only limit extensions under the condition that the valid_extensions list
is not empty and the user wishes to limit the extensions. Otherwise
present files of all recognized extensions.

Part of this logic was implemented in 8f32801292 where the
point was to show supported files when core info file is missing. The
other part is the filter_by_current_core option.
2025-03-22 20:37:05 +00:00
LibretroAdmin e05dc9837b Merge pull request #17721 from mittonk/lr-dice_apple
Package lr-dice for the Apple Store.
2025-03-22 07:21:44 -07:00
Ken Mitton 59d1b94b65 Package lr-dice for the Apple Store. 2025-03-21 11:53:50 -04:00
LibretroAdmin 5adaaf7851 Merge pull request #17717 from pstef/silence-warnings
Silence even more warnings
2025-03-21 08:41:40 -07:00
pstef 3be0cfe09c Allow frame_time_accumulator to go negative
to be able to catch the underflow and correct it.
2025-03-20 21:44:39 +00:00
pstef c3dfc7ec63 Push the compiler to reserve space for negative commands
Cheevos define a special macro defined to -1 and uses it as one of the
values for enum event_command. Make this value a part of the enum
definition so that this type is not optimized to be unsigned.
2025-03-20 21:32:56 +00:00
pstef a28b79215f Silence warning about type sign mismatch
Make this enum act like a type, use it and let the compiler choose and
handle signedness so that it all matches.
2025-03-20 18:24:55 +00:00
LibretroAdmin a58ac85dbc Merge pull request #17704 from zoltanvb/android_bind_hold
Change bind hold default on Android
2025-03-20 11:05:49 -07:00
pstef 3fb7d190bf Silence warning about possible truncation
Also simplify this part; the point here is to start the copy later, but
otherwise the buffer size is the same, and it's still a string, so needs
no special handling.
2025-03-20 16:51:58 +00:00
pstef b85bcb8e48 Adjust types of index and maxindex to unsigned 2025-03-20 16:21:27 +00:00
pstef ce6cd0000c Don't free members of struct before init 2025-03-20 16:12:12 +00:00
pstef c978717b61 Silence a warning about no return value from non-void function
It seems the idea is to continue with installation, regardless of what
happened within deleteCia, so I just change its return type to void.
2025-03-20 06:26:44 +00:00
pstef 29639b98b3 Use the return value of rbtree_insert to silence a warning
The function prototype wants us to be warned when the result is not
used, but it's not clear why - I assume to check for failure.
2025-03-20 06:26:44 +00:00
LibretroAdmin ee881cfd67 Merge pull request #17706 from zoltanvb/plain_drm_fix
Enable compilation with plain_drm without other video drivers.
2025-03-19 18:04:52 -07:00
LibretroAdmin e6887be45c Merge pull request #17710 from warmenhoven/warmenhoven/pr/apple-strlcpy
apple: fix strlcpy where src and dst are the same
2025-03-19 18:04:41 -07:00
LibretroAdmin f7b4af89e9 Merge pull request #17713 from pstef/silence-warnings
Silence warnings
2025-03-19 18:04:22 -07:00
github-actions 9fe9cb0939 Fetch translations from Crowdin 2025-03-20 00:15:04 +00:00
pstef 17a05ea939 Silence a dangling-pointer warning in Lzma 2025-03-19 20:19:39 +00:00
pstef f7285ff405 Silence warning: left shift of negative value
Import the change from upstream 16c83cd5fc4c18954c1b6e3de16c37ba
2025-03-19 20:09:15 +00:00
pstef a27d49b6f2 Silence GCC stringop-overflow
At optimization level -O3, GCC generates a warning about its own
optimizations, likely due to loop unrolling. Manually unroll the loop to
eliminate any ambiguity and prevent the warning.
2025-03-19 19:57:50 +00:00
pstef 3dca8dbf66 Silence -Walloc-size-larger-than=byte-size
One of the GCC14's optimization heuristic triggered here, suggesting
that the special value of len (size_t) could potentially be lesser than
the file's size (int64_t) but greater than "maximum object size" (set by
byte-size, PTRDIFF_MAX by default).

Use the same type as the file size it's compared to, and adjust the
sentinel value to spell INT64_MAX.
2025-03-19 17:35:15 +00:00
github-actions 5c093a7211 Fetch translations from Crowdin 2025-03-19 00:22:56 +00:00
Eric Warmenhoven 86fddd5326 apple: fix strlcpy where src and dst are the same 2025-03-17 15:34:45 -04:00
sonninnos 5365639a36 Win32: Fix pick core dialog (#17709) 2025-03-17 18:10:50 +02:00
zoltanvb 6ce2a12c4d Enable compilation with plain_drm without other video drivers. 2025-03-17 06:04:06 +01:00
github-actions 81b74decb3 Fetch translations from Crowdin 2025-03-17 00:16:11 +00:00
LibretroAdmin fbcd3a77fb Merge pull request #17705 from pstef/silence-warnings-ctr
CTR: more compiler warnings cleanup
2025-03-16 09:29:39 -07:00
pstef bad0e58372 CTR: more compiler warnings cleanup
* unsigned vs signed comparison
* copy DEBUG_VAR from wiiu - this one prints pointer values in a
  portable way
* prove GCC14 that a date formatted as "00/00/0000" can fit into 11
  bytes
* explicitly mention previously unhandled enum constants
* Adding GFX widgets in b9849f78f7 and 1235a7435e orphaned
  ctr_set_osd_msg(). Reinstate it instead of removing, since it's
  effectively the same as calling font_driver_render_msg, but with
  checks.
* remove sp from clobber list in inline assembly
2025-03-16 14:00:35 +00:00
zoltanvb 485b055d48 Change bind hold default on Android
Due to touchscreen quick tap function, binding runs into problems
with the default setting that works well on other platforms. Using
a nonzero value avoids that problem.
2025-03-16 14:28:21 +01:00
LibretroAdmin bf3752ed61 Merge pull request #17702 from pstef/silence-warnings-ctr 2025-03-15 18:08:22 -07:00
LibretroAdmin 98b1601fcb Merge pull request #17701 from zoltanvb/reserved_device_multiple_instance 2025-03-15 18:07:03 -07:00
LibretroAdmin 040cbe00d6 Merge pull request #17698 from pstef/Makefile.ctr-debug 2025-03-15 18:06:49 -07:00
LibretroAdmin c2ffa044f9 Merge pull request #17700 from pstef/realloc-ext-list 2025-03-15 18:06:35 -07:00
pstef fc9f0b04be CTR: Silence a couple of GCC 14 warnings 2025-03-16 01:01:04 +00:00
github-actions b9de670da0 Fetch translations from Crowdin 2025-03-16 00:15:47 +00:00
zoltanvb ba5489128f Fix reserved device selection when multiple controller instances are present
If multiple instances of the same controller type are present, they will be
postfixed by (#2), (#3) etc. This made menu selection ineffective.
2025-03-15 18:40:33 +01:00
pstef 62ccd05e36 Try to avoid overflowing the stack
PATH_MAX_LENGTH is pretty short on CTR and not really adequate here
since this buffer is not storing a path.

Allocate and possibly reallocate from heap instead of using the
stack here.
2025-03-15 16:43:38 +00:00
pstef b8a340641a Make debugging on CTR easier
Only omit frame pointers on non-debug builds.
2025-03-15 10:30:06 +00:00
github-actions a186bdba06 Fetch translations from Crowdin 2025-03-15 00:14:20 +00:00
LibretroAdmin ea592051c7 Merge pull request #17696 from sonninnos/content-load-archive
Show load before open in archives
2025-03-14 13:46:28 -07:00
LibretroAdmin 4923c2e70b Merge pull request #17697 from sonninnos/core-suggest
Suggest cores only when core is not loaded
2025-03-14 13:46:20 -07:00
sonninnos e64d52740b Suggest cores only when core is not loaded 2025-03-14 12:50:15 +02:00
sonninnos ee2cf436d4 Show load before open in archives 2025-03-14 12:47:58 +02:00
github-actions 113ff2f009 Fetch translations from Crowdin 2025-03-14 00:14:58 +00:00
LibretroAdmin 51b13fc58c Merge pull request #17695 from sonninnos/core-load-unload
Core load+unload fixes
2025-03-13 09:17:44 -07:00
sonninnos ee8a641275 Core load+unload fixes 2025-03-13 15:09:38 +02:00
LibretroAdmin 0b2b933388 Merge pull request #17681 from SternXD/uwp-update-angle 2025-03-12 22:00:30 -07:00
LibretroAdmin bfad782acc Merge pull request #17679 from SternXD/uwp-invalid-key 2025-03-12 22:00:19 -07:00
github-actions c0348de3db Fetch translations from Crowdin 2025-03-13 00:15:32 +00:00
LibretroAdmin 7e1c036fc0 Merge pull request #17693 from JesseTG/jtg/fix-light-sensor-parsing 2025-03-12 16:43:54 -07:00
LibretroAdmin faae5b1519 Merge pull request #17692 from JoeOsborn/fetch-single-backend 2025-03-12 16:43:40 -07:00
Jesse Talavera a52a63c381 Fix the light sensor reading on Linux input drivers
A previous `errno` was causing `linux_read_illuminance_sensor` to fail despite parsing the returned value correctly
2025-03-12 18:25:21 -04:00
Joseph C. Osborn 525e1cff49 Slightly more informative printf 2025-03-12 15:11:23 -07:00
Joseph C. Osborn 52e2ee9272 add abort in case only one of manifest/base dir defined 2025-03-12 15:10:49 -07:00
Joseph C. Osborn d4d3aee457 Strip newline from base_url, use wasmfs_create_file instead of open
Also style fixes
2025-03-12 15:06:29 -07:00
LibretroAdmin 919868aa0a Merge pull request #17688 from zoltanvb/changelist_update 2025-03-11 22:02:35 -07:00
github-actions a36e380337 Fetch translations from Crowdin 2025-03-12 00:15:19 +00:00
zoltanvb 5cf14cc14c Changes up to 2025-03-11 2025-03-11 23:20:48 +01:00
github-actions c94e4cff85 Fetch translations from Crowdin 2025-03-11 00:15:37 +00:00
Joseph C. Osborn 809e5d78be create a single fetchfs backend instead of 1 per file
symlinking manifest entries and using a baseurl gives us a way to
create just a single fetchfs backend (and a single thread) since
emscripten upstream is not willing to integrate manifest support to
fetchfs directly.

Retroarch embedders could use this to get assets or other resources
lazily or chunk-by-chunk for large files.
2025-03-10 15:04:38 -07:00
SternXD 37b349432f UWP: Update invalid pfx key 2025-03-10 11:24:42 -04:00
SternXD 1761aa0814 UWP: Update x64 Angle Binaries 2025-03-10 11:01:27 -04:00
LibretroAdmin 9e64cce10f Merge pull request #17678 from warmenhoven/warmenhoven/cloud-ignore 2025-03-10 04:35:37 -07:00
github-actions e7132c1c59 Fetch translations from Crowdin 2025-03-10 00:13:28 +00:00
Eric Warmenhoven 3943f5b6b0 cloud sync: properly handle ignored directories 2025-03-09 18:24:02 -04:00
LibretroAdmin 4c5cf5a8e5 Merge pull request #17671 from zoltanvb/remove_discord_avatar
Remove discord avatar references
2025-03-09 09:17:22 -07:00
zoltanvb 675909333d Remove discord avatar references
These additions were never enabled in current builds, discord
avatar stuff was disabled in #7964.
2025-03-09 09:00:25 +01:00
LibretroAdmin 4b368ae008 Merge pull request #17664 from BinBashBanana/master 2025-03-08 20:24:15 -08:00
github-actions 86800ed493 Fetch translations from Crowdin 2025-03-09 00:13:40 +00:00
github-actions 9cad6dd993 Fetch translations from Crowdin 2025-03-08 00:12:01 +00:00
LibretroAdmin 644fd891d7 Merge pull request #17665 from zoltanvb/android_pause_key
Remove special handling of pause key on Android
2025-03-07 09:21:18 -08:00
github-actions 0868c16564 Fetch translations from Crowdin 2025-03-07 00:15:02 +00:00
BinBashBanana c672730259 address issues 2025-03-06 15:38:40 -08:00
zoltanvb 176247d3bc Remove special handling of pause key 2025-03-06 17:55:37 +01:00
github-actions a6316465a3 Fetch translations from Crowdin 2025-03-06 00:14:36 +00:00
LibretroAdmin 7f1a348d03 Merge pull request #17663 from warmenhoven/warmenhoven/pr/apple-def-avf
apple: make avfoundation camera the default driver
2025-03-05 15:29:23 -08:00
BinBashBanana f6eb1ed5c5 Threaded emscripten improvements 2025-03-05 10:39:43 -08:00
Eric Warmenhoven 733bae3b3a apple: make avfoundation camera the default driver 2025-03-05 10:05:36 -05:00
LibretroAdmin 96a72e834a Merge pull request #17660 from warmenhoven/warmenhoven/pr/ios9-ci
ios9 ci: move back to run on old xcode version
2025-03-05 06:11:35 -08:00
LibretroAdmin 978c84ee1e Merge pull request #17662 from zoltanvb/android_game_focus
Fix keyboard_mapping_blocked usage on Android (game focus)
2025-03-05 06:09:02 -08:00
zoltanvb 27b67c1340 Fix keyboard_mapping_blocked usage (game focus) 2025-03-05 06:23:53 +01:00
github-actions eafd46d84e Fetch translations from Crowdin 2025-03-05 00:15:09 +00:00
Eric Warmenhoven 9d4a4e29fc ios9 ci: move back to run on old xcode version 2025-03-04 15:30:33 -05:00
LibretroAdmin 80b62db04e Merge pull request #17657 from warmenhoven/warmenhoven/pr/apple-avf-camera
apple: enable JoeMatt's avfoundation-based camera driver
2025-03-04 07:32:13 -08:00
LibretroAdmin 9a8035bad1 Merge pull request #17656 from warmenhoven/warmenhoven/pr/macos-flto
macos: compile with -flto
2025-03-04 07:32:05 -08:00
LibretroAdmin c2933b91c2 Merge pull request #17655 from warmenhoven/warmenhoven/pr/apple-so-entitled
apple: add camera entitlements
2025-03-04 07:31:57 -08:00
LibretroAdmin fe11b3ffb1 Merge pull request #17654 from warmenhoven/warmenhoven/pr/apple-build
apple: by default build on apple silicon builder
2025-03-04 07:31:38 -08:00
Eric Warmenhoven 8c729fd029 apple: enable JoeMatt's avfoundation-based camera driver 2025-03-03 23:20:59 -05:00
Eric Warmenhoven 6c7b16df3c macos: compile with -flto 2025-03-03 22:51:16 -05:00
Eric Warmenhoven c1806ff994 apple: add camera entitlements 2025-03-03 22:46:43 -05:00
Eric Warmenhoven 6dcb0b22f2 apple: by default build on apple silicon builder 2025-03-03 21:54:46 -05:00
github-actions 58752d0755 Fetch translations from Crowdin 2025-03-04 00:15:10 +00:00
github-actions 6df846dc61 Fetch translations from Crowdin 2025-03-03 00:14:58 +00:00
LibretroAdmin 647bba1125 Merge pull request #17648 from warmenhoven/warmenhoven/pr/webdav-301
webdav: workaround for getting 301 redirects
2025-03-02 15:57:32 -08:00
LibretroAdmin fd5543cc2d Merge pull request #17651 from zoltanvb/offset_sublabel_fix
Update viewport bias sublabels.
2025-03-02 15:57:22 -08:00
LibretroAdmin d862f87c28 Merge pull request #17652 from JesseTG/jtg/libavdevice-camera-driver
Add a ffmpeg-based camera driver
2025-03-02 15:57:13 -08:00
Jesse Talavera e9e12eed66 Move a variable declaration up to adhere to C89 rules 2025-03-02 17:00:40 -05:00
Jesse Talavera 80044dd282 Clarify a comment 2025-03-02 17:00:24 -05:00
zoltanvb 6294854990 Update viewport bias sublabels. 2025-03-02 16:29:16 +01:00
Eric Warmenhoven 962cc9b033 webdav: workaround for getting 301 redirects 2025-03-01 22:53:11 -05:00
Joe Osborn f2a86f34d1 Remove unnecessary rigmarole around importing the script as a blob (#17642) 2025-03-01 17:34:05 -08:00
sonninnos 23170b82ec Add MIDI device menu item dropdowns (#17645) 2025-03-01 17:33:46 -08:00
github-actions 7cb27c965d Fetch translations from Crowdin 2025-03-02 00:16:20 +00:00
sonninnos 5c92055aef Fix cloud sync driver menu item refresh 2025-03-01 11:47:53 +02:00
Viačasłaŭ 6bfe3fcb43 (Win32) Unrevert TTS fallback (#17643)
Originally implemented in 274d47f
2025-03-01 01:04:29 -08:00
sonninnos 6a717fd44c Better way to count dropped frames 2025-03-01 10:40:59 +02:00
github-actions b3e2d5213d Fetch translations from Crowdin 2025-03-01 00:17:26 +00:00
Joseph C. Osborn c29cd046d0 Fixes asset paths/double bundle path for web player 2025-02-28 18:44:31 +01:00
sonninnos aaa7b272aa XMB: Gray theme color correction 2025-02-28 08:44:37 +02:00
zoltanvb 31de40b32a Align GDI feature reporting with actual status (#17635)
Value of HAVE_GDI is always 1 unless explicitly disabled, however
it only takes effect on Windows platforms. Actual functionality
is behind multiple #ifdef's, but the feature indication was showing
up even on platforms like Linux.
2025-02-27 20:15:43 -08:00
sonninnos b62cc87e84 Turbo Fire overhaul (#17633) 2025-02-27 20:15:22 -08:00
Joe Osborn 7a7c208c85 Only read first frame of inputs under new movie formats (#17634) 2025-02-27 20:15:14 -08:00
zoltanvb 9970d45367 Make autoconfig failure notifications optional. (#17636)
Introduce a new setting that controls autoconfiguration messages
when the config fails, either with fallback or without.
2025-02-27 20:15:06 -08:00
Joe Osborn fa6d622031 Cancel bootup main loop before starting regular mainloop (#17638) 2025-02-27 20:14:57 -08:00
zoltanvb 8396d8e626 Fix bluetooth option ifdef (#17639) 2025-02-27 20:14:49 -08:00
github-actions e9dd1731ee Fetch translations from Crowdin 2025-02-28 00:14:51 +00:00
github-actions 62f32e5f63 Fetch translations from Crowdin 2025-02-26 00:15:19 +00:00
github-actions e16953b9af Fetch translations from Crowdin 2025-02-25 00:14:55 +00:00
Joe Osborn c413bcc626 Threaded emscripten fixes (#17614)
* Actually read CLI args in emscripten

* Fix fetchfs manifest parsing, increase download chunk size

The chunk size should probably be made a parameter in the future.  The
larger chunk size trades longer hitches for fewer hitches.

* Add exec command driver and API functions for emscripten.

Under WASMFS, stdin/stdout can't be customized the way they can with
the JS FS implementation.  Also, this approach frees up stdin/stdout
and simplifies interaction with the command interface for web embedders.

* fixup upload paths, show use of new emscripten cmd interface

* Add JS library function names to EXPORTS as well as EXPORTED_FUNCTIONS for older emsdk versions
2025-02-24 09:25:05 -08:00
github-actions 55b59262b9 Fetch translations from Crowdin 2025-02-24 00:15:28 +00:00
Jesse Talavera e7142903ea Use av_dict_get instead of av_dict_iterate
- The latter seems to be newer, and therefore not available in all common installations of libavdevice
2025-02-23 15:26:58 -05:00
Bernhard Schelling b725de086e Fix netplay when using core netpacket interface after a recent change made for cheevos (#17619) 2025-02-23 04:26:02 -08:00
刘皓 b3376716f2 Add declaration for libnx_apply_overclock() in menu/menu_driver.c (#17620) 2025-02-23 04:25:49 -08:00
刘皓 c9ed5df025 Add PS3 build to GitHub Actions (#17621) 2025-02-23 04:25:39 -08:00
Eric Warmenhoven 84eb4f32e0 Small adjustment to coordinating mouse inputs (#17622) 2025-02-23 04:25:29 -08:00
sonninnos 4de34208ed Ozone: Messagebox font fix 2025-02-22 22:31:47 +02:00
github-actions b5fd91972c Fetch translations from Crowdin 2025-02-22 00:13:39 +00:00
sonninnos 3c1a1a44ae Vulkan: Add adaptive vsync support (#17611) 2025-02-21 12:34:32 -08:00
Eric Warmenhoven f7d235f2d6 update core info list after updating core info files (#17613) 2025-02-21 12:34:06 -08:00
Hed0nium bc1bc2431d Update AUTHORS.h: Edit name (#17610) 2025-02-21 12:33:48 -08:00
Eric Warmenhoven e26b3bca4e allow mouse input while mouse overlay is active (#17615) 2025-02-21 12:33:27 -08:00
Eric Warmenhoven 273eb7bd7b fix sublabel on "add to playlist" in quick menu (#17616) 2025-02-21 12:33:18 -08:00
Joe Osborn 9005e1b9fe Use correct key into message data to get last asset fetch time (#17607) 2025-02-21 07:40:49 +01:00
Jesse Talavera 527b977587 Simplify ffmpeg backend selection 2025-02-20 16:35:06 -05:00
Jesse Talavera dd49f8fa0d Remove camera device list functions from camera drivers
- Those will come in a future PR instead
2025-02-20 15:42:02 -05:00
sonninnos 61de3a3260 Integer scaling improvements (#17606) 2025-02-20 19:51:19 +02:00
Jesse Talavera 63d965753f Merge branch 'refs/heads/master' into jtg/libavdevice-camera-driver
# Conflicts:
#	camera/camera_driver.c
#	configuration.c
2025-02-20 11:28:54 -05:00
sonninnos fce67c1fab Use core fps instead of display rate when counting dropped frames (#17605) 2025-02-20 14:10:08 +02:00
sonninnos b5756a1b20 Prevent crash when Main Menu is empty (#17604) 2025-02-20 14:09:47 +02:00
github-actions 09a59edd6b Fetch translations from Crowdin 2025-02-20 00:14:51 +00:00
Joe Osborn 56014a27d6 Enable pthreads on Emscripten (#17586)
* workerized RA

* Workerized (non-async) web player, using OPFS

This patch eliminates the need for asyncify and uses modern filesystem
APIs instead of the deprecated, unmaintained BrowserFS.

This is a WIP patch because it won't fully work until these two
Emscripten PRs land and are released:

https://github.com/emscripten-core/emscripten/pull/23518
https://github.com/emscripten-core/emscripten/pull/23021

The former fixes an offscreen canvas context recreation bug, and the
latter adds an equivalent to BrowserFS's XHR filesystem (but without
the hazardous running-XHR-on-the-main-thread problem).

The biggest issue is that local storage of users who were using the
old version of the webplayer will be gone when they switch to the new
webplayer.  I don't have a good story for converting the old BrowserFS
IDBFS contents into the new OPFS filesystem (the move is worth doing
because OPFS supports seeking and reading only bits of a file, and
because BrowserFS is dead).

I've kept around the old libretro webplayer under
pkg/emscripten/libretro-classic, and with these make flags you can
build a non-workerized RA that uses asyncify to sleep as before:

make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1

I also moved the default directory for core content on emscripten to
not be a subdirectory of the local filesystem mount, because it's
confusing to have a subdirectory that's lazily fetched and not
mirrored to the local storage.  I think it won't impact existing users
of the classic web player because they already have a retroarch.cfg in
place.

* Get fetchfs working without manifest support

* makefile fixes

* fix scaling, remove zip dependency

* Support asset/cheats/etc downloaders for emscripten

- Add http transfer support for emscripten
  - At the task_http level, not the net_http level --- so no netplay
    or webdav.
- Change default paths to be more like other platforms
- Gives us smaller bundles and a faster boot time
- Had to work around a task queue bug on Emscripten
  - I made the smallest possible change to do it, but it may be better
    to fix in rthread.c

* Load an emscripten file_packager package on first run

If no ozone assets are present, load a libretro_minimal package
created using Emscripten's built-in file packager.

* updated readme, removed indexer from wasmfs libretro-web

* Put back zip dependency, load asset bundle into opfs on first run

* fix upload path

* Remove unused function

* easy testing setup for two multithreaded conditions

1. make PROXY_TO_PTHREAD=1 (slower)
2. make PROXY_TO_PTHREAD=0 (bad audio, because doesn't sleep in
openal.c)

* Remove condition on sleep in openal

also make input_driver check existence of drv->axis, drv->button
before calling them.

* Fix resizing under EGL

* Don't force config file path on emscripten

* Add time.h include to netplay, default HAVE_NETPLAYDISCOVERY to 0

* Remove nearly all proxied joypad calls under emscripten

* Fix file uploads under firefox

* Fix safari API uses, but Safari still hangs in OPFS filesystem mount

I think this can be fixed by moving the backend creation off the main
thread.

* Move filesystem init into emscripten C entry point

* Setup filesystems off of main thread

* re-set default player to async

Also improve Safari compatibility under proxy-to-pthread condition

* Safari upload file fixes

* Remove some excess prints

* Fix typo
2025-02-20 00:59:25 +01:00
Eric Warmenhoven 6ec4ffb2fa apple, mouse overlay: fix relative mouse deltas (#17602)
makes sure that relative mouse movement deltas are based on last poll,
not last state check; checking state should not reset state
2025-02-20 00:59:14 +01:00
sonninnos 6c08bf003b XMB: Title replace '/' with '-' instead of ' ' (#17603) 2025-02-19 21:49:55 +02:00
sonninnos 8f3347d9ab GLUI: Limit save state thumbnail size (#17600) 2025-02-19 17:06:01 +02:00
sonninnos b5e01422e1 XMB: Trigger bg-image load on theme change (#17599) 2025-02-19 17:05:34 +02:00
Eric Warmenhoven 8bf7e76f45 apple: enable corelocation location driver (#17595) 2025-02-19 04:04:17 +01:00
github-actions d818cb8fe1 Fetch translations from Crowdin 2025-02-19 00:14:43 +00:00
Eric Warmenhoven 0ed66a79f1 glui: fix add to playlist icon in quick menu (#17596) 2025-02-18 22:55:04 +01:00
sonninnos e4fe551924 Gray Dark+Light theme adjustments (#17597) 2025-02-18 20:47:10 +02:00
Steve Cox 087d11b750 for iOS: updated app icon to additional iconset (#17582) 2025-02-18 17:13:13 +01:00
Eric Warmenhoven fe3e1b56b7 camera: don't reinit when core sets av info; don't poll if not allowed (#17588) 2025-02-18 17:12:18 +01:00
Joe Mattiello 9438d70ed9 Add CoreLocation location driver for macOS and iOS (#17591)
Signed-off-by: Joseph Mattiello <[email protected]>
2025-02-18 17:12:08 +01:00
sonninnos 73abaddd9c GLUI: Add save state thumbnails (#17592) 2025-02-18 17:11:46 +01:00
Tomáš Kelemen cd85a4dbf2 bluetoothctl: use two calls to disconnect/remove device (#17593)
the previous method does not remove the pairing of the selected device,
user must remove the pairing manually by modifying filesystem.

change tested on real system (Lakka-RPi4.aarch64).
2025-02-18 17:11:36 +01:00
Bernhard Schelling 754dbe37cc Color the notification icon by message category (#17573)
Use yellow for warnings and red for errors, keep the current blue for everything else.
Additionally, flip the 'i' info icon upside down for warnings and errors so it becomes a '!' exclamation mark icon.
2025-02-17 01:38:16 +01:00
Eric Warmenhoven cf867395f8 apple: enable midi driver in macos/ios builds (#17580) 2025-02-17 01:38:07 +01:00
github-actions 660cf1f449 Fetch translations from Crowdin 2025-02-17 00:16:46 +00:00
Steve Cox d58394b4e6 for iOS: update Launch Screen to match icon & UI color scheme; add subtle drag shadow to app icon (#17574)
* for iOS: update launch screen to match UI

* use higher resolution invader

* adjust Y constraint (diff invader body proportion)

* for iOS: update Launch Screen to match app icon/ui

* update iOS icon—match shadow on other platforms

* icon source svgs to media folder for others’ reuse

* iOS App Icon revision, fix asset index mismatch
2025-02-16 23:12:33 +01:00
github-actions 73bc4092a1 Fetch translations from Crowdin 2025-02-16 00:15:52 +00:00
Joe Mattiello eb2928eb0c CoreMIDI add driver (#17569)
CoreMIDI install into build

Signed-off-by: Joseph Mattiello <[email protected]>
2025-02-15 18:57:09 +01:00
github-actions 83c0c1fc43 Fetch translations from Crowdin 2025-02-15 00:14:14 +00:00
github-actions b4c15668bd Fetch translations from Crowdin 2025-02-14 00:14:34 +00:00
sonninnos 01a2da47a6 Ozone: Messagebox background asset fix (#17566) 2025-02-13 09:28:59 +01:00
Eric Warmenhoven 65e1436a23 iOS: set up shared gl context correctly (#17565) 2025-02-13 09:06:14 +01:00
github-actions a6ea47df15 Fetch translations from Crowdin 2025-02-13 00:14:41 +00:00
LibretroAdmin 8a22b87101 Revert rich_label changes 2025-02-12 17:46:32 +01:00
sonninnos 106dc5d8b7 GLUI: Allow fullscreen thumbnail browsing (#17562) 2025-02-12 16:50:17 +01:00
LibretroAdmin 135a228ac1 menu_entry - rich_label gets merged into label - make struct smaller 2025-02-12 15:17:58 +01:00
LibretroAdmin c864c50c9f (Menu) Cleanups 2025-02-12 14:52:17 +01:00
LibretroAdmin ebd9abb5f6 Get rid of sublabel_cache 2025-02-12 14:25:12 +01:00
LibretroAdmin 824209178c setting_list - remove unused original_value 2025-02-12 13:56:21 +01:00
LibretroAdmin 8e2e2cdbac Style nits 2025-02-12 13:06:40 +01:00
Lucas Cañero 64c7faf11b Revert "enable CloudSync on libnx (switch) (#17516)" (#17561)
This reverts commit b18a6b644b.
2025-02-12 12:10:12 +01:00
LibretroAdmin a167fb1c2f Unused variables cleanup 2025-02-12 11:59:22 +01:00
LibretroAdmin d2d0e7a17d Style nits 2025-02-12 10:35:04 +01:00
LibretroAdmin f6006ae6ca Style nits 2025-02-12 10:17:35 +01:00
sonninnos bdf2e9407d Label rewording and deprecation removal (#17560) 2025-02-12 09:52:12 +01:00
LibretroAdmin 0d57b59cd3 Another fix 2025-02-12 01:43:16 +01:00
LibretroAdmin 6556edd18e Fix remap screens 2025-02-12 01:32:26 +01:00
github-actions 49e625e750 Fetch translations from Crowdin 2025-02-12 00:14:33 +00:00
LibretroAdmin 366612fb82 Revert "Fix some string appending"
This reverts commit 65b9ea4e76.
2025-02-11 23:48:12 +01:00
sonninnos 2073b8abfc XMB: Icon thumbnail improvements (#17558) 2025-02-11 23:09:47 +01:00
LibretroAdmin 65b9ea4e76 Fix some string appending 2025-02-11 23:08:55 +01:00
ScoochAside 9f5bc9c318 Fix issue #17438 (#17557) 2025-02-11 22:45:44 +01:00
LibretroAdmin c62de90430 Cleanups 2025-02-11 22:45:16 +01:00
LibretroAdmin 064372d787 Get rid of action_title_cache 2025-02-11 21:21:14 +01:00
Eric Warmenhoven 422a4310f3 Add To Playlist from quickmenu can't rely on the current playlist (#17556) 2025-02-11 21:01:42 +01:00
LibretroAdmin 5372f3fe84 Change signature of get_representation callbacks 2025-02-11 21:01:04 +01:00
Eric Warmenhoven b0999db885 properly initialize variable (#17555) 2025-02-11 16:09:05 +01:00
LibretroAdmin 71a4ff07e3 (Qt) Cleanups 2025-02-11 15:25:05 +01:00
LibretroAdmin 76233f8959 on/off labels no longer cached - language switches now immediately
change the on/off labels as well - and binary size is smaller
2025-02-11 12:44:03 +01:00
LibretroAdmin 653c6ed1e6 Cleanup 2025-02-11 11:58:57 +01:00
LibretroAdmin aadb290cc4 (Qt) More avoidance of unneeded heap allocations 2025-02-11 11:23:46 +01:00
LibretroAdmin 6c7522fef8 (Qt) Prevent some unneeded string heap allocations 2025-02-11 10:58:48 +01:00
LibretroAdmin 0f5a990141 Cleanups 2025-02-11 10:28:16 +01:00
LibretroAdmin 98681ace4a Cleanups - less settings pointer grabbing 2025-02-11 10:12:12 +01:00
LibretroAdmin 6559f4499c Cleanups - less settings_t pointer passing 2025-02-11 09:38:54 +01:00
LibretroAdmin 316077a135 Cleanups 2025-02-11 09:24:50 +01:00
github-actions 77c0950a1b Fetch translations from Crowdin 2025-02-11 00:15:00 +00:00
LibretroAdmin a9a9075f5f (Qt) Cleanups 2025-02-10 23:06:32 +01:00
zoltanvb cc9ff9870f Create SECURITY.md (#17553) 2025-02-10 22:07:57 +01:00
LibretroAdmin 9489dd05bc Cleanups 2025-02-10 18:45:23 +01:00
LibretroAdmin 56d3042efd Change db_crc size back 2025-02-10 17:14:13 +01:00
LibretroAdmin 7a7c4df2a1 Settings cleanups 2025-02-10 17:12:02 +01:00
LibretroAdmin ef7b9830db (cheat_manager) No more dependency on configuration.h 2025-02-10 16:48:56 +01:00
LibretroAdmin d766a5b71e Cleanups 2025-02-10 16:31:30 +01:00
sonninnos afd290e289 XMB: Appearance menu cleanup (#17549) 2025-02-10 16:16:56 +01:00
LibretroAdmin 1a561ea0c2 Less passing around of settings_t pointer 2025-02-10 16:11:18 +01:00
LibretroAdmin ddd7ff2d33 get rid of some settings_t pointer passing 2025-02-10 15:47:18 +01:00
LibretroAdmin 50a0e17539 (Menu/XMB/Ozone) Less settings_t pointer grabbing 2025-02-10 15:13:59 +01:00
sonninnos 1a5e255c1b Playlists menu label capitalization (#17551) 2025-02-10 15:07:21 +01:00
LibretroAdmin 1300dc4ef4 Do all netplay state checks upfront in runloop_iterate 2025-02-10 14:11:46 +01:00
LibretroAdmin c57c4fbd1a Style nits 2025-02-10 13:59:25 +01:00
Steve Cox 1170373494 update tvOS “Top Shelf” image (#17543) 2025-02-10 11:52:38 +01:00
sonninnos 87b3032139 XMB: Color tuning (#17547) 2025-02-10 11:52:08 +01:00
sonninnos c1077a5ef5 RGUI: Thumbnail fixes (#17546) 2025-02-10 11:51:56 +01:00
github-actions 5d3ff55b86 Fetch translations from Crowdin 2025-02-10 00:14:31 +00:00
sonninnos 372396d5b6 Add separate visibility toggle for playlist tabs (#17545) 2025-02-10 00:45:50 +01:00
sonninnos ad72af9d40 Enable perfcnt if saved in conf (#17544) 2025-02-10 00:45:32 +01:00
LibretroAdmin d34cfcdfef iSilence warnings 2025-02-09 22:26:36 +01:00
LibretroAdmin c4a9a3d3a2 Don't redefine menu_st again 2025-02-09 21:53:55 +01:00
LibretroAdmin 4d9af08881 Buildfix for platforms where HAVE_NETWORKING is not defined 2025-02-09 21:52:10 +01:00
LibretroAdmin 584ea45837 Less state grabbing between runloop_iterate and runloop_check_state 2025-02-09 21:39:05 +01:00
LibretroAdmin 72efcab3e7 Silence more warnings 2025-02-09 21:11:35 +01:00
LibretroAdmin 63704efd59 One less extraneous netplay check in runloop_check_state 2025-02-09 20:43:55 +01:00
LibretroAdmin afd73998e6 Silence warnings 2025-02-09 20:33:04 +01:00
LibretroAdmin 9267771422 * Less passing around of settings pointer
* Less calls to netplay_driver_ctl in runloop_iterate
2025-02-09 20:12:10 +01:00
LibretroAdmin 4faed7a84f Less passing around of settings_t pointer 2025-02-09 18:56:50 +01:00
LibretroAdmin f9fa557a95 Some refactors to make some video driver functions less dependent
on passing around the settings_t pointer
2025-02-09 18:23:42 +01:00
LibretroAdmin f71181d1c1 * Style nits
* task_database - db_crc allocated variable does not need to be of size PATH_MAX_LENGTH size
2025-02-09 17:49:44 +01:00
LibretroAdmin db99fe098d Simplify string_list_new_special 2025-02-09 16:58:11 +01:00
LibretroAdmin 91aa8034b1 Style nits/conventions 2025-02-09 16:43:51 +01:00
LibretroAdmin 0be8fe8e3f Style nits 2025-02-09 16:07:15 +01:00
LibretroAdmin 376e4b307c Style nits 2025-02-09 15:40:45 +01:00
sonninnos 0d46073bb9 Add mute on rewind option (#17541) 2025-02-09 14:24:14 +01:00
sonninnos 81df9b0491 GLUI: Also set navigation with long press (#17537) 2025-02-09 06:11:28 +01:00
sonninnos 3bf04c6034 GLUI: Fix null label icon (#17538) 2025-02-09 06:11:21 +01:00
sonninnos 2c06049a2f Allow CLI --entryslot fallback to normal states (#17539) 2025-02-09 06:11:13 +01:00
github-actions 58d7879e1d Fetch translations from Crowdin 2025-02-09 00:14:47 +00:00
sonninnos 677e627278 GLUI: Touch related fixes (#17536) 2025-02-08 21:19:24 +01:00
Eric Warmenhoven 5471a9ebfe ios: jump back to selected item after closing content (#17534) 2025-02-08 20:32:41 +01:00
sonninnos 4cbfa3ad47 GLUI: Use tab selection remember option (#17532) 2025-02-08 11:56:40 +01:00
github-actions 17bc1eba3f Fetch translations from Crowdin 2025-02-08 00:13:29 +00:00
sonninnos 4232700de5 GLUI: Fix menu back to switch tabs like other drivers (#17529) 2025-02-07 11:43:45 +01:00
github-actions 3f70ac54a5 Fetch translations from Crowdin 2025-02-07 00:14:43 +00:00
Eric Warmenhoven 4c8da979a5 fix a couple minor warnings (#17526) 2025-02-06 20:22:36 +01:00
sonninnos bb9f07569c Video stats unit alignments (#17524) 2025-02-06 04:49:20 +01:00
Eric Warmenhoven 92c3800731 apple: include b2 core in App Store builds (#17525) 2025-02-06 04:49:08 +01:00
Viačasłaŭ 5b9d5a9086 Buildfix for Debian 12 (#17522) 2025-02-06 02:10:06 +01:00
github-actions 187463d355 Fetch translations from Crowdin 2025-02-06 00:14:50 +00:00
sonninnos 998200793d File Browser settings + Directory list cleanup (#17519) 2025-02-05 07:19:50 +01:00
sonninnos 94d5223880 Random selector Explore View fix (#17518) 2025-02-04 20:29:20 +01:00
sonninnos ea22c7c16c Main Menu unifications between drivers (#17517) 2025-02-04 16:32:37 +01:00
Lucas Cañero b18a6b644b enable CloudSync on libnx (switch) (#17516) 2025-02-04 14:24:47 +01:00
David Demelier f73df57a1a Fix non-integer cast to pthread_t (#17512) 2025-02-03 15:21:07 +01:00
Viačasłaŭ 359258a1b5 Add missing drivers to configuration (#17509)
`camera_pipewire` and `record_wav`
2025-02-03 09:04:23 +01:00
Viačasłaŭ 65014a46b4 Add PipeWire camera driver (#17507) 2025-02-03 04:30:13 +01:00
Viačasłaŭ 45586e83da (PipeWire) Pass the new_rate to the audio driver (#17508)
Set the supported sample rate after initialization.
Also a few minor fixes.
2025-02-03 04:30:02 +01:00
github-actions 9b3b75aa93 Fetch translations from Crowdin 2025-02-03 00:14:45 +00:00
neil4 05f75b83c1 Overlays: Improve Analog Recentering (#17505)
- Use closest point on zone perimeter if first touch is outside zone
2025-02-02 01:27:18 +01:00
Eric Warmenhoven 089a51f674 apple: enable emulated mailbox (#17506) 2025-02-02 01:22:18 +01:00
Eric Warmenhoven 212ae55cfe glui: extremely minor refactor. (#17501) 2025-02-01 04:57:46 +01:00
Rob Loach 7ba205ba34 common: Move audio_mixer_sound user_data to above the types union 2025-01-31 16:29:18 -05:00
Rob Loach 355b277c11 common: Add a user_data pointer to audio_mixer_sound (#17488) 2025-01-31 03:41:07 +01:00
LibretroAdmin 2870a0a8ad Revert "Workerized emscripten retroarch (WIP) (#17484)" (#17492)
This reverts commit cacd5a9a23.
2025-01-30 21:35:58 +01:00
Joe Osborn cacd5a9a23 Workerized emscripten retroarch (WIP) (#17484)
* workerized RA

* Workerized (non-async) web player, using OPFS

This patch eliminates the need for asyncify and uses modern filesystem
APIs instead of the deprecated, unmaintained BrowserFS.

This is a WIP patch because it won't fully work until these two
Emscripten PRs land and are released:

https://github.com/emscripten-core/emscripten/pull/23518
https://github.com/emscripten-core/emscripten/pull/23021

The former fixes an offscreen canvas context recreation bug, and the
latter adds an equivalent to BrowserFS's XHR filesystem (but without
the hazardous running-XHR-on-the-main-thread problem).

The biggest issue is that local storage of users who were using the
old version of the webplayer will be gone when they switch to the new
webplayer.  I don't have a good story for converting the old BrowserFS
IDBFS contents into the new OPFS filesystem (the move is worth doing
because OPFS supports seeking and reading only bits of a file, and
because BrowserFS is dead).

I've kept around the old libretro webplayer under
pkg/emscripten/libretro-classic, and with these make flags you can
build a non-workerized RA that uses asyncify to sleep as before:

make -f Makefile.emscripten libretro=$CORE HAVE_WORKER=0 HAVE_WASMFS=0 PTHREAD=0 HAVE_AL=1

I also moved the default directory for core content on emscripten to
not be a subdirectory of the local filesystem mount, because it's
confusing to have a subdirectory that's lazily fetched and not
mirrored to the local storage.  I think it won't impact existing users
of the classic web player because they already have a retroarch.cfg in
place.

* Get fetchfs working without manifest support

* makefile fixes
2025-01-30 19:58:18 +01:00
Eric Warmenhoven 4b5f782fe4 iOS: Fix crash during scanning (#17489) 2025-01-30 19:57:19 +01:00
Eric Warmenhoven fd8ba559d7 net_http: fix memleak (#17487) 2025-01-30 04:06:59 +01:00
github-actions 97803f5627 Fetch translations from Crowdin 2025-01-30 00:14:14 +00:00
BinBashBanana ed1810de86 Emscripten improvements (#17422) 2025-01-29 05:29:16 +01:00
github-actions 104561e7aa Fetch translations from Crowdin 2025-01-29 00:14:29 +00:00
Eric Warmenhoven 12f66bebb7 net_http: expire dns lookup failures more quickly (#17481) 2025-01-28 23:27:51 +01:00
Eric Warmenhoven d00ee5a70b net_http: handle redirects (#17482) 2025-01-28 23:27:28 +01:00
Eric Warmenhoven b982ff64c2 cheevos: fix crash entering achievements in quick menu when no client (#17472) 2025-01-26 04:10:25 +01:00
github-actions c11d9bee2e Fetch translations from Crowdin 2025-01-25 00:13:19 +00:00
zoltanvb 8814eb3eb6 Changes up to 2025-01-24 (#17469) 2025-01-24 23:49:41 +01:00
LibretroAdmin 120465d676 Fix runahead.c 2025-01-24 19:37:28 +01:00
Eric Warmenhoven 04cdf0aa4d apple: acceleration should include gravity (#17467) 2025-01-24 18:05:32 +01:00
github-actions 81e443c4cf Fetch translations from Crowdin 2025-01-24 00:14:32 +00:00
Eric Warmenhoven 72df261ed0 Fix opening file inside archive with core detection (#17461) 2025-01-23 18:56:11 +01:00
Eric Warmenhoven d2eb49ccbc net_http refactor (#17460)
* net_http: refactor net_http_new

The goal is to move calls to getaddrinfo() and connect() into
net_http_update(). This will make it possible for them to be replaced
with non-blocking alternatives later.

The net_http calling pattern right now allows callers to create the
http_connection_t, call net_http_new() which creates the http_t from
the http_connection_t, free the http_connection_t, and then start
calling net_http_update(). In order to preserve that, the http_t needs
to copy the values out of the http_connection_t on create. This also
preserves the http_connection_t values instead of freeing them, so the
connection would be able to be used later.

* net_http: implement dns cache

* net_http: separate out address resolution, connect, and request send

* net_http: perform getaddrinfo on separate thread

* net_http: implement basic connection pool

* net_http: refactor receive calls to read faster, do fewer reallocs

* net_http: build fix for platforms without SSL

* net_http: build fix for non-griffin builds

* net_http: build fix for non-threaded platforms
2025-01-23 01:29:47 +01:00
github-actions 14a28b81af Fetch translations from Crowdin 2025-01-23 00:14:36 +00:00
Mathieu Poliquin aa49c05524 Fix game_ai_lib.so loading path in game_ai.c (#17456) 2025-01-22 20:43:11 +01:00
Eric Warmenhoven 0903eead06 tvos: fix fetching refresh rate on tvos 13/14 (#17455) 2025-01-22 20:43:02 +01:00
MrHuu c276577b52 (3DS) Add unique ID's (#17459)
- Anarch
- Ardens
- Dice
- DoubleCherryGB
- Fbneocps12
- Fbneoneogeo
- Numero
- Tamalibretro
- Uw8
2025-01-22 20:42:23 +01:00
github-actions 5c53570446 Fetch translations from Crowdin 2025-01-22 00:14:25 +00:00
Eric Warmenhoven f1e3b83d26 macos: reset keyboard state when focus is lost (#17453) 2025-01-21 22:31:24 +01:00
Mathieu Poliquin 66e23fca79 New feature: Override player input with machine learning models (#17407)
* Add dummy game ai subsystem

* First working prototype of a machine learning model that can override player input

* Update README.md

* Update README.md

* Fix loading path on Windows

* Change ai override to player 2

* Added quick menu show game ai option

* Implemented Quick Menu entry for Game AI options

* Redirect debug logs to retroarch log system + properly support player override

* Added support to use framebuffer as input to the AI

* Added pixel format parameter to API

* Fix game name

* code clean-up of game_ai.cpp

* Update README.md - Windows Build

* Update README.md

* Update README.md

* Update README.md

* Update config.params.sh

turn off GAME_AI feature by default

* Fix compile error in menu_displaylist.c

* Add missing #define in menu_cbs_title.c

* Added new game_ai entry in griffin_cpp

* Remove GAME_AI entry in  msg_hash_us.c

* Fix compile error in menu_displaylist.h

* Removed GAME AI references from README.md

* Fixes coding style + add GameAI lib API header

* Convert comment to legacy + remove unused code

* Additional coding style fixes to game_ai.cpp

* Fix identation issues in game_ai.cpp

* Removed some debug code in game_ai.cpp

* Add game_ai_lib in deps

* Replace assert with retro_assert

* Update Makefile.common

* Converting game_ai from cpp to c. First step.

* Convert game_ai from CPP to C. STEP 2: add C function calls

* Convert game_ai from CPP to C. Final Step

* Added shutdown function for game ai lib

* Update game_ai_lib README

* Fix crash when loading/unloading multiple games
2025-01-21 13:05:43 +01:00
sonninnos 3797d4deb6 Fix latency header in video stats (#17451) 2025-01-21 04:31:13 +01:00
LibretroAdmin a49196ee30 (menu_cbs_get_value.c) Put protective guards around strlcpy copies
into s2
2025-01-21 03:57:08 +01:00
LibretroAdmin e9afd53351 Fix crash that can happen in menu_action_setting_disp_set_label_entry 2025-01-21 03:50:46 +01:00
Viačasłaŭ f84f829957 (PipeWire) reset playback buffer on stopping (#17449)
* Fix compile warnings
2025-01-21 02:40:15 +01:00
sonninnos 1c724f5355 RGUI: 'Use This Directory' cleanup (#17450) 2025-01-21 02:02:55 +01:00
github-actions 54debca4a3 Fetch translations from Crowdin 2025-01-21 00:14:16 +00:00
LibretroAdmin b443d9974a Cleanup 2025-01-21 00:17:18 +01:00
LibretroAdmin 1ecd83b0ab Change returntype of random to size_t 2025-01-20 23:59:09 +01:00
Eric Warmenhoven f55d028ae5 cloud sync: workaround bug of requests being duplicated (#17448) 2025-01-20 22:39:23 +01:00
Daniel Worley 565e1c7d2d UWP: Fix slang shader compilation (#17447) 2025-01-20 22:10:57 +01:00
Eric Warmenhoven ef4512dd02 macOS: ensure bundled assets get extracted properly (#17444) 2025-01-20 21:38:29 +01:00
Eric Warmenhoven 6fda41900d apple: include git hash in TestFlight message (#17445) 2025-01-20 21:38:20 +01:00
Viačasłaŭ d3a879638d Fix PipeWire freezing (#17446)
* Fix freezing after restarting pipewire service
* Rewrite the logic for starting/stopping stream
* Reduce boilerplate code
2025-01-20 21:38:11 +01:00
sonninnos 66921e8549 RGUI: Entry value cleanup (#17443) 2025-01-20 20:38:40 +01:00
sonninnos 391ba55b81 Add playlist random selector (#17441)
* Add playlist random selector

* Buildfix attempt

* ORBIS buildfix attempt
2025-01-20 18:25:41 +01:00
Apteryks 52320dfaa8 * platform: Honor the LIBRETRO_CHEATS_DIRECTORY environment variable. (#17440)
* frontend/drivers/platform_unix.c
(libretro_cheats_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_CHEATS to the value of
the LIBRETRO_CHEATS_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.
* configuration.c (config_load_file)
<libretro_cheats_directory>: New variable. Use the values of
the LIBRETRO_CHEATS_DIRECTORY environment variables instead of their
corresponding configured values, when set.
* docs/retroarch.6: Document it.
* retroarch.c (retroarch_print_help): Extend help text.
2025-01-20 15:08:45 +01:00
LibretroAdmin 4020326f58 Style nits 2025-01-20 04:37:27 +01:00
LibretroAdmin 350e4faf79 Fix some warnings 2025-01-20 01:30:27 +01:00
github-actions 1f2b299e00 Fetch translations from Crowdin 2025-01-20 00:19:46 +00:00
LibretroAdmin a6c8c6c7ef Cleanups 2025-01-19 23:57:15 +01:00
LibretroAdmin 3549d8378c Style nits 2025-01-19 22:15:34 +01:00
LibretroAdmin 13bc41facc Buildfixes 2025-01-19 20:37:04 +01:00
LibretroAdmin cde82f532c * Naming convention changes for variable names/function arguments
* Try to fit lines within ANSI 80-char limit
2025-01-19 20:19:14 +01:00
Apteryks 274cd419fa Honor the LIBRETRO_DATABASE_DIRECTORY environment variable. (#17431)
* Partially revert a change made in 69ceb95ddc.

The change caused the 'libretro_directory' config option to always
revert to the default value, which was not intended behavior.

Reported-by: Michael Cook

* platform: Honor the LIBRETRO_DATABASE_DIRECTORY environment variable.

This is a follow-up to commit 69ceb95ddc.

* frontend/drivers/platform_unix.c
(libretro_database_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_DATABASE to the value of
the LIBRETRO_DATABASE_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.
* configuration.c (config_load_file)
<libretro_database_directory>: New variable. Use the values of
the LIBRETRO_DATABASE_DIRECTORY environment variables instead of their
corresponding configured values, when set.
* docs/retroarch.6: Document.
* retroarch.c (retroarch_print_help): List supported environment
variables, and cross-reference the man page.
2025-01-19 15:25:28 +01:00
github-actions 5db9b7f8c9 Fetch translations from Crowdin 2025-01-19 00:15:40 +00:00
zoltanvb 976cb288c3 Update font size sublabel. (#17435) 2025-01-18 22:45:00 +01:00
Eric Warmenhoven 68b3e5d8e0 iOS: fix "clean playlist" (#17434) 2025-01-18 17:34:49 +01:00
LibretroAdmin 445547f00a Remove unused variable warning 2025-01-18 04:09:36 +01:00
LibretroAdmin 9bff7168e8 (input_driver.c) Style nits 2025-01-18 03:11:24 +01:00
sonninnos aefadc04c7 Analog to Digital refactor (#17429) 2025-01-18 02:19:01 +01:00
LibretroAdmin 984d591573 Silence some warnings 2025-01-18 01:48:33 +01:00
github-actions cf0ec85c35 Fetch translations from Crowdin 2025-01-18 00:13:21 +00:00
Kreijstal 90d3e0be17 Allowing compilation on msys2 (#17369)
## Description
Before there was no clear way of running msys2, and even if there was, there is no guarantee of it working, well I fixed it, and added a CI, so that we can always know if it works. Furthermore I added 2 targets more: UCRT64 and CLANG64, yes, compilation with clang64 means we can also compile with clang for windows on arm :D, plus clang has better error messages overall, anyway.

## Related Issues

#17367

## Reviewers
Anyone, it's my first PR here.
2025-01-18 01:00:09 +01:00
LibretroAdmin 48d903e811 print_buf_lines - cast to unsigned to avoid warnings 2025-01-17 21:52:50 +01:00
Eric Warmenhoven 8aa445dfe2 tvos build fix (#17426) 2025-01-17 21:45:01 +01:00
LibretroAdmin fce755127c Cleanups/style nits 2025-01-17 20:06:47 +01:00
Apteryks 69ceb95ddc Add libretro assets directory search path, and have environment variables override configured values (#17054)
* platform_win32: Fix sizeof for DEFAULT_DIR_PLAYLIST.

* frontend/drivers/platform_win32.c (frontend_win32_env_get): Check
the size of correct destination array.

* frontend: Honor the LIBRETRO_ASSETS_DIRECTORY environment variable.

This builds on 763fcd8267 ("unix, win32: Allow set the default
libretro_directory via environment variable") to also allow specifying
the assets directory via an environment variable.

* frontend/drivers/platform_unix.c (frontend_unix_get_env)
<libretro_assets_directory> New variable. Use it to set
DEFAULT_DIR_ASSETS, when available.
* frontend/drivers/platform_win32.c (frontend_win32_env_get): Likewise.

* platform: Honor the LIBRETRO_DIRECTORY environment variable.

Until now, and unlike the defaut core directory, the default
core *info* directory would be hard-coded relative to the installation
directory. Honor the LIBRETRO_DIRECTORY environment variable the same
instead.

* frontend/drivers/platform_unix.c (frontend_unix_get_env): Set
DEFAULT_DIR_CORE_INFO default to the value of the LIBRETRO_DIRECTORY
environment variable, if available.
* frontend/drivers/platform_win32.c (frontend_win32_env_get): Likewise.

* platform: Honor the LIBRETRO_AUTOCONFIG_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_autoconfig_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_AUTOCONFIG to the value of
the LIBRETRO_AUTOCONFIG_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* platform: Honor the LIBRETRO_VIDEO_FILTER_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_video_filter_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_VIDEO_FILTER to the value of
the LIBRETRO_VIDEO_FILTER_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* platform: Honor the LIBRETRO_VIDEO_SHADER_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_video_shader_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_SHADER to the value of
the LIBRETRO_VIDEO_SHADER_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* platform: Honor the LIBRETRO_SYSTEM_DIRECTORY environment variable.

* frontend/drivers/platform_unix.c
(libretro_system_directory): New variable.
(frontend_unix_get_env): Set DEFAULT_DIR_SYSTEM to the value of
the LIBRETRO_SYSTEM_DIRECTORY environment variable, if available.
* frontend/drivers/platform_win32.c: Likewise.

* configuration: Have environment variables override configuration.

Because the configuration file is systematically written when
RetroArch terminates, persisting any previous default/configured
value, setting the LIBRETRO_DIRECTORY, LIBRETRO_ASSETS_DIRECTORY, etc.
environment variables would not have an effect unless the
retroarch.cfg configuration file was cleared.

This seems to go against the common expectation that environment
variables are set by users to *override* the default behavior or
configuration of an application.

* configuration.c (config_load_file) <libretro_directory>
<libretro_assets_directory, libretro_autoconfig_directory>
<libretro_system_directory, libretro_video_filter_directory>
<libretro_video_shader_directory>: New variables. Use the values of
the LIBRETRO_DIRECTORY, LIBRETRO_ASSETS_DIRECTORY,
LIBRETRO_AUTOCONFIG_DIRECTORY, LIBRETRO_SYSTEM_DIRECTORY,
LIBRETRO_VIDEO_FILTER_DIRECTORY and LIBRETRO_VIDEO_SHADER_DIRECTORY
environment variables instead of their corresponding configured
values, when set.
* docs/retroarch.6: Document the environment variables honored and
their behavior.
2025-01-17 20:04:23 +01:00
LibretroAdmin b211adaaca Function argument name standardization 2025-01-17 19:55:32 +01:00
Ethan O'Brien ec54cdfcf0 Add HAVE_CHD flag for emscripten makefile (#17423) 2025-01-17 19:55:02 +01:00
Eric Warmenhoven 2471082ced macos: fix some sandbox handling for app store (#17424)
* minor safety check

* macos: fix some sandbox handling for app store
2025-01-17 19:54:54 +01:00
LibretroAdmin dda78a4fc8 Use find_last_slash where possible 2025-01-17 13:26:17 +01:00
LibretroAdmin b47e09534c Less string copies 2025-01-17 13:10:17 +01:00
LibretroAdmin 1e83bfb971 Reduce char arrays 2025-01-17 12:55:45 +01:00
LibretroAdmin 16209a0936 (configuration.c) Cleanups/remove some redundant char buffers
(rcheevos) Fix warning
2025-01-17 12:32:54 +01:00
LibretroAdmin e2c8e98be0 Buildfixes and warning fixes 2025-01-17 12:03:30 +01:00
LibretroAdmin 31b7812720 Function argument name standardization 2025-01-17 04:16:12 +01:00
LibretroAdmin 9b5007aefd (manual_content_scan) USe fill_pathname 2025-01-17 03:39:30 +01:00
LibretroAdmin a9b0e45013 (glslang_utill.c) One less string copy per iteration 2025-01-17 03:01:59 +01:00
github-actions 1975235fd7 Fetch translations from Crowdin 2025-01-17 00:14:25 +00:00
LibretroAdmin e4d7684246 Less string copies in fill_pathname_expanded_and_absolute 2025-01-17 01:01:43 +01:00
LibretroAdmin e982905eb4 content_get_subsystem_friendly_name - change function signature return
to size_t
2025-01-17 00:55:30 +01:00
LibretroAdmin 0b329018ee Less string buffers and less string copies 2025-01-16 23:59:22 +01:00
LibretroAdmin 86c9a43b08 Use path_get_extension_mutable 2025-01-16 21:09:19 +01:00
zoltanvb 7e00668181 Language update (#17418) 2025-01-16 20:00:16 +01:00
Jamiras 0113226936 (cheevos) include achievement state in netplay states (#17416)
* add achievement data to netplay save state

* honor achievement state from netplay server

* keep processing achievements if menu doesn't pause game

* remove unused variable

* only CRC coremem

* force send savestate on join and hardcore change

* allow hardcore enablement to be synced to clients

* still calculate cheevos_size for non-server

* use appropriate buffer

* optimizations for when achievements are disabled

* support interfacing with older protocols

* formatting

* c89
2025-01-16 20:00:02 +01:00
github-actions beceb88cd7 Fetch translations from Crowdin 2025-01-16 00:14:30 +00:00
LibretroAdmin a5c9d9520f * Use fill_pathname_basedir where possible
* Move static variable to only function where it's used
* Change signature of file_path.c function
2025-01-15 22:17:59 +01:00
LibretroAdmin e0f09f609f (video_shader_parse.c) token_name char size can be further reduced to 24 2025-01-15 18:30:11 +01:00
LibretroAdmin de3acd9017 (video_shader_parse.c) Go lighter on char stack usage, remove unnecessary
wildcard token_size
2025-01-15 18:28:14 +01:00
LibretroAdmin b2072dd3be Use strldup where possible, avoid strcpy_literal 2025-01-15 16:36:49 +01:00
LibretroAdmin 9da7af46c3 len variable/argument name standardization 2025-01-15 16:04:25 +01:00
LibretroAdmin 076c2bca3b video_shader_replace_wildcards - get rid of the 2D char arrays 2025-01-15 15:25:27 +01:00
LibretroAdmin 7456711eaa (video_shader_parse.c) Standardize replace_len variable name and
reduce char array buffers
2025-01-15 15:08:37 +01:00
LibretroAdmin 047e04ed3e Standardize local len variable naming conventions 2025-01-15 15:00:12 +01:00
LibretroAdmin 47d199297a runtime_file.c - Move scope of menu_driver_ident call 2025-01-15 12:45:05 +01:00
LibretroAdmin 2533bbdc0b Small cleanups 2025-01-15 12:37:35 +01:00
LibretroAdmin f7447d2e0d Add TODO/FIXME notes and cleanup argument naming 2025-01-15 12:19:02 +01:00
github-actions 5069b693a1 Fetch translations from Crowdin 2025-01-15 00:14:15 +00:00
Viačasłaŭ Chalikin 13bd14747a PipeWire improvements
* Use given latency
* Fix (non)blocking microphone
* Mute microphone on startuo
* Reset buffer when the microphone stops
* Delete client-info handler
* Refactor the naming conventions, styling
2025-01-14 21:31:32 +01:00
Eric Warmenhoven 2fdd8434df tvOS: Fix 720p display (#17414) 2025-01-14 21:31:11 +01:00
zoltanvb 31534438bc Enable also alternative device names (#17412)
Enable input_device_device_display_name to also have alt_ variants.
Tests updated.
2025-01-14 16:19:05 +01:00
Jesse Talavera 0bb0077358 Fix a crash when initializing an illuminance sensor on Linux (#17408) 2025-01-13 21:54:52 +01:00
LibretroAdmin 47d888364d Standardize len variables - argument should always be named 'len',
while local len variables should have '_' prefix
2025-01-13 21:53:49 +01:00
LibretroAdmin e081bde064 (core_info.c) Use fill_pathname where we can 2025-01-13 21:14:30 +01:00
LibretroAdmin bd413de842 Log messages are too small to hold entire path 2025-01-13 16:01:16 +01:00
LibretroAdmin 3c3611af6f Resync libretro-common 2025-01-13 15:37:59 +01:00
Viačasłaŭ 1d6badb1f1 (PipeWire) Fix speedup in the video threaded mode (#17406) 2025-01-13 04:36:17 +01:00
github-actions 41290bb1a8 Fetch translations from Crowdin 2025-01-13 00:16:05 +00:00
LibretroAdmin 7e7224196a Avoid some strlens, and also return size_t in more string
modification functions
2025-01-12 23:39:29 +01:00
LibretroAdmin 598764b860 rarch_file_log_set_override - size_t return 2025-01-12 23:09:12 +01:00
LibretroAdmin fb338b90bf Turn some functions to returntype size_t 2025-01-12 23:03:41 +01:00
LibretroAdmin 955eeed31a (playlist.c) -
* playlist_get_old_format_metadata_value - now returns size_t
* fix bug where string copy was being made with strdup before
anything got written to the string
2025-01-12 22:32:42 +01:00
LibretroAdmin e84ea6082c Fix 'Remove Preset' 2025-01-12 19:05:44 +01:00
LibretroAdmin e30fcb6da6 Remove unnnecessary null pointer check 2025-01-12 18:45:14 +01:00
LibretroAdmin 203c6218e4 Re-enable BFI menu setting for mobile 2025-01-12 17:35:50 +01:00
hizzlekizzle f7678abe8d Add flicker warnings, only auto-apply preferred overlays on Android and iOS (#17398)
* disable default overlays except on Android and iOS

* add flicker warnings to BFI/Subframes/rolling scan

and remove the prohibitions against other settings, since those conflicts are handled automagically anyway

* formatting nit
2025-01-12 17:34:13 +01:00
zoltanvb e71a1620b0 Update core list based on what is compiled for 1.20.0 stable version. (#17404) 2025-01-12 17:34:01 +01:00
Viačasłaŭ 1039db7bf8 Fix Qt build (#17397)
Related to #17346
2025-01-12 14:21:27 +01:00
iyzsong f309266422 (Qt) Fix desktop menu crash with CHEEVOS disabled (#17400) 2025-01-12 14:21:01 +01:00
github-actions 62a85ae737 Fetch translations from Crowdin 2025-01-12 00:16:13 +00:00
sonninnos 8ef798ea51 Add human readable rotation logging (#17387) 2025-01-11 02:51:48 +01:00
Eric Warmenhoven fcda24be29 Files in archives should always be marked as such (#17390) 2025-01-11 02:51:04 +01:00
zoltanvb 9e048d8d77 Reset save state index on content load, if auto index is not enabled. (#17391) 2025-01-11 02:50:35 +01:00
github-actions 857dc8be5a Fetch translations from Crowdin 2025-01-11 00:14:13 +00:00
sonninnos 1e32a1e5e9 Save state logging and label unifications (#17384) 2025-01-10 14:47:28 +01:00
sonninnos 17e9aabd25 WINRAW: Invert mouse order (#17376) 2025-01-10 12:21:33 +01:00
Eric Warmenhoven 95dd1d8449 cloud sync: fix windows path issues (#17375) 2025-01-10 12:21:24 +01:00
zoltanvb 4b45499b97 Changes up to 01-09 (#17379)
...and one minor clarification in previous logs.
2025-01-10 12:20:46 +01:00
github-actions 2c57a35055 Fetch translations from Crowdin 2025-01-10 00:15:03 +00:00
zoltanvb 6f495dea04 Replace upload-artifact v3 with v4 (#17378) 2025-01-09 20:29:15 +01:00
github-actions 74e7a62e91 Fetch translations from Crowdin 2025-01-09 00:14:07 +00:00
Rob Loach 941806698e Add SSL Support to the information list (#17370) 2025-01-09 00:09:56 +01:00
Viačasłaŭ 9886944f32 Fix launch app when pipewire service is stopped (#17365) 2025-01-07 18:31:45 +01:00
zoltanvb 65b9b1cd25 Fix compile failure (#17366) 2025-01-07 17:42:25 +01:00
LibretroAdmin 839b7654db More standardization of local len variables 2025-01-07 03:20:39 +01:00
LibretroAdmin fc48ecaa1d Local 'len' variables need to prefixed with '_', inner-loop len
variables need to be prefixed with '__'
2025-01-07 02:57:24 +01:00
LibretroAdmin e40f405b97 Play it on the safe side - go back to some of the code
from before
2025-01-07 02:47:37 +01:00
LibretroAdmin a98ab483cb Restore archive_file_7z.c 2025-01-07 02:22:57 +01:00
Eric Warmenhoven 69e8be6dc1 iOS: ensure webserver notice can be dismissed (#17356) 2025-01-07 02:03:00 +01:00
hizzlekizzle 8a3f25311b partial revert of c09fd38 (#17363)
which was causing softpatching to break on games with periods/dots in the filename. This restores the previous patch-matching behavior
2025-01-07 01:58:53 +01:00
github-actions 3ba7d88cea Fetch translations from Crowdin 2025-01-07 00:14:59 +00:00
Tatsuya79 43a2e1003e allow exact sync with shader subframes (#17355)
* allow exact sync with shader subframes

* Update menu_setting.c
2025-01-06 21:36:57 +01:00
zoltanvb 5399faaa9d Fix savestate auto-index detection (#17351) 2025-01-06 11:45:00 +01:00
github-actions 9c6e772497 Fetch translations from Crowdin 2025-01-06 00:15:51 +00:00
Jesse Talavera 3cdb95a602 Construct device URLs differently based on the ffmpeg backend 2024-12-18 21:05:30 -05:00
Jesse Talavera b68a588ede Split some ffmpeg camera logic into functions 2024-12-18 20:32:19 -05:00
Jesse Talavera 9ee56da6b0 Prioritize certain backends 2024-12-18 20:31:44 -05:00
Jesse Talavera 4beb80c290 Revert "Forward ffmpeg's logging to RetroArch"
This reverts commit 4aac4d5b9e.
2024-12-18 14:52:28 -05:00
Jesse Talavera 4aac4d5b9e Forward ffmpeg's logging to RetroArch 2024-12-18 14:28:49 -05:00
Jesse Talavera 7586ae7dbe Remove stray whitespace 2024-12-17 14:57:36 -05:00
Jesse Talavera 88b6342bb5 Move up some declarations 2024-12-17 14:57:06 -05:00
Jesse Talavera 7b21ed5f93 Set options for the camera and accompanying AV structures 2024-12-17 14:37:29 -05:00
Jesse Talavera ce1f31af8d Don't pass in the driver context to camera_driver::device_list_new
- Unlike some other drivers, the camera driver is only initialized when a core actually asks for it
- Therefore, the driver context isn't available when it's time to ask for devices
- I could refactor the camera driver to be created earlier, but then I'd need to refactor the other drivers as well
- That'll come later in another PR
2024-12-16 21:53:37 -05:00
Jesse Talavera 3c73b36cca Remove const from some fields 2024-12-16 16:45:12 -05:00
Jesse Talavera 7d31c65af1 Fix compatibility with libswscale < 6.1.100
- sws_scale_frame was introduced in 6.1.100
- Before this change, the driver wouldn't build on my Ubuntu Jammy VM
2024-12-16 16:38:15 -05:00
Jesse Talavera 47e0a163f3 Don't try to link the ffmpeg camera driver twice
- Whoops
2024-12-16 16:28:34 -05:00
Jesse Talavera c63a8d6705 Check for FFmpeg's constitutent libraries before adding flags for them 2024-12-16 15:21:56 -05:00
Jesse Talavera 33b574198c Swap the buffers after copying the most recent camera frame, but only upon success 2024-12-15 21:39:48 -05:00
Jesse Talavera 024fd873ec Moved polling in the new ffmpeg camera driver to another thread 2024-12-15 21:21:08 -05:00
Jesse Talavera 2bd45eeb6f Remove an unneeded comment 2024-12-13 14:52:11 -05:00
Jesse Talavera 391be66361 Unref the packet and frame correctly 2024-12-12 18:55:05 -05:00
Jesse Talavera 2d2e9d840c Fix the channels being swapped
- Whoops, wrong format
2024-12-12 18:54:49 -05:00
Jesse Talavera 0e347391e8 Clean up ffmpeg_camera_free
- Release resources in the opposite order they were initialized
- Don't release resources twice (even for cases of a noop)
2024-12-12 18:18:01 -05:00
Jesse Talavera 716be2bb22 Silence some warnings 2024-12-12 18:16:24 -05:00
Jesse Talavera 0bdf616836 Fix some swapped arguments 2024-12-12 18:13:14 -05:00
Jesse Talavera 22301bd3d5 Fix a crash when closing the ffmpeg camera driver
- Allocate the target buffer aligned to 4-byte addresses
- Consolidate resource cleanup to mitigate similar issues
2024-12-12 11:25:43 -05:00
Jesse Talavera b1eb37b394 Capture an image and display it (as tested with 3DEngine)
- Still crashes upon closing
- Colors are all wrong, too
2024-12-12 11:09:31 -05:00
Jesse Talavera af1c4a3e7f First crack at implementing the ffmpeg camera driver 2024-12-11 21:26:15 -05:00
Jesse Talavera 1d618bf232 Mark the ffmpeg_camera functions as static
- Other translation units don't need to worry about them
2024-12-03 14:59:14 -05:00
Jesse Talavera 4f88c4eb09 Forgot a comma 2024-12-02 20:41:28 -05:00
Jesse Talavera 29f31b3457 Remove some stray whitespace
- Excluding this trivial change from commits is gonna drive me nuts
2024-12-02 14:11:29 -05:00
Jesse Talavera de3abdb556 Add some new camera_driver functions for retrieving a list of devices
- Only ffmpeg will support these right now
2024-12-01 19:34:08 -05:00
Jesse Talavera ed04e1060a Allocate the ffmpeg camera driver 2024-11-30 18:59:26 -05:00
Jesse Talavera 9c82e9304b Merge branch 'master' into jtg/libavdevice-camera-driver 2024-11-30 16:37:54 -05:00
Jesse Talavera-Greenberg d9207c924e Add a stub ffmpeg camera driver 2023-07-20 15:28:16 -04:00
Jesse Talavera-Greenberg 3e10389106 Create the file where the ffmpeg camera driver will be implemented 2023-07-20 15:14:30 -04:00
1187 changed files with 222500 additions and 77387 deletions

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.
(
(c-mode . ((standard-indent . 3)
(c-basic-offset . 3)
(c-file-offsets . ((arglist-intro . ++)
(arglist-cont-nonempty . ++)
(block-close . 0)
(block-open . 0)))
(eval . (setq-local c-cleanup-list
(cl-set-difference c-cleanup-list
'(brace-else-brace
brace-elseif-brace))))))
(objc-mode . ((c-basic-offset . 3)))
)
+3 -3
View File
@@ -42,7 +42,7 @@ body:
attributes:
label: Version/Commit
description: You can find this information under Information/System Information
placeholder: 1.19.1 (Git 0792144fe3)
placeholder: 1.20.0 (Git ab3b175)
validations:
required: true
@@ -56,8 +56,8 @@ body:
- type: dropdown
id: nigthly
attributes:
label: Check in the nightly version
description: This issue is reproducible with [nightly builds](https://buildbot.libretro.com/nightly/)?
label: Present in the nightly version
description: Is the issue reproducible with current [nightly builds](https://buildbot.libretro.com/nightly/)?
options:
- I don't know
- Yes, this is reproduced in the nightly build
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
- name: Compile RA
run: |
make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 clean
make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 HAVE_STATIC_DUMMY=1
make -f Makefile.ctr -j$(getconf _NPROCESSORS_ONLN) USE_CTRULIB_2=1 HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: retroarch-android-${{ steps.slug.outputs.sha8 }}
path: |
+2 -2
View File
@@ -25,13 +25,13 @@ jobs:
- name: Compile RA
run: |
make -f Makefile.dos -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.dos -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1
make -f Makefile.dos -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RA-DOS-dummy-${{ steps.slug.outputs.sha8 }}
path: |
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
- name: Compile RA
run: |
make -f Makefile.ngc -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.ngc -j$(getconf _NPROCESSORS_ONLN) EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 HAVE_STATIC_DUMMY=1
make -f Makefile.ngc -j$(getconf _NPROCESSORS_ONLN) EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
- name: Compile RA
run: |
make -j$(getconf _NPROCESSORS_ONLN) clean
make -j$(getconf _NPROCESSORS_ONLN)
make -j$(getconf _NPROCESSORS_ONLN) info all
- name: Get short SHA
id: slug
+77
View File
@@ -0,0 +1,77 @@
name: CI Windows (MSYS2)
on:
push:
pull_request:
repository_dispatch:
types: [run_build]
permissions:
contents: read
jobs:
msys2-build-test:
strategy:
fail-fast: false
matrix:
sys: [MINGW64, UCRT64,CLANG64]
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: base-devel git
pacboy: >-
gettext:p
gobject-introspection:p
graphite2:p
p11-kit:p
qt6:p
qt6-3d:p
qt6-charts:p
qt6-datavis3d:p
qt6-imageformats:p
qt6-location:p
qt6-lottie:p
qt6-networkauth:p
qt6-quick3dphysics:p
qt6-quicktimeline:p
qt6-remoteobjects:p
qt6-scxml:p
qt6-sensors:p
qt6-serialbus:p
qt6-speech:p
qt6-tools:p
qt6-translations:p
qt6-virtualkeyboard:p
qt6-webchannel:p
qt6-websockets:p
x264:p
cc:p
- name: Configure and build RetroArch
shell: msys2 {0}
run: |
echo "Building RetroArch in ${{ matrix.sys }} environment"
./configure
make -j$(nproc) info all
- name: Collect DLLs and binaries
shell: msys2 {0}
run: |
echo "Collecting DLLs and binaries"
mkdir -p dist
cp retroarch.exe dist/
ldd retroarch.exe|grep $MINGW_PREFIX |awk '{print $3}'|xargs -I {} cp {} dist/
- name: Archive build artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: retroarch-${{ matrix.sys }}
path: dist/
+1 -1
View File
@@ -26,7 +26,7 @@ jobs:
id: slug
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RetroArch-${{ steps.slug.outputs.sha8 }}
path: |
+2 -2
View File
@@ -25,13 +25,13 @@ jobs:
- name: Compile RA
run: |
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.miyoo clean
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.miyoo
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.miyoo info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: retroarch_miyoo_arm32${{ steps.slug.outputs.sha8 }}
path: |
+2 -2
View File
@@ -30,13 +30,13 @@ jobs:
- name: Compile RA
run: |
make -f Makefile.ps2 -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.ps2 -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 release
make -f Makefile.ps2 -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 info release
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RA-PS2-dummy-${{ steps.slug.outputs.sha8 }}
path: |
+44
View File
@@ -0,0 +1,44 @@
name: CI PS3/PSL1GHT
on:
push:
pull_request:
repository_dispatch:
types: [run_build]
permissions:
contents: read
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
build:
runs-on: ubuntu-latest
container:
image: git.libretro.com:5050/libretro-infrastructure/libretro-build-psl1ght:latest
options: --user root
steps:
- uses: actions/checkout@v3
- name: Compile Salamander
run: |
make -f Makefile.psl1ght.salamander -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.psl1ght.salamander -j$(getconf _NPROCESSORS_ONLN)
- name: Compile RA
run: |
make -f Makefile.psl1ght -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.psl1ght -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v4
with:
name: RA-psl1ght-dummy-${{ steps.slug.outputs.sha8 }}
path: |
retroarch_psl1ght_salamander.elf
retroarch_psl1ght.elf
+2 -2
View File
@@ -31,13 +31,13 @@ jobs:
- name: Compile RA
run: |
export PATH=~/cli:$PATH # .net cli
make -f Makefile.orbis -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1
make -f Makefile.orbis -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: bin-${{ steps.slug.outputs.sha8 }}
path: |
+1 -1
View File
@@ -42,7 +42,7 @@ jobs:
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RA-PSP-dummy-${{ steps.slug.outputs.sha8 }}
path: |
+2 -2
View File
@@ -30,12 +30,12 @@ jobs:
- name: Compile RA
run: |
make -f Makefile.vita -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.vita -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 HAVE_VITAGLES=1
make -f Makefile.vita -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 HAVE_VITAGLES=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RA-PSVita-dummy-${{ steps.slug.outputs.sha8 }}
path: |
+2 -2
View File
@@ -25,13 +25,13 @@ jobs:
- name: Compile RA
run: |
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.rs90 clean
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.rs90
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.rs90 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: retroarch_rs90_mips32${{ steps.slug.outputs.sha8 }}
path: |
+2 -2
View File
@@ -25,13 +25,13 @@ jobs:
- name: Compile RA
run: |
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.retrofw clean
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.retrofw
make -j$(getconf _NPROCESSORS_ONLN) -f Makefile.retrofw info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: retroarch_retrofw_mips32${{ steps.slug.outputs.sha8 }}
path: |
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: RA-libnx-dummy-${{ steps.slug.outputs.sha8 }}
path: |
+1 -1
View File
@@ -30,7 +30,7 @@ jobs:
- name: Compile RA
run: |
make -f Makefile.wii -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.wii -j$(getconf _NPROCESSORS_ONLN) EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 HAVE_STATIC_DUMMY=1
make -f Makefile.wii -j$(getconf _NPROCESSORS_ONLN) EXTERNAL_LIBOGC=1 GX_PTHREAD_LEGACY=0 HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+2 -2
View File
@@ -25,12 +25,12 @@ jobs:
- name: Compile Salamander
run: |
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) SALAMANDER_BUILD=1 clean
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) SALAMANDER_BUILD=1 V=1
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) SALAMANDER_BUILD=1
- name: Compile RA
run: |
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 V=1
make -f Makefile.wiiu -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1 info all
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+1 -1
View File
@@ -33,4 +33,4 @@ jobs:
- name: Build Debug
run: |
make clean # making sure we don't have leftovers from previous build
make DEBUG=1 GL_DEBUG=1 C89_BUILD=1
make DEBUG=1 GL_DEBUG=1 C89_BUILD=1 info all
+78 -8
View File
@@ -2,14 +2,18 @@ name: CI webOS
on:
push:
tags-ignore:
- '*'
branches:
- '*'
pull_request:
release:
types: [ published ]
repository_dispatch:
types: [run_build]
permissions:
contents: read
types: [ run_build ]
env:
PACKAGE_NAME: com.retroarch.webos
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
@@ -28,6 +32,14 @@ jobs:
fileName: "ares-package_*.deb"
out-file-path: "temp"
- name: Download Manifest Generator
uses: robinraju/[email protected]
with:
repository: "webosbrew/dev-toolbox-cli"
latest: true
fileName: "webosbrew-toolbox-gen-manifest_*.deb"
out-file-path: "temp"
- name: Update packages
run: sudo apt-get -yq update
@@ -39,17 +51,75 @@ jobs:
with:
repository: "openlgtv/buildroot-nc4"
latest: true
fileName: "arm-webos-linux-gnueabi_sdk-buildroot.tar.gz"
fileName: "arm-webos-linux-gnueabi_sdk-buildroot-x86_64.tar.gz"
out-file-path: "/tmp"
- name: Extract webOS NDK
shell: bash
working-directory: /tmp
run: |
tar xzf arm-webos-linux-gnueabi_sdk-buildroot.tar.gz
tar xzf arm-webos-linux-gnueabi_sdk-buildroot-x86_64.tar.gz
./arm-webos-linux-gnueabi_sdk-buildroot/relocate-sdk.sh
- name: Compile RA
- name: Load RARCH_VERSION from version.all
id: version
shell: bash
run: |
RARCH_VERSION=$(grep -Po '(?<=#define PACKAGE_VERSION ")[^"]+' version.all)
echo "RARCH_VERSION=$RARCH_VERSION" >> "$GITHUB_ENV"
- name: Compile RA (GLES3 variant)
shell: bash
run: |
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
make -f Makefile.webos ADD_SDL2_LIB=1 -j$(getconf _NPROCESSORS_ONLN)
make -f Makefile.webos clean
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 \
HAVE_OPENGLES3=1 HAVE_OPENGLES3_1=1 HAVE_OPENGLES3_2=1 -j"$(getconf _NPROCESSORS_ONLN)"
mv webos/com.retroarch.webos_${RARCH_VERSION}_arm.ipk \
webos/com.retroarch.webos.gles3_${RARCH_VERSION}_arm.ipk
env:
DEBUG: ${{ github.event_name == 'release' && '0' || '1' }}
- name: Upload GLES3 artifact
uses: actions/upload-artifact@v4
with:
name: com.retroarch.webos.gles3_${{ env.RARCH_VERSION }}_${{ github.sha }}_arm.ipk
path: webos/com.retroarch.webos.gles3_${{ env.RARCH_VERSION }}_arm.ipk
- name: Compile RA (default)
shell: bash
run: |
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 -j"$(getconf _NPROCESSORS_ONLN)"
env:
DEBUG: ${{ github.event_name == 'release' && '0' || '1' }}
- name: Upload default artifact
uses: actions/upload-artifact@v4
with:
name: com.retroarch.webos_${{ env.RARCH_VERSION }}_${{ github.sha }}_arm.ipk
path: webos/com.retroarch.webos_${{ env.RARCH_VERSION }}_arm.ipk
- name: Generate Manifest (default only)
if: github.repository == 'webosbrew/Retroarch'
shell: bash
run: |
webosbrew-gen-manifest -o webos/${PACKAGE_NAME}.manifest.json \
-p webos/${PACKAGE_NAME}_${RARCH_VERSION}_arm.ipk \
-i https://github.com/webosbrew/RetroArch/raw/webos/webos/icon160.png \
-l https://github.com/webosbrew/RetroArch
- name: Release
if: github.event_name == 'release' && github.repository == 'webosbrew/Retroarch'
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.release.tag_name }}
allowUpdates: true
omitNameDuringUpdate: true
omitBody: true
omitPrereleaseDuringUpdate: true
artifacts: |
webos/com.retroarch.webos_${{ env.RARCH_VERSION }}_arm.ipk
webos/com.retroarch.webos.gles3_${{ env.RARCH_VERSION }}_arm.ipk
webos/${{ env.PACKAGE_NAME }}.manifest.json
+19 -1
View File
@@ -148,7 +148,6 @@ wiiu/wut/elf2rpl/elf2rpl
/pkg/android/phoenix/bin/
/pkg/android/phoenix/gen/
/pkg/android/phoenix/local.properties
/pkg/android/phoenix/gradle.properties
/pkg/android/phoenix/.gradle
/pkg/android/phoenix/.externalNativeBuild
/pkg/android/phoenix/build
@@ -196,6 +195,8 @@ retroarch.js
retroarch.js.mem
*.bc
*.wasm
*.wasm.map
obj-emscripten/
# only ignore .js files in the repo root
/*.js
@@ -239,6 +240,8 @@ gfx/common/wayland/content-type-v1.h
gfx/common/wayland/content-type-v1.c
gfx/common/wayland/single-pixel-buffer-v1.h
gfx/common/wayland/single-pixel-buffer-v1.c
gfx/common/wayland/xdg-toplevel-icon-v1.h
gfx/common/wayland/xdg-toplevel-icon-v1.c
# libretro-common samples
libretro-common/samples/streams/rzip/rzip
@@ -260,3 +263,18 @@ param.sfo
# Clazy
*.clazy.yaml
# PSL1GHT
*.SELF
EBOOT.BIN
pkg/psl1ght/*.pkg
modern_alpha_blend_fpo.h
modern_alpha_blend_vpo.h
modern_opaque_fpo.h
modern_opaque_vpo.h
gfx/drivers/rsx_shaders/modern_alpha_blend.fpo
gfx/drivers/rsx_shaders/modern_alpha_blend.vpo
gfx/drivers/rsx_shaders/modern_opaque.fpo
gfx/drivers/rsx_shaders/modern_opaque.vpo
pkg/psl1ght/pkg/USRDIR/shaders_cg/
!pkg/psl1ght/pkg/USRDIR/system/
+5 -3
View File
@@ -331,7 +331,7 @@ build-retroarch-linux-i686:
.build-retroarch-macos-xcode:
# Metal/Universal x86_64 arm64 is default
tags:
- macosx-packaging
- mac-apple-silicon
stage: build
variables:
XCARCHIVE_PATH: pkg/apple/build/RetroArchUniversal
@@ -358,6 +358,8 @@ build-retroarch-osx-universal-metal:
build-retroarch-osx-opengl-x64:
extends: .build-retroarch-macos-xcode
tags:
- macosx-packaging
variables:
XCARCHIVE_PATH: pkg/apple/build/RetroArchOpenGL
XCPROJECT_NAME: RetroArch
@@ -388,8 +390,6 @@ build-retroarch-osx-opengl-x64:
build-retroarch-ios-arm64:
extends: .build-retroarch-macos-xcode
tags:
- mac-apple-silicon
variables:
XCPROJECT_NAME: RetroArch_iOS13
XCCONFIG: GitLabCI.xcconfig
@@ -408,6 +408,8 @@ build-retroarch-ios-arm64:
build-retroarch-ios9:
extends: .build-retroarch-macos-xcode
tags:
- macosx-packaging
variables:
XCPROJECT_NAME: RetroArch_iOS9
XCCONFIG: GitLabCI.xcconfig
-191
View File
@@ -1,191 +0,0 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/libretro-common/include"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceFolder}/libretro-common/include",
"${workspaceRoot}/libretro-common/include"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/winrt",
"${workspaceRoot}",
"${workspaceFolder}/libretro-common/include"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.15063.0/winrt",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"cStandard": "c11",
"cppStandard": "c++17",
"configurationProvider": "ms-vscode.makefile-tools"
},
{
"name": "msys2-mingw32",
"includePath": [
"C:/msys64/mingw32/include",
"C:/msys64/mingw32/i686-w64-mingw32/include",
"${workspaceRoot}/libretro-common/include",
"${workspaceRoot}/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/msys64/mingw32/include",
"C:/msys64/mingw32/i686-w64-mingw32/include",
"${workspaceRoot}/libretro-common/include",
"${workspaceRoot}/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "msys2-mingw64",
"includePath": [
"C:/msys64/mingw64/include",
"C:/msys64/mingw64/x86_64-w64-mingw32/include",
"${workspaceRoot}/libretro-common/include",
"${workspaceRoot}/include",
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/msys64/mingw64/include",
"C:/msys64/mingw64/x86_64-w64-mingw32/include",
"${workspaceRoot}/libretro-common/include",
"${workspaceRoot}/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Switch",
"includePath": [
"/opt/devkitpro/devkitA64/aarch64-none-elf/include",
"/opt/devkitpro/devkitA64/lib/gcc/aarch64-none-elf/8.3.0/include",
"/opt/devkitpro/libnx/include",
"/opt/devkitpro/portlibs/switch/include",
"/opt/devkitpro/portlibs/switch/include/freetype2",
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"__aarch64__",
"__SWITCH__",
"HAVE_LIBNX"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "/opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "gcc-x64"
},
{
"name": "WiiU",
"includePath": [
"/opt/devkitpro/devkitPPC/powerpc-eabi/include",
"/opt/devkitpro/devkitPPC/lib/gcc/powerpc-eabi/6.3.0/include",
"/opt/devkitpro/portlibs/ppc/include",
"${workspaceFolder}/**"
],
"defines": [
"WIIU",
"WIIU_HID"
],
"windowsSdkVersion": "10.0.17763.0",
"compilerPath": "/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "gcc-x64"
},
{
"name": "ps2sdk-ee",
"includePath": [
"${env:PS2DEV}/ps2sdk/common/include",
"${env:PS2DEV}/ps2sdk/ee/include",
"${env:PS2DEV}/gsKit/include",
"${workspaceFolder}/**"
],
"defines": [
"PS2",
"_EE"
],
"compilerPath": "${env:PS2DEV}/ee/bin/mips64r5900el-ps2-elf-gcc",
"cStandard": "c11",
"cppStandard": "c++11",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
-70
View File
@@ -1,70 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/retroarch.exe",
"args": ["-v"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "${workspaceFolder}/retroarch.exe",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "PSP-GDB Debugger",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/retroarchpsp.elf",
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"setupCommands": [
{
"text": "symbol-file ${workspaceFolder}/retroarchpsp.elf",
"description": "read symbols for elf file",
"ignoreFailures": true
},
{
"description": "Enable all-exceptions",
"text": "-exec \"catch throw\"",
"ignoreFailures": true
}
],
"showDisplayString": true,
"targetArchitecture": "mips",
"MIMode": "gdb",
"miDebuggerPath": "/usr/local/pspdev/bin/psp-gdb",
"miDebuggerServerAddress": "127.0.0.1:10001",
}
]
}
-43
View File
@@ -1,43 +0,0 @@
{
/*"terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\bash.exe",
"terminal.integrated.env.windows": {
"PATH": "/mingw64/lib/ccache/bin:/mingw64/lib/ccache/bin:/mingw64/lib/ccache/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:$PATH",
"MSYSTEM": "MINGW64",
},*/
"terminal.integrated.cursorBlinking": true,
"editor.tabSize": 3,
"editor.detectIndentation": false,
"editor.renderWhitespace": "all",
"editor.insertSpaces": true,
"editor.formatOnSave": false,
"editor.ruler": [80],
"files.associations": {
"*.h": "c",
"*.in": "c",
"*.rh": "c",
"array": "c",
"iosfwd": "c",
"xlocbuf": "c",
"xmemory0": "c",
"ios": "c",
"list": "c",
"unordered_map": "c",
"unordered_set": "c",
"sstream": "cpp",
"hash_map": "c",
"hash_set": "c",
"initializer_list": "c",
"string_view": "c",
"utility": "c",
"thread": "c",
"xlocale": "c",
"deque": "c",
"vector": "c",
"xhash": "c",
"xiosbase": "c",
"xstring": "c",
"xtree": "c",
"xutility": "c"
},
"C_Cpp.dimInactiveRegions": false,
}
-128
View File
@@ -1,128 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "linux clean build",
"type": "shell",
"group": "build",
"command": "make clean && ./configure && make -j12"
},
{
"label": "linux clean",
"type": "shell",
"group": "build",
"command": "make clean"
},
{
"label": "linux build with debug symbols",
"type": "shell",
"group": "build",
"command": "DEBUG=1 make -j12"
},
{
"label": "linux build",
"type": "shell",
"group": "build",
"command": "make -j12"
},
{
"label": "linux build and run",
"type": "shell",
"group": "build",
"command": "make -j12 && ./retroarch -v"
},
{
"label": "linux build and run with debug symbols",
"type": "shell",
"group": "build",
"command": "DEBUG=1 make -j12 && ./retroarch -v"
},
{
"label": "msys2-mingw64 build",
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"command": "./configure; make -j2",
"options": {
"shell": {
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"-c"
]
}
}
},
{
"label": "msys2-mingw64 build with debug symbols",
"type": "shell",
"group": "build",
"command": "./configure; DEBUG=1 make -j2",
"options": {
"shell": {
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"-c"
]
}
}
},
{
"label": "msys2-mingw64 rebuild",
"type": "shell",
"group": "build",
"command": "make -j2",
"options": {
"shell": {
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"-c"
]
}
}
},
{
"label": "msys2-mingw64 clean",
"type": "shell",
"group": "build",
"command": "make clean",
"options": {
"shell": {
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"-c"
]
}
}
},
{
"label": "msys2-mingw64 run",
"type": "shell",
"group": {
"kind": "test",
"isDefault": true },
"command": "./retroarch -v",
"options": {
"shell": {
"executable": "C:\\msys64\\usr\\bin\\bash.exe",
"args": [
"-c"
]
}
}
}
]
}
+1 -1
View File
@@ -315,7 +315,7 @@ Mike Swanson (chungy)
mikeOSX
minucce
misson20000
Mohmoud (esoptron) (Hedonium)
esoptron
Monroe88
Morgane (MorganeAD)
mprobinson
+255 -1
View File
@@ -1,5 +1,258 @@
# Future
# 1.22.1
- ANDROID: OnNewIntent handler to allow launchers start new content without closing first
- ANDROID: Use app-specific storage for Google Play builds of RetroArch
- ANDROID: Implement support for the Storage Access Framework, to allow the user to mount most directories1 from internal storage, the SD card, other removable storage devices and any document providers provided by other Android apps on the current device.
- 3DS: Add 800px mode for New 3DS models
- APPLE: Include sameduck, gearcoleco, geargrafx cores in App Store builds
- APPLE: Include reminiscence, virtualjaguar, vitaquake2 cores in App Store builds
- APPLE: Include gam4980 core in App Store builds
- APPLE: Bundle identifier added to Information menu
- APPLE: Option to control the usage of Metal argument buffers
- APPLE: Don't force fullscreen, allow multitasking on iPad
- APPLE: AppIntents for Siri, Shortcuts
- APPLE: Fix ffmpeg camera driver
- APPLE/MFI: Try harder to own the home button
- AUDIO: Microphone CoreAudio driver for iOS and macOS
- AUTOCONF: Autoconfig match extended with a physical identifier
- CAMERA: Use ffmpeg libavfilter virtual input device as default
- CHEEVOS: Show additional message for unsupported achievements
- CHEEVOS: Upgrade to rcheevos 12.1
- CHEEVOS: Change expired token message from info to error
- CHEEVOS: Hashing of RVZ files is now supported
- CLOUDSYNC: Enable icloud_drive cloud sync backend on MacOS / iOS
- CLOUDSYNC: Don't always trust the server hash
- CLOUDSYNC: Enable WebDAV support for Android
- CLOUDSYNC: Speed up cloudsync on Apple
- DATABASE: Improve multidisk game scanning
- DATABASE: Filter in Database Manager now works for genre and region
- EMSCRIPTEN: Support core switching
- EMSCRIPTEN: Support suspend screensaver
- EMSCRIPTEN/RWEBCAM: Fix camera driver
- EMSCRIPTEN/RWEBINPUT: Add accelerometer/gyroscope support
- EMSCRIPTEN/RWEBPAD: Add rumble support
- EMSCRIPTEN/RWEBAUDIO: Rewrite driver, set as default audio driver
- INPUT: Default key and mouse binds for lightgun Start and Select buttons
- INPUT: Turbo mode corrections
- INPUT: Turbo fire settings are now saved to remaps, not to overrides
- INPUT: Fix menu usage when OK/Cancel has mouse binds
- INPUT: Ignore menu mouse startup position before moving
- INPUT: Fix heavy slowdown when using Bluetooth XInput controllers with rumble
- INPUT: Reset and close content hotkeys now require confirmation, similar to quit
- INPUT: Menu toggle and hotkey enable can now be assigned to the same key
- INPUT: Option to have hotkeys follow the port mapped first to the core
- INPUT/ANDROID: Favor mouse coordinates for lightgun
- INPUT/UDEV: Fix lost terminal settings after restart from menu
- INPUT/BSV/REPLAY: Bumped replay format version to 2. Old replays will still play back fine.
- INPUT/BSV/REPLAY: Add option to skip deserializing checkpoints from replay files (it introduces jank in some emulators).
- INPUT/BSV/REPLAY: Add checkpoint and initial savestate compression, following the `savestate_file_compression` config boolean. Use zstd if available, or fall back to zlib.
- INPUT/BSV/REPLAY: Add incremental checkpoints based on statestreams (depending on `HAVE_STATESTREAM` compile time flag). As an example, 60 `pcsx_rearmed` savestates would take 267MB uncompressed; with incremental encoding this is reduced to 77MB. Compressing the result can reduce the size to just 4MB.
- INPUT/BSV/REPLAY: Checkpoint compression and encoding can be combined. For example, 60 `pcsx_rearmed` checkpoints can take up just 15MB if each state is incremental and compressed. This is not as optimal as using incremental states without save state compression followed by offline compression, but is a good compromise in many use cases.
- INPUT/BSV/REPLAY: Add hotkeys and text commands to force a checkpoint insertion into the currently recording replay, and to seek backwards to the previous checkpoint and forwards to the next checkpoint.
- INPUT/BSV/REPLAY: Add a text command to seek to a specific frame of the currently playing/recording replay; it will return via the command replier the actual seeked-to frame (right now it only supports seeking to checkpoints).
- INTL: Add Irish Gaelic to selectable languages
- IOS: Use native keyboard in search
- IOS: Fix crash on iOS9 when fetching refresh rate
- IOS: Stronger haptics, controllable by setting
- IOS: Down arrow menu is removed, all 3 options are available by other means now
- IOS/MACOS: Fix display server resolution and refresh rates
- IOS/TVOS: Use native keyboard
- JPEG: Fix clamping bug in JPEG decode
- LIBRETRO: Deprecate intfstream_open_writable_memory
- LIBRETRO: New environment function RETRO_ENVIRONMENT_GET_TARGET_SAMPLE_RATE
- LINUX: Add full complement of key/value pairs to desktop entry
- MACOS: Fix coreaudio microphone handling
- MACOS: Fix window size calculation
- MENU: Common Thumbnail Background option for all menu drivers
- MENU: Move core options reset from Settings/Configuration to Main Menu / Configuration Files
- MENU: Use right analog stick for thumbnail cycling in playlists
- MENU: Option to always suggest cores, even when a core is already loaded
- MENU: Option to show Favorites before History
- MENU: Media history playlists are now visible in playlist manager
- MENU: Import Content visibility defaults reverted
- MENU: Update CRTSwitchRes menu options for future use
- MENU: Debug builds are indicated in Information menu
- MENU: Save As / Save Main options for configuration file
- MENU: Unwanted input is prevented when menu is triggered by toggle combo
- MENU: 32-bit values in cheats and rumble are not presented as huge lists
- MENU: Less important widgets are now sized like task notifications
- MENU: Play count is added to runtime log
- MENU: Configurable startup page (several options beside default Main Menu)
- MENU: Shader menu rework, combined save/remove menus, save current, Y and Start hotkeys for shader parameters and background opacity toggle
- MENU: Single-click start option from playlists and Explore view
- MENU: Allow kiosk mode and hiding of Settings menu also in GLUI and RGUI
- MENU: Task widget improvements
- MENU/GLUI: Show thumbnails in Explore view
- MENU/XMB: Improvements for mobile/touch. More natural horizontal/vertical scrolling
- MENU/XMB: Select button toggles thumbnails in playlists
- MENU/XMB,OZONE: Fix content icons when playlist tabs are hidden
- MENU/OZONE: Horizontal padding factor option
- MENU/OZONE: Custom font selection and scaling factor
- MENU/RGUI: Clock format is now configurable and moved to top header
- NETPLAY: Push room info to lobby
- NETWORK: Fixes for nmcli wifi driver
- NETWORK: Network command interface enabled for Android, iOS, TVOS
- OTHER: ZStandard support and libchdr update for support of chd files converted with createdvd option
- OVERLAY: Speed limit on touch pointer tracking
- OVERLAY: Dedicate each touch pointer to hitboxes or pointing devices
- OVERLAY: Fix overlay turbo fire
- PLAYLIST: Built-in playlists are now stored under playlists/builtin
- PLAYLIST: Fix subsystem information in playlists
- PS3: Fix psl1ght target of dist-cores.sh
- REPLAY: Bugs fixed regarding rewind
- REPLAY: Same timeline check and future state check for replays vs. savestates
- SAVESTATES: Savestate thumbnails are default enabled for x86_64 builds
- SAVESTATES: Slot is now remembered using the runtime log file
- SAVESTATES: Slot hotkey widget shows save state thumbnail
- SCAN: Fix crash with Sega CD
- SCAN: Log files without database match
- SCAN: Optimization of database queries by content file size
- VIDEO: Fix auto swap interval setup
- VIDEO: Improvements for integer scale half scaling
- VIDEO: Adjustments to smart integer scaling, considering title safe area
- VIDEO: Frame delay improvements for the automatic setting
- VIDEO: Auto-enable GPU recording with HW context cores
- VIDEO: Fix viewport bias when using custom aspect ratio
- VIDEO/D3D11/D3D12: snappy extra vsync presentation mode
- VIDEO/GL: Fallback OpenGL symbol loader for Linux devices with EGL < 1.5
- VIDEO/GL: Support for Cg and GLSL shaders in the GLCore video driver
- VIDEO/GL: Improve GLES version detection
- VIDEO/SHADER: Shader hold function, useful for some lightguns and shader comparison
- VIDEO/SWITCHRES: Horizontal and vertical geometry adjustment options added
- VIDEO/SWITCHRES: Game overrides
- VIDEO/VULKAN: Add VK_EXT_full_screen_exclusive extension support for Windows
- VIDEO/WAYLAND: Support for xdg-toplevel-icon-v1
- VIDEO/WAYLAND: Fix deadlock when using Wayland Vulkan driver
- VIDEO/WAYLAND: Fix fullscreen on auto monitor index (partial)
- VITA: Touchscreen support for PS Vita
- VITA: Set RGUI framebuffer to 272 lines to remove blurriness
- WEBOS: Various fixes and tunings
- WEBOS: Disable core dumps
- WEBOS: Debug builds enabled
- WEBOS: Fix GLES 3/3.1/3.2 option, enable 64-bit option
# 1.21.0
- 3DS: Fix unique IDs for newer cores
- 3DS: Enable TLS (SSL)
- 3DS: Fix UI freeze when threaded rendering is enabled
- 3DS: Fix crash on load content
- 3DS: Other minor fixes
- APPLE: Enable Vulkan emulated mailbox
- APPLE: Include b2 core in App Store builds
- APPLE: CoreMIDI driver for IOS/MacOS
- APPLE: CoreLocation driver for IOS/MacOS
- AUTOCONF: Enable alternative display name in autoconfig files
- AUTOCONF: Make autoconfig failure messages optional
- AUDIO: Option to mute on rewind
- AUDIO/PIPEWIRE: Fix app launch when pipewire service is stopped
- AUDIO/PIPEWIRE: Fix speedup with threaded video mode
- AUDIO/PIPEWIRE: Fix latency setting and microphone handling
- AUDIO/PIPEWIRE: Pass the new rate to the audio driver
- CAMERA: Add PipeWire camera driver
- CAMERA: Add ffmpeg camera driver
- CHEAT: Rewrite part of cheat_manager_load_cb_second_pass()
- CHEEVOS: Include achievement state in netplay states
- CHEEVOS: Fix crash when entering achievements in quick menu while client is not present
- CHEEVOS: Restore cheevos_badges_enable for HAVE_GFX_WIDGETS builds
- CLI: Allow --entryslot to fall back to normal states
- CLOUDSYNC: Fix Windows path issues
- CLOUDSYNC: Workaround for duplicated requests bug
- CLOUDSYNC: Workaround for 301 redirects
- CLOUDSYNC: Handle ignored directories properly
- EMSCRIPTEN: Added new AudioWorklet driver, a fast callback-based audio driver
- EMSCRIPTEN: Scale window to correct size
- EMSCRIPTEN: Additional platform functions
- EMSCRIPTEN: Add new default video context driver: emscriptenwebgl_ctx
- EMSCRIPTEN: Add new audio driver: AudioWorklet
- EMSCRIPTEN: Add new modernized web player which will eventually replace the existing one
- EMSCRIPTEN/RWEBINPUT: Add touch input support
- GAMECUBE: Fixes
- GENERAL: Fix save state auto increment
- GENERAL: Fix softpatching with periods/dots in the file name
- GENERAL: Fix compilation with --enable-videocore
- GENERAL: Allow asset directory redefinition and other directory overrides via environment variables
- GENERAL: Allow override of player 1/2 input with machine learning models (needs recompilation and external library)
- GENERAL: Fix performance counter option not remembered between sessions
- GENERAL: Create security statement
- GENERAL: Fix crash when core is not selected
- GENERAL: Use core fps instead of screen refresh for calculating dropped frames
- INPUT: Fix a crash when initializing illuminance sensor on Linux
- INPUT: Analog-to-digital refactor, fixing behavior when analogs are assigned to keys
- INPUT: Turbo fire overhaul. See https://github.com/libretro/RetroArch/pull/17633
- INPUT/ANDROID: Fix game focus and pause handling
- INPUT/COCOA: Include gravity in acceleration sensor values
- INPUT/COCOA: Fix relative mouse input
- INPUT/COCOA: Allow mouse input while mouse overlay is active
- INPUT/WINRAW: Invert mouse index order
- IOS: Ensure webserver notice can be dismissed
- IOS: Fix rescanning manual playlists after app update
- IOS: Fix clean playlist function
- IOS: Fix crash when scanning
- IOS: Fix jump back to selected item when closing content
- IOS: Fix shared GL context setup
- IOS: Update Launch Screen
- IOS: Screen orientation lock through display server
- IOS: Fix rescanning manual playlists after app update
- LAKKA: Remove bluetooth device after disconnection
- LINUX/X11: Extend X11 input driver with XInput2 extensions for multi-mouse
- MACOS: Fix some sandbox handling in App Store builds
- MACOS: Reset keyboard state when focus is lost
- MENU: Add SSL support to the information list
- MENU: Add warning to BFI and related menu items
- MENU: Fix latency statistics when using runahead
- MENU: Fix opening file inside archive with core selection
- MENU: Main menu unified between different menu drivers
- MENU: Visibility toggle for playlist tabs
- MENU: Color the notification icon by message category
- MENU: Gray Dark+Light theme adjustments
- MENU/GLUI: Menu back button switches tabs like in other menu drivers
- MENU/GLUI: Tab selection option is honored
- MENU/GLUI: Fix CD icon appearing when no icon is specified
- MENU/GLUI: Allow fullscreen thumbnail browsing
- MENU/GLUI: Save state thumbnails
- MENU/PLAYLISTS: Random selection/shuffle function
- MENU/QT: Fix desktop menu crash with Cheevos disabled
- MENU/RGUI: Cleanups of certain menu items
- MENU/RGUI: Thumbnail fixes
- MENU/OZONE: Fix messagebox background
- MENU/XMB: Fix Light theme, font shadow
- MENU/XMB: Appearance menu cleanup
- MENU/XMB: Icon thumbnail can be any of the existing types
- MISC: Guard nanosleep prototype behind _POSIX_TIMERS
- MISC: Use fabsf and intended threshold for refresh rate check
- MISC: Use platform-specific checks for invalid descriptors
- MIDI: Add dropdown items for midi device selection
- NETWORK: Refactor of net_http, improvements for task blocking and performance
- NETWORK: Follow http redirects in net_http
- NETWORK: Expire failed DNS lookups much faster
- NETWORK: Fix netplay when using netpacket interface with recent cheevos
- NETWORK/HTTP: Fix crash in net_http_resolve() in single-thread mode
- OVERLAY: Fix overlay lightgun, mouse & pointer
- OVERLAY: Preferred overlay loading is now default only on mobile platforms
- OVERLAY: Improve analog recentering when touching the area just outside the recentering zone
- QT: Enable non-png thumbnails also for Qt interface
- REPLAY: Fix issue when replaying old format input recordings in newer RetroArch
- TTS: Fix initial text-to-speech on Windows
- TVOS: Fix 720p display
- TVOS: Fix refresh rate fetching on tvOS 13/14
- TVOS: Update Top Shelf art
- SAVESTATES: Reset state index when loading new content
- UWP: Fix slang shader compilation
- VIDEO: Enable BFI setting for mobile platforms (mind the warnings)
- VIDEO/OpenGLES: Fix FP/sRGB FBO support
- VIDEO/SHADERS: Allow exact refresh rate sync with shader subframes
- VIDEO/SHADERS: FIX shader wildcards
- VIDEO/VULKAN: Enable adaptive vsync
- VIDEO/V4L2: Added resolution picker/forcing.
- VIDEO/V4L2: Rewrote logic for finding ALSA audio devices in enumerate_audio_devices function
- VIDEO/V4L2: Added a skip for some of the interface queries that fail and aren't required for magewell usb.
- VITA: Fixes
- WINDOWS: Win32 socket improvements
- WII: Fixes
- WIIU: Fixes
- WEBPLAYER: Update core list for 1.20.0
# 1.20.0
- AUDIO: Fix audio handling in case of RARCH_NETPLAY_CTL_USE_CORE_PACKET_INTERFACE
- AUDIO: Include missing audio filters on some platforms
@@ -46,7 +299,7 @@
- INPUT/UDEV: Enable mouse buttons 4 and 5
- INPUT/WAYLAND: Enable horizontal scroll and mouse buttons 4 and 5
- INPUT/WAYLAND: Simulate lightgun input for cores
- INPUT/WAYLAND: Support for cursor-shape-v1 and content-type-v1 protocol
- INPUT/WAYLAND: Support for cursor-shape-v1 protocol
- INPUT/X11: Enable mouse buttons 4 and 5
- iOS: Enable vibration by default
- iOS: Better handling of physical mice/magic keyboard trackpad
@@ -114,6 +367,7 @@
- VIDEO/VULKAN: Fix Vulkan window freezes when swapchain becomes suboptimal
- VIDEO/VULKAN: Prefer IMMEDIATE mode without vsync
- VIDEO/X11: Support inhibit of Xss screensaver
- VIDEO/WAYLAND: Support for content-type-v1 protocol
- VITA: Enable analog L2/R2 triggers when a DS3 controller is used with PS Vita
- WAYLAND: Fix segfault when relative pointer is not supported
- WAYLAND: Use reverse DNS name for desktop file and icon
+33 -5
View File
@@ -1,4 +1,5 @@
HAVE_FILE_LOGGER=1
HAVE_STATESTREAM?=1
NEED_CXX_LINKER?=0
NEED_GOLD_LINKER?=0
MISSING_DECLS =0
@@ -45,7 +46,6 @@ else
OBJDIR := $(OBJDIR_BASE)/release
CFLAGS ?= -O3
CXXFLAGS ?= -O3
DEF_FLAGS += -ffast-math
endif
DEF_FLAGS += -Wall -Wsign-compare
@@ -113,7 +113,7 @@ endif
ifneq ($(CXX_BUILD), 1)
ifneq ($(C89_BUILD),)
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long -Werror=declaration-after-statement
CFLAGS += -std=c89 -ansi -pedantic -Werror=pedantic -Wno-long-long -Werror=declaration-after-statement -Wno-variadic-macros
else ifeq ($(HAVE_C99), 1)
CFLAGS += $(C99_CFLAGS)
endif
@@ -173,6 +173,33 @@ endif
all: $(TARGET) config.mk
define INFO
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CPPFLAGS: $(CPPFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEFINES: $(DEFINES)
LDFLAGS: $(LDFLAGS)
LIBRARY_DIRS: $(LIBRARY_DIRS)
LIBS: $(LIBS)
LINK: $(LINK)
MD: $(MD)
MOC: $(MOC)
MOC_TMP: $(MOC_TMP)
OBJCFLAGS: $(OBJCFLAGS)
QT_VERSION: $(QT_VERSION)
RARCH_OBJ: $(RARCH_OBJ)
WINDRES: $(WINDRES)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
$(MOC_SRC):
@$(if $(Q), $(shell echo echo MOC $<),)
$(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@))
@@ -285,9 +312,10 @@ uninstall:
rm -rf $(DESTDIR)$(ASSETS_DIR)
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
@$(if $(Q), echo $@,)
$(Q)rm -rf $(OBJDIR_BASE)
$(Q)rm -f $(TARGET)
$(Q)rm -f *.d
.PHONY: all install uninstall clean
+195 -38
View File
@@ -302,6 +302,10 @@ OBJ += \
$(LIBRETRO_COMM_DIR)/streams/network_stream.o \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o
ifeq ($(ANDROID), 1)
OBJ += $(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_saf.o
endif
OBJ += \
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
@@ -351,7 +355,6 @@ endif
ifeq ($(HAVE_MICROPHONE), 1)
DEFINES += -DHAVE_MICROPHONE
OBJ += audio/microphone_driver.o
endif
ifeq ($(HAVE_REWIND), 1)
@@ -452,6 +455,12 @@ endif
ifeq ($(HAVE_BSV_MOVIE), 1)
DEFINES += -DHAVE_BSV_MOVIE
OBJ += input/bsv/bsvmovie.o
endif
ifeq ($(HAVE_STATESTREAM), 1)
DEFINES += -DHAVE_STATESTREAM
OBJ += input/bsv/uint32s_index.o
endif
ifeq ($(HAVE_RUNAHEAD), 1)
@@ -790,6 +799,9 @@ ifeq ($(HAVE_EMSCRIPTEN), 1)
ifeq ($(HAVE_RWEBAUDIO), 1)
OBJ += audio/drivers/rwebaudio.o
endif
ifeq ($(HAVE_AUDIOWORKLET), 1)
OBJ += audio/drivers/audioworklet.o
endif
endif
ifeq ($(HAVE_BLUETOOTH), 1)
@@ -858,10 +870,6 @@ ifeq ($(HAVE_ALSA), 1)
OBJ += audio/drivers/alsa.o \
audio/common/alsa.o
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/alsa.o
endif
ifneq ($(HAVE_HAKCHI), 1)
ifneq ($(HAVE_SEGAM), 1)
ifneq ($(DINGUX), 1)
@@ -872,12 +880,7 @@ ifeq ($(HAVE_ALSA), 1)
ifneq ($(MIYOO), 1)
ifeq ($(HAVE_THREADS), 1)
OBJ += audio/drivers/alsathread.o \
audio/common/alsathread.o
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/alsathread.o
endif
OBJ += audio/drivers/alsathread.o
endif
endif
@@ -925,8 +928,8 @@ ifeq ($(HAVE_PIPEWIRE), 1)
OBJ += audio/drivers/pipewire.o \
audio/common/pipewire.o
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/pipewire.o
ifeq ($(HAVE_PIPEWIRE_STABLE), 1)
OBJ += camera/drivers/pipewire.o
endif
LIBS += $(PIPEWIRE_LIBS)
@@ -952,14 +955,9 @@ endif
ifeq ($(HAVE_WASAPI), 1)
HAVE_MMDEVAPI = 1
OBJ += audio/drivers/wasapi.o \
audio/common/wasapi.o
OBJ += audio/drivers/wasapi.o
DEFINES += -DHAVE_WASAPI
LIBS += -lole32 -lksuser
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/wasapi.o
endif
endif
ifeq ($(HAVE_XAUDIO), 1)
@@ -978,6 +976,12 @@ ifeq ($(HAVE_WINMM), 1)
LIBS += -lwinmm
endif
ifeq ($(HAVE_COREMIDI), 1)
OBJ += midi/drivers/coremidi.o
DEFINES += -DHAVE_COREMIDI
LIBS += -framework CoreMIDI
endif
# Audio Resamplers
ifeq ($(HAVE_NEON),1)
@@ -1271,6 +1275,7 @@ ifeq ($(HAVE_WAYLAND), 1)
gfx/common/wayland_common.o \
gfx/common/wayland/fractional-scale-v1.o \
gfx/common/wayland/viewporter.o \
gfx/common/wayland/xdg-toplevel-icon-v1.o \
gfx/common/wayland/xdg-shell.o \
gfx/common/wayland/idle-inhibit-unstable-v1.o \
gfx/common/wayland/xdg-decoration-unstable-v1.o \
@@ -1337,6 +1342,10 @@ ifeq ($(HAVE_X11), 1)
ifeq ($(HAVE_XCB),1)
LIBS += -lX11-xcb
endif
ifeq ($(HAVE_XI2),1)
LIBS += -lXi
DEFINES += -DHAVE_XI2
endif
ifeq ($(HAVE_XSCRNSAVER),1)
LIBS += -lXss
endif
@@ -1494,6 +1503,7 @@ ifeq ($(HAVE_PLAIN_DRM), 1)
INCLUDE_DIRS += -I/usr/include/libdrm
endif
LIBS += -ldrm
HAVE_AND_WILL_USE_DRM = 1
endif
ifeq ($(HAVE_VITAGL), 1)
@@ -1526,7 +1536,10 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
endif
ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += gfx/drivers_context/emscriptenegl_ctx.o
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/drivers_context/emscriptenegl_ctx.o
endif
OBJ += gfx/drivers_context/emscriptenwebgl_ctx.o
endif
ifeq ($(HAVE_MALI_FBDEV), 1)
@@ -1570,10 +1583,11 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
DEF_FLAGS += $(OPENGLES_CFLAGS)
ifeq ($(HAVE_OPENGLES3), 1)
DEFINES += -DHAVE_OPENGLES3
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_es3.o
else
DEFINES += -DHAVE_OPENGLES2
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.o
endif
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.o
else
DEFINES += -DHAVE_GL_SYNC
OBJ += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.o
@@ -1615,14 +1629,9 @@ endif
ifeq ($(HAVE_SDL2), 1)
HAVE_SDL_COMMON = 1
OBJ += gfx/drivers/sdl2_gfx.o \
gfx/common/sdl2_common.o
gfx/common/sdl2_common.o
DEF_FLAGS += $(SDL2_CFLAGS)
LIBS += $(SDL2_LIBS)
ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/sdl_microphone.o
# Microphones are not supported by SDL 1.x
endif
else ifeq ($(HAVE_SDL), 1)
HAVE_SDL_COMMON = 1
OBJ += gfx/drivers/sdl_gfx.o
@@ -1688,11 +1697,15 @@ ifeq ($(HAVE_VULKAN), 1)
endif
ifeq ($(HAVE_OPENGL_CORE), 1)
OBJ += gfx/drivers/gl3.o \
gfx/drivers_shader/shader_gl3.o
OBJ += gfx/drivers/gl3.o
DEFINES += -DHAVE_OPENGL_CORE
NEED_CXX_LINKER = 1
ifeq ($(HAVE_SLANG), 1)
OBJ += gfx/drivers_shader/shader_gl3.o
NEED_CXX_LINKER = 1
endif
endif
ifeq ($(HAVE_OMAP), 1)
@@ -1754,22 +1767,19 @@ endif
ifeq ($(HAVE_D3D10), 1)
HAVE_D3D_COMMON = 1
OBJ += gfx/drivers/d3d10.o \
gfx/common/d3d10_common.o
OBJ += gfx/drivers/d3d10.o
DEFINES += -DHAVE_D3D10
endif
ifeq ($(HAVE_D3D11), 1)
HAVE_D3D_COMMON = 1
OBJ += gfx/drivers/d3d11.o \
gfx/common/d3d11_common.o
OBJ += gfx/drivers/d3d11.o
DEFINES += -DHAVE_D3D11
endif
ifeq ($(HAVE_D3D12), 1)
HAVE_D3D_COMMON = 1
OBJ += gfx/drivers/d3d12.o \
gfx/common/d3d12_common.o
OBJ += gfx/drivers/d3d12.o
DEFINES += -DHAVE_D3D12
endif
@@ -1949,6 +1959,34 @@ ifeq ($(HAVE_7ZIP),1)
$(7ZOBJ)
endif
ifeq ($(HAVE_ZSTD),1)
INCLUDE_DIRS += -I$(DEPS_DIR)/zstd/lib
DEFINES += -DHAVE_ZSTD -DZSTD_DISABLE_ASM
ZSOBJ = $(DEPS_DIR)/zstd/lib/common/entropy_common.o \
$(DEPS_DIR)/zstd/lib/common/error_private.o \
$(DEPS_DIR)/zstd/lib/common/fse_decompress.o \
$(DEPS_DIR)/zstd/lib/common/zstd_common.o \
$(DEPS_DIR)/zstd/lib/common/xxhash.o \
$(DEPS_DIR)/zstd/lib/compress/fse_compress.o \
$(DEPS_DIR)/zstd/lib/compress/hist.o \
$(DEPS_DIR)/zstd/lib/compress/huf_compress.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_compress.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_compress_literals.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_compress_sequences.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_compress_superblock.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_double_fast.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_fast.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_lazy.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_ldm.o \
$(DEPS_DIR)/zstd/lib/compress/zstd_opt.o \
$(DEPS_DIR)/zstd/lib/decompress/huf_decompress.o \
$(DEPS_DIR)/zstd/lib/decompress/zstd_ddict.o \
$(DEPS_DIR)/zstd/lib/decompress/zstd_decompress.o \
$(DEPS_DIR)/zstd/lib/decompress/zstd_decompress_block.o
OBJ += $(ZSOBJ)
endif
ifeq ($(HAVE_IBXM), 1)
DEFINES += -DHAVE_IBXM
OBJ += $(DEPS_DIR)/ibxm/ibxm.o
@@ -1990,6 +2028,7 @@ ifeq ($(HAVE_BUILTINZLIB), 1)
HAVE_ZLIB_COMMON = 1
OBJ += $(DEPS_DIR)/libz/adler32.o \
$(DEPS_DIR)/libz/libz-crc32.o \
$(DEPS_DIR)/libz/compress.o \
$(DEPS_DIR)/libz/deflate.o \
$(DEPS_DIR)/libz/gzclose.o \
$(DEPS_DIR)/libz/gzlib.o \
@@ -1999,6 +2038,7 @@ ifeq ($(HAVE_BUILTINZLIB), 1)
$(DEPS_DIR)/libz/inflate.o \
$(DEPS_DIR)/libz/inftrees.o \
$(DEPS_DIR)/libz/trees.o \
$(DEPS_DIR)/libz/uncompr.o \
$(DEPS_DIR)/libz/zutil.o
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include/compat/zlib
else ifeq ($(HAVE_ZLIB),1)
@@ -2099,6 +2139,13 @@ ifeq ($(HAVE_ZLIB_COMMON), 1)
DEFINES += -Dcdlz_codec_init=retroarch_internal_cdlz_codec_init
DEFINES += -Dcdlz_codec_free=retroarch_internal_cdlz_codec_free
DEFINES += -Dcdlz_codec_decompress=retroarch_internal_cdlz_codec_decompress
DEFINES += -Dzstd_codec_init=retroarch_internal_zstd_codec_init
DEFINES += -Dzstd_codec_free=retroarch_internal_zstd_codec_free
DEFINES += -Dzstd_codec_decompress=retroarch_internal_zstd_codec_decompress
DEFINES += -Dcdzs_codec_init=retroarch_internal_cdzs_codec_init
DEFINES += -Dcdzs_codec_free=retroarch_internal_cdzs_codec_free
DEFINES += -Dcdzs_codec_decompress=retroarch_internal_cdzs_codec_decompress
endif
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_bitstream.o \
$(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_cdrom.o \
@@ -2115,6 +2162,10 @@ ifeq ($(HAVE_ZLIB_COMMON), 1)
ifeq ($(HAVE_7ZIP), 1)
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_lzma.o
endif
ifeq ($(HAVE_ZSTD), 1)
OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_zstd.o
endif
endif
endif
@@ -2168,6 +2219,65 @@ ifeq ($(HAVE_V4L2),1)
LIBS += $(V4L2_LIBS)
endif
# FFmpeg
ifeq ($(HAVE_FFMPEG), 1)
DEFINES += -DHAVE_FFMPEG
INCLUDE_DIRS += -Iffmpeg
DEF_FLAGS += $(FFMPEG_CFLAGS) -Wno-deprecated-declarations
LIBS += $(FFMPEG_LIBS)
ifeq ($(HAVE_AVCODEC), 1)
DEFINES += -DHAVE_AVCODEC
DEF_FLAGS += $(AVCODEC_CFLAGS)
LIBS += $(AVCODEC_LIBS)
endif
ifeq ($(HAVE_AVDEVICE), 1)
DEFINES += -DHAVE_AVDEVICE
DEF_FLAGS += $(AVDEVICE_CFLAGS)
LIBS += $(AVDEVICE_LIBS)
endif
ifeq ($(HAVE_AVFORMAT), 1)
DEFINES += -DHAVE_AVFORMAT
DEF_FLAGS += $(AVFORMAT_CFLAGS)
LIBS += $(AVFORMAT_LIBS)
endif
ifeq ($(HAVE_AVUTIL), 1)
DEFINES += -DHAVE_AVUTIL
DEF_FLAGS += $(AVUTIL_CFLAGS)
LIBS += $(AVUTIL_LIBS)
endif
ifeq ($(HAVE_SWSCALE), 1)
DEFINES += -DHAVE_SWSCALE
DEF_FLAGS += $(SWSCALE_CFLAGS)
LIBS += $(SWSCALE_LIBS)
endif
ifeq ($(HAVE_SWRESAMPLE), 1)
DEFINES += -DHAVE_SWRESAMPLE
DEF_FLAGS += $(SWRESAMPLE_CFLAGS)
LIBS += $(SWRESAMPLE_LIBS)
endif
endif
ifeq ($(HAVE_FFMPEG), 1)
ifeq ($(HAVE_AVFORMAT), 1)
ifeq ($(HAVE_AVDEVICE), 1)
ifeq ($(HAVE_AVCODEC), 1)
ifeq ($(HAVE_AVUTIL), 1)
ifeq ($(HAVE_SWSCALE), 1)
OBJ += camera/drivers/ffmpeg.o
endif
endif
endif
endif
endif
endif
# Accessibility
ifeq ($(HAVE_ACCESSIBILITY), 1)
DEFINES += -DHAVE_ACCESSIBILITY
@@ -2192,11 +2302,16 @@ ifeq ($(HAVE_NETWORKING), 1)
$(LIBRETRO_COMM_DIR)/net/net_socket.o \
core_updater_list.o \
network/natt.o \
tasks/task_http.o \
tasks/task_netplay_lan_scan.o \
tasks/task_netplay_nat_traversal.o \
tasks/task_netplay_find_content.o
ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += tasks/task_http_emscripten.o
else
OBJ += tasks/task_http.o
endif
ifeq ($(HAVE_MENU), 1)
OBJ += tasks/task_pl_thumbnail_download.o
endif
@@ -2284,11 +2399,21 @@ ifeq ($(HAVE_NETWORKING), 1)
deps/rcheevos/src/rhash/aes.o \
deps/rcheevos/src/rhash/cdreader.o \
deps/rcheevos/src/rhash/hash.o \
deps/rcheevos/src/rhash/hash_disc.o \
deps/rcheevos/src/rhash/hash_encrypted.o \
deps/rcheevos/src/rhash/hash_rom.o \
deps/rcheevos/src/rhash/hash_zip.o \
deps/rcheevos/src/rapi/rc_api_common.o \
deps/rcheevos/src/rapi/rc_api_info.o \
deps/rcheevos/src/rapi/rc_api_runtime.o \
deps/rcheevos/src/rapi/rc_api_user.o \
# RVZ/WIA disc image support for RetroAchievements
ifeq ($(HAVE_ZSTD), 1)
DEFINES += -DHAVE_CHEEVOS_RVZ
OBJ += cheevos/cheevos_rvz.o
endif
ifeq ($(HAVE_LUA), 1)
DEFINES += -DHAVE_LUA \
-DLUA_32BITS
@@ -2403,7 +2528,7 @@ ifeq ($(HAVE_FFMPEG), 1)
cores/libretro-ffmpeg/video_buffer.o \
$(LIBRETRO_COMM_DIR)/rthreads/tpool.o
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS)
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS) $(AVDEVICE_LIBS)
DEFINES += -DHAVE_FFMPEG
DEF_FLAGS += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS) \
-Wno-deprecated-declarations
@@ -2648,4 +2773,36 @@ ifeq ($(HAVE_ODROIDGO2), 1)
gfx/drivers/oga_gfx.o
endif
ifeq ($(HAVE_GAME_AI),1)
DEFINES += -DHAVE_GAME_AI
OBJ += ai/game_ai.o
endif
# Detect the operating system
UNAME := $(shell uname -s)
# Check if the system is MSYS2 (MINGW64 or MINGW32)
ifneq ($(findstring MINGW,$(UNAME)),)
$(info Detected MSYS2 environment)
NT_VERSION := $(shell \
echo '#include <windows.h>' > temp.c; \
echo '#ifdef _WIN32_WINNT' >> temp.c; \
echo '#define GET_MACRO_VALUE(x) #x' >> temp.c; \
echo '#define EXPAND_MACRO_VALUE(x) GET_MACRO_VALUE(x)' >> temp.c; \
echo '#pragma message("_WIN32_WINNT=" EXPAND_MACRO_VALUE(_WIN32_WINNT))' >> temp.c; \
echo '#endif' >> temp.c; \
$(CC) -c temp.c 2>&1 | sed -n 's/^.*_WIN32_WINNT=\(0x[0-9A-Fa-f]\+\).*/\1/p'; \
rm -f temp.c temp.o)
ifneq ($(NT_VERSION),)
ifeq ($(shell [ $$(( $(NT_VERSION) )) -gt $$(( 0x602 )) ] && echo true),true)
LIBS += -lxaudio2_9
endif
else
$(warning Windows NT version macro (_WIN32_WINNT) is not defined.)
endif
endif
##################################
+84 -56
View File
@@ -3,8 +3,8 @@ LIBRETRO =
DEBUG = 0
CONSOLE_LOG = 0
GRIFFIN_BUILD = 1
HAVE_STATIC_DUMMY ?= 0
GRIFFIN_BUILD = 0
HAVE_STATIC_DUMMY ?= 0
WHOLE_ARCHIVE_LINK = 0
BUILD_3DSX = 1
BUILD_3DS = 0
@@ -68,6 +68,14 @@ ifeq ($(GRIFFIN_BUILD), 1)
#DEFINES += -DHAVE_SOCKET_LEGACY
#-DHAVE_SSL -DHAVE_BUILTINMBEDTLS -DMBEDTLS_SSL_DEBUG_ALL
#ssl is currently incompatible with griffin due to use of the "static" flag on repeating functions that will conflict when included in one file
CFLAGS += -I. \
-Ideps \
-Ideps/7zip \
-Ideps/stb \
-Ideps/mbedtls \
-Ideps/rcheevos/include \
-Ilibretro-common/include \
-Ilibretro-common/include/compat/zlib
else
HAVE_CC_RESAMPLER = 1
HAVE_MENU_COMMON = 1
@@ -89,21 +97,22 @@ else
HAVE_REWIND = 1
HAVE_AUDIOMIXER = 1
HAVE_RWAV = 1
#HAVE_NETWORKING = 1
#HAVE_IFINFO = 1
#HAVE_CHEEVOS = 1
#HAVE_SOCKET_LEGACY = 1
HAVE_CHEATS = 1
HAVE_VIDEO_FILTER = 1
HAVE_DSP_FILTER = 1
HAVE_CONFIGFILE = 1
HAVE_OVERLAY = 1
HAVE_GFX_WIDGETS = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_CHEEVOS = 1
HAVE_THREADS = 1
#HAVE_SSL = 1
#HAVE_BUILTINMBEDTLS = 1
HAVE_BUILTINMBEDTLS = 1
HAVE_CORE_INFO_CACHE = 1
HAVE_CLOUDSYNC = 1
include Makefile.common
CFLAGS += $(DEF_FLAGS)
BLACKLIST :=
BLACKLIST += input/input_overlay.o
BLACKLIST += tasks/task_overlay.o
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
CFLAGS += $(DEF_FLAGS) -I. $(INCLUDE_DIRS)
endif
ifeq ($(strip $(DEVKITPRO)),)
@@ -153,12 +162,7 @@ LIBDIRS := -L. -L$(CTRULIB)/lib
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft
CFLAGS += -mword-relocations \
-fomit-frame-pointer -ffast-math \
-Werror=implicit-function-declaration \
$(ARCH)
#CFLAGS += -Wall
CFLAGS += -mword-relocations $(ARCH)
CFLAGS += -DARM11 -D_3DS
ifeq ($(strip $(USE_CTRULIB_2)),1)
@@ -168,7 +172,7 @@ endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
CFLAGS += -fomit-frame-pointer -O3
endif
ifeq ($(CONSOLE_LOG), 1)
@@ -184,25 +188,17 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
WHOLE_END := -Wl,--no-whole-archive
endif
CFLAGS += -I. \
-Ideps \
-Ideps/7zip \
-Ideps/stb \
-Ideps/rcheevos/include \
-Ilibretro-common/include \
-Ilibretro-common/include/compat/zlib
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
CFLAGS += -DHAVE_DSP_FILTER
CFLAGS += -DHAVE_VIDEO_FILTER
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
CFLAGS += -DHAVE_CHEATS
CFLAGS += -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES -DHAVE_UPDATE_CORE_INFO
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
CFLAGS += -Werror=implicit-function-declaration
ASFLAGS := -g $(ARCH) -O3
LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
CFLAGS += -std=gnu99 -ffast-math
CFLAGS += -std=gnu99
LIB_CORE :=
LIB_CORE_FULL :=
@@ -222,6 +218,10 @@ else
LIBS += -lctru
endif
ifneq ($(V),1)
Q := @
endif
ifeq ($(BUILD_3DSX), 1)
TARGET_3DSX := $(TARGET).3dsx $(TARGET).smdh
endif
@@ -234,16 +234,7 @@ ifeq ($(BUILD_CIA), 1)
TARGET_CIA := $(TARGET).cia
endif
.PHONY: $(BUILD) clean all
all: $(TARGET)
$(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA)
$(TARGET).3dsx: $(TARGET).elf
$(TARGET).elf: $(OBJ) $(LIB_CORE_FULL)
PREFIX := $(DEVKITARM)/bin/arm-none-eabi-
CC := $(PREFIX)gcc
CXX := $(PREFIX)g++
AS := $(PREFIX)as
@@ -277,6 +268,36 @@ else
MAKEROM = $(CTRMAKEROM)
endif
.PHONY: $(BUILD) clean all
all: $(TARGET)
define INFO
AR: $(AR)
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
INCDIRS: $(INCDIRS)
LD: $(LD)
LDFLAGS: $(LDFLAGS)
LIBDIRS: $(LIBDIRS)
LIBS: $(LIBS)
OBJ: $(OBJ)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
$(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA)
$(TARGET).3dsx: $(TARGET).elf
$(TARGET).elf: $(OBJ) $(LIB_CORE_FULL)
%.o: %.vsh %.gsh
$(DEVKITTOOLS)/bin/picasso $^ -o $*.shbin
$(DEVKITTOOLS)/bin/bin2s $*.shbin | $(PREFIX)as -o $@
@@ -288,19 +309,24 @@ endif
rm $*.shbin
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS)
%.o: %.s
$(CC) -c -o $@ $< $(ASFLAGS)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $< $(ASFLAGS)
%.o: %.S
$(CC) -c -o $@ $< $(ASFLAGS)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $< $(ASFLAGS)
%.a:
$(AR) -rc $@ $^
@$(if $(Q), $(shell echo echo AR $<),)
$(Q)$(AR) -rc $@ $^
%.vsh:
@@ -316,7 +342,8 @@ endif
$(DEVKITTOOLS)/bin/3dsxtool $< $@ $(_3DSXFLAGS)
$(TARGET).elf: ctr/3dsx_custom_crt0.o
$(LD) $(LDFLAGS) $(OBJ) $(LIBDIRS) $(LIBS) -o $@
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LD) $(LDFLAGS) $(OBJ) $(LIBDIRS) $(LIBS) -o $@
$(NM) -CSn $@ > $(notdir $*.lst)
$(TARGET).bnr: $(TARGET).elf $(APP_BANNER) $(APP_AUDIO)
@@ -332,15 +359,16 @@ $(TARGET).cia: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF)
$(MAKEROM) -f cia -o $@ $(MAKEROM_ARGS_COMMON) -DAPP_ENCRYPTED=false
clean:
rm -f $(OBJ)
rm -f $(TARGET).3dsx
rm -f $(TARGET).elf
rm -f $(TARGET).3ds
rm -f $(TARGET).cia
rm -f $(TARGET).smdh
rm -f $(TARGET).bnr
rm -f $(TARGET).icn
rm -f ctr/ctr_config_*.o
rm -f ctr/3dsx_custom_crt0.o
@$(if $(Q), echo $@,)
$(Q)rm -f $(OBJ)
$(Q)rm -f $(TARGET).3dsx
$(Q)rm -f $(TARGET).elf
$(Q)rm -f $(TARGET).3ds
$(Q)rm -f $(TARGET).cia
$(Q)rm -f $(TARGET).smdh
$(Q)rm -f $(TARGET).bnr
$(Q)rm -f $(TARGET).icn
$(Q)rm -f ctr/ctr_config_*.o
$(Q)rm -f ctr/3dsx_custom_crt0.o
.PHONY: clean
+3 -7
View File
@@ -83,12 +83,7 @@ LIBDIRS := -L. -L$(CTRULIB)/lib
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft
CFLAGS += -mword-relocations \
-fomit-frame-pointer -ffast-math \
-Werror=implicit-function-declaration \
$(ARCH)
#CFLAGS += -Wall
CFLAGS += -mword-relocations -fomit-frame-pointer $(ARCH)
CFLAGS += -DARM11 -D_3DS
ifeq ($(strip $(USE_CTRULIB_2)),1)
@@ -111,11 +106,12 @@ CFLAGS += -I. -Ideps/7zip -Ideps/stb -Ilibretro-common/include -Ilibretro-common
CFLAGS += -DRARCH_CONSOLE -DIS_SALAMANDER
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
CFLAGS += -Werror=implicit-function-declaration
ASFLAGS := -g $(ARCH) -O3
LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
CFLAGS += -std=gnu99 -ffast-math
CFLAGS += -std=gnu99
LIBS := -lctru -lm
+1 -1
View File
@@ -107,7 +107,7 @@ OPK_NAME = retroarch.opk
OBJ :=
LINK := $(CXX)
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -fomit-frame-pointer
DEF_FLAGS += -mplt -mno-shared
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD
+34 -6
View File
@@ -120,7 +120,7 @@ APP_ICON := pkg/libnx/retroarch.jpg
#---------------------------------------------------------------------------------
ARCH :=
CFLAGS := -g -Wall -O3 -fcommon -ffast-math -ffunction-sections \
CFLAGS := -g -Wall -O3 -fcommon -ffunction-sections \
$(ARCH) $(DEFINES) $(INCLUDE_DIRS)
CFLAGS += $(INCLUDE)
@@ -195,6 +195,10 @@ else
LIB_CORE += -lretro_dos
endif
ifneq ($(V),1)
Q := @
endif
DEPENDS_TMP := $(OFILES:.o=.d)
DEPENDS := $(filter-out libretro_libnx.a,$(DEPENDS_TMP))
@@ -203,19 +207,43 @@ DEPENDS := $(filter-out libretro_libnx.a,$(DEPENDS_TMP))
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
all : $(OUTPUT)
all: $(OUTPUT)
define INFO
CC: $(CC)
CFLAGS: $(CFLAGS)
CXX: $(CXX)
DEPENDS: $(DEPENDS)
LDFLAGS: $(LDFLAGS)
LIBDIRS: $(LIBDIRS)
LIBS: $(LIBS)
LIB_CORE: $(LIB_CORE)
OBJ: $(OBJ)
OUTPUT: $(OUTPUT)
PLATEXTRA: $(PLATEXTRA)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
$(OUTPUT): $(OBJ)
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) -L. $(LIB_CORE) $(LIBS)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) -L. $(LIB_CORE) $(LIBS)
%.o: %.c
$(CC) -c -o $@ $(CFLAGS) $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $(CFLAGS) $<
%.o: %.cpp
$(CXX) -c -o $@ $(CFLAGS) $<
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) -c -o $@ $(CFLAGS) $<
clean:
rm -f $(DEPENDS) $(OBJ) $(OUTPUT)
@$(if $(Q), $(shell echo echo RM),)
$(Q)rm -f $(DEPENDS) $(OBJ) $(OUTPUT)
#---------------------------------------------------------------------------------
# you need a rule like this for each extension you use as binary data
+227 -80
View File
@@ -7,29 +7,34 @@ else
TARGET := $(LIBRETRO)_libretro.js
endif
endif
EOPT = USE_ZLIB=1 # Emscripten specific options
EOPTS = $(addprefix -s $(EMPTY), $(EOPT)) # Add '-s ' to each option
TARGET_BASE := $(subst .js,,$(TARGET))
OS = Emscripten
OBJ :=
DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN -DEMSCRIPTEN
DEFINES += -DHAVE_FILTERS_BUILTIN -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORE_INFO
HAVE_STATESTREAM ?= 1
HAVE_PATCH = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_OVERLAY = 1
HAVE_NETWORKING ?= 1
HAVE_LIBRETRODB = 1
HAVE_COMPRESSION = 1
HAVE_UPDATE_ASSETS = 1
HAVE_ONLINE_UPDATER = 1
HAVE_GLSL = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_AUDIOMIXER = 1
HAVE_CC_RESAMPLER = 1
HAVE_EGL = 1
HAVE_CC_RESAMPLER ?= 1
HAVE_EGL ?= 0
HAVE_OPENGLES = 1
HAVE_RJPEG = 0
HAVE_RPNG = 1
HAVE_RJPEG = 0
HAVE_RPNG = 1
HAVE_EMSCRIPTEN = 1
HAVE_MENU = 1
HAVE_MENU ?= 1
HAVE_GFX_WIDGETS = 1
HAVE_RGUI = 1
HAVE_SDL = 0
@@ -41,91 +46,234 @@ HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_STB_FONT = 1
HAVE_CONFIGFILE = 1
HAVE_COMMAND = 1
HAVE_STDIN_CMD = 1
HAVE_STDIN_CMD ?= 1
HAVE_CHEATS = 1
HAVE_IBXM = 1
HAVE_CORE_INFO_CACHE = 1
HAVE_7ZIP = 1
HAVE_BSV_MOVIE = 1
HAVE_AL = 1
HAVE_CHD ?= 0
HAVE_NETPLAYDISCOVERY ?= 0
# WARNING -- READ BEFORE ENABLING
# The rwebaudio driver is known to have several audio bugs, such as
# minor crackling, or the entire page freezing/crashing.
# It works perfectly on chrome, but even firefox has really bad audio quality.
# I should also note, the driver on iOS is completely broken (crashes the page).
# You have been warned.
HAVE_RWEBAUDIO = 0
# enables pthreads, requires special headers on the web server:
# see https://web.dev/articles/coop-coep
HAVE_THREADS ?= 0
# requires HAVE_THREADS
HAVE_AUDIOWORKLET ?= 0
# doesn't work on PROXY_TO_PTHREAD
HAVE_RWEBAUDIO ?= 1
# requires ASYNC or PROXY_TO_PTHREAD
HAVE_AL ?= 0
# whether the browser thread is allowed to block to wait for audio to play, not CPU usage-friendly!
# currently this variable is only used by rwebaudio and audioworklet; openal will never busywait.
ALLOW_AUDIO_BUSYWAIT ?= 0
# minimal asyncify; better performance than full asyncify,
# but sleeping on the main thread is only possible in some places.
MIN_ASYNC ?= 0
# runs RetroArch on a pthread instead of the browser thread; requires HAVE_THREADS
PROXY_TO_PTHREAD ?= 0
# recommended FS when using HAVE_THREADS
HAVE_WASMFS ?= 0
# enables OPFS (origin private file system) and FETCHFS, requires PROXY_TO_PTHREAD
HAVE_EXTRA_WASMFS ?= 0
# enable javascript filesystem tracking, incompatible with HAVE_WASMFS
FS_DEBUG ?= 0
# help diagnose GL problems (can cause issues in normal operation)
GL_DEBUG ?= 0
# does nothing on its own, but automatically selected by some other options
WASM_WORKERS = 0
HAVE_OPENGLES ?= 1
HAVE_OPENGLES3 ?= 0
ASYNC ?= 0
ifeq ($(LIBRETRO), mupen64plus)
ASYNC = 1
endif
LTO ?= 0
ifeq ($(LIBRETRO), tyrquake)
LTO = 0
endif
PTHREAD_POOL_SIZE ?= 4
PTHREAD ?= 0
ASYNCIFY_ADD ?= dynCall_*,emscripten_mainloop
ASYNCIFY_REMOVE ?= threaded_worker
MEMORY ?= 134217728
STACK_SIZE ?= 4194304
INITIAL_HEAP ?= 134217728
PRECISE_F32 = 1
# 4194304 ----- 4 MiB (Stack: recommended)
# 8388608 ----- 8 MiB
# 16777216 ---- 16 MiB
# 33554432 ---- 32 MiB
# 67108864 ---- 64 MiB
# 134217728 --- 128 MiB (Heap: recommended) (Stack: recommended for some cores [mupen64plus_next])
# 268435456 --- 256 MiB (Heap: recommended for some cores [mupen64plus_next])
# 536870912 --- 512 MiB (Heap: needed for some cores [mednafen_psx(_hw)])
# 1073741824 -- 1 GiB
# 1610612736 -- 1.5 GiB
# 2147483648 -- 2 GiB
OBJDIR := obj-emscripten
#if you compile with SDL2 flag add this Emscripten flag "-s USE_SDL=2" to LDFLAGS:
EXPORTED_FUNCTIONS = _main,_malloc,_free,_cmd_savefiles,_cmd_save_state,_cmd_load_state,_cmd_undo_save_state,_cmd_undo_load_state,_cmd_toggle_fullscreen,_cmd_take_screenshot,\
_cmd_toggle_menu,_cmd_reload_config,_cmd_toggle_grab_mouse,_cmd_toggle_game_focus,_cmd_reset,_cmd_toggle_pause,_cmd_pause,_cmd_unpause,\
_cmd_set_volume,_cmd_set_shader,_cmd_cheat_set_code,_cmd_cheat_get_code,_cmd_cheat_toggle_index,_cmd_cheat_get_code_state,_cmd_cheat_realloc,\
_cmd_cheat_get_size,_cmd_cheat_apply_cheats,EmscriptenSendCommand,EmscriptenReceiveCommandReply
LIBS := -s USE_ZLIB=1
LDFLAGS := -L. --no-heap-copy -s $(LIBS) -s TOTAL_MEMORY=$(MEMORY) -s NO_EXIT_RUNTIME=0 -s FULL_ES2=1 \
-s "EXPORTED_RUNTIME_METHODS=['callMain', 'FS', 'PATH', 'ERRNO_CODES']" \
-s ALLOW_MEMORY_GROWTH=1 -s "EXPORTED_FUNCTIONS=['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_load_state', '_cmd_take_screenshot']" \
-s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="libretro_$(subst -,_,$(LIBRETRO))" \
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 \
--js-library emscripten/library_errno_codes.js \
--js-library emscripten/library_rwebcam.js
EXPORTS := callMain,FS,PATH,ERRNO_CODES,ENV,stringToNewUTF8,UTF8ToString,Browser,EmscriptenSendCommand,EmscriptenReceiveCommandReply
ifeq ($(HAVE_RWEBAUDIO), 1)
LDFLAGS += --js-library emscripten/library_rwebaudio.js
DEFINES += -DHAVE_RWEBAUDIO
endif
ifeq ($(HAVE_AL), 1)
LDFLAGS += -lopenal
DEFINES += -DHAVE_AL
ASYNC = 1
endif
LIBS := -s USE_ZLIB=1
CFLAGS := -s USE_ZLIB=1
ifneq ($(PTHREAD), 0)
LDFLAGS += -s WASM_MEM_MAX=1073741824 -pthread -s PTHREAD_POOL_SIZE=$(PTHREAD)
CFLAGS += -pthread
HAVE_THREADS=1
else
HAVE_THREADS=0
endif
ifeq ($(ASYNC), 1)
LDFLAGS += -s ASYNCIFY=$(ASYNC) -s ASYNCIFY_STACK_SIZE=8192
ifeq ($(DEBUG), 1)
LDFLAGS += -s ASYNCIFY_DEBUG=1 # -s ASYNCIFY_ADVISE
ifeq ($(HAVE_EXTRA_WASMFS), 1)
LIBS += -lfetchfs.js -lopfs.js
DEFINES += -DHAVE_EXTRA_WASMFS
override HAVE_WASMFS = 1
ifeq ($(PROXY_TO_PTHREAD), 0)
$(error ERROR: HAVE_EXTRA_WASMFS requires PROXY_TO_PTHREAD)
endif
endif
ifeq ($(HAVE_WASMFS), 1)
LIBS += -s WASMFS -s FORCE_FILESYSTEM=1
endif
# note: real PROXY_TO_PTHREAD is not used here; we do the pthread management ourselves
ifeq ($(PROXY_TO_PTHREAD), 1)
LIBS += -s OFFSCREENCANVAS_SUPPORT
DEFINES += -DPROXY_TO_PTHREAD -DEMSCRIPTEN_STACK_SIZE=$(STACK_SIZE)
override HAVE_THREADS = 1
override WASM_WORKERS = 1
# use the default stack size for the browser thread; the RetroArch thread will be created with the specified stack size
override STACK_SIZE = 4194304
else ifeq ($(HAVE_AL), 1)
override ASYNC = 1
endif
ifeq ($(HAVE_SDL2), 1)
LIBS += -s USE_SDL=2
DEFINES += -DHAVE_SDL2
endif
LDFLAGS := -L. --no-heap-copy -s STACK_SIZE=$(STACK_SIZE) -s INITIAL_MEMORY=$(INITIAL_HEAP) \
-s EXPORTED_RUNTIME_METHODS=$(EXPORTS) -s EXIT_RUNTIME=1 \
-s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS="$(EXPORTED_FUNCTIONS)" \
-s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="libretro_$(subst -,_,$(LIBRETRO))" \
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 \
-s ENVIRONMENT=web,worker -s WASM_BIGINT=1 \
--extern-pre-js emscripten/pre.js \
--js-library emscripten/library_rwebcam.js \
--js-library emscripten/library_platform_emscripten.js
ifeq ($(HAVE_OPENGLES), 1)
ifeq ($(HAVE_OPENGLES3), 1)
LDFLAGS += -s FULL_ES3=1 -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2
else
LDFLAGS += -s FULL_ES2=1 -s MIN_WEBGL_VERSION=1 -s MAX_WEBGL_VERSION=2
endif
endif
ifeq ($(GL_DEBUG), 1)
LDFLAGS += -s GL_ASSERTIONS=1 -s GL_DEBUG=1
DEFINES += -DHAVE_GL_DEBUG_ES=1
endif
ifeq ($(FS_DEBUG), 1)
LDFLAGS += -s FS_DEBUG=1
endif
ifeq ($(HAVE_RWEBAUDIO), 1)
LDFLAGS += --js-library emscripten/library_rwebaudio.js
DEFINES += -DHAVE_RWEBAUDIO
ifeq ($(PROXY_TO_PTHREAD), 1)
$(error ERROR: RWEBAUDIO is incompatible with PROXY_TO_PTHREAD)
endif
endif
ifeq ($(HAVE_AUDIOWORKLET), 1)
LDFLAGS += -s AUDIO_WORKLET=1
DEFINES += -DHAVE_AUDIOWORKLET
override WASM_WORKERS = 1
ifeq ($(HAVE_THREADS), 0)
$(error ERROR: AUDIOWORKLET requires HAVE_THREADS)
endif
endif
ifeq ($(HAVE_AL), 1)
LDFLAGS += -lopenal
DEFINES += -DHAVE_AL
endif
ifeq ($(PROXY_TO_PTHREAD), 1)
else ifeq ($(ASYNC), 1)
else
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_BLOCK
ifeq ($(MIN_ASYNC), 1)
DEFINES += -DEMSCRIPTEN_AUDIO_ASYNC_BLOCK
else
DEFINES += -DEMSCRIPTEN_AUDIO_FAKE_BLOCK
endif
ifneq ($(ALLOW_AUDIO_BUSYWAIT), 1)
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
endif
endif
ifeq ($(ALLOW_AUDIO_BUSYWAIT), 1)
DEFINES += -DEMSCRIPTEN_AUDIO_BUSYWAIT
endif
# explanation of some of these defines:
# EMSCRIPTEN_AUDIO_EXTERNAL_BLOCK: audio blocking occurs in the main loop instead of in the audio driver functions.
# EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK: along with above, enables external blocking in the write function.
# EMSCRIPTEN_AUDIO_BUSYWAIT: write function will busywait. init function may still use an external block.
# EMSCRIPTEN_AUDIO_ASYNC_BLOCK: external block uses emscripten_sleep (requires MIN_ASYNC).
# EMSCRIPTEN_AUDIO_FAKE_BLOCK: external block uses main loop timing (doesn't require asyncify).
# when building with either PROXY_TO_PTHREAD or ASYNC (full asyncify), none of the above are required.
ifeq ($(HAVE_THREADS), 1)
LDFLAGS += -pthread -s PTHREAD_POOL_SIZE=$(PTHREAD_POOL_SIZE)
CFLAGS += -pthread -s SHARED_MEMORY
endif
ifeq ($(WASM_WORKERS), 1)
LDFLAGS += -s WASM_WORKERS=1
endif
ifeq ($(ASYNC), 1)
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_FULL_ASYNCIFY
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192
ifeq ($(DEBUG), 1)
#LDFLAGS += -s ASYNCIFY_DEBUG=1 # broken?
endif
else ifeq ($(MIN_ASYNC), 1)
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_MIN_ASYNCIFY
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192 -s ASYNCIFY_IGNORE_INDIRECT=1 -s ASYNCIFY_ADD='$(ASYNCIFY_ADD)' -s ASYNCIFY_REMOVE='$(ASYNCIFY_REMOVE)'
ifeq ($(DEBUG), 1)
LDFLAGS += -s ASYNCIFY_ADVISE #-s ASYNCIFY_DEBUG=1
endif
endif
include Makefile.common
CFLAGS += $(DEF_FLAGS) -Ideps -Ideps/stb
DEF_FLAGS += $(INCLUDE_DIRS) -Ideps -Ideps/stb
libretro :=
CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS) -D__STDC_CONSTANT_MACROS
libretro =
libretro_new =
ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
else
libretro += libretro_emscripten.bc
libretro = libretro_emscripten.bc
libretro_new = libretro_emscripten.a
endif
ifneq ($(V), 1)
@@ -133,46 +281,45 @@ ifneq ($(V), 1)
endif
ifeq ($(DEBUG), 1)
LDFLAGS += -O0 -g -gsource-map -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=2 -s ASSERTIONS=1
CFLAGS += -O0 -g -gsource-map -s SAFE_HEAP=1 -s SAFE_HEAP_LOG=1 -s STACK_OVERFLOW_CHECK=2 -s ASSERTIONS=1
LDFLAGS += -O0 -g -gsource-map -s SAFE_HEAP=2 -s STACK_OVERFLOW_CHECK=2 -s ASSERTIONS=1
# -O0 in cflags gives "too many locals" errors
CFLAGS += -O1 -g -gsource-map
else
LDFLAGS += -O3 -s WASM=1
LDFLAGS += -O3
# WARNING: some optimizations can break some cores (ex: LTO breaks tyrquake)
LDFLAGS += -s PRECISE_F32=$(PRECISE_F32)
ifeq ($(LTO), 1)
LDFLAGS += --llvm-lto 3
LDFLAGS += -flto
endif
CFLAGS += -O3
endif
# 128 * 1024, double the usual emscripten stack size
LDFLAGS += -s STACK_SIZE=131072
LDFLAGS += --extern-pre-js emscripten/pre.js
CFLAGS += -Wall -I. -Ilibretro-common/include -std=gnu99 #\
# -s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_take_screenshot']"
CFLAGS += -Wall -I. -Ilibretro-common/include -Ideps/7zip -std=gnu99
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
all: $(TARGET)
$(TARGET): $(RARCH_OBJ) $(libretro)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LD) -o $@ $(RARCH_OBJ) $(libretro) $(LIBS) $(LDFLAGS)
$(libretro_new): ;
mv_libretro:
$(Q)mv -f $(libretro) $(libretro_new) || true
$(TARGET): $(RARCH_OBJ) $(libretro_new) mv_libretro
@$(if $(Q), $(shell echo echo "LD $@ \<obj\> $(libretro_new) $(LIBS) $(LDFLAGS)"),)
$(Q)$(LD) -o $@ $(RARCH_OBJ) $(libretro_new) $(LIBS) $(LDFLAGS)
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) $(EOPTS) -c -o $@ $<
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) $(EOPTS) -c -o $@ $<
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR)
rm -f $(TARGET)
.PHONY: all clean
.PHONY: all clean mv_libretro
+5
View File
@@ -116,6 +116,7 @@ else ifeq ($(platform), ps3-cobra)
# NGC/Wii - libogc
else ifeq ($(libogc_platform), 1)
EXTERNAL_LIBOGC ?= 0
HAVE_OGG_OGC ?= 0
GX_PTHREAD_LEGACY ?= 1
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
@@ -183,6 +184,10 @@ else ifeq ($(libogc_platform), 1)
endif
endif
ifeq ($(HAVE_OGG_OGC), 1)
LIBS += -L$(DEVKITPRO)/portlibs/ppc/lib -lvorbisfile -lvorbis -logg
endif
ifeq ($(EXTERNAL_LIBOGC), 1)
LIBS += -lfat
endif
+4 -2
View File
@@ -57,6 +57,8 @@ HAVE_CHD = 1
HAVE_STB_VORBIS = 1
HAVE_IBXM = 1
HAVE_CORE_INFO_CACHE = 1
HAVE_CLOUD_SYNC = 1
HAVE_SSL = 1
# RetroArch libnx useful flags
HAVE_THREADS = 1
@@ -127,7 +129,7 @@ APP_ICON := pkg/libnx/retroarch.jpg
#---------------------------------------------------------------------------------
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd
CFLAGS := -g -Wall -O3 -fcommon -ffast-math -ffunction-sections \
CFLAGS := -g -Wall -O3 -fcommon -ffunction-sections \
$(ARCH) $(DEFINES) $(INCLUDE_DIRS) -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h #$(shell $(PORTLIBS)/bin/freetype-config --cflags)
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1 -DHAVE_SHADERPIPELINE -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES -DHAVE_UPDATE_CORE_INFO -DHAVE_STB_FONT #-DHAVE_FREETYPE
@@ -148,7 +150,7 @@ LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs $(ARCH) -Wl,--allow-multiple-de
# add things from Makefile.common
CFLAGS += $(DEF_FLAGS)
LIBS := -lswresample -lavformat -lavcodec -lavutil -lswscale -lstdc++ -lbz2 -lpng -lz -lnx -lvpx -lopus -llzma -lm
LIBS := -lswresample -lavformat -lavcodec -lavutil -lswscale -lstdc++ -lbz2 -lpng -lz -lnx -lvpx -lopus -llzma -lmbedtls -lmbedx509 -lmbedcrypto -lnx -lm
ifeq ($(HAVE_OPENGL), 1)
LIBS := -lEGL -lglapi -ldrm_nouveau $(LIBS)
+30 -5
View File
@@ -118,7 +118,7 @@ TARGET = retroarch
OBJ :=
LINK := $(CXX)
DEF_FLAGS := -march=armv5te -mtune=arm926ej-s -ffast-math -fomit-frame-pointer
DEF_FLAGS := -march=armv5te -mtune=arm926ej-s -fomit-frame-pointer
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DMIYOO=1 -DDINGUX -MMD
DEF_FLAGS += -Wall -Wno-unused-variable -flto
@@ -160,12 +160,36 @@ CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
ifneq ($(V),1)
Q := @
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
all: $(TARGET)
define INFO
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CPPFLAGS: $(CPPFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEFINES: $(DEFINES)
LDFLAGS: $(LDFLAGS)
LIBRARY_DIRS: $(LIBRARY_DIRS)
LIBS: $(LIBS)
LINK: $(LINK)
OBJCFLAGS: $(OBJCFLAGS)
RARCH_OBJ: $(RARCH_OBJ)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
@@ -199,9 +223,10 @@ $(OBJDIR)/%.o: %.S $(HEADERS)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
@$(if $(Q), echo $@,)
$(Q)rm -rf $(OBJDIR_BASE)
$(Q)rm -f $(TARGET)
$(Q)rm -f *.d
.PHONY: all clean
+44 -8
View File
@@ -58,6 +58,7 @@ LIBS := $(WHOLE_START) $(LIB_CORE) $(WHOLE_END)
libogc_platform := 1
EXTERNAL_LIBOGC ?= 0
HAVE_OGG_OGC ?= 0
GX_PTHREAD_LEGACY ?= 1
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
@@ -102,6 +103,10 @@ ifeq ($(BIG_STACK), 1)
LDFLAGS += -T bootstrap/gx/ogc.ld
endif
ifeq ($(HAVE_OGG_OGC), 1)
LIBS += -L$(DEVKITPRO)/portlibs/ppc/lib -lvorbisfile -lvorbis -logg
endif
ifeq ($(EXTERNAL_LIBOGC), 1)
LIBS += -lfat
endif
@@ -233,34 +238,65 @@ else
CFLAGS += -O3
endif
ifneq ($(V),1)
Q := @
endif
OBJOUT = -o
LINKOUT = -o
LINK = $(CXX)
all: $(EXT_TARGET)
define INFO
CC: $(CC)
CFLAGS: $(CFLAGS)
CXX: $(CXX)
LD: $(LD)
LDFLAGS: $(LDFLAGS)
LIBDIRS: $(LIBDIRS)
LIBS: $(LIBS)
LINK: $(LINK)
LINKOUT: $(LINKOUT)
OBJ: $(OBJ)
OBJOUT: $(OBJOUT)
PLATEXTRA: $(PLATEXTRA)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
%.dol: %.elf
$(ELF2DOL) $< $@
$(EXT_INTER_TARGET): $(OBJ)
$(LINK) $(LINKOUT)$@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) $(LIBS)
@$(if $(Q), $(shell echo echo LINK $@),)
$(Q)$(LINK) $(LINKOUT)$@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.cpp
$(CXX) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.S
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.binobj: %.bin
$(LD) -r -b binary $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LD) -r -b binary $(OBJOUT)$@ $<
clean:
rm -f $(EXT_TARGET)
rm -f $(EXT_INTER_TARGET)
rm -f $(OBJ)
@$(if $(Q), echo $@,)
$(Q)rm -f $(EXT_TARGET)
$(Q)rm -f $(EXT_INTER_TARGET)
$(Q)rm -f $(OBJ)
.PHONY: clean
+37 -8
View File
@@ -176,38 +176,67 @@ else
CXXFLAGS += -O3
endif
ifneq ($(V),1)
Q := @
endif
TARGETS := $(TARGET).self
all: $(TARGETS)
define INFO
CC: $(CC)
CFLAGS: $(CFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
LD: $(LD)
LDFLAGS: $(LDFLAGS)
LIBS: $(LIBS)
OBJ: $(OBJ)
OBJOUT: $(OBJOUT)
ORBISDEV: $(ORBISDEV)
TARGET: $(TARGET)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
OBJOUT = -o
%.o: %.c
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $<
%.o: %.S
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.s
$(CC) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c $(OBJOUT)$@ $<
$(TARGET).elf: $(OBJ)
$(LD) $(ORBISDEV)/usr/lib/crt0.o $(OBJ) $(LDFLAGS) $(LIBS) -o $(TARGET).elf
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LD) $(ORBISDEV)/usr/lib/crt0.o $(OBJ) $(LDFLAGS) $(LIBS) -o $(TARGET).elf
$(TARGET).oelf: $(TARGET).elf
@orbis-elf-create $(TARGET).elf $(TARGET).oelf
orbis-elf-create $(TARGET).elf $(TARGET).oelf
$(TARGET).self: $(TARGET).oelf
python $(ORBISDEV)/bin/make_fself.py --auth-info $(AUTH_INFO) $(TARGET).oelf $(TARGET).self
install:
@cp $(TARGET).self $(SELF_PATH_INSTALL)/homebrew.self
cp $(TARGET).self $(SELF_PATH_INSTALL)/homebrew.self
@echo "Installed!"
clean:
rm -f $(OBJ) $(TARGET).elf $(TARGET).oelf $(TARGET).self
$(Q)rm -f $(OBJ) $(TARGET).elf $(TARGET).oelf $(TARGET).self
.PHONY: clean all
+35 -2
View File
@@ -83,6 +83,10 @@ ifeq ($(strip $(PS2SDK)),)
$(error "Please set PS2SDK in your environment. export PS2SDK=<path to>ps2sdk")
endif
ifneq ($(V),1)
Q := @
endif
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
INCDIR += -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
@@ -90,7 +94,7 @@ LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
# Lib cdvd is needed to get proper time
LIBS += -lpatches -lgskit -ldmakit -lps2_drivers -lz -lelf-loader
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) $(DEFINES) -DPS2 -ffast-math -fsingle-precision-constant
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) $(DEFINES) -DPS2 -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
EE_OBJS += $(OBJ)
@@ -106,8 +110,25 @@ EE_GPVAL = $(GPVAL)
all: $(EE_BIN)
define INFO
EE_BIN: $(EE_BIN)
EE_CC: $(EE_CC)
EE_CFLAGS: $(EE_CFLAGS)
EE_CXX: $(EE_CXX)
EE_CXXFLAGS: $(EE_CXXFLAGS)
EE_INCS: $(EE_INCS)
EE_OBJS: $(EE_OBJS)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
clean:
rm -f $(EE_BIN) $(EE_OBJS)
@$(if $(Q), $(shell echo echo RM $<),)
$(Q)rm -f $(EE_BIN) $(EE_OBJS)
prepare:
ps2client -h $(PS2_IP) reset
@@ -131,3 +152,15 @@ release: all
#Include preferences
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
%.o: %.c
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(EE_CC) $(EE_CFLAGS) $(EE_INCS) -c $< -o $@
%.o: %.cc
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(EE_CXX) $(EE_CXXFLAGS) $(EE_INCS) -c $< -o $@
%.o: %.cpp
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(EE_CXX) $(EE_CXXFLAGS) $(EE_INCS) -c $< -o $@
+1 -1
View File
@@ -21,7 +21,7 @@ endif
INCDIR = -Ilibretro-common/include
INCDIR += -I$(PS2SDK)/ports/include
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
RARCH_DEFINES += -DPS2 -DIS_SALAMANDER -DRARCH_CONSOLE
+34 -7
View File
@@ -6,7 +6,7 @@
ifeq ($(strip $(PSL1GHT)),)
$(error "Please set PSL1GHT in your environment. export PSL1GHT=<path>")
endif
include $(PSL1GHT)/ppu_rules
include version.all
@@ -30,10 +30,17 @@ CORE_PATH = pkg/psl1ght/pkg/USRDIR/cores/CORE.SELF
INCLUDE += -I. -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude -Idefines -I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2
LIBDIRS += -L. -L$(PORTLIBS)/lib
ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
LIBS :=
else
LIBS := -lretro_psl1ght
endif
MACHDEP := -D__PSL1GHT__ -D__PS3__ -mcpu=cell
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
CFLAGS += -Wall $(DEFINES) $(MACHDEP) $(INCLUDE)
LDFLAGS := $(MACHDEP)
LIBS := -lretro_psl1ght -lrt -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl -lsysfs -lfreetype -lcamera -lgem -lspurs
LIBS += -lrt -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl -lsysfs -lfreetype -lcamera -lgem -lspurs
# system platform
system_platform = unix
@@ -119,13 +126,32 @@ else
CXXFLAGS += -03 -g
endif
ifneq ($(V),1)
Q := @
endif
all: $(SELF_TARGET)
define INFO
CXX: $(CXX)
LDFLAGS: $(LDFLAGS)
LIBDIRS: $(LIBDIRS)
LIBS: $(LIBS)
OBJ: $(OBJ)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
$(ELF_TARGET): $(OBJ)
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)
create-core: $(SELF_TARGET)
cp $(SELF_TARGET) $(CORE_PATH)
cp $(SELF_TARGET) $(CORE_PATH)
pkg: create-core
$(PKG) --contentid $(CONTENTID) pkg/psl1ght/pkg/ $(PACKAGE_BASENAME).pkg
@@ -133,7 +159,8 @@ pkg: create-core
# $(PACKAGE_FINALIZE) $(PACKAGE_BASENAME).gnpdrm.pkg
clean:
rm -f $(ELF_TARGET)
rm -f $(OBJ)
@$(if $(Q), echo $@,)
$(Q)rm -f $(ELF_TARGET)
$(Q)rm -f $(OBJ)
.PHONY: clean
+1 -1
View File
@@ -16,7 +16,7 @@ else
endif
INCDIR = deps deps/stb deps/7zip libretro-common/include libretro-common/include/compat/zlib
CFLAGS = $(OPTIMIZE_LV) -ffast-math -fsingle-precision-constant
CFLAGS = $(OPTIMIZE_LV) -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
RARCH_DEFINES = -DPSP \
+1 -1
View File
@@ -12,7 +12,7 @@ else
endif
INCDIR = $(PSPPATH)/include libretro-common/include
CFLAGS = $(OPTIMIZE_LV) -ffast-math -fsingle-precision-constant
CFLAGS = $(OPTIMIZE_LV) -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
RARCH_DEFINES = -DPSP -DIS_SALAMANDER -DRARCH_CONSOLE
+31 -7
View File
@@ -120,7 +120,7 @@ OPK_NAME = retroarch_retrofw.opk
OBJ :=
LINK := $(CXX)
DEF_FLAGS := -march=mips32 -mtune=mips32 -mhard-float -ffast-math -fomit-frame-pointer
DEF_FLAGS := -march=mips32 -mtune=mips32 -mhard-float -fomit-frame-pointer
DEF_FLAGS += -mplt -mno-shared
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -DRETROFW=1 -MMD
@@ -164,7 +164,9 @@ CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
ifneq ($(V),1)
Q := @
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
@@ -182,9 +184,30 @@ X-OD-NeedsDownscaling=true
endef
export DESKTOP_ENTRY
all: $(TARGET) opk
define INFO
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CPPFLAGS: $(CPPFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEFINES: $(DEFINES)
LDFLAGS: $(LDFLAGS)
LIBRARY_DIRS: $(LIBRARY_DIRS)
LIBS: $(LIBS)
LINK: $(LINK)
OBJCFLAGS: $(OBJCFLAGS)
RARCH_OBJ: $(RARCH_OBJ)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
@@ -214,10 +237,11 @@ $(OBJDIR)/%.o: %.S $(HEADERS)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf $(OPK_NAME)
@$(if $(Q), echo $@,)
$(Q)rm -rf $(OBJDIR_BASE)
$(Q)rm -f $(TARGET)
$(Q)rm -f *.d
$(Q)rm -rf $(OPK_NAME)
opk: $(TARGET)
echo "$$DESKTOP_ENTRY" > default.retrofw.desktop
+30 -5
View File
@@ -166,7 +166,9 @@ CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
ifneq ($(V),1)
Q := @
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
@@ -186,6 +188,28 @@ export DESKTOP_ENTRY
all: $(TARGET) opk
define INFO
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CPPFLAGS: $(CPPFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEFINES: $(DEFINES)
LDFLAGS: $(LDFLAGS)
LIBRARY_DIRS: $(LIBRARY_DIRS)
LIBS: $(LIBS)
LINK: $(LINK)
OBJCFLAGS: $(OBJCFLAGS)
RARCH_OBJ: $(RARCH_OBJ)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
@@ -215,10 +239,11 @@ $(OBJDIR)/%.o: %.S $(HEADERS)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf $(OPK_NAME)
@$(if $(Q), echo $@,)
$(Q)rm -rf $(OBJDIR_BASE)
$(Q)rm -f $(TARGET)
$(Q)rm -f *.d
$(Q)rm -rf $(OPK_NAME)
opk: $(TARGET)
echo "$$DESKTOP_ENTRY" > default.rs90.desktop
+47 -15
View File
@@ -138,7 +138,7 @@ ifeq ($(HAVE_VITAGLES), 1)
ARCHFLAGS += -DSCE_LIBC_SIZE=$(SCE_LIBC_SIZE)
endif
CFLAGS += $(ARCHFLAGS) -mword-relocations -fno-optimize-sibling-calls
CFLAGS += $(ARCHFLAGS) -mword-relocations
ifeq ($(DEBUG), 1)
CFLAGS += -g -Og
@@ -147,9 +147,9 @@ else
endif
ASFLAGS := $(CFLAGS)
LDFLAGS := -Wl,-q
LDFLAGS := -Wl,-q,--pic-veneer
CFLAGS += -Wall -ffast-math
CFLAGS += -Wall
CFLAGS += -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DRARCH_CONSOLE
CFLAGS += -DHAVE_DSP_FILTER
CFLAGS += -DHAVE_VIDEO_FILTER
@@ -190,6 +190,10 @@ else
LIBS += -lretro_vita
endif
ifneq ($(V),1)
Q := @
endif
LIBS += $(WHOLE_END) $(VITA_LIBS) -lm -lc
TARGETS := $(TARGET).vpk
@@ -199,25 +203,51 @@ POSTCOMPILE = mv -f $*.Tdepend $*.depend
all: $(TARGETS)
define INFO
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEPFLAGS: $(DEPFLAGS)
INCDIRS: $(INCDIRS)
LD: $(LD)
LDFLAGS: $(LDFLAGS)
LIBDIRS: $(LIBDIRS)
LIBS: $(LIBS)
OBJ: $(OBJ)
POSTCOMPILE: $(POSTCOMPILE)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
%.o: %.cpp
%.o: %.cpp %.depend
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS)
$(Q)$(POSTCOMPILE)
%.o: %.c
%.o: %.c %.depend
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
$(Q)$(POSTCOMPILE)
%.o: %.S
%.o: %.S %.depend
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
$(Q)$(POSTCOMPILE)
%.o: %.s
%.o: %.s %.depend
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
$(POSTCOMPILE)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
$(Q)$(POSTCOMPILE)
%.depend: ;
@@ -228,7 +258,8 @@ liblibScePiglet_stub.a:
cp deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet/liblibScePiglet_stub.a .
$(TARGET).elf: $(OBJ) liblibScePiglet_stub.a
$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LD) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
%.velf: %.elf
cp $< $<.unstripped.elf
@@ -243,9 +274,10 @@ $(TARGET).elf: $(OBJ) liblibScePiglet_stub.a
vita-pack-vpk -s param.sfo -b $< $@
clean:
rm -f $(OBJ) $(TARGET).elf $(TARGET).elf.unstripped.elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
rm -rf deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet
rm -f $(OBJ:.o=.depend)
@$(if $(Q), echo $@,)
$(Q)rm -f $(OBJ) $(TARGET).elf $(TARGET).elf.unstripped.elf $(TARGET).velf $(TARGET).self param.sfo $(TARGET).vpk
$(Q)rm -rf deps/Pigs-In-A-Blanket/piglet_stub/libScePiglet
$(Q)rm -f $(OBJ:.o=.depend)
# Useful for developers
vpksend: $(TARGET).vpk
+1 -1
View File
@@ -14,7 +14,7 @@ PREFIX = arm-vita-eabi
CC = $(PREFIX)-gcc
INCDIR = libretro-common/include
CFLAGS = -Wl,-q $(OPTIMIZE_LV) -I$(INCDIR) -std=gnu99 -mfloat-abi=hard -ffast-math -fsingle-precision-constant -mword-relocations
CFLAGS = -Wl,-q $(OPTIMIZE_LV) -I$(INCDIR) -std=gnu99 -mfloat-abi=hard -fsingle-precision-constant -mword-relocations
ASFLAGS = $(CFLAGS)
RARCH_DEFINES = -DVITA -DIS_SALAMANDER -DRARCH_CONSOLE
+327 -271
View File
@@ -1,271 +1,327 @@
include version.all
ifneq ($(CROSS_COMPILE),arm-webos-linux-gnueabi-)
$(error You need webOS toolchain to build this. See https://github.com/webosbrew/native-toolchain)
endif
ifdef SDKTARGETSYSROOT
$(warning OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain)
STAGING_DIR = $(SDKTARGETSYSROOT)
else ifndef STAGING_DIR
$(error Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain)
endif
WEBOS_FREETYPE_CONFIG ?= $(STAGING_DIR)/usr/bin/freetype-config
WEBOS_INC_DIR ?= $(STAGING_DIR)/usr/include
WEBOS_LIB_DIR ?= $(STAGING_DIR)/usr/lib
ADD_SDL2_LIB ?= 0
SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.0-webos.2/SDL2-2.30.0-webos.tar.gz
#########################
#########################
PACKAGE_NAME = com.retroarch
PACKAGE_VERSION := $(patsubst "%",%,$(RARCH_VERSION))
DEBUG ?= 0
HAVE_CLOUDSYNC = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_7ZIP = 1
HAVE_ACCESSIBILITY = 1
HAVE_AL = 0
# ALSA freezes when switching back from menu
HAVE_ALSA = 0
HAVE_ANGLE = 0
HAVE_AUDIOIO = 0
HAVE_AUDIOMIXER = 1
HAVE_BLISSBOX = 0
HAVE_BSV_MOVIE = 1
HAVE_BUILTINBEARSSL = 0
HAVE_BUILTINFLAC = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 1
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_NEAREST_RESAMPLER = 1
HAVE_CHD = 1
HAVE_COMMAND = 1
HAVE_CXX = 1
HAVE_DR_MP3 = 1
HAVE_DYNAMIC = 1
HAVE_DYLIB = 1
HAVE_EGL = 0
HAVE_FREETYPE = 0
HAVE_GDI = 1
HAVE_GETADDRINFO = 1
HAVE_GETOPT_LONG = 1
HAVE_GLSL = 1
HAVE_GLSLANG = 0
HAVE_GLSLANG_HLSL = 0
HAVE_GLSLANG_OGLCOMPILER = 0
HAVE_GLSLANG_OSDEPENDENT = 0
HAVE_GLSLANG_SPIRV = 0
HAVE_GLSLANG_SPIRV_TOOLS = 0
HAVE_GLSLANG_SPIRV_TOOLS_OPT = 0
HAVE_HID = 1
HAVE_IBXM = 1
HAVE_IMAGEVIEWER = 1
HAVE_LANGEXTRA = 1
HAVE_LIBRETRODB = 1
HAVE_MENU = 1
HAVE_MENU_COMMON = 1
HAVE_NEON = 1
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_NETWORK_CMD = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETWORKGAMEPAD = 1
HAVE_GFX_WIDGETS = 1
HAVE_MMAP = 1
HAVE_ONLINE_UPDATER = 1
HAVE_OPENDINGUX_FBDEV = 0
HAVE_OPENGL = 0
HAVE_OPENGL1 = 0
HAVE_OPENGL_CORE = 0
HAVE_OPENGLES = 1
HAVE_OPENGLES3 = 0
HAVE_OPENGLES3_1 = 0
HAVE_OPENGLES3_2 = 0
HAVE_OPENSSL = 0
HAVE_OVERLAY = 1
HAVE_PULSE = 1
HAVE_RBMP = 1
HAVE_RJPEG = 1
HAVE_RPILED = 0
HAVE_RPNG = 1
HAVE_RUNAHEAD = 1
HAVE_SDL = 0
HAVE_SDL2 = 1
HAVE_SHADERPIPELINE = 1
HAVE_STB_FONT = 1
HAVE_STB_IMAGE = 1
HAVE_STB_VORBIS = 1
HAVE_STDIN_CMD = 1
HAVE_STRCASESTR = 1
HAVE_THREADS = 1
HAVE_UDEV = 0
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
HAVE_XMB = 1
HAVE_OZONE = 1
HAVE_ZLIB = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_CHEEVOS = 1
HAVE_LIBSHAKE = 1
HAVE_UPDATE_ASSETS = 1
HAVE_UPDATE_CORES = 1
HAVE_UPDATE_CORE_INFO = 1
HAVE_CORE_INFO_CACHE = 1
OS = Linux
TARGET = retroarch
OBJ :=
LINK := $(CC)
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
LIBS := -ldl -lz -lrt -pthread
CFLAGS :=
CXXFLAGS := -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS :=
LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections
INCLUDE_DIRS = -I$(WEBOS_INC_DIR)
LIBRARY_DIRS = -L$(WEBOS_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1 -D_GNU_SOURCE
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_SDL2
DEFINES += -DHAVE_PULSE
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
DEFINES += -DHAVE_UPDATE_CORE_INFO
PKG_CONFIG=pkg-config
SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2)
SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2)
OPENGLES_LIBS = -lGLESv2
PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse)
MMAP_LIBS = -lc
NEON_CFLAGS = -mfpu=neon
NEON_ASFLAGS = -mfpu=neon
NETWORKING_LIBS = -lc
OBJDIR_BASE := obj-unix
ifeq ($(DEBUG), 1)
OBJDIR := $(OBJDIR_BASE)/debug
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
else
OBJDIR := $(OBJDIR_BASE)/release
DEF_FLAGS += -O2 -DNDEBUG
endif
include Makefile.common
DEF_FLAGS += $(INCLUDE_DIRS)
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
Q := @
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
define APPINFO
{
"id": "$(PACKAGE_NAME)",
"version": "$(PACKAGE_VERSION)",
"vendor": "webosbrew.org",
"title": "RetroArch",
"icon": "icon160.png",
"main": "retroarch",
"iconColor": "#333333",
"type": "native",
"appDescription": "Emulation frontend"
}
endef
export APPINFO
all: $(TARGET) ipk
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
$(TARGET): $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.m
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo OBJC $<),)
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.S $(HEADERS)
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo AS $<),)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -rf $(OBJDIR_BASE)
rm -f $(TARGET)
rm -f *.d
rm -rf SDL
rm -rf webos/*.ipk
rm -rf webos/dist
sdl2: $(TARGET)
ifeq ($(ADD_SDL2_LIB), 1)
@echo "Downloading SDL2 prebuilt"
mkdir -p SDL
wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf -
endif
ipk: $(TARGET) sdl2
rm -rf webos/dist
mkdir -p webos/dist/lib
echo "$$APPINFO" > webos/dist/appinfo.json
cp -t webos/dist -vf $(TARGET) webos/icon160.png
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libstdc++.so.6
ifeq ($(ADD_SDL2_LIB), 1)
cp -t webos/dist/lib -vf SDL/lib/libSDL2-2.0.so.0
endif
$(STRIP) webos/dist/$(TARGET)
cd webos && ares-package dist
install: ipk
ares-install webos/$(PACKAGE_NAME)_$(PACKAGE_VERSION)_$(ARCH).ipk
launch: install
ares-launch com.retroarch
.PHONY: all clean ipk
print-%:
@echo '$*=$($*)'
include version.all
ifneq ($(filter $(CROSS_COMPILE),arm-webos-linux-gnueabi- aarch64-webos-linux-gnu-),$(CROSS_COMPILE))
$(error You need webOS toolchain to build this. See https://github.com/webosbrew/native-toolchain)
endif
ifdef SDKTARGETSYSROOT
$(warning "OE-based toolchain isn't supported anymore. Please use https://github.com/webosbrew/native-toolchain")
STAGING_DIR = $(SDKTARGETSYSROOT)
else ifndef STAGING_DIR
$(error "Can't find buildroot based toolchain. Please use https://github.com/webosbrew/native-toolchain")
endif
WEBOS_FREETYPE_CONFIG ?= $(STAGING_DIR)/usr/bin/freetype-config
WEBOS_INC_DIR ?= $(STAGING_DIR)/usr/include
WEBOS_USR_LIB_DIR ?= $(STAGING_DIR)/usr/lib
WEBOS_LIB_DIR ?= $(STAGING_DIR)/lib
ADD_SDL2_LIB ?= 0
SDL2_PREBUILT_ARCHIVE ?= https://github.com/webosbrew/SDL-webOS/releases/download/release-2.30.12-webos.1/SDL2-2.30.12-webos-abi.tar.gz
#########################
#########################
APP_PACKAGE_NAME ?= com.retroarch.webos
IPK_VERSION := $(shell grep '#define PACKAGE_VERSION' version.all | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/')
DEBUG ?= 0
HAVE_CLOUDSYNC = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_7ZIP = 1
HAVE_ACCESSIBILITY = 1
HAVE_AL = 0
# ALSA freezes when switching back from menu
HAVE_ALSA = 0
HAVE_ANGLE = 0
HAVE_AUDIOIO = 0
HAVE_AUDIOMIXER = 1
HAVE_BLISSBOX = 0
HAVE_BSV_MOVIE = 1
HAVE_BUILTINBEARSSL = 0
HAVE_BUILTINFLAC = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_BUILTINMBEDTLS = 1
HAVE_BUILTINZLIB = 1
HAVE_C99 = 1
HAVE_CC = 1
HAVE_CC_RESAMPLER = 1
HAVE_NEAREST_RESAMPLER = 1
HAVE_CHD = 1
HAVE_COMMAND = 1
HAVE_CXX = 1
HAVE_DR_MP3 = 1
HAVE_DYNAMIC = 1
HAVE_DYLIB = 1
HAVE_EGL = 0
HAVE_FREETYPE = 1
HAVE_GDI = 0
HAVE_GETADDRINFO = 1
HAVE_GETOPT_LONG = 1
HAVE_GLSL = 1
HAVE_GLSLANG = 0
HAVE_GLSLANG_HLSL = 0
HAVE_GLSLANG_OGLCOMPILER = 0
HAVE_GLSLANG_OSDEPENDENT = 0
HAVE_GLSLANG_SPIRV = 0
HAVE_GLSLANG_SPIRV_TOOLS = 0
HAVE_GLSLANG_SPIRV_TOOLS_OPT = 0
HAVE_HID = 1
HAVE_IBXM = 1
HAVE_IMAGEVIEWER = 1
HAVE_LANGEXTRA = 1
HAVE_LIBRETRODB = 1
HAVE_MENU = 1
HAVE_MENU_COMMON = 1
HAVE_NEON = 0
HAVE_NETWORKING = 1
HAVE_IFINFO = 1
HAVE_NETWORK_CMD = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_NETWORKGAMEPAD = 1
HAVE_GFX_WIDGETS = 1
HAVE_MMAP = 1
HAVE_ONLINE_UPDATER = 1
HAVE_OPENDINGUX_FBDEV = 0
HAVE_OPENGL = 0
HAVE_OPENGL1 = 0
HAVE_OPENGL_CORE = 0
HAVE_OPENGLES = 1
HAVE_OPENGLES3 = 0
HAVE_OPENGLES3_1 = 0
HAVE_OPENGLES3_2 = 0
HAVE_OPENSSL = 0
HAVE_OVERLAY = 1
HAVE_PULSE = 1
HAVE_RBMP = 1
HAVE_RJPEG = 1
HAVE_RPILED = 0
HAVE_RPNG = 1
HAVE_RUNAHEAD = 1
HAVE_SDL = 0
HAVE_SDL2 = 1
HAVE_SHADERPIPELINE = 1
HAVE_STB_FONT = 0
HAVE_STB_IMAGE = 1
HAVE_STB_VORBIS = 1
HAVE_STDIN_CMD = 1
HAVE_STRCASESTR = 1
HAVE_THREADS = 1
HAVE_UDEV = 0
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
HAVE_XMB = 1
HAVE_OZONE = 1
HAVE_ZLIB = 1
HAVE_ZSTD = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_CHEEVOS = 1
HAVE_LIBSHAKE = 1
HAVE_UPDATE_ASSETS = 1
HAVE_UPDATE_CORES = 1
HAVE_UPDATE_CORE_INFO = 1
HAVE_CORE_INFO_CACHE = 1
OS = Linux
TARGET = retroarch
OBJ :=
LINK := $(CC)
DEF_FLAGS += -ffunction-sections -fdata-sections
DEF_FLAGS += -I. -Ideps -Ideps/stb -DWEBOS=1 -MMD
DEF_FLAGS += -Wall -Wno-unused-variable
LIBS := -ldl -lz -lrt -pthread
ifeq ($(findstring arm64,$(ARCH)),arm64)
ARCHFLAGS := -mcpu=cortex-a53
else
ARCHFLAGS := -mcpu=cortex-a9 -mtune=cortex-a53 -mfloat-abi=softfp
HAVE_NEON = 1
endif
CFLAGS := $(ARCHFLAGS)
CXXFLAGS := $(ARCHFLAGS) -fno-exceptions -fno-rtti -std=c++11 -D__STDC_CONSTANT_MACROS
ASFLAGS := $(ARCHFLAGS)
LDFLAGS := -Wl,-rpath=\$$ORIGIN/lib,--gc-sections
INCLUDE_DIRS = -I$(WEBOS_INC_DIR)
LIBRARY_DIRS = -L$(WEBOS_USR_LIB_DIR)
DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1 -D_GNU_SOURCE
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_SDL2
DEFINES += -DHAVE_PULSE
DEFINES += -DHAVE_NETWORKING -DHAVE_IFINFO -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORES
DEFINES += -DHAVE_NETWORKGAMEPAD
DEFINES += -DHAVE_FREETYPE
DEFINES += -DHAVE_UPDATE_CORE_INFO
ifneq (,$(filter 1,$(HAVE_OPENGLES3) $(HAVE_OPENGLES3_1) $(HAVE_OPENGLES3_2)))
DEFINES += -DHAVE_OPENGLES3
endif
ifeq ($(HAVE_OPENGLES3_1),1)
DEFINES += -DHAVE_OPENGLES3_1
endif
ifeq ($(HAVE_OPENGLES3_2),1)
DEFINES += -DHAVE_OPENGLES3_2
endif
PKG_CONFIG=pkg-config
SDL2_CFLAGS := $(shell $(PKG_CONFIG) --cflags sdl2)
SDL2_LIBS := $(shell $(PKG_CONFIG) --libs sdl2)
OPENGLES_LIBS = -lGLESv2
PULSE_LIBS = $(shell $(PKG_CONFIG) --libs libpulse)
FREETYPE_CFLAGS := $(shell $(PKG_CONFIG) --cflags freetype2)
FREETYPE_LIBS := $(shell $(PKG_CONFIG) --libs freetype2)
FONTCONFIG_CFLAGS := $(shell $(PKG_CONFIG) --cflags fontconfig)
FONTCONFIG_LIBS := $(shell $(PKG_CONFIG) --libs fontconfig)
MMAP_LIBS = -lc
ifeq ($(HAVE_NEON),1)
NEON_CFLAGS += -mfpu=neon
NEON_ASFLAGS += -mfpu=neon
endif
NETWORKING_LIBS = -lc
OBJDIR_BASE := obj-unix
ifeq ($(DEBUG), 1)
OBJDIR := $(OBJDIR_BASE)/debug
DEF_FLAGS += -O0 -g -DDEBUG -D_DEBUG
else
OBJDIR := $(OBJDIR_BASE)/release
DEF_FLAGS += -O2 -DNDEBUG
endif
include Makefile.common
DEF_FLAGS += $(INCLUDE_DIRS)
LDFLAGS += $(CFLAGS) $(CXXFLAGS) $(DEF_FLAGS)
CFLAGS += $(DEF_FLAGS)
CXXFLAGS += $(DEF_FLAGS)
HEADERS = $(wildcard */*/*.h) $(wildcard */*.h) $(wildcard *.h)
ifneq ($(V),1)
Q := @
endif
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))
define APPINFO
{
"id": "$(APP_PACKAGE_NAME)",
"version": "$(IPK_VERSION)",
"vendor": "webosbrew.org",
"title": "RetroArch",
"icon": "icon160.png",
"main": "retroarch",
"iconColor": "#333333",
"type": "native",
"appDescription": "Emulation frontend",
"cloudgame_active": true,
"useAllMouseButtons": true,
"useAllKeyboardKeys": true
}
endef
export APPINFO
all: $(TARGET) ipk
define INFO
ASFLAGS: $(ASFLAGS)
CC: $(CC)
CFLAGS: $(CFLAGS)
CPPFLAGS: $(CPPFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEFINES: $(DEFINES)
LDFLAGS: $(LDFLAGS)
LIBRARY_DIRS: $(LIBRARY_DIRS)
LIBS: $(LIBS)
LINK: $(LINK)
OBJCFLAGS: $(OBJCFLAGS)
RARCH_OBJ: $(RARCH_OBJ)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
-include $(RARCH_OBJ:.o=.d)
SYMBOL_MAP := -Wl,-Map=output.map
$(TARGET): $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)
$(OBJDIR)/%.o: %.c
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
$(OBJDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.m
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo OBJC $<),)
$(Q)$(CXX) $(OBJCFLAGS) $(DEFINES) -MMD -c -o $@ $<
$(OBJDIR)/%.o: %.S $(HEADERS)
@mkdir -p $(dir $@)
@$(if $(Q), $(shell echo echo AS $<),)
$(Q)$(CC) $(CFLAGS) $(ASFLAGS) $(DEFINES) -c -o $@ $<
clean:
@$(if $(Q), echo $@,)
$(Q)rm -rf $(OBJDIR_BASE)
$(Q)rm -f $(TARGET)
$(Q)rm -f *.d
$(Q)rm -rf SDL
$(Q)rm -rf webos/*.ipk
$(Q)rm -rf webos/dist
sdl2: $(TARGET)
ifeq ($(ADD_SDL2_LIB), 1)
@echo "Downloading SDL2 prebuilt"
mkdir -p SDL
wget -qO - $(SDL2_PREBUILT_ARCHIVE) | tar -C SDL -zxvf -
endif
ipk: $(TARGET) sdl2
rm -rf webos/dist
mkdir -p webos/dist/lib
echo "$$APPINFO" > webos/dist/appinfo.json
cp -t webos/dist -vf $(TARGET) webos/icon160.png
cp -t webos/dist/lib -vf $(WEBOS_USR_LIB_DIR)/libstdc++.so.6
cp -t webos/dist/lib -vf $(WEBOS_LIB_DIR)/libatomic.so.1
ifeq ($(ADD_SDL2_LIB), 1)
cp -t webos/dist/lib -vf SDL/lib/libSDL2-2.0.so.0
endif
ifneq ($(DEBUG), 1)
$(STRIP) webos/dist/$(TARGET)
endif
cd webos && ares-package dist
install: ipk
ares-install webos/$(APP_PACKAGE_NAME)_$(IPK_VERSION)_$(ARCH).ipk
launch: install
ares-launch $(APP_PACKAGE_NAME)
.PHONY: all clean ipk
print-%:
@echo '$*=$($*)'
+30 -6
View File
@@ -61,6 +61,7 @@ LIBS := $(WHOLE_START) $(LIB_CORE) $(WHOLE_END)
libogc_platform := 1
EXTERNAL_LIBOGC ?= 0
HAVE_OGG_OGC ?= 0
GX_PTHREAD_LEGACY ?= 1
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
@@ -105,6 +106,10 @@ ifeq ($(BIG_STACK), 1)
LDFLAGS += -T bootstrap/gx/rvl.ld
endif
ifeq ($(HAVE_OGG_OGC), 1)
LIBS += -L$(DEVKITPRO)/portlibs/ppc/lib -lvorbisfile -lvorbis -logg
endif
ifeq ($(EXTERNAL_LIBOGC), 1)
LIBS += -lfat
endif
@@ -265,12 +270,28 @@ ifeq ($(LOAD_WITHOUT_CORE_INFO),1)
CFLAGS += -DLOAD_WITHOUT_CORE_INFO
endif
ifneq ($(V),1)
Q := @
endif
OBJOUT = -o
LINKOUT = -o
LINK = $(CXX)
all: $(EXT_TARGET)
define INFO
CC: $(CC)
CFLAGS: $(CFLAGS)
OBJOUT: $(OBJOUT)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
%.dol: %.elf
$(ELF2DOL) $< $@
@@ -278,13 +299,15 @@ $(EXT_INTER_TARGET): $(OBJ)
$(LINK) $(LINKOUT)$@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(PLATEXTRA) $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.cpp
$(CXX) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.S
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.binobj: %.bin
$(LD) -r -b binary $(OBJOUT)$@ $<
@@ -294,10 +317,11 @@ $(APP_BOOTER_DIR)/app_booter.bin:
$(MAKE) -C $(APP_BOOTER_DIR)
clean:
rm -f $(EXT_TARGET)
rm -f $(EXT_INTER_TARGET)
rm -f $(OBJ)
$(MAKE) -C $(APP_BOOTER_DIR) clean
@$(if $(Q), echo $@,)
$(Q)rm -f $(EXT_TARGET)
$(Q)rm -f $(EXT_INTER_TARGET)
$(Q)rm -f $(OBJ)
$(Q)$(MAKE) -C $(APP_BOOTER_DIR) clean
.PHONY: clean
+32 -1
View File
@@ -203,7 +203,7 @@ INCDIRS += -Iwiiu
INCDIRS += -Iwiiu/include
CFLAGS := -mcpu=750 -meabi -mhard-float
CFLAGS += -ffast-math -Werror=implicit-function-declaration
CFLAGS += -Werror=implicit-function-declaration
CFLAGS += -ffunction-sections -fdata-sections
#CFLAGS += -fomit-frame-pointer -mword-relocations
CFLAGS += -Wall
@@ -304,6 +304,37 @@ DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILD_DIR)/$*.depend
all: $(TARGETS)
define INFO
AR: $(AR)
ASFLAGS: $(ASFLAGS)
BUILD_DIR: $(BUILD_DIR)
CC: $(CC)
CFLAGS: $(CFLAGS)
CXX: $(CXX)
CXXFLAGS: $(CXXFLAGS)
DEFINES: $(DEFINES)
DEPFLAGS: $(DEPFLAGS)
ELF2RPL: $(ELF2RPL)
HBL_ELF_LDFLAGS: $(HBL_ELF_LDFLAGS)
HBL_ELF_OBJ: $(HBL_ELF_OBJ)
INCDIRS: $(INCDIRS)
LD: $(LD)
LDFLAGS: $(LDFLAGS)
LIBDIRS: $(LIBDIRS)
LIBS: $(LIBS)
MAKE: $(MAKE)
OBJ: $(OBJ)
RPX_LDFLAGS: $(RPX_LDFLAGS)
RPX_OBJ: $(RPX_OBJ)
TARGET: $(TARGET)
endef
export INFO
info:
ifneq ($(V),1)
@echo "$$INFO"
endif
%: $(BUILD_DIR)/%
cp $< $@
+3 -2
View File
@@ -89,6 +89,7 @@ AVUTIL_LIBS := -lavutil
SWSCALE_LIBS := -lswscale
AVFORMAT_LIBS := -lavformat
SWRESAMPLE_LIBS := -lswresample
AVDEVICE_LIBS := -lavdevice
FFMPEG_LIBS := -lws2_32 -lz
endif
@@ -131,8 +132,8 @@ ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
CXXFLAGS += -O0 -g
else
CFLAGS += -O3 -ffast-math
CXXFLAGS += -O3 -ffast-math
CFLAGS += -O3
CXXFLAGS += -O3
endif
CFLAGS += $(DEF_FLAGS) -Wall -Wno-unused-result -Wno-unused-variable -I. -Ideps
+1
View File
@@ -73,6 +73,7 @@ RetroArch has been ported to the following platforms:
- Emscripten (WebAssembly and JavaScript)
- FreeBSD
- Haiku
- LG webOS
- Linux
- Original Microsoft Xbox
- Microsoft Xbox 360 (Libxenon/XeXDK)
+26
View File
@@ -0,0 +1,26 @@
# Security Policy
## Reasonable expectations
RetroArch is a frontend for the libretro API. The main functionality is fulfilled by invoking other binary libraries ("cores") which are not restricted by RetroArch in any way. Cores are able to read/write/delete files, spawn processes, communicate over the network. Also, source for cores is not necessarily in control by libretro team, and core binaries / RetroArch binaries are not signed. For this reason, it is a bad idea to use RetroArch or any other libretro frontend on security critical systems.
Also, RetroArch and cores have been packaged in several ways. Content on the [official download site](https://buildbot.libretro.com/) is built from a direct mirror of the original RetroArch and core repositories, no binaries are reused. Note that source for the core repositories may be outside libretro team control.
## Supported Versions
For most delivery channels, libretro team does not have control over the version. The exceptions are:
- [official download site](https://buildbot.libretro.com/)
- Steam release
- Apple App Store release
- various Android app store releases
- note that Google Play Store version is years behind and can not be updated
You may report vulnerability against any recent version, but be reasonable.
## Reporting a Vulnerability
Please report security vulnerabilities at libretro@gmail.com
## Possible remediation
Due to the variety of delivery channels, RetroArch team can not recall any given version universally. Security fixes are accepted for next release, and notice may be posted in the channels controlled by RetroArch team, depending on the severity assessed by RetroArch team.
+216
View File
@@ -0,0 +1,216 @@
#include "game_ai.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <dlfcn.h>
#endif
#include <retro_assert.h>
#include <compat/strl.h>
#include "../deps/game_ai_lib/GameAI.h"
#define GAME_AI_MAX_PLAYERS 2
void * ga = NULL;
volatile void * g_ram_ptr = NULL;
volatile int g_ram_size = 0;
volatile signed short int g_buttons_bits[GAME_AI_MAX_PLAYERS] = {0};
volatile int g_frameCount = 0;
volatile char game_ai_lib_path[1024] = {0};
volatile char g_game_name[1024] = {0};
retro_log_printf_t g_log = NULL;
#ifdef _WIN32
HINSTANCE g_lib_handle = NULL;
#else
void * g_lib_handle = NULL;
#endif
/* GameAI Lib API*/
create_game_ai_t create_game_ai = NULL;
destroy_game_ai_t destroy_game_ai = NULL;
game_ai_lib_init_t game_ai_lib_init = NULL;
game_ai_lib_think_t game_ai_lib_think = NULL;
game_ai_lib_set_show_debug_t game_ai_lib_set_show_debug = NULL;
game_ai_lib_set_debug_log_t game_ai_lib_set_debug_log = NULL;
/* Helper functions */
void game_ai_debug_log(int level, const char *fmt, ...)
{
va_list vp;
va_start(vp, fmt);
if (g_log)
g_log((enum retro_log_level)level, fmt, vp);
va_end(vp);
}
void array_to_bits_16(volatile signed short *result, const bool b[16])
{
for (int bit = 0; bit <= 15; bit++)
*result |= b[bit] ? (1 << bit) : 0;
}
/* Interface to RA */
signed short int game_ai_input(unsigned int port, unsigned int device,
unsigned int idx, unsigned int id, signed short int result)
{
if (ga && (port < GAME_AI_MAX_PLAYERS))
return g_buttons_bits[port];
return 0;
}
void game_ai_init(void)
{
if (!create_game_ai)
{
#ifdef _WIN32
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
g_lib_handle = LoadLibrary(TEXT("game_ai.dll"));
retro_assert(hinstLib);
char full_module_path[MAX_PATH];
DWORD dwLen = GetModuleFileNameA(g_lib_handle, static_cast<char*>(&full_module_path), MAX_PATH);
if (hinstLib)
{
create_game_ai = (create_game_ai_t) GetProcAddress(hinstLib, "create_game_ai");
retro_assert(create_game_ai);
destroy_game_ai = (destroy_game_ai_t) GetProcAddress(hinstLib, "destroy_game_ai");
retro_assert(destroy_game_ai);
game_ai_lib_init = (game_ai_lib_init_t) GetProcAddress(hinstLib, "game_ai_lib_init");
retro_assert(game_ai_lib_init);
game_ai_lib_think = (game_ai_lib_think_t) GetProcAddress(hinstLib, "game_ai_lib_think");
retro_assert(game_ai_lib_think);
game_ai_lib_set_show_debug = (game_ai_lib_set_show_debug_t) GetProcAddress(hinstLib, "game_ai_lib_set_show_debug");
retro_assert(game_ai_lib_set_show_debug);
game_ai_lib_set_debug_log = (game_ai_lib_set_debug_log_t) GetProcAddress(hinstLib, "game_ai_lib_set_debug_log");
retro_assert(game_ai_lib_set_debug_log);
}
#else
g_lib_handle = dlopen("./libgame_ai.so", RTLD_NOW);
retro_assert(g_lib_handle);
if (g_lib_handle)
{
dlinfo(g_lib_handle, RTLD_DI_ORIGIN, (void *) &game_ai_lib_path);
create_game_ai = (create_game_ai_t)(dlsym(g_lib_handle, "create_game_ai"));
retro_assert(create_game_ai);
destroy_game_ai = (destroy_game_ai_t)(dlsym(g_lib_handle, "destroy_game_ai"));
retro_assert(destroy_game_ai);
game_ai_lib_init = (game_ai_lib_init_t)(dlsym(g_lib_handle, "game_ai_lib_init"));
retro_assert(game_ai_lib_init);
game_ai_lib_think = (game_ai_lib_think_t)(dlsym(g_lib_handle, "game_ai_lib_think"));
retro_assert(game_ai_lib_think);
game_ai_lib_set_show_debug = (game_ai_lib_set_show_debug_t)(dlsym(g_lib_handle, "game_ai_lib_set_show_debug"));
retro_assert(game_ai_lib_set_show_debug);
game_ai_lib_set_debug_log = (game_ai_lib_set_debug_log_t)(dlsym(g_lib_handle, "game_ai_lib_set_debug_log"));
retro_assert(game_ai_lib_set_debug_log);
}
#endif
}
}
void game_ai_shutdown(void)
{
if (g_lib_handle)
{
if (ga)
{
destroy_game_ai(ga);
ga = NULL;
}
#ifdef _WIN32
FreeLibrary(g_lib_handle);
#else
dlclose(g_lib_handle);
#endif
}
}
void game_ai_load(const char * name, void * ram_ptr, int ram_size, retro_log_printf_t log)
{
strcpy((char *) &g_game_name[0], name);
g_ram_ptr = ram_ptr;
g_ram_size = ram_size;
g_log = log;
if (ga)
{
destroy_game_ai(ga);
ga = NULL;
}
}
void game_ai_think(bool override_p1, bool override_p2, bool show_debug,
const void *frame_data, unsigned int frame_width, unsigned int frame_height,
unsigned int frame_pitch, unsigned int pixel_format)
{
if (ga)
game_ai_lib_set_show_debug(ga, show_debug);
if (!ga && g_ram_ptr)
{
ga = create_game_ai((char *) &g_game_name[0]);
retro_assert(ga);
if (ga)
{
char data_path[1024] = {0};
strcpy(&data_path[0], (char *)game_ai_lib_path);
strcat(&data_path[0], "/data/");
strcat(&data_path[0], (char *)g_game_name);
game_ai_lib_init(ga, (void *) g_ram_ptr, g_ram_size);
game_ai_lib_set_debug_log(ga, game_ai_debug_log);
}
}
if (g_frameCount >= (GAMEAI_SKIPFRAMES - 1))
{
if (ga)
{
bool b[GAMEAI_MAX_BUTTONS] = {0};
g_buttons_bits[0]=0;
g_buttons_bits[1]=0;
if (override_p1)
{
game_ai_lib_think(ga, b, 0, frame_data, frame_width, frame_height, frame_pitch, pixel_format);
array_to_bits_16(&g_buttons_bits[0], b);
}
if (override_p2)
{
game_ai_lib_think(ga, b, 1, frame_data, frame_width, frame_height, frame_pitch, pixel_format);
array_to_bits_16(&g_buttons_bits[1], b);
}
}
g_frameCount=0;
}
else
g_frameCount++;
}
+23 -21
View File
@@ -1,7 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* copyright (c) 2011-2015 - Daniel De Matteis
* copyright (c) 2016-2019 - Brad Parker
* Copyright (C) 2011-2016 - Daniel De Matteis
* Copyright (C) 2021 - David G.F.
*
* 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-
@@ -15,28 +15,30 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __VGA_DEFINES_H
#define __VGA_DEFINES_H
#ifndef RARCH_GAME_AI_H__
#define RARCH_GAME_AI_H__
#define VGA_WIDTH 320
#define VGA_HEIGHT 200
#include <boolean.h>
#include <retro_common_api.h>
typedef struct vga
{
unsigned char *vga_menu_frame;
unsigned char *vga_frame;
#include <libretro.h>
unsigned vga_menu_width;
unsigned vga_menu_height;
unsigned vga_menu_pitch;
unsigned vga_menu_bits;
unsigned vga_video_width;
unsigned vga_video_height;
unsigned vga_video_pitch;
unsigned vga_video_bits;
RETRO_BEGIN_DECLS
bool color;
bool vga_rgb32;
} vga_t;
signed short int game_ai_input(unsigned int port, unsigned int device,
unsigned int idx, unsigned int id, signed short int result);
void game_ai_init(void);
void game_ai_shutdown(void);
void game_ai_load(const char * name, void * ram_ptr,
int ram_size, retro_log_printf_t log);
void game_ai_think(bool override_p1, bool override_p2, bool show_debug,
const void *frame_data, unsigned int frame_w, unsigned int frame_h,
unsigned int frame_pitch, unsigned int pixel_format);
RETRO_END_DECLS
#endif
+8 -14
View File
@@ -21,23 +21,11 @@
RETRO_BEGIN_DECLS
#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
#define AUDIO_MIN_RATIO 0.0625
#define AUDIO_MIXER_MAX_STREAMS 16
#define AUDIO_MIXER_MAX_SYSTEM_STREAMS (AUDIO_MIXER_MAX_STREAMS + 8)
/* Fastforward timing calculations running average samples. Helps with a
consistent pitch when fast-forwarding. */
#define AUDIO_FF_EXP_AVG_SAMPLES 16
/* do not define more than (MAX_SYSTEM_STREAMS - MAX_STREAMS) */
/* Do not define more than (MAX_SYSTEM_STREAMS - MAX_STREAMS) */
enum audio_mixer_system_slot
{
AUDIO_MIXER_SYSTEM_SLOT_OK = AUDIO_MIXER_MAX_STREAMS,
@@ -161,7 +149,13 @@ enum audio_driver_state_flags
* @see audio_driver_t::write_avail
* @see audio_driver_t::buffer_size
*/
AUDIO_FLAG_CONTROL = (1 << 5)
AUDIO_FLAG_CONTROL = (1 << 5),
/**
* Indicates that the audio driver is forcing gain to 0.
* Used for temporary rewind and fast-forward muting.
*/
AUDIO_FLAG_MUTED = (1 << 6)
};
typedef struct audio_statistics
+1000 -177
View File
File diff suppressed because it is too large. Load diff
+7 -21
View File
@@ -110,7 +110,7 @@ typedef struct audio_driver
* Unless said otherwise with set_nonblock_state(), all writes
* are blocking, and it should block till it has written all frames.
*/
ssize_t (*write)(void *data, const void *buf, size_t size);
ssize_t (*write)(void *data, const void *s, size_t len);
/**
* Temporarily pauses the audio driver.
@@ -169,8 +169,8 @@ typedef struct audio_driver
typedef struct
{
double source_ratio_original;
double source_ratio_current;
double src_ratio_orig;
double src_ratio_curr;
uint64_t free_samples_count;
@@ -320,17 +320,6 @@ bool audio_driver_start(bool is_shutdown);
bool audio_driver_stop(void);
/**
* If you need to query the size of audio samples,
* use this function instead of checking the flags directly.
*
* @return The size of a single audio sample in bytes,
* as determined by the presence of the \c AUDIO_FLAG_USE_FLOAT flag.
* Will currently return either 2 (for \c uint16_t) or 4 (for \c float),
* although this may change if we add support for more sample types.
*/
unsigned audio_driver_get_sample_size(void);
#ifdef HAVE_TRANSLATE
/* TODO/FIXME - Doesn't currently work. Fix this. */
bool audio_driver_is_ai_service_speech_running(void);
@@ -344,16 +333,12 @@ bool audio_driver_is_ai_service_speech_running(void);
**/
bool audio_compute_buffer_statistics(audio_statistics_t *stats);
bool audio_driver_init_internal(
void *settings_data,
bool audio_cb_inited);
bool audio_driver_init_internal(void *data, bool audio_cb_inited);
bool audio_driver_deinit(void);
bool audio_driver_find_driver(
void *settings_data,
const char *prefix,
bool verbosity_enabled);
bool audio_driver_find_driver(const char *audio_drv,
const char *prefix, bool verbosity_enabled);
/**
* audio_driver_sample:
@@ -441,6 +426,7 @@ extern audio_driver_t audio_switch_thread;
extern audio_driver_t audio_switch_libnx_audren;
extern audio_driver_t audio_switch_libnx_audren_thread;
extern audio_driver_t audio_rwebaudio;
extern audio_driver_t audio_audioworklet;
audio_driver_state_t *audio_state_get_ptr(void);
+6 -10
View File
@@ -99,7 +99,7 @@ static void audio_thread_loop(void *data)
thr->driver->stop(thr->driver_data);
while (thr->stopped)
{
/* If we stop right after start,
/* If we stop right after start,
* we might not be able to properly ack.
* Signal in the loop instead. */
thr->stopped_ack = true;
@@ -249,25 +249,21 @@ static bool audio_thread_use_float(void *data)
return thr->use_float;
}
static ssize_t audio_thread_write(void *data, const void *buf, size_t size)
static ssize_t audio_thread_write(void *data, const void *s, size_t len)
{
ssize_t ret;
ssize_t _len;
audio_thread_t *thr = (audio_thread_t*)data;
if (!thr)
return 0;
ret = thr->driver->write(thr->driver_data, buf, size);
if (ret < 0)
_len = thr->driver->write(thr->driver_data, s, len);
if (_len < 0)
{
slock_lock(thr->lock);
thr->alive = false;
scond_signal(thr->cond);
slock_unlock(thr->lock);
}
return ret;
return _len;
}
static const audio_driver_t audio_thread = {
+41 -40
View File
@@ -44,11 +44,11 @@ int alsa_init_pcm(snd_pcm_t **pcm,
const char *alsa_dev = device ? device : "default";
int errnum = 0;
RARCH_DBG("[ALSA]: Requesting device \"%s\" for %s stream\n", alsa_dev, snd_pcm_stream_name(stream));
RARCH_DBG("[ALSA] Requesting device \"%s\" for %s stream...\n", alsa_dev, snd_pcm_stream_name(stream));
if ((errnum = snd_pcm_open(pcm, alsa_dev, stream, mode)) < 0)
{
RARCH_ERR("[ALSA]: Failed to open %s stream on device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to open %s stream on device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
alsa_dev,
snd_strerror(errnum));
@@ -58,7 +58,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_malloc(&params)) < 0)
{
RARCH_ERR("[ALSA]: Failed to allocate hardware parameters: %s\n",
RARCH_ERR("[ALSA] Failed to allocate hardware parameters: %s.\n",
snd_strerror(errnum));
goto error;
@@ -66,7 +66,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_any(*pcm, params)) < 0)
{
RARCH_ERR("[ALSA]: Failed to query hardware parameters from %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to query hardware parameters from %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -78,7 +78,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
? SND_PCM_FORMAT_FLOAT : SND_PCM_FORMAT_S16;
stream_info->has_float = (format == SND_PCM_FORMAT_FLOAT);
RARCH_LOG("[ALSA]: Using %s sample format for %s device \"%s\"\n",
RARCH_LOG("[ALSA] Using %s sample format for %s device \"%s\".\n",
snd_pcm_format_name(format),
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm)
@@ -86,7 +86,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_set_access(*pcm, params, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
{
RARCH_ERR("[ALSA]: Failed to set %s access for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to set %s access for %s device \"%s\": %s.\n",
snd_pcm_access_name(SND_PCM_ACCESS_RW_INTERLEAVED),
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -98,7 +98,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_set_format(*pcm, params, format)) < 0)
{
RARCH_ERR("[ALSA]: Failed to set %s format for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to set %s format for %s device \"%s\": %s.\n",
snd_pcm_format_name(format),
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -109,7 +109,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_set_channels(*pcm, params, channels)) < 0)
{
RARCH_ERR("[ALSA]: Failed to set %u-channel audio for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to set %u-channel audio for %s device \"%s\": %s.\n",
channels,
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -121,7 +121,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
/* Don't allow rate resampling when probing for the default rate (but ignore if this call fails) */
if ((errnum = snd_pcm_hw_params_set_rate_resample(*pcm, params, false)) < 0)
{
RARCH_WARN("[ALSA]: Failed to request a default unsampled rate for %s device \"%s\": %s\n",
RARCH_WARN("[ALSA] Failed to request a default unsampled rate for %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -129,7 +129,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_set_rate_near(*pcm, params, &rate, 0)) < 0)
{
RARCH_ERR("[ALSA]: Failed to request a rate near %uHz for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to request a rate near %uHz for %s device \"%s\": %s.\n",
rate,
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -143,7 +143,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((snd_pcm_hw_params_set_buffer_time_near(*pcm, params, &latency_usec, NULL)) < 0)
{
RARCH_ERR("[ALSA]: Failed to request a buffer time near %uus for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to request a buffer time near %uus for %s device \"%s\": %s.\n",
latency_usec,
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -155,7 +155,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params_set_periods_near(*pcm, params, &periods, NULL)) < 0)
{
RARCH_ERR("[ALSA]: Failed to request %u periods per buffer for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to request %u periods per buffer for %s device \"%s\": %s.\n",
periods,
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -166,7 +166,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_hw_params(*pcm, params)) < 0)
{ /* This calls snd_pcm_prepare() under the hood */
RARCH_ERR("[ALSA]: Failed to install hardware parameters for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to install hardware parameters for %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -178,15 +178,15 @@ int alsa_init_pcm(snd_pcm_t **pcm,
* but some drivers are apparently broken. */
if ((errnum = snd_pcm_hw_params_get_period_size(params, &stream_info->period_frames, NULL)) < 0)
{
RARCH_WARN("[ALSA]: Failed to get an exact period size from %s device \"%s\": %s\n",
RARCH_WARN("[ALSA] Failed to get an exact period size from %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
RARCH_WARN("[ALSA]: Trying the minimum period size instead\n");
RARCH_WARN("[ALSA] Trying the minimum period size instead.\n");
if ((errnum = snd_pcm_hw_params_get_period_size_min(params, &stream_info->period_frames, NULL)) < 0)
{
RARCH_ERR("[ALSA]: Failed to get min period size from %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to get min period size from %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -197,28 +197,28 @@ int alsa_init_pcm(snd_pcm_t **pcm,
stream_info->period_size = snd_pcm_frames_to_bytes(*pcm, stream_info->period_frames);
if (stream_info->period_size < 0)
{
RARCH_ERR("[ALSA]: Failed to convert a period size of %lu frames to bytes: %s\n",
RARCH_ERR("[ALSA] Failed to convert a period size of %lu frames to bytes: %s.\n",
stream_info->period_frames,
snd_strerror(stream_info->period_frames));
goto error;
}
RARCH_LOG("[ALSA]: Period: %u periods per buffer (%lu frames, %lu bytes)\n",
RARCH_LOG("[ALSA] Period: %u periods per buffer (%lu frames, %lu bytes).\n",
periods,
stream_info->period_frames,
stream_info->period_size);
if ((errnum = snd_pcm_hw_params_get_buffer_size(params, &buffer_size)) < 0)
{
RARCH_WARN("[ALSA]: Failed to get exact buffer size from %s device \"%s\": %s\n",
RARCH_WARN("[ALSA] Failed to get exact buffer size from %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
RARCH_WARN("[ALSA]: Trying the maximum buffer size instead\n");
RARCH_WARN("[ALSA] Trying the maximum buffer size instead.\n");
if ((errnum = snd_pcm_hw_params_get_buffer_size_max(params, &buffer_size)) < 0)
{
RARCH_ERR("[ALSA]: Failed to get max buffer size from %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to get max buffer size from %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -230,20 +230,20 @@ int alsa_init_pcm(snd_pcm_t **pcm,
stream_info->buffer_size = snd_pcm_frames_to_bytes(*pcm, buffer_size);
if (stream_info->buffer_size < 0)
{
RARCH_ERR("[ALSA]: Failed to convert a buffer size of %lu frames to bytes: %s\n",
RARCH_ERR("[ALSA] Failed to convert a buffer size of %lu frames to bytes: %s.\n",
buffer_size,
snd_strerror(buffer_size));
goto error;
}
RARCH_LOG("[ALSA]: Buffer size: %lu frames (%lu bytes)\n", buffer_size, stream_info->buffer_size);
RARCH_LOG("[ALSA] Buffer size: %lu frames (%lu bytes).\n", buffer_size, stream_info->buffer_size);
stream_info->can_pause = snd_pcm_hw_params_can_pause(params);
RARCH_LOG("[ALSA]: Can pause: %s.\n", stream_info->can_pause ? "yes" : "no");
RARCH_LOG("[ALSA] Can pause: %s.\n", stream_info->can_pause ? "yes" : "no");
if ((errnum = snd_pcm_sw_params_malloc(&sw_params)) < 0)
{
RARCH_ERR("[ALSA]: Failed to allocate software parameters: %s\n",
RARCH_ERR("[ALSA] Failed to allocate software parameters: %s.\n",
snd_strerror(errnum));
goto error;
@@ -251,7 +251,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_sw_params_current(*pcm, sw_params)) < 0)
{
RARCH_ERR("[ALSA]: Failed to query current software parameters for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to query current software parameters for %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -261,7 +261,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_sw_params_set_start_threshold(*pcm, sw_params, buffer_size / 2)) < 0)
{
RARCH_ERR("[ALSA]: Failed to set start %lu-frame threshold for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to set start %lu-frame threshold for %s device \"%s\": %s.\n",
buffer_size / 2,
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
@@ -272,7 +272,7 @@ int alsa_init_pcm(snd_pcm_t **pcm,
if ((errnum = snd_pcm_sw_params(*pcm, sw_params)) < 0)
{
RARCH_ERR("[ALSA]: Failed to install software parameters for %s device \"%s\": %s\n",
RARCH_ERR("[ALSA] Failed to install software parameters for %s device \"%s\": %s.\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm),
snd_strerror(errnum));
@@ -283,11 +283,12 @@ int alsa_init_pcm(snd_pcm_t **pcm,
snd_pcm_hw_params_free(params);
snd_pcm_sw_params_free(sw_params);
RARCH_LOG("[ALSA]: Initialized %s device \"%s\"\n",
RARCH_LOG("[ALSA] Initialized %s device \"%s\".\n",
snd_pcm_stream_name(stream),
snd_pcm_name(*pcm));
return 0;
error:
if (params)
snd_pcm_hw_params_free(params);
@@ -312,7 +313,7 @@ void alsa_free_pcm(snd_pcm_t *pcm)
if ((errnum = snd_pcm_drop(pcm)) < 0)
{
RARCH_WARN("[ALSA]: Failed to drop remaining samples in %s stream \"%s\": %s\n",
RARCH_WARN("[ALSA] Failed to drop remaining samples in %s stream \"%s\": %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_strerror(errnum));
@@ -320,7 +321,7 @@ void alsa_free_pcm(snd_pcm_t *pcm)
if ((errnum = snd_pcm_close(pcm)) < 0)
{
RARCH_WARN("[ALSA]: Failed to close %s stream \"%s\": %s\n",
RARCH_WARN("[ALSA] Failed to close %s stream \"%s\": %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_strerror(errnum));
@@ -351,19 +352,19 @@ bool alsa_start_pcm(snd_pcm_t *pcm)
break;
case SND_PCM_STATE_RUNNING:
RARCH_DBG("[ALSA]: %s stream \"%s\" is already running, no action needed.\n",
RARCH_DBG("[ALSA] %s stream \"%s\" is already running, no action needed.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm));
return true;
default:
RARCH_ERR("[ALSA]: Failed to start %s stream \"%s\" in unexpected state %s\n",
RARCH_ERR("[ALSA] Failed to start %s stream \"%s\" in unexpected state %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_pcm_state_name(pcm_state));
return false;
}
RARCH_DBG("[ALSA]: Started %s stream \"%s\", transitioning from %s to %s\n",
RARCH_DBG("[ALSA] Started %s stream \"%s\", transitioning from %s to %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_pcm_state_name(pcm_state),
@@ -372,7 +373,7 @@ bool alsa_start_pcm(snd_pcm_t *pcm)
return true;
error:
RARCH_ERR("[ALSA]: Failed to start %s stream \"%s\" in state %s: %s\n",
RARCH_ERR("[ALSA] Failed to start %s stream \"%s\" in state %s: %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_pcm_state_name(pcm_state),
@@ -393,12 +394,12 @@ bool alsa_stop_pcm(snd_pcm_t *pcm)
switch (pcm_state)
{
case SND_PCM_STATE_PAUSED:
RARCH_DBG("[ALSA]: %s stream \"%s\" is already paused, no action needed.\n",
RARCH_DBG("[ALSA] %s stream \"%s\" is already paused, no action needed.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm));
return true;
case SND_PCM_STATE_PREPARED:
RARCH_DBG("[ALSA]: %s stream \"%s\" is prepared but not running, no action needed.\n",
RARCH_DBG("[ALSA] %s stream \"%s\" is prepared but not running, no action needed.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm));
return true;
@@ -409,7 +410,7 @@ bool alsa_stop_pcm(snd_pcm_t *pcm)
break;
default:
RARCH_ERR("[ALSA]: Failed to stop %s stream \"%s\" in unexpected state %s\n",
RARCH_ERR("[ALSA] Failed to stop %s stream \"%s\" in unexpected state %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_pcm_state_name(pcm_state));
@@ -417,7 +418,7 @@ bool alsa_stop_pcm(snd_pcm_t *pcm)
return false;
}
RARCH_DBG("[ALSA]: Stopped %s stream \"%s\", transitioning from %s to %s\n",
RARCH_DBG("[ALSA] Stopped %s stream \"%s\", transitioning from %s to %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_pcm_state_name(pcm_state),
@@ -426,7 +427,7 @@ bool alsa_stop_pcm(snd_pcm_t *pcm)
return true;
error:
RARCH_ERR("[ALSA]: Failed to stop %s stream \"%s\" in state %s: %s\n",
RARCH_ERR("[ALSA] Failed to stop %s stream \"%s\" in state %s: %s.\n",
snd_pcm_stream_name(snd_pcm_stream(pcm)),
snd_pcm_name(pcm),
snd_pcm_state_name(pcm_state),
+10 -10
View File
@@ -17,9 +17,8 @@
#ifndef _RETROARCH_ALSA
#define _RETROARCH_ALSA
#include <stdint.h>
#include <boolean.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
/* Header file for common functions that are used by alsa and alsathread. */
@@ -38,14 +37,15 @@ typedef struct alsa_stream_info
} alsa_stream_info_t;
int alsa_init_pcm(snd_pcm_t **pcm,
const char* device,
snd_pcm_stream_t stream,
unsigned rate,
unsigned latency,
unsigned channels,
alsa_stream_info_t *stream_info,
unsigned *new_rate,
int mode);
const char* device,
snd_pcm_stream_t stream,
unsigned rate,
unsigned latency,
unsigned channels,
alsa_stream_info_t *stream_info,
unsigned *new_rate,
int mode);
void alsa_free_pcm(snd_pcm_t *pcm);
void *alsa_device_list_new(void *data);
struct string_list *alsa_device_list_type_new(const char* type);
-43
View File
@@ -1,43 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 Daniel De Matteis
* Copyright (C) 2023 Jesse Talavera-Greenberg
*
* 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 "alsathread.h"
void alsa_thread_free_info_members(alsa_thread_info_t *info)
{
if (info)
{
if (info->worker_thread)
{
slock_lock(info->cond_lock);
info->thread_dead = true;
slock_unlock(info->cond_lock);
sthread_join(info->worker_thread);
}
if (info->buffer)
fifo_free(info->buffer);
if (info->cond)
scond_free(info->cond);
if (info->fifo_lock)
slock_free(info->fifo_lock);
if (info->cond_lock)
slock_free(info->cond_lock);
if (info->pcm)
alsa_free_pcm(info->pcm);
}
/* Do NOT free() info itself; it's embedded within another struct
* that will be freed. */
}
-40
View File
@@ -1,40 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 Daniel De Matteis
* Copyright (C) 2023 Jesse Talavera-Greenberg
*
* 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 RETROARCH_ALSATHREAD_H
#define RETROARCH_ALSATHREAD_H
#include <alsa/asoundlib.h>
#include <boolean.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "alsa.h"
typedef struct alsa_thread_info
{
snd_pcm_t *pcm;
fifo_buffer_t *buffer;
sthread_t *worker_thread;
slock_t *fifo_lock;
scond_t *cond;
slock_t *cond_lock;
alsa_stream_info_t stream_info;
volatile bool thread_dead;
} alsa_thread_info_t;
void alsa_thread_free_info_members(alsa_thread_info_t *info);
#endif
+427 -23
View File
@@ -17,44 +17,400 @@
#include <encodings/utf.h>
#include <lists/string_list.h>
#include <string/stdstring.h>
#include "mmdevice_common.h"
#include "mmdevice_common_inline.h"
char* mmdevice_name(IMMDevice *device)
#include "../../verbosity.h"
static const char *mmdevice_data_flow_name(unsigned data_flow)
{
switch (data_flow)
{
case 0:
return "eRender";
case 1:
return "eCapture";
case 2:
return "eAll";
default:
break;
}
return "<unknown>";
}
const char *mmdevice_hresult_name(int hr)
{
switch (hr)
{
/* Standard error codes */
case E_INVALIDARG:
return "E_INVALIDARG";
case E_NOINTERFACE:
return "E_NOINTERFACE";
case E_OUTOFMEMORY:
return "E_OUTOFMEMORY";
case E_POINTER:
return "E_POINTER";
/* Standard success codes */
case S_FALSE:
return "S_FALSE";
case S_OK:
return "S_OK";
/* AUDCLNT error codes */
case AUDCLNT_E_ALREADY_INITIALIZED:
return "AUDCLNT_E_ALREADY_INITIALIZED";
case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL:
return "AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL";
case AUDCLNT_E_BUFFER_ERROR:
return "AUDCLNT_E_BUFFER_ERROR";
case AUDCLNT_E_BUFFER_OPERATION_PENDING:
return "AUDCLNT_E_BUFFER_OPERATION_PENDING";
case AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED:
return "AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED";
case AUDCLNT_E_BUFFER_SIZE_ERROR:
return "AUDCLNT_E_BUFFER_SIZE_ERROR";
case AUDCLNT_E_CPUUSAGE_EXCEEDED:
return "AUDCLNT_E_CPUUSAGE_EXCEEDED";
case AUDCLNT_E_DEVICE_IN_USE:
return "AUDCLNT_E_DEVICE_IN_USE";
case AUDCLNT_E_DEVICE_INVALIDATED:
return "AUDCLNT_E_DEVICE_INVALIDATED";
case AUDCLNT_E_ENDPOINT_CREATE_FAILED:
return "AUDCLNT_E_ENDPOINT_CREATE_FAILED";
case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED:
return "AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED";
case AUDCLNT_E_INVALID_DEVICE_PERIOD:
return "AUDCLNT_E_INVALID_DEVICE_PERIOD";
case AUDCLNT_E_INVALID_SIZE:
return "AUDCLNT_E_INVALID_SIZE";
case AUDCLNT_E_NOT_INITIALIZED:
return "AUDCLNT_E_NOT_INITIALIZED";
case AUDCLNT_E_OUT_OF_ORDER:
return "AUDCLNT_E_OUT_OF_ORDER";
case AUDCLNT_E_SERVICE_NOT_RUNNING:
return "AUDCLNT_E_SERVICE_NOT_RUNNING";
case AUDCLNT_E_UNSUPPORTED_FORMAT:
return "AUDCLNT_E_UNSUPPORTED_FORMAT";
case AUDCLNT_E_WRONG_ENDPOINT_TYPE:
return "AUDCLNT_E_WRONG_ENDPOINT_TYPE";
/* AUDCLNT success codes */
case AUDCLNT_S_BUFFER_EMPTY:
return "AUDCLNT_S_BUFFER_EMPTY";
/* Something else; probably from an API that we started using
* after mic support was implemented */
default:
break;
}
return "<unknown>";
}
size_t mmdevice_samplerate(void *data)
{
HRESULT hr;
IPropertyStore *prop_store = NULL;
PWAVEFORMATEX devfmt_props;
PROPVARIANT prop_var;
bool prop_var_init = false;
IMMDevice *device = (IMMDevice*)data;
IPropertyStore *prop_store = NULL;
DWORD result = 0;
if (!device)
return 0;
hr = _IMMDevice_OpenPropertyStore(device,
STGM_READ, &prop_store);
if (FAILED(hr))
return 0;
PropVariantInit(&prop_var);
hr = _IPropertyStore_GetValue(prop_store,
PKEY_AudioEngine_DeviceFormat, &prop_var);
if (SUCCEEDED(hr))
{
devfmt_props = (PWAVEFORMATEX)prop_var.blob.pBlobData;
result = devfmt_props->nSamplesPerSec;
}
PropVariantClear(&prop_var);
if (prop_store)
{
#ifdef __cplusplus
prop_store->Release();
#else
prop_store->lpVtbl->Release(prop_store);
#endif
prop_store = NULL;
}
return (size_t)result;
}
char *mmdevice_name(void *data)
{
HRESULT hr;
PROPVARIANT prop_var;
IMMDevice *device = (IMMDevice*)data;
IPropertyStore *prop_store = NULL;
char* result = NULL;
if (!device)
return NULL;
hr = _IMMDevice_OpenPropertyStore(device, STGM_READ, &prop_store);
hr = _IMMDevice_OpenPropertyStore(device,
STGM_READ, &prop_store);
if (FAILED(hr))
return NULL;
PropVariantInit(&prop_var);
prop_var_init = true;
hr = _IPropertyStore_GetValue(prop_store, PKEY_Device_FriendlyName, &prop_var);
if (FAILED(hr))
goto done;
result = utf16_to_utf8_string_alloc(prop_var.pwszVal);
done:
if (prop_var_init)
PropVariantClear(&prop_var);
IFACE_RELEASE(prop_store);
hr = _IPropertyStore_GetValue(prop_store,
PKEY_Device_FriendlyName, &prop_var);
if (SUCCEEDED(hr))
result = utf16_to_utf8_string_alloc(prop_var.pwszVal);
PropVariantClear(&prop_var);
if (prop_store)
{
#ifdef __cplusplus
prop_store->Release();
#else
prop_store->lpVtbl->Release(prop_store);
#endif
prop_store = NULL;
}
return result;
}
void *mmdevice_list_new(const void *u, EDataFlow data_flow)
void *mmdevice_handle(int id, unsigned data_flow)
{
HRESULT hr;
IMMDeviceEnumerator *enumerator = NULL;
IMMDevice *device = NULL;
IMMDeviceCollection *collection = NULL;
#ifdef __cplusplus
hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
IID_IMMDeviceEnumerator, (void **)&enumerator);
#else
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
&IID_IMMDeviceEnumerator, (void **)&enumerator);
#endif
if (FAILED(hr))
return NULL;
hr = _IMMDeviceEnumerator_EnumAudioEndpoints(enumerator,
data_flow, DEVICE_STATE_ACTIVE, &collection);
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to enumerate audio endpoints: %s.\n", mmdevice_hresult_name(hr));
goto error;
}
hr = _IMMDeviceCollection_Item(collection, id, &device);
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to get IMMDevice #%d: %s.\n", id, mmdevice_hresult_name(hr));
goto error;
}
return device;
error:
if (collection)
#ifdef __cplusplus
collection->Release();
#else
collection->lpVtbl->Release(collection);
#endif
if (enumerator)
#ifdef __cplusplus
enumerator->Release();
#else
enumerator->lpVtbl->Release(enumerator);
#endif
collection = NULL;
enumerator = NULL;
return NULL;
}
size_t mmdevice_get_samplerate(int id)
{
IMMDevice *device = (IMMDevice*)mmdevice_handle(id, 0 /* eRender */);
if (device)
{
size_t _len = mmdevice_samplerate(device);
#ifdef __cplusplus
device->Release();
#else
device->lpVtbl->Release(device);
#endif
return _len;
}
return 0;
}
void *mmdevice_init_device(const char *id, unsigned data_flow)
{
HRESULT hr;
UINT32 dev_count, i;
IMMDeviceEnumerator *enumerator = NULL;
IMMDevice *device = NULL;
IMMDeviceCollection *collection = NULL;
const char *data_flow_name = mmdevice_data_flow_name(data_flow);
if (id)
RARCH_DBG("[MMDevice] Initializing %s device \"%s\"...\n", data_flow_name, id);
else
RARCH_DBG("[MMDevice] Initializing default %s device...\n", data_flow_name);
#ifdef __cplusplus
hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
IID_IMMDeviceEnumerator, (void **)&enumerator);
#else
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
&IID_IMMDeviceEnumerator, (void **)&enumerator);
#endif
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to create device enumerator: %s.\n", mmdevice_hresult_name(hr));
goto error;
}
if (id)
{
/* If a specific device was requested... */
int32_t idx_found = -1;
struct string_list *list = (struct string_list*)mmdevice_list_new(NULL, data_flow);
if (!list)
{
RARCH_ERR("[MMDevice] Failed to allocate %s device list.\n", data_flow_name);
goto error;
}
if (list->elems)
{
size_t d;
/* If any devices were found... */
for (d = 0; d < list->size; d++)
{
if (string_is_equal(id, list->elems[d].data))
{
RARCH_DBG("[MMDevice] Found device #%d: \"%s\".\n", d,
list->elems[d].data);
idx_found = d;
break;
}
}
/* Index was not found yet based on name string,
* just assume id is a one-character number index. */
if (idx_found == -1 && isdigit(id[0]))
{
idx_found = strtoul(id, NULL, 0);
RARCH_LOG("[MMDevice] Fallback, %s device index is a single number index instead: %u.\n",
data_flow_name, idx_found);
}
}
string_list_free(list);
if (idx_found == -1)
idx_found = 0;
hr = _IMMDeviceEnumerator_EnumAudioEndpoints(enumerator,
data_flow, DEVICE_STATE_ACTIVE, &collection);
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to enumerate audio endpoints: %s.\n", mmdevice_hresult_name(hr));
goto error;
}
hr = _IMMDeviceCollection_GetCount(collection, &dev_count);
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to count IMMDevices: %s.\n", mmdevice_hresult_name(hr));
goto error;
}
for (i = 0; i < dev_count; ++i)
{
hr = _IMMDeviceCollection_Item(collection, i, &device);
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to get IMMDevice #%d: %s.\n", i, mmdevice_hresult_name(hr));
goto error;
}
if (i == (UINT32)idx_found)
break;
if (device)
#ifdef __cplusplus
device->Release();
#else
device->lpVtbl->Release(device);
#endif
device = NULL;
}
}
else
{
hr = _IMMDeviceEnumerator_GetDefaultAudioEndpoint(
enumerator, data_flow, eConsole, &device);
if (FAILED(hr))
{
RARCH_ERR("[MMDevice] Failed to get default audio endpoint: %s.\n", mmdevice_hresult_name(hr));
goto error;
}
}
if (!device)
goto error;
if (collection)
#ifdef __cplusplus
collection->Release();
#else
collection->lpVtbl->Release(collection);
#endif
if (enumerator)
#ifdef __cplusplus
enumerator->Release();
#else
enumerator->lpVtbl->Release(enumerator);
#endif
collection = NULL;
enumerator = NULL;
return device;
error:
if (collection)
#ifdef __cplusplus
collection->Release();
#else
collection->lpVtbl->Release(collection);
#endif
if (enumerator)
#ifdef __cplusplus
enumerator->Release();
#else
enumerator->lpVtbl->Release(enumerator);
#endif
collection = NULL;
enumerator = NULL;
if (id)
RARCH_WARN("[MMDevice] Failed to initialize %s device \"%s\".\n", data_flow_name, id);
else
RARCH_ERR("[MMDevice] Failed to initialize default %s device.\n", data_flow_name);
return NULL;
}
void *mmdevice_list_new(const void *u, unsigned data_flow)
{
HRESULT hr;
UINT i;
@@ -120,11 +476,35 @@ void *mmdevice_list_new(const void *u, EDataFlow data_flow)
free(dev_name_str);
dev_name_str = NULL;
dev_id_wstr = NULL;
IFACE_RELEASE(device);
if (device)
{
#ifdef __cplusplus
device->Release();
#else
device->lpVtbl->Release(device);
#endif
device = NULL;
}
}
IFACE_RELEASE(collection);
IFACE_RELEASE(enumerator);
if (collection)
{
#ifdef __cplusplus
collection->Release();
#else
collection->lpVtbl->Release(collection);
#endif
collection = NULL;
}
if (enumerator)
{
#ifdef __cplusplus
enumerator->Release();
#else
enumerator->lpVtbl->Release(enumerator);
#endif
enumerator = NULL;
}
return sl;
@@ -138,9 +518,33 @@ error:
if (dev_id_wstr)
CoTaskMemFree(dev_id_wstr);
dev_id_wstr = NULL;
IFACE_RELEASE(device);
IFACE_RELEASE(collection);
IFACE_RELEASE(enumerator);
if (device)
{
#ifdef __cplusplus
device->Release();
#else
device->lpVtbl->Release(device);
#endif
device = NULL;
}
if (collection)
{
#ifdef __cplusplus
collection->Release();
#else
collection->lpVtbl->Release(collection);
#endif
collection = NULL;
}
if (enumerator)
{
#ifdef __cplusplus
enumerator->Release();
#else
enumerator->lpVtbl->Release(enumerator);
#endif
enumerator = NULL;
}
if (sl)
string_list_free(sl);
+19 -3
View File
@@ -19,17 +19,33 @@
#include <stdlib.h>
#include <retro_common_api.h>
#include "mmdevice_common_inline.h"
RETRO_BEGIN_DECLS
void *mmdevice_list_new(const void *u, EDataFlow data_flow);
void *mmdevice_list_new(const void *u, unsigned data_flow);
/**
* Gets the friendly name of the provided IMMDevice.
* The string must be freed with free().
*/
char* mmdevice_name(IMMDevice *device);
char* mmdevice_name(void *data);
/**
* Gets the samplerate of the provided IMMDevice.
*/
size_t mmdevice_samplerate(void *data);
/**
* Gets the handle of the IMMDevice.
*/
void *mmdevice_handle(int id, unsigned data_flow);
size_t mmdevice_get_samplerate(int id);
const char *mmdevice_hresult_name(int hr);
void *mmdevice_init_device(const char *id, unsigned data_flow);
RETRO_END_DECLS
+114 -143
View File
@@ -1,143 +1,114 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - 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 _MMDEVICE_COMMON_INLINE_H
#define _MMDEVICE_COMMON_INLINE_H
#include <stdlib.h>
/* Fix for MSYS2 increasing _WIN32_WINNT to 0x0603*/
#if defined(__MINGW32__) || defined(__MINGW64__)
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0600
#define WIN32_LEAN_AND_MEAN
#else
typedef enum EDataFlow EDataFlow;
/* MinGW defines EDataFlow differently than MSVC does;
* this typedef smooths that over. */
#endif
#include <windows.h>
#include <winerror.h>
#include <propidl.h>
#include <initguid.h>
#include <mmdeviceapi.h>
#include <mmreg.h>
#include <audioclient.h>
#include <retro_common_api.h>
#ifdef _MSC_VER
DEFINE_GUID(IID_IAudioClient, 0x1CB9AD4C, 0xDBFA, 0x4C32, 0xB1, 0x78, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2);
DEFINE_GUID(IID_IAudioRenderClient, 0xF294ACFC, 0x3146, 0x4483, 0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2);
DEFINE_GUID(IID_IAudioCaptureClient, 0xC8ADBD64, 0xE71E, 0x48A0, 0xA4, 0xDE, 0x18, 0x5C, 0x39, 0x5C, 0xD3, 0x17);
DEFINE_GUID(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6);
DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E);
#undef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
#endif
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); /* DEVPROP_TYPE_STRING */
#ifdef __cplusplus
#define _IMMDeviceCollection_Item(This,nDevice,ppdevice) (This)->Item(nDevice,ppdevice)
#define _IAudioClient_Start(This) ( (This)->Start() )
#define _IAudioClient_Stop(This) ( (This)->Stop() )
#define _IAudioClient_GetCurrentPadding(This,pNumPaddingFrames) \
( (This)->GetCurrentPadding(pNumPaddingFrames) )
#define _IAudioRenderClient_GetBuffer(This,NumFramesRequested,ppData) \
( (This)->GetBuffer(NumFramesRequested,ppData) )
#define _IAudioRenderClient_ReleaseBuffer(This,NumFramesWritten,dwFlags) \
( (This)->ReleaseBuffer(NumFramesWritten,dwFlags) )
#define _IAudioClient_GetService(This,riid,ppv) ( (This)->GetService(riid,ppv) )
#define _IAudioClient_SetEventHandle(This,eventHandle) ( (This)->SetEventHandle(eventHandle) )
#define _IAudioClient_GetBufferSize(This,pNumBufferFrames) ( (This)->GetBufferSize(pNumBufferFrames) )
#define _IAudioClient_GetStreamLatency(This,phnsLatency) ( (This)->GetStreamLatency(phnsLatency) )
#define _IAudioClient_GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) ( (This)->GetDevicePeriod(phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) )
#define _IAudioClient_Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) \
( (This)->Initialize(ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid))
#define _IAudioClient_IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) \
( (This)->IsFormatSupported(ShareMode,pFormat,ppClosestMatch))
#define _IMMDevice_Activate(This,iid,dwClsCtx,pActivationParams,ppv) ((This)->Activate(iid,(dwClsCtx),pActivationParams,ppv))
#define _IMMDeviceEnumerator_EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices) (This)->EnumAudioEndpoints(dataFlow,dwStateMask,ppDevices)
#define _IMMDeviceEnumerator_GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint) (This)->GetDefaultAudioEndpoint(dataFlow,role,ppEndpoint)
#define _IMMDevice_OpenPropertyStore(This,stgmAccess,ppProperties) (This)->OpenPropertyStore(stgmAccess,ppProperties)
#define _IMMDevice_GetId(This,ppstrId) ((This)->GetId(ppstrId))
#define _IPropertyStore_GetValue(This,key,pv) ( (This)->GetValue(key,pv) )
#define _IMMDeviceCollection_GetCount(This,cProps) ( (This)->GetCount(cProps) )
#define _IAudioCaptureClient_GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) \
( (This) -> GetBuffer(ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) )
#define _IAudioCaptureClient_ReleaseBuffer(This,NumFramesRead) \
( (This) -> ReleaseBuffer(NumFramesRead) )
#define _IAudioCaptureClient_GetNextPacketSize(This,pNumFramesInNextPacket) \
( (This) -> GetNextPacketSize(pNumFramesInNextPacket) )
#else
#define _IMMDeviceCollection_Item(This,nDevice,ppdevice) (This)->lpVtbl->Item(This,nDevice,ppdevice)
#define _IAudioClient_Start(This) ( (This)->lpVtbl -> Start(This) )
#define _IAudioClient_Stop(This) ( (This)->lpVtbl -> Stop(This) )
#define _IAudioClient_GetCurrentPadding(This,pNumPaddingFrames) \
( (This)->lpVtbl -> GetCurrentPadding(This,pNumPaddingFrames) )
#define _IAudioRenderClient_GetBuffer(This,NumFramesRequested,ppData) \
( (This)->lpVtbl -> GetBuffer(This,NumFramesRequested,ppData) )
#define _IAudioRenderClient_ReleaseBuffer(This,NumFramesWritten,dwFlags) \
( (This)->lpVtbl -> ReleaseBuffer(This,NumFramesWritten,dwFlags) )
#define _IAudioClient_GetService(This,riid,ppv) ( (This)->lpVtbl -> GetService(This,&(riid),ppv) )
#define _IAudioClient_SetEventHandle(This,eventHandle) ( (This)->lpVtbl -> SetEventHandle(This,eventHandle) )
#define _IAudioClient_GetBufferSize(This,pNumBufferFrames) ( (This)->lpVtbl -> GetBufferSize(This,pNumBufferFrames) )
#define _IAudioClient_GetStreamLatency(This,phnsLatency) ( (This)->lpVtbl -> GetStreamLatency(This,phnsLatency) )
#define _IAudioClient_GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) ( (This)->lpVtbl -> GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) )
#define _IAudioClient_Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) \
( (This)->lpVtbl->Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid))
#define _IAudioClient_IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) \
( (This)->lpVtbl->IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch))
#define _IMMDevice_Activate(This,iid,dwClsCtx,pActivationParams,ppv) ((This)->lpVtbl->Activate(This,&(iid),dwClsCtx,pActivationParams,ppv))
#define _IMMDeviceEnumerator_EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices) (This)->lpVtbl->EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices)
#define _IMMDeviceEnumerator_GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint) (This)->lpVtbl->GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint)
#define _IMMDevice_OpenPropertyStore(This,stgmAccess,ppProperties) (This)->lpVtbl->OpenPropertyStore(This,stgmAccess,ppProperties)
#define _IMMDevice_GetId(This,ppstrId) (This)->lpVtbl->GetId(This,ppstrId)
#define _IPropertyStore_GetValue(This,key,pv) ( (This)->lpVtbl -> GetValue(This,&(key),pv) )
#define _IMMDeviceCollection_GetCount(This,cProps) ( (This)->lpVtbl -> GetCount(This,cProps) )
#define _IAudioCaptureClient_GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) \
( (This)->lpVtbl -> GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) )
#define _IAudioCaptureClient_ReleaseBuffer(This,NumFramesRead) \
( (This)->lpVtbl -> ReleaseBuffer(This,NumFramesRead) )
#define _IAudioCaptureClient_GetNextPacketSize(This,pNumFramesInNextPacket) \
( (This)-> lpVtbl -> GetNextPacketSize(This,pNumFramesInNextPacket) )
#endif
#ifdef __cplusplus
#ifndef IFACE_RELEASE
#define IFACE_RELEASE(iface) \
if (iface) \
{ \
iface->Release(); \
iface = NULL; \
}
#endif
#else
#ifndef IFACE_RELEASE
#define IFACE_RELEASE(iface) \
if (iface) \
{ \
iface->lpVtbl->Release(iface);\
iface = NULL; \
}
#endif
#endif
#endif
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - 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 _MMDEVICE_COMMON_INLINE_H
#define _MMDEVICE_COMMON_INLINE_H
#include <stdlib.h>
/* Fix for MSYS2 increasing _WIN32_WINNT to 0x0603 */
#if defined(__MINGW32__) || defined(__MINGW64__)
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <winerror.h>
#include <propidl.h>
#include <initguid.h>
#include <mmdeviceapi.h>
#include <mmreg.h>
#include <audioclient.h>
#include <retro_common_api.h>
#ifdef _MSC_VER
DEFINE_GUID(IID_IAudioClient, 0x1CB9AD4C, 0xDBFA, 0x4C32, 0xB1, 0x78, 0xC2, 0xF5, 0x68, 0xA7, 0x03, 0xB2);
DEFINE_GUID(IID_IAudioRenderClient, 0xF294ACFC, 0x3146, 0x4483, 0xA7, 0xBF, 0xAD, 0xDC, 0xA7, 0xC2, 0x60, 0xE2);
DEFINE_GUID(IID_IAudioCaptureClient, 0xC8ADBD64, 0xE71E, 0x48A0, 0xA4, 0xDE, 0x18, 0x5C, 0x39, 0x5C, 0xD3, 0x17);
DEFINE_GUID(IID_IMMDeviceEnumerator, 0xA95664D2, 0x9614, 0x4F35, 0xA7, 0x46, 0xDE, 0x8D, 0xB6, 0x36, 0x17, 0xE6);
DEFINE_GUID(CLSID_MMDeviceEnumerator, 0xBCDE0395, 0xE52F, 0x467C, 0x8E, 0x3D, 0xC4, 0x57, 0x92, 0x91, 0x69, 0x2E);
#undef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT
DEFINE_GUID(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 0x00000003, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71);
#endif
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); /* DEVPROP_TYPE_STRING */
#ifdef __cplusplus
#define _IMMDeviceCollection_Item(This,nDevice,ppdevice) (This)->Item(nDevice,ppdevice)
#define _IAudioClient_Start(This) ( (This)->Start() )
#define _IAudioClient_Stop(This) ( (This)->Stop() )
#define _IAudioClient_GetCurrentPadding(This,pNumPaddingFrames) \
( (This)->GetCurrentPadding(pNumPaddingFrames) )
#define _IAudioRenderClient_GetBuffer(This,NumFramesRequested,ppData) \
( (This)->GetBuffer(NumFramesRequested,ppData) )
#define _IAudioRenderClient_ReleaseBuffer(This,NumFramesWritten,dwFlags) \
( (This)->ReleaseBuffer(NumFramesWritten,dwFlags) )
#define _IAudioClient_GetService(This,riid,ppv) ( (This)->GetService(riid,ppv) )
#define _IAudioClient_SetEventHandle(This,eventHandle) ( (This)->SetEventHandle(eventHandle) )
#define _IAudioClient_GetBufferSize(This,pNumBufferFrames) ( (This)->GetBufferSize(pNumBufferFrames) )
#define _IAudioClient_GetStreamLatency(This,phnsLatency) ( (This)->GetStreamLatency(phnsLatency) )
#define _IAudioClient_GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) ( (This)->GetDevicePeriod(phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) )
#define _IAudioClient_Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) \
( (This)->Initialize(ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid))
#define _IAudioClient_IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) \
( (This)->IsFormatSupported(ShareMode,pFormat,ppClosestMatch))
#define _IMMDevice_Activate(This,iid,dwClsCtx,pActivationParams,ppv) ((This)->Activate(iid,(dwClsCtx),pActivationParams,ppv))
#define _IMMDeviceEnumerator_EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices) (This)->EnumAudioEndpoints(dataFlow,dwStateMask,ppDevices)
#define _IMMDeviceEnumerator_GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint) (This)->GetDefaultAudioEndpoint(dataFlow,role,ppEndpoint)
#define _IMMDevice_OpenPropertyStore(This,stgmAccess,ppProperties) (This)->OpenPropertyStore(stgmAccess,ppProperties)
#define _IMMDevice_GetId(This,ppstrId) ((This)->GetId(ppstrId))
#define _IPropertyStore_GetValue(This,key,pv) ( (This)->GetValue(key,pv) )
#define _IMMDeviceCollection_GetCount(This,cProps) ( (This)->GetCount(cProps) )
#define _IAudioCaptureClient_GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) \
( (This) -> GetBuffer(ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) )
#define _IAudioCaptureClient_ReleaseBuffer(This,NumFramesRead) \
( (This) -> ReleaseBuffer(NumFramesRead) )
#define _IAudioCaptureClient_GetNextPacketSize(This,pNumFramesInNextPacket) \
( (This) -> GetNextPacketSize(pNumFramesInNextPacket) )
#else
#define _IMMDeviceCollection_Item(This,nDevice,ppdevice) (This)->lpVtbl->Item(This,nDevice,ppdevice)
#define _IAudioClient_Start(This) ( (This)->lpVtbl -> Start(This) )
#define _IAudioClient_Stop(This) ( (This)->lpVtbl -> Stop(This) )
#define _IAudioClient_GetCurrentPadding(This,pNumPaddingFrames) \
( (This)->lpVtbl -> GetCurrentPadding(This,pNumPaddingFrames) )
#define _IAudioRenderClient_GetBuffer(This,NumFramesRequested,ppData) \
( (This)->lpVtbl -> GetBuffer(This,NumFramesRequested,ppData) )
#define _IAudioRenderClient_ReleaseBuffer(This,NumFramesWritten,dwFlags) \
( (This)->lpVtbl -> ReleaseBuffer(This,NumFramesWritten,dwFlags) )
#define _IAudioClient_GetService(This,riid,ppv) ( (This)->lpVtbl -> GetService(This,&(riid),ppv) )
#define _IAudioClient_SetEventHandle(This,eventHandle) ( (This)->lpVtbl -> SetEventHandle(This,eventHandle) )
#define _IAudioClient_GetBufferSize(This,pNumBufferFrames) ( (This)->lpVtbl -> GetBufferSize(This,pNumBufferFrames) )
#define _IAudioClient_GetStreamLatency(This,phnsLatency) ( (This)->lpVtbl -> GetStreamLatency(This,phnsLatency) )
#define _IAudioClient_GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) ( (This)->lpVtbl -> GetDevicePeriod(This,phnsDefaultDevicePeriod,phnsMinimumDevicePeriod) )
#define _IAudioClient_Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid) \
( (This)->lpVtbl->Initialize(This,ShareMode,StreamFlags,hnsBufferDuration,hnsPeriodicity,pFormat,AudioSessionGuid))
#define _IAudioClient_IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch) \
( (This)->lpVtbl->IsFormatSupported(This,ShareMode,pFormat,ppClosestMatch))
#define _IMMDevice_Activate(This,iid,dwClsCtx,pActivationParams,ppv) ((This)->lpVtbl->Activate(This,&(iid),dwClsCtx,pActivationParams,ppv))
#define _IMMDeviceEnumerator_EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices) (This)->lpVtbl->EnumAudioEndpoints(This,dataFlow,dwStateMask,ppDevices)
#define _IMMDeviceEnumerator_GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint) (This)->lpVtbl->GetDefaultAudioEndpoint(This,dataFlow,role,ppEndpoint)
#define _IMMDevice_OpenPropertyStore(This,stgmAccess,ppProperties) (This)->lpVtbl->OpenPropertyStore(This,stgmAccess,ppProperties)
#define _IMMDevice_GetId(This,ppstrId) (This)->lpVtbl->GetId(This,ppstrId)
#define _IPropertyStore_GetValue(This,key,pv) ( (This)->lpVtbl -> GetValue(This,&(key),pv) )
#define _IMMDeviceCollection_GetCount(This,cProps) ( (This)->lpVtbl -> GetCount(This,cProps) )
#define _IAudioCaptureClient_GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) \
( (This)->lpVtbl -> GetBuffer(This,ppData,pNumFramesToRead,pdwFlags,pu64DevicePosition,pu64QPCPosition) )
#define _IAudioCaptureClient_ReleaseBuffer(This,NumFramesRead) \
( (This)->lpVtbl -> ReleaseBuffer(This,NumFramesRead) )
#define _IAudioCaptureClient_GetNextPacketSize(This,pNumFramesInNextPacket) \
( (This)-> lpVtbl -> GetNextPacketSize(This,pNumFramesInNextPacket) )
#endif
#endif
+81 -83
View File
@@ -16,22 +16,20 @@
#include "pipewire.h"
#include <spa/utils/result.h>
#include <pipewire/pipewire.h>
#include <retro_assert.h>
#include "verbosity.h"
#include "../../verbosity.h"
static void core_error_cb(void *data, uint32_t id, int seq, int res, const char *message)
{
pipewire_core_t *pw = (pipewire_core_t*)data;
RARCH_ERR("[PipeWire]: error id:%u seq:%d res:%d (%s): %s\n",
RARCH_ERR("[PipeWire] Error id:%u seq:%d res:%d (%s): %s.\n",
id, seq, res, spa_strerror(res), message);
/* stop and exit the thread loop */
pw_thread_loop_stop(pw->thread_loop);
}
@@ -42,11 +40,9 @@ static void core_done_cb(void *data, uint32_t id, int seq)
retro_assert(id == PW_ID_CORE);
pw->last_seq = seq;
if (pw->pending_seq == seq)
{
/* stop and exit the thread loop */
pw_thread_loop_signal(pw->thread_loop, false);
}
}
static const struct pw_core_events core_events = {
@@ -55,66 +51,7 @@ static const struct pw_core_events core_events = {
.error = core_error_cb,
};
size_t calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels)
{
uint32_t sample_size = 1;
switch (fmt)
{
case SPA_AUDIO_FORMAT_S8:
case SPA_AUDIO_FORMAT_U8:
sample_size = 1;
break;
case SPA_AUDIO_FORMAT_S16_BE:
case SPA_AUDIO_FORMAT_S16_LE:
case SPA_AUDIO_FORMAT_U16_BE:
case SPA_AUDIO_FORMAT_U16_LE:
sample_size = 2;
break;
case SPA_AUDIO_FORMAT_S32_BE:
case SPA_AUDIO_FORMAT_S32_LE:
case SPA_AUDIO_FORMAT_U32_BE:
case SPA_AUDIO_FORMAT_U32_LE:
case SPA_AUDIO_FORMAT_F32_BE:
case SPA_AUDIO_FORMAT_F32_LE:
sample_size = 4;
break;
default:
RARCH_ERR("[PipeWire]: Bad spa_audio_format %d\n", fmt);
break;
}
return sample_size * nchannels;
}
void set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS])
{
memcpy(position, (uint32_t[SPA_AUDIO_MAX_CHANNELS]) { SPA_AUDIO_CHANNEL_UNKNOWN, },
sizeof(uint32_t) * SPA_AUDIO_MAX_CHANNELS);
switch (channels)
{
case 8:
position[6] = SPA_AUDIO_CHANNEL_SL;
position[7] = SPA_AUDIO_CHANNEL_SR;
/* fallthrough */
case 6:
position[2] = SPA_AUDIO_CHANNEL_FC;
position[3] = SPA_AUDIO_CHANNEL_LFE;
position[4] = SPA_AUDIO_CHANNEL_RL;
position[5] = SPA_AUDIO_CHANNEL_RR;
/* fallthrough */
case 2:
position[0] = SPA_AUDIO_CHANNEL_FL;
position[1] = SPA_AUDIO_CHANNEL_FR;
break;
case 1:
position[0] = SPA_AUDIO_CHANNEL_MONO;
break;
default:
RARCH_ERR("[PipeWire]: Internal error: unsupported channel count %d\n", channels);
}
}
void pipewire_wait_resync(pipewire_core_t *pw)
void pipewire_core_wait_resync(pipewire_core_t *pw)
{
retro_assert(pw);
pw->pending_seq = pw_core_sync(pw->core, PW_ID_CORE, pw->pending_seq);
@@ -127,7 +64,7 @@ void pipewire_wait_resync(pipewire_core_t *pw)
}
}
bool pipewire_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active)
bool pipewire_stream_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active)
{
enum pw_stream_state st;
const char *error;
@@ -144,31 +81,92 @@ bool pipewire_set_active(struct pw_thread_loop *loop, struct pw_stream *stream,
return active ? st == PW_STREAM_STATE_STREAMING : st == PW_STREAM_STATE_PAUSED;
}
bool pipewire_core_init(pipewire_core_t *pw, const char *loop_name)
bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struct pw_registry_events *events)
{
retro_assert(pw);
retro_assert(!*pw);
pw->thread_loop = pw_thread_loop_new(loop_name, NULL);
if (!pw->thread_loop)
*pw = (pipewire_core_t*)calloc(1, sizeof(pipewire_core_t));
if (!*pw)
return false;
pw->ctx = pw_context_new(pw_thread_loop_get_loop(pw->thread_loop), NULL, 0);
if (!pw->ctx)
(*pw)->devicelist = string_list_new();
if (!(*pw)->devicelist)
{
free(*pw);
*pw = NULL;
return false;
}
pw_init(NULL, NULL);
(*pw)->thread_loop = pw_thread_loop_new(loop_name, NULL);
if (!(*pw)->thread_loop)
return false;
if (pw_thread_loop_start(pw->thread_loop) < 0)
(*pw)->ctx = pw_context_new(pw_thread_loop_get_loop((*pw)->thread_loop), NULL, 0);
if (!(*pw)->ctx)
return false;
pw_thread_loop_lock(pw->thread_loop);
pw->core = pw_context_connect(pw->ctx, NULL, 0);
if(!pw->core)
if (pw_thread_loop_start((*pw)->thread_loop) < 0)
return false;
if (pw_core_add_listener(pw->core,
&pw->core_listener,
&core_events, pw) < 0)
return false;
pw_thread_loop_lock((*pw)->thread_loop);
(*pw)->core = pw_context_connect((*pw)->ctx, NULL, 0);
if (!(*pw)->core)
goto unlock;
if (pw_core_add_listener((*pw)->core,
&(*pw)->core_listener,
&core_events, *pw) < 0)
goto unlock;
if (events)
{
(*pw)->registry = pw_core_get_registry((*pw)->core, PW_VERSION_REGISTRY, 0);
spa_zero((*pw)->registry_listener);
pw_registry_add_listener((*pw)->registry, &(*pw)->registry_listener, events, *pw);
}
return true;
unlock:
pw_thread_loop_unlock((*pw)->thread_loop);
return false;
}
void pipewire_core_deinit(pipewire_core_t *pw)
{
if (!pw)
{
pw_deinit();
return;
}
if (pw->thread_loop)
pw_thread_loop_stop(pw->thread_loop);
if (pw->registry)
{
spa_hook_remove(&pw->registry_listener);
pw_proxy_destroy((struct pw_proxy*)pw->registry);
}
if (pw->core)
{
spa_hook_remove(&pw->core_listener);
pw_core_disconnect(pw->core);
}
if (pw->ctx)
pw_context_destroy(pw->ctx);
if (pw->thread_loop)
pw_thread_loop_destroy(pw->thread_loop);
if (pw->devicelist)
string_list_free(pw->devicelist);
free(pw);
pw_deinit();
}
+10 -11
View File
@@ -21,9 +21,11 @@
#include <spa/param/audio/format-utils.h>
#include <spa/utils/ringbuffer.h>
#include <pipewire/pipewire.h>
#include <lists/string_list.h>
#define PW_RARCH_APPNAME "RetroArch"
/* String literals are part of the PipeWire specification */
@@ -31,34 +33,31 @@
#define PW_RARCH_MEDIA_TYPE_VIDEO "Video"
#define PW_RARCH_MEDIA_TYPE_MIDI "Midi"
#define PW_RARCH_MEDIA_CATEGORY_PLAYBACK "Playback"
#define PW_RARCH_MEDIA_CATEGORY_RECORD "Capture"
#define PW_RARCH_MEDIA_CATEGORY_RECORD "Capture"
#define PW_RARCH_MEDIA_ROLE "Game"
typedef struct pipewire_core
{
struct pw_thread_loop *thread_loop;
struct pw_context *ctx;
struct pw_core *core;
struct spa_hook core_listener;
int last_seq, pending_seq;
struct pw_registry *registry;
struct spa_hook registry_listener;
struct pw_client *client;
struct spa_hook client_listener;
bool nonblock;
struct string_list *devicelist;
bool nonblock;
} pipewire_core_t;
size_t calc_frame_size(enum spa_audio_format fmt, uint32_t nchannels);
bool pipewire_core_init(pipewire_core_t **pw, const char *loop_name, const struct pw_registry_events *events);
void set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS]);
void pipewire_core_deinit(pipewire_core_t *pw);
void pipewire_wait_resync(pipewire_core_t *pipewire);
void pipewire_core_wait_resync(pipewire_core_t *pw);
bool pipewire_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active);
bool pipewire_core_init(pipewire_core_t *pipewire, const char *loop_name);
bool pipewire_stream_set_active(struct pw_thread_loop *loop, struct pw_stream *stream, bool active);
#endif /* _RETROARCH_PIPEWIRE */
-735
View File
@@ -1,735 +0,0 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 Daniel De Matteis
* Copyright (C) 2023 Jesse Talavera-Greenberg
*
* 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 "wasapi.h"
#ifdef HAVE_MICROPHONE
#include "../microphone_driver.h"
#endif
#include <string/stdstring.h>
#include <queues/fifo_queue.h>
#include <lists/string_list.h>
#include "mmdevice_common.h"
#include "../../configuration.h"
#include "../../verbosity.h"
const char *hresult_name(HRESULT hr)
{
switch (hr)
{
/* Standard error codes */
case E_INVALIDARG:
return "E_INVALIDARG";
case E_NOINTERFACE:
return "E_NOINTERFACE";
case E_OUTOFMEMORY:
return "E_OUTOFMEMORY";
case E_POINTER:
return "E_POINTER";
/* Standard success codes */
case S_FALSE:
return "S_FALSE";
case S_OK:
return "S_OK";
/* AUDCLNT error codes */
case AUDCLNT_E_ALREADY_INITIALIZED:
return "AUDCLNT_E_ALREADY_INITIALIZED";
case AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL:
return "AUDCLNT_E_BUFDURATION_PERIOD_NOT_EQUAL";
case AUDCLNT_E_BUFFER_ERROR:
return "AUDCLNT_E_BUFFER_ERROR";
case AUDCLNT_E_BUFFER_OPERATION_PENDING:
return "AUDCLNT_E_BUFFER_OPERATION_PENDING";
case AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED:
return "AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED";
case AUDCLNT_E_BUFFER_SIZE_ERROR:
return "AUDCLNT_E_BUFFER_SIZE_ERROR";
case AUDCLNT_E_CPUUSAGE_EXCEEDED:
return "AUDCLNT_E_CPUUSAGE_EXCEEDED";
case AUDCLNT_E_DEVICE_IN_USE:
return "AUDCLNT_E_DEVICE_IN_USE";
case AUDCLNT_E_DEVICE_INVALIDATED:
return "AUDCLNT_E_DEVICE_INVALIDATED";
case AUDCLNT_E_ENDPOINT_CREATE_FAILED:
return "AUDCLNT_E_ENDPOINT_CREATE_FAILED";
case AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED:
return "AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED";
case AUDCLNT_E_INVALID_DEVICE_PERIOD:
return "AUDCLNT_E_INVALID_DEVICE_PERIOD";
case AUDCLNT_E_INVALID_SIZE:
return "AUDCLNT_E_INVALID_SIZE";
case AUDCLNT_E_NOT_INITIALIZED:
return "AUDCLNT_E_NOT_INITIALIZED";
case AUDCLNT_E_OUT_OF_ORDER:
return "AUDCLNT_E_OUT_OF_ORDER";
case AUDCLNT_E_SERVICE_NOT_RUNNING:
return "AUDCLNT_E_SERVICE_NOT_RUNNING";
case AUDCLNT_E_UNSUPPORTED_FORMAT:
return "AUDCLNT_E_UNSUPPORTED_FORMAT";
case AUDCLNT_E_WRONG_ENDPOINT_TYPE:
return "AUDCLNT_E_WRONG_ENDPOINT_TYPE";
/* AUDCLNT success codes */
case AUDCLNT_S_BUFFER_EMPTY:
return "AUDCLNT_S_BUFFER_EMPTY";
/* Something else; probably from an API that we started using
* after mic support was implemented */
default:
break;
}
return "<unknown>";
}
static const char *wave_subtype_name(const GUID *guid)
{
if (!memcmp(guid, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, sizeof(GUID)))
return "KSDATAFORMAT_SUBTYPE_IEEE_FLOAT";
return "<unknown sub-format>";
}
static const char *wave_format_name(const WAVEFORMATEXTENSIBLE *format)
{
switch (format->Format.wFormatTag)
{
case WAVE_FORMAT_PCM:
return "WAVE_FORMAT_PCM";
case WAVE_FORMAT_EXTENSIBLE:
return wave_subtype_name(&format->SubFormat);
default:
break;
}
return "<unknown>";
}
const char* wasapi_error(DWORD error)
{
static char error_message[256];
FormatMessage(
FORMAT_MESSAGE_IGNORE_INSERTS
| FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
error,
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
error_message,
sizeof(error_message) - 1,
NULL);
return error_message;
}
static const char* wasapi_data_flow_name(EDataFlow data_flow)
{
switch (data_flow)
{
case eCapture:
return "eCapture";
case eRender:
return "eRender";
case eAll:
return "eAll";
default:
break;
}
return "<unknown>";
}
static void wasapi_set_format(WAVEFORMATEXTENSIBLE *wf,
bool float_fmt, unsigned rate, unsigned channels)
{
WORD wBitsPerSample = float_fmt ? 32 : 16;
WORD nBlockAlign = (channels * wBitsPerSample) / 8;
DWORD nAvgBytesPerSec = rate * nBlockAlign;
wf->Format.nChannels = channels;
wf->Format.nSamplesPerSec = rate;
wf->Format.nAvgBytesPerSec = nAvgBytesPerSec;
wf->Format.nBlockAlign = nBlockAlign;
wf->Format.wBitsPerSample = wBitsPerSample;
if (float_fmt)
{
wf->Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wf->Format.cbSize = sizeof(WORD) + sizeof(DWORD) + sizeof(GUID);
wf->Samples.wValidBitsPerSample = wBitsPerSample;
wf->dwChannelMask = channels == 1 ? KSAUDIO_SPEAKER_MONO : KSAUDIO_SPEAKER_STEREO;
wf->SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
}
else
{
wf->Format.wFormatTag = WAVE_FORMAT_PCM;
wf->Format.cbSize = 0;
wf->Samples.wValidBitsPerSample = 0;
wf->dwChannelMask = 0;
memset(&wf->SubFormat, 0, sizeof(wf->SubFormat));
}
}
/**
* @param[in] format The format to check.
* @return \c true if \c format is suitable for RetroArch.
*/
static bool wasapi_is_format_suitable(const WAVEFORMATEXTENSIBLE *format)
{
/* RetroArch only supports mono mic input and stereo speaker output */
if (!format || format->Format.nChannels == 0 || format->Format.nChannels > 2)
return false;
switch (format->Format.wFormatTag)
{
case WAVE_FORMAT_PCM:
if (format->Format.wBitsPerSample != 16)
/* Integer samples must be 16-bit */
return false;
break;
case WAVE_FORMAT_EXTENSIBLE:
if (!(!memcmp(&format->SubFormat, &KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, sizeof(GUID))))
/* RetroArch doesn't support any other subformat */
return false;
if (format->Format.wBitsPerSample != 32)
/* floating-point samples must be 32-bit */
return false;
break;
default:
/* Other formats are unsupported */
return false;
}
return true;
}
/**
* Selects a sample format suitable for the given device.
* @param[in,out] format The place where the chosen format will be written,
* as well as the first format checked.
* @param[in] client The audio client (i.e. device handle) for which a format will be selected.
* @param[in] mode The device mode (shared or exclusive) that \c client will use.
* @param[in] channels The number of channels that will constitute one audio frame.
* @return \c true if successful, \c false if a suitable format wasn't found or there was an error.
* If \c true, the selected format will be written to \c format.
* If \c false, the value referred by \c format will be unchanged.
*/
static bool wasapi_select_device_format(WAVEFORMATEXTENSIBLE *format, IAudioClient *client, AUDCLNT_SHAREMODE mode, unsigned channels)
{
/* Try the requested sample format first, then try the other one. */
WAVEFORMATEXTENSIBLE *suggested_format = NULL;
bool result = false;
HRESULT hr = _IAudioClient_IsFormatSupported(
client, mode,
(const WAVEFORMATEX *)format,
(WAVEFORMATEX **)&suggested_format);
/* The Windows docs say that casting these arguments to WAVEFORMATEX* is okay. */
switch (hr)
{
case S_OK:
/* The requested format is okay without any changes. */
result = true;
break;
case S_FALSE:
/* The requested format is unsupported, but Windows has suggested a similar one. */
RARCH_DBG("[WASAPI]: Windows suggests a format of (%s, %u-channel, %uHz).\n",
wave_format_name(suggested_format),
suggested_format->Format.nChannels,
suggested_format->Format.nSamplesPerSec);
if (wasapi_is_format_suitable(suggested_format))
{
*format = *suggested_format;
result = true;
}
else
{
RARCH_ERR("[WASAPI]: Windows suggested a format, but RetroArch can't use it.\n");
}
break;
case AUDCLNT_E_UNSUPPORTED_FORMAT:
{
/* The requested format is unsupported
* and Windows was unable to suggest another.
* Usually happens with exclusive mode.
* RetroArch will try selecting a format. */
size_t i, j;
bool preferred_formats[2];
preferred_formats[0] = (format->Format.wFormatTag == WAVE_FORMAT_EXTENSIBLE);
preferred_formats[1] = (format->Format.wFormatTag != WAVE_FORMAT_EXTENSIBLE);
RARCH_WARN("[WASAPI]: Requested format not supported, and Windows could not suggest one. RetroArch will do so.\n");
for (i = 0; i < ARRAY_SIZE(preferred_formats); ++i)
{
static const unsigned preferred_rates[] = { 48000, 44100, 96000, 192000, 32000 };
for (j = 0; j < ARRAY_SIZE(preferred_rates); ++j)
{
HRESULT format_check_hr;
WAVEFORMATEXTENSIBLE possible_format;
wasapi_set_format(&possible_format, preferred_formats[i], preferred_rates[j], channels);
format_check_hr = _IAudioClient_IsFormatSupported(client, mode, (const WAVEFORMATEX *) &possible_format, NULL);
if (SUCCEEDED(format_check_hr))
{
*format = possible_format;
result = true;
RARCH_DBG("[WASAPI]: RetroArch suggests a format of (%s, %u-channel, %uHz).\n",
wave_format_name(format),
format->Format.nChannels,
format->Format.nSamplesPerSec);
goto done;
}
}
}
RARCH_ERR("[WASAPI]: Failed to select client format: No suitable format available.\n");
break;
}
default:
/* Something else went wrong. */
RARCH_ERR("[WASAPI]: Failed to select client format: %s.\n", hresult_name(hr));
break;
}
done:
/* IAudioClient::IsFormatSupported allocates a format object. */
if (suggested_format)
CoTaskMemFree(suggested_format);
return result;
}
static IAudioClient *wasapi_init_client_ex(IMMDevice *device,
bool *float_fmt, unsigned *rate, unsigned latency, unsigned channels)
{
WAVEFORMATEXTENSIBLE wf;
IAudioClient *client = NULL;
REFERENCE_TIME minimum_period = 0;
REFERENCE_TIME buffer_duration = 0;
UINT32 buffer_length = 0;
HRESULT hr = _IMMDevice_Activate(device,
IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&client);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: IMMDevice::Activate failed: %s.\n", hresult_name(hr));
return NULL;
}
hr = _IAudioClient_GetDevicePeriod(client, NULL, &minimum_period);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to get minimum device period of exclusive client: %s.\n", hresult_name(hr));
goto error;
}
/* Buffer_duration is in 100ns units. */
buffer_duration = latency * 10000.0;
if (buffer_duration < minimum_period)
buffer_duration = minimum_period;
wasapi_set_format(&wf, *float_fmt, *rate, channels);
RARCH_DBG("[WASAPI]: Requesting exclusive %u-bit %u-channel client with %s samples at %uHz %ums.\n",
wf.Format.wBitsPerSample,
wf.Format.nChannels,
wave_format_name(&wf),
wf.Format.nSamplesPerSec,
latency);
if (!wasapi_select_device_format(&wf, client, AUDCLNT_SHAREMODE_EXCLUSIVE, channels))
{
RARCH_ERR("[WASAPI]: Failed to select a suitable device format.\n");
goto error;
}
hr = _IAudioClient_Initialize(client, AUDCLNT_SHAREMODE_EXCLUSIVE,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
buffer_duration, buffer_duration, (WAVEFORMATEX*)&wf, NULL);
if (hr == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED)
{
RARCH_WARN("[WASAPI]: Unaligned buffer size: %s.\n", hresult_name(hr));
hr = _IAudioClient_GetBufferSize(client, &buffer_length);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to get buffer size of client: %s.\n", hresult_name(hr));
goto error;
}
IFACE_RELEASE(client);
hr = _IMMDevice_Activate(device,
IID_IAudioClient,
CLSCTX_ALL, NULL, (void**)&client);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: IMMDevice::Activate failed: %s.\n", hresult_name(hr));
return NULL;
}
buffer_duration = 10000.0 * 1000.0 / (*rate) * buffer_length + 0.5;
hr = _IAudioClient_Initialize(client, AUDCLNT_SHAREMODE_EXCLUSIVE,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
buffer_duration, buffer_duration, (WAVEFORMATEX*)&wf, NULL);
}
if (hr == AUDCLNT_E_ALREADY_INITIALIZED)
{
IFACE_RELEASE(client);
hr = _IMMDevice_Activate(device,
IID_IAudioClient,
CLSCTX_ALL, NULL, (void**)&client);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI] IMMDevice::Activate failed: %s.\n", hresult_name(hr));
return NULL;
}
hr = _IAudioClient_Initialize(client, AUDCLNT_SHAREMODE_EXCLUSIVE,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK | AUDCLNT_STREAMFLAGS_NOPERSIST,
buffer_duration, buffer_duration, (WAVEFORMATEX*)&wf, NULL);
}
if (hr != AUDCLNT_E_UNSUPPORTED_FORMAT)
{
if (hr == AUDCLNT_E_DEVICE_IN_USE)
goto error;
if (hr == AUDCLNT_E_EXCLUSIVE_MODE_NOT_ALLOWED)
goto error;
}
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: IAudioClient::Initialize failed: %s.\n", hresult_name(hr));
goto error;
}
*float_fmt = wf.Format.wFormatTag != WAVE_FORMAT_PCM;
*rate = wf.Format.nSamplesPerSec;
return client;
error:
IFACE_RELEASE(client);
return NULL;
}
static IAudioClient *wasapi_init_client_sh(IMMDevice *device,
bool *float_fmt, unsigned *rate, unsigned latency, unsigned channels)
{
WAVEFORMATEXTENSIBLE wf;
IAudioClient *client = NULL;
settings_t *settings = config_get_ptr();
unsigned sh_buffer_length = settings->uints.audio_wasapi_sh_buffer_length;
REFERENCE_TIME default_period = 0;
REFERENCE_TIME buffer_duration = 0;
HRESULT hr = _IMMDevice_Activate(device,
IID_IAudioClient, CLSCTX_ALL, NULL, (void**)&client);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: IMMDevice::Activate failed: %s.\n", hresult_name(hr));
return NULL;
}
hr = _IAudioClient_GetDevicePeriod(client, &default_period, NULL);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to get default device period of shared client: %s.\n", hresult_name(hr));
goto error;
}
/* Use audio latency setting for buffer size if allowed */
if ( (sh_buffer_length < WASAPI_SH_BUFFER_DEVICE_PERIOD)
|| (sh_buffer_length > WASAPI_SH_BUFFER_CLIENT_BUFFER))
{
/* Buffer_duration is in 100ns units. */
buffer_duration = latency * 10000.0;
if (buffer_duration < default_period)
buffer_duration = default_period;
}
wasapi_set_format(&wf, *float_fmt, *rate, channels);
RARCH_DBG("[WASAPI]: Requesting shared %u-bit %u-channel client with %s samples at %uHz %ums.\n",
wf.Format.wBitsPerSample,
wf.Format.nChannels,
wave_format_name(&wf),
wf.Format.nSamplesPerSec,
latency);
if (!wasapi_select_device_format(&wf, client, AUDCLNT_SHAREMODE_SHARED, channels))
{
RARCH_ERR("[WASAPI]: Failed to select a suitable device format.\n");
goto error;
}
hr = _IAudioClient_Initialize(client, AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
buffer_duration, 0, (WAVEFORMATEX*)&wf, NULL);
if (hr == AUDCLNT_E_ALREADY_INITIALIZED)
{
IFACE_RELEASE(client);
hr = _IMMDevice_Activate(device,
IID_IAudioClient,
CLSCTX_ALL, NULL, (void**)&client);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: IMMDevice::Activate failed: %s.\n", hresult_name(hr));
return NULL;
}
hr = _IAudioClient_Initialize(client, AUDCLNT_SHAREMODE_SHARED,
AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
buffer_duration, 0, (WAVEFORMATEX*)&wf, NULL);
}
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: IAudioClient::Initialize failed: %s.\n", hresult_name(hr));
goto error;
}
*float_fmt = wf.Format.wFormatTag != WAVE_FORMAT_PCM;
*rate = wf.Format.nSamplesPerSec;
return client;
error:
IFACE_RELEASE(client);
return NULL;
}
IMMDevice *wasapi_init_device(const char *id, EDataFlow data_flow)
{
HRESULT hr;
UINT32 dev_count, i;
IMMDeviceEnumerator *enumerator = NULL;
IMMDevice *device = NULL;
IMMDeviceCollection *collection = NULL;
const char *data_flow_name = wasapi_data_flow_name(data_flow);
if (id)
RARCH_DBG("[WASAPI]: Initializing %s device \"%s\"..\n", data_flow_name, id);
else
RARCH_DBG("[WASAPI]: Initializing default %s device..\n", data_flow_name);
#ifdef __cplusplus
hr = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
IID_IMMDeviceEnumerator, (void **)&enumerator);
#else
hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL,
&IID_IMMDeviceEnumerator, (void **)&enumerator);
#endif
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to create device enumerator: %s.\n", hresult_name(hr));
goto error;
}
if (id)
{
/* If a specific device was requested... */
int32_t idx_found = -1;
struct string_list *list = (struct string_list*)mmdevice_list_new(NULL, data_flow);
if (!list)
{
RARCH_ERR("[WASAPI]: Failed to allocate %s device list.\n", data_flow_name);
goto error;
}
if (list->elems)
{
/* If any devices were found... */
unsigned d;
for (d = 0; d < list->size; d++)
{
if (string_is_equal(id, list->elems[d].data))
{
RARCH_DBG("[WASAPI]: Found device #%d: \"%s\".\n", d, list->elems[d].data);
idx_found = d;
break;
}
}
/* Index was not found yet based on name string,
* just assume id is a one-character number index. */
if (idx_found == -1 && isdigit(id[0]))
{
idx_found = strtoul(id, NULL, 0);
RARCH_LOG("[WASAPI]: Fallback, %s device index is a single number index instead: %u.\n", data_flow_name, idx_found);
}
}
string_list_free(list);
if (idx_found == -1)
idx_found = 0;
hr = _IMMDeviceEnumerator_EnumAudioEndpoints(enumerator,
data_flow, DEVICE_STATE_ACTIVE, &collection);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to enumerate audio endpoints: %s.\n", hresult_name(hr));
goto error;
}
hr = _IMMDeviceCollection_GetCount(collection, &dev_count);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to count IMMDevices: %s.\n", hresult_name(hr));
goto error;
}
for (i = 0; i < dev_count; ++i)
{
hr = _IMMDeviceCollection_Item(collection, i, &device);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to get IMMDevice #%d: %s.\n", i, hresult_name(hr));
goto error;
}
if (i == (UINT32)idx_found)
break;
IFACE_RELEASE(device);
}
}
else
{
hr = _IMMDeviceEnumerator_GetDefaultAudioEndpoint(
enumerator, data_flow, eConsole, &device);
if (FAILED(hr))
{
RARCH_ERR("[WASAPI]: Failed to get default audio endpoint: %s.\n", hresult_name(hr));
goto error;
}
}
if (!device)
goto error;
IFACE_RELEASE(collection);
IFACE_RELEASE(enumerator);
return device;
error:
IFACE_RELEASE(collection);
IFACE_RELEASE(enumerator);
if (id)
RARCH_WARN("[WASAPI]: Failed to initialize %s device \"%s\".\n", data_flow_name, id);
else
RARCH_ERR("[WASAPI]: Failed to initialize default %s device.\n", data_flow_name);
return NULL;
}
IAudioClient *wasapi_init_client(IMMDevice *device, bool *exclusive,
bool *float_fmt, unsigned *rate, unsigned latency, unsigned channels)
{
HRESULT hr;
IAudioClient *client;
float latency_res;
REFERENCE_TIME device_period = 0;
REFERENCE_TIME device_period_min = 0;
REFERENCE_TIME stream_latency = 0;
UINT32 buffer_length = 0;
if (*exclusive)
{
client = wasapi_init_client_ex(device, float_fmt, rate, latency, channels);
if (!client)
{
RARCH_WARN("[WASAPI]: Failed to initialize exclusive client, attempting shared client.\n");
client = wasapi_init_client_sh(device, float_fmt, rate, latency, channels);
if (client)
*exclusive = false;
}
}
else
{
client = wasapi_init_client_sh(device, float_fmt, rate, latency, channels);
if (!client)
{
RARCH_WARN("[WASAPI]: Failed to initialize shared client, attempting exclusive client.\n");
client = wasapi_init_client_ex(device, float_fmt, rate, latency, channels);
if (client)
*exclusive = true;
}
}
if (!client)
return NULL;
/* Remaining calls are for logging purposes. */
hr = _IAudioClient_GetDevicePeriod(client, &device_period, &device_period_min);
if (SUCCEEDED(hr))
{
RARCH_DBG("[WASAPI]: Default device period is %.1fms.\n", (float)device_period * 100 / 1e6);
RARCH_DBG("[WASAPI]: Minimum device period is %.1fms.\n", (float)device_period_min * 100 / 1e6);
}
else
RARCH_WARN("[WASAPI]: IAudioClient::GetDevicePeriod failed: %s.\n", hresult_name(hr));
if (!*exclusive)
{
hr = _IAudioClient_GetStreamLatency(client, &stream_latency);
if (SUCCEEDED(hr))
RARCH_DBG("[WASAPI]: Shared stream latency is %.1fms.\n", (float)stream_latency * 100 / 1e6);
else
RARCH_WARN("[WASAPI]: IAudioClient::GetStreamLatency failed: %s.\n", hresult_name(hr));
}
hr = _IAudioClient_GetBufferSize(client, &buffer_length);
if (SUCCEEDED(hr))
{
size_t num_samples = buffer_length * channels;
size_t num_bytes = num_samples * (*float_fmt ? sizeof(float) : sizeof(int16_t));
RARCH_DBG("[WASAPI]: Endpoint buffer size is %u frames (%u samples, %u bytes, %.1f ms).\n",
buffer_length, num_samples, num_bytes, (float)buffer_length * 1000.0 / *rate);
}
else
RARCH_WARN("[WASAPI]: IAudioClient::GetBufferSize failed: %s.\n", hresult_name(hr));
if (*exclusive)
latency_res = (float)buffer_length * 1000.0 / (*rate);
else
{
settings_t *settings = config_get_ptr();
unsigned sh_buffer_length = settings->uints.audio_wasapi_sh_buffer_length;
switch (sh_buffer_length)
{
case WASAPI_SH_BUFFER_AUDIO_LATENCY:
case WASAPI_SH_BUFFER_CLIENT_BUFFER:
latency_res = (float)buffer_length * 1000.0 / (*rate);
break;
case WASAPI_SH_BUFFER_DEVICE_PERIOD:
latency_res = (float)(stream_latency + device_period) / 10000.0;
break;
default:
latency_res = (float)sh_buffer_length * 1000.0 / (*rate);
break;
}
}
RARCH_LOG("[WASAPI]: Client initialized (%s, %s, %uHz, %.1fms).\n",
*exclusive ? "exclusive" : "shared",
*float_fmt ? "FLOAT" : "PCM",
*rate, latency_res);
return client;
}
-10
View File
@@ -17,24 +17,14 @@
/**
* Contains WASAPI-specific support functions that are used
* by the WASAPI audio and microphone drivers.
*
*/
#ifndef RETROARCH_COMMON_WASAPI_H
#define RETROARCH_COMMON_WASAPI_H
#include "mmdevice_common_inline.h"
#include <boolean.h>
/* Shared buffer size replacement placeholders */
#define WASAPI_SH_BUFFER_AUDIO_LATENCY 0
#define WASAPI_SH_BUFFER_DEVICE_PERIOD 32
#define WASAPI_SH_BUFFER_CLIENT_BUFFER 64
const char *hresult_name(HRESULT hr);
const char* wasapi_error(DWORD error);
IMMDevice *wasapi_init_device(const char *id, EDataFlow data_flow);
IAudioClient *wasapi_init_client(IMMDevice *device, bool *exclusive,
bool *float_fmt, unsigned *rate, unsigned latency, unsigned channels);
#endif /* RETROARCH_COMMON_WASAPI_H */
+313 -46
View File
@@ -1,6 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2023-2025 - Jesse Talavera-Greenberg
*
* 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-
@@ -20,12 +21,281 @@
#include <string/stdstring.h>
#include <alsa/asoundlib.h>
#include <alsa/pcm.h>
#include <asm-generic/errno.h>
#include "../audio_driver.h"
#include "../common/alsa.h"
#include "../../verbosity.h"
#ifdef HAVE_MICROPHONE
#include "../microphone_driver.h"
#define BYTES_TO_FRAMES(bytes, frame_bits) ((bytes) * 8 / frame_bits)
#define FRAMES_TO_BYTES(frames, frame_bits) ((frames) * frame_bits / 8)
typedef struct alsa_microphone_handle
{
snd_pcm_t *pcm;
alsa_stream_info_t stream_info;
} alsa_microphone_handle_t;
typedef struct alsa_microphone
{
bool nonblock;
} alsa_microphone_t;
static void *alsa_microphone_init(void)
{
alsa_microphone_t *alsa = (alsa_microphone_t*)calloc(1, sizeof(alsa_microphone_t));
if (!alsa)
{
RARCH_ERR("[ALSA] Failed to allocate driver context.\n");
return NULL;
}
RARCH_LOG("[ALSA] Using ALSA version %s.\n", snd_asoundlib_version());
return alsa;
}
static void alsa_microphone_close_mic(void *driver_context, void *mic_context);
static void alsa_microphone_free(void *driver_context)
{
alsa_microphone_t *alsa = (alsa_microphone_t*)driver_context;
/* The mic frontend should've closed all mics before calling free(). */
if (alsa)
{
snd_config_update_free_global();
free(alsa);
}
}
static bool alsa_microphone_start_mic(void *driver_context, void *mic_context);
static int alsa_microphone_read(void *driver_context, void *mic_context, void *s, size_t len)
{
size_t frames_size;
snd_pcm_sframes_t size;
snd_pcm_state_t state;
alsa_microphone_t *alsa = (alsa_microphone_t*)driver_context;
alsa_microphone_handle_t *mic = (alsa_microphone_handle_t*)mic_context;
uint8_t *buf = (uint8_t*)s;
snd_pcm_sframes_t read = 0;
int errnum = 0;
if (!alsa || !mic || !buf)
return -1;
size = BYTES_TO_FRAMES(len, mic->stream_info.frame_bits);
frames_size = mic->stream_info.has_float ? sizeof(float) : sizeof(int16_t);
state = snd_pcm_state(mic->pcm);
if (state != SND_PCM_STATE_RUNNING)
{
RARCH_WARN("[ALSA] Expected microphone \"%s\" to be in state RUNNING, was in state %s.\n",
snd_pcm_name(mic->pcm),
snd_pcm_state_name(state));
errnum = snd_pcm_start(mic->pcm);
if (errnum < 0)
{
RARCH_ERR("[ALSA] Failed to start microphone \"%s\": %s.\n",
snd_pcm_name(mic->pcm),
snd_strerror(errnum));
return -1;
}
}
if (alsa->nonblock)
{
while (size)
{
snd_pcm_sframes_t frames = snd_pcm_readi(mic->pcm, buf, size);
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
{
errnum = snd_pcm_recover(mic->pcm, frames, 0);
if (errnum < 0)
{
RARCH_ERR("[ALSA] Failed to read from microphone: %s.\n", snd_strerror(frames));
RARCH_ERR("[ALSA] Additionally, recovery failed with: %s.\n", snd_strerror(errnum));
return -1;
}
break;
}
else if (frames == -EAGAIN)
break;
else if (frames < 0)
return -1;
read += frames;
buf += frames_size;
size -= frames;
}
}
else
{
bool eagain_retry = true;
while (size)
{
snd_pcm_sframes_t frames;
int rc = snd_pcm_wait(mic->pcm, -1);
if (rc == -EPIPE || rc == -ESTRPIPE || rc == -EINTR)
{
if (snd_pcm_recover(mic->pcm, rc, 1) < 0)
return -1;
continue;
}
frames = snd_pcm_readi(mic->pcm, buf, size);
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
{
if (snd_pcm_recover(mic->pcm, frames, 1) < 0)
return -1;
break;
}
else if (frames == -EAGAIN)
{
/* Definitely not supposed to happen. */
if (eagain_retry)
{
eagain_retry = false;
continue;
}
break;
}
else if (frames < 0)
return -1;
read += frames;
buf += frames_size;
size -= frames;
}
}
return FRAMES_TO_BYTES(read, mic->stream_info.frame_bits);
}
static bool alsa_microphone_mic_alive(const void *driver_context, const void *mic_context)
{
alsa_microphone_handle_t *mic = (alsa_microphone_handle_t*)mic_context;
(void)driver_context;
if (!mic)
return false;
return snd_pcm_state(mic->pcm) == SND_PCM_STATE_RUNNING;
}
static void alsa_microphone_set_nonblock_state(void *driver_context, bool nonblock)
{
alsa_microphone_t *alsa = (alsa_microphone_t*)driver_context;
alsa->nonblock = nonblock;
}
static struct string_list *alsa_microphone_device_list_new(const void *data)
{
return alsa_device_list_type_new("Input");
}
static void alsa_microphone_device_list_free(const void *driver_context, struct string_list *devices)
{
(void)driver_context;
string_list_free(devices);
/* Does nothing if devices is NULL */
}
static void *alsa_microphone_open_mic(void *driver_context,
const char *device,
unsigned rate,
unsigned latency,
unsigned *new_rate)
{
alsa_microphone_t *alsa = (alsa_microphone_t*)driver_context;
alsa_microphone_handle_t *mic = NULL;
if (!alsa) /* If we weren't given a valid ALSA context... */
return NULL;
/* If the microphone context couldn't be allocated... */
if (!(mic = calloc(1, sizeof(alsa_microphone_handle_t))))
return NULL;
/* channels hardcoded to 1, because we only support mono mic input */
if (alsa_init_pcm(&mic->pcm, device, SND_PCM_STREAM_CAPTURE, rate, latency, 1,
&mic->stream_info, new_rate, SND_PCM_NONBLOCK) < 0)
goto error;
return mic;
error:
RARCH_ERR("[ALSA] Failed to initialize microphone.\n");
alsa_microphone_close_mic(alsa, mic);
return NULL;
}
static void alsa_microphone_close_mic(void *driver_context, void *mic_context)
{
alsa_microphone_handle_t *mic = (alsa_microphone_handle_t*)mic_context;
(void)driver_context;
if (mic)
{
alsa_free_pcm(mic->pcm);
free(mic);
}
}
static bool alsa_microphone_start_mic(void *driver_context, void *mic_context)
{
alsa_microphone_handle_t *mic = (alsa_microphone_handle_t*)mic_context;
if (!mic)
return false;
return alsa_start_pcm(mic->pcm);
}
static bool alsa_microphone_stop_mic(void *driver_context, void *mic_context)
{
alsa_microphone_handle_t *mic = (alsa_microphone_handle_t*)mic_context;
if (!mic)
return false;
return alsa_stop_pcm(mic->pcm);
}
static bool alsa_microphone_mic_use_float(const void *driver_context, const void *mic_context)
{
alsa_microphone_handle_t *mic = (alsa_microphone_handle_t*)mic_context;
return mic->stream_info.has_float;
}
microphone_driver_t microphone_alsa = {
alsa_microphone_init,
alsa_microphone_free,
alsa_microphone_read,
alsa_microphone_set_nonblock_state,
"alsa",
alsa_microphone_device_list_new,
alsa_microphone_device_list_free,
alsa_microphone_open_mic,
alsa_microphone_close_mic,
alsa_microphone_mic_alive,
alsa_microphone_start_mic,
alsa_microphone_stop_mic,
alsa_microphone_mic_use_float
};
#endif
typedef struct alsa
{
snd_pcm_t *pcm;
@@ -49,21 +319,20 @@ static void *alsa_init(const char *device, unsigned rate, unsigned latency,
if (!alsa)
{
RARCH_ERR("[ALSA]: Failed to allocate driver context\n");
RARCH_ERR("[ALSA] Failed to allocate driver context.\n");
return NULL;
}
RARCH_LOG("[ALSA]: Using ALSA version %s\n", snd_asoundlib_version());
RARCH_LOG("[ALSA] Using ALSA version %s.\n", snd_asoundlib_version());
if (alsa_init_pcm(&alsa->pcm, device, SND_PCM_STREAM_PLAYBACK, rate, latency, 2, &alsa->stream_info, new_rate, SND_PCM_NONBLOCK) < 0)
{
if (alsa_init_pcm(&alsa->pcm, device, SND_PCM_STREAM_PLAYBACK, rate,
latency, 2, &alsa->stream_info, new_rate, SND_PCM_NONBLOCK) < 0)
goto error;
}
return alsa;
error:
RARCH_ERR("[ALSA]: Failed to initialize...\n");
RARCH_ERR("[ALSA] Failed to initialize.\n");
alsa_free(alsa);
@@ -73,20 +342,41 @@ error:
#define BYTES_TO_FRAMES(bytes, frame_bits) ((bytes) * 8 / frame_bits)
#define FRAMES_TO_BYTES(frames, frame_bits) ((frames) * frame_bits / 8)
static bool alsa_start(void *data, bool is_shutdown);
static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
static bool alsa_start(void *data, bool is_shutdown)
{
alsa_t *alsa = (alsa_t*)data;
const uint8_t *buf = (const uint8_t*)buf_;
snd_pcm_sframes_t written = 0;
snd_pcm_sframes_t size = BYTES_TO_FRAMES(size_, alsa->stream_info.frame_bits);
size_t frames_size = alsa->stream_info.has_float ? sizeof(float) : sizeof(int16_t);
alsa_t *alsa = (alsa_t*)data;
if (!alsa->is_paused)
return true;
if ( alsa->stream_info.can_pause
&& alsa->is_paused)
{
int ret = snd_pcm_pause(alsa->pcm, 0);
if (ret < 0)
{
RARCH_ERR("[ALSA] Failed to unpause: %s.\n",
snd_strerror(ret));
return false;
}
alsa->is_paused = false;
}
return true;
}
static ssize_t alsa_write(void *data, const void *buf_, size_t len)
{
ssize_t _len = 0;
alsa_t *alsa = (alsa_t*)data;
const uint8_t *buf = (const uint8_t*)buf_;
snd_pcm_sframes_t size = BYTES_TO_FRAMES(len, alsa->stream_info.frame_bits);
size_t frames_size = alsa->stream_info.has_float ? sizeof(float) : sizeof(int16_t);
/* Workaround buggy menu code.
* If a write happens while we're paused, we might never progress. */
if (alsa->is_paused)
if (!alsa_start(alsa, false))
return -1;
if (alsa->is_paused && !alsa_start(alsa, false))
return -1;
if (alsa->nonblock)
{
@@ -106,9 +396,9 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
else if (frames < 0)
return -1;
written += frames;
buf += (frames << 1) * frames_size;
size -= frames;
_len += frames;
buf += (frames << 1) * frames_size;
size -= frames;
}
}
else
@@ -149,13 +439,13 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
else if (frames < 0)
return -1;
written += frames;
buf += (frames << 1) * frames_size;
size -= frames;
_len += frames;
buf += (frames << 1) * frames_size;
size -= frames;
}
}
return written;
return _len;
}
static bool alsa_alive(void *data)
@@ -192,29 +482,6 @@ static void alsa_set_nonblock_state(void *data, bool state)
alsa->nonblock = state;
}
static bool alsa_start(void *data, bool is_shutdown)
{
alsa_t *alsa = (alsa_t*)data;
if (!alsa->is_paused)
return true;
if (alsa->stream_info.can_pause
&& alsa->is_paused)
{
int ret = snd_pcm_pause(alsa->pcm, 0);
if (ret < 0)
{
RARCH_ERR("[ALSA]: Failed to unpause: %s.\n",
snd_strerror(ret));
return false;
}
alsa->is_paused = false;
}
return true;
}
static void alsa_free(void *data)
{
alsa_t *alsa = (alsa_t*)data;
+35 -36
View File
@@ -64,14 +64,14 @@ static void *alsa_qsa_init(const char *device,
if ((err = snd_pcm_open_preferred(&alsa->pcm, &card, &dev,
SND_PCM_OPEN_PLAYBACK)) < 0)
{
RARCH_ERR("[ALSA QSA]: Audio open error: %s\n",
RARCH_ERR("[ALSA QSA] Audio open error: %s.\n",
snd_strerror(err));
goto error;
}
if ((err = snd_pcm_nonblock_mode(alsa->pcm, 1)) < 0)
{
RARCH_ERR("[ALSA QSA]: Can't set blocking mode: %s\n",
RARCH_ERR("[ALSA QSA] Can't set blocking mode: %s.\n",
snd_strerror(err));
goto error;
}
@@ -80,7 +80,7 @@ static void *alsa_qsa_init(const char *device,
pi.channel = SND_PCM_CHANNEL_PLAYBACK;
if ((err = snd_pcm_channel_info(alsa->pcm, &pi)) < 0)
{
RARCH_ERR("[ALSA QSA]: snd_pcm_channel_info failed: %s\n",
RARCH_ERR("[ALSA QSA] snd_pcm_channel_info failed: %s.\n",
snd_strerror(err));
goto error;
}
@@ -88,27 +88,27 @@ static void *alsa_qsa_init(const char *device,
memset(&params, 0, sizeof(params));
params.channel = SND_PCM_CHANNEL_PLAYBACK;
params.mode = SND_PCM_MODE_BLOCK;
params.mode = SND_PCM_MODE_BLOCK;
params.format.interleave = 1;
params.format.format = SND_PCM_SFMT_S16_LE;
params.format.rate = DEFAULT_RATE;
params.format.voices = 2;
params.format.format = SND_PCM_SFMT_S16_LE;
params.format.rate = DEFAULT_RATE;
params.format.voices = 2;
params.start_mode = SND_PCM_START_FULL;
params.stop_mode = SND_PCM_STOP_STOP;
params.stop_mode = SND_PCM_STOP_STOP;
params.buf.block.frag_size = pi.max_fragment_size;
params.buf.block.frags_min = 2;
params.buf.block.frags_max = 8;
RARCH_LOG("Fragment size: %d\n", params.buf.block.frag_size);
RARCH_LOG("Min Fragment size: %d\n", params.buf.block.frags_min);
RARCH_LOG("Max Fragment size: %d\n", params.buf.block.frags_max);
RARCH_LOG("[ALSA QSA] Fragment size: %d.\n", params.buf.block.frag_size);
RARCH_LOG("[ALSA QSA] Min Fragment size: %d.\n", params.buf.block.frags_min);
RARCH_LOG("[ALSA QSA] Max Fragment size: %d.\n", params.buf.block.frags_max);
if ((err = snd_pcm_channel_params(alsa->pcm, &params)) < 0)
{
RARCH_ERR("[ALSA QSA]: Channel Parameter Error: %s\n",
RARCH_ERR("[ALSA QSA] Channel Parameter Error: %s.\n",
snd_strerror(err));
goto error;
}
@@ -117,7 +117,7 @@ static void *alsa_qsa_init(const char *device,
if ((err = snd_pcm_channel_setup(alsa->pcm, &setup)) < 0)
{
RARCH_ERR("[ALSA QSA]: Channel Parameter Read Back Error: %s\n",
RARCH_ERR("[ALSA QSA] Channel Parameter Read Back Error: %s.\n",
snd_strerror(err));
goto error;
}
@@ -127,7 +127,7 @@ static void *alsa_qsa_init(const char *device,
else
alsa->buf_size = next_pow2(32 * latency);
RARCH_LOG("[ALSA QSA]: buffer size: %u bytes\n", alsa->buf_size);
RARCH_LOG("[ALSA QSA] Buffer size: %u bytes.\n", alsa->buf_size);
alsa->buf_count = (latency * 4 * rate + 500) / 1000;
alsa->buf_count = (alsa->buf_count + alsa->buf_size / 2) / alsa->buf_size;
@@ -135,7 +135,7 @@ static void *alsa_qsa_init(const char *device,
if ((err = snd_pcm_channel_prepare(alsa->pcm,
SND_PCM_CHANNEL_PLAYBACK)) < 0)
{
RARCH_ERR("[ALSA QSA]: Channel Prepare Error: %s\n",
RARCH_ERR("[ALSA QSA] Channel Prepare Error: %s.\n",
snd_strerror(err));
goto error;
}
@@ -153,7 +153,7 @@ static void *alsa_qsa_init(const char *device,
alsa->has_float = false;
alsa->can_pause = true;
RARCH_LOG("[ALSA QSA]: Can pause: %s.\n",
RARCH_LOG("[ALSA QSA] Can pause: %s.\n",
alsa->can_pause ? "yes" : "no");
return alsa;
@@ -175,35 +175,35 @@ static int check_pcm_status(void *data, int channel_type)
{
if (status.status == SND_PCM_STATUS_UNSECURE)
{
RARCH_ERR("check_pcm_status got SND_PCM_STATUS_UNSECURE, aborting playback\n");
RARCH_ERR("[ALSA QSA] check_pcm_status got SND_PCM_STATUS_UNSECURE, aborting playback.\n");
ret = -EPROTO;
}
else if (status.status == SND_PCM_STATUS_UNDERRUN)
{
RARCH_LOG("check_pcm_status: SNDP_CM_STATUS_UNDERRUN.\n");
RARCH_LOG("[ALSA QSA] check_pcm_status: SNDP_CM_STATUS_UNDERRUN.\n");
if ((ret = snd_pcm_channel_prepare(alsa->pcm, channel_type)) < 0)
{
RARCH_ERR("Invalid state detected for underrun on snd_pcm_channel_prepare: %s\n",
RARCH_ERR("[ALSA QSA] Invalid state detected for underrun on snd_pcm_channel_prepare: %s.\n",
snd_strerror(ret));
ret = -EPROTO;
}
}
else if (status.status == SND_PCM_STATUS_OVERRUN)
{
RARCH_LOG("check_pcm_status: SNDP_CM_STATUS_OVERRUN.\n");
RARCH_LOG("[ALSA QSA] check_pcm_status: SNDP_CM_STATUS_OVERRUN.\n");
if ((ret = snd_pcm_channel_prepare(alsa->pcm, channel_type)) < 0)
{
RARCH_ERR("Invalid state detected for overrun on snd_pcm_channel_prepare: %s\n",
RARCH_ERR("[ALSA QSA] Invalid state detected for overrun on snd_pcm_channel_prepare: %s.\n",
snd_strerror(ret));
ret = -EPROTO;
}
}
else if (status.status == SND_PCM_STATUS_CHANGE)
{
RARCH_LOG("check_pcm_status: SNDP_CM_STATUS_CHANGE.\n");
RARCH_LOG("[ALSA QSA] check_pcm_status: SNDP_CM_STATUS_CHANGE.\n");
if ((ret = snd_pcm_channel_prepare(alsa->pcm, channel_type)) < 0)
{
RARCH_ERR("Invalid state detected for change on snd_pcm_channel_prepare: %s\n",
RARCH_ERR("[ALSA QSA] Invalid state detected for change on snd_pcm_channel_prepare: %s.\n",
snd_strerror(ret));
ret = -EPROTO;
}
@@ -211,7 +211,7 @@ static int check_pcm_status(void *data, int channel_type)
}
else
{
RARCH_ERR("check_pcm_status failed: %s\n", snd_strerror(ret));
RARCH_ERR("[ALSA QSA] check_pcm_status failed: %s.\n", snd_strerror(ret));
if (ret == -ESRCH)
ret = -EBADF;
}
@@ -219,24 +219,24 @@ static int check_pcm_status(void *data, int channel_type)
return ret;
}
static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size)
static ssize_t alsa_qsa_write(void *data, const void *buf, size_t len)
{
alsa_qsa_t *alsa = (alsa_qsa_t*)data;
snd_pcm_sframes_t written = 0;
ssize_t _len = 0;
alsa_qsa_t *alsa = (alsa_qsa_t*)data;
while (size)
{
size_t avail_write = MIN(alsa->buf_size - alsa->buffer_ptr, size);
size_t avail_write = MIN(alsa->buf_size - alsa->buffer_ptr, len);
if (avail_write)
{
memcpy(alsa->buffer[alsa->buffer_index] +
alsa->buffer_ptr, buf, avail_write);
alsa->buffer_ptr += avail_write;
buf = (void*)((uint8_t*)buf + avail_write);
size -= avail_write;
written += avail_write;
alsa->buffer_ptr += avail_write;
buf = (void*)((uint8_t*)buf + avail_write);
len -= avail_write;
_len += avail_write;
}
if (alsa->buffer_ptr >= alsa->buf_size)
@@ -260,10 +260,9 @@ static ssize_t alsa_qsa_write(void *data, const void *buf, size_t size)
return -1;
}
}
}
return written;
return _len;
}
static bool alsa_qsa_stop(void *data)
@@ -300,7 +299,7 @@ static bool alsa_qsa_start(void *data, bool is_shutdown)
if (ret < 0)
{
RARCH_ERR("[ALSA QSA]: Failed to unpause: %s.\n",
RARCH_ERR("[ALSA QSA] Failed to unpause: %s.\n",
snd_strerror(ret));
return false;
}
@@ -318,7 +317,7 @@ static void alsa_qsa_set_nonblock_state(void *data, bool state)
if ((err = snd_pcm_nonblock_mode(alsa->pcm, state)) < 0)
{
RARCH_ERR("Can't set blocking mode to %d: %s\n", state,
RARCH_ERR("[ALSA QSA] Can't set blocking mode to %d: %s.\n", state,
snd_strerror(err));
return;
}
+436 -35
View File
@@ -1,6 +1,7 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2012-2015 - Michael Lelli
* Copyright (C) 2023-2025 - Jesse Talavera-Greenberg
*
* 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-
@@ -15,8 +16,10 @@
*/
#include <stdlib.h>
#include <boolean.h>
#include <alsa/asoundlib.h>
#include <alsa/pcm.h>
#include <rthreads/rthreads.h>
#include <queues/fifo_queue.h>
@@ -25,9 +28,412 @@
#include "../audio_driver.h"
#include "../common/alsa.h" /* For some common functions/types */
#include "../common/alsathread.h"
#include "../../verbosity.h"
typedef struct alsa_thread_info
{
snd_pcm_t *pcm;
fifo_buffer_t *buffer;
sthread_t *worker_thread;
slock_t *fifo_lock;
scond_t *cond;
slock_t *cond_lock;
alsa_stream_info_t stream_info;
volatile bool thread_dead;
} alsa_thread_info_t;
static void alsa_thread_free_info_members(alsa_thread_info_t *info)
{
if (info)
{
if (info->worker_thread)
{
slock_lock(info->cond_lock);
info->thread_dead = true;
slock_unlock(info->cond_lock);
sthread_join(info->worker_thread);
}
if (info->buffer)
fifo_free(info->buffer);
if (info->cond)
scond_free(info->cond);
if (info->fifo_lock)
slock_free(info->fifo_lock);
if (info->cond_lock)
slock_free(info->cond_lock);
if (info->pcm)
alsa_free_pcm(info->pcm);
}
/* Do NOT free() info itself; it's embedded within another struct
* that will be freed. */
}
#ifdef HAVE_MICROPHONE
#include "../microphone_driver.h"
typedef struct alsa_thread_microphone_handle
{
alsa_thread_info_t info;
} alsa_thread_microphone_handle_t;
typedef struct alsa_thread_microphone
{
bool nonblock;
} alsa_thread_microphone_t;
static void *alsa_thread_microphone_init(void)
{
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)calloc(1, sizeof(alsa_thread_microphone_t));
if (!alsa)
{
RARCH_ERR("[ALSA] Failed to allocate driver context.\n");
return NULL;
}
RARCH_LOG("[ALSA] Using ALSA version %s\n", snd_asoundlib_version());
return alsa;
}
/* Forward declaration */
static void alsa_thread_microphone_close_mic(void *driver_context, void *mic_context);
static void alsa_thread_microphone_free(void *driver_context)
{
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context;
if (alsa)
free(alsa);
}
/** @see alsa_thread_read_microphone() */
static void alsa_microphone_worker_thread(void *mic_context)
{
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
uint8_t *buf = NULL;
uintptr_t thread_id = sthread_get_current_thread_id();
if (!(buf = (uint8_t *)calloc(1, mic->info.stream_info.period_size)))
{
RARCH_ERR("[ALSA] [capture thread %p] Failed to allocate audio buffer.\n", thread_id);
goto end;
}
RARCH_DBG("[ALSA] [capture thread %p] Beginning microphone worker thread.\n", thread_id);
RARCH_DBG("[ALSA] [capture thread %p] Microphone \"%s\" is in state %s.\n",
thread_id,
snd_pcm_name(mic->info.pcm),
snd_pcm_state_name(snd_pcm_state(mic->info.pcm)));
/* Until we're told to stop... */
while (!mic->info.thread_dead)
{
size_t avail;
size_t fifo_size;
snd_pcm_sframes_t frames;
int errnum = 0;
/* Lock the incoming sample queue (the main thread may block) */
slock_lock(mic->info.fifo_lock);
/* Fill the incoming sample queue with whatever we recently read */
avail = FIFO_WRITE_AVAIL(mic->info.buffer);
fifo_size = MIN(mic->info.stream_info.period_size, avail);
fifo_write(mic->info.buffer, buf, fifo_size);
/* Tell the main thread that it's okay to query the mic again */
scond_signal(mic->info.cond);
/* Unlock the incoming sample queue (the main thread may resume) */
slock_unlock(mic->info.fifo_lock);
/* If underrun, fill rest with silence. */
memset(buf + fifo_size, 0, mic->info.stream_info.period_size - fifo_size);
errnum = snd_pcm_wait(mic->info.pcm, 33);
if (errnum == 0)
{
RARCH_DBG("[ALSA] [capture thread %p] Timeout after 33ms waiting for input.\n", thread_id);
continue;
}
else if (errnum == -EPIPE || errnum == -ESTRPIPE || errnum == -EINTR)
{
RARCH_WARN("[ALSA] [capture thread %p] Wait error: %s.\n",
thread_id,
snd_strerror(errnum));
if ((errnum = snd_pcm_recover(mic->info.pcm, errnum, false)) < 0)
{
RARCH_ERR("[ALSA] [capture thread %p] Failed to recover from prior wait error: %s.\n",
thread_id,
snd_strerror(errnum));
break;
}
continue;
}
frames = snd_pcm_readi(mic->info.pcm, buf, mic->info.stream_info.period_frames);
if (frames == -EPIPE || frames == -EINTR || frames == -ESTRPIPE)
{
RARCH_WARN("[ALSA] [capture thread %p] Read error: %s.\n",
thread_id,
snd_strerror(frames));
if ((errnum = snd_pcm_recover(mic->info.pcm, frames, false)) < 0)
{
RARCH_ERR("[ALSA] [capture thread %p] Failed to recover from prior read error: %s.\n",
thread_id,
snd_strerror(errnum));
break;
}
continue;
}
else if (frames < 0)
{
RARCH_ERR("[ALSA] [capture thread %p] Read error: %s.\n",
thread_id,
snd_strerror(frames));
break;
}
}
end:
slock_lock(mic->info.cond_lock);
mic->info.thread_dead = true;
scond_signal(mic->info.cond);
slock_unlock(mic->info.cond_lock);
free(buf);
RARCH_DBG("[ALSA] [capture thread %p] Ending microphone worker thread.\n", thread_id);
}
static int alsa_thread_microphone_read(void *driver_context, void *mic_context, void *sv, size_t len)
{
snd_pcm_state_t state;
size_t _len = 0;
uint8_t *s = (uint8_t*)sv;
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context;
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
if (!alsa || !mic || !s) /* If any of the parameters were invalid... */
return -1;
if (mic->info.thread_dead) /* If the mic thread is shutting down... */
return -1;
state = snd_pcm_state(mic->info.pcm);
if (state != SND_PCM_STATE_RUNNING)
{
int errnum;
RARCH_WARN("[ALSA] Expected microphone \"%s\" to be in state RUNNING, was in state %s.\n",
snd_pcm_name(mic->info.pcm), snd_pcm_state_name(state));
errnum = snd_pcm_start(mic->info.pcm);
if (errnum < 0)
{
RARCH_ERR("[ALSA] Failed to start microphone \"%s\": %s.\n",
snd_pcm_name(mic->info.pcm), snd_strerror(errnum));
return -1;
}
}
/* If driver interactions shouldn't block... */
if (alsa->nonblock)
{
size_t avail;
/* "Hey, I'm gonna borrow the queue." */
slock_lock(mic->info.fifo_lock);
avail = FIFO_READ_AVAIL(mic->info.buffer);
_len = MIN(avail, len);
/* "It's okay if you don't have any new samples, I'll just check in on you later." */
fifo_read(mic->info.buffer, s, _len);
/* "Here, take this queue back." */
slock_unlock(mic->info.fifo_lock);
}
else
{
/* Until we've read all requested samples (or we're told to stop)... */
while (_len < len && !mic->info.thread_dead)
{
size_t avail;
/* "Hey, I'm gonna borrow the queue." */
slock_lock(mic->info.fifo_lock);
avail = FIFO_READ_AVAIL(mic->info.buffer);
if (avail == 0)
{ /* "Oh, wait, it's empty." */
/* "Here, take it back..." */
slock_unlock(mic->info.fifo_lock);
/* "...I'll just wait right here." */
slock_lock(mic->info.cond_lock);
/* "Unless we're closing up shop..." */
if (!mic->info.thread_dead)
/* "...let me know when you've produced some samples." */
scond_wait(mic->info.cond, mic->info.cond_lock);
/* "Oh, you're ready? Okay, I'm gonna continue." */
slock_unlock(mic->info.cond_lock);
}
else
{
size_t read_amt = MIN(len - _len, avail);
/* "I'll just go ahead and consume all these samples..."
* (As many as will fit in s, or as many as are available.) */
fifo_read(mic->info.buffer,s + _len, read_amt);
/* "I'm done, you can take the queue back now." */
slock_unlock(mic->info.fifo_lock);
_len += read_amt;
}
/* "I'll be right back..." */
}
}
return _len;
}
static bool alsa_thread_microphone_mic_alive(const void *driver_context, const void *mic_context);
static void *alsa_thread_microphone_open_mic(void *driver_context,
const char *device, unsigned rate, unsigned latency, unsigned *new_rate)
{
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context;
alsa_thread_microphone_handle_t *mic = NULL;
if (!alsa) /* If we weren't given a valid ALSA context... */
return NULL;
/* If the microphone context couldn't be allocated... */
if (!(mic = calloc(1, sizeof(alsa_thread_microphone_handle_t))))
{
RARCH_ERR("[ALSA] Failed to allocate microphone context.\n");
return NULL;
}
if (alsa_init_pcm(&mic->info.pcm, device, SND_PCM_STREAM_CAPTURE, rate, latency,
1, &mic->info.stream_info, new_rate, 0) < 0)
goto error;
mic->info.fifo_lock = slock_new();
mic->info.cond_lock = slock_new();
mic->info.cond = scond_new();
mic->info.buffer = fifo_new(mic->info.stream_info.buffer_size);
if (!mic->info.fifo_lock || !mic->info.cond_lock || !mic->info.cond || !mic->info.buffer || !mic->info.pcm)
goto error;
mic->info.worker_thread = sthread_create(alsa_microphone_worker_thread, mic);
if (!mic->info.worker_thread)
{
RARCH_ERR("[ALSA] Failed to initialize microphone worker thread.\n");
goto error;
}
RARCH_DBG("[ALSA] Initialized microphone worker thread.\n");
return mic;
error:
RARCH_ERR("[ALSA] Failed to initialize microphone.\n");
if (mic)
{
if (mic->info.pcm)
snd_pcm_close(mic->info.pcm);
alsa_thread_microphone_close_mic(alsa, mic);
}
return NULL;
}
static void alsa_thread_microphone_close_mic(void *driver_context, void *mic_context)
{
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
if (mic)
{
alsa_thread_free_info_members(&mic->info);
free(mic);
}
}
static bool alsa_thread_microphone_mic_alive(const void *driver_context, const void *mic_context)
{
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t *)mic_context;
if (!mic)
return false;
return snd_pcm_state(mic->info.pcm) == SND_PCM_STATE_RUNNING;
}
static void alsa_thread_microphone_set_nonblock_state(void *driver_context, bool state)
{
alsa_thread_microphone_t *alsa = (alsa_thread_microphone_t*)driver_context;
alsa->nonblock = state;
}
static struct string_list *alsa_thread_microphone_device_list_new(const void *data)
{
return alsa_device_list_type_new("Input");
}
static void alsa_thread_microphone_device_list_free(const void *driver_context, struct string_list *devices)
{
string_list_free(devices);
/* Does nothing if devices is NULL */
}
static bool alsa_thread_microphone_start_mic(void *driver_context, void *mic_context)
{
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
if (!mic)
return false;
return alsa_start_pcm(mic->info.pcm);
}
static bool alsa_thread_microphone_stop_mic(void *driver_context, void *mic_context)
{
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
if (!mic)
return false;
return alsa_stop_pcm(mic->info.pcm);
}
static bool alsa_thread_microphone_mic_use_float(const void *driver_context, const void *mic_context)
{
alsa_thread_microphone_handle_t *mic = (alsa_thread_microphone_handle_t*)mic_context;
return mic->info.stream_info.has_float;
}
microphone_driver_t microphone_alsathread = {
alsa_thread_microphone_init,
alsa_thread_microphone_free,
alsa_thread_microphone_read,
alsa_thread_microphone_set_nonblock_state,
"alsathread",
alsa_thread_microphone_device_list_new,
alsa_thread_microphone_device_list_free,
alsa_thread_microphone_open_mic,
alsa_thread_microphone_close_mic,
alsa_thread_microphone_mic_alive,
alsa_thread_microphone_start_mic,
alsa_thread_microphone_stop_mic,
alsa_thread_microphone_mic_use_float
};
#endif
typedef struct alsa_thread
{
alsa_thread_info_t info;
@@ -43,11 +449,11 @@ static void alsa_worker_thread(void *data)
if (!buf)
{
RARCH_ERR("[ALSA] [playback thread %u]: Failed to allocate audio buffer\n", thread_id);
RARCH_ERR("[ALSA] [playback thread %u] Failed to allocate audio buffer.\n", thread_id);
goto end;
}
RARCH_DBG("[ALSA] [playback thread %p]: Beginning playback worker thread\n", thread_id);
RARCH_DBG("[ALSA] [playback thread %p] Beginning playback worker thread.\n", thread_id);
while (!alsa->info.thread_dead)
{
size_t avail;
@@ -65,12 +471,13 @@ static void alsa_worker_thread(void *data)
frames = snd_pcm_writei(alsa->info.pcm, buf, alsa->info.stream_info.period_frames);
if (frames == -EPIPE || frames == -EINTR ||
frames == -ESTRPIPE)
if ( frames == -EPIPE
|| frames == -EINTR
|| frames == -ESTRPIPE)
{
if (snd_pcm_recover(alsa->info.pcm, frames, false) < 0)
{
RARCH_ERR("[ALSA] [playback thread %u]: Failed to recover from error: %s\n",
RARCH_ERR("[ALSA] [playback thread %u] Failed to recover from error: %s.\n",
thread_id,
snd_strerror(frames));
break;
@@ -80,7 +487,7 @@ static void alsa_worker_thread(void *data)
}
else if (frames < 0)
{
RARCH_ERR("[ALSA] [playback thread %u]: Error writing audio to device: %s\n",
RARCH_ERR("[ALSA] [playback thread %u] Error writing audio to device: %s.\n",
thread_id,
snd_strerror(frames));
break;
@@ -93,7 +500,7 @@ end:
scond_signal(alsa->info.cond);
slock_unlock(alsa->info.cond_lock);
free(buf);
RARCH_DBG("[ALSA] [playback thread %p]: Ending playback worker thread\n", thread_id);
RARCH_DBG("[ALSA] [playback thread %p] Ending playback worker thread...\n", thread_id);
}
static bool alsa_thread_use_float(void *data)
@@ -122,43 +529,43 @@ static void *alsa_thread_init(const char *device,
if (!alsa)
{
RARCH_ERR("[ALSA] Failed to allocate driver context\n");
RARCH_ERR("[ALSA] Failed to allocate driver context.\n");
return NULL;
}
RARCH_LOG("[ALSA] Using ALSA version %s\n", snd_asoundlib_version());
RARCH_LOG("[ALSA] Using ALSA version %s.\n", snd_asoundlib_version());
if (alsa_init_pcm(&alsa->info.pcm, device, SND_PCM_STREAM_PLAYBACK, rate, latency, 2, &alsa->info.stream_info, new_rate, 0) < 0)
{
if (alsa_init_pcm(&alsa->info.pcm, device, SND_PCM_STREAM_PLAYBACK, rate,
latency, 2, &alsa->info.stream_info, new_rate, 0) < 0)
goto error;
}
alsa->info.fifo_lock = slock_new();
alsa->info.cond_lock = slock_new();
alsa->info.cond = scond_new();
alsa->info.buffer = fifo_new(alsa->info.stream_info.buffer_size);
alsa->info.cond = scond_new();
alsa->info.buffer = fifo_new(alsa->info.stream_info.buffer_size);
if (!alsa->info.fifo_lock || !alsa->info.cond_lock || !alsa->info.cond || !alsa->info.buffer)
goto error;
alsa->info.worker_thread = sthread_create(alsa_worker_thread, alsa);
if (!alsa->info.worker_thread)
{
RARCH_ERR("[ALSA]: Failed to initialize worker thread\n");
RARCH_ERR("[ALSA] Failed to initialize worker thread.\n");
goto error;
}
return alsa;
error:
RARCH_ERR("[ALSA]: Failed to initialize...\n");
RARCH_ERR("[ALSA] Failed to initialize.\n");
alsa_thread_free(alsa);
return NULL;
}
static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
static ssize_t alsa_thread_write(void *data, const void *s, size_t len)
{
ssize_t _len = 0;
alsa_thread_t *alsa = (alsa_thread_t*)data;
if (alsa->info.thread_dead)
@@ -167,21 +574,17 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
if (alsa->nonblock)
{
size_t avail;
size_t write_amt;
slock_lock(alsa->info.fifo_lock);
avail = FIFO_WRITE_AVAIL(alsa->info.buffer);
write_amt = MIN(avail, size);
avail = FIFO_WRITE_AVAIL(alsa->info.buffer);
_len = MIN(avail, len);
fifo_write(alsa->info.buffer, buf, write_amt);
fifo_write(alsa->info.buffer, s, _len);
slock_unlock(alsa->info.fifo_lock);
return write_amt;
}
else
{
size_t written = 0;
while (written < size && !alsa->info.thread_dead)
while (_len < (ssize_t)len && !alsa->info.thread_dead)
{
size_t avail;
slock_lock(alsa->info.fifo_lock);
@@ -197,15 +600,15 @@ static ssize_t alsa_thread_write(void *data, const void *buf, size_t size)
}
else
{
size_t write_amt = MIN(size - written, avail);
size_t write_amt = MIN(len - _len, avail);
fifo_write(alsa->info.buffer,
(const char*)buf + written, write_amt);
(const char*)s + _len, write_amt);
slock_unlock(alsa->info.fifo_lock);
written += write_amt;
_len += write_amt;
}
}
return written;
}
return _len;
}
static bool alsa_thread_alive(void *data)
@@ -219,7 +622,6 @@ static bool alsa_thread_alive(void *data)
static bool alsa_thread_stop(void *data)
{
alsa_thread_t *alsa = (alsa_thread_t*)data;
if (alsa)
alsa->is_paused = true;
return true;
@@ -242,15 +644,14 @@ static bool alsa_thread_start(void *data, bool is_shutdown)
static size_t alsa_thread_write_avail(void *data)
{
size_t _len;
alsa_thread_t *alsa = (alsa_thread_t*)data;
size_t val;
if (alsa->info.thread_dead)
return 0;
slock_lock(alsa->info.fifo_lock);
val = FIFO_WRITE_AVAIL(alsa->info.buffer);
_len = FIFO_WRITE_AVAIL(alsa->info.buffer);
slock_unlock(alsa->info.fifo_lock);
return val;
return _len;
}
static size_t alsa_thread_buffer_size(void *data)
+17 -21
View File
@@ -33,12 +33,11 @@
#define DEFAULT_DEV "/dev/audio"
static void *audioio_init(const char *device, unsigned rate, unsigned latency,
unsigned block_frames,
unsigned *new_out_rate)
unsigned block_frames, unsigned *new_out_rate)
{
struct audio_info info;
const char *audiodev = device ? device : DEFAULT_DEV;
int *fd = (int*)calloc(1, sizeof(int));
const char *audiodev = device ? device : DEFAULT_DEV;
int *fd = (int*)calloc(1, sizeof(int));
if (!fd)
return NULL;
@@ -46,17 +45,17 @@ static void *audioio_init(const char *device, unsigned rate, unsigned latency,
AUDIO_INITINFO(&info);
#ifdef AUMODE_PLAY_ALL
info.mode = AUMODE_PLAY_ALL;
info.mode = AUMODE_PLAY_ALL;
#elif defined(AUMODE_PLAY)
info.mode = AUMODE_PLAY;
info.mode = AUMODE_PLAY;
#endif
info.play.sample_rate = rate;
info.play.channels = 2;
info.play.precision = 16;
info.play.channels = 2;
info.play.precision = 16;
#ifdef AUDIO_ENCODING_SLINEAR
info.play.encoding = AUDIO_ENCODING_SLINEAR;
info.play.encoding = AUDIO_ENCODING_SLINEAR;
#else
info.play.encoding = AUDIO_ENCODING_LINEAR;
info.play.encoding = AUDIO_ENCODING_LINEAR;
#endif
if ((*fd = open(audiodev, O_WRONLY)) < 0)
@@ -82,15 +81,15 @@ error:
return NULL;
}
static ssize_t audioio_write(void *data, const void *buf, size_t size)
static ssize_t audioio_write(void *data, const void *s, size_t len)
{
ssize_t ret;
ssize_t _len;
int *fd = (int*)data;
if (size == 0)
if (len == 0)
return 0;
if ((ret = write(*fd, buf, size)) < 0)
if ((_len = write(*fd, s, len)) < 0)
{
if (errno == EAGAIN && (fcntl(*fd, F_GETFL) & O_NONBLOCK))
return 0;
@@ -98,7 +97,7 @@ static ssize_t audioio_write(void *data, const void *buf, size_t size)
return -1;
}
return ret;
return _len;
}
static bool audioio_stop(void *data)
@@ -158,7 +157,7 @@ static void audioio_set_nonblock_state(void *data, bool state)
else
rc = fcntl(*fd, F_SETFL, fcntl(*fd, F_GETFL) & (~O_NONBLOCK));
if (rc != 0)
RARCH_WARN("Could not set nonblocking on audio file descriptor. Will not be able to fast-forward.\n");
RARCH_WARN("[AudioIO] Could not set nonblocking on audio file descriptor. Will not be able to fast-forward.\n");
}
static void audioio_free(void *data)
@@ -189,11 +188,8 @@ static size_t audioio_write_avail(void *data)
return audioio_buffer_size(data);
}
static bool audioio_use_float(void *data)
{
(void)data;
return false;
}
/* TODO/FIXME - implement? */
static bool audioio_use_float(void *data) { return false; }
audio_driver_t audio_audioio = {
audioio_init,
+537
View File
@@ -0,0 +1,537 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2025 - OlyB
*
* 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 <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <boolean.h>
#include <emscripten/wasm_worker.h>
#include <emscripten/webaudio.h>
#include <emscripten/atomic.h>
#include "../../frontend/drivers/platform_emscripten.h"
#include <queues/fifo_queue.h>
#include <retro_timers.h>
#include "../audio_driver.h"
#include "../../verbosity.h"
#define WORKLET_STACK_SIZE 4096
/* additional buffer size (for EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK only) */
/* if this is too small, frames may be dropped and content could run too fast. */
/* very large slow-motion rate values may be too large for this; avoid anything higher than 6 or 7. */
#define EXTERNAL_BLOCK_BUFFER_MS 128
typedef struct audioworklet_data
{
uint8_t *worklet_stack;
uint32_t write_avail_bytes; /* atomic */
size_t visible_buffer_size;
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
size_t write_avail_diff;
#endif
#ifdef PROXY_TO_PTHREAD
emscripten_lock_t trywrite_lock;
emscripten_condvar_t trywrite_cond;
#endif
emscripten_lock_t buffer_lock;
EMSCRIPTEN_WEBAUDIO_T context;
float *tmpbuf;
fifo_buffer_t *buffer;
unsigned rate;
unsigned latency;
bool nonblock;
bool initing;
#ifdef EMSCRIPTEN_AUDIO_FAKE_BLOCK
bool block_requested;
#endif
volatile bool running; /* currently only used by RetroArch */
volatile bool driver_running; /* whether the driver is running (buffer allocated) */
volatile bool context_running; /* whether the AudioContext is running */
volatile bool init_done;
volatile bool init_error;
} audioworklet_data_t;
/* We only ever want to create 1 worklet, so we need to keep its data even if the driver is inactive. */
static audioworklet_data_t *audioworklet_static_data = NULL;
/* Note that we cannot allocate any heap in here. */
static bool audioworklet_process_cb(int numInputs, const AudioSampleFrame *inputs,
int numOutputs, AudioSampleFrame *outputs,
int numParams, const AudioParamFrame *params,
void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
size_t avail;
size_t max_read;
unsigned writing_frames = 0;
int i;
/* TODO: do we need to pay attention to audioworklet->running here too? */
if (audioworklet->driver_running)
{
/* can't use Atomics.wait in AudioWorklet */
/* busyspin is safe as of emscripten 4.0.4 */
if (!emscripten_lock_busyspin_wait_acquire(&audioworklet->buffer_lock, 2.5))
{
printf("[WARN] [AudioWorklet] Worklet: could not acquire lock\n");
return true;
}
avail = FIFO_READ_AVAIL(audioworklet->buffer);
max_read = MIN(avail, outputs[0].samplesPerChannel * 2 * sizeof(float));
if (max_read)
{
fifo_read(audioworklet->buffer, audioworklet->tmpbuf, max_read);
emscripten_atomic_add_u32(&audioworklet->write_avail_bytes, max_read);
}
emscripten_lock_release(&audioworklet->buffer_lock);
#ifdef PROXY_TO_PTHREAD
emscripten_condvar_signal(&audioworklet->trywrite_cond, 1);
#endif
writing_frames = max_read / 2 / sizeof(float);
for (i = 0; i < writing_frames; i++)
{
outputs[0].data[i] = audioworklet->tmpbuf[i * 2];
outputs[0].data[outputs[0].samplesPerChannel + i] = audioworklet->tmpbuf[i * 2 + 1];
}
}
if (writing_frames < outputs[0].samplesPerChannel)
{
int zero_frames = outputs[0].samplesPerChannel - writing_frames;
memset(outputs[0].data + writing_frames, 0, zero_frames * sizeof(float));
memset(outputs[0].data + writing_frames + outputs[0].samplesPerChannel, 0, zero_frames * sizeof(float));
}
return true;
}
static void audioworklet_processor_inited_cb(EMSCRIPTEN_WEBAUDIO_T context, bool success, void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
int outputChannelCounts[1] = { 2 };
EmscriptenAudioWorkletNodeCreateOptions opts = { 0, 1, outputChannelCounts };
EMSCRIPTEN_AUDIO_WORKLET_NODE_T worklet_node;
if (!success)
{
RARCH_ERR("[AudioWorklet] Failed to init AudioWorkletProcessor.\n");
audioworklet->init_error = true;
audioworklet->init_done = true;
return;
}
worklet_node = emscripten_create_wasm_audio_worklet_node(context, "retroarch", &opts, audioworklet_process_cb, audioworklet);
emscripten_audio_node_connect(worklet_node, context, 0, 0);
audioworklet->init_done = true;
}
static void audioworklet_thread_inited_cb(EMSCRIPTEN_WEBAUDIO_T context, bool success, void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
WebAudioWorkletProcessorCreateOptions opts = { "retroarch", 0 };
if (success)
emscripten_create_wasm_audio_worklet_processor_async(context, &opts,
audioworklet_processor_inited_cb, audioworklet);
else
{
RARCH_ERR("[AudioWorklet] Failed to init worklet thread! Is the worklet file in the right place?\n");
audioworklet->init_error = true;
audioworklet->init_done = true;
}
}
static void audioworklet_ctx_statechange_cb(void *data, bool state)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
audioworklet->context_running = state;
}
static void audioworklet_ctx_create(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
audioworklet->context = emscripten_create_audio_context(0);
audioworklet->tmpbuf = memalign(16, emscripten_audio_context_quantum_size(audioworklet->context) * 2 * sizeof(float));
audioworklet->rate = EM_ASM_INT({
return emscriptenGetAudioObject($0).sampleRate;
}, audioworklet->context);
audioworklet->context_running = EM_ASM_INT({
let ac = emscriptenGetAudioObject($0);
ac.addEventListener("statechange", function() {
getWasmTableEntry($2)($1, ac.state == "running");
});
return ac.state == "running";
}, audioworklet->context, audioworklet, audioworklet_ctx_statechange_cb);
emscripten_start_wasm_audio_worklet_thread_async(audioworklet->context,
audioworklet->worklet_stack, WORKLET_STACK_SIZE, audioworklet_thread_inited_cb, audioworklet);
}
static void audioworklet_alloc_buffer(void *data)
{
size_t buffer_size;
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
audioworklet->visible_buffer_size = (audioworklet->latency * audioworklet->rate * 2 * sizeof(float)) / 1000;
buffer_size = audioworklet->visible_buffer_size;
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
audioworklet->write_avail_diff = (EXTERNAL_BLOCK_BUFFER_MS * audioworklet->rate * 2 * sizeof(float)) / 1000;
buffer_size += audioworklet->write_avail_diff;
#endif
audioworklet->buffer = fifo_new(buffer_size);
emscripten_atomic_store_u32(&audioworklet->write_avail_bytes, buffer_size);
RARCH_LOG("[AudioWorklet] Buffer size: %lu bytes.\n", audioworklet->visible_buffer_size);
}
static void audioworklet_init_error(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
RARCH_ERR("[AudioWorklet] Failed to initialize driver.\n");
free(audioworklet->worklet_stack);
free(audioworklet->tmpbuf);
free(audioworklet);
}
static bool audioworklet_resume_ctx(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
if (!audioworklet->context_running)
{
MAIN_THREAD_ASYNC_EM_ASM({
emscriptenGetAudioObject($0).resume();
}, audioworklet->context);
}
return audioworklet->context_running;
}
static void *audioworklet_init(const char *device, unsigned rate,
unsigned latency, unsigned block_frames, unsigned *new_rate)
{
audioworklet_data_t *audioworklet;
if (audioworklet_static_data)
{
if (audioworklet_static_data->driver_running || audioworklet_static_data->initing)
{
RARCH_ERR("[AudioWorklet] Tried to start already running driver.\n");
return NULL;
}
RARCH_LOG("[AudioWorklet] Reusing old context.\n");
audioworklet = audioworklet_static_data;
audioworklet->latency = latency;
*new_rate = audioworklet->rate;
RARCH_LOG("[AudioWorklet] Device rate: %d Hz.\n", *new_rate);
audioworklet_alloc_buffer(audioworklet);
audioworklet_resume_ctx(audioworklet);
audioworklet->driver_running = true;
return audioworklet;
}
audioworklet = (audioworklet_data_t*)calloc(1, sizeof(audioworklet_data_t));
if (!audioworklet)
return NULL;
audioworklet->worklet_stack = memalign(16, WORKLET_STACK_SIZE);
if (!audioworklet->worklet_stack)
return NULL;
audioworklet_static_data = audioworklet;
audioworklet->latency = latency;
platform_emscripten_run_on_browser_thread_sync(audioworklet_ctx_create, audioworklet);
*new_rate = audioworklet->rate;
RARCH_LOG("[AudioWorklet] Device rate: %d Hz.\n", *new_rate);
audioworklet->initing = true;
audioworklet_alloc_buffer(audioworklet);
emscripten_lock_init(&audioworklet->buffer_lock);
#ifdef PROXY_TO_PTHREAD
emscripten_lock_init(&audioworklet->trywrite_lock);
emscripten_condvar_init(&audioworklet->trywrite_cond);
#endif
#ifndef EMSCRIPTEN_AUDIO_EXTERNAL_BLOCK
/* TODO: can MIN_ASYNCIFY block here too? */
while (!audioworklet->init_done)
retro_sleep(1);
audioworklet->initing = false;
if (audioworklet->init_error)
{
audioworklet_init_error(audioworklet);
return NULL;
}
audioworklet->driver_running = true;
#elif defined(EMSCRIPTEN_AUDIO_FAKE_BLOCK)
audioworklet->block_requested = true;
platform_emscripten_enter_fake_block(1);
#endif
/* external block: will be handled later */
return audioworklet;
}
static ssize_t audioworklet_write(void *data, const void *s, size_t ss)
{
size_t avail;
size_t max_write;
size_t to_write_frames;
size_t to_write_bytes;
size_t _len = 0;
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
const float *samples = (const float*)s;
size_t num_frames = ss / 2 / sizeof(float);
/* too early! might happen with external blocking */
if (!audioworklet->driver_running)
return 0;
/* don't write audio if the context isn't running, just try to start it */
if (!audioworklet_resume_ctx(audioworklet))
return 0;
while (num_frames)
{
#ifdef PROXY_TO_PTHREAD
if (!emscripten_lock_wait_acquire(&audioworklet->buffer_lock, 2500000))
#else
if (!emscripten_lock_busyspin_wait_acquire(&audioworklet->buffer_lock, 2.5))
#endif
{
RARCH_WARN("[AudioWorklet] Main thread: could not acquire lock.\n");
break;
}
avail = FIFO_WRITE_AVAIL(audioworklet->buffer);
max_write = avail;
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
/* make sure we don't write into the blocking buffer for nonblock */
if (audioworklet->nonblock)
{
if (max_write > audioworklet->write_avail_diff)
max_write -= audioworklet->write_avail_diff;
else
max_write = 0;
}
#endif
to_write_frames = MIN(num_frames, max_write / 2 / sizeof(float));
if (to_write_frames)
{
to_write_bytes = to_write_frames * 2 * sizeof(float);
avail -= to_write_bytes;
fifo_write(audioworklet->buffer, samples, to_write_bytes);
emscripten_atomic_store_u32(&audioworklet->write_avail_bytes, (uint32_t)avail);
num_frames -= to_write_frames;
samples += (to_write_frames * 2);
_len += to_write_frames;
}
emscripten_lock_release(&audioworklet->buffer_lock);
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
#ifdef EMSCRIPTEN_AUDIO_FAKE_BLOCK
/* see if we're over the threshold to go to fake block */
if (avail < audioworklet->write_avail_diff)
{
audioworklet->block_requested = true;
platform_emscripten_enter_fake_block(1);
}
#endif
if (num_frames && !audioworklet->nonblock)
RARCH_WARN("[AudioWorklet] Dropping %lu frames.\n", num_frames);
break;
#endif
if (audioworklet->nonblock || !num_frames)
break;
#if defined(PROXY_TO_PTHREAD)
emscripten_condvar_wait(&audioworklet->trywrite_cond, &audioworklet->trywrite_lock, 3000000);
#elif defined(EMSCRIPTEN_FULL_ASYNCIFY)
retro_sleep(1);
#else /* equivalent to defined(EMSCRIPTEN_AUDIO_BUSYWAIT) */
while (emscripten_atomic_load_u32(&audioworklet->write_avail_bytes) < 2 * sizeof(float))
audioworklet_resume_ctx(audioworklet);
#endif
/* try resuming, on the off chance that the context was interrupted while blocking */
audioworklet_resume_ctx(audioworklet);
}
return _len;
}
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_BLOCK
/* returns true if fake block should continue */
bool audioworklet_external_block(void)
{
audioworklet_data_t *audioworklet = audioworklet_static_data;
if (audioworklet)
{
#ifdef EMSCRIPTEN_AUDIO_FAKE_BLOCK
if (!audioworklet->block_requested)
return false;
#endif
while (audioworklet->initing && !audioworklet->init_done)
#ifdef EMSCRIPTEN_AUDIO_ASYNC_BLOCK
retro_sleep(1);
#else
return true;
#endif
if (audioworklet->init_done && !audioworklet->driver_running)
{
audioworklet->initing = false;
if (audioworklet->init_error)
{
audioworklet_init_error(audioworklet);
abort();
return false;
}
audioworklet->driver_running = true;
}
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
if (!audioworklet->driver_running)
return false;
while (emscripten_atomic_load_u32(&audioworklet->write_avail_bytes) < audioworklet->write_avail_diff)
{
audioworklet_resume_ctx(audioworklet);
#ifdef EMSCRIPTEN_AUDIO_ASYNC_BLOCK
retro_sleep(1);
#else
return true;
#endif
}
#endif
#ifdef EMSCRIPTEN_AUDIO_FAKE_BLOCK
audioworklet->block_requested = false;
platform_emscripten_exit_fake_block();
return true; /* return to RAF if needed */
#endif
}
return false;
}
#endif
/* called on program exit */
void audioworklet_close(void)
{
audioworklet_data_t *audioworklet = audioworklet_static_data;
if (!audioworklet)
return;
MAIN_THREAD_EM_ASM({
emscriptenGetAudioObject($0).close();
}, audioworklet->context);
}
static bool audioworklet_stop(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
audioworklet->running = false;
return true;
}
static bool audioworklet_start(void *data, bool is_shutdown)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
audioworklet->running = true;
return true;
}
static bool audioworklet_alive(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
return audioworklet->running;
}
static void audioworklet_set_nonblock_state(void *data, bool state)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
audioworklet->nonblock = state;
}
static void audioworklet_free(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
/* that's not good... this shouldn't happen? */
if (!audioworklet->driver_running)
{
RARCH_ERR("[AudioWorklet] Tried to free before done initing.\n");
return;
}
#ifdef PROXY_TO_PTHREAD
if (!emscripten_lock_wait_acquire(&audioworklet->buffer_lock, 10000000))
#else
if (!emscripten_lock_busyspin_wait_acquire(&audioworklet->buffer_lock, 10))
#endif
{
RARCH_ERR("[AudioWorklet] Main thread: could not acquire lock to free buffer.\n");
return;
}
audioworklet->driver_running = false;
fifo_free(audioworklet->buffer);
emscripten_lock_release(&audioworklet->buffer_lock);
MAIN_THREAD_ASYNC_EM_ASM({
emscriptenGetAudioObject($0).suspend();
}, audioworklet->context);
}
static size_t audioworklet_write_avail(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
#ifdef EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
size_t avail = emscripten_atomic_load_u32(&audioworklet->write_avail_bytes);
if (avail > audioworklet->write_avail_diff)
return avail - audioworklet->write_avail_diff;
return 0;
#else
return emscripten_atomic_load_u32(&audioworklet->write_avail_bytes);
#endif
}
static size_t audioworklet_buffer_size(void *data)
{
audioworklet_data_t *audioworklet = (audioworklet_data_t*)data;
return audioworklet->visible_buffer_size;
}
static bool audioworklet_use_float(void *data) { return true; }
audio_driver_t audio_audioworklet = {
audioworklet_init,
audioworklet_write,
audioworklet_stop,
audioworklet_start,
audioworklet_alive,
audioworklet_set_nonblock_state,
audioworklet_free,
audioworklet_use_float,
"audioworklet",
NULL,
NULL,
audioworklet_write_avail,
audioworklet_buffer_size
};
+62 -69
View File
@@ -78,7 +78,7 @@ static void coreaudio_free(void *data)
free(dev);
}
static OSStatus audio_write_cb(void *userdata,
static OSStatus coreaudio_audio_write_cb(void *userdata,
AudioUnitRenderActionFlags *action_flags,
const AudioTimeStamp *time_stamp, UInt32 bus_number,
UInt32 number_frames, AudioBufferList *io_data)
@@ -102,31 +102,24 @@ static OSStatus audio_write_cb(void *userdata,
if (FIFO_READ_AVAIL(dev->buffer) < write_avail)
{
*action_flags = kAudioUnitRenderAction_OutputIsSilence;
/* Seems to be needed. */
memset(outbuf, 0, write_avail);
slock_unlock(dev->lock);
/* Technically possible to deadlock without. */
scond_signal(dev->cond);
return noErr;
}
fifo_read(dev->buffer, outbuf, write_avail);
else
fifo_read(dev->buffer, outbuf, write_avail);
slock_unlock(dev->lock);
scond_signal(dev->cond);
return noErr;
}
#if !TARGET_OS_IPHONE
static void choose_output_device(coreaudio_t *dev, const char* device)
static void coreaudio_choose_output_device(coreaudio_t *dev, const char* device)
{
int i;
UInt32 deviceCount;
UInt32 device_count;
AudioObjectPropertyAddress propaddr;
AudioDeviceID *devices = NULL;
UInt32 size = 0;
AudioDeviceID *devices = NULL;
UInt32 size = 0;
propaddr.mSelector = kAudioHardwarePropertyDevices;
#if HAS_MACOSX_10_12
@@ -140,36 +133,35 @@ static void choose_output_device(coreaudio_t *dev, const char* device)
&propaddr, 0, 0, &size) != noErr)
return;
deviceCount = size / sizeof(AudioDeviceID);
devices = (AudioDeviceID*)malloc(size);
if (!devices || AudioObjectGetPropertyData(kAudioObjectSystemObject,
&propaddr, 0, 0, &size, devices) != noErr)
goto done;
device_count = size / sizeof(AudioDeviceID);
devices = (AudioDeviceID*)malloc(size);
if (devices && AudioObjectGetPropertyData(kAudioObjectSystemObject,
&propaddr, 0, 0, &size, devices) == noErr)
{
#if HAS_MACOSX_10_12
#else
propaddr.mScope = kAudioDevicePropertyScopeOutput;
propaddr.mScope = kAudioDevicePropertyScopeOutput;
#endif
propaddr.mSelector = kAudioDevicePropertyDeviceName;
propaddr.mSelector = kAudioDevicePropertyDeviceName;
for (i = 0; i < (int)deviceCount; i ++)
{
char device_name[1024];
device_name[0] = 0;
size = 1024;
if (AudioObjectGetPropertyData(devices[i],
&propaddr, 0, 0, &size, device_name) == noErr
&& string_is_equal(device_name, device))
for (i = 0; i < (int)device_count; i ++)
{
AudioUnitSetProperty(dev->dev, kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Global, 0, &devices[i], sizeof(AudioDeviceID));
goto done;
char device_name[1024];
device_name[0] = 0;
size = 1024;
if (AudioObjectGetPropertyData(devices[i],
&propaddr, 0, 0, &size, device_name) == noErr
&& string_is_equal(device_name, device))
{
AudioUnitSetProperty(dev->dev, kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Global, 0, &devices[i], sizeof(AudioDeviceID));
break;
}
}
}
done:
free(devices);
}
#endif
@@ -232,7 +224,7 @@ static void *coreaudio_init(const char *device,
#if !TARGET_OS_IPHONE
if (device)
choose_output_device(dev, device);
coreaudio_choose_output_device(dev, device);
#endif
dev->dev_alive = true;
@@ -245,9 +237,11 @@ static void *coreaudio_init(const char *device,
stream_desc.mBytesPerFrame = 2 * sizeof(float);
stream_desc.mFramesPerPacket = 1;
stream_desc.mFormatID = kAudioFormatLinearPCM;
stream_desc.mFormatFlags = kAudioFormatFlagIsFloat |
kAudioFormatFlagIsPacked | (is_little_endian() ?
0 : kAudioFormatFlagIsBigEndian);
stream_desc.mFormatFlags = kAudioFormatFlagIsFloat
| kAudioFormatFlagIsPacked;
if (!is_little_endian())
stream_desc.mFormatFlags |= kAudioFormatFlagIsBigEndian;
if (AudioUnitSetProperty(dev->dev, kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input, 0, &stream_desc, sizeof(stream_desc)) != noErr)
@@ -268,7 +262,7 @@ static void *coreaudio_init(const char *device,
if (real_desc.mFormatID != stream_desc.mFormatID)
goto error;
RARCH_LOG("[CoreAudio]: Using output sample rate of %.1f Hz\n",
RARCH_LOG("[CoreAudio] Using output sample rate of %.1f Hz.\n",
(float)real_desc.mSampleRate);
*new_rate = real_desc.mSampleRate;
@@ -281,7 +275,7 @@ static void *coreaudio_init(const char *device,
#endif
/* Set callbacks and finish up. */
cb.inputProc = audio_write_cb;
cb.inputProc = coreaudio_audio_write_cb;
cb.inputProcRefCon = dev;
if (AudioUnitSetProperty(dev->dev, kAudioUnitProperty_SetRenderCallback,
@@ -298,7 +292,7 @@ static void *coreaudio_init(const char *device,
if (!(dev->buffer = fifo_new(fifo_size)))
goto error;
RARCH_LOG("[CoreAudio]: Using buffer size of %u bytes: (latency = %u ms)\n",
RARCH_LOG("[CoreAudio] Using buffer size of %u bytes: (latency = %u ms).\n",
(unsigned)fifo_size, latency);
if (AudioOutputUnitStart(dev->dev) != noErr)
@@ -307,31 +301,31 @@ static void *coreaudio_init(const char *device,
return dev;
error:
RARCH_ERR("[CoreAudio]: Failed to initialize driver ...\n");
RARCH_ERR("[CoreAudio] Failed to initialize driver.\n");
coreaudio_free(dev);
return NULL;
}
static ssize_t coreaudio_write(void *data, const void *buf_, size_t size)
static ssize_t coreaudio_write(void *data, const void *buf_, size_t len)
{
coreaudio_t *dev = (coreaudio_t*)data;
const uint8_t *buf = (const uint8_t*)buf_;
size_t written = 0;
size_t _len = 0;
while (!dev->is_paused && size > 0)
while (!dev->is_paused && len > 0)
{
size_t write_avail;
slock_lock(dev->lock);
write_avail = FIFO_WRITE_AVAIL(dev->buffer);
if (write_avail > size)
write_avail = size;
if (write_avail > len)
write_avail = len;
fifo_write(dev->buffer, buf, write_avail);
buf += write_avail;
written += write_avail;
size -= write_avail;
_len += write_avail;
len -= write_avail;
if (dev->nonblock)
{
@@ -353,7 +347,7 @@ static ssize_t coreaudio_write(void *data, const void *buf_, size_t size)
slock_unlock(dev->lock);
}
return written;
return _len;
}
static void coreaudio_set_nonblock_state(void *data, bool state)
@@ -374,19 +368,25 @@ static bool coreaudio_alive(void *data)
static bool coreaudio_stop(void *data)
{
coreaudio_t *dev = (coreaudio_t*)data;
if (!dev)
return false;
dev->is_paused = (AudioOutputUnitStop(dev->dev) == noErr) ? true : false;
return dev->is_paused ? true : false;
if (dev)
{
dev->is_paused = (AudioOutputUnitStop(dev->dev) == noErr) ? true : false;
if (dev->is_paused)
return true;
}
return false;
}
static bool coreaudio_start(void *data, bool is_shutdown)
{
coreaudio_t *dev = (coreaudio_t*)data;
if (!dev)
return false;
dev->is_paused = (AudioOutputUnitStart(dev->dev) == noErr) ? false : true;
return dev->is_paused ? false : true;
if (dev)
{
dev->is_paused = (AudioOutputUnitStart(dev->dev) == noErr) ? false : true;
if (!dev->is_paused)
return true;
}
return false;
}
static bool coreaudio_use_float(void *data) { return true; }
@@ -409,16 +409,9 @@ 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 */
}
/* TODO/FIXME - implement */
static void *coreaudio_device_list_new(void *data) { return NULL; }
static void coreaudio_device_list_free(void *data, void *array_list_data) { }
audio_driver_t audio_coreaudio = {
coreaudio_init,
+17 -23
View File
@@ -27,6 +27,9 @@
#pragma mark - ringbuffer
#define UNLIKELY(x) __builtin_expect((x), 0)
#define LIKELY(x) __builtin_expect((x), 1)
typedef struct ringbuffer
{
float *buffer;
@@ -93,9 +96,6 @@ static void rb_free(ringbuffer_h r)
memset(r, 0, sizeof(*r));
}
#define UNLIKELY(x) __builtin_expect((x), 0)
#define LIKELY(x) __builtin_expect((x), 1)
static void rb_write_data(ringbuffer_h r, const float *data, size_t len)
{
size_t avail = rb_avail(r);
@@ -109,8 +109,8 @@ static void rb_write_data(ringbuffer_h r, const float *data, size_t len)
rest_write = n - first_write;
}
memcpy(r->buffer + r->write_ptr, data, first_write*sizeof(float));
memcpy(r->buffer, data + first_write, rest_write*sizeof(float));
memcpy(r->buffer + r->write_ptr, data, first_write * sizeof(float));
memcpy(r->buffer, data + first_write, rest_write * sizeof(float));
rb_advance_write_n(r, n);
rb_len_add(r, (int)n);
@@ -155,7 +155,7 @@ static void rb_read_data(ringbuffer_h r,
#pragma mark - CoreAudio3
static bool g_interrupted;
static bool coreaudio3_g_interrupted;
@interface CoreAudio3 : NSObject {
ringbuffer_t _rb;
@@ -227,7 +227,7 @@ static bool g_interrupted;
_au = au;
RARCH_LOG("[CoreAudio3]: Using buffer size of %u bytes: (latency = %u ms)\n", (unsigned)self.bufferSizeInBytes, latency);
RARCH_LOG("[CoreAudio3] Using buffer size of %u bytes: (latency = %u ms).\n", (unsigned)self.bufferSizeInBytes, latency);
[self start];
}
@@ -260,8 +260,8 @@ static bool g_interrupted;
}
- (ssize_t)writeFloat:(const float *)data samples:(size_t)samples {
size_t written = 0;
while (!g_interrupted && samples > 0)
size_t _len = 0;
while (!coreaudio3_g_interrupted && samples > 0)
{
size_t write_avail = rb_avail(&_rb);
if (write_avail > samples)
@@ -269,7 +269,7 @@ static bool g_interrupted;
rb_write_data(&_rb, data, write_avail);
data += write_avail;
written += write_avail;
_len += write_avail;
samples -= write_avail;
if (_nonBlock)
@@ -279,7 +279,7 @@ static bool g_interrupted;
dispatch_semaphore_wait(_sema, DISPATCH_TIME_FOREVER);
}
return written;
return _len;
}
@end
@@ -307,12 +307,11 @@ static void *coreaudio3_init(const char *device,
return (__bridge_retained void *)dev;
}
static ssize_t coreaudio3_write(void *data,
const void *buf_, size_t size)
static ssize_t coreaudio3_write(void *data, const void *buf_, size_t len)
{
CoreAudio3 *dev = (__bridge CoreAudio3 *)data;
return [dev writeFloat:(const float *)
buf_ samples:size/sizeof(float)] * sizeof(float);
buf_ samples:len / sizeof(float)] * sizeof(float);
}
static void coreaudio3_set_nonblock_state(void *data, bool state)
@@ -328,8 +327,7 @@ static bool coreaudio3_alive(void *data)
{
CoreAudio3 *dev = (__bridge CoreAudio3 *)data;
if (dev == nil)
return NO;
return false;
return !dev.paused;
}
@@ -337,8 +335,7 @@ static bool coreaudio3_stop(void *data)
{
CoreAudio3 *dev = (__bridge CoreAudio3 *)data;
if (dev == nil)
return NO;
return false;
[dev stop];
return dev.paused;
}
@@ -347,16 +344,13 @@ static bool coreaudio3_start(void *data, bool is_shutdown)
{
CoreAudio3 *dev = (__bridge CoreAudio3 *)data;
if (dev == nil)
return NO;
return false;
[dev start];
return !dev.paused;
}
static bool coreaudio3_use_float(void *data)
{
return YES;
}
static bool coreaudio3_use_float(void *data) { return true; }
static size_t coreaudio3_write_avail(void *data)
{
+476
View File
@@ -0,0 +1,476 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2025 - Joseph Mattiello
*
* 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.
*/
#import <AudioToolbox/AudioToolbox.h>
#import <AVFoundation/AVFoundation.h>
#include "audio/microphone_driver.h"
#include "queues/fifo_queue.h"
#include "verbosity.h"
#include <memory.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include "audio/audio_driver.h"
#include "../../verbosity.h"
typedef struct coreaudio_microphone
{
AudioUnit audio_unit; /* CoreAudio audio unit */
AudioStreamBasicDescription format; /* Audio format */
fifo_buffer_t *sample_buffer; /* Sample buffer */
bool is_running; /* Whether the microphone is running */
bool nonblock; /* Non-blocking mode flag */
int sample_rate; /* Current sample rate */
bool use_float; /* Whether to use float format */
} coreaudio_microphone_t;
/* Callback for receiving audio samples */
static OSStatus coreaudio_input_callback(
void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData)
{
OSStatus status;
AudioBufferList bufferList;
void *tempBuffer = NULL;
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)inRefCon;
/* Calculate required buffer size */
size_t bufferSize = inNumberFrames * microphone->format.mBytesPerFrame;
if (bufferSize == 0)
{
RARCH_ERR("[CoreAudio] Invalid buffer size calculation.\n");
return kAudio_ParamError;
}
/* Allocate temporary buffer */
tempBuffer = malloc(bufferSize);
if (!tempBuffer)
{
RARCH_ERR("[CoreAudio] Failed to allocate temporary buffer.\n");
return kAudio_MemFullError;
}
/* Set up buffer list */
bufferList.mNumberBuffers = 1;
bufferList.mBuffers[0].mDataByteSize = (UInt32)bufferSize;
bufferList.mBuffers[0].mData = tempBuffer;
/* Render audio data */
status = AudioUnitRender(microphone->audio_unit,
ioActionFlags,
inTimeStamp,
inBusNumber,
inNumberFrames,
&bufferList);
/* Write to FIFO buffer */
if (status == noErr)
fifo_write(microphone->sample_buffer,
bufferList.mBuffers[0].mData,
bufferList.mBuffers[0].mDataByteSize);
else
{
RARCH_ERR("[CoreAudio] Failed to render audio: %d.\n", status);
}
/* Clean up temporary buffer */
free(tempBuffer);
return status;
}
/* Initialize CoreAudio microphone driver */
static void *coreaudio_microphone_init(void)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)calloc(1, sizeof(*microphone));
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to allocate microphone driver.\n");
return NULL;
}
/* Default sample rate will be set during open_mic */
microphone->sample_rate = 0;
microphone->nonblock = false;
microphone->use_float = false;
return microphone;
}
/* Free CoreAudio microphone driver */
static void coreaudio_microphone_free(void *driver_context)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;
if (microphone)
{
if (microphone->audio_unit && microphone->is_running)
{
AudioOutputUnitStop(microphone->audio_unit);
microphone->is_running = false;
}
/* TODO: This crashes, though we protect calls around `audio_unit` nil! */
#if 0
if (microphone->audio_unit)
{
AudioComponentInstanceDispose(microphone->audio_unit);
microphone->audio_unit = nil;
}
#endif
if (microphone->sample_buffer)
fifo_free(microphone->sample_buffer);
free(microphone);
}
}
/* Read samples from microphone */
static int coreaudio_microphone_read(void *driver_context,
void *microphone_context, void *buf, size_t size)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;
size_t avail, read_amt;
if (!microphone || !buf)
{
RARCH_ERR("[CoreAudio] Invalid parameters in read.\n");
return -1;
}
avail = FIFO_READ_AVAIL(microphone->sample_buffer);
read_amt = MIN(avail, size);
if (microphone->nonblock && read_amt == 0)
return 0; /* Return immediately in non-blocking mode */
if (read_amt > 0)
{
fifo_read(microphone->sample_buffer, buf, read_amt);
#if DEBUG
RARCH_LOG("[CoreAudio] Read %zu bytes from microphone.\n", read_amt);
#endif
}
return (int)read_amt;
}
/* Set non-blocking state */
static void coreaudio_microphone_set_nonblock_state(void *driver_context, bool state)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;
if (microphone)
microphone->nonblock = state;
}
/* Helper method to set audio format */
static void coreaudio_microphone_set_format(coreaudio_microphone_t *microphone, bool use_float)
{
microphone->use_float = use_float; /* Store the format choice */
microphone->format.mSampleRate = microphone->sample_rate;
microphone->format.mFormatID = kAudioFormatLinearPCM;
microphone->format.mFormatFlags = use_float
? (kAudioFormatFlagIsFloat | kAudioFormatFlagIsPacked)
: (kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked);
microphone->format.mFramesPerPacket = 1;
microphone->format.mChannelsPerFrame = 1;
microphone->format.mBitsPerChannel = use_float ? 32 : 16;
microphone->format.mBytesPerFrame = microphone->format.mChannelsPerFrame * microphone->format.mBitsPerChannel / 8;
microphone->format.mBytesPerPacket = microphone->format.mBytesPerFrame * microphone->format.mFramesPerPacket;
RARCH_LOG("[CoreAudio] Format setup: sample_rate=%d, bits=%d, bytes_per_frame=%d.\n",
(int)microphone->format.mSampleRate,
microphone->format.mBitsPerChannel,
microphone->format.mBytesPerFrame);
}
/* Open microphone device */
static void *coreaudio_microphone_open_mic(void *driver_context,
const char *device,
unsigned rate,
unsigned latency,
unsigned *new_rate)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Invalid driver context.\n");
return NULL;
}
/* Initialize handle fields */
microphone->sample_rate = rate;
microphone->use_float = false; /* Default to integer format */
/* Validate requested sample rate */
if (rate != 44100 && rate != 48000)
{
RARCH_WARN("[CoreAudio] Requested sample rate %u not supported, defaulting to 48000.\n", rate);
rate = 48000;
}
#if TARGET_OS_IPHONE
/* Configure audio session */
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *error = nil;
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&error];
if (error)
{
RARCH_ERR("[CoreAudio] Failed to set audio session category: %s.\n", [[error localizedDescription] UTF8String]);
return NULL;
}
/*/ Set preferred sample rate */
[audioSession setPreferredSampleRate:rate error:&error];
if (error)
{
RARCH_ERR("[CoreAudio] Failed to set preferred sample rate: %s.\n", [[error localizedDescription] UTF8String]);
return NULL;
}
/* Get actual sample rate */
Float64 actualRate = [audioSession sampleRate];
if (new_rate)
*new_rate = (unsigned)actualRate;
microphone->sample_rate = (int)actualRate;
RARCH_LOG("[CoreAudio] Using sample rate: %d Hz.\n", microphone->sample_rate);
#else
#endif
/* Set format using helper method */
coreaudio_microphone_set_format(microphone, false); /* Default to 16-bit integer */
/* Calculate FIFO buffer size */
size_t fifoBufferSize = (latency * microphone->sample_rate * microphone->format.mBytesPerFrame) / 1000;
if (fifoBufferSize == 0)
{
RARCH_WARN("[CoreAudio] Calculated FIFO buffer size is 0 for latency: %u, sample_rate: %d, bytes_per_frame: %d.\n",
latency, microphone->sample_rate, microphone->format.mBytesPerFrame);
fifoBufferSize = 1024; /* Default to a reasonable buffer size */
}
RARCH_LOG("[CoreAudio] FIFO buffer size: %zu bytes.\n", fifoBufferSize);
/* Create sample buffer */
microphone->sample_buffer = fifo_new(fifoBufferSize);
if (!microphone->sample_buffer)
{
RARCH_ERR("[CoreAudio] Failed to create sample buffer.\n");
return NULL;
}
/* Initialize audio unit */
AudioComponentDescription desc = {
.componentType = kAudioUnitType_Output,
#if TARGET_OS_IPHONE
.componentSubType = kAudioUnitSubType_RemoteIO,
#else
.componentSubType = kAudioUnitSubType_HALOutput,
#endif
.componentManufacturer = kAudioUnitManufacturer_Apple,
.componentFlags = 0,
.componentFlagsMask = 0
};
AudioComponent comp = AudioComponentFindNext(NULL, &desc);
OSStatus status = AudioComponentInstanceNew(comp, &microphone->audio_unit);
if (status != noErr)
{
RARCH_ERR("[CoreAudio] Failed to create audio unit.\n");
goto error;
}
/* Enable input */
UInt32 flag = 1;
status = AudioUnitSetProperty(microphone->audio_unit,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Input,
1, /* Input bus */
&flag,
sizeof(flag));
if (status != noErr)
{
RARCH_ERR("[CoreAudio] Failed to enable input.\n");
goto error;
}
/* Set format using helper method */
coreaudio_microphone_set_format(microphone, false); /* Default to 16-bit integer */
status = AudioUnitSetProperty(microphone->audio_unit,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
1, /* Input bus */
&microphone->format,
sizeof(microphone->format));
if (status != noErr)
{
RARCH_ERR("[CoreAudio] Failed to set format: %d.\n", status);
goto error;
}
/* Set callback */
AURenderCallbackStruct callback = { coreaudio_input_callback, microphone };
status = AudioUnitSetProperty(microphone->audio_unit,
kAudioOutputUnitProperty_SetInputCallback,
kAudioUnitScope_Global,
1, /* Input bus */
&callback,
sizeof(callback));
if (status != noErr)
{
RARCH_ERR("[CoreAudio] Failed to set callback.\n");
goto error;
}
/* Initialize audio unit */
status = AudioUnitInitialize(microphone->audio_unit);
if (status != noErr)
{
RARCH_ERR("[CoreAudio] Failed to initialize audio unit: %d.\n", status);
goto error;
}
/* Start audio unit */
status = AudioOutputUnitStart(microphone->audio_unit);
if (status != noErr)
{
RARCH_ERR("[CoreAudio] Failed to start audio unit: %d.\n", status);
goto error;
}
return microphone;
error:
if (microphone)
{
if (microphone->audio_unit)
{
AudioComponentInstanceDispose(microphone->audio_unit);
microphone->audio_unit = nil;
}
free(microphone);
}
return NULL;
}
/* Close microphone */
static void coreaudio_microphone_close_mic(void *driver_context, void *microphone_context)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
if (microphone)
{
if (microphone->is_running)
AudioOutputUnitStop(microphone->audio_unit);
if (microphone->audio_unit)
{
AudioComponentInstanceDispose(microphone->audio_unit);
microphone->audio_unit = nil;
}
if (microphone->sample_buffer)
fifo_free(microphone->sample_buffer);
free(microphone);
}
else
{
RARCH_ERR("[CoreAudio] Failed to close microphone.\n");
}
}
/* Start microphone */
static bool coreaudio_microphone_start_mic(void *driver_context, void *microphone_context)
{
RARCH_LOG("[CoreAudio] Starting microphone.\n");
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to start microphone.\n");
return false;
}
RARCH_LOG("[CoreAudio] Starting audio unit...\n");
OSStatus status = AudioOutputUnitStart(microphone->audio_unit);
if (status == noErr)
{
RARCH_LOG("[CoreAudio] Audio unit started successfully.\n");
microphone->is_running = true;
return true;
}
RARCH_ERR("[CoreAudio] Failed to start microphone: %d.\n", status);
return false;
}
/* Stop microphone */
static bool coreaudio_microphone_stop_mic(void *driver_context, void *microphone_context)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to stop microphone.\n");
return false;
}
if (microphone->is_running)
{
OSStatus status = AudioOutputUnitStop(microphone->audio_unit);
if (status == noErr)
{
microphone->is_running = false;
return true;
}
RARCH_ERR("[CoreAudio] Failed to stop microphone: %d.\n", status);
}
return true; /* Already stopped */
}
/* Check if microphone is alive */
static bool coreaudio_microphone_mic_alive(const void *driver_context, const void *microphone_context)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
return microphone && microphone->is_running;
}
/* Check if microphone uses float samples */
static bool coreaudio_microphone_mic_use_float(const void *driver_context, const void *microphone_context)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
return microphone && microphone->use_float;
}
/* Get device list (not implemented for CoreAudio) */
static struct string_list *coreaudio_microphone_device_list_new(const void *driver_context)
{
return NULL;
}
/* Free device list (not implemented for CoreAudio) */
static void coreaudio_microphone_device_list_free(const void *driver_context, struct string_list *devices)
{
}
/* CoreAudio microphone driver structure */
microphone_driver_t microphone_coreaudio = {
coreaudio_microphone_init,
coreaudio_microphone_free,
coreaudio_microphone_read,
coreaudio_microphone_set_nonblock_state,
"coreaudio",
coreaudio_microphone_device_list_new,
coreaudio_microphone_device_list_free,
coreaudio_microphone_open_mic,
coreaudio_microphone_close_mic,
coreaudio_microphone_mic_alive,
coreaudio_microphone_start_mic,
coreaudio_microphone_stop_mic,
coreaudio_microphone_mic_use_float
};
File diff suppressed because it is too large. Load diff
+24 -29
View File
@@ -162,34 +162,35 @@ static void ctr_csnd_audio_free(void *data)
free(ctr);
}
static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t len)
{
int i;
uint32_t samples_played = 0;
uint64_t current_tick = 0;
const uint16_t *src = buf;
ctr_csnd_audio_t *ctr = (ctr_csnd_audio_t*)data;
unsigned int i;
uint32_t samples_played = 0;
uint64_t current_tick = 0;
const uint16_t *src = buf;
ctr_csnd_audio_t *ctr = (ctr_csnd_audio_t*)data;
ctr_csnd_audio_update_playpos(ctr);
if ((((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 2)) ||
(((ctr->pos - ctr->playpos ) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 4)) ||
(((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (size >> 2)))
if ( (((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 2))
|| (((ctr->pos - ctr->playpos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 4))
|| (((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (len >> 2)))
{
if (ctr->nonblock)
ctr->pos = (ctr->playpos + (CTR_CSND_AUDIO_COUNT >> 1)) & CTR_CSND_AUDIO_COUNT_MASK;
else
{
do{
do
{
/* todo: compute the correct sleep period */
retro_sleep(1);
ctr_csnd_audio_update_playpos(ctr);
}while (((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 1)
} while (((ctr->playpos - ctr->pos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 1)
|| (((ctr->pos - ctr->playpos) & CTR_CSND_AUDIO_COUNT_MASK) < (CTR_CSND_AUDIO_COUNT >> 4)));
}
}
for (i = 0; i < (size >> 1); i += 2)
for (i = 0; i < (len >> 1); i += 2)
{
ctr->l[ctr->pos] = src[i];
ctr->r[ctr->pos] = src[i + 1];
@@ -200,7 +201,7 @@ static ssize_t ctr_csnd_audio_write(void *data, const void *buf, size_t size)
GSPGPU_FlushDataCache(ctr->l, CTR_CSND_AUDIO_SIZE);
GSPGPU_FlushDataCache(ctr->r, CTR_CSND_AUDIO_SIZE);
return size;
return len;
}
static bool ctr_csnd_audio_stop(void *data)
@@ -239,20 +240,19 @@ static bool ctr_csnd_audio_start(void *data, bool is_shutdown)
/* Prevents restarting audio when the menu
* is toggled off on shutdown */
if (is_shutdown)
return true;
if (!is_shutdown)
{
#if 0
CSND_SetPlayState(0x8, 1);
CSND_SetPlayState(0x9, 1);
CSND_SetPlayState(0x8, 1);
CSND_SetPlayState(0x9, 1);
#endif
CSND_SetVol(0x8, 0x00008000, 0);
CSND_SetVol(0x9, 0x80000000, 0);
CSND_SetVol(0x8, 0x00008000, 0);
CSND_SetVol(0x9, 0x80000000, 0);
csndExecCmds(false);
ctr->playing = true;
csndExecCmds(false);
ctr->playing = true;
}
return true;
}
@@ -264,11 +264,7 @@ static void ctr_csnd_audio_set_nonblock_state(void *data, bool state)
ctr->nonblock = state;
}
static bool ctr_csnd_audio_use_float(void *data)
{
(void)data;
return false;
}
static bool ctr_csnd_audio_use_float(void *data) { return false; }
static size_t ctr_csnd_audio_write_avail(void *data)
{
@@ -280,7 +276,6 @@ static size_t ctr_csnd_audio_write_avail(void *data)
static size_t ctr_csnd_audio_buffer_size(void *data)
{
(void)data;
return CTR_CSND_AUDIO_COUNT;
}
+23 -26
View File
@@ -19,6 +19,8 @@
#include "../audio_driver.h"
#include "../../ctr/ctr_debug.h"
#include "../../retroarch.h"
#include "../../verbosity.h"
typedef struct
{
@@ -91,15 +93,15 @@ static void ctr_dsp_audio_free(void *data)
ndspExit();
}
static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t len)
{
u32 pos;
ctr_dsp_audio_t * ctr = (ctr_dsp_audio_t*)data;
uint32_t sample_pos = ndspChnGetSamplePos(ctr->channel);
ctr_dsp_audio_t *ctr = (ctr_dsp_audio_t*)data;
uint32_t sample_pos = ndspChnGetSamplePos(ctr->channel);
if ((((sample_pos - ctr->pos) & CTR_DSP_AUDIO_COUNT_MASK) < (CTR_DSP_AUDIO_COUNT >> 2)) ||
(((ctr->pos - sample_pos ) & CTR_DSP_AUDIO_COUNT_MASK) < (CTR_DSP_AUDIO_COUNT >> 4)) ||
(((sample_pos - ctr->pos) & CTR_DSP_AUDIO_COUNT_MASK) < (size >> 2)))
if ( (((sample_pos - ctr->pos) & CTR_DSP_AUDIO_COUNT_MASK) < (CTR_DSP_AUDIO_COUNT >> 2))
|| (((ctr->pos - sample_pos) & CTR_DSP_AUDIO_COUNT_MASK) < (CTR_DSP_AUDIO_COUNT >> 4))
|| (((sample_pos - ctr->pos) & CTR_DSP_AUDIO_COUNT_MASK) < (len >> 2)))
{
if (ctr->nonblock)
ctr->pos = (sample_pos + (CTR_DSP_AUDIO_COUNT >> 1)) & CTR_DSP_AUDIO_COUNT_MASK;
@@ -113,38 +115,38 @@ static ssize_t ctr_dsp_audio_write(void *data, const void *buf, size_t size)
* changed, this prevents a hang on sleep. */
if (!aptMainLoop())
{
command_event(CMD_EVENT_QUIT, NULL);
retroarch_main_quit();
return true;
}
sample_pos = ndspChnGetSamplePos(ctr->channel);
}while ( ((sample_pos - (ctr->pos + (size >>2))) & CTR_DSP_AUDIO_COUNT_MASK) > (CTR_DSP_AUDIO_COUNT >> 1)
}while ( ((sample_pos - (ctr->pos + (len >>2))) & CTR_DSP_AUDIO_COUNT_MASK) > (CTR_DSP_AUDIO_COUNT >> 1)
|| (((ctr->pos - (CTR_DSP_AUDIO_COUNT >> 4) - sample_pos) & CTR_DSP_AUDIO_COUNT_MASK) > (CTR_DSP_AUDIO_COUNT >> 1)));
}
}
pos = ctr->pos << 2;
if ((pos + size) > CTR_DSP_AUDIO_SIZE)
if ((pos + len) > CTR_DSP_AUDIO_SIZE)
{
memcpy(ctr->dsp_buf.data_pcm8 + pos, buf,
(CTR_DSP_AUDIO_SIZE - pos));
DSP_FlushDataCache(ctr->dsp_buf.data_pcm8 + pos, (CTR_DSP_AUDIO_SIZE - pos));
memcpy(ctr->dsp_buf.data_pcm8, (uint8_t*) buf + (CTR_DSP_AUDIO_SIZE - pos),
(pos + size - CTR_DSP_AUDIO_SIZE));
DSP_FlushDataCache(ctr->dsp_buf.data_pcm8, (pos + size - CTR_DSP_AUDIO_SIZE));
(pos + len - CTR_DSP_AUDIO_SIZE));
DSP_FlushDataCache(ctr->dsp_buf.data_pcm8, (pos + len - CTR_DSP_AUDIO_SIZE));
}
else
{
memcpy(ctr->dsp_buf.data_pcm8 + pos, buf, size);
DSP_FlushDataCache(ctr->dsp_buf.data_pcm8 + pos, size);
memcpy(ctr->dsp_buf.data_pcm8 + pos, buf, len);
DSP_FlushDataCache(ctr->dsp_buf.data_pcm8 + pos, len);
}
ctr->pos += size >> 2;
ctr->pos += len >> 2;
ctr->pos &= CTR_DSP_AUDIO_COUNT_MASK;
return size;
return len;
}
static bool ctr_dsp_audio_stop(void *data)
@@ -169,11 +171,11 @@ static bool ctr_dsp_audio_start(void *data, bool is_shutdown)
/* Prevents restarting audio when the menu
* is toggled off on shutdown */
if (is_shutdown)
return true;
ndspSetMasterVol(1.0);
ctr->playing = true;
if (!is_shutdown)
{
ndspSetMasterVol(1.0);
ctr->playing = true;
}
return true;
}
@@ -185,11 +187,7 @@ static void ctr_dsp_audio_set_nonblock_state(void *data, bool state)
ctr->nonblock = state;
}
static bool ctr_dsp_audio_use_float(void *data)
{
(void)data;
return false;
}
static bool ctr_dsp_audio_use_float(void *data) { return false; }
static size_t ctr_dsp_audio_write_avail(void *data)
{
@@ -200,7 +198,6 @@ static size_t ctr_dsp_audio_write_avail(void *data)
static size_t ctr_dsp_audio_buffer_size(void *data)
{
(void)data;
return CTR_DSP_AUDIO_COUNT;
}
+15 -13
View File
@@ -16,11 +16,13 @@
#include <3ds.h>
#include <string.h>
#include <malloc.h>
#include <math.h>
#include <queues/fifo_queue.h>
#include <rthreads/rthreads.h>
#include "../audio_driver.h"
#include "../../ctr/ctr_debug.h"
#include "../../verbosity.h"
typedef struct
{
@@ -43,7 +45,7 @@ typedef struct
uint32_t pos;
} ctr_dsp_thread_audio_t;
// PCM16 stereo
/* PCM16 stereo */
#define DSP_BYTES_TO_SAMPLES(bytes) (bytes / (2 * sizeof(uint16_t)))
#define DSP_SAMPLES_TO_BYTES(samples) (samples * 2 * sizeof(uint16_t))
@@ -148,7 +150,7 @@ static void *ctr_dsp_thread_audio_init(const char *device, unsigned rate, unsign
|| !(ctr->fifo_done = scond_new())
|| !(ctr->thread = sthread_create(ctr_dsp_audio_loop, ctr)))
{
RARCH_LOG("[Audio]: thread creation failed.\n");
RARCH_LOG("[Audio] Thread creation failed.\n");
ctr->running = false;
ctr_dsp_thread_audio_free(ctr);
return NULL;
@@ -198,9 +200,9 @@ static void ctr_dsp_thread_audio_free(void *data)
ctr = NULL;
}
static ssize_t ctr_dsp_thread_audio_write(void *data, const void *buf, size_t size)
static ssize_t ctr_dsp_thread_audio_write(void *data, const void *buf, size_t len)
{
size_t avail, written;
size_t avail, _len;
ctr_dsp_thread_audio_t * ctr = (ctr_dsp_thread_audio_t*)data;
if (!ctr || !ctr->running)
@@ -210,18 +212,18 @@ static ssize_t ctr_dsp_thread_audio_write(void *data, const void *buf, size_t si
{
slock_lock(ctr->fifo_lock);
avail = FIFO_WRITE_AVAIL(ctr->fifo);
written = MIN(avail, size);
if (written > 0)
_len = MIN(avail, len);
if (_len > 0)
{
fifo_write(ctr->fifo, buf, written);
fifo_write(ctr->fifo, buf, _len);
scond_signal(ctr->fifo_avail);
}
slock_unlock(ctr->fifo_lock);
}
else
{
written = 0;
while (written < size && ctr->running)
_len = 0;
while (_len < len && ctr->running)
{
slock_lock(ctr->fifo_lock);
avail = FIFO_WRITE_AVAIL(ctr->fifo);
@@ -240,16 +242,16 @@ static ssize_t ctr_dsp_thread_audio_write(void *data, const void *buf, size_t si
}
else
{
size_t write_amt = MIN(size - written, avail);
fifo_write(ctr->fifo, (const char*)buf + written, write_amt);
size_t write_amt = MIN(len - _len, avail);
fifo_write(ctr->fifo, (const char*)buf + _len, write_amt);
scond_signal(ctr->fifo_avail);
slock_unlock(ctr->fifo_lock);
written += write_amt;
_len += write_amt;
}
}
}
return written;
return _len;
}
static bool ctr_dsp_thread_audio_stop(void *data)
+166 -147
View File
@@ -53,6 +53,8 @@
#pragma comment(lib, "dxguid")
#endif
#define CHUNK_SIZE 256
typedef struct dsound
{
LPDIRECTSOUND ds;
@@ -67,7 +69,7 @@ typedef struct dsound
#else
HANDLE thread;
#endif
size_t fifo_bufsize;
unsigned buffer_size;
bool nonblock;
@@ -75,17 +77,6 @@ typedef struct dsound
volatile bool thread_alive;
} dsound_t;
/* Forward declarations */
static void *dsound_list_new(void *u);
static INLINE unsigned write_avail(unsigned read_ptr,
unsigned write_ptr, unsigned buffer_size)
{
return (read_ptr + buffer_size - write_ptr) % buffer_size;
}
#define CHUNK_SIZE 256
struct audio_lock
{
void *chunk1;
@@ -94,39 +85,94 @@ struct audio_lock
DWORD size2;
};
static bool grab_region(dsound_t *ds, uint32_t write_ptr,
static BOOL CALLBACK dsound_enumerate_cb(LPGUID guid,
LPCSTR desc, LPCSTR module, LPVOID context)
{
union string_list_elem_attr attr;
struct string_list *list = (struct string_list*)context;
attr.i = 0;
string_list_append(list, desc, attr);
if (guid)
{
LPGUID guid_copy = (LPGUID)malloc(sizeof(GUID) * 1);
if (guid_copy)
{
int i;
guid_copy->Data1 = guid->Data1;
guid_copy->Data2 = guid->Data2;
guid_copy->Data3 = guid->Data3;
for (i = 0; i < 8; i++)
guid_copy->Data4[i] = guid->Data4[i];
list->elems[list->size - 1].userdata = guid_copy;
}
}
return TRUE;
}
static void *dsound_list_new(void *u)
{
struct string_list *sl = string_list_new();
if (!sl)
return NULL;
#ifndef _XBOX
#ifdef UNICODE
DirectSoundEnumerate((LPDSENUMCALLBACKW)dsound_enumerate_cb, sl);
#else
DirectSoundEnumerate((LPDSENUMCALLBACKA)dsound_enumerate_cb, sl);
#endif
#endif
return sl;
}
static INLINE unsigned _dsound_write_avail(unsigned read_ptr,
unsigned write_ptr, unsigned buffer_size)
{
return (read_ptr + buffer_size - write_ptr) % buffer_size;
}
static bool dsound_grab_region(dsound_t *ds, uint32_t write_ptr,
struct audio_lock *region, HRESULT res)
{
if (res == DSERR_BUFFERLOST)
{
#ifdef DEBUG
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_BUFFERLOST");
RARCH_WARN("[DirectSound] %s.\n", "DSERR_BUFFERLOST");
#endif
if ((res = IDirectSoundBuffer_Restore(ds->dsb)) != DS_OK)
return false;
if ((res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
&region->chunk1, &region->size1, &region->chunk2, &region->size2, 0)) != DS_OK)
return false;
return true;
if ((IDirectSoundBuffer_Restore(ds->dsb)) == DS_OK)
if ((IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
&region->chunk1, &region->size1, &region->chunk2, &region->size2, 0)) == DS_OK)
return true;
}
#ifdef DEBUG
switch (res)
else
{
case DSERR_INVALIDCALL:
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_INVALIDCALL");
break;
case DSERR_INVALIDPARAM:
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_INVALIDPARAM");
break;
case DSERR_PRIOLEVELNEEDED:
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_PRIOLEVELNEEDED");
break;
default:
break;
switch (res)
{
case DSERR_INVALIDCALL:
RARCH_WARN("[DirectSound] %s.\n", "DSERR_INVALIDCALL");
break;
case DSERR_INVALIDPARAM:
RARCH_WARN("[DirectSound] %s.\n", "DSERR_INVALIDPARAM");
break;
case DSERR_PRIOLEVELNEEDED:
RARCH_WARN("[DirectSound] %s.\n", "DSERR_PRIOLEVELNEEDED");
break;
default:
break;
}
}
#endif
return false;
}
@@ -152,7 +198,7 @@ static DWORD CALLBACK dsound_thread(PVOID data)
DWORD read_ptr, avail, fifo_avail;
IDirectSoundBuffer_GetCurrentPosition(ds->dsb, &read_ptr, NULL);
avail = write_avail(read_ptr, write_ptr, ds->buffer_size);
avail = _dsound_write_avail(read_ptr, write_ptr, ds->buffer_size);
EnterCriticalSection(&ds->crit);
fifo_avail = FIFO_READ_AVAIL(ds->buffer);
@@ -174,7 +220,7 @@ static DWORD CALLBACK dsound_thread(PVOID data)
if ((res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
&region.chunk1, &region.size1, &region.chunk2, &region.size2, 0)) != DS_OK)
{
if (!grab_region(ds, write_ptr, &region, res))
if (!dsound_grab_region(ds, write_ptr, &region, res))
{
ds->thread_alive = false;
SetEvent(ds->event);
@@ -192,7 +238,6 @@ static DWORD CALLBACK dsound_thread(PVOID data)
else
{
/* All is good. Pull from it and notify FIFO. */
EnterCriticalSection(&ds->crit);
if (region.chunk1)
fifo_read(ds->buffer, region.chunk1, region.size1);
@@ -205,7 +250,7 @@ static DWORD CALLBACK dsound_thread(PVOID data)
IDirectSoundBuffer_Unlock(ds->dsb, region.chunk1,
region.size1, region.chunk2, region.size2);
write_ptr = (write_ptr + region.size1 + region.size2)
write_ptr = (write_ptr + region.size1 + region.size2)
% ds->buffer_size;
if (is_pull)
@@ -237,11 +282,10 @@ static bool dsound_start_thread(dsound_t *ds)
if (!ds->thread)
{
ds->thread_alive = true;
#ifdef HAVE_THREADS
ds->thread = sthread_create(dsound_thread, ds);
ds->thread = sthread_create(dsound_thread, ds);
#else
ds->thread = CreateThread(NULL, 0, dsound_thread, ds, 0, NULL);
ds->thread = CreateThread(NULL, 0, dsound_thread, ds, 0, NULL);
#endif
if (!ds->thread)
return false;
@@ -303,78 +347,71 @@ static void dsound_free(void *data)
free(ds);
}
static BOOL CALLBACK enumerate_cb(LPGUID guid,
LPCSTR desc, LPCSTR module, LPVOID context)
static void dsound_set_format(WAVEFORMATEX *wf,
bool float_fmt, unsigned channels, unsigned rate)
{
union string_list_elem_attr attr;
struct string_list *list = (struct string_list*)context;
WORD wBitsPerSample = float_fmt ? 32 : 16;
WORD nBlockAlign = (channels * wBitsPerSample) / 8;
DWORD nAvgBytesPerSec = rate * nBlockAlign;
attr.i = 0;
if (float_fmt)
wf->wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
else
wf->wFormatTag = WAVE_FORMAT_PCM;
string_list_append(list, desc, attr);
wf->nChannels = channels;
wf->nSamplesPerSec = rate;
wf->nAvgBytesPerSec = nAvgBytesPerSec;
wf->nBlockAlign = nBlockAlign;
wf->wBitsPerSample = wBitsPerSample;
if (guid)
{
LPGUID guid_copy = (LPGUID)malloc(sizeof(GUID) * 1);
if (guid_copy)
{
unsigned i;
guid_copy->Data1 = guid->Data1;
guid_copy->Data2 = guid->Data2;
guid_copy->Data3 = guid->Data3;
for (i = 0; i < 8; i++)
guid_copy->Data4[i] = guid->Data4[i];
list->elems[list->size - 1].userdata = guid_copy;
}
}
return TRUE;
wf->cbSize = 0;
}
static void dsound_set_wavefmt(WAVEFORMATEX *wfx,
unsigned channels, unsigned samplerate)
static const char *dsound_wave_format_name(const WAVEFORMATEX *format)
{
wfx->wFormatTag = WAVE_FORMAT_PCM;
wfx->nBlockAlign = channels * sizeof(int16_t);
wfx->wBitsPerSample = 16;
switch (format->wFormatTag)
{
case WAVE_FORMAT_PCM:
return "WAVE_FORMAT_PCM";
case WAVE_FORMAT_IEEE_FLOAT:
return "WAVE_FORMAT_IEEE_FLOAT";
default:
break;
}
wfx->nChannels = channels;
wfx->nSamplesPerSec = samplerate;
wfx->nAvgBytesPerSec = wfx->nSamplesPerSec * wfx->nBlockAlign;
wfx->cbSize = 0;
return "<unknown>";
}
static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
unsigned block_frames,
unsigned *new_rate)
unsigned block_frames, unsigned *new_rate)
{
LPGUID selected_device = NULL;
WAVEFORMATEX wfx = {0};
DSBUFFERDESC bufdesc = {0};
int32_t idx_found = -1;
struct string_list *list = (struct string_list*)dsound_list_new(NULL);
dsound_t *ds = (dsound_t*)calloc(1, sizeof(*ds));
LPGUID selected_device = NULL;
WAVEFORMATEX wf = {0};
DSBUFFERDESC bufdesc = {0};
dsound_t *ds = (dsound_t*)calloc(1, sizeof(*ds));
if (!ds)
goto error;
return NULL;
InitializeCriticalSection(&ds->crit);
if (dev)
{
struct string_list *list = (struct string_list*)dsound_list_new(NULL);
/* Search for device name first */
if (list && list->elems)
{
int32_t idx_found = -1;
if (list->elems)
{
unsigned i;
size_t i;
for (i = 0; i < list->size; i++)
{
if (string_is_equal(dev, list->elems[i].data))
{
RARCH_DBG("[DirectSound] Found device #%d: \"%s\".\n", i, list->elems[i].data);
idx_found = i;
selected_device = (LPGUID)list->elems[idx_found].userdata;
break;
@@ -386,19 +423,21 @@ static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
if (idx_found == -1 && isdigit(dev[0]))
{
idx_found = strtoul(dev, NULL, 0);
RARCH_LOG("[DirectSound]: Fallback, device index is a single number index instead: %d.\n", idx_found);
RARCH_LOG("[DirectSound] Fallback, device index is a single number index instead: %d.\n", idx_found);
if (idx_found != -1)
{
if (idx_found < (int32_t)list->size)
{
RARCH_LOG("[DirectSound]: Corresponding name: %s\n", list->elems[idx_found].data);
RARCH_LOG("[DirectSound] Corresponding name: %s.\n", list->elems[idx_found].data);
selected_device = (LPGUID)list->elems[idx_found].userdata;
}
}
}
}
}
string_list_free(list);
}
if (DirectSoundCreate(selected_device, &ds->ds, NULL) != DS_OK)
@@ -409,16 +448,22 @@ static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
goto error;
#endif
dsound_set_wavefmt(&wfx, 2, rate);
dsound_set_format(&wf, false, 2, rate);
RARCH_DBG("[DirectSound] Requesting %u-bit %u-channel client with %s samples at %uHz %ums.\n",
wf.wBitsPerSample,
wf.nChannels,
dsound_wave_format_name(&wf),
wf.nSamplesPerSec,
latency);
ds->buffer_size = (latency * wfx.nAvgBytesPerSec) / 1000;
ds->buffer_size = (latency * wf.nAvgBytesPerSec) / 1000;
ds->buffer_size /= CHUNK_SIZE;
ds->buffer_size *= CHUNK_SIZE;
if (ds->buffer_size < 4 * CHUNK_SIZE)
ds->buffer_size = 4 * CHUNK_SIZE;
RARCH_LOG("[DirectSound]: Setting buffer size of %u bytes\n", ds->buffer_size);
RARCH_LOG("[DirectSound]: Latency = %u ms\n", (unsigned)((1000 * ds->buffer_size) / wfx.nAvgBytesPerSec));
RARCH_LOG("[DirectSound] Setting buffer size of %u bytes.\n", ds->buffer_size);
RARCH_LOG("[DirectSound] Latency = %u ms.\n", (unsigned)((1000 * ds->buffer_size) / wf.nAvgBytesPerSec));
bufdesc.dwSize = sizeof(DSBUFFERDESC);
bufdesc.dwFlags = 0;
@@ -426,13 +471,14 @@ static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
bufdesc.dwFlags = DSBCAPS_GETCURRENTPOSITION2 | DSBCAPS_GLOBALFOCUS;
#endif
bufdesc.dwBufferBytes = ds->buffer_size;
bufdesc.lpwfxFormat = &wfx;
bufdesc.lpwfxFormat = &wf;
ds->event = CreateEvent(NULL, false, false, NULL);
if (!ds->event)
goto error;
ds->buffer = fifo_new(4 * 1024);
ds->fifo_bufsize = 4 * 1024;
ds->buffer = fifo_new(ds->fifo_bufsize);
if (!ds->buffer)
goto error;
@@ -444,19 +490,12 @@ static void *dsound_init(const char *dev, unsigned rate, unsigned latency,
dsound_clear_buffer(ds);
if (IDirectSoundBuffer_Play(ds->dsb, 0, 0, DSBPLAY_LOOPING) != DS_OK)
goto error;
if (!dsound_start_thread(ds))
goto error;
string_list_free(list);
return ds;
if (IDirectSoundBuffer_Play(ds->dsb, 0, 0, DSBPLAY_LOOPING) == DS_OK)
if (dsound_start_thread(ds))
return ds;
error:
RARCH_ERR("[DirectSound] Error occurred in init.\n");
if (list)
string_list_free(list);
dsound_free(ds);
return NULL;
}
@@ -464,11 +503,9 @@ error:
static bool dsound_stop(void *data)
{
dsound_t *ds = (dsound_t*)data;
dsound_stop_thread(ds);
ds->is_paused = (IDirectSoundBuffer_Stop(ds->dsb) == DS_OK) ? true : false;
return (ds->is_paused) ? true : false;
return ds->is_paused;
}
static bool dsound_start(void *data, bool is_shutdown)
@@ -482,16 +519,13 @@ static bool dsound_start(void *data, bool is_shutdown)
ds->is_paused = (IDirectSoundBuffer_Play(
ds->dsb, 0, 0, DSBPLAY_LOOPING) == DS_OK) ? false : true;
return (ds->is_paused) ? false : true;
return !ds->is_paused;
}
static bool dsound_alive(void *data)
{
dsound_t *ds = (dsound_t*)data;
if (!ds)
return false;
return !ds->is_paused;
return ds && !ds->is_paused;
}
static void dsound_set_nonblock_state(void *data, bool state)
@@ -501,9 +535,9 @@ static void dsound_set_nonblock_state(void *data, bool state)
ds->nonblock = state;
}
static ssize_t dsound_write(void *data, const void *buf_, size_t size)
static ssize_t dsound_write(void *data, const void *buf_, size_t len)
{
size_t written = 0;
size_t _len = 0;
dsound_t *ds = (dsound_t*)data;
const uint8_t *buf = (const uint8_t*)buf_;
@@ -512,51 +546,48 @@ static ssize_t dsound_write(void *data, const void *buf_, size_t size)
if (ds->nonblock)
{
if (size > 0)
if (len > 0)
{
size_t avail;
EnterCriticalSection(&ds->crit);
avail = FIFO_WRITE_AVAIL(ds->buffer);
if (avail > size)
avail = size;
if (avail > len)
avail = len;
fifo_write(ds->buffer, buf, avail);
LeaveCriticalSection(&ds->crit);
buf += avail;
size -= avail;
written += avail;
_len += avail;
}
}
else
{
while (size > 0)
while (len > 0)
{
size_t avail;
EnterCriticalSection(&ds->crit);
avail = FIFO_WRITE_AVAIL(ds->buffer);
if (avail > size)
avail = size;
if (avail > len)
avail = len;
fifo_write(ds->buffer, buf, avail);
LeaveCriticalSection(&ds->crit);
buf += avail;
size -= avail;
written += avail;
buf += avail;
_len += avail;
len -= avail;
if (!ds->thread_alive)
break;
if (avail == 0)
if (!(WaitForSingleObject(ds->event, 50) == WAIT_OBJECT_0))
return -1;
if (avail == 0 && !(WaitForSingleObject(ds->event, 50) == WAIT_OBJECT_0))
return -1;
}
}
return written;
return _len;
}
static size_t dsound_write_avail(void *data)
@@ -570,27 +601,15 @@ static size_t dsound_write_avail(void *data)
return avail;
}
static size_t dsound_buffer_size(void *data) { return 4 * 1024; }
static bool dsound_use_float(void *data) { return false; }
static void *dsound_list_new(void *u)
static size_t dsound_buffer_size(void *data)
{
struct string_list *sl = string_list_new();
if (!sl)
return NULL;
#ifndef _XBOX
#ifdef UNICODE
DirectSoundEnumerate((LPDSENUMCALLBACKW)enumerate_cb, sl);
#else
DirectSoundEnumerate((LPDSENUMCALLBACKA)enumerate_cb, sl);
#endif
#endif
return sl;
dsound_t *ds = (dsound_t*)data;
return ds->fifo_bufsize;
}
/* TODO/FIXME - implement? */
static bool dsound_use_float(void *data) { return false; }
static void dsound_device_list_free(void *u, void *slp)
{
struct string_list *sl = (struct string_list*)slp;
+25 -28
View File
@@ -16,6 +16,7 @@
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#ifdef GEKKO
#include <gccore.h>
@@ -31,6 +32,10 @@
#include "../audio_driver.h"
#define CHUNK_FRAMES 64
#define CHUNK_SIZE (CHUNK_FRAMES * sizeof(uint32_t))
#define BLOCKS 16
typedef struct
{
size_t write_ptr;
@@ -45,7 +50,7 @@ typedef struct
static volatile gx_audio_t *gx_audio_data = NULL;
static volatile bool stop_audio = false;
static void dma_callback(void)
static void gx_audio_dma_callback(void)
{
gx_audio_t *wa = (gx_audio_t*)gx_audio_data;
@@ -68,7 +73,7 @@ static void *gx_audio_init(const char *device,
unsigned block_frames,
unsigned *new_rate)
{
gx_audio_t *wa = (gx_audio_t*)memalign(32, sizeof(*wa));
gx_audio_t *wa = (gx_audio_t*)memalign(32, sizeof(*wa));
if (!wa)
return NULL;
@@ -77,9 +82,9 @@ static void *gx_audio_init(const char *device,
memset(wa, 0, sizeof(*wa));
AIInit(NULL);
AIRegisterDMACallback(dma_callback);
AIRegisterDMACallback(gx_audio_dma_callback);
/* Ranges 0-32000 (default low) and 40000-47999
/* Ranges 0-32000 (default low) and 40000-47999
(in settings going down from 48000) -> set to 32000 hz */
if (rate <= 32000 || (rate >= 40000 && rate < 48000))
{
@@ -102,19 +107,20 @@ static void *gx_audio_init(const char *device,
}
/* Wii uses silly R, L, R, L interleaving. */
static INLINE void copy_swapped(uint32_t * restrict dst,
const uint32_t * restrict src, size_t size)
static INLINE void gx_audio_copy_swapped(
uint32_t *restrict dst,
const uint32_t * restrict src, size_t len)
{
do
{
uint32_t s = *src++;
*dst++ = (s >> 16) | (s << 16);
} while (--size);
} while (--len);
}
static ssize_t gx_audio_write(void *data, const void *buf_, size_t size)
static ssize_t gx_audio_write(void *data, const void *buf_, size_t len)
{
size_t frames = size >> 2;
size_t frames = len >> 2;
const uint32_t *buf = buf_;
gx_audio_t *wa = data;
@@ -127,14 +133,15 @@ static ssize_t gx_audio_write(void *data, const void *buf_, size_t size)
/* FIXME: Nonblocking audio should break out of loop
* when it has nothing to write. */
while ((wa->dma_write == wa->dma_next ||
wa->dma_write == wa->dma_busy) && !wa->nonblock);
while (( wa->dma_write == wa->dma_next
|| wa->dma_write == wa->dma_busy) && !wa->nonblock);
copy_swapped(wa->data[wa->dma_write] + wa->write_ptr, buf, to_write);
gx_audio_copy_swapped(wa->data[wa->dma_write] + wa->write_ptr,
buf, to_write);
wa->write_ptr += to_write;
frames -= to_write;
buf += to_write;
frames -= to_write;
buf += to_write;
if (wa->write_ptr >= CHUNK_FRAMES)
{
@@ -142,8 +149,7 @@ static ssize_t gx_audio_write(void *data, const void *buf_, size_t size)
wa->dma_write = (wa->dma_write + 1) & (BLOCKS - 1);
}
}
return size;
return len;
}
static bool gx_audio_stop(void *data)
@@ -209,18 +215,9 @@ static size_t gx_audio_write_avail(void *data)
& (BLOCKS - 1)) * CHUNK_SIZE;
}
static size_t gx_audio_buffer_size(void *data)
{
(void)data;
return BLOCKS * CHUNK_SIZE;
}
static bool gx_audio_use_float(void *data)
{
/* TODO/FIXME - verify */
(void)data;
return false;
}
static size_t gx_audio_buffer_size(void *data) { return BLOCKS * CHUNK_SIZE; }
/* TODO/FIXME - implement/verify? */
static bool gx_audio_use_float(void *data) { return false; }
audio_driver_t audio_gx = {
gx_audio_init,
+42 -52
View File
@@ -46,7 +46,7 @@ typedef struct jack
bool is_paused;
} jack_t;
static size_t read_deinterleaved(float *dst[2], jack_nframes_t dst_offset,
static size_t ja_read_deinterleaved(float *dst[2], jack_nframes_t dst_offset,
jack_ringbuffer_data_t buf, jack_nframes_t nframes)
{
int i;
@@ -66,43 +66,37 @@ static size_t read_deinterleaved(float *dst[2], jack_nframes_t dst_offset,
return nframes;
}
static int process_cb(jack_nframes_t nframes, void *data)
static int ja_process_cb(jack_nframes_t nframes, void *data)
{
int i;
jack_nframes_t read = 0;
jack_t *jd = (jack_t*)data;
jack_ringbuffer_data_t buf[2];
float *dst[2];
if (nframes <= 0)
if (nframes > 0)
{
#ifdef HAVE_THREADS
scond_signal(jd->cond);
#endif
return 0;
}
for (i = 0; i < 2; i++)
dst[i] = (float *)jack_port_get_buffer(jd->ports[i], nframes);
jack_ringbuffer_get_read_vector(jd->buffer, buf);
for (i = 0; i < 2; i++)
read += read_deinterleaved(dst, read, buf[i], nframes - read);
jack_ringbuffer_read_advance(jd->buffer, read * sizeof(float) * 2);
for (; read < nframes; read++)
int i;
float *dst[2];
jack_ringbuffer_data_t buf[2];
jack_nframes_t read = 0;
for (i = 0; i < 2; i++)
dst[i][read] = 0.0f;
dst[i] = (float *)jack_port_get_buffer(jd->ports[i], nframes);
jack_ringbuffer_get_read_vector(jd->buffer, buf);
for (i = 0; i < 2; i++)
read += ja_read_deinterleaved(dst, read, buf[i], nframes - read);
jack_ringbuffer_read_advance(jd->buffer, read * sizeof(float) * 2);
for (; read < nframes; read++)
for (i = 0; i < 2; i++)
dst[i][read] = 0.0f;
}
#ifdef HAVE_THREADS
scond_signal(jd->cond);
#endif
return 0;
}
static void shutdown_cb(void *data)
static void ja_shutdown_cb(void *data)
{
jack_t *jd = (jack_t*)data;
@@ -115,7 +109,7 @@ static void shutdown_cb(void *data)
#endif
}
static int parse_ports(char **dest_ports, const char **jports)
static int ja_parse_ports(char **dest_ports, const char **jports)
{
int i;
char *save = NULL;
@@ -137,7 +131,7 @@ static int parse_ports(char **dest_ports, const char **jports)
return 2;
}
static size_t find_buffersize(jack_t *jd, int latency, unsigned out_rate)
static size_t ja_find_buffersize(jack_t *jd, int latency, unsigned out_rate)
{
jack_latency_range_t range;
int i, buffer_frames, min_buffer_frames;
@@ -151,12 +145,12 @@ static size_t find_buffersize(jack_t *jd, int latency, unsigned out_rate)
jack_latency = range.max;
}
RARCH_LOG("[JACK]: Jack latency is %d frames.\n", jack_latency);
RARCH_LOG("[JACK] Jack latency is %d frames.\n", jack_latency);
buffer_frames = frames - jack_latency;
min_buffer_frames = jack_get_buffer_size(jd->client) * 2;
RARCH_LOG("[JACK]: Minimum buffer size is %d frames.\n", min_buffer_frames);
RARCH_LOG("[JACK] Minimum buffer size is %d frames.\n", min_buffer_frames);
if (buffer_frames < min_buffer_frames)
buffer_frames = min_buffer_frames;
@@ -190,41 +184,41 @@ static void *ja_init(const char *device,
*new_rate = jack_get_sample_rate(jd->client);
jack_set_process_callback(jd->client, process_cb, jd);
jack_on_shutdown(jd->client, shutdown_cb, jd);
jack_set_process_callback(jd->client, ja_process_cb, jd);
jack_on_shutdown(jd->client, ja_shutdown_cb, jd);
jd->ports[0] = jack_port_register(jd->client, "left", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
jd->ports[1] = jack_port_register(jd->client, "right", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
if (!jd->ports[0] || !jd->ports[1])
{
RARCH_ERR("[JACK]: Failed to register ports.\n");
RARCH_ERR("[JACK] Failed to register ports.\n");
goto error;
}
jports = jack_get_ports(jd->client, NULL, NULL, JackPortIsPhysical | JackPortIsInput);
if (!jports)
{
RARCH_ERR("[JACK]: Failed to get ports.\n");
RARCH_ERR("[JACK] Failed to get ports.\n");
goto error;
}
bufsize = find_buffersize(jd, latency, *new_rate);
bufsize = ja_find_buffersize(jd, latency, *new_rate);
jd->buffer_size = bufsize;
RARCH_LOG("[JACK]: Internal buffer size: %d frames.\n", (int)(bufsize / sizeof(jack_default_audio_sample_t)));
RARCH_LOG("[JACK] Internal buffer size: %d frames.\n", (int)(bufsize / sizeof(jack_default_audio_sample_t)));
jd->buffer = jack_ringbuffer_create(bufsize);
if (!jd->buffer)
{
RARCH_ERR("[JACK]: Failed to create buffers.\n");
RARCH_ERR("[JACK] Failed to create buffers.\n");
goto error;
}
parsed = parse_ports(dest_ports, jports);
parsed = ja_parse_ports(dest_ports, jports);
if (jack_activate(jd->client) < 0)
{
RARCH_ERR("[JACK]: Failed to activate Jack...\n");
RARCH_ERR("[JACK] Failed to activate Jack.\n");
goto error;
}
@@ -232,7 +226,7 @@ static void *ja_init(const char *device,
{
if (jack_connect(jd->client, jack_port_name(jd->ports[i]), dest_ports[i]))
{
RARCH_ERR("[JACK]: Failed to connect to Jack port.\n");
RARCH_ERR("[JACK] Failed to connect to Jack port.\n");
goto error;
}
}
@@ -252,13 +246,13 @@ error:
return NULL;
}
static ssize_t ja_write(void *data, const void *buf_, size_t size)
static ssize_t ja_write(void *data, const void *buf_, size_t len)
{
size_t _len = 0;
jack_t *jd = (jack_t*)data;
const char *buf = (const char *)buf_;
size_t written = 0;
while (size > 0)
while (len > 0)
{
size_t avail, to_write;
@@ -267,7 +261,7 @@ static ssize_t ja_write(void *data, const void *buf_, size_t size)
avail = jack_ringbuffer_write_space(jd->buffer);
to_write = size < avail ? size : avail;
to_write = (len < avail) ? len : avail;
/* make sure to only write multiples of the sample size */
to_write = (to_write / sizeof(float)) * sizeof(float);
@@ -275,8 +269,8 @@ static ssize_t ja_write(void *data, const void *buf_, size_t size)
{
jack_ringbuffer_write(jd->buffer, buf, to_write);
buf += to_write;
size -= to_write;
written += to_write;
len -= to_write;
_len += to_write;
}
else if (!jd->nonblock)
{
@@ -291,7 +285,7 @@ static ssize_t ja_write(void *data, const void *buf_, size_t size)
break;
}
return written;
return _len;
}
static bool ja_stop(void *data)
@@ -350,11 +344,7 @@ static void ja_free(void *data)
free(jd);
}
static bool ja_use_float(void *data)
{
(void)data;
return true;
}
static bool ja_use_float(void *data) { return true; }
static size_t ja_write_avail(void *data)
{
+135 -60
View File
@@ -32,6 +32,8 @@
#include <retro_miscellaneous.h>
#include <retro_timers.h>
#include <lists/string_list.h>
#include <string/stdstring.h>
#include "../audio_driver.h"
#include "../../verbosity.h"
@@ -47,10 +49,8 @@ typedef struct al
ALCcontext *ctx;
size_t res_ptr;
ALsizei num_buffers;
size_t tmpbuf_ptr;
int rate;
ALenum format;
uint8_t tmpbuf[OPENAL_BUFSIZE];
bool nonblock;
bool is_paused;
} al_t;
@@ -79,19 +79,93 @@ static void al_free(void *data)
free(al);
}
static void *al_list_new(void *u)
{
union string_list_elem_attr attr;
const char *audio_out_device_list;
struct string_list *sl = string_list_new();
if (!sl)
return NULL;
attr.i = 0;
if (alcIsExtensionPresent(NULL, "ALC_ENUMERATE_ALL_EXT"))
audio_out_device_list = alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
else
audio_out_device_list = alcGetString(NULL, ALC_DEVICE_SPECIFIER);
if (audio_out_device_list)
{
while (*audio_out_device_list)
{
string_list_append(sl, audio_out_device_list, attr);
audio_out_device_list += strlen(audio_out_device_list) + 1;
}
}
return sl;
}
static void *al_init(const char *device, unsigned rate, unsigned latency,
unsigned block_frames,
unsigned *new_rate)
{
al_t *al;
(void)device;
al = (al_t*)calloc(1, sizeof(al_t));
size_t _latency;
char *dev_id = NULL;
al_t *al = (al_t*)calloc(1, sizeof(al_t));
if (!al)
return NULL;
al->handle = alcOpenDevice(NULL);
if (device)
{
struct string_list *list = (struct string_list*)al_list_new(NULL);
/* Search for device name first */
if (list && list->elems)
{
int32_t idx_found = -1;
if (list->elems)
{
size_t i;
for (i = 0; i < list->size; i++)
{
if (string_is_equal(device, list->elems[i].data))
{
RARCH_DBG("[OpenAL] Found device #%d: \"%s\".\n", i, list->elems[i].data);
idx_found = i;
dev_id = strdup(list->elems[i].data);
break;
}
}
/* Index was not found yet based on name string,
* just assume id is a one-character number index. */
if (idx_found == -1 && isdigit(device[0]))
{
idx_found = strtoul(device, NULL, 0);
RARCH_LOG("[OpenAL] Fallback, device index is a single number index instead: %d.\n", idx_found);
if (idx_found != -1)
{
if (idx_found < (int32_t)list->size)
{
RARCH_LOG("[OpenAL] Corresponding name: %s.\n", list->elems[idx_found].data);
dev_id = strdup(list->elems[idx_found].data);
}
}
}
}
}
string_list_free(list);
}
al->handle = alcOpenDevice(dev_id);
if (dev_id)
free(dev_id);
dev_id = NULL;
if (!al->handle)
goto error;
@@ -101,14 +175,26 @@ static void *al_init(const char *device, unsigned rate, unsigned latency,
alcMakeContextCurrent(al->ctx);
al->rate = rate;
al->rate = rate;
*new_rate = rate;
/* We already use one buffer for tmpbuf. */
al->num_buffers = (latency * rate * 2 * sizeof(int16_t)) / (1000 * OPENAL_BUFSIZE) - 1;
if (alIsExtensionPresent("AL_EXT_FLOAT32"))
{
al->format = alGetEnumValue("AL_FORMAT_STEREO_FLOAT32");
_latency = latency * rate * 2 * sizeof(float);
RARCH_LOG("[OpenAL] Device supports float sample format\n");
}
else
{
al->format = AL_FORMAT_STEREO16;
_latency = latency * rate * 2 * sizeof(int16_t);
}
al->num_buffers = _latency / (1000 * OPENAL_BUFSIZE);
if (al->num_buffers < 2)
al->num_buffers = 2;
RARCH_LOG("[OpenAL]: Using %u buffers of %u bytes.\n", (unsigned)al->num_buffers, OPENAL_BUFSIZE);
RARCH_LOG("[OpenAL] Using %u buffers of %u bytes (%s format).\n", (unsigned)al->num_buffers, OPENAL_BUFSIZE, (al->format == AL_FORMAT_STEREO16) ? "integer" : "float");
al->buffers = (ALuint*)calloc(al->num_buffers, sizeof(ALuint));
al->res_buf = (ALuint*)calloc(al->num_buffers, sizeof(ALuint));
@@ -116,9 +202,11 @@ static void *al_init(const char *device, unsigned rate, unsigned latency,
goto error;
alGenSources(1, &al->source);
alSourcei(al->source, AL_LOOPING, AL_FALSE);
alGenBuffers(al->num_buffers, al->buffers);
memcpy(al->res_buf, al->buffers, al->num_buffers * sizeof(ALuint));
al->res_ptr = al->num_buffers;
return al;
@@ -144,70 +232,49 @@ static bool al_unqueue_buffers(al_t *al)
static bool al_get_buffer(al_t *al, ALuint *buffer)
{
if (!al->res_ptr)
while (al->res_ptr == 0)
{
for (;;)
{
if (al_unqueue_buffers(al))
break;
if (al_unqueue_buffers(al))
break;
if (al->nonblock)
return false;
if (al->nonblock)
return false;
/* Must sleep as there is no proper blocking method. */
retro_sleep(1);
}
/* Must sleep as there is no proper blocking method. */
retro_sleep(1);
}
*buffer = al->res_buf[--al->res_ptr];
return true;
}
static size_t al_fill_internal_buf(al_t *al, const void *buf, size_t size)
{
size_t read_size = MIN(OPENAL_BUFSIZE - al->tmpbuf_ptr, size);
memcpy(al->tmpbuf + al->tmpbuf_ptr, buf, read_size);
al->tmpbuf_ptr += read_size;
return read_size;
}
static ssize_t al_write(void *data, const void *buf_, size_t size)
static ssize_t al_write(void *data, const void *s, size_t len)
{
al_t *al = (al_t*)data;
const uint8_t *buf = (const uint8_t*)buf_;
size_t written = 0;
const uint8_t *buf = (const uint8_t*)s;
size_t _len = 0;
while (size)
while (len)
{
ALint val;
ALuint buffer;
size_t rc = al_fill_internal_buf(al, buf, size);
written += rc;
buf += rc;
size -= rc;
if (al->tmpbuf_ptr != OPENAL_BUFSIZE)
break;
size_t rc = MIN(OPENAL_BUFSIZE, len);
if (!al_get_buffer(al, &buffer))
break;
alBufferData(buffer, AL_FORMAT_STEREO16, al->tmpbuf, OPENAL_BUFSIZE, al->rate);
al->tmpbuf_ptr = 0;
alBufferData(buffer, al->format, buf, rc, al->rate);
alSourceQueueBuffers(al->source, 1, &buffer);
if (alGetError() != AL_NO_ERROR)
return -1;
_len += rc;
buf += rc;
len -= rc;
alGetSourcei(al->source, AL_SOURCE_STATE, &val);
if (val != AL_PLAYING)
alSourcePlay(al->source);
if (alGetError() != AL_NO_ERROR)
return -1;
}
return written;
return _len;
}
static bool al_stop(void *data)
@@ -221,9 +288,7 @@ static bool al_stop(void *data)
static bool al_alive(void *data)
{
al_t *al = (al_t*)data;
if (!al)
return false;
return !al->is_paused;
return al && !al->is_paused;
}
static void al_set_nonblock_state(void *data, bool state)
@@ -245,19 +310,29 @@ static size_t al_write_avail(void *data)
{
al_t *al = (al_t*)data;
al_unqueue_buffers(al);
return al->res_ptr * OPENAL_BUFSIZE + (OPENAL_BUFSIZE - al->tmpbuf_ptr);
return al->res_ptr * OPENAL_BUFSIZE;
}
static size_t al_buffer_size(void *data)
{
al_t *al = (al_t*)data;
return (al->num_buffers + 1) * OPENAL_BUFSIZE; /* Also got tmpbuf. */
return (al->num_buffers) * OPENAL_BUFSIZE;
}
static bool al_use_float(void *data)
{
(void)data;
return false;
al_t *al = (al_t*)data;
if (al->format == AL_FORMAT_STEREO16)
return false;
return true;
}
static void al_device_list_free(void *u, void *slp)
{
struct string_list *sl = (struct string_list*)slp;
if (sl)
string_list_free(sl);
}
audio_driver_t audio_openal = {
@@ -270,8 +345,8 @@ audio_driver_t audio_openal = {
al_free,
al_use_float,
"openal",
NULL,
NULL,
al_list_new,
al_device_list_free,
al_write_avail,
al_buffer_size,
};
+15 -19
View File
@@ -116,7 +116,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency,
if (!sl)
goto error;
RARCH_LOG("[OpenSL]: Requested audio latency: %u ms.\n", latency);
RARCH_LOG("[OpenSL] Requested audio latency: %u ms.\n", latency);
GOTO_IF_FAIL(slCreateEngine(&sl->engine_object, 0, NULL, 0, NULL, NULL));
GOTO_IF_FAIL(SLObjectItf_Realize(sl->engine_object, SL_BOOLEAN_FALSE));
@@ -147,7 +147,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency,
for (i = 0; i < sl->buf_count; i++)
sl->buffer[i] = sl->buffer_chunk + i * sl->buf_size;
RARCH_LOG("[OpenSL]: Setting audio latency: Block size = %u, Blocks = %u, Total = %u ...\n",
RARCH_LOG("[OpenSL] Setting audio latency: Block size = %u, Blocks = %u, Total = %u...\n",
sl->buf_size, sl->buf_count, sl->buf_size * sl->buf_count);
fmt_pcm.formatType = SL_DATAFORMAT_PCM;
@@ -195,7 +195,7 @@ static void *sl_init(const char *device, unsigned rate, unsigned latency,
return sl;
error:
RARCH_ERR("[OpenSL]: Couldn't initialize OpenSL ES driver, error code: [%d].\n", (int)res);
RARCH_ERR("[OpenSL] Couldn't initialize OpenSL ES driver. Error code: %d.\n", (int)res);
sl_free(sl);
return NULL;
}
@@ -232,13 +232,13 @@ static bool sl_start(void *data, bool is_shutdown)
return sl->is_paused ? false : true;
}
static ssize_t sl_write(void *data, const void *buf_, size_t size)
static ssize_t sl_write(void *data, const void *s, size_t len)
{
size_t _len = 0;
sl_t *sl = (sl_t*)data;
size_t written = 0;
const uint8_t *buf = (const uint8_t*)buf_;
const uint8_t *buf = (const uint8_t*)s;
while (size)
while (len)
{
size_t avail_write;
@@ -255,15 +255,15 @@ static ssize_t sl_write(void *data, const void *buf_, size_t size)
slock_unlock(sl->lock);
}
avail_write = MIN(sl->buf_size - sl->buffer_ptr, size);
avail_write = MIN(sl->buf_size - sl->buffer_ptr, len);
if (avail_write)
{
memcpy(sl->buffer[sl->buffer_index] + sl->buffer_ptr, buf, avail_write);
sl->buffer_ptr += avail_write;
buf += avail_write;
size -= avail_write;
written += avail_write;
len -= avail_write;
_len += avail_write;
}
if (sl->buffer_ptr >= sl->buf_size)
@@ -275,20 +275,19 @@ static ssize_t sl_write(void *data, const void *buf_, size_t size)
if (res != SL_RESULT_SUCCESS)
{
RARCH_ERR("[OpenSL]: Failed to write! (Error: 0x%x)\n", (unsigned)res);
RARCH_ERR("[OpenSL] Failed to write. Error: 0x%x.\n", (unsigned)res);
return -1;
}
}
}
return written;
return _len;
}
static size_t sl_write_avail(void *data)
{
sl_t *sl = (sl_t*)data;
size_t avail = (sl->buf_count - (int)sl->buffered_blocks - 1) * sl->buf_size + (sl->buf_size - (int)sl->buffer_ptr);
return avail;
return ((sl->buf_count - (int)sl->buffered_blocks - 1) * sl->buf_size + (sl->buf_size - (int)sl->buffer_ptr));
}
static size_t sl_buffer_size(void *data)
@@ -297,11 +296,8 @@ static size_t sl_buffer_size(void *data)
return sl->buf_size * sl->buf_count;
}
static bool sl_use_float(void *data)
{
(void)data;
return false;
}
/* TODO/FIXME - implement */
static bool sl_use_float(void *data) { return false; }
audio_driver_t audio_opensl = {
sl_init,
+11 -16
View File
@@ -71,7 +71,7 @@ static void *oss_init(const char *device,
frag = (frags << 16) | 10;
if (ioctl(ossaudio->fd, SNDCTL_DSP_SETFRAGMENT, &frag) < 0)
RARCH_WARN("Cannot set fragment sizes. Latency might not be as expected ...\n");
RARCH_WARN("[OSS] Could not set fragment sizes. Latency might not be as expected.\n");
channels = 2;
format = is_little_endian() ? AFMT_S16_LE : AFMT_S16_BE;
@@ -89,7 +89,7 @@ static void *oss_init(const char *device,
if (new_rate != (int)rate)
{
RARCH_WARN("Requested sample rate not supported. Adjusting output rate to %d Hz.\n", new_rate);
RARCH_WARN("[OSS] Requested sample rate not supported. Adjusting output rate to %d Hz.\n", new_rate);
*new_out_rate = new_rate;
}
@@ -103,23 +103,19 @@ error:
return NULL;
}
static ssize_t oss_write(void *data, const void *buf, size_t size)
static ssize_t oss_write(void *data, const void *s, size_t len)
{
ssize_t ret;
ssize_t _len;
oss_audio_t *ossaudio = (oss_audio_t*)data;
if (size == 0)
if (len == 0)
return 0;
if ((ret = write(ossaudio->fd, buf, size)) < 0)
if ((_len = write(ossaudio->fd, s, len)) < 0)
{
if (errno == EAGAIN && (fcntl(ossaudio->fd, F_GETFL) & O_NONBLOCK))
return 0;
return -1;
}
return ret;
return _len;
}
static bool oss_stop(void *data)
@@ -162,14 +158,14 @@ static void oss_set_nonblock_state(void *data, bool state)
rc = fcntl(ossaudio->fd, F_SETFL,
fcntl(ossaudio->fd, F_GETFL) & (~O_NONBLOCK));
if (rc != 0)
RARCH_WARN("Could not set nonblocking on OSS file descriptor. Will not be able to fast-forward.\n");
RARCH_WARN("[OSS] Could not set nonblocking on OSS file descriptor. Will not be able to fast-forward.\n");
}
static void oss_free(void *data)
{
oss_audio_t *ossaudio = (oss_audio_t*)data;
/*RETROFW IOCTL always returns EINVAL*/
/*RETROFW IOCTL always returns EINVAL*/
#if !defined(RETROFW)
if (ioctl(ossaudio->fd, SNDCTL_DSP_RESET, 0) < 0)
return;
@@ -186,7 +182,7 @@ static size_t oss_write_avail(void *data)
if (ioctl(ossaudio->fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
{
RARCH_ERR("[OSS]: SNDCTL_DSP_GETOSPACE failed ...\n");
RARCH_ERR("[OSS] SNDCTL_DSP_GETOSPACE failed.\n");
return 0;
}
@@ -200,7 +196,7 @@ static size_t oss_buffer_size(void *data)
if (ioctl(ossaudio->fd, SNDCTL_DSP_GETOSPACE, &info) < 0)
{
RARCH_ERR("[OSS]: SNDCTL_DSP_GETOSPACE failed ...\n");
RARCH_ERR("[OSS] SNDCTL_DSP_GETOSPACE failed.\n");
return 1; /* Return something non-zero to avoid SIGFPE. */
}
@@ -209,7 +205,6 @@ static size_t oss_buffer_size(void *data)
static bool oss_use_float(void *data)
{
(void)data;
return false;
}
+637 -252
View File
File diff suppressed because it is too large. Load diff
+16 -40
View File
@@ -33,9 +33,16 @@ typedef struct ps2_audio
bool running;
} ps2_audio_t;
static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
static void *ps2_audio_init(const char *device,
unsigned rate, unsigned latency,
unsigned block_frames,
unsigned *new_rate)
{
struct audsrv_fmt_t format;
ps2_audio_t *ps2 = (ps2_audio_t*)calloc(1, sizeof(ps2_audio_t));
if (!ps2)
return NULL;
format.bits = AUDIO_BITS;
format.freq = rate;
@@ -43,19 +50,6 @@ static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
audsrv_set_format(&format);
audsrv_set_volume(MAX_VOLUME);
}
static void *ps2_audio_init(const char *device,
unsigned rate, unsigned latency,
unsigned block_frames,
unsigned *new_rate)
{
ps2_audio_t *ps2 = (ps2_audio_t*)calloc(1, sizeof(ps2_audio_t));
if (!ps2)
return NULL;
audioConfigure(ps2, rate);
return ps2;
}
@@ -71,50 +65,39 @@ static void ps2_audio_free(void *data)
free(ps2);
}
static ssize_t ps2_audio_write(void *data, const void *buf, size_t size)
static ssize_t ps2_audio_write(void *data, const void *s, size_t len)
{
ps2_audio_t* ps2 = (ps2_audio_t*)data;
if (!ps2->running)
return -1;
return audsrv_play_audio(buf, size);
return audsrv_play_audio(s, len);
}
static bool ps2_audio_alive(void *data)
{
bool alive = false;
ps2_audio_t* ps2 = (ps2_audio_t*)data;
if (ps2)
alive = ps2->running;
return alive;
return ps2->running;
return false;
}
static bool ps2_audio_stop(void *data)
{
bool stop = true;
ps2_audio_t* ps2 = (ps2_audio_t*)data;
if (ps2)
{
audsrv_stop_audio();
ps2->running = false;
}
return stop;
return true;
}
static bool ps2_audio_start(void *data, bool is_shutdown)
{
ps2_audio_t* ps2 = (ps2_audio_t*)data;
bool start = true;
if (ps2)
ps2->running = true;
return start;
return true;
}
static void ps2_audio_set_nonblock_state(void *data, bool toggle)
@@ -125,11 +108,6 @@ static void ps2_audio_set_nonblock_state(void *data, bool toggle)
ps2->nonblock = toggle;
}
static bool ps2_audio_use_float(void *data)
{
return false;
}
static size_t ps2_audio_write_avail(void *data)
{
ps2_audio_t* ps2 = (ps2_audio_t*)data;
@@ -140,10 +118,8 @@ static size_t ps2_audio_write_avail(void *data)
return 0;
}
static size_t ps2_audio_buffer_size(void *data)
{
return AUDIO_BUFFER;
}
static bool ps2_audio_use_float(void *data) { return false; }
static size_t ps2_audio_buffer_size(void *data) { return AUDIO_BUFFER; }
audio_driver_t audio_ps2 = {
ps2_audio_init,
+9 -13
View File
@@ -41,9 +41,9 @@ typedef struct
#ifdef __PSL1GHT__
static void event_loop(void *data)
static void ps3_event_loop(void *data)
#else
static void event_loop(uint64_t data)
static void ps3_event_loop(uint64_t data)
#endif
{
float out_tmp[AUDIO_BLOCK_SAMPLES * AUDIO_CHANNELS]
@@ -131,7 +131,7 @@ static void *ps3_audio_init(const char *device,
audioPortStart(data->audio_port);
data->started = true;
sysThreadCreate(&data->thread, event_loop,
sysThreadCreate(&data->thread, ps3_event_loop,
#ifdef __PSL1GHT__
data,
#else
@@ -142,24 +142,23 @@ static void *ps3_audio_init(const char *device,
return data;
}
static ssize_t ps3_audio_write(void *data, const void *buf, size_t size)
static ssize_t ps3_audio_write(void *data, const void *s, size_t len)
{
ps3_audio_t *aud = data;
if (aud->nonblock)
{
if (FIFO_WRITE_AVAIL(aud->buffer) < size)
if (FIFO_WRITE_AVAIL(aud->buffer) < len)
return 0;
}
while (FIFO_WRITE_AVAIL(aud->buffer) < size)
while (FIFO_WRITE_AVAIL(aud->buffer) < len)
sysLwCondWait(&aud->cond, 0);
sysLwMutexLock(&aud->lock, PS3_SYS_NO_TIMEOUT);
fifo_write(aud->buffer, buf, size);
fifo_write(aud->buffer, s, len);
sysLwMutexUnlock(&aud->lock);
return size;
return len;
}
static bool ps3_audio_stop(void *data)
@@ -220,10 +219,7 @@ static void ps3_audio_free(void *data)
free(data);
}
static bool ps3_audio_use_float(void *data)
{
return true;
}
static bool ps3_audio_use_float(void *data) { return true; }
static size_t ps3_audio_write_avail(void *data)
{
+33 -35
View File
@@ -68,7 +68,7 @@ typedef struct psp_audio
#define AUDIO_BUFFER_SIZE_MASK (AUDIO_BUFFER_SIZE-1)
/* Return port used */
static int configureAudio(unsigned rate)
static int psp_configure_audio(unsigned rate)
{
#if defined(VITA)
return sceAudioOutOpenPort(
@@ -83,7 +83,7 @@ static int configureAudio(unsigned rate)
#endif
}
static void audioMainLoop(void *data)
static void psp_audio_mainloop(void *data)
{
psp_audio_t* psp = (psp_audio_t*)data;
@@ -115,7 +115,9 @@ static void audioMainLoop(void *data)
cond ? (psp->zeroBuffer)
: (psp->buffer + read_pos_2));
#else
sceAudioSRCOutputBlocking(PSP_AUDIO_VOLUME_MAX, cond ? (psp->zeroBuffer)
sceAudioSRCOutputBlocking(PSP_AUDIO_VOLUME_MAX,
cond
? (psp->zeroBuffer)
: (psp->buffer + read_pos));
#endif
}
@@ -134,7 +136,7 @@ static void *psp_audio_init(const char *device,
if (!psp)
return NULL;
if ((port = configureAudio(rate)) < 0)
if ((port = psp_configure_audio(rate)) < 0)
{
free(psp);
return NULL;
@@ -160,7 +162,7 @@ static void *psp_audio_init(const char *device,
psp->nonblock = false;
psp->running = true;
psp->worker_thread = sthread_create(audioMainLoop, psp);
psp->worker_thread = sthread_create(psp_audio_mainloop, psp);
return psp;
}
@@ -202,11 +204,11 @@ static void psp_audio_free(void *data)
}
static ssize_t psp_audio_write(void *data, const void *buf, size_t size)
static ssize_t psp_audio_write(void *data, const void *s, size_t len)
{
psp_audio_t* psp = (psp_audio_t*)data;
uint16_t write_pos = psp->write_pos;
uint16_t sampleCount = size / sizeof(uint32_t);
psp_audio_t* psp = (psp_audio_t*)data;
uint16_t write_pos = psp->write_pos;
uint16_t sample_count = len / sizeof(uint32_t);
if (!psp->running)
return -1;
@@ -214,35 +216,34 @@ static ssize_t psp_audio_write(void *data, const void *buf, size_t size)
if (psp->nonblock)
{
if (AUDIO_BUFFER_SIZE - ((uint16_t)
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < size)
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < len)
return 0;
}
slock_lock(psp->cond_lock);
while (AUDIO_BUFFER_SIZE - ((uint16_t)
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < size)
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK) < len)
scond_wait(psp->cond, psp->cond_lock);
slock_unlock(psp->cond_lock);
slock_lock(psp->fifo_lock);
if ((write_pos + sampleCount) > AUDIO_BUFFER_SIZE)
if ((write_pos + sample_count) > AUDIO_BUFFER_SIZE)
{
memcpy(psp->buffer + write_pos, buf,
memcpy(psp->buffer + write_pos, s,
(AUDIO_BUFFER_SIZE - write_pos) * sizeof(uint32_t));
memcpy(psp->buffer, (uint32_t*) buf +
memcpy(psp->buffer, (uint32_t*)s +
(AUDIO_BUFFER_SIZE - write_pos),
(write_pos + sampleCount - AUDIO_BUFFER_SIZE) * sizeof(uint32_t));
(write_pos + sample_count - AUDIO_BUFFER_SIZE) * sizeof(uint32_t));
}
else
memcpy(psp->buffer + write_pos, buf, size);
memcpy(psp->buffer + write_pos, s, len);
write_pos += sampleCount;
write_pos += sample_count;
write_pos &= AUDIO_BUFFER_SIZE_MASK;
psp->write_pos = write_pos;
slock_unlock(psp->fifo_lock);
return size;
return len;
}
static bool psp_audio_alive(void *data)
@@ -260,14 +261,15 @@ static bool psp_audio_stop(void *data)
#if defined(ORBIS)
return false;
#else
if (psp){
if (psp)
{
psp->running = false;
if (!psp->worker_thread)
return true;
sthread_join(psp->worker_thread);
psp->worker_thread = NULL;
if (psp->worker_thread)
{
sthread_join(psp->worker_thread);
psp->worker_thread = NULL;
}
}
return true;
#endif
@@ -282,7 +284,7 @@ static bool psp_audio_start(void *data, bool is_shutdown)
if (!psp->worker_thread)
{
psp->running = true;
psp->worker_thread = sthread_create(audioMainLoop, psp);
psp->worker_thread = sthread_create(psp_audio_mainloop, psp);
}
}
@@ -296,28 +298,24 @@ static void psp_audio_set_nonblock_state(void *data, bool toggle)
psp->nonblock = toggle;
}
static bool psp_audio_use_float(void *data)
{
return false;
}
static size_t psp_write_avail(void *data)
{
size_t val;
size_t _len;
psp_audio_t* psp = (psp_audio_t*)data;
if (!psp||!psp->running)
return 0;
slock_lock(psp->fifo_lock);
val = AUDIO_BUFFER_SIZE - ((uint16_t)
_len = AUDIO_BUFFER_SIZE - ((uint16_t)
(psp->write_pos - psp->read_pos) & AUDIO_BUFFER_SIZE_MASK);
slock_unlock(psp->fifo_lock);
return val;
return _len;
}
/* TODO/FIXME - implement? */
static bool psp_audio_use_float(void *data) { return false; }
static size_t psp_buffer_size(void *data)
{
/* TODO/FIXME - implement? */
return AUDIO_BUFFER_SIZE /** sizeof(uint32_t)*/;
}
+57 -63
View File
@@ -72,7 +72,7 @@ static void pulse_free(void *data)
free(pa);
}
static void stream_success_cb(pa_stream *s, int success, void *data)
static void pulse_stream_success_cb(pa_stream *s, int success, void *data)
{
pa_t *pa = (pa_t*)data;
(void)s;
@@ -80,7 +80,7 @@ static void stream_success_cb(pa_stream *s, int success, void *data)
pa_threaded_mainloop_signal(pa->mainloop, 0);
}
static void context_state_cb(pa_context *c, void *data)
static void pulse_context_state_cb(pa_context *c, void *data)
{
pa_t *pa = (pa_t*)data;
@@ -90,7 +90,7 @@ static void context_state_cb(pa_context *c, void *data)
pa_threaded_mainloop_signal(pa->mainloop, 0);
break;
case PA_CONTEXT_FAILED:
RARCH_ERR("[PulseAudio]: Connection failed\n");
RARCH_ERR("[PulseAudio] Connection failed.\n");
pa->is_ready = false;
pa_threaded_mainloop_signal(pa->mainloop, 0);
break;
@@ -117,11 +117,11 @@ static void pa_sinklist_cb(pa_context *c, const pa_sink_info *l, int eol, void *
if (eol > 0)
return;
RARCH_DBG("[PulseAudio]: Sink detected: %s\n",l->name);
RARCH_DBG("[PulseAudio] Sink detected: %s.\n", l->name);
string_list_append(pa->devicelist, l->name, attr);
}
static void stream_state_cb(pa_stream *s, void *data)
static void pulse_stream_state_cb(pa_stream *s, void *data)
{
pa_t *pa = (pa_t*)data;
@@ -142,32 +142,32 @@ static void stream_state_cb(pa_stream *s, void *data)
}
}
static void stream_request_cb(pa_stream *s, size_t length, void *data)
static void pulse_stream_request_cb(pa_stream *s, size_t len, void *data)
{
pa_t *pa = (pa_t*)data;
pa_threaded_mainloop_signal(pa->mainloop, 0);
}
static void stream_latency_update_cb(pa_stream *s, void *data)
static void pulse_stream_latency_update_cb(pa_stream *s, void *data)
{
pa_t *pa = (pa_t*)data;
pa_threaded_mainloop_signal(pa->mainloop, 0);
}
static void underrun_update_cb(pa_stream *s, void *data)
static void pulse_underrun_update_cb(pa_stream *s, void *data)
{
#if 0
pa_t *pa = (pa_t*)data;
(void)s;
RARCH_LOG("[PulseAudio]: Underrun (Buffer: %u, Writable size: %u).\n",
RARCH_LOG("[PulseAudio] Underrun (Buffer: %u, Writable size: %u).\n",
(unsigned)pa->buffer_size,
(unsigned)pa_stream_writable_size(pa->stream));
#endif
}
static void buffer_attr_cb(pa_stream *s, void *data)
static void pulse_buffer_attr_cb(pa_stream *s, void *data)
{
pa_t *pa = (pa_t*)data;
const pa_buffer_attr *server_attr = pa_stream_get_buffer_attr(s);
@@ -175,24 +175,23 @@ static void buffer_attr_cb(pa_stream *s, void *data)
pa->buffer_size = server_attr->tlength;
#if 0
RARCH_LOG("[PulseAudio]: Got new buffer size %u.\n", (unsigned)pa->buffer_size);
RARCH_LOG("[PulseAudio] Got new buffer size %u.\n", (unsigned)pa->buffer_size);
#endif
}
static void *pulse_init(const char *device, unsigned rate,
unsigned latency,
unsigned block_frames,
unsigned latency, unsigned block_frames,
unsigned *new_rate)
{
pa_sample_spec spec;
pa_sample_spec spec;
pa_buffer_attr buffer_attr = {0};
const pa_buffer_attr *server_attr = NULL;
pa_t *pa = (pa_t*)calloc(1, sizeof(*pa));
memset(&spec, 0, sizeof(spec));
if (!pa)
goto error;
return NULL;
memset(&spec, 0, sizeof(spec));
pa->devicelist = string_list_new();
@@ -204,7 +203,7 @@ static void *pulse_init(const char *device, unsigned rate,
if (!pa->context)
goto error;
pa_context_set_state_callback(pa->context, context_state_cb, pa);
pa_context_set_state_callback(pa->context, pulse_context_state_cb, pa);
/* Code is not prepared to use multiple PulseAudio servers, device is used as sink. */
if (pa_context_connect(pa->context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0)
@@ -232,11 +231,12 @@ static void *pulse_init(const char *device, unsigned rate,
if (!pa->stream)
goto unlock_error;
pa_stream_set_state_callback(pa->stream, stream_state_cb, pa);
pa_stream_set_write_callback(pa->stream, stream_request_cb, pa);
pa_stream_set_latency_update_callback(pa->stream, stream_latency_update_cb, pa);
pa_stream_set_underflow_callback(pa->stream, underrun_update_cb, pa);
pa_stream_set_buffer_attr_callback(pa->stream, buffer_attr_cb, pa);
pa_stream_set_state_callback(pa->stream, pulse_stream_state_cb, pa);
pa_stream_set_write_callback(pa->stream, pulse_stream_request_cb, pa);
pa_stream_set_latency_update_callback(pa->stream,
pulse_stream_latency_update_cb, pa);
pa_stream_set_underflow_callback(pa->stream, pulse_underrun_update_cb, pa);
pa_stream_set_buffer_attr_callback(pa->stream, pulse_buffer_attr_cb, pa);
buffer_attr.maxlength = -1;
buffer_attr.tlength = pa_usec_to_bytes(latency * PA_USEC_PER_MSEC, &spec);
@@ -257,7 +257,7 @@ static void *pulse_init(const char *device, unsigned rate,
if (server_attr)
{
pa->buffer_size = server_attr->tlength;
RARCH_LOG("[PulseAudio]: Requested %u bytes buffer, got %u.\n",
RARCH_LOG("[PulseAudio] Requested %u bytes buffer, got %u.\n",
(unsigned)buffer_attr.tlength,
(unsigned)pa->buffer_size);
}
@@ -276,33 +276,51 @@ error:
return NULL;
}
static bool pulse_start(void *data, bool is_shutdown);
static ssize_t pulse_write(void *data, const void *buf_, size_t size)
static bool pulse_start(void *data, bool is_shutdown)
{
bool ret;
pa_t *pa = (pa_t*)data;
if (!pa->is_ready)
return false;
if (!pa->is_paused)
return true;
pa->success = true; /* In case of spurious wakeup. Not critical. */
pa_threaded_mainloop_lock(pa->mainloop);
pa_stream_cork(pa->stream, false, pulse_stream_success_cb, pa);
pa_threaded_mainloop_wait(pa->mainloop);
ret = pa->success;
pa_threaded_mainloop_unlock(pa->mainloop);
pa->is_paused = false;
return ret;
}
static ssize_t pulse_write(void *data, const void *s, size_t len)
{
size_t _len = 0;
pa_t *pa = (pa_t*)data;
const uint8_t *buf = (const uint8_t*)buf_;
size_t written = 0;
const uint8_t *buf = (const uint8_t*)s;
/* Workaround buggy menu code.
* If a write happens while we're paused, we might never progress. */
if (pa->is_paused)
if (!pulse_start(pa, false))
return -1;
if (pa->is_paused && !pulse_start(pa, false))
return -1;
if (!pa->is_ready)
return 0;
pa_threaded_mainloop_lock(pa->mainloop);
while (size)
while (len)
{
size_t writable = MIN(size, pa_stream_writable_size(pa->stream));
size_t writable = MIN(len, pa_stream_writable_size(pa->stream));
if (writable)
{
pa_stream_write(pa->stream, buf, writable, NULL, 0, PA_SEEK_RELATIVE);
buf += writable;
size -= writable;
written += writable;
buf += writable;
len -= writable;
_len += writable;
}
else if (!pa->nonblock)
pa_threaded_mainloop_wait(pa->mainloop);
@@ -312,7 +330,7 @@ static ssize_t pulse_write(void *data, const void *buf_, size_t size)
pa_threaded_mainloop_unlock(pa->mainloop);
return written;
return _len;
}
static bool pulse_stop(void *data)
@@ -327,7 +345,7 @@ static bool pulse_stop(void *data)
pa->success = true; /* In case of spurious wakeup. Not critical. */
pa_threaded_mainloop_lock(pa->mainloop);
pa_stream_cork(pa->stream, true, stream_success_cb, pa);
pa_stream_cork(pa->stream, true, pulse_stream_success_cb, pa);
pa_threaded_mainloop_wait(pa->mainloop);
ret = pa->success;
pa_threaded_mainloop_unlock(pa->mainloop);
@@ -344,26 +362,6 @@ static bool pulse_alive(void *data)
return !pa->is_paused;
}
static bool pulse_start(void *data, bool is_shutdown)
{
bool ret;
pa_t *pa = (pa_t*)data;
if (!pa->is_ready)
return false;
if (!pa->is_paused)
return true;
pa->success = true; /* In case of spurious wakeup. Not critical. */
pa_threaded_mainloop_lock(pa->mainloop);
pa_stream_cork(pa->stream, false, stream_success_cb, pa);
pa_threaded_mainloop_wait(pa->mainloop);
ret = pa->success;
pa_threaded_mainloop_unlock(pa->mainloop);
pa->is_paused = false;
return ret;
}
static void pulse_set_nonblock_state(void *data, bool state)
{
pa_t *pa = (pa_t*)data;
@@ -371,11 +369,7 @@ static void pulse_set_nonblock_state(void *data, bool state)
pa->nonblock = state;
}
static bool pulse_use_float(void *data)
{
(void)data;
return true;
}
static bool pulse_use_float(void *data) { return true; }
static size_t pulse_write_avail(void *data)
{
+14 -21
View File
@@ -45,7 +45,7 @@ static void *ra_init(const char *device, unsigned rate, unsigned latency,
if (!(vss = roar_vs_new_simple(device, "RetroArch", rate, 2, ROAR_CODEC_PCM_S, 16, ROAR_DIR_PLAY, &err)))
{
RARCH_ERR("RoarAudio: \"%s\"\n", roar_vs_strerr(err));
RARCH_ERR("[RoarAudio] \"%s\".\n", roar_vs_strerr(err));
free(roar);
return NULL;
}
@@ -56,32 +56,32 @@ static void *ra_init(const char *device, unsigned rate, unsigned latency,
return roar;
}
static ssize_t ra_write(void *data, const void *buf, size_t size)
static ssize_t ra_write(void *data, const void *buf, size_t len)
{
int err;
size_t written = 0;
roar_t *roar = (roar_t*)data;
size_t _len = 0;
roar_t *roar = (roar_t*)data;
if (size == 0)
if (len == 0)
return 0;
while (written < size)
while (_len < len)
{
ssize_t rc;
size_t write_amt = size - written;
size_t write_amt = len - _len;
if ((rc = roar_vs_write(roar->vss,
(const char*)buf + written, write_amt, &err)) < (ssize_t)write_amt)
(const char*)buf + _len, write_amt, &err)) < (ssize_t)write_amt)
{
if (roar->nonblocking)
return rc;
else if (rc < 0)
return -1;
}
written += rc;
_len += rc;
}
return size;
return _len;
}
static bool ra_stop(void *data)
@@ -106,7 +106,7 @@ static void ra_set_nonblock_state(void *data, bool state)
if (roar_vs_blocking(roar->vss, (state) ? ROAR_VS_FALSE : ROAR_VS_TRUE, NULL) < 0)
{
RARCH_ERR("Can't set nonblocking. Will not be able to fast-forward.\n");
RARCH_ERR("[RoarAudio] Can't set nonblocking. Will not be able to fast-forward.\n");
}
roar->nonblocking = state;
}
@@ -126,16 +126,9 @@ static void ra_free(void *data)
free(data);
}
static bool ra_use_float(void *data)
{
return false;
}
static size_t ra_write_avail(void *data)
{
(void)data;
return 0;
}
/* TODO/FIXME - implement? */
static bool ra_use_float(void *data) { return false; }
static size_t ra_write_avail(void *data) { return 0; }
audio_driver_t audio_roar = {
ra_init,
+17 -25
View File
@@ -48,7 +48,7 @@ static ssize_t rsound_audio_cb(void *data, size_t bytes, void *userdata)
return write_size;
}
static void err_cb(void *userdata)
static void rsound_err_cb(void *userdata)
{
rsd_t *rsd = (rsd_t*)userdata;
rsd->has_error = true;
@@ -85,7 +85,7 @@ static void *rs_init(const char *device, unsigned rate, unsigned latency,
rsd_set_param(rd, RSD_FORMAT, &format);
rsd_set_callback(rd, rsound_audio_cb, err_cb, 256, rsd);
rsd_set_callback(rd, rsound_audio_cb, rsound_err_cb, 256, rsd);
if (rsd_start(rd) < 0)
{
@@ -101,8 +101,9 @@ error:
return NULL;
}
static ssize_t rs_write(void *data, const void *buf, size_t size)
static ssize_t rs_write(void *data, const void *buf, size_t len)
{
size_t _len;
rsd_t *rsd = (rsd_t*)data;
if (rsd->has_error)
@@ -110,21 +111,20 @@ static ssize_t rs_write(void *data, const void *buf, size_t size)
if (rsd->nonblock)
{
size_t avail, write_amt;
size_t avail;
rsd_callback_lock(rsd->rd);
avail = FIFO_WRITE_AVAIL(rsd->buffer);
write_amt = avail > size ? size : avail;
avail = FIFO_WRITE_AVAIL(rsd->buffer);
_len = avail > len ? len : avail;
fifo_write(rsd->buffer, buf, write_amt);
fifo_write(rsd->buffer, buf, _len);
rsd_callback_unlock(rsd->rd);
return write_amt;
}
else
{
size_t written = 0;
while (written < size && !rsd->has_error)
_len = 0;
while (_len < len && !rsd->has_error)
{
size_t avail;
rsd_callback_lock(rsd->rd);
@@ -143,13 +143,13 @@ static ssize_t rs_write(void *data, const void *buf, size_t size)
}
else
{
size_t write_amt = size - written > avail ? avail : size - written;
fifo_write(rsd->buffer, (const char*)buf + written, write_amt);
size_t write_amt = len - _len > avail ? avail : len - _len;
fifo_write(rsd->buffer, (const char*)buf + _len, write_amt);
rsd_callback_unlock(rsd->rd);
written += write_amt;
_len += write_amt;
}
}
return written;
return _len;
}
}
@@ -213,17 +213,9 @@ static size_t rs_write_avail(void *data)
return val;
}
static size_t rs_buffer_size(void *data)
{
(void)data;
return 1024 * 4;
}
static bool rs_use_float(void *data)
{
(void)data;
return false;
}
/* TODO/FIXME - implement? */
static size_t rs_buffer_size(void *data) { return 1024 * 4; }
static bool rs_use_float(void *data) { return false; }
audio_driver_t audio_rsound = {
rs_init,
+1 -1
View File
@@ -286,7 +286,7 @@ int rsd_stop (rsound_t *rd);
or there was an unexpected error. This function will block until all data has
been written to the buffer. This function will return the number of bytes written to the buffer,
or 0 should it fail (disconnection from server). You will have to restart the stream again should this occur. */
size_t rsd_write (rsound_t *rd, const void* buf, size_t size);
size_t rsd_write (rsound_t *rd, const void *s, size_t len);
/* Gets the position of the buffer pointer.
Not really interesting for normal applications.
Loaded 100 of 1187 files, more files were not shown because too many files have changed in this diff. Show more