Skip to content

Commit 43a3573

Browse files
Merge branch 'libretro:master' into master
2 parents 6aff67b + 158ad0c commit 43a3573

File tree

169 files changed

+4694
-6472
lines changed

Some content is hidden

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

169 files changed

+4694
-6472
lines changed

.github/workflows/webOS.yml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ name: CI webOS
22

33
on:
44
push:
5+
tags-ignore:
6+
- '*'
7+
branches:
8+
- '*'
59
pull_request:
10+
release:
11+
types: [ published ]
612
repository_dispatch:
7-
types: [run_build]
8-
9-
permissions:
10-
contents: read
13+
types: [ run_build ]
1114

1215
env:
16+
PACKAGE_NAME: com.retroarch.webos
1317
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
1418

1519
jobs:
@@ -28,6 +32,14 @@ jobs:
2832
fileName: "ares-package_*.deb"
2933
out-file-path: "temp"
3034

35+
- name: Download Manifest Generator
36+
uses: robinraju/release-downloader@v1.9
37+
with:
38+
repository: "webosbrew/dev-toolbox-cli"
39+
latest: true
40+
fileName: "webosbrew-toolbox-gen-manifest_*.deb"
41+
out-file-path: "temp"
42+
3143
- name: Update packages
3244
run: sudo apt-get -yq update
3345

