Skip to content

Commit c314465

Browse files
committed
feat(platform): add libretro
1 parent 08ce21f commit c314465

2 files changed

Lines changed: 66 additions & 42 deletions

File tree

‎build.md‎

Lines changed: 54 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ done with `cmake`, though the exact commands differ between platforms:
125125
`cmake -B build/webos -S . -DCMAKE_TOOLCHAIN_FILE="~/arm-webos-linux-gnueabi_sdk-buildroot/share/buildroot/toolchainfile.cmake" -DSE_CLOUDVARS=OFF -DWEBOS=ON -DSE_RENDERER=sdl2 && make -C build/webos all package`.
126126
> [!NOTE]
127127
> webOS **requires** the `WEBOS=ON` flag. It will not compile without it.
128+
- **For libretro**, you need to run
129+
`mkdir build && cd build && cmake .. -DLIBRETRO=ON && cmake --build .`.
130+
> [!NOTE]
131+
> Creating the `build` directory and using the `LIBRETRO=ON` flag is required
132+
> for libretro builds.
128133
129134
## Final Packages
130135

@@ -173,19 +178,20 @@ The audio backend to be used. Can be one of `sdl2`, `sdl1`, `sdl3`, `nds`, or
173178

174179
#### Supported Audio Engines
175180

176-
| Platform | `sdl1` | `sdl2` | `sdl3` | `nds` | `headless` |
177-
| -------- | ------ | ------ | ------ | ----- | ---------- |
178-
| PC | ✅ | ✅ | ✅ | ❌ | ✅ |
179-
| 3DS | ❌ | ✅ | ✅ | ❌ | ✅ |
180-
| DS | ❌ | ❌ | ❌ | ✅ | ✅ |
181-
| Wii U | ❌ | ✅ | ❌ | ❌ | ✅ |
182-
| Wii | ✅ | ✅ | ❌ | ❌ | ✅ |
183-
| GameCube | ❌ | ✅ | ❌ | ❌ | ✅ |
184-
| Switch | ❌ | ✅ | ❌ | ❌ | ✅ |
185-
| Vita | ❌ | ✅ | ❌ | ❌ | ✅ |
186-
| PSP | ❌ | ✅ | ❌ | ❌ | ✅ |
187-
| PS4 | ❌ | ✅ | ❌ | ❌ | ✅ |
188-
| webOS | ❌ | ✅ | ❌ | ❌ | ✅ |
181+
| Platform | `sdl1` | `sdl2` | `sdl3` | `nds` | `libretro` | `headless` |
182+
| -------- | ------ | ------ | ------ | ----- | ---------- | ---------- |
183+
| PC | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
184+
| 3DS | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ |
185+
| DS | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ |
186+
| Wii U | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
187+
| Wii | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
188+
| GameCube | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
189+
| Switch | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
190+
| Vita | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
191+
| PSP | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
192+
| PS4 | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
193+
| webOS | ❌ | ✅ | ❌ | ❌ | ❌ | ✅ |
194+
| Libretro | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
189195

190196
The default value depends on the renderer being used (see below):
191197

@@ -195,6 +201,7 @@ The default value depends on the renderer being used (see below):
195201
- `opengl`: `sdl2`
196202
- `citro2d`: `sdl3`
197203
- `gl2d`: `nds`
204+
- `libretro`: `libretro`
198205
- `headless`: `headless`
199206

200207
### `SE_BANNERTOOL`
@@ -249,6 +256,7 @@ The allowed modes depend on the platform you are building for:
249256
| PSP | ❌ | ✅ | ✅ |
250257
| PS4 | ❌ | ✅ | ✅ |
251258
| webOS | ❌ | ❌ | ✅ |
259+
| Libretro | ✅ | ✅ | ✅ |
252260

253261
### `SE_DOWNLOAD`
254262

@@ -266,15 +274,16 @@ Whether or not to show the leading screen while loading a project. If set to
266274

267275
This option crashes on Wii and GameCube when trying to load large projects.
268276

269-
Defaults to `ON`.
277+
Defaults to `ON` on every platform except Libretro.
270278

271279
### `SE_MAKEROM`
272280

273281
The path to the `makerom` executable. **Only relevant on 3DS.**
274282

275283
### `SE_MENU`
276284

277-
Whether or not the main menu will appear. Defaults to `ON`.
285+
Whether or not the main menu will appear. Defaults to `ON` on every platform
286+
except Libretro.
278287

