Skip to content

Commit e60b81c

Browse files
authored
Merge branch 'libretro:master' into master
2 parents f1db3f9 + 367d2ee commit e60b81c

File tree

272 files changed

+11118
-4309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

272 files changed

+11118
-4309
lines changed

.github/workflows/MSYS2.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,21 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
sys: [MINGW64, UCRT64,CLANG64]
18-
runs-on: windows-latest
17+
include:
18+
# Existing x64 builds
19+
- sys: MINGW64
20+
runner: windows-latest
21+
- sys: UCRT64
22+
runner: windows-latest
23+
- sys: CLANG64
24+
runner: windows-latest
25+
26+
# New ARM64 build (native Windows on ARM)
27+
- sys: CLANGARM64
28+
runner: windows-11-arm
29+
30+
runs-on: ${{ matrix.runner }}
31+
1932
steps:
2033
- name: Checkout repository
2134
uses: actions/checkout@v4
@@ -25,7 +38,9 @@ jobs:
2538
with:
2639
msystem: ${{ matrix.sys }}
2740
update: true
28-
install: base-devel git
41+
install: >-
42+
base-devel
43+
git
2944
pacboy: >-
3045
gettext:p
3146
gobject-introspection:p
@@ -57,17 +72,18 @@ jobs:
5772
- name: Configure and build RetroArch
5873
shell: msys2 {0}
5974
run: |
60-
echo "Building RetroArch in ${{ matrix.sys }} environment"
75+
echo "Building RetroArch in ${{ matrix.sys }} on ${{ matrix.runner }}"
6176
./configure
62-
make -j$(nproc) info all
77+
make -j"$(nproc)" info all
6378
6479
- name: Collect DLLs and binaries
6580
shell: msys2 {0}
6681
run: |
6782
echo "Collecting DLLs and binaries"
83+
rm -rf dist
6884
mkdir -p dist
6985
cp retroarch.exe dist/
70-
ldd retroarch.exe|grep $MINGW_PREFIX |awk '{print $3}'|xargs -I {} cp {} dist/
86+
ldd retroarch.exe | grep "$MINGW_PREFIX" | awk '{print $3}' | xargs -I {} cp {} dist/ || true
7187
7288
- name: Archive build artifacts
7389
if: success()
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI Windows ARM64 (MSVC)
2+
3+
on:
4+
push:
5+
pull_request:
6+
repository_dispatch:
7+
types: [run_build]
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
14+
15+
jobs:
16+
msvc:
17+
runs-on: windows-11-arm
18+
strategy:
19+
matrix:
20+
version: [2022]
21+
configuration: [Debug, Release]
22+
platform: [ARM64]
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Add msbuild to PATH
28+
uses: microsoft/setup-msbuild@v1
29+
30+
- name: Compile RA
31+
working-directory: "${{ github.workspace }}/pkg/msvc"
32+
run: |
33+
msbuild -p:"Configuration=${{ matrix.configuration }}" -p:"Platform=${{ matrix.platform }}" .\RetroArch-msvc${{ matrix.version }}.sln
34+
35+
- name: Get short SHA
36+
id: slug
37+
shell: powershell
38+
run: echo "sha8=$('${{ github.sha }}'.Substring(0,8))" >> $env:GITHUB_OUTPUT
39+
40+
- uses: actions/upload-artifact@v4
41+
with:
42+
name: retroarch-${{ matrix.version }}-${{ matrix.configuration }}-${{ matrix.platform }}-${{ steps.slug.outputs.sha8 }}
43+
path: |
44+
pkg/msvc/${{ matrix.platform }}/${{ matrix.configuration }}/RetroArch-msvc${{ matrix.version }}.exe

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,14 @@ gfx/common/wayland/single-pixel-buffer-v1.h
242242
gfx/common/wayland/single-pixel-buffer-v1.c
243243
gfx/common/wayland/xdg-toplevel-icon-v1.h
244244
gfx/common/wayland/xdg-toplevel-icon-v1.c
245+
gfx/common/wayland/webos-foreign.c
246+
gfx/common/wayland/webos-foreign.h
247+
gfx/common/wayland/webos-input-manager.c
248+
gfx/common/wayland/webos-input-manager.h
249+
gfx/common/wayland/webos-shell.c
250+
gfx/common/wayland/webos-shell.h
251+
gfx/common/wayland/webos-surface-group.c
252+
gfx/common/wayland/webos-surface-group.h
245253

