From 4ab91b02c3c3a27f4eee835907213549941380b0 Mon Sep 17 00:00:00 2001 From: MoistDreams <22002023+Misunderstood-Wookiee@users.noreply.github.com> Date: Sun, 7 Jul 2024 03:11:53 +1000 Subject: [PATCH] Downstream (#1) * (libretro-common) Some functions now return len * More string_list removal in menu_displaylist.c * (menu_displaylist.c) Get rid of more string_list usage * (playlist.c) Get rid of string_list usage * (menu) More string_list removal * file_archive_get_file_list_cb - remove string_list usage * (menu_cbs_title.c) Remove string_list usage * Include for strtok_r MSVC compatibility * Slight change in header include * (archive_file) Don't know why this won't compile for MSVC - gets included which should redefine strtok_r for MSVC usage but it just doesn't work and fails at linking stage, will have to figure this out later * Remove unused variables * (audio/common) Fix header includes * (menu_displaylist.c) More string_list removal * More string_list removal * Fetch translations from Crowdin * generic_action_ok_dropdown_setting - don't use string_list for ST_STRING_OPTIONS * Fix ST_STRING_OPTIONS 'selected' dropdown item - was off by one * Rewrite action_ok_rdb_entry_submenu - no more string_list usage * Rewrite 2 of action_ok_rdb_entry_submenu - now with less allocations * (gfx_animation.c) Small cleanups * (task_overlay.c) No more string_list usage * (task_overlay) remove unused variable * Replace some strlcat usage with strlcpy * Get rid of some unnecessary strlcat usage * (dylib.c) Avoid strlcat usage, camelcase variable name removal and C comments * (gfx_animation.c) Use strlcpy * Buildfix * iOS/tvOS: Add ardens and anarch cores to app store build * (RGUI) rgui_update_menu_sublabel - use strtok_r instead of string_list * (ozone) ozone_draw_osk - use strtok_r instead of string_list * (task_content.c) content_file_override_set - use strtok_r instead of string_list * Put comment back * (core_updater_list) replace string_list usage with strtok_r * (core_updater_list) Remove more string_list usage * Simplifications * input_config_get_bind_string - do proper character counting now, avoid strlcats, and have functions return size_t value indicating how many chars were written * (steam) avoid strlcat usage * task_save_handler - rewrite code - put string on stack instead of heap, avoid using strlcat * Cut down on strlcats * CI: add github workflow to create source-only release tarball closes #16645 * Replace more strlcats * x11: add support for Xss screensaver disabling in case xdg-screensaver isn't installed. * Remove some header includes * (cheevos) Cleanups - only use snprintf for formatting * Fetch translations from Crowdin * Fullscreen refresh rate improvements Handle refresh rate as float in general, and add also extra attributes (interlaced, doublescan) for video modes. Make it possible to select exact mode (interlaced / doublescan modes will not be selected), and allow close matches such as 49.5 Hz for PAL 50 Hz. * Fix MSVC05 compilation failure * Fetch translations from Crowdin * (menu_cbs_deferred_push) Get rid of string_list usage * Simplify gfx_animation_line_ticker_smooth * add intfstream_truncate for file streams Will return 0 for non-file streams. I didn't want to mess around with memory_stream (which could in theory have a truncate impl that sets size) because there were globals and stuff and I got nervous (also truncate might *grow* a file if the new length is longer than the old one and then I'd have to think about realloc, etc). * change some replay file seeks to seek+truncates in record mode * tidy up intfstream_truncate ifdefs. * Fetch translations from Crowdin * [Wayland] Support for mouse buttons 4&5 and horizontal wheel * Fetch translations from Crowdin * Fetch translations from Crowdin * Fetch translations from Crowdin * (libretro-common) Use inline assembly for PowerPC libco This puts the code into the binary's .text section, which is needed for platforms without the ability to map it as RWX (WiiU). Using GNU/AT&T syntax for the assembly here. * Fix exclusive fullscreen condition Spotted in Android compilation: warning: bitwise or with non-zero value always evaluates to true [-Wtautological-bitwise-compare] * Fix keyboard events missing RETROKMOD_NUMLOCK or RETROKMOD_SCROLLOCK - Add missing numlock mod to dinput - Add missing scrolllock mod to x11 - Add missing capslock, numlock, scrolllock and meta mods to android - Add missing scrolllock mod to sdl - Add missing capslock, numlock, scrolllock and meta mods to switch - Add missing numlock mod to winraw - Add missing numlock mod to uwp * Add config values and menu items for viewport bias x/y * Refactor viewport handling/aspect ratio scaling. This mirrors the use of video_viewport_get_scaled_integer for non-integer scaling at various aspect ratios. Two variants are provided, one with implicit device and desired ratios and one with explicit ratios. Also added a flag to video_viewport_get_scaled_integer to indicate the direction of positive y. * Fix build errors on wiiu, directx * [X11] Support for mouse buttons 4 and 5 Support added for extra mouse buttons. Since these buttons were not returned by XQueryPointer(), some additional logic was needed which fit best to scroll wheel handling. * allow saves and configs to be optionally synced to cloud * ensure that all folders are enabled by default. * Fetch translations from Crowdin * (D3D8) Fix build * Silence warnings * (menu_cbs_ok.c) Some cleanups, warning fixes, use strtok_r instead of strtok * (glslang) use strtok_r instead of strtok * strtok_r - small syntactic cleanup * Add missing header * Flip default y positive direction for viewport calc This should fix metal and maybe some directx resizes * Use device ratio when determining portrait orientation * Fetch translations from Crowdin * Skip core unload when Quit on Close Content is set * Fix #16562 support bluetooth keyboards on tvos * Fetch translations from Crowdin * Add header include for rhmap.h * Try to avoid strdup to avoid portability issues * Buildfix * Fetch translations from Crowdin * Android: Improvements to DocumentProvider Added move and rename methods Provider notifies viewer to refresh view when files are changed Bumped up TargetApi annotation for DocumentsContract.buildTreeDocumentUri. Could alternatively use androidx compat class. * Android: Remove External Storage permission * Android: Add function to migrate RetroArch folder from sdcard. * Improvements to migration code Will be squashed before commit * Revert "Improvements to migration code Will be squashed before commit" This reverts commit 3dab003b19d5b9fa096de2be2672029f80655acb. * Revert "Android: Add function to migrate RetroArch folder from sdcard." This reverts commit b7235e426f239825fc3d8fbb5a8cb482153faf96. * Revert "Android: Remove External Storage permission" This reverts commit 850560d1b6e774753d536690259d84610f623927. * Revert "Android: Improvements to DocumentProvider Added move and rename methods Provider notifies viewer to refresh view when files are changed Bumped up TargetApi annotation for DocumentsContract.buildTreeDocumentUri. Could alternatively use androidx compat class." This reverts commit 72db30128c8f8f149d2727c8f439af5969c58a99. * Fetch translations from Crowdin * Fetch translations from Crowdin * Fetch translations from Crowdin * (rhmap) use custom strdup * Fetch translations from Crowdin * Bump robinraju/release-downloader from 1.9 to 1.11 Bumps [robinraju/release-downloader](https://github.com/robinraju/release-downloader) from 1.9 to 1.11. - [Release notes](https://github.com/robinraju/release-downloader/releases) - [Commits](https://github.com/robinraju/release-downloader/compare/v1.9...v1.11) --- updated-dependencies: - dependency-name: robinraju/release-downloader dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Bump actions/setup-java from 3 to 4 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Bump actions/setup-python from 4 to 5 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: libretroadmin Co-authored-by: github-actions Co-authored-by: Eric Warmenhoven Co-authored-by: rofl0r Co-authored-by: zoltanvb Co-authored-by: zoltanvb <101990835+zoltanvb@users.noreply.github.com> Co-authored-by: Joseph C. Osborn Co-authored-by: Ash Logan Co-authored-by: schellingb <14200249+schellingb@users.noreply.github.com> Co-authored-by: Jay Paul Co-authored-by: Jonathan Rascher Co-authored-by: cwyc Co-authored-by: LibretroAdmin <105389611+LibretroAdmin@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/SourceRelease.yml | 49 + .github/workflows/crowdin-daily.yml | 4 +- .github/workflows/crowdin.yml | 4 +- .github/workflows/webOS.yml | 4 +- Makefile.common | 3 + audio/common/alsa.c | 3 +- audio/common/alsa.h | 5 +- audio/common/alsathread.h | 6 +- audio/common/mmdevice_common.c | 1 - audio/common/wasapi.c | 15 +- audio/common/wasapi.h | 6 +- audio/microphone_driver.c | 1 + cheevos/cheevos.c | 80 +- config.def.h | 8 + configuration.c | 8 + configuration.h | 8 + core_info.c | 51 +- core_updater_list.c | 171 +-- frontend/drivers/platform_ctr.c | 12 +- frontend/drivers/platform_emscripten.c | 10 +- frontend/drivers/platform_win32.c | 20 +- frontend/drivers/platform_xdk.c | 2 +- frontend/frontend_driver.c | 62 +- frontend/frontend_driver.h | 2 +- gfx/common/d3d9_common.c | 71 +- gfx/common/win32_common.c | 6 + gfx/common/x11_common.c | 39 +- gfx/display_servers/dispserv_kms.c | 11 +- gfx/display_servers/dispserv_win32.c | 11 + gfx/drivers/ctr_gfx.c | 46 +- gfx/drivers/d3d8.c | 75 +- gfx/drivers/gl1.c | 54 +- gfx/drivers/gl2.c | 62 +- gfx/drivers/gl3.c | 56 +- gfx/drivers/gx2_gfx.c | 51 +- gfx/drivers/gx_gfx.c | 57 +- gfx/drivers/psp1_gfx.c | 47 +- gfx/drivers/rsx_gfx.c | 62 +- gfx/drivers/sdl2_gfx.c | 34 +- gfx/drivers/switch_nx_gfx.c | 44 +- gfx/drivers/vg.c | 64 +- gfx/drivers/vita2d_gfx.c | 67 +- gfx/drivers/vulkan.c | 58 +- gfx/drivers/xvideo.c | 34 +- gfx/drivers_shader/glslang.cpp | 18 +- gfx/gfx_animation.c | 79 +- gfx/video_display_server.h | 3 + gfx/video_driver.c | 145 ++- gfx/video_driver.h | 35 +- gfx/video_shader_parse.c | 5 +- input/common/input_x11_common.c | 37 +- input/common/wayland_common.c | 14 + input/common/wayland_common.h | 2 +- input/drivers/android_input.c | 8 + input/drivers/dinput.c | 29 +- input/drivers/sdl_input.c | 5 + input/drivers/switch_input.c | 14 +- input/drivers/wayland_input.c | 13 +- input/drivers/winraw_input.c | 2 + input/drivers/x11_input.c | 9 +- input/input_driver.c | 162 ++- input/input_driver.h | 25 +- input/input_remapping.h | 43 +- intl/msg_hash_ar.h | 10 + intl/msg_hash_ast.h | 10 + intl/msg_hash_be.h | 130 ++- intl/msg_hash_bg.h | 10 + intl/msg_hash_ca.h | 10 + intl/msg_hash_chs.h | 8 +- intl/msg_hash_cht.h | 8 +- intl/msg_hash_cs.h | 8 +- intl/msg_hash_cy.h | 10 + intl/msg_hash_da.h | 10 + intl/msg_hash_de.h | 36 +- intl/msg_hash_el.h | 10 + intl/msg_hash_en.h | 18 + intl/msg_hash_eo.h | 10 + intl/msg_hash_es.h | 118 +- intl/msg_hash_fa.h | 10 + intl/msg_hash_fi.h | 10 +- intl/msg_hash_fr.h | 68 +- intl/msg_hash_gl.h | 84 +- intl/msg_hash_he.h | 10 + intl/msg_hash_hr.h | 10 + intl/msg_hash_hu.h | 12 +- intl/msg_hash_id.h | 14 +- intl/msg_hash_it.h | 68 +- intl/msg_hash_ja.h | 140 ++- intl/msg_hash_ko.h | 8 +- intl/msg_hash_lbl.h | 26 + intl/msg_hash_mt.h | 10 + intl/msg_hash_nl.h | 10 + intl/msg_hash_no.h | 8 +- intl/msg_hash_oc.h | 10 + intl/msg_hash_or.h | 10 + intl/msg_hash_pl.h | 52 +- intl/msg_hash_pt_br.h | 94 +- intl/msg_hash_pt_pt.h | 10 + intl/msg_hash_ro.h | 10 + intl/msg_hash_ru.h | 20 +- intl/msg_hash_si.h | 10 + intl/msg_hash_sk.h | 10 + intl/msg_hash_sr.h | 10 + intl/msg_hash_sv.h | 8 +- intl/msg_hash_tr.h | 68 +- intl/msg_hash_uk.h | 8 +- intl/msg_hash_us.h | 68 +- intl/msg_hash_val.h | 10 + intl/msg_hash_vn.h | 10 + intl/progress.h | 16 +- libretro-common/dynamic/dylib.c | 20 +- libretro-common/file/archive_file.c | 5 +- libretro-common/file/file_path.c | 20 +- libretro-common/include/array/rhmap.h | 26 +- libretro-common/include/file/file_path.h | 32 +- .../include/streams/interface_stream.h | 3 + libretro-common/libco/ppc.c | 229 +++- libretro-common/lists/nested_list.c | 7 +- libretro-common/lists/string_list.c | 4 +- libretro-common/streams/interface_stream.c | 20 + menu/cbs/menu_cbs_deferred_push.c | 136 ++- menu/cbs/menu_cbs_ok.c | 162 ++- menu/cbs/menu_cbs_sublabel.c | 32 +- menu/cbs/menu_cbs_title.c | 64 +- menu/drivers/materialui.c | 6 +- menu/drivers/ozone.c | 48 +- menu/drivers/rgui.c | 29 +- menu/drivers/xmb.c | 23 +- menu/menu_displaylist.c | 505 ++++---- menu/menu_driver.c | 6 +- menu/menu_driver.h | 2 +- menu/menu_setting.c | 108 ++ menu/menu_shader.h | 5 +- msg_hash.h | 8 + network/cloud_sync/webdav.c | 5 +- pkg/apple/update-cores.sh | 152 +-- playlist.c | 66 +- qb/config.libs.sh | 1 + qb/config.params.sh | 1 + record/record_driver.c | 1034 +++++++++-------- retroarch.c | 194 ++-- retroarch.h | 2 +- steam/steam.c | 20 +- tasks/task_cloudsync.c | 25 +- tasks/task_content.c | 31 +- tasks/task_decompress.c | 1 - tasks/task_overlay.c | 127 +- tasks/task_save.c | 31 +- ui/drivers/cocoa/cocoa_common.m | 4 +- uwp/uwp_main.cpp | 2 + 150 files changed, 4009 insertions(+), 2637 deletions(-) create mode 100644 .github/workflows/SourceRelease.yml diff --git a/.github/workflows/SourceRelease.yml b/.github/workflows/SourceRelease.yml new file mode 100644 index 000000000000..c89434d17e9f --- /dev/null +++ b/.github/workflows/SourceRelease.yml @@ -0,0 +1,49 @@ +name: CI Generate Source Only Tarball + +# Trigger whenever a release and/or is created +on: + release: + types: + - created + push: + tags: + - "v*.*" + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: archive + id: archive + run: | + VERSION=${GITHUB_REF##*/} + test -z "$VERSION" && VERSION=${{ github.event.release.tag_name }} + VERSION=$(printf "%s\n" "$VERSION" | sed 's/^v//') + PKGNAME="retroarch-sourceonly-$VERSION" + mkdir -p /tmp/$PKGNAME + mv * /tmp/$PKGNAME + mv /tmp/$PKGNAME . + rm -rf $PKGNAME/pkg || true + rm -rf $PKGNAME/wii/libogc || true + rm -rf $PKGNAME/deps/glslang/glslang/Test || true + rm -rf $PKGNAME/deps/SPIRV-Cross/reference || true + rm -rf $PKGNAME/gfx/include/userland || true + find $PKGNAME/ -type f -name '*.a' -delete || true + find $PKGNAME/ -type f -name '*.lib' -delete || true + find $PKGNAME/ -type f -name '*.dylib' -delete || true + find $PKGNAME/ -type f -name '*.so.*' -delete || true + find $PKGNAME/ -type f -name '*.dll' -delete || true + TARBALL=$PKGNAME.tar.xz + tar cJf $TARBALL $PKGNAME + echo "tarball=$TARBALL" >> $GITHUB_OUTPUT + + - name: upload tarball + uses: softprops/action-gh-release@v2 + with: + files: ${{ steps.archive.outputs.tarball }} diff --git a/.github/workflows/crowdin-daily.yml b/.github/workflows/crowdin-daily.yml index cb2eb994e206..c75dc130e60e 100644 --- a/.github/workflows/crowdin-daily.yml +++ b/.github/workflows/crowdin-daily.yml @@ -16,12 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 18 distribution: zulu - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - name: Checkout diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 2e1079528dec..5ee309af9e93 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -18,12 +18,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Setup Java JDK - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 18 distribution: zulu - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.10' - name: Checkout diff --git a/.github/workflows/webOS.yml b/.github/workflows/webOS.yml index 425c02c9c105..669afa50ec73 100644 --- a/.github/workflows/webOS.yml +++ b/.github/workflows/webOS.yml @@ -18,7 +18,7 @@ jobs: uses: actions/checkout@v4 - name: Download ares-cli-rs - uses: robinraju/release-downloader@v1.9 + uses: robinraju/release-downloader@v1.11 with: repository: "webosbrew/ares-cli-rs" latest: true @@ -32,7 +32,7 @@ jobs: run: sudo apt-get -yq install ./temp/*.deb - name: Download webOS NDK - uses: robinraju/release-downloader@v1.9 + uses: robinraju/release-downloader@v1.11 with: repository: "openlgtv/buildroot-nc4" latest: true diff --git a/Makefile.common b/Makefile.common index 2a715f4786a2..17c5e401853d 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1305,6 +1305,9 @@ ifeq ($(HAVE_X11), 1) ifeq ($(HAVE_XCB),1) LIBS += -lX11-xcb endif + ifeq ($(HAVE_XSCRNSAVER),1) + LIBS += -lXss + endif ifneq ($(HAVE_OPENGLES), 1) OBJ += gfx/drivers_context/x_ctx.o endif diff --git a/audio/common/alsa.c b/audio/common/alsa.c index f1b011a2e8e5..445ecb2017d2 100644 --- a/audio/common/alsa.c +++ b/audio/common/alsa.c @@ -19,8 +19,9 @@ #include #include +#include "alsa.h" + #include "../audio_driver.h" -#include "../common/alsa.h" #include "../../verbosity.h" int alsa_init_pcm(snd_pcm_t **pcm, diff --git a/audio/common/alsa.h b/audio/common/alsa.h index d459c21c746e..013a4e7103a3 100644 --- a/audio/common/alsa.h +++ b/audio/common/alsa.h @@ -18,8 +18,9 @@ #define _RETROARCH_ALSA #include -#include "queues/fifo_queue.h" -#include "rthreads/rthreads.h" +#include +#include + /* Header file for common functions that are used by alsa and alsathread. */ /** diff --git a/audio/common/alsathread.h b/audio/common/alsathread.h index dafa5be8e050..b137b1fff692 100644 --- a/audio/common/alsathread.h +++ b/audio/common/alsathread.h @@ -19,9 +19,9 @@ #include #include -#include "queues/fifo_queue.h" -#include "rthreads/rthreads.h" -#include "./alsa.h" +#include +#include +#include "alsa.h" typedef struct alsa_thread_info { diff --git a/audio/common/mmdevice_common.c b/audio/common/mmdevice_common.c index 6801693b907e..c0c14979ddb8 100644 --- a/audio/common/mmdevice_common.c +++ b/audio/common/mmdevice_common.c @@ -21,7 +21,6 @@ #include "mmdevice_common.h" #include "mmdevice_common_inline.h" - char* mmdevice_name(IMMDevice *device) { HRESULT hr; diff --git a/audio/common/wasapi.c b/audio/common/wasapi.c index b94a3ed20ec9..639dda79d8e3 100644 --- a/audio/common/wasapi.c +++ b/audio/common/wasapi.c @@ -15,17 +15,18 @@ */ #include "wasapi.h" -#include #ifdef HAVE_MICROPHONE -#include "audio/microphone_driver.h" +#include "../microphone_driver.h" #endif -#include "queues/fifo_queue.h" -#include "lists/string_list.h" -#include "configuration.h" -#include "verbosity.h" -#include "string/stdstring.h" +#include +#include +#include + #include "mmdevice_common.h" +#include "../../configuration.h" +#include "../../verbosity.h" + const char *hresult_name(HRESULT hr) { switch (hr) diff --git a/audio/common/wasapi.h b/audio/common/wasapi.h index 9393e2a01ed7..154313ab36b7 100644 --- a/audio/common/wasapi.h +++ b/audio/common/wasapi.h @@ -23,8 +23,8 @@ #ifndef RETROARCH_COMMON_WASAPI_H #define RETROARCH_COMMON_WASAPI_H -#include "../common/mmdevice_common_inline.h" -#include "boolean.h" +#include "mmdevice_common_inline.h" +#include /* Shared buffer size replacement placeholders */ #define WASAPI_SH_BUFFER_AUDIO_LATENCY 0 @@ -37,4 +37,4 @@ 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 */ \ No newline at end of file +#endif /* RETROARCH_COMMON_WASAPI_H */ diff --git a/audio/microphone_driver.c b/audio/microphone_driver.c index f5a667cf86f0..7174311495a5 100644 --- a/audio/microphone_driver.c +++ b/audio/microphone_driver.c @@ -19,6 +19,7 @@ #include