279288
### `SE_OUTPUT_NAME`
280289

@@ -293,21 +302,23 @@ The renderer backend to be used. Can be one of `sdl1`, `sdl2`, `sdl3`, `opengl`,
293302

294303
#### Supported Renderers
295304

296-
| Platform | `sdl1` | `sdl2` | `sdl3` | `opengl` | `citro2d` | `gl2d` | `headless` |
297-
| -------- | ------ | ------ | ------ | -------- | --------- | ------ | ---------- |
298-
| PC | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ |
299-
| 3DS | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ |
300-
| DS | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ |
301-
| Wii U | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
302-
| Wii | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
303-
| GameCube | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
304-
| Switch | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
305-
| Vita | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
306-
| PSP | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
307-
| PS4 | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
308-
| webOS | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
309-
310-
Defaults to `citro2d` on 3DS, `gl2d` on NDS, and `sdl2` on everything else.
305+
| Platform | `sdl1` | `sdl2` | `sdl3` | `opengl` | `citro2d` | `gl2d` | `libretro` | `headless` |
306+
| -------- | ------ | ------ | ------ | -------- | --------- | ------ | ---------- | ---------- |
307+
| PC | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ✅ |
308+
| 3DS | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ✅ |
309+
| DS | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ✅ |
310+
| Wii U | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
311+
| Wii | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
312+
| GameCube | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
313+
| Switch | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
314+
| Vita | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
315+
| PSP | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
316+
| PS4 | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
317+
| webOS | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
318+
| Libretro | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
319+
320+
Defaults to `citro2d` on 3DS, `gl2d` on NDS, `libretro` on Libretro, and `sdl2`
321+
on everything else.
311322

312323
### `SE_SVG`
313324

@@ -320,17 +331,18 @@ The windowing backend to be used. Can be one of `sdl1`, `sdl2`, `sdl3`, `glfw`,
320331

321332
#### Supported Windowing Backends
322333

323-
| Renderer | `sdl1` | `sdl2` | `sdl3` | `glfw` | `3ds` | `nds` | `headless` |
324-
| ---------- | ------ | ------ | ------ | ------ | ----- | ----- | ---------- |
325-
| `sdl1` | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
326-
| `sdl2` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
327-
| `sdl3` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
328-
| `opengl` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
329-
| `citro2d` | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ |
330-
| `gl2d` | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
331-
| `headless` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
334+
| Renderer | `sdl1` | `sdl2` | `sdl3` | `glfw` | `3ds` | `nds` | `libretro` | `headless` |
335+
| ---------- | ------ | ------ | ------ | ------ | ----- | ----- | ---------- | ---------- |
336+
| `sdl1` | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
337+
| `sdl2` | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
338+
| `sdl3` | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
339+
| `opengl` | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
340+
| `citro2d` | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ |
341+
| `gl2d` | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ |
342+
| `headless` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
343+
| `libretro` | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
332344

333345
SE! prioritizes windowing backends in the following order: `glfw`, `sdl3`,
334-
`sdl2`, `sdl1`, `3ds`, `nds`, and finally `headless`. It will pick the first
335-
backend in that order that is supported by the chosen renderer, unless the
336-
windowing backend is manually set.
346+
`sdl2`, `sdl1`, `3ds`, `nds`, `headless`, and finally `libretro`. It will pick
347+
the first backend in that order that is supported by the chosen renderer, unless
348+
the windowing backend is manually set.

‎install.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,15 @@ Upload your Scratch projects with Dev Manager to your TV in
202202
folder doesn't exist, create it.
203203

204204
Then it should be as simple as opening the app on your TV from the home menu!
205+
206+
## Libretro (RetroArch)
207+
208+
Download the `scratch-everywhere.so` file from the
209+
[Releases tab](https://github.com/ScratchEverywhere/ScratchEverywhere/releases)
210+
or
211+
[nightly build](https://nightly.link/ScratchEverywhere/ScratchEverywhere/workflows/nightly-ps4/main/Scratch%20Everywhere!%20Libretro%20Nightly.zip).
212+
213+
Place it in the RetroArch cores directory, which you can find in Settings ->
214+
Directory -> Cores.
215+
216+
Then it should be as simple as loading the core and opening a Scratch project!

0 commit comments

Comments
 (0)