246254
# libretro-common samples
247255
libretro-common/samples/streams/rzip/rzip

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ build-retroarch-android-playstore-plus:
629629
mv .retroarch-precompiled/ retroarch-precompiled/
630630
631631
build-static-retroarch-libnx-aarch64:
632-
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:latest
632+
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:v4-10-0
633633
stage: prepare-for-static-cores
634634
before_script:
635635
- export NUMPROC=$(($(nproc)/3))
@@ -649,7 +649,7 @@ build-static-retroarch-libnx-aarch64:
649649
- "mv .retroarch-precompiled/ retroarch-precompiled/"
650650

651651
build-static-retroarch-dummy-libnx-aarch64:
652-
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:latest
652+
image: $CI_SERVER_HOST:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:v4-10-0
653653
stage: build
654654
variables:
655655
MEDIA_PATH: .media

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Future
2+
- EMSCRIPTEN: Added dice to core selection dropdown
23

34
# 1.22.1
45
- ANDROID: OnNewIntent handler to allow launchers start new content without closing first

Makefile.common

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ OBJ += \
278278
tasks/task_file_transfer.o \
279279
tasks/task_image.o \
280280
tasks/task_playlist_manager.o \
281-
tasks/task_manual_content_scan.o \
282281
tasks/task_core_backup.o \
283282
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
284283
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
@@ -1290,6 +1289,14 @@ ifeq ($(HAVE_WAYLAND), 1)
12901289
OBJ += gfx/drivers_context/wayland_vk_ctx.o
12911290
endif
12921291

1292+
ifeq ($(WEBOS), 1)
1293+
OBJ += input/common/wayland_common_webos.o
1294+
OBJ += gfx/common/wayland/webos-foreign.o
1295+
OBJ += gfx/common/wayland/webos-input-manager.o
1296+
OBJ += gfx/common/wayland/webos-shell.o
1297+
OBJ += gfx/common/wayland/webos-surface-group.o
1298+
endif
1299+
12931300
DEF_FLAGS += $(WAYLAND_CFLAGS) $(WAYLAND_CURSOR_CFLAGS)
12941301
LIBS += $(WAYLAND_LIBS) $(WAYLAND_CURSOR_LIBS)
12951302

Makefile.emscripten

Lines changed: 61 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TARGET_BASE := $(subst .js,,$(TARGET))
1212
OS = Emscripten
1313
OBJ :=
1414
DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN -DEMSCRIPTEN
15-
DEFINES += -DHAVE_FILTERS_BUILTIN -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORE_INFO
15+
DEFINES += -DHAVE_FILTERS_BUILTIN -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORE_INFO -DHAVE_STB_VORBIS
1616

1717
HAVE_STATESTREAM ?= 1
1818
HAVE_PATCH = 1
@@ -26,7 +26,8 @@ HAVE_UPDATE_ASSETS = 1
2626
HAVE_ONLINE_UPDATER = 1
2727
HAVE_GLSL = 1
2828
HAVE_SCREENSHOTS = 1
29-
HAVE_REWIND = 1
29+
HAVE_REWIND ?= 1
30+
HAVE_RUNAHEAD ?= 1
3031
HAVE_AUDIOMIXER = 1
3132
HAVE_CC_RESAMPLER ?= 1
3233
HAVE_EGL ?= 0
@@ -51,7 +52,7 @@ HAVE_CHEATS = 1
5152
HAVE_IBXM = 1
5253
HAVE_CORE_INFO_CACHE = 1
5354
HAVE_7ZIP = 1
54-
HAVE_BSV_MOVIE = 1
55+
HAVE_BSV_MOVIE ?= 1
5556
HAVE_CHD ?= 0
5657
HAVE_NETPLAYDISCOVERY ?= 0
5758

@@ -65,39 +66,55 @@ HAVE_AUDIOWORKLET ?= 0
6566
# doesn't work on PROXY_TO_PTHREAD
6667
HAVE_RWEBAUDIO ?= 1
6768

68-
# requires ASYNC or PROXY_TO_PTHREAD
69+
# requires ASYNC or PROXY_TO_PTHREAD. Prefer another driver.
6970
HAVE_AL ?= 0
7071

7172
# whether the browser thread is allowed to block to wait for audio to play, not CPU usage-friendly!
7273
# currently this variable is only used by rwebaudio and audioworklet; openal will never busywait.
7374
ALLOW_AUDIO_BUSYWAIT ?= 0
7475

