Commit graph

270 commits

Author SHA1 Message Date
刘皓
5199c48de7
Remove exceptions from mkxp-z src/ directory 2025-05-16 15:54:32 -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
刘皓
13c0657691
Handle current working directory properly in libretro builds
Any relative paths that the game tries to access in libretro builds will
now be relative to whatever is the current working directory in the Ruby
sandbox, which will also now be initialized to the game directory during
initialization. Before, all of the bindings that took paths were
hardcoded to prepend the path with the game directory.
2025-05-06 16:55:28 -04:00
刘皓
1c10158f2d
Add single-threaded Graphics.play_movie for platforms without multithreading 2025-05-05 11:00:27 -04:00
刘皓
82c3d7985c
Fix some Graphics.play_movie audio/video synchronization issues in libretro builds 2025-05-03 23:01:11 -04:00
刘皓
74e5cc763c
Implement Graphics.play_movie in libretro builds 2025-05-03 18:27:44 -04:00
刘皓
a40f6e7659
Fix some compiler warnings in libretro builds 2025-05-01 11:58:43 -04:00
刘皓
0b9baa1007
Add mutex and condition variable polyfill for libretro 3DS builds 2025-04-27 00:49:47 -04:00
刘皓
a73dec9cad
Manually disable threaded audio support in libretro Wii U build 2025-04-26 22:01:07 -04:00
刘皓
e5a4309402
Try using the latest version of Emscripten in the autobuild 2025-04-22 21:47:38 -04:00
刘皓
fafad03874
Temporarily use nightly build of RetroArch in libretro Emscripten autobuild 2025-04-22 16:51:38 -04:00
刘皓
71653549f2
Add threaded audio driver in libretro builds
This adds a new driver for audio in libretro builds for devices with
multithreading support that defers audio rendering to a worker thread
provided by the libretro frontend.

The threaded driver has the advantage that video lag will not also cause
the audio to lag, which is very noticeable since it manifests in the
form of audio crackling when it happens.
2025-04-22 12:17:15 -04:00
刘皓
3ace4ad6ae
Merge branch 'misc-fixes' into libretro 2025-04-15 23:25:55 -04:00
刘皓
8277390e13
Move embedtool.cpp into tools directory 2025-04-15 12:20:22 -04:00
刘皓
ae19c0e42e
Reconcile the standalone and libretro build systems 2025-04-09 23:52:12 -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
刘皓
01a5875fd3
Improve detection of aligned memory allocation APIs in libretro builds 2025-04-08 17:32:19 -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
刘皓
192300dbe9
Allow FluidSynth to build for libretro targets with no threading support 2025-04-08 00:27:32 -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
刘皓
7c7495ab1e
Set CMAKE_POLICY_VERSION_MINIMUM to 3.10 in libretro builds instead of 3.5 2025-04-02 13:23:47 -04:00
刘皓
8457ac1598
Rename mkxp-threads to mkxp-polyfill 2025-04-02 13:06:17 -04:00
刘皓
436e5f8510
Stop passing -fno-optimize-sibling-calls in PlayStation Vita builds
Not required as long as we pass `-Wl,--pic-veneer` when linking, which
we do (in Makefile.vita from RetroArch).
2025-03-31 23:41:18 -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
刘皓
afec0dc50d
Use -mword-relocations -fno-optimize-sibling-calls in libretro PlayStation Vita builds
The Vita builds of RetroArch and some libretro cores use these two
flags, supposedly to fix relocation-related bugs.

(cherry picked from commit 3c43cd5747b19bd4d9c0202fec1a68677ddbd5af)
2025-03-29 22:23:39 -04:00
刘皓
5754c8b4f1
Use -march=armv6k in libretro Nintendo 3DS builds 2025-03-29 22:17: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
刘皓
eeef9ff943
Don't make sandbox_malloc into a coroutine
Okay, the coroutine implementation of `sandbox_malloc` is clearly
broken. It would be working if Asyncify instrumented the `memory.grow`
WebAssembly instruction, but it doesn't instrument it.

This commit reverts commit 42c4ff9497 and
also increases the default VM memory allocation from 64 MiB to 96 MiB to
account for the lack of ability to increase the memory allocation at run
time. I'll find some new way to implement increasing the memory
allocation later.
2025-03-18 13:49:41 -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
刘皓
96e44e285f
Prevent type conflicts between Khronos OpenGL headers and PortableGL headers 2025-03-15 01:29:12 -04:00
刘皓
2cd8202af3
Convert GLSL shaders to PortableGL's shader format
PortableGL supports shaders, but requires them to be compiled
ahead-of-time to C or C++.

I'll write a compiler later to translate from GLSL to this format
automatically at build time.
2025-03-13 16:16:17 -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
刘皓
ccceeeb75b
Merge branch 'libretro-compat' into libretro 2025-03-09 21:23:50 -04:00
刘皓
549193cb1f
Remove -fno-optimize-sibling-calls from Ruby in libretro builds
The only reason why WABT suggests this flag be used is because it
guarantees that infinite recursion will crash the program instead of
running in an infinite loop.

Honestly, who cares? It's not like either of these things are supposed
to happen, so from the viewpoint of the end user, they're basically the
same thing. I think we can afford to deviate from the WebAssembly
Specification here if it means allowing the compiler to do more
optimizations.
2025-03-08 14:21:08 -05: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
刘皓
f810489a15
Enable LTO only for libruby in libretro PlayStation 3 build 2025-03-07 11:27:27 -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
刘皓
740dfd51c9
Start integrating font code into libretro builds 2025-03-04 18:52:20 -05:00
刘皓
1ae5e0e4a0
Merge branch 'libretro-compat' into libretro 2025-03-04 00:18:51 -05:00
刘皓
0f684b5416
Move libretro Ruby WASI build into a separate static library 2025-03-04 00:17:14 -05:00
刘皓
a37997a6ac
Add FreeType to libretro builds 2025-03-03 23:26:57 -05:00
刘皓
f3419a9c16
Merge branch 'libretro-compat' into libretro 2025-03-03 12:08:13 -05:00
刘皓
8d574dfe64
Merge branch 'misc-fixes' into libretro-compat 2025-03-03 10:46:44 -05:00
刘皓
7182a57fe1
Use std::ios::binary mode in embedtool.cpp
Required for it to work properly on Windows.
2025-03-03 10:41:01 -05:00
刘皓
d1230aab74
Merge branch 'libretro-compat' into libretro 2025-02-28 00:42:05 -05:00