Skip to content

Commit

Permalink
Merge branch 'libretro:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
TheRhysWyrill authored Feb 24, 2025
2 parents 0b30e83 + c413bcc commit c50354a
Show file tree
Hide file tree
Showing 291 changed files with 18,567 additions and 14,354 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/PS3-PSL1GHT.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI PS3/PSL1GHT

on:
push:
pull_request:
repository_dispatch:
types: [run_build]

permissions:
contents: read

env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
build:
runs-on: ubuntu-latest
container:
image: git.libretro.com:5050/libretro-infrastructure/libretro-build-psl1ght:latest
options: --user root

steps:
- uses: actions/checkout@v3

- name: Compile Salamander
run: |
make -f Makefile.psl1ght.salamander -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.psl1ght.salamander -j$(getconf _NPROCESSORS_ONLN)
- name: Compile RA
run: |
make -f Makefile.psl1ght -j$(getconf _NPROCESSORS_ONLN) clean
make -f Makefile.psl1ght -j$(getconf _NPROCESSORS_ONLN) HAVE_STATIC_DUMMY=1
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"

- uses: actions/upload-artifact@v4
with:
name: RA-psl1ght-dummy-${{ steps.slug.outputs.sha8 }}
path: |
retroarch_psl1ght_salamander.elf
retroarch_psl1ght.elf
2 changes: 1 addition & 1 deletion AUTHORS.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ Mike Swanson (chungy)
mikeOSX
minucce
misson20000
Mohmoud (esoptron) (Hedonium)
esoptron
Monroe88
Morgane (MorganeAD)
mprobinson
Expand Down
25 changes: 21 additions & 4 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -923,13 +923,16 @@ endif

ifeq ($(HAVE_PIPEWIRE), 1)
OBJ += audio/drivers/pipewire.o \
audio/common/pipewire.o \
camera/drivers/pipewire.o
audio/common/pipewire.o

ifeq ($(HAVE_MICROPHONE), 1)
OBJ += audio/drivers_microphone/pipewire.o
endif

ifeq ($(HAVE_PIPEWIRE_STABLE), 1)
OBJ += camera/drivers/pipewire.o
endif

LIBS += $(PIPEWIRE_LIBS)
DEF_FLAGS += $(PIPEWIRE_CFLAGS)
endif
Expand Down Expand Up @@ -979,6 +982,12 @@ ifeq ($(HAVE_WINMM), 1)
LIBS += -lwinmm
endif

ifeq ($(HAVE_COREMIDI), 1)
OBJ += midi/drivers/coremidi.o
DEFINES += -DHAVE_COREMIDI
LIBS += -framework CoreMIDI
endif

# Audio Resamplers

ifeq ($(HAVE_NEON),1)
Expand Down Expand Up @@ -1527,7 +1536,10 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
endif

ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += gfx/drivers_context/emscriptenegl_ctx.o
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/drivers_context/emscriptenegl_ctx.o
endif
OBJ += gfx/drivers_context/emscriptenwebgl_ctx.o
endif

ifeq ($(HAVE_MALI_FBDEV), 1)
Expand Down Expand Up @@ -2194,11 +2206,16 @@ ifeq ($(HAVE_NETWORKING), 1)
$(LIBRETRO_COMM_DIR)/net/net_socket.o \
core_updater_list.o \
network/natt.o \
tasks/task_http.o \
tasks/task_netplay_lan_scan.o \
tasks/task_netplay_nat_traversal.o \
tasks/task_netplay_find_content.o

ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += tasks/task_http_emscripten.o
else
OBJ += tasks/task_http.o
endif

