Commit graph

95 commits

Author SHA1 Message Date
刘皓
08ad3e9f8f
Patch boost_assert to use stb_sprintf on platforms with no snprintf implementation 2025-06-23 18:15:11 -04:00
刘皓
b339eea1a7
Downgrade FLAC in libretro builds to 1.4.3
Some of the Android builds broke in the 1.5.0 update.
2025-06-04 11:38:25 -04:00
刘皓
41557aba6e
Add a log message when loading libretro save state made with incompatible mkxp-z version 2025-06-04 11:32:32 -04:00
刘皓
e342d6187c
Update dependencies in libretro builds 2025-06-04 10:18:53 -04:00
刘皓
afb0748ffa
Use a priority deque to allocate object keys/WASI file descriptors 2025-06-03 10:59:30 -04:00
刘皓
cd628048ef
Store destructors in a global table instead of in the object itself in libretro builds 2025-05-19 19:27:30 -04:00
刘皓
a9a67052ff
Fix libretro PlayStation 3 build 2025-05-17 10:08:36 -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
刘皓
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
刘皓
c85e9554ec
Implement writing to filesystem (i.e. game saving) in libretro builds
Files are written to the libretro save directory, which is mounted at
/save in PhysFS. All filesystem calls made from Ruby in libretro builds
are routed through PhysFS, so the game can just use any ordinary
filesystem function provided by Ruby to interact with /save.

It's also union mounted on top of the game directory (located at /game
in PhysFS) so that games that write their save files to the current
working directory will have their save files saved to the libretro save
directory instead of the game directory.

For security and portability reasons, nothing outside of the libretro
save directory can be written to, and nothing outside of the libretro
save directory, the libretro game directory and the various embedded
files used by the runtime can be read from.
2025-05-07 16:01:41 -04:00
刘皓
b518ca62f0
Re-add polyfill for pthread_self()
Apparently PhysFS does actually need this function to work properly.
Without it, we get weird crashes and corruptions in some of the libretro
builds.
2025-05-05 16:45:22 -04:00
刘皓
33e1328e71
Prevent usage of mkxp_thread_t on single-threaded platforms 2025-05-05 11:47:17 -04:00
刘皓
1c10158f2d
Add single-threaded Graphics.play_movie for platforms without multithreading 2025-05-05 11:00:27 -04:00
刘皓
2bec640f7f
Update TheoraPlay in the Xcode build system as well 2025-05-04 21:39:52 -04:00
刘皓
307d3d84d5
Update TheoraPlay
The version originally used by mkxp-z has a bug where TheoraPlay's
internal mutexes don't do anything on non-Windows platforms (see commit
35295146d38d389729380a691292cdb8e90bad1b in TheoraPlay), leading to race
conditions, especially when using RetroArch's fast-forwarding.

Also, this new version has support for being run single-threaded,
which'll come in handy on platforms with no multithreading support.
2025-05-04 11:41:32 -04:00
刘皓
23bc6625f1
Add Theora as a dependency in libretro builds 2025-05-03 13:46:17 -04:00
刘皓
a40f6e7659
Fix some compiler warnings in libretro builds 2025-05-01 11:58:43 -04:00
刘皓
fae9df6324
Add a mirror URL for libiconv 2025-04-23 10:31:14 -04:00
刘皓
75946ab6a5
Download uchardet tarball instead of Git repository in libretro builds
The Git repository seems to be down.
2025-04-20 23:04:40 -04:00
刘皓
5a5fcd26c5
Delete copy constructor for stack_frame_guard and stack_frame
The copy constructors are causing problems when the `fiber.stack` vector
gets reallocated when its capacity is full, since when vectors are
reallocated, the elements are moved (or copied if there's no usable move
constructor) to the reallocated memory and then the original elements
are destroyed.

This premature calling of destructors leads to double-free and
use-after-free errors.

