Commit graph

2382 commits

Author SHA1 Message Date
刘皓
ef58df103a
Remember to actually initialize exception classes in libretro builds 2025-05-18 09:42:42 -04:00
刘皓
4709ea48ce
Merge branch 'libretro-no-exceptions' into libretro 2025-05-17 23:22:25 -04:00
刘皓
367a2a5949
Remove unused guardDisposed() functions from font.cpp and graphics.cpp 2025-05-17 23:04:50 -04:00
刘皓
79199ccd7a
Allow json5pp to report syntax errors and bad casts even with -fno-exceptions 2025-05-17 22:57:31 -04:00
刘皓
83a6b7a1f1
Re-add missing GFX_LOCK/GFX_UNLOCK calls in binding-sandbox 2025-05-17 19:41:43 -04:00
刘皓
c18e7e28a3
Fix free being called on null pointer in Graphics.snap_to_bitmap in standalone builds 2025-05-17 18:20:17 -04:00
刘皓
2f589e1cf4
Fix compilation errors in binding/ in standalone builds 2025-05-17 17:21:51 -04:00
刘皓
aef7eff511
Fix some compilation errors in standalone builds 2025-05-17 13:03:57 -04:00
刘皓
3fec509568
Merge branch 'libretro' into libretro-no-exceptions 2025-05-17 10:21:36 -04:00
刘皓
a9a67052ff
Fix libretro PlayStation 3 build 2025-05-17 10:08:36 -04:00
刘皓
134e08ce6a
Allow the entire codebase to build with -fno-exceptions -fno-rtti in libretro builds 2025-05-16 21:59:54 -04:00
刘皓
5199c48de7
Remove exceptions from mkxp-z src/ directory 2025-05-16 15:54:32 -04:00
刘皓
3b564efd79
Remove direct dependency on Boost.Core in libretro builds 2025-05-16 15:51:51 -04:00
刘皓
082bd25be5
Allow FluidSynth and OpenAL Soft to compile with -fno-exceptions -fno-rtti in libretro builds 2025-05-15 15:17:18 -04:00
刘皓
94e0f99643
Allow ViewportElement to compile with -fno-rtti 2025-05-15 13:34:09 -04:00
刘皓
53f42adb89
Add an x86 version of the libretro Alpine Linux autobuild 2025-05-14 23:11:10 -04:00
刘皓
e3cbed2fb3
Remove unused next_func_ptr field of binding_base 2025-05-14 21:16:50 -04:00
刘皓
1f136cd6ff
Fix Graphics.play_movie volume being ignored 2025-05-14 21:08:33 -04:00
刘皓
e803e8e9e0
Pin libretro GNU/Linux autobuilds to Ubuntu 16.04 Xenial Xerus
The libretro buildbot uses Xenial for its GNU/Linux images, but with GCC
9 instead of the default GCC 5 that's available in the Xenial
repositories. I've changed our libretro autobuilds to do the same.

Pinning an old distribution for the libretro GNU/Linux autobuilds allows
for compatibility with devices with old versions of glibc, like some
Linux-based handheld console OSes.
2025-05-14 19:10:47 -04:00
刘皓
042d6f3e9d
Use Meson to configure Boost subprojects instead of CMake
Boost's CMake files try to access the Internet for absolutely no reason.
2025-05-14 16:55:35 -04:00
刘皓
d5f4d6777a
Merge branch 'misc-fixes' into libretro 2025-05-14 12:59:24 -04:00
刘皓
8cf251bd5d
Set a C++ standard for embedtool 2025-05-14 12:59:17 -04:00
刘皓
215e880aa6
Make RTP paths in mkxp.json consistent with other paths in libretro builds 2025-05-14 10:10:46 -04:00
刘皓
7af5179232
Remove exceptions from src/util/iniconfig.cpp
The libretro Emscripten build really doesn't like exceptions, and
neither does the PlayStation 4 homebrew toolchain. I'll have to get rid
of all exceptions elsewhere as well.
2025-05-14 09:55:37 -04:00
刘皓
28fb36af98
Capitalize /Dist, /Game, /Save and /System in libretro builds for consistency 2025-05-13 17:53:59 -04:00
刘皓
36075a5add
Load RTPs from mkxp.json as well in libretro builds 2025-05-13 17:26:30 -04:00
刘皓
714c583b9f
Allow RTPs to be loaded from archives as well in libretro builds 2025-05-13 16:17:04 -04:00
刘皓
75b953d4c8
Implement loading RTPs from the libretro system directory 2025-05-13 12:28:17 -04:00
刘皓
d62d6aef3e
Remove WASI_DEBUG macro 2025-05-12 13:50:48 -04:00
刘皓
67e61917a7
Apply big-endian fixes to binding-sandbox/wasi.cpp as well 2025-05-12 12:39:08 -04:00
刘皓
f57568e051
Allow some libretro core options to be changed during execution 2025-05-11 18:54:56 -04:00
刘皓
3fda80275d
Implement core options in libretro builds 2025-05-11 17:04:33 -04:00
刘皓
7347afed21
Revert "Make sure sandbox stack grows upwards in big-endian libretro builds"
This reverts commit 58e6f71ef3.

