Commit Graph

3776 Commits

Author SHA1 Message Date
libretroadmin
631301b3f7 * Cut down on strlcat calls when possible and replace them with clever
usage of strlcpy (when position/offset of previous strlcpy/snprintf call
is known. strlcat implementation in libretro-common makes implicit strlen
call, using strlcpy avoids this
* Reduce a bunch of local char variables by use of said clever usage,
should save up on local stack size usage
2023-06-18 12:06:12 +02:00
Grisly Glee
3861e6e3ba
Introduce RETRO_DEPRECATED macro (#15363) 2023-06-15 23:16:18 +02:00
Grisly Glee
de0c6d5cd1
Trivial warnings fixes (#15383)
* Trivial graphics context drivers fix

* Assorted minor warnings fixes
2023-06-14 23:46:27 +02:00
libretroadmin
d342a4a04a Signedness warning fixes 2023-06-14 23:25:50 +02:00
libretroadmin
246cceeb27 Silence more signedness warnings 2023-06-14 19:51:31 +02:00
Grisly Glee
4202f8650d
Fix trivial signedness warnings (#15377)
* Fix trivial signedness warnings

* Followup on trivial signedness warnings
2023-06-14 04:43:11 +02:00
Jesse Talavera-Greenberg
938d60d0f4
Add microphone support via a new driver (#14731)
* Some slight fixes

* Update libretro.h

* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE

* Finish proof-of-concept for mic support

- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too

* Add macros that aren't available in SDL 2

* Comment out a variable definition for now

- For C89 compliance

* Add some comments for clarity

* Let ALSA tolerate a null new_rate

* Partial ALSA microphone support

- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read

* Install error logging in the ALSA driver

- It defers to RARCH_ERR

* Free the ALSA microphone in alsa_free

* Fix an indent

* First draft of alsa_read_microphone

* Deinitialize SDL Audio in sdl_audio_free

* Save and restore the ALSA error logger

- You should always practice safe global state

* Add newlines to some RARCH_ERRs

* Add some logging

* Check for the mic being active via settings instead of via flags

* Adjusted a log entry to be less misleading

- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency

* Fix an incorrect format string

* Tidy up logging in alsa.c

* Rename audio_enable_microphone to audio_enable_input

* Rename microphone_device to audio_input_device

* Add audio_input_latency and audio_input_block_frames settings

* Add all mic-related settings to the options menu

* Adjust logging for alsa.c

- Log the ALSA library version
- Add errno details

* Refer to the microphone in logs by name

* Use %u instead of %d for some log items

* Add input_samples_buf

* Remove an inaccurate comment

* Change type of input_samples_buf

* Clean up audio_driver_flush_microphone_input

* Comment convert_float_to_s16

- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio

* Don't use the resampler for mic input

* Fix crash in the ALSA driver when reading from a mic

* Update some logging messages

* ALSA support now works for mics

* Reuse some common functions in alsa.c

* Add alsa_thread_microphone_t

* Refactor alsa.c

- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next

* Make ALSA logging a little more consistent

* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails

* Remove an unused function

* Move some cleanup in alsa.c to a common function

* First crack at mic support for alsathread

- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic

* Slight cleanups for clarity

* Implement alsa_thread_set/get_microphone_state

* More work on alsathread

- No more crashing, but the mic just returns silence

* Slight cleanups for clarity

* Add alsa_set_mic_enabled_internal

- For setting the state of a microphone while considering its current state

* Use alsa_set_mic_enabled_internal

* Log a little more info

* Log when the audio driver is started/stopped

* Move base microphone driver code into a new directory

- Add microphone_driver.c to Makefile.common
- Rename functions as needed

* Initialize and deinitialize the microphone driver

* Implement sdl_microphone.c

* Un-const an argument

- In case the driver context needs to do any locking

* Revise comments for microphone_driver.h

* Remove an unimplemented function

* Remove some functions from the mic driver

* Remove mic functions from audio_thread_wrapper

* Remove mic functions from sdl_audio

* Fix microphone_null

* Split the mic code for the alsa audio drivers into microphone drivers

* Fix an extra struct member

* Add a setting for the mic driver

* Add a command to reinitialize the microphone driver

* Rename mic-related settings

* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL

* Rename audio_enable_input to microphone_enable

* Remove some labels from qt_options

* Search for microphone_driver within find_driver_nonempty

* Clean up some mic driver code

* Pending mics now return silence

* Adjust some logging and comments

* Some cleanup in the microphone driver

* Invert a flag check

- Oops

* Fix a log message

* Fix the wrong flags being checked

* Slight refactor of wasapi_init_device

- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support

* Add some WASAPI macros for _IAudioCaptureClient

* Move some common WASAPI functions to audio/common/wasapi.c

- They'll be used by the mic and the audio drivers

* Add wasapi_log_hr

* Generalize mmdevice_list_new to look for capture devices, too

* Fix a function declaration

* Move driver-specific device_list_new functions into their respective files

* Clean up some declarations

* First draft of wasapi microphone driver

* Add wasapi_microphone_device_list_free

* Change function parameter names to be consistent with microphone_driver

* Partially implement wasapi_microphone_read

- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it

* Refactor the mic driver's functions

- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly

* Edit some WASAPI functions for logging and clarity

* Implement more of the WASAPI mic driver

* Rename write_event to read_event

* Pass the WASAPI driver context to the various read functions

* Mostly implement the read function for the WASAPI mic driver

* Fix a crash in microphone_driver

- Forgot to move the position of the name of null_driver

* Reduce some logging in wasapi common functions

- Only log the chosen audio client format, not all attempted ones

* Add some macro wrappers for IAudioClient methods

* Update mic driver configuration

- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver

* Fix a menu entry scrolling through audio devices instead of mic devices

* Add some utility functions

* Expose the new utility functions in wasapi.h

* Add extra logging in the WASAPI common functions

* Add sharemode_name

* Use _IAudioClient_Initialize macro in some places

* Pass channels to wasapi_init_client

- Remember, mics are in mono

* Use _IAudioClient_Initialize macro some more

* Forgot to pass channels in some places

* Add some utility functions

* Forgot an #include

* Add wasapi_select_device_format

* Simplify the format selection logic in wasapi_init_client_sh

* Unset the microphone in wasapi_microphone_close_mic

- Ought to prevent a potential segfault

* Simplify some logging

* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer

* Remove some unneeded logging

* Add some values to hresult_name

* Polish up wasapi_select_device_format

- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels

* Compute the fields of WAVEFORMATEXTENSIBLE correctly

- As per the doc's stated requirements

* Simplify logic for WASAPI client creation

* Fix a potential hang in wasapi_microphone_read_shared_buffered

* Stop the microphone if the driver is stopped

* Don't name the microphone event

* Ensure that wasapi_init_client reports the correct format and rate

* Implement exclusive microphone read access for WASAPI

* Add _IAudioCaptureClient_GetNextPacketSize macro

* Organize cases in hresult_name

* Clear some extra fields if wasapi_set_format is setting a Pcm format

* Adjust some logs

* Adjust some logs

* Remove unneeded local vars

* Add a log

* Update wasapi.c

* Update wasapi.c

* Fix shared-mode mic support in WASAPI producing broken input

- Turns out it had nothing to do with shared mode

* Reuse a common function

- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered

* Remove some code I was using for test purposes

* Clarify some language

* Double the default shared-mode mic buffer length

* Split getting a device's name into a separate function, then use it

* Fix the ALSA mic drivers

- To comply with changes I previously made to the mic driver interface

* Remove unused synchronization primitives from the SDL microphone driver

* Add sdl_microphone_mic_use_float

* Document audio_driver_state_flags

- I needed to understand these to see if similar flags were required for the mic driver

* Remove an unused function in wasapi.c

* Add and document flags in microphone_driver.h

* Remove driver-specific mic start/stop functions

- The mic driver itself doesn't do much processing
- That honor goes to individual mics

* Remove some unused fields in microphone_driver.h

* Add CMD_EVENT_MICROPHONE_STOP/START

* Remove unused functions from microphone_null

* Change how the mic driver state is referenced in some places

* Simplify the SDL microphone driver

- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself

* Simplify the WASAPI microphone driver

- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)

* Make microphone_wasapi_sh_buffer_length a uint, not an int

- It won't be negative anymore
- 0 now represents the default value

* Make the microphone frontend more robust

- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)

* Stop the mic driver in core_unload_game

* Ensure mic support is compatible with the revised menu code

* Move alsa.h into audio/common

* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED

- It was never really needed

* Refactor the ALSA microphone driver

- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields

* Move some common alsathread code into audio/common/alsathread.c

* Change return type of mic_driver_open_mic_internal to bool

* First crack at resampling mic input

* Remove an extraneous check

- I think something distracted me when I was writing this line

* Add stereo/mono conversion functions

* Make alsa_start_pcm and alsa_stop_pcm more robust

- They now return success if the stream is already running and stopped, respectively

* Revise some mic-related comments in libretro.h

* First crack at resampling mic input

* Simplify an expression

* Simplify an expression

* Fix a log tag

* Allow mic resampler to be configured separately from audio resampler

* Add some comments

* Set the source ratio to something sensible

* Stop deadlock in `alsathread` mic driver

* Allow mics to be initialized even when core is loaded from CLI

- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code

* Rename the functions in retro_microphone_interface

* Revise some mic-related comments in libretro.h

* Update retro_microphone_interface

- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet

* Use parameter objects in the microphone handle

* Replace get_mic_rate with get_params

* Add a microphone interface version

* Remove part of a comment

* Set the effective params in mic_driver_microphone_handle_init

* Drop a stray newline

* Change where the mic interface is zeroed

- I was accidentally throwing out the version that the core was asking for

* Reduce logspam for wasapi_set_nonblock_state

- Now it only logs when the sync mode is changed

* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0

- -16 is no longer a valid value

* Set the new_rate in wasapi_init

* Change description of microphone sample rate in the settings

* First attempt at resampling configured mic input

* Forgot a section

* Fix some input samples being skipped

* Rename a variable for clarity

* Add microphone.outgoing_samples

* Update the mic driver

- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1

* Remove part of a comment

* Update some comments in audio_resampler.h

* Slightly refactor the SDL microphone driver

- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float

* Fix a non-C89-compliant declaration

* Add new files to griffin.c

* Remove a C++-style comment

* Add two more files to griffin.c

* Remove some unneeded declarations in microphone_driver.h

* Remove a stray comma in configuration.c

- For C89 compliance

* Fix compilation on some platforms

* Change some function signatures

* Make the ALSA drivers always set the audio rate

* Fix the alsathread mic driver

* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined

* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind

* Clarify a comment

* Clarify a comment

* Add a comment

* Don't allocate memory for slowmo samples in the mic driver

- We're not supporting slowmo for mics, so it's not needed

* Fix a {

* Add my name to AUTHORS.h

* Add driver_lifetime_flags

- For drivers that have special setup/teardown needs

* Ensure that resetting the mic driver maintains active mic handles

- Prevents fullscreen toggle from stopping all mic input

* Update CHANGES.md

* Move some default microphone settings to a new part of the config file

* Ensure that RetroArch can use the audio format that Windows suggests

* Remove references to mic support in the SDL audio driver

* Remove unused WASAPI functions

* Return failure if RetroArch couldn't select a WASAPI format

* Ensure that Windows uses the WASAPI mic driver by default

* Treat disabled mic support as a warning, not an error

* Clarify some WASAPI-related microphone settings

* Remove some unused variables

* Add or revise microphone-related comments

* Rearrange doc comments for microphone types in libretro.h

* Remove a space

* Remove some unused flags

* Remove ALSA error logger

- It was never used anyway

* Remove unneeded microphone-related arguments

* Document a parameter

* Remove a logging call

* Add a constant for the microphone's shared buffer length for WASAPI

* Fix stylistic inconsistencies

* Make mic_driver_get_sample_size a macro instead of a function

* Move the microphone implementation to the audio directory

* Make microphone support optional (but enabled by default)

* Fix the griffin build
2023-06-06 21:55:06 +02:00
libretroadmin
862acd7160 rjson_optional_skip - fix code 2023-05-30 19:45:15 +02:00
libretroadmin
3f992de8a6 Silence warning 2023-05-30 19:39:12 +02:00
libretroadmin
72bd1a2ba4 (libretro-common) Resync 2023-05-30 19:34:55 +02:00
libretroadmin
735500ff66 Warning fixes and style nits 2023-05-29 15:30:54 +02:00
libretroadmin
c4d22cf51f Simplification 2023-05-28 22:45:46 +02:00
libretroadmin
90115e2dc9 Silence warnings; code cleanups 2023-05-28 22:43:33 +02:00
Bernhard Schelling
18f79a8a8d Allow RETRO_ENVIRONMENT_SET_MEMORY_MAPS also after core startup
Change the comment in libretro.h about the removed limit and handle the environment call during core runtime in RetroArch.
2023-05-28 05:23:12 +02:00
libretroadmin
207dfe170c Small cleanups 2023-05-03 21:10:21 +02:00
libretroadmin
b951a010fd Move strftime_am_pm to libretro-common and get rid of duplicated
function
2023-05-01 19:03:11 +02:00
libretroadmin
1db2f20665 Clean warnings 2023-04-28 02:11:52 +02:00
warmenhoven
5eddcfee48
The default pthread stack size on Apple is too small for detect_ps2_game (#15235) 2023-04-27 21:16:36 +02:00
David G. F
5fec32649f
Fix bug introduced in f13cf9 regarding non-compressed ZIPs (#15230)
This happens on platforms with HAVE_MMAP (Linux/Mac) and with ZIPs that
contain uncompressed files.
2023-04-26 21:56:51 +02:00
warmenhoven
295e5f0682
JIT support in iOS (#15224)
* Use AltKit to try to enable JIT on iOS

* libretro: Add API to check JIT availability on iOS
2023-04-26 01:55:37 +02:00
David G. F
f13cf92341
Improve ZIP decompression (#15220)
This reduces the amount of memory Retroarch needs to extract a ROM file.
It will only need the size of the ROM plus 128KiB to extract the file
from the ZIP. Previously it needed as much as twice that amount if the
compression ratio was not great. This is useful on memory constrained
platforms and has no impact on platforms with plenty of memory.

Handles all cases correctly (with and without MMAP, for cores that
require fullpath or not, small and big ZIP files).
2023-04-25 13:17:18 +02:00
libretroadmin
d48bd7244a Libretro API update - add new context hardware render enums - enables
autodetection of DX12 for PS2 core
2023-04-11 00:54:02 +02:00
aliaspider
0adbd6905f
add D3D12 HW_render support. (#15177) 2023-04-10 01:08:44 +01:00
warmenhoven
54055558f1
Fix several warnings (#15153) 2023-04-04 15:06:34 +01:00
hunterk
2a36245e0c
make ffmpeg core compile separately again and silence a couple of unused variable warnings (#15108) 2023-03-19 02:38:18 +01:00
libretroadmin
d2ac15c6db Fixes filestream_vscanf regression 2023-03-15 20:13:04 +01:00
LibretroAdmin
a03587d890
Update reverb.c 2023-03-11 23:00:39 +01:00
libretroadmin
d4677790eb Hopefully fixes Dingux issues with ScummVM 2023-02-24 19:13:30 +01:00
libretroadmin
3adcbea501 Silence some implicit conversion warnings 2023-02-23 21:59:02 +01:00
libretroadmin
4811568c78 Silence -Wunused-const-variable warnings 2023-02-23 21:49:46 +01:00
libretroadmin
27ad653dbd Fixed another CXX_BUILD error 2023-02-23 17:11:26 +01:00
libretroadmin
4fa19e552a CXX_BUILD buildfixes 2023-02-23 17:09:45 +01:00
libretroadmin
581b9e0b0d (RSX) Updates to video driver 2023-02-23 16:11:01 +01:00
libretroadmin
1d35e1a460 (PS3) Fix typedefs 2023-02-23 15:25:23 +01:00
libretroadmin
e447443e86 (PS3) Define KbData 2023-02-23 13:20:56 +01:00
libretroadmin
7ebab640d7 Cleanups/style nits 2023-02-23 13:15:14 +01:00
LibretroAdmin
491c495249
Unify ps3 (#15014)
* Unify PS3 input driver

* Fix builds

* Add missing variable

* (PS3/Keyboard) Add more missing defines
2023-02-23 00:35:46 +01:00
libretroadmin
a77802fec4 Update libretro-common 2023-02-22 23:31:42 +01:00
libretroadmin
d55d1a8863 Fix typo 2023-02-22 14:54:53 +01:00
libretroadmin
51894c3cbb (Config file/libretro-common) config_file_extract_value - don't make
it dependent on strldup which pulls in another dependency/source file -
instead just unroll strldup for this specific one-time instance
2023-02-21 16:37:30 +01:00
libretroadmin
1f0a5f9615 (libretro-common) retro_endianness.h - Get rid of warning: #warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated [-Wcpp]
#  warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated
    ^~~~~~~
2023-02-21 13:35:04 +01:00
libretroadmin
1440196fa0 (GX/GEKKO/RTHREADS) scond_wait_timeout - correct Gekko codepath 2023-02-21 11:00:17 +01:00
libretroadmin
8590dd6425 (GX/Gekko) Implement scond_wait_timeout - now.tv_sec / now.tv_nsec were
previously uninitialized when being touched
2023-02-21 10:28:23 +01:00
libretroadmin
48e551a2e6 (libretro-common/PSL1GHT) Don't redefine defines 2023-02-20 19:32:59 +01:00
libretroadmin
258c161d84 (libretro-common/vfs_implementation) Don't rely on ps3_defines.h which pulls in a ton of other header files
which might not be available for a given core
2023-02-20 19:26:54 +01:00
libretroadmin
35fa25bed6 (PS3) Start turning PS3 input drivers more the same 2023-02-20 18:09:57 +01:00
libretroadmin
851177bf20 (libretro-common) Buildfix 2023-02-20 14:52:00 +01:00
libretroadmin
22cdfaf95a (libretro-common) Backport reverb.c changes 2023-02-20 14:40:10 +01:00
libretroadmin
a6bb8679c9 (memmap.c) Silence implicit declaration of function 'free' for PSL1GHT 2023-02-20 14:29:40 +01:00
crystalct
0fe92cc954
PSL1GHT fix http download (#14994) 2023-02-19 18:07:01 +01:00
libretroadmin
6624126885 (MSVC) silence warnings 2023-02-18 17:04:23 +01:00
Hans-Kristian Arntzen
9f7d0c74d5
[Vulkan] Define and implement v2 of context negotiation interface (#14890)
* [Vulkan] Add v2 of context negotiation interface.

* [Vulkan] Add vkEnumerateInstanceVersion symbol.

* [Vulkan] Implement v2 context negotiation

* [libretro] Add GET_HW_CONTEXT_NEGOTIATION_INTERFACE_SUPPORT.

Works around issues in v1 interface where it was not possible to
query what frontend would do when faces with newer interface versions.

This env-call gives stronger guarantees how things have to work.

* [runloop] Implement GET_HW_CONTEXT_NEGOATION_INTERFACE_SUPPORT.

Fairly trivial. Just report the latest version.

* [Vulkan] Add stricted wording around get_application_info in v2.

* [Vulkan] Be more defensive about get_application_info() in v1.
2023-02-04 16:51:50 +01:00
Jamiras
0ec1a6acfd
call ssl_socket_close for ssl sockets (#14903) 2023-01-25 16:17:41 +01:00
retroNUC
afe3bf72bb
net_http - 3ds build fix (#14900) 2023-01-25 07:15:17 +01:00
retroNUC
4ad9c7e020
net_http - Temp fix for cheevos crash (#14742) (#14899)
* net_http - Temp fix for cheevos crash (#14742)

Don't use new timeout/poll code for cheevos http requests

* net_http - Typo fix in comment
2023-01-24 23:36:17 +01:00
libretroadmin
9fbd62d7b8 Reduce dependence on strcpy_literal (just a macro for strcpy) - prefer
going through safer strlcpy
2023-01-22 17:13:38 +01:00
libretroadmin
daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00
reallibretroadmin
d36bd9e677 Silence some warnings found in Xcode 2023-01-05 09:27:45 +01:00
Eric Warmenhoven
cf64525343 Include "Update Core Info Files" for iOS/tvOS
Also a build fix for tvOS with Xcode 14.2
2023-01-04 03:43:42 +01:00
libretroadmin
6e3f168c1c (sinc) Hopefully that's the last of these warnings 2022-11-23 18:07:53 +01:00
libretroadmin
8ed246be86 (sinc resampler) Silence warning
(MaterialUI) Style nits
2022-11-23 18:03:44 +01:00
libretroadmin
3fbcde000c (string_list) Silence warning 2022-11-23 05:10:35 +01:00
sonninnos
aeaf5561bd
Fix libchdr warning (#14658) 2022-11-22 14:44:56 +01:00
libretroadmin
1c9d3ad0bf Silence some warnings 2022-11-21 20:56:28 +01:00
libretroadmin
6b71214ed7 Silence some signed/unsigned mismatch warnings 2022-11-21 19:34:43 +01:00
libretroadmin
d5a268a2ac * Fix signed/unsigned mismatches
* Fix missing IPAddr on MSVC2017 UWP - use ULONG instead since this is
just a typedef
2022-11-15 00:24:26 +01:00
Michael Burgardt
b89692c532
Add Hungarian language option (#14585) 2022-11-04 19:52:39 +01:00
neil4
b98c53ddb7
Improve haptic feedback for input overlays (#14517)
Repurpose vibrate_on_keypress to enable device's standard keypress feedback on overlay key/button state changes

- Add keypress_vibrate function ptr to input_driver_t (only implemented on Android for now)
- (Android) Remove APP_CMD_VIBRATE_KEYPRESS
- (Android) Add doHapticFeedback, called directly to avoid latency
2022-10-16 09:58:09 +02:00
Michael Burgardt
254ac65549
Add British English language option (#14504) 2022-10-12 23:26:00 +02:00
LibretroAdmin
78ffb973b1
Add WIIU ifdef for socket_connect_with_timeout and revert (#14503)
else default codepath
2022-10-10 18:04:05 +02:00
Bernhard Schelling
c9bbe7683f
Add View feature (#14467)
* Add View feature
Add saving of a filter set in the Explore menu into a so called "View" file which then gets listed alongside playlists.
This also adds the ability to filter a category by range in the Explore menu and not just filter on exact matches.

* Menu improvements for explore and views

* Collapse ozone sidebar in view

* Fix problems with the sidebar in explore/view

* Ignore view files in the Qt playlists menu

* Add missing semicolon

* Support downloading thumbnails in views
2022-10-10 06:36:02 +02:00
gblues
c51b1491ef
Get mkdir working on wiiu (#14490)
== DETAILS
Looks like Wii U's mkdir() implementation doesn't like trailing
slashes either.

Since we already have an implementation to handle this, I just added
Wii U to it.
2022-10-07 06:19:54 +02:00
LibretroAdmin
951b98fe1b
Bools to flags (#14486)
* (D3D11) Use flags instead of bools

* (RPNG) Use flags

* Simplify rpng_is_valid

* (rpng_is_valid) Prevent potential NULL pointer dereference
(D3D11) Some whitespacing changes/code nits

* (task_pl_thumbnail_download.c) Simplify some code
2022-10-06 19:26:38 +02:00
gblues
714878783a
Fix socket_connect_with_timeout for WIIU (#14483)
== DETAILS
Previous work to clean up the HTTP networking code surfaced a bug
in `socket_connect_with_timeout()` that caused connections to
immediately fail. Specifically, achievements stopped working because
the http task code path was rewritten to use
`socket_connect_with_timeout` instead of `socket_connect`.

The bug appears to come down to an unsupported socket option. The final
check is to try to read `SO_ERROR` from the socket, and on WIIU the
`getsockopt()` call returns -1 and sets `lastsocketerr()` (WIIU's
equivalent to errno) to 16.

The fix is to change the logic to only abort the connection if that
`getsockopt()` call succeeds *and* the error is set.
2022-10-06 17:01:19 +02:00
LibretroAdmin
b3bb62881a Disable poll support for MSVC 2010 and earlier 2022-10-06 01:27:27 +02:00
LibretroAdmin
92e996e272 Revert "(Win32/Sockets/Networking) WSAPoll is only available since Windows Vista; disable"
This reverts commit d832ce15d6.
2022-10-06 00:46:33 +02:00
LibretroAdmin
d832ce15d6 (Win32/Sockets/Networking) WSAPoll is only available since Windows Vista; disable
NETWORK_HAVE_POLL for MSVC2003/2005/2010
2022-10-05 23:54:25 +02:00
LibretroAdmin
d0c6dfee0b Cleanup bitmask setting 2022-10-05 18:43:58 +02:00
Cthulhu-throwaway
d774256e0d
(Network) Add the const qualifier to some function parameters (#14463) 2022-10-03 07:35:37 +02:00
Cthulhu-throwaway
daf8cb9bc8
(Netplay) Add a private or CGNAT address warning to UPnP (#14461) 2022-10-03 01:18:34 +02:00
reallibretroadmin
0033224c25 Fix some implicit conversion signedness warnings 2022-10-02 03:22:34 +02:00
LibretroAdmin
4251eb5f61 Turn uwp_mkdir_impl function static 2022-09-30 17:50:07 +02:00
MrHuu
a878bd3f95
(Network) Adapt POLL for 3DS platform (#14431) 2022-09-25 17:15:56 +02:00
Filipe Azevedo
c10a4d632f
Fix label sanitization (#14428)
This simplify and trim whitespaces left.
ie, starting, trailing and multiple consecutive whitespaces are now
removed.
2022-09-18 19:25:21 +02:00
MrHuu
dbba69a2d1
(Network) Check connect errno for successful connection (#14420) 2022-09-18 01:15:09 +02:00
MrHuu
b88c297f8e
(Network) Don't call getsockopt on 3DS platform (#14389) 2022-09-06 01:51:15 +02:00
Filipe Azevedo
788d602ec7
Fix various vfs / file stream issues (#14384)
* VFS: Fix stream size after truncate / write calls
Those changes ensure the stream size get updated correctly after a
truncate or write call.
* File Stream: Fix file stream eof
After a write call, EOF would be incorrect because it was only updated
after a read call.
2022-09-04 23:11:54 +02:00
LibretroAdmin
1e035b9385 (file_list) Get rid of superfluous small functions 2022-09-04 17:52:06 +02:00
LibretroAdmin
dfb4b603e4 Get rid of superfluous wrapper function file_list_get_at_offset 2022-09-04 07:30:21 +02:00
LibretroAdmin
1a24bfe60c (file_list) Get rid of useless wrapper functions 2022-09-04 05:39:16 +02:00
LibretroAdmin
3abd414656 Backport ebe5f2cc3d -
Remove config_file_exists, replace with path_is_valid
2022-09-03 06:35:41 +02:00
LibretroAdmin
ab39c6c2c8 * VFS:
- Simplify retro_vfs_file_seek_impl
- Some cleanups of vfs_implementation_uwp.cpp - backport some of the
improvements made to the non-UWP version
2022-09-03 01:42:57 +02:00
LibretroAdmin
8f14143859 Don't do implicit memsets for struct timespec - always has only
a tv_sec and tv_nsec member field which always get set
2022-09-02 23:47:58 +02:00
Themaister
6038d503c2 Move over to VK_EXT_debug_utils.
Debug marker is deprecated years ago.
2022-08-31 19:45:21 +02:00
LibretroAdmin
fcbc71fef8 retro_vfs_opendir_impl - one less unnecessary strlen for Win32 2022-08-29 10:04:18 +02:00
LibretroAdmin
8f47621857 (libretro-common) Remove unused jsonsax files - we use rjson now instead 2022-08-26 17:38:34 +02:00
LibretroAdmin
288b2da13e Create separate file compat_strldup.c since compat_strl.c is not
getting built-in for Apple targets at all
2022-08-25 16:50:12 +02:00
LibretroAdmin
575e331fd1 If we already know the length of the string, use strldup instead.
Avoids the internal strlen call inside strdup, and strdup is a deprecated
function starting from MSVC2005 anyways.

NOTE: Do NOT pass STRLEN_CONST as n parameter to strldup, it needs to
be at least +1 character higher than the strlen return value of the same
string
2022-08-25 16:31:54 +02:00
LibretroAdmin
da13fb0f48 Don't include errno.h in files that don't justify its use 2022-08-25 05:19:30 +02:00
Cthulhu-throwaway
e45958b25a
(Network) Get rid of the timeout_enable parameter for socket_connect (#14351) 2022-08-25 04:40:19 +02:00
LibretroAdmin
9aef0eff90 Resync 2022-08-24 16:41:21 +02:00
LibretroAdmin
6b9a382f2e Resync 2022-08-24 15:09:51 +02:00
LibretroAdmin
6894600d41 (stdstring) word_wrap - use strlcpy instead of strcpy 2022-08-24 15:06:03 +02:00
LibretroAdmin
e769436876 (word wrap functions in stdstring.c) Avoid implicit strlens, caller
should pass the 'length' to the function instead
2022-08-23 17:06:01 +02:00
Jamiras
85c44f9245
more thread-awareness in task callbacks (#14337)
* more thread-awareness in task callbacks
2022-08-23 15:11:11 +02:00
LibretroAdmin
6f738d4fbd Gradually get rid of strcpy_literal
Reasons:
1 - Just a macro for strcpy
1.2 - doesn't have a return type unlike strlcpy, can't be used
for string concatenation
1.3 - unsafe compared to strlcpy

Do either manual string assignment per character or strlcpy, no
inbetween by resorting to strcpy
2022-08-23 15:04:47 +02:00
LibretroAdmin
a96d12e8bc Put back property locking in threaded_gather_internal - without this,
core updater tasks would crash/segfault - heap corruption
2022-08-22 03:41:17 +02:00
Cthulhu-throwaway
e1a139ec0f
(Network Stream) Add function netstream_eof (#14335) 2022-08-21 21:52:57 +02:00
Cthulhu-throwaway
f27c8c0c1d
(Network Stream) Add string functions (#14333) 2022-08-20 16:36:13 +02:00
Jamiras
e0a065d20e
don't hold property_lock while gathering tasks (#14328) 2022-08-18 04:28:40 +02:00
Filipe Azevedo
e8668a5c71
rzipstream_tell: Fix missing tell for non compressed files (#14313)
The tell call would always return the compressed stream position.
2022-08-15 17:48:09 +02:00
Filipe Azevedo
d62b866237
rzipstream_gets: Fix missing eol (#14311)
The eol was always stripped from the data, leading to behavior
differences with filestream_gets and general read line implementations.
2022-08-11 23:17:00 +02:00
Cthulhu-throwaway
d3f3c58e61
(Network) Fix getnameinfo_retro's port value for HAVE_SOCKET_LEGACY platforms (#14303) 2022-08-08 15:28:42 +02:00
Cthulhu-throwaway
078f712b34
(WiiU) Attempt fix (#14302) 2022-08-07 20:32:27 +02:00
LibretroAdmin
c7786a45e1 Create path_get_extension_mutable and use it in menu_explore function
for trivial extension replacement in string
2022-08-06 19:06:31 +02:00
Cthulhu-throwaway
a7c93eb9ed
(PS3) Silence Warnings (#14287) 2022-08-05 12:45:35 +02:00
Cthulhu-throwaway
b04cb4b1e5
(PS3) Buildfix (#14285) 2022-08-05 04:19:28 +02:00
Cthulhu-throwaway
add4a1e8a0
(Network) Define inet_ntop and inet_pton for older Windows versions (#14284) 2022-08-05 02:23:35 +02:00
Cthulhu-throwaway
c6b99a5df0
(Network) Always have getaddrinfo and getnameinfo flags defined (#14283) 2022-08-04 23:06:28 +02:00
LibretroAdmin
2e5df6a973 fill_str_dated_filename: add size_t return value 2022-08-04 17:18:32 +02:00
LibretroAdmin
0c21a92581 * fill_pathname_expand_special will NULL-terminate string so not
necessary to NULL terminate passed string
* fill_pathname - add size_t return value
* Some general cleanups
2022-08-04 17:10:51 +02:00
LibretroAdmin
9ae46d2648 (file_path.c)
- file_path_expand_special - cut down on code duplication
- file_path_expand_special - add size_t return value
- fill_pathname_abbreviate_special - add size_t return value
2022-08-04 16:53:53 +02:00
LibretroAdmin
5172fe2ba6 fill_pathname_abbreviated_or_relative - add return value 2022-08-04 16:44:01 +02:00
LibretroAdmin
b2634ea588 * Create fill_pathname_join_special - and specify fill_pathname_join
as deprecated.
* Use fill_pathname_join_special in the vast majority of cases where
we can ensure out_path is a new empty string
* Get rid of some extension concatenation with strlcat where encountered
* Some general cleanups with NULL termination of strings that get immediately
passed to strlcpy/strlcpy-adjacent functions
2022-08-04 14:19:38 +02:00
Cthulhu-throwaway
3aa1811ca9
(Network) Add getnameinfo_retro (#14278) 2022-08-04 13:22:49 +02:00
LibretroAdmin
e7f3432e48 Replace some trivial strlcat usage - use return value of preceding
strlcpy then simply append the extension to it at this location
2022-08-04 03:45:09 +02:00
LibretroAdmin
f4c22cb236 (file_path.c) fill_pathname_join - do away with one less strlcat 2022-08-03 23:54:10 +02:00
LibretroAdmin
c240340c91 (vfs_implementation.c) We need to include stdstring.h for string_is_empty 2022-08-03 19:49:02 +02:00
LibretroAdmin
53d2fdbd97 net_http_urlencode - avoid one strlen call by clever use of strlcpy
return value and some subtraction arithmetic
2022-08-03 15:53:12 +02:00
LibretroAdmin
8e6369ef33 (vfs_implementation.c) An unnecessary repeated conditional removed 2022-08-03 15:19:54 +02:00
LibretroAdmin
7871e9fbc1 retro_vfs_file_open_impl - bunch of inefficiencies here:
- was doing a strlen first on path to calculate the length
- stored at least three local variables for string constants
- did another memcmp check after doing the length comparison conditional first
Simplify all this into a simple string comparison checking if the
path starts with the string 'vfsonly://' and/or 'cdrom://' -
avoid both strlen and memcmp cost. Also removed the need for
stdstring.h header include - just translated STRLEN_CONST into
(sizeof(x)-1) - no header file dependency for the only usage of stdstring.h
in this file
2022-08-03 15:07:02 +02:00
LibretroAdmin
33c9f56df0 (RPNG) PNG decoder - proper namespacing of functions, general cleanups 2022-08-02 15:55:26 +02:00
LibretroAdmin
342d3da620 (RPNG optimizations)
- Use memcpy to inflate_buf into array
- Some miscellaneous tweaks
2022-08-02 15:17:37 +02:00
LibretroAdmin
e6f3a387b2 png_reverse_filter_copy_line - optimization - paeth would always return
'b' input value (and input is unsigned, so abs would have no effect), so
get rid of the paeth function call for the first loop iteration
2022-08-02 13:22:13 +02:00
LibretroAdmin
78f4e0abda C89_BUILD buildfix 2022-08-02 11:34:41 +02:00
LibretroAdmin
a974cef001 (sinc resampler) Simplifications - call besseli0 directly instead of
through kaiser_window_function wrapper function - get rid of some unnecessary
sqrtf calls and such, some other small opts
2022-08-02 11:29:05 +02:00
LibretroAdmin
605c4608d9 Optimize fill_pathname_join - avoid the call to fill_pathname_slash()
which would have an implicit strlen cost
2022-08-01 22:14:26 +02:00
LibretroAdmin
e4bff7c12c Move rjsonwriter helper inline functions over to separate file rjson_helpers.h 2022-08-01 17:41:34 +02:00
LibretroAdmin
f79875536a (libretro-common) Move file_crc32 out of encoding_crc32.c - we don't want file I/O
code in encodings/encoding_crc32.c
2022-08-01 14:04:01 +02:00
LibretroAdmin
ec6f4c1f55 (libretro-common) refinements to documentation 2022-08-01 13:06:35 +02:00
LibretroAdmin
107c69ab9e (libretro-common) More documentation refinement 2022-08-01 11:03:58 +02:00
LibretroAdmin
c7a1d83675 (libretro-common) Start documenting leaf functon calls in function documentation
(libretro-common) docs - document when string has to be non-NULL or else UB (undefined behavior)
(libretro-common) stdstring.c - string_hex_to_unsigned - make strlen call unneeded
2022-08-01 09:52:39 +02:00
LibretroAdmin
fca6015011 (file_path) path_basedir - remove unnecessary strlcpy - add return value comment
to another function
2022-07-31 12:45:14 +02:00
LibretroAdmin
88bdaffa87 path_basedir_wrapper - get rid of unnecessary strlcpy 2022-07-31 12:42:50 +02:00
LibretroAdmin
36edb15c5b path_parent_dir - don't do implicit strlen inside 2022-07-31 12:31:55 +02:00
Cthulhu-throwaway
9b10579a54
(Network) Fix getaddrinfo_retro (#14261) 2022-07-31 11:22:28 +02:00
Cthulhu-throwaway
f96ef5407a
(Network) Refactor getaddrinfo_retro (#14258) 2022-07-30 22:43:32 +02:00
LibretroAdmin
2c3c9e1e71 Add note to string_list_join_concat 2022-07-27 15:51:16 +02:00
Cthulhu-throwaway
29f0ba2e71
(Network/Vita) Add net_ifinfo support (#14225) 2022-07-26 16:10:23 +01:00
Cthulhu-throwaway
97e3ef6ec7
(Network/Vita) Do not multiply negative timeout values (#14217) 2022-07-25 07:55:08 +02:00