@@ -50,6 +62,38 @@ jobs:
5062
./arm-webos-linux-gnueabi_sdk-buildroot/relocate-sdk.sh
5163
5264
- name: Compile RA
65+
shell: bash
5366
run: |
5467
. /tmp/arm-webos-linux-gnueabi_sdk-buildroot/environment-setup
55-
make -f Makefile.webos ADD_SDL2_LIB=1 -j$(getconf _NPROCESSORS_ONLN) info all
68+
make -f Makefile.webos ipk PACKAGE_NAME=${PACKAGE_NAME} ADD_SDL2_LIB=1 -j$(getconf _NPROCESSORS_ONLN)
69+
70+
- name: Get short SHA
71+
id: slug
72+
run: echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
73+
74+
- uses: actions/upload-artifact@v4
75+
with:
76+
name: com.retroarch.webos_${{ steps.slug.outputs.sha8 }}_arm.ipk
77+
path: |
78+
webos/*.ipk
79+
80+
- name: Generate Manifest
81+
shell: bash
82+
run: |
83+
. version.all
84+
webosbrew-gen-manifest -o webos/${PACKAGE_NAME}.manifest.json \
85+
-p webos/${PACKAGE_NAME}_${RARCH_VERSION}_arm.ipk \
86+
-i https://github.com/webosbrew/RetroArch/raw/webos/webos/icon160.png \
87+
-l https://github.com/webosbrew/RetroArch
88+
89+
- name: Release
90+
if: github.event_name == 'release'
91+
uses: ncipollo/release-action@v1
92+
with:
93+
token: ${{ secrets.GITHUB_TOKEN }}
94+
tag: ${{ github.event.release.tag_name }}
95+
allowUpdates: true
96+
omitNameDuringUpdate: true
97+
omitBody: true
98+
omitPrereleaseDuringUpdate: true
99+
artifacts: webos/*.ipk,webos/*.manifest.json

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ gfx/common/wayland/content-type-v1.h
241241
gfx/common/wayland/content-type-v1.c
242242
gfx/common/wayland/single-pixel-buffer-v1.h
243243
gfx/common/wayland/single-pixel-buffer-v1.c
244+
gfx/common/wayland/xdg-toplevel-icon-v1.h
245+
gfx/common/wayland/xdg-toplevel-icon-v1.c
244246

245247
# libretro-common samples
246248
libretro-common/samples/streams/rzip/rzip

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Future
2+
- EMSCRIPTEN: Support suspend screensaver
3+
- EMSCRIPTEN/RWEBCAM: Fix camera driver
4+
- EMSCRIPTEN/RWEBINPUT: Add accelerometer/gyroscope support
5+
- EMSCRIPTEN/RWEBPAD: Add rumble support
6+
- EMSCRIPTEN/RWEBAUDIO: Rewrite driver, set as default audio driver
27

38
# 1.21.0
49
- 3DS: Fix unique IDs for newer cores

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ else
4545
OBJDIR := $(OBJDIR_BASE)/release
4646
CFLAGS ?= -O3
4747
CXXFLAGS ?= -O3
48-
DEF_FLAGS += -ffast-math
4948
endif
5049

5150
DEF_FLAGS += -Wall -Wsign-compare

Makefile.common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,7 @@ ifeq ($(HAVE_WAYLAND), 1)
12841284
gfx/common/wayland_common.o \
12851285
gfx/common/wayland/fractional-scale-v1.o \
12861286
gfx/common/wayland/viewporter.o \
1287+
gfx/common/wayland/xdg-toplevel-icon-v1.o \
12871288
gfx/common/wayland/xdg-shell.o \
12881289
gfx/common/wayland/idle-inhibit-unstable-v1.o \
12891290
gfx/common/wayland/xdg-decoration-unstable-v1.o \

Makefile.ctr

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,7 @@ LIBDIRS := -L. -L$(CTRULIB)/lib
154154

155155
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft
156156

157-
CFLAGS += -mword-relocations \
158-
-ffast-math \
159-
$(ARCH)
160-
161-
#CFLAGS += -Wall
157+
CFLAGS += -mword-relocations $(ARCH)
162158
CFLAGS += -DARM11 -D_3DS
163159

164160
ifeq ($(strip $(USE_CTRULIB_2)),1)
@@ -202,7 +198,7 @@ CFLAGS += -Werror=implicit-function-declaration
202198

203199
ASFLAGS := -g $(ARCH) -O3
204200
LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
205-
CFLAGS += -std=gnu99 -ffast-math
201+
CFLAGS += -std=gnu99
206202

207203
LIB_CORE :=
208204
LIB_CORE_FULL :=

Makefile.ctr.salamander

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,7 @@ LIBDIRS := -L. -L$(CTRULIB)/lib
8383

8484
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft
8585

86-
CFLAGS += -mword-relocations \
87-
-fomit-frame-pointer -ffast-math \
88-
$(ARCH)
89-
90-
#CFLAGS += -Wall
86+
CFLAGS += -mword-relocations -fomit-frame-pointer $(ARCH)
9187
CFLAGS += -DARM11 -D_3DS
9288

9389
ifeq ($(strip $(USE_CTRULIB_2)),1)
@@ -115,7 +111,7 @@ CFLAGS += -Werror=implicit-function-declaration
115111
ASFLAGS := -g $(ARCH) -O3
116112
LDFLAGS += -specs=ctr/3dsx_custom.specs -g $(ARCH) -Wl,-Map,$(notdir $*.map)
117113

118-
CFLAGS += -std=gnu99 -ffast-math
114+
CFLAGS += -std=gnu99
119115

120116
LIBS := -lctru -lm
121117

Makefile.dingux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ OPK_NAME = retroarch.opk
107107

108108
OBJ :=
109109
LINK := $(CXX)
110-
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -ffast-math -fomit-frame-pointer
110+
DEF_FLAGS := -march=mips32 -mtune=mips32r2 -mhard-float -fomit-frame-pointer
111111
DEF_FLAGS += -mplt -mno-shared
112112
DEF_FLAGS += -ffunction-sections -fdata-sections
113113
DEF_FLAGS += -I. -Ideps -Ideps/stb -DDINGUX=1 -MMD

Makefile.dos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ APP_ICON := pkg/libnx/retroarch.jpg
120120
#---------------------------------------------------------------------------------
121121
ARCH :=
122122

123-
CFLAGS := -g -Wall -O3 -fcommon -ffast-math -ffunction-sections \
123+
CFLAGS := -g -Wall -O3 -fcommon -ffunction-sections \
124124
$(ARCH) $(DEFINES) $(INCLUDE_DIRS)
125125

126126
CFLAGS += $(INCLUDE)

Makefile.emscripten

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ TARGET_BASE := $(subst .js,,$(TARGET))
1111

1212
OS = Emscripten
1313
OBJ :=
14-
DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN -DEMSCRIPTEN -DNO_CANVAS_RESIZE
14+
DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN -DEMSCRIPTEN
1515
DEFINES += -DHAVE_FILTERS_BUILTIN -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_UPDATE_CORE_INFO
1616

1717
HAVE_PATCH = 1
@@ -27,7 +27,7 @@ HAVE_GLSL = 1
2727
HAVE_SCREENSHOTS = 1
2828
HAVE_REWIND = 1
2929
HAVE_AUDIOMIXER = 1
30-
HAVE_CC_RESAMPLER = 1
30+
HAVE_CC_RESAMPLER ?= 1
3131
HAVE_EGL ?= 0
3232
HAVE_OPENGLES = 1
3333
HAVE_RJPEG = 0
@@ -54,27 +54,21 @@ HAVE_BSV_MOVIE = 1
5454
HAVE_CHD ?= 0
5555
HAVE_NETPLAYDISCOVERY ?= 0
5656

57-
HAVE_AL ?= 1
58-
5957
# enables pthreads, requires special headers on the web server:
6058
# see https://web.dev/articles/coop-coep
6159
HAVE_THREADS ?= 0
6260

6361
# requires HAVE_THREADS
6462
HAVE_AUDIOWORKLET ?= 0
6563

66-
# WARNING -- READ BEFORE ENABLING
67-
# The rwebaudio driver is known to have several audio bugs, such as
68-
# minor crackling, or the entire page freezing/crashing.
69-
# It works perfectly on chrome, but even firefox has really bad audio quality.
70-
# I should also note, the driver on iOS is completely broken (crashes the page).
71-
# You have been warned.
72-
HAVE_RWEBAUDIO ?= 0
73-
74-
# whether the browser thread is allowed to block to wait for audio to play,
75-
# may lead to the issues mentioned above.
76-
# currently this variable is only used by audioworklet;
77-
# rwebaudio will always busywait and openal will never busywait.
64+
# doesn't work on PROXY_TO_PTHREAD
65+
HAVE_RWEBAUDIO ?= 1
66+
67+
# requires ASYNC or PROXY_TO_PTHREAD
68+
HAVE_AL ?= 0
69+
70+
# whether the browser thread is allowed to block to wait for audio to play, not CPU usage-friendly!
71+
# currently this variable is only used by rwebaudio and audioworklet; openal will never busywait.
7872
ALLOW_AUDIO_BUSYWAIT ?= 0
7973

8074
# minimal asyncify; better performance than full asyncify,
@@ -106,6 +100,9 @@ ASYNC ?= 0
106100
LTO ?= 0
107101
PTHREAD_POOL_SIZE ?= 4
108102

103+
ASYNCIFY_ADD ?= dynCall_*,emscripten_mainloop
104+
ASYNCIFY_REMOVE ?= threaded_worker
105+
109106
STACK_SIZE ?= 4194304
110107
INITIAL_HEAP ?= 134217728
111108

@@ -123,7 +120,7 @@ INITIAL_HEAP ?= 134217728
123120

124121
OBJDIR := obj-emscripten
125122

126-
EXPORTED_FUNCTIONS = _main,_malloc,_free,_cmd_savefiles,_cmd_save_state,_cmd_load_state,_cmd_undo_save_state,_cmd_undo_load_state,_cmd_take_screenshot,\
123+
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,\
127124
_cmd_toggle_menu,_cmd_reload_config,_cmd_toggle_grab_mouse,_cmd_toggle_game_focus,_cmd_reset,_cmd_toggle_pause,_cmd_pause,_cmd_unpause,\
128125
_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,\
129126
_cmd_cheat_get_size,_cmd_cheat_apply_cheats,EmscriptenSendCommand,EmscriptenReceiveCommandReply
@@ -168,7 +165,7 @@ LDFLAGS := -L. --no-heap-copy -s STACK_SIZE=$(STACK_SIZE) -s INITIAL_MEMORY=$(IN
168165
-s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS="$(EXPORTED_FUNCTIONS)" \
169166
-s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="libretro_$(subst -,_,$(LIBRETRO))" \
170167
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 \
171-
-s ENVIRONMENT=web,worker \
168+
-s ENVIRONMENT=web,worker -s WASM_BIGINT=1 \
172169
--extern-pre-js emscripten/pre.js \
173170
--js-library emscripten/library_rwebcam.js \
174171
--js-library emscripten/library_platform_emscripten.js
@@ -193,6 +190,9 @@ endif
193190
ifeq ($(HAVE_RWEBAUDIO), 1)
194191
LDFLAGS += --js-library emscripten/library_rwebaudio.js
195192
DEFINES += -DHAVE_RWEBAUDIO
193+
ifeq ($(PROXY_TO_PTHREAD), 1)
194+
$(error ERROR: RWEBAUDIO is incompatible with PROXY_TO_PTHREAD)
195+
endif
196196
endif
197197

198198
ifeq ($(HAVE_AUDIOWORKLET), 1)
@@ -202,18 +202,24 @@ ifeq ($(HAVE_AUDIOWORKLET), 1)
202202
ifeq ($(HAVE_THREADS), 0)
203203
$(error ERROR: AUDIOWORKLET requires HAVE_THREADS)
204204
endif
205-
ifeq ($(PROXY_TO_PTHREAD), 1)
206-
else ifeq ($(ASYNC), 1)
205+
endif
206+
207+
ifeq ($(HAVE_AL), 1)
208+
LDFLAGS += -lopenal
209+
DEFINES += -DHAVE_AL
210+
endif
211+
212+
ifeq ($(PROXY_TO_PTHREAD), 1)
213+
else ifeq ($(ASYNC), 1)
214+
else
215+
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_BLOCK
216+
ifeq ($(MIN_ASYNC), 1)
217+
DEFINES += -DEMSCRIPTEN_AUDIO_ASYNC_BLOCK
207218
else
208-
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_BLOCK
209-
ifeq ($(MIN_ASYNC), 1)
210-
DEFINES += -DEMSCRIPTEN_AUDIO_ASYNC_BLOCK
211-
else
212-
DEFINES += -DEMSCRIPTEN_AUDIO_FAKE_BLOCK
213-
endif
214-
ifneq ($(ALLOW_AUDIO_BUSYWAIT), 1)
215-
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
216-
endif
219+
DEFINES += -DEMSCRIPTEN_AUDIO_FAKE_BLOCK
220+
endif
221+
ifneq ($(ALLOW_AUDIO_BUSYWAIT), 1)
222+
DEFINES += -DEMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK
217223
endif
218224
endif
219225

@@ -224,23 +230,18 @@ endif
224230
# explanation of some of these defines:
225231
# EMSCRIPTEN_AUDIO_EXTERNAL_BLOCK: audio blocking occurs in the main loop instead of in the audio driver functions.
226232
# EMSCRIPTEN_AUDIO_EXTERNAL_WRITE_BLOCK: along with above, enables external blocking in the write function.
227-
# ALLOW_AUDIO_BUSYWAIT: write function will busywait. init function may still use an external block.
233+
# EMSCRIPTEN_AUDIO_BUSYWAIT: write function will busywait. init function may still use an external block.
228234
# EMSCRIPTEN_AUDIO_ASYNC_BLOCK: external block uses emscripten_sleep (requires MIN_ASYNC).
229235
# EMSCRIPTEN_AUDIO_FAKE_BLOCK: external block uses main loop timing (doesn't require asyncify).
230236
# when building with either PROXY_TO_PTHREAD or ASYNC (full asyncify), none of the above are required.
231237

232-
ifeq ($(HAVE_AL), 1)
233-
LDFLAGS += -lopenal
234-
DEFINES += -DHAVE_AL
235-
endif
236-
237238
ifeq ($(HAVE_THREADS), 1)
238239
LDFLAGS += -pthread -s PTHREAD_POOL_SIZE=$(PTHREAD_POOL_SIZE)
239240
CFLAGS += -pthread -s SHARED_MEMORY
240241
endif
241242

242243
ifeq ($(WASM_WORKERS), 1)
243-
LDFLAGS += -s WASM_WORKERS=2
244+
LDFLAGS += -s WASM_WORKERS=1
244245
endif
245246

246247
ifeq ($(ASYNC), 1)
@@ -251,7 +252,7 @@ ifeq ($(ASYNC), 1)
251252
endif
252253
else ifeq ($(MIN_ASYNC), 1)
253254
DEFINES += -DEMSCRIPTEN_ASYNCIFY -DEMSCRIPTEN_MIN_ASYNCIFY
254-
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192 -s ASYNCIFY_IGNORE_INDIRECT=1 -s ASYNCIFY_ADD='dynCall_*,emscripten_mainloop' -s ASYNCIFY_REMOVE='threaded_worker'
255+
LDFLAGS += -s ASYNCIFY=1 -s ASYNCIFY_STACK_SIZE=8192 -s ASYNCIFY_IGNORE_INDIRECT=1 -s ASYNCIFY_ADD='$(ASYNCIFY_ADD)' -s ASYNCIFY_REMOVE='$(ASYNCIFY_REMOVE)'
255256
ifeq ($(DEBUG), 1)
256257
LDFLAGS += -s ASYNCIFY_ADVISE #-s ASYNCIFY_DEBUG=1
257258
endif
@@ -297,21 +298,11 @@ all: $(TARGET)
297298
$(libretro_new): ;
298299

299300
mv_libretro:
300-
mv -f $(libretro) $(libretro_new) || true
301+
$(Q)mv -f $(libretro) $(libretro_new) || true
301302

302-
# until emscripten adds something like WASM_WORKERS=2 but for audio worklets, DIY.
303-
ifeq ($(HAVE_AUDIOWORKLET), 1)
304303
$(TARGET): $(RARCH_OBJ) $(libretro_new) mv_libretro
305304
@$(if $(Q), $(shell echo echo "LD $@ \<obj\> $(libretro_new) $(LIBS) $(LDFLAGS)"),)
306305
$(Q)$(LD) -o $@ $(RARCH_OBJ) $(libretro_new) $(LIBS) $(LDFLAGS)
307-
$(Q)tr -d '\n' < "$(TARGET_BASE).aw.js" | sed -e "s/[\/&]/\\\\&/g" -e "s/'/\\\\\\\\&/g" > _audioworklet.js
308-
$(Q)sed -i.bak -e "s/\"$(TARGET_BASE)\.aw\.js\"/URL.createObjectURL(new Blob(['$$(cat _audioworklet.js)'],{type:'text\/javascript'}))/" -- "$@"
309-
$(Q)rm -f "$(TARGET_BASE).aw.js" _audioworklet.js "$@".bak
310-
else
311-
$(TARGET): $(RARCH_OBJ) $(libretro_new) mv_libretro
312-
@$(if $(Q), $(shell echo echo "LD $@ \<obj\> $(libretro_new) $(LIBS) $(LDFLAGS)"),)
313-
$(Q)$(LD) -o $@ $(RARCH_OBJ) $(libretro_new) $(LIBS) $(LDFLAGS)
314-
endif
315306

316307
$(OBJDIR)/%.o: %.c
317308
@mkdir -p $(dir $@)

0 commit comments

Comments
 (0)