├── .gitignore ├── Makefile.test ├── audio ├── audio_mix.c ├── audio_mixer.c ├── conversion │ ├── float_to_s16.c │ ├── float_to_s16_neon.S │ ├── float_to_s16_neon.c │ ├── mono_to_stereo_float.c │ ├── s16_to_float.c │ ├── s16_to_float_neon.S │ ├── s16_to_float_neon.c │ └── stereo_to_mono_float.c ├── dsp_filter.c ├── dsp_filters │ ├── BassBoost.dsp │ ├── ChipTune-Lowpass.dsp │ ├── ChipTuneEnhance.dsp │ ├── Chorus.dsp │ ├── Crystalizer.dsp │ ├── EQ.dsp │ ├── Echo.dsp │ ├── EchoReverb.dsp │ ├── HighShelfDampen.dsp │ ├── IIR.dsp │ ├── LowPassCPS.dsp │ ├── Makefile │ ├── Mono.dsp │ ├── Panning.dsp │ ├── Phaser.dsp │ ├── Reverb.dsp │ ├── Tremolo.dsp │ ├── Vibrato.dsp │ ├── WahWah.dsp │ ├── chorus.c │ ├── configure │ ├── crystalizer.c │ ├── echo.c │ ├── eq.c │ ├── fft │ │ ├── fft.c │ │ └── fft.h │ ├── iir.c │ ├── link.T │ ├── panning.c │ ├── phaser.c │ ├── reverb.c │ ├── tremolo.c │ ├── vibrato.c │ └── wahwah.c └── resampler │ ├── audio_resampler.c │ └── drivers │ ├── nearest_resampler.c │ ├── sinc_resampler.c │ └── sinc_resampler_neon.S ├── cdrom └── cdrom.c ├── compat ├── compat_fnmatch.c ├── compat_getopt.c ├── compat_ifaddrs.c ├── compat_posix_string.c ├── compat_snprintf.c ├── compat_strcasestr.c ├── compat_strl.c ├── compat_strldup.c ├── compat_vscprintf.c └── fopen_utf8.c ├── crt ├── include │ └── string.h └── string.c ├── dynamic └── dylib.c ├── encodings ├── encoding_base64.c ├── encoding_crc32.c └── encoding_utf.c ├── features └── features_cpu.c ├── file ├── archive_file.c ├── archive_file_7z.c ├── archive_file_zlib.c ├── config_file.c ├── config_file_userdata.c ├── file_path.c ├── file_path_io.c ├── nbio │ ├── nbio_intf.c │ ├── nbio_linux.c │ ├── nbio_orbis.c │ ├── nbio_stdio.c │ ├── nbio_unixmmap.c │ └── nbio_windowsmmap.c └── retro_dirent.c ├── formats ├── bmp │ ├── rbmp.c │ └── rbmp_encode.c ├── cdfs │ └── cdfs.c ├── image_texture.c ├── image_transfer.c ├── jpeg │ └── rjpeg.c ├── json │ └── rjson.c ├── libchdr │ ├── libchdr_bitstream.c │ ├── libchdr_cdrom.c │ ├── libchdr_chd.c │ ├── libchdr_flac.c │ ├── libchdr_flac_codec.c │ ├── libchdr_huffman.c │ ├── libchdr_lzma.c │ └── libchdr_zlib.c ├── logiqx_dat │ └── logiqx_dat.c ├── m3u │ └── m3u_file.c ├── png │ ├── rpng.c │ ├── rpng_encode.c │ └── rpng_internal.h ├── tga │ └── rtga.c ├── wav │ └── rwav.c └── xml │ ├── rxml.c │ └── test │ ├── Makefile │ └── rxml_test.c ├── gfx ├── gl_capabilities.c └── scaler │ ├── pixconv.c │ ├── scaler.c │ ├── scaler_filter.c │ └── scaler_int.c ├── glsm └── glsm.c ├── glsym ├── README.md ├── glgen.py ├── glsym_es2.c ├── glsym_es3.c ├── glsym_gl.c ├── rglgen.c ├── rglgen.py └── xglgen.py ├── hash └── lrc_hash.c ├── include ├── array │ ├── rbuf.h │ └── rhmap.h ├── audio │ ├── audio_mix.h │ ├── audio_mixer.h │ ├── audio_resampler.h │ ├── conversion │ │ ├── dual_mono.h │ │ ├── float_to_s16.h │ │ └── s16_to_float.h │ └── dsp_filter.h ├── boolean.h ├── cdrom │ └── cdrom.h ├── clamping.h ├── compat │ ├── apple_compat.h │ ├── fnmatch.h │ ├── fopen_utf8.h │ ├── getopt.h │ ├── ifaddrs.h │ ├── intrinsics.h │ ├── msvc.h │ ├── msvc │ │ └── stdint.h │ ├── posix_string.h │ ├── strcasestr.h │ ├── strl.h │ ├── zconf.h │ ├── zconf.h.in │ ├── zlib.h │ ├── zlib │ │ ├── zconf.h │ │ ├── zconf.h.in │ │ ├── zlib.h │ │ └── zutil.h │ └── zutil.h ├── defines │ ├── cocoa_defines.h │ ├── d3d_defines.h │ ├── gx_defines.h │ ├── ps3_defines.h │ ├── ps4_defines.h │ └── psp_defines.h ├── dynamic │ └── dylib.h ├── encodings │ ├── base64.h │ ├── crc32.h │ ├── utf.h │ └── win32.h ├── fastcpy.h ├── features │ └── features_cpu.h ├── file │ ├── archive_file.h │ ├── config_file.h │ ├── config_file_userdata.h │ ├── file_path.h │ └── nbio.h ├── filters.h ├── formats │ ├── cdfs.h │ ├── image.h │ ├── logiqx_dat.h │ ├── m3u_file.h │ ├── rbmp.h │ ├── rjpeg.h │ ├── rjson.h │ ├── rjson_helpers.h │ ├── rpng.h │ ├── rtga.h │ ├── rwav.h │ └── rxml.h ├── gfx │ ├── gl_capabilities.h │ ├── math │ │ ├── matrix_3x3.h │ │ ├── matrix_4x4.h │ │ ├── vector_2.h │ │ ├── vector_3.h │ │ └── vector_4.h │ ├── scaler │ │ ├── filter.h │ │ ├── pixconv.h │ │ ├── scaler.h │ │ └── scaler_int.h │ └── video_frame.h ├── glsm │ ├── glsm.h │ └── glsmsym.h ├── glsym │ ├── glsym.h │ ├── glsym_es2.h │ ├── glsym_es3.h │ ├── glsym_gl.h │ ├── rglgen.h │ ├── rglgen_headers.h │ ├── rglgen_private_headers.h │ └── switch │ │ ├── nx_gl.h │ │ └── nx_glsym.h ├── libchdr │ ├── bitstream.h │ ├── cdrom.h │ ├── chd.h │ ├── coretypes.h │ ├── flac.h │ ├── huffman.h │ ├── libchdr_zlib.h │ ├── lzma.h │ └── minmax.h ├── libco.h ├── libretro.h ├── libretro_d3d.h ├── libretro_dspfilter.h ├── libretro_gskit_ps2.h ├── libretro_vulkan.h ├── lists │ ├── dir_list.h │ ├── file_list.h │ ├── linked_list.h │ ├── nested_list.h │ └── string_list.h ├── lrc_hash.h ├── math │ ├── complex.h │ ├── float_minmax.h │ └── fxp.h ├── media │ └── media_detect_cd.h ├── memalign.h ├── memmap.h ├── net │ ├── net_compat.h │ ├── net_http.h │ ├── net_http_parse.h │ ├── net_ifinfo.h │ ├── net_socket.h │ └── net_socket_ssl.h ├── playlists │ └── label_sanitization.h ├── queues │ ├── fifo_queue.h │ ├── generic_queue.h │ ├── message_queue.h │ └── task_queue.h ├── retro_assert.h ├── retro_common.h ├── retro_common_api.h ├── retro_dirent.h ├── retro_endianness.h ├── retro_environment.h ├── retro_inline.h ├── retro_math.h ├── retro_miscellaneous.h ├── retro_stat.h ├── retro_timers.h ├── rthreads │ ├── async_job.h │ ├── rthreads.h │ └── tpool.h ├── streams │ ├── chd_stream.h │ ├── file_stream.h │ ├── file_stream_transforms.h │ ├── interface_stream.h │ ├── memory_stream.h │ ├── network_stream.h │ ├── rzip_stream.h │ ├── stdin_stream.h │ └── trans_stream.h ├── string │ └── stdstring.h ├── time │ └── rtime.h ├── utils │ └── md5.h ├── vfs │ ├── vfs.h │ ├── vfs_implementation.h │ └── vfs_implementation_cdrom.h └── vulkan │ └── vulkan_symbol_wrapper.h ├── libco ├── aarch64.c ├── amd64.c ├── armeabi.c ├── fiber.c ├── genode.cpp ├── libco.c ├── ppc.c ├── ps2.c ├── ps3.S ├── psp1.c ├── psp2.c ├── scefiber.c ├── sjlj.c ├── ucontext.c └── x86.c ├── lists ├── dir_list.c ├── file_list.c ├── linked_list.c ├── nested_list.c ├── string_list.c └── vector_list.c ├── media └── media_detect_cd.c ├── memmap ├── memalign.c └── memmap.c ├── net ├── net_compat.c ├── net_http.c ├── net_http_parse.c ├── net_ifinfo.c ├── net_socket.c ├── net_socket_ssl_bear.c └── net_socket_ssl_mbed.c ├── playlists └── label_sanitization.c ├── queues ├── fifo_queue.c ├── generic_queue.c ├── message_queue.c └── task_queue.c ├── rthreads ├── ctr_pthread.h ├── gx_pthread.h ├── psp_pthread.h ├── rthreads.c ├── tpool.c ├── wiiu_pthread.h └── xenon_sdl_threads.c ├── samples ├── compat │ ├── fnmatch │ │ ├── Makefile │ │ └── compat_fnmatch_test.c │ ├── snprintf │ │ ├── Makefile │ │ └── snprintf_test.c │ └── strl │ │ ├── Makefile │ │ └── strl_test.c ├── core_options │ ├── README.md │ ├── example_categories │ │ ├── conversion_scripts │ │ │ ├── core_option_regex.py │ │ │ └── v1_to_v2_converter.py │ │ ├── libretro_core_options.h │ │ └── libretro_core_options_intl.h │ ├── example_default │ │ ├── libretro_core_options.h │ │ └── libretro_core_options_intl.h │ ├── example_hide_option │ │ ├── libretro_core_options.h │ │ └── libretro_core_options_intl.h │ └── example_translation │ │ ├── libretro_core_options.h │ │ ├── libretro_core_options_intl.h │ │ └── translation scripts │ │ ├── .github │ │ └── workflows │ │ │ ├── crowdin_intl.yml │ │ │ └── crowdin_prep.yml │ │ ├── crowdin.yml │ │ ├── instructions.txt │ │ └── intl │ │ ├── .gitignore │ │ ├── core_opt_translation.py │ │ ├── core_option_regex.py │ │ ├── crowdin_intl.py │ │ ├── crowdin_prep.py │ │ └── v1_to_v2_converter.py ├── file │ ├── config_file │ │ ├── Makefile │ │ └── config_file_test.c │ └── nbio │ │ ├── Makefile │ │ └── nbio_test.c ├── formats │ ├── png │ │ ├── Makefile │ │ └── rpng_test.c │ └── xml │ │ ├── Makefile │ │ └── rxml_test.c ├── net │ ├── Makefile │ ├── http_test │ ├── net_http_parse_test.c │ ├── net_http_test.c │ ├── net_ifinfo │ ├── net_ifinfo_test.c │ └── udp-test.c ├── streams │ └── rzip │ │ ├── Makefile │ │ └── rzip.c └── utils │ ├── Makefile │ ├── crc32.c │ ├── md5_test.c │ └── sha1_main.c ├── streams ├── chd_stream.c ├── file_stream.c ├── file_stream_transforms.c ├── interface_stream.c ├── memory_stream.c ├── network_stream.c ├── rzip_stream.c ├── stdin_stream.c ├── trans_stream.c ├── trans_stream_pipe.c └── trans_stream_zlib.c ├── string └── stdstring.c ├── test ├── hash │ └── test_hash.c ├── lists │ └── test_linked_list.c ├── queues │ └── test_generic_queue.c ├── string │ └── test_stdstring.c └── utils │ └── test_utils.c ├── time └── rtime.c ├── utils ├── debugbreak │ └── debugbreak.c ├── djb2.c ├── md5.c └── sha1.c ├── vfs ├── vfs_implementation.c ├── vfs_implementation_cdrom.c └── vfs_implementation_uwp.cpp └── vulkan └── vulkan_symbol_wrapper.c /.gitignore: -------------------------------------------------------------------------------- 1 | glsm/ 2 | *.[od] 3 | *.dll 4 | *.so 5 | *.dylib 6 | *.exe 7 | -------------------------------------------------------------------------------- /Makefile.test: -------------------------------------------------------------------------------- 1 | 2 | OBJDIR = ../obj-unix 3 | 4 | TEST_UNIT_CFLAGS = $(CFLAGS) -Iinclude $(LDFLAGS) -lcheck $(LIBCHECK_CFLAGS) -Werror -Wdeclaration-after-statement -fsanitize=address -fsanitize=undefined -ftest-coverage -fprofile-arcs -ggdb 5 | 6 | TEST_GENERIC_QUEUE = test/queues/test_generic_queue 7 | TEST_GENERIC_QUEUE_SRC = test/queues/test_generic_queue.c queues/generic_queue.c 8 | 9 | TEST_LINKED_LIST = test/lists/test_linked_list 10 | TEST_LINKED_LIST_SRC = test/lists/test_linked_list.c lists/linked_list.c 11 | 12 | TEST_STDSTRING = test/string/test_stdstring 13 | TEST_STDSTRING_SRC = test/string/test_stdstring.c string/stdstring.c encodings/encoding_utf.c \ 14 | compat/compat_strl.c 15 | 16 | TEST_UTILS = test/utils/test_utils 17 | TEST_UTILS_SRC = test/utils/test_utils.c utils/md5.c encodings/encoding_crc32.c \ 18 | streams/file_stream.c vfs/vfs_implementation.c file/file_path.c \ 19 | compat/compat_strl.c time/rtime.c string/stdstring.c encodings/encoding_utf.c 20 | 21 | TEST_HASH = test/hash/test_hash 22 | TEST_HASH_SRC = test/hash/test_hash.c hash/lrc_hash.c \ 23 | streams/file_stream.c vfs/vfs_implementation.c file/file_path.c \ 24 | compat/compat_strl.c time/rtime.c string/stdstring.c encodings/encoding_utf.c 25 | 26 | all: 27 | # Build and execute tests in order, to avoid coverage file collision 28 | # string 29 | $(CC) $(TEST_UNIT_CFLAGS) $(TEST_STDSTRING_SRC) -o $(TEST_STDSTRING) 30 | $(TEST_STDSTRING) 31 | lcov -c -d . -o `dirname $(TEST_STDSTRING)`/coverage.info 32 | # utils 33 | $(CC) $(TEST_UNIT_CFLAGS) $(TEST_UTILS_SRC) -o $(TEST_UTILS) 34 | $(TEST_UTILS) 35 | lcov -c -d . -o `dirname $(TEST_UTILS)`/coverage.info 36 | # utils 37 | $(CC) $(TEST_UNIT_CFLAGS) $(TEST_HASH_SRC) -o $(TEST_HASH) 38 | $(TEST_HASH) 39 | lcov -c -d . -o `dirname $(TEST_HASH)`/coverage.info 40 | # list 41 | $(CC) $(TEST_UNIT_CFLAGS) $(TEST_LINKED_LIST_SRC) -o $(TEST_LINKED_LIST) 42 | $(TEST_LINKED_LIST) 43 | lcov -c -d . -o `dirname $(TEST_LINKED_LIST)`/coverage.info 44 | # queue 45 | $(CC) $(TEST_UNIT_CFLAGS) $(TEST_GENERIC_QUEUE_SRC) -o $(TEST_GENERIC_QUEUE) 46 | $(TEST_GENERIC_QUEUE) 47 | lcov -c -d . -o `dirname $(TEST_GENERIC_QUEUE)`/coverage.info 48 | 49 | lcov -o test/coverage.info \ 50 | -a test/utils/coverage.info \ 51 | -a test/string/coverage.info \ 52 | -a test/lists/coverage.info \ 53 | -a test/queues/coverage.info 54 | genhtml -o test/coverage/ test/coverage.info 55 | 56 | clean: 57 | rm -f *.gcda *.gcno 58 | 59 | -------------------------------------------------------------------------------- /audio/conversion/float_to_s16_neon.S: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2020 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (float_to_s16_neon.S). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | #if defined(__ARM_NEON__) && defined(HAVE_ARM_NEON_ASM_OPTIMIZATIONS) 23 | 24 | #ifndef __MACH__ 25 | .arm 26 | #endif 27 | 28 | .align 4 29 | .globl convert_float_s16_asm 30 | #ifndef __MACH__ 31 | .type convert_float_s16_asm, %function 32 | #endif 33 | .globl _convert_float_s16_asm 34 | #ifndef __MACH__ 35 | .type _convert_float_s16_asm, %function 36 | #endif 37 | # convert_float_s16_asm(int16_t *out, const float *in, size_t samples) 38 | convert_float_s16_asm: 39 | _convert_float_s16_asm: 40 | # Hacky way to get a constant of 2^15. 41 | # ((2^4)^2)^2 * 0.5 = 2^15 42 | vmov.f32 q8, #16.0 43 | vmov.f32 q9, #0.5 44 | vmul.f32 q8, q8, q8 45 | vmul.f32 q8, q8, q8 46 | vmul.f32 q8, q8, q9 47 | 48 | 1: 49 | # Preload here? 50 | vld1.f32 {q0-q1}, [r1]! 51 | 52 | vmul.f32 q0, q0, q8 53 | vmul.f32 q1, q1, q8 54 | 55 | vcvt.s32.f32 q0, q0 56 | vcvt.s32.f32 q1, q1 57 | 58 | vqmovn.s32 d4, q0 59 | vqmovn.s32 d5, q1 60 | 61 | vst1.f32 {d4-d5}, [r0]! 62 | 63 | # Guaranteed to get samples in multiples of 8. 64 | subs r2, r2, #8 65 | bne 1b 66 | 67 | bx lr 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /audio/conversion/mono_to_stereo_float.c: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2010-2023 The RetroArch team 2 | * 3 | * --------------------------------------------------------------------------------------- 4 | * The following license statement only applies to this file (mono_to_stereo.c). 5 | * --------------------------------------------------------------------------------------- 6 | * 7 | * Permission is hereby granted, free of charge, 8 | * to any person obtaining a copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, including without limitation the rights to 10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 11 | * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 16 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 19 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | */ 22 | #include 23 | #include 24 | 25 | #include