ifeq ($(HAVE_MENU), 1)
OBJ += tasks/task_pl_thumbnail_download.o
endif
Expand Down
105 changes: 72 additions & 33 deletions Makefile.emscripten
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ HAVE_PATCH = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_OVERLAY = 1
HAVE_NETWORKING = 1
HAVE_LIBRETRODB = 1
HAVE_COMPRESSION = 1
HAVE_UPDATE_ASSETS = 1
HAVE_ONLINE_UPDATER = 1
HAVE_GLSL = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_AUDIOMIXER = 1
HAVE_CC_RESAMPLER = 1
HAVE_EGL = 1
HAVE_EGL ?= 1
HAVE_OPENGLES = 1
HAVE_RJPEG = 0
HAVE_RPNG = 1
HAVE_EMSCRIPTEN = 1
Expand All @@ -48,6 +54,12 @@ HAVE_7ZIP = 1
HAVE_BSV_MOVIE = 1
HAVE_AL = 1
HAVE_CHD ?= 0
HAVE_WASMFS ?= 0
PROXY_TO_PTHREAD ?= 0
HAVE_NETPLAYDISCOVERY ?= 0

DEFINES += -DHAVE_NETWORKING -DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_ASSETS -DHAVE_COMPRESSION
DEFINES += -DHAVE_UPDATE_CORE_INFO

# WARNING -- READ BEFORE ENABLING
# The rwebaudio driver is known to have several audio bugs, such as
Expand All @@ -61,12 +73,12 @@ HAVE_RWEBAUDIO = 0
GL_DEBUG ?= 0

# enable javascript filesystem tracking
FS_DEBUG = 1
FS_DEBUG = 0

HAVE_OPENGLES ?= 1
HAVE_OPENGLES3 ?= 0

ASYNC ?= 0
ASYNC ?= 1
LTO ?= 0
PTHREAD ?= 0

Expand All @@ -90,63 +102,88 @@ OBJDIR := obj-emscripten
EXPORTED_FUNCTIONS = _main,_malloc,_free,_cmd_savefiles,_cmd_save_state,_cmd_load_state,_cmd_undo_save_state,_cmd_undo_load_state,_cmd_take_screenshot,\
_cmd_toggle_menu,_cmd_reload_config,_cmd_toggle_grab_mouse,_cmd_toggle_game_focus,_cmd_reset,_cmd_toggle_pause,_cmd_pause,_cmd_unpause,\
_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,\
_cmd_cheat_get_size,_cmd_cheat_apply_cheats
_cmd_cheat_get_size,_cmd_cheat_apply_cheats,EmscriptenSendCommand,EmscriptenReceiveCommandReply

EXPORTS := callMain,FS,PATH,ERRNO_CODES,ENV,stringToNewUTF8,UTF8ToString,Browser,GL,EmscriptenSendCommand,EmscriptenReceiveCommandReply

LIBS := -s USE_ZLIB=1
LDFLAGS := -L. --no-heap-copy -s $(LIBS) -s STACK_SIZE=$(STACK_SIZE) -s INITIAL_MEMORY=$(INITIAL_HEAP) \
-s EXPORTED_RUNTIME_METHODS=callMain,FS,PATH,ERRNO_CODES,stringToNewUTF8,UTF8ToString \
LIBS := -s USE_ZLIB=1 -lbrowser.js

ifeq ($(HAVE_WASMFS), 1)
DEFINES += -DHAVE_WASMFS=1
LIBS += -sWASMFS -sFORCE_FILESYSTEM=1 -lfetchfs.js -lopfs.js
EXPORTS := $(EXPORTS),FETCHFS,OPFS
ifeq ($(PTHREAD),0)
$(error ERROR: WASMFS requires threading support)
endif
endif

ifeq ($(PROXY_TO_PTHREAD),1)
LIBS += -sUSE_ES6_IMPORT_META=0 -sENVIRONMENT=worker,web
LIBS += -sPROXY_TO_PTHREAD -sOFFSCREENCANVAS_SUPPORT
DEFINES += -DUSE_OFFSCREENCANVAS=1 -DPROXY_TO_PTHREAD=1
else
override ASYNC = 1
endif

ifeq ($(HAVE_SDL2), 1)
LIBS += -s USE_SDL=2
DEFINES += -DHAVE_SDL2
endif


