Commit graph

258 commits

Author SHA1 Message Date
刘皓
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
刘皓
99d4748227
Merge branch 'misc-fixes' into libretro-compat 2025-02-28 00:41:06 -05:00
刘皓
5be1f6962e
Explicitly request 7-character Git hash in meson.build
It seems the length of the hash generated by
`git rev-parse --short HEAD` is nondeterministic. GitHub Actions
generates 7-character hashes, while my computer currently generates
8-character hashes. To be consistent, I'm forcing the hashes to be 7
characters long.
2025-02-28 00:40:32 -05:00
刘皓
5c0e06eaf4
Use vcs_tag to get Git version instead of run_command
This way Meson will automatically keep the Git hash updated as you make
new Git commits, rather than forcing you to reconfigure the build again
every time you make a new commit to keep the commit hash updated.

(cherry picked from commit b9bb3535ae)
2025-02-27 23:41:40 -05:00
刘皓
66152bf5c5
Merge branch 'libretro-compat' into libretro 2025-02-27 23:34:08 -05:00
刘皓
20f806abef
Remove dependency on xxd 2025-02-27 23:32:30 -05:00
刘皓
ecc5cb5de3
Merge branch 'misc-fixes' into libretro-compat 2025-02-27 22:56:24 -05:00
刘皓
f162e8a494
Replace xxd with a custom executable
This removes the need to have xxd installed and provides a portable way
to specify the name of the output array (xxd has an `-n` option for
this, but it isn't present in older versions of xxd), which helps reduce
the possibility of symbol conflicts in libretro builds and also prevents
portability issues since the name of xxd's output array depends on the
relative path to the input file, which can break if Meson changes the
structure of the build directory or if the user sets the build directory
to a different location.

Also, this custom executable declares the array as const so that it goes
into the read-only data section of the binary instead of the data
section.
2025-02-27 22:55:22 -05:00
刘皓
ba68b8fa5b
Move libretro headers and SDL headers to meson.build 2025-02-27 20:39:17 -05:00
刘皓
e17abc9b6c
Enable -ffunction-sections -fdata-sections -Wl,--gc-sections in libretro builds 2025-02-27 18:38:52 -05:00
刘皓
01fce50d97
Remove most of the #ifndef MKXPZ_RETRO macros in graphics-related code 2025-02-27 12:19:34 -05:00
刘皓
9f33a0acea
Implement image loading in libretro builds 2025-02-25 12:53:57 -05:00
刘皓
8ed8dd14ee
Add stb_image and PortableGL to libretro builds 2025-02-24 23:22:00 -05:00