75-
# minimal asyncify; better performance than full asyncify,
76-
# but sleeping on the main thread is only possible in some places.
76+
# asyncify: enable fibers and sleeping on the browser thread,
77+
# this has a noticeable impact on compile time, output wasm size, and speed.
78+
# see https://emscripten.org/docs/porting/asyncify.html for more info
79+
ASYNC ?= 0
80+
81+
# minimal asyncify: better performance than full asyncify,
82+
# but sleeping on the browser thread is only possible in some places.
7783
MIN_ASYNC ?= 0
7884

79-
# runs RetroArch on a pthread instead of the browser thread; requires HAVE_THREADS
85+
# JSPI: experimental asyncify alternative, see https://webassembly.org/features/
86+
# currently (emscripten 4.0.15) this requires a patched emscripten toolchain.
87+
JSPI ?= 0
88+
89+
# runs RetroArch on a pthread instead of the browser thread; implies HAVE_THREADS
8090
PROXY_TO_PTHREAD ?= 0
8191

8292
# recommended FS when using HAVE_THREADS
8393
HAVE_WASMFS ?= 0
8494

85-
# enables OPFS (origin private file system) and FETCHFS, requires PROXY_TO_PTHREAD
95+
# enables OPFS (origin private file system) and FETCHFS, requires PROXY_TO_PTHREAD or JSPI
8696
HAVE_EXTRA_WASMFS ?= 0
8797

98+
# use the closure compiler to further minify output JS
99+
CLOSURE_COMPILER ?= 0
100+
88101
# enable javascript filesystem tracking, incompatible with HAVE_WASMFS
89102
FS_DEBUG ?= 0
90103

91104
# help diagnose GL problems (can cause issues in normal operation)
92105
GL_DEBUG ?= 0
93106

94-
# does nothing on its own, but automatically selected by some other options
95-
WASM_WORKERS = 0
107+
# enable runtime assertions (always enabled in debug builds)
108+
# please use this when testing new emscripten-specific features!
109+
ASSERTIONS ?= 0
96110

97-
HAVE_OPENGLES ?= 1
111+
# enable GLES 3.0 (WebGL 2).
112+
# if left disabled, GLES 2.0 (WebGL 1) will be used.
98113
HAVE_OPENGLES3 ?= 0
99114

100-
ASYNC ?= 0
115+
# does nothing on its own, but automatically selected by some other options
116+
WASM_WORKERS = 0
117+
101118
LTO ?= 0
102119
PTHREAD_POOL_SIZE ?= 4
103120

@@ -136,7 +153,10 @@ ifeq ($(HAVE_EXTRA_WASMFS), 1)
136153
DEFINES += -DHAVE_EXTRA_WASMFS
137154
override HAVE_WASMFS = 1
138155
ifeq ($(PROXY_TO_PTHREAD), 0)
139-
$(error ERROR: HAVE_EXTRA_WASMFS requires PROXY_TO_PTHREAD)
156+
# note: currently HAVE_EXTRA_WASMFS+JSPI requires ASSERTIONS to be turned off
157+
ifeq ($(JSPI), 0)
158+
$(error ERROR: HAVE_EXTRA_WASMFS requires PROXY_TO_PTHREAD or JSPI)
159+
endif
140160
endif
141161
endif
142162

@@ -154,6 +174,7 @@ ifeq ($(PROXY_TO_PTHREAD), 1)
154174
override STACK_SIZE = 4194304
155175
else ifeq ($(HAVE_AL), 1)
156176
override ASYNC = 1
177+
override MIN_ASYNC = 0
157178
endif
158179