LDFLAGS := -L. --no-heap-copy -s STACK_SIZE=$(STACK_SIZE) -s INITIAL_MEMORY=$(INITIAL_HEAP) \
-s EXPORTED_RUNTIME_METHODS=$(EXPORTS) \
-s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS="$(EXPORTED_FUNCTIONS)" \
-s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="libretro_$(subst -,_,$(LIBRETRO))" \
-s DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=0 \
--extern-pre-js emscripten/pre.js \
--js-library emscripten/library_rwebcam.js \
-gsource-map -g2 \
--js-library emscripten/library_platform_emscripten.js

ifeq ($(HAVE_OPENGLES), 1)
ifeq ($(HAVE_OPENGLES3), 1)
LDFLAGS += -s FULL_ES3=1 -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 -lGL
else
LDFLAGS += -s FULL_ES2=1 -s MIN_WEBGL_VERSION=1 -s MAX_WEBGL_VERSION=2 -lGL
endif
endif

ifeq ($(GL_DEBUG), 1)
LDFLAGS += -s GL_ASSERTIONS=1 -s GL_DEBUG=1 -DHAVE_GL_DEBUG_ES=1
endif

ifeq ($(FS_DEBUG), 1)
LDFLAGS += -s FS_DEBUG=1
endif

ifeq ($(HAVE_RWEBAUDIO), 1)
LDFLAGS += --js-library emscripten/library_rwebaudio.js
DEFINES += -DHAVE_RWEBAUDIO
endif

ifeq ($(HAVE_AL), 1)
LDFLAGS += -lopenal
DEFINES += -DHAVE_AL
override ASYNC = 1
endif

ifneq ($(PTHREAD), 0)
LDFLAGS += -s MAXIMUM_MEMORY=1073741824 -pthread -s PTHREAD_POOL_SIZE=$(PTHREAD)
CFLAGS += -pthread
LDFLAGS += -s WASM_MEM_MAX=1073741824 -pthread -s PTHREAD_POOL_SIZE=$(PTHREAD)
CFLAGS += -pthread -s SHARED_MEMORY
HAVE_THREADS=1
else
HAVE_THREADS=0
endif


ifeq ($(ASYNC), 1)
DEFINES += -DEMSCRIPTEN_ASYNCIFY
LDFLAGS += -s ASYNCIFY=$(ASYNC) -s ASYNCIFY_STACK_SIZE=8192
ifeq ($(DEBUG), 1)
LDFLAGS += -s ASYNCIFY_DEBUG=1 # -s ASYNCIFY_ADVISE
endif
endif

ifeq ($(HAVE_OPENGLES), 1)
ifeq ($(HAVE_OPENGLES3), 1)
LDFLAGS += -s FULL_ES3=1 -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2
else
LDFLAGS += -s FULL_ES2=1
endif
endif

ifeq ($(GL_DEBUG), 1)
LDFLAGS += -s GL_ASSERTIONS=1 -s GL_DEBUG=1
endif

ifeq ($(FS_DEBUG), 1)
LDFLAGS += -s FS_DEBUG=1
endif

ifeq ($(HAVE_SDL2), 1)
LIBS += -s USE_SDL=2
DEFINES += -DHAVE_SDL2
endif

include Makefile.common

CFLAGS += $(DEF_FLAGS) -Ideps -Ideps/stb
Expand Down Expand Up @@ -183,8 +220,10 @@ RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ))

all: $(TARGET)

$(TARGET): $(RARCH_OBJ) $(libretro)
@$(if $(libretro), mv -f $(libretro) $(libretro_new),)
$(libretro_new) : $(libretro)
mv -f $(libretro) $(libretro_new)

$(TARGET): $(RARCH_OBJ) $(libretro_new)
@$(if $(Q), $(shell echo echo "LD $@ \<obj\> $(libretro_new) $(LIBS) $(LDFLAGS)"),)
$(Q)$(LD) -o $@ $(RARCH_OBJ) $(libretro_new) $(LIBS) $(LDFLAGS)

