Commit graph

270 commits

Author SHA1 Message Date
刘皓
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
刘皓
2029539ece
Replace pixman with pixman-region in libretro builds 2025-02-24 17:13:25 -05:00
刘皓
3506ce6cc6
Make sure pixman inherits compiler flags in libretro builds 2025-02-24 16:44:00 -05:00
刘皓
81c272cb9f
Add libpng and pixman to libretro builds 2025-02-24 15:32:02 -05:00
刘皓
4a810730f1
Merge branch 'libretro-compat' into libretro 2025-02-22 23:16:58 -05:00
刘皓
07780d4702
Require LTO when building for PowerPC 2025-02-22 23:16:37 -05:00
刘皓
9ed11ecffa
Use libretro's PlayStation 3 Docker image instead of ScummVM's 2025-02-22 16:04:51 -05:00
刘皓
8a8860912a
Merge branch 'libretro-compat' into libretro 2025-02-21 23:56:52 -05:00
刘皓
9e4a221240
Fix many, many compilation errors in libretro PlayStation 3 builds 2025-02-21 14:06:28 -05:00
刘皓
f8d5fc06f5
Disable PIC in static libretro builds
Apparently Vita SDK doesn't support PIC. It throws "Invalid relocation
type 25!" while creating the .self file when building RetroArch.
2025-02-21 00:17:01 -05:00
刘皓
6cbf1b34ca
Move the FLAC fix for Vita SDK into meson.build 2025-02-20 19:20:01 -05:00
刘皓
8559091afd
Fix mpg123-related libsndfile linking error in libretro Vita SDK builds 2025-02-20 18:36:02 -05:00
刘皓
fc26ac927b
Add a pthreads shim for libretro builds on platforms without pthreads 2025-02-20 12:49:36 -05:00
刘皓
20c8f6d463
Get Graphics::update() working (probably) in libretro builds 2025-02-19 18:16:08 -05:00
刘皓
7e4484a640
Start integrating the OpenGL code for sprites into libretro builds 2025-02-18 23:12:42 -05:00
刘皓
613493c773
Merge branch 'misc-fixes' into libretro 2025-02-18 23:10:37 -05:00
刘皓
ceea260b82
Make the xxd command in shader/meson.build less fragile 2025-02-18 22:58:58 -05:00
刘皓
7c5ae9a8e5
Start integrating libretro OpenGL graphics 2025-02-18 14:05:14 -05:00
刘皓
42c4ff9497
Make sandbox_malloc into a coroutine
According to AddressSanitizer, when `sandbox_malloc` causes the
WebAssembly memory to grow in size, every single coroutine on the
sandbox stack gets corrupted. So if `sandbox_malloc` is going to cause
the memory to grow in size, we need to yield so that there are no
coroutines on the sandbox stack while the reallocation occurs.
2025-02-17 00:38:40 -05:00
刘皓
f355a6585e
Disable LTO when using OpenOrbis toolchain
This toolchain doesn't support `-ffat-lto-objects`, so we can't use LTO
properly. Doesn't support C++ exceptions either.
2025-02-14 21:29:44 -05:00
刘皓
7c066a2b24
Change some of the nomenclature in libretro builds 2025-02-14 12:05:30 -05:00
刘皓
ce54a5f898
Don't build relocatable objects in libretro console builds
It seems this isn't supported either.
2025-02-13 22:24:08 -05:00
刘皓
54ed0241fc
Try enabling LTO in libretro console builds but with -ffat-lto-objects 2025-02-13 22:02:59 -05:00
刘皓
4d9de19266
Prelink manually instead of relying on Meson's prelink kwarg 2025-02-13 21:02:29 -05:00
刘皓
4fdb7316b2
Enable prelinking in static libretro builds 2025-02-13 19:42:29 -05:00
刘皓
76c802b901
Fix linker errors in libretro Nintendo Switch build 2025-02-12 21:30:18 -05:00
刘皓
7c36b76a63
Link dependencies as whole for static libretro builds 2025-02-11 23:23:29 -05:00
刘皓
206e8508b6
Replace WABT's WebAssembly runtime with a custom implementation 2025-02-11 20:40:55 -05:00
刘皓
d5dff61ed3
Disable fortification and stack protection in FLAC and Opus in libretro builds
The Emscripten build doesn't support stack protection. Besides, if we
really wanted to enable fortification and stack protection, we would
enable it for the entire application instead of enabling it for only
these two libraries.
2025-02-10 12:58:33 -05:00
刘皓
e52e1a483b
Enable libsndfile's support for FLAC, MP3, Opus and Vorbis in libretro builds 2025-02-09 18:37:32 -05:00
刘皓
80324f0e94
Simplify the libretro Emscripten build process 2025-02-09 00:37:57 -05:00
刘皓
f4659619b0
Fix Audio.bgm_stop in libretro builds
Now it actually stops the audio instead of doing nothing.

Also, calling `Audio.bgm_stop` was causing a crash in Emscripten due to
an exception being thrown internally in OpenAL Soft and C++ exceptions
being disabled when targeting Emscripten. Shouldn't happen anymore.
2025-02-08 16:48:59 -05:00
刘皓
a75cf4ae22
Implement plane bindings for binding-sandbox 2025-02-06 19:44:34 -05:00
刘皓
74ebe267ee
Implement tilemap bindings for binding-sandbox 2025-02-06 15:01:05 -05:00
刘皓
1e42180fa2
Stub out more of the sprite bindings for binding-sandbox 2025-02-05 22:30:04 -05:00
刘皓
1c4d65e02e
Refactor the non-autogenerated parts of sandbox-bindgen into separate files 2025-02-05 01:11:23 -05:00
刘皓
f1ad41814a
Start implementing input for libretro builds 2025-02-04 23:47:54 -05:00
刘皓
d7e002f9b0
Compile Ruby with -Oz -DNDEBUG in libretro builds 2025-02-02 17:05:15 -05:00
刘皓
b9bb3535ae
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.
2025-02-01 17:28:52 -05:00