159180
ifeq ($(HAVE_SDL2), 1)
@@ -167,7 +188,7 @@ LDFLAGS := -L. --no-heap-copy -s STACK_SIZE=$(STACK_SIZE) -s INITIAL_MEMORY=$(IN
167188
-s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="libretro_$(subst -,_,$(LIBRETRO))" \
168189
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 \
169190
-s ENVIRONMENT=web,worker -s WASM_BIGINT=1 \
170-
--extern-pre-js emscripten/pre.js \
191+
--extern-pre-js emscripten/extern_pre.js \
171192
--js-library emscripten/library_rwebcam.js \
172193
--js-library emscripten/library_platform_emscripten.js
173194

@@ -181,7 +202,6 @@ endif
181202

182203
ifeq ($(GL_DEBUG), 1)
183204
LDFLAGS += -s GL_ASSERTIONS=1 -s GL_DEBUG=1
184-
DEFINES += -DHAVE_GL_DEBUG_ES=1
185205
endif
186206

187207
ifeq ($(FS_DEBUG), 1)
@@ -211,6 +231,7 @@ ifeq ($(HAVE_AL), 1)
211231
endif
212232

213233
ifeq ($(PROXY_TO_PTHREAD), 1)
234+
else ifeq ($(JSPI), 1)
214235
else ifeq ($(ASYNC), 1)
215236
else
216237
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_BLOCK
@@ -245,18 +266,26 @@ ifeq ($(WASM_WORKERS), 1)
245266
LDFLAGS += -s WASM_WORKERS=1
246267
endif
247268

248-
ifeq ($(ASYNC), 1)
249-
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_FULL_ASYNCIFY
250-
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192
251-
ifeq ($(DEBUG), 1)
252-
#LDFLAGS += -s ASYNCIFY_DEBUG=1 # broken?
253-
endif
269+
ifeq ($(JSPI), 1)
270+
CFLAGS += -fwasm-exceptions
271+
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_FULL_ASYNCIFY -DEMSCRIPTEN_JSPI
272+
LDFLAGS += -s JSPI=1 -fwasm-exceptions
254273
else ifeq ($(MIN_ASYNC), 1)
255274
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_MIN_ASYNCIFY
256275
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192 -s ASYNCIFY_IGNORE_INDIRECT=1 -s ASYNCIFY_ADD='$(ASYNCIFY_ADD)' -s ASYNCIFY_REMOVE='$(ASYNCIFY_REMOVE)'
257276
ifeq ($(DEBUG), 1)
258277
LDFLAGS += -s ASYNCIFY_ADVISE #-s ASYNCIFY_DEBUG=1
259278
endif
279+
else ifeq ($(ASYNC), 1)
280+
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_FULL_ASYNCIFY
281+
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192
282+
ifeq ($(DEBUG), 1)
283+
#LDFLAGS += -s ASYNCIFY_DEBUG=1 # broken?
284+
endif
285+
endif
286+
287+
ifeq ($(CLOSURE_COMPILER), 1)
288+
LDFLAGS += --closure 1 --closure-args=--externs=emscripten/closure_externs.js --post-js emscripten/closure_post.js
260289
endif
261290

262291
include Makefile.common
@@ -281,9 +310,15 @@ ifneq ($(V), 1)
281310
endif
282311

283312
ifeq ($(DEBUG), 1)
284-
LDFLAGS += -O0 -g -gsource-map -s SAFE_HEAP=2 -s STACK_OVERFLOW_CHECK=2 -s ASSERTIONS=1
313+
LDFLAGS += -O0 -g -gsource-map -s STACK_OVERFLOW_CHECK=2
285314
# -O0 in cflags gives "too many locals" errors
286315
CFLAGS += -O1 -g -gsource-map
316+
override ASSERTIONS = 1
317+
# "WASM_WORKERS is not currently compatible with `-fsanitize` tools"
318+
ifeq ($(WASM_WORKERS), 0)
319+
CFLAGS += -fsanitize=undefined
320+
LDFLAGS += -fsanitize=undefined
321+
endif
287322
else
288323
LDFLAGS += -O3
289324
# WARNING: some optimizations can break some cores (ex: LTO breaks tyrquake)
@@ -293,6 +328,10 @@ else
293328
CFLAGS += -O3
294329
endif
295330

331+
ifneq ($(ASSERTIONS), 0)
332+
LDFLAGS += -s ASSERTIONS=$(ASSERTIONS)
333+
endif
334+
296335
CFLAGS += -Wall -I. -Ilibretro-common/include -Ideps/7zip -std=gnu99
297336

298337
RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))

Makefile.libnx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ HAVE_CHD = 1
5757
HAVE_STB_VORBIS = 1
5858
HAVE_IBXM = 1
5959
HAVE_CORE_INFO_CACHE = 1
60-
HAVE_CLOUD_SYNC = 1
60+
HAVE_CLOUDSYNC = 1
6161
HAVE_SSL = 1
6262

6363
# RetroArch libnx useful flags

Makefile.vita

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ else
9595
HAVE_LIBRETRODB := 1
9696
HAVE_CC_RESAMPLER := 1
9797
HAVE_CHEEVOS := 1
98+
HAVE_CLOUDSYNC := 1
9899
HAVE_RUNAHEAD := 1
99100
RARCH_CONSOLE := 1
100101
HAVE_STATIC_VIDEO_FILTERS = 1

0 commit comments

Comments
 (0)