I fixed it by deleting the copy constructors and explicitly defining
move constructors.
2025-04-16 21:39:04 -04:00
刘皓
07a03be7df
Use libiconv instead of the system iconv in libretro builds 2025-04-12 16:40:50 -04:00
刘皓
2c3c560af2
Add uchardet to libretro builds 2025-04-10 23:42:44 -04:00
刘皓
ecd8e50e9e
Upgrade OpenAL Soft from 1.23.1 to 1.24.2 again in libretro builds
I don't know why the Wii U build fails with older versions of OpenAL
Soft. There's nothing we can do here except use the newer OpenAL Soft
versions.
2025-04-09 17:22:13 -04:00
刘皓
8c7786da2b
Change openal-soft-int32.patch to also apply to devkitPPC 2025-04-08 23:36:42 -04:00
刘皓
495d00d5ed
Fix libretro compilation errors caused by the previous commit 2025-04-08 15:20:13 -04:00
刘皓
74f4c0e714
Downgrade OpenAL Soft from 1.24.2 to 1.23.1 in libretro builds
OpenAL Soft 1.24 introduces a lot of code that doesn't work well with
the PlayStation 3 homebrew toolchain, and also the old version of the
Wii U homebrew toolchain currently used by the libretro buildbot.
Instead of maintaining a bunch of patches to get 1.24 to work on these
toolchains, I think it'd be easier to just use 1.23.
2025-04-08 14:27:20 -04:00
刘皓
0bd07c8dc8
Disable building the FluidSynth executable in libretro builds 2025-04-08 01:15:33 -04:00
刘皓
192300dbe9
Allow FluidSynth to build for libretro targets with no threading support 2025-04-08 00:27:32 -04:00
刘皓
89ffd49acf
Fix several FluidSynth compilation errors in libretro builds 2025-04-07 22:16:00 -04:00
刘皓
db7853d02d
Use fluidsynth-sans-glib instead of fluidlite in libretro builds
FluidLite plays one of the tracks in the intro sequence of KNight-Blade
incorrectly.
2025-04-07 21:24:27 -04:00
刘皓
8457ac1598
Rename mkxp-threads to mkxp-polyfill 2025-04-02 13:06:17 -04:00
刘皓
dcd29f44a9
Remove dependency on libzip in libretro builds 2025-03-31 13:26:54 -04:00
刘皓
70c5b3dad4
Fix undefined symbol error in libretro Nintendo 3DS build 2025-03-30 00:03:03 -04:00
刘皓
81b94d1498
Remove dependency on SDL headers in libretro builds
I'd already removed the SDL static libraries from libretro builds for
portability, but kept the headers to make it easier to port the codebase
to libretro. Eventually it was time to stop using the SDL headers as a
crutch.
2025-03-29 12:37:07 -04:00
刘皓
b9e54fbb28
Fix libretro builds with CMake 4 2025-03-27 23:02:49 -04:00
刘皓
54e819f89c
Remove PortableGL support
I was planning on using PortableGL as a software implementation of
OpenGL, but it's really slow (at least when compared to actual 2D
graphics software renderers). I'll have to actually add a separate
rendering backend for software rendering later instead of trying to
emulate OpenGL in software.
2025-03-16 22:15:24 -04:00
刘皓
0e786c4e48
Replace GLsizeiptr in PortableGL headers with uintptr_t
Required to account for the fact that we changed the typedef for
`GLsizeiptr` from `uintptr_t` to `ssize_t`, and PortableGL, for some
reason, incorrectly relies on `GLsizeiptr` being an unsigned
pointer-sized integer in some places.
2025-03-15 11:50:50 -04:00
刘皓
96e44e285f
Prevent type conflicts between Khronos OpenGL headers and PortableGL headers 2025-03-15 01:29:12 -04:00
刘皓
995c5303a3
Rename PortableGL shader texture functions 2025-03-12 23:05:02 -04:00
刘皓
969ef0612f
Start implementing PortableGL bindings for libretro builds 2025-03-11 14:07:20 -04:00
刘皓
497d6788c6
Use Khronos OpenGL headers in libretro builds instead of SDL OpenGL headers
SDL disables OpenGL headers when building for iOS and tvOS, but that
causes our builds to fail. I'm getting conflicting answers on whether or
not OpenGL is supported on iOS and tvOS, but it's the libretro
frontend's job to care about this, not mine. Regardless, I'm gonna need
these OpenGL headers for software rendering on platforms with no OpenGL
support, so I can't tolerate the headers being disabled.
2025-03-10 17:31:39 -04:00
刘皓
9677ab899b
Merge branch 'libretro-compat' into libretro 2025-03-07 21:01:48 -05:00
刘皓
c25175778e
Prevent PhysFS from using lstat() on platforms where it's not supported 2025-03-07 12:10:26 -05:00
刘皓
516c706a66
Convert all CMake subprojects' object libraries into static libraries
CMake object libraries keep building with position-independent code
enabled even when it's explicitly disabled! We do, in fact, have to
build with position-independent code disabled on some targets, such as
PlayStation Vita, since some targets support position-independent code.

CMake static libraries don't seem to forcibly enable
position-independent code, so I've converted all the object libraries
into static libraries and added the new static libraries as dependencies
in Meson.
2025-03-06 22:55:26 -05:00
刘皓
24a4ae5759
Fix missing symbol errors in libretro PlayStation Vita build
Somehow, enabling LTO prevents these linker errors from showing up,
which is why they don't show up in GitHub Actions, but that doesn't mean
the errors can be ignored!
2025-03-06 20:07:58 -05:00
刘皓
740dfd51c9
Start integrating font code into libretro builds 2025-03-04 18:52:20 -05:00
刘皓
a37997a6ac
Add FreeType to libretro builds 2025-03-03 23:26:57 -05:00
刘皓
66152bf5c5
Merge branch 'libretro-compat' into libretro 2025-02-27 23:34:08 -05:00
刘皓
ba68b8fa5b
Move libretro headers and SDL headers to meson.build 2025-02-27 20:39:17 -05:00
刘皓
ec0196b5e3
Fix OpenGL symbol conflict in libretro Emscripten build 2025-02-27 16:16:05 -05:00