Expand Down
1 change: 0 additions & 1 deletion Makefile.libnx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ HAVE_PATCH = 1
HAVE_CHEATS = 1
HAVE_RUNAHEAD = 1
HAVE_NETWORKING = 1
HAVE_CLOUDSYNC = 1
HAVE_IFINFO = 1
HAVE_NETPLAYDISCOVERY = 1
HAVE_STB_FONT = 1
Expand Down
15 changes: 11 additions & 4 deletions Makefile.psl1ght
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ifeq ($(strip $(PSL1GHT)),)
$(error "Please set PSL1GHT in your environment. export PSL1GHT=<path>")
endif

include $(PSL1GHT)/ppu_rules

include version.all
Expand All @@ -30,10 +30,17 @@ CORE_PATH = pkg/psl1ght/pkg/USRDIR/cores/CORE.SELF
INCLUDE += -I. -Ideps -Ideps/stb -Ilibretro-common/include/compat/zlib -Ilibretro-common/include $(LIBPSL1GHT_INC) -Iinclude -Idefines -I$(PORTLIBS)/include -I$(PORTLIBS)/include/freetype2
LIBDIRS += -L. -L$(PORTLIBS)/lib

ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
LIBS :=
else
LIBS := -lretro_psl1ght
endif

MACHDEP := -D__PSL1GHT__ -D__PS3__ -mcpu=cell
CFLAGS += -Wall $(MACHDEP) $(INCLUDE)
CFLAGS += -Wall $(DEFINES) $(MACHDEP) $(INCLUDE)
LDFLAGS := $(MACHDEP)
LIBS := -lretro_psl1ght -lrt -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl -lsysfs -lfreetype -lcamera -lgem -lspurs
LIBS += -lrt -laudio -lrsx -lgcm_sys -lnet -lio -lsysutil -lsysmodule -lm -ljpgdec -lpngdec -llv2 -lnet -lnetctl -lsysfs -lfreetype -lcamera -lgem -lspurs

# system platform
system_platform = unix
Expand Down Expand Up @@ -125,7 +132,7 @@ $(ELF_TARGET): $(OBJ)
$(CXX) -o $@ $(LDFLAGS) $(LIBDIRS) $(OBJ) $(LIBS)

create-core: $(SELF_TARGET)
cp $(SELF_TARGET) $(CORE_PATH)
cp $(SELF_TARGET) $(CORE_PATH)

pkg: create-core
$(PKG) --contentid $(CONTENTID) pkg/psl1ght/pkg/ $(PACKAGE_BASENAME).pkg
Expand Down
26 changes: 26 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Security Policy

## Reasonable expectations

RetroArch is a frontend for the libretro API. The main functionality is fulfilled by invoking other binary libraries ("cores") which are not restricted by RetroArch in any way. Cores are able to read/write/delete files, spawn processes, communicate over the network. Also, source for cores is not necessarily in control by libretro team, and core binaries / RetroArch binaries are not signed. For this reason, it is a bad idea to use RetroArch or any other libretro frontend on security critical systems.

Also, RetroArch and cores have been packaged in several ways. Content on the [official download site](https://buildbot.libretro.com/) is built from a direct mirror of the original RetroArch and core repositories, no binaries are reused. Note that source for the core repositories may be outside libretro team control.

## Supported Versions

For most delivery channels, libretro team does not have control over the version. The exceptions are:
- [official download site](https://buildbot.libretro.com/)
- Steam release
- Apple App Store release
- various Android app store releases
- note that Google Play Store version is years behind and can not be updated

You may report vulnerability against any recent version, but be reasonable.

## Reporting a Vulnerability

Please report security vulnerabilities at libretro@gmail.com

## Possible remediation

Due to the variety of delivery channels, RetroArch team can not recall any given version universally. Security fixes are accepted for next release, and notice may be posted in the channels controlled by RetroArch team, depending on the severity assessed by RetroArch team.
Loading

0 comments on commit c50354a

Please sign in to comment.