The original behaviour was the correct one. The stack should always grow
downwards.
2025-05-10 23:37:39 -04:00
刘皓
87eea255c5
Remove void pointer arithmetic in src/display/bitmap.cpp 2025-05-10 23:27:30 -04:00
刘皓
68b2067a45
Remove void pointer arithmetic in binding-sandbox/binding-base.h 2025-05-10 20:44:46 -04:00
刘皓
2a8370a8ee
Fix typo in bitmap.cpp 2025-05-10 20:09:56 -04:00
刘皓
58e6f71ef3
Make sure sandbox stack grows upwards in big-endian libretro builds 2025-05-10 19:23:43 -04:00
刘皓
3ba12e5672
Fix handling of big-endian platforms in libretro builds
In big-endian libretro builds, the WebAssembly memory is reversed, so no
byte-swapping is required to read from/write to WebAssembly memory
(which is little-endian).

However, that means the ways to get and set values in WebAssembly memory
are endianness-dependent, so I've added the correct such ways for
big-endian platforms.
2025-05-10 18:55:14 -04:00
刘皓
09ed08c087
Fix edge case in memory reallocation algorithm in wasm-rt.cpp 2025-05-10 11:09:20 -04:00
刘皓
fc744ab6c6
Refactor locking of all tracks in AudioPrivate::bgmTracks into a custom lock guard 2025-05-10 10:48:57 -04:00
刘皓
3bceb56bd3
Merge branch 'misc-fixes' into libretro 2025-05-10 10:48:49 -04:00
刘皓
95f0f08c87
Fix memory leak in Input::getClipboardText() 2025-05-10 10:47:48 -04:00
刘皓
215046d8b4
Only use extern in embedtool.cpp if language is C++
In C, variables defined as `const` have external linkage.

In C++, variables defined as `const` have internal linkage, and we need
to define them as `extern const` for them to have external linkage like
in C.

However, in C, defining a variable as `extern const` throws a compiler
error, so we need to add `extern` only for C++ files.
2025-05-10 10:47:19 -04:00
刘皓
dafe038bb4
Merge branch 'misc-fixes' into libretro 2025-05-10 10:07:48 -04:00
刘皓
54d915860f
Fix some bugs in the ME watch thread
* BGM track streams should be locked while `extPaused` is being modified
* All BGM track streams should be locked in the `BgmFadingOut` phase
  since we need to query the states of all tracks in the middle of the
  loop
* BGM tracks should have `extPaused` set to false if the ME ends in the
  middle of the `BgmFadingOut` phase
2025-05-10 09:59:56 -04:00
刘皓
c5747f17c5
Fix minor issues in binding-sandbox/binding-base.h and binding-sandbox/binding-util.h 2025-05-10 09:25:43 -04:00
刘皓
8ec189e3d2
Remove always-false static_assert from binding-sandbox/binding-base.h
This is causing compilation errors with some compilers.
2025-05-09 23:28:17 -04:00
刘皓
b8d785b7e1
Implement growing VM memory in libretro builds
The binding coroutines in libretro builds are constructed on the VM
stack, so reallocating the VM memory would corrupt the memory of any
currently existing coroutines.

I've changed it so that the coroutines are no longer constructed on the
VM stack so that they're unaffected by VM memory reallocations, and
added a "slot" mechanism for storing variables on the VM stack. (Any
Ruby `VALUE`s used by a coroutine have to be stored on the VM stack so
that the Ruby garbage collector doesn't free them while they're being
used, which is why the slot mechanism is necessary.)
2025-05-09 22:49:13 -04:00
刘皓
d186fa97bc
Update Emscripten to 4.0.8 for the libretro Emscripten autobuild
Will be required once https://github.com/libretro/RetroArch/pull/17872
makes its way into the version of RetroArch used in the autobuild.
2025-05-09 18:02:37 -04:00
刘皓
d71cd242c7
Improve save directory creation algorithm in libretro builds
Before, if the game tried to create a save file, missing parent
directories would always be created because they could possibly exist
only in the game directory and not in the save directory, and we
wouldn't know due to the union mounting of the save and game
directories. But this is inconsistent with the behaviour of file
creation, where it should fail if parent directories don't exist.

The behaviour has been changed to only create parent directories if the
parent directories already exist. I know that sounds strange, but if the
parent directories exist, it could be that they only exist in the game
directory but not the save directory due to the union mounting, so we
need to create the parent directories, which will be created in the save
directory due to it being set as the write directory in PhysFS.
2025-05-07 22:13:45 -04:00