Commit graph

1953 commits

Author SHA1 Message Date
刘皓
0602c97a0a
Fix dependency compilation errors when compiling for Nintendo consoles 2025-01-16 01:33:44 -05:00
刘皓
44b8d13ff8
Add Nintendo consoles, PS2 and PSP to libretro CI
I'll also add PlayStation Vita and Xbox once I figure out how.

Other than that, I think that's all the game consoles RetroArch supports
that aren't Linux-based!
2025-01-15 22:10:50 -05:00
刘皓
fe5e23a5bc
Fix crash when libretro core is reset 2025-01-15 18:28:22 -05:00
刘皓
de0c5b8f4a
Raise Android API version to 24 for 32-bit Android targets 2025-01-14 21:34:23 -05:00
刘皓
b1131c1a7b
Fix Android libretro builds 2025-01-14 18:51:56 -05:00
刘皓
688544096f
Add Alpine Linux and Android to libretro CI 2025-01-13 23:09:39 -05:00
刘皓
e31dd0f32e
Improve compilation flags for libretro builds 2025-01-10 17:57:10 -05:00
刘皓
4c0ab3639b
Implement handling of fibers and exception catching in libretro sandbox runtime 2025-01-10 00:47:52 -05:00
刘皓
2a204178fe
Implement stackful coroutine-based executor for libretro builds
This executor has the advantage of being able to work correctly when
there are Ruby stack frames underneath C/C++ stack frames in the stack.

Still need to implement handling Ruby fibers.
2025-01-08 19:39:48 -05:00
刘皓
4a94a326b5
Fix libretro phase 1 Makefile and enable stripping in libretro CI
Apparently passing extra tools into `NATIVE_TOOLCHAIN` and
`WASI_TOOLCHAIN` in the phase 1 Makefile breaks libretro builds in
GitHub Actions - binaries built using those phase 1 files are unable to
start up the Ruby VM, although there are no compilation errors. Doesn't
happen when I build phase 1 on my computer though... Nonetheless, I've
removed the extra stuff from `NATIVE_TOOLCHAIN` and `WASI_TOOLCHAIN` in
the Makefile.

Also I've added code into the GitHub Actions workflows to strip the
libretro cores. Enabling LTO in GitHub Actions caused the libretro cores
produced to swell to enormous size compared to when built without LTO
due to the extra debug information added by LTO. However, with stripping
enabled, stripped binaries built with LTO are actually somewhat smaller
than stripped binaries built without LTO.
2025-01-07 18:44:05 -05:00
刘皓
c4d5d8af97
Turn all sandbox bindings into coroutines
We can't have them as normal functions because reentrant calls into the
Ruby API don't work if you do that, i.e. calling into the Ruby API and
that calls mkxp-z's bindings and that calls back into the Ruby API.
2025-01-07 00:02:09 -05:00
刘皓
c4cb891e37
Enable LTO in libretro CI 2025-01-06 20:38:31 -05:00
刘皓
1413feec51
Improve the Makefile for phase 1
* Ruby is no longer required to be already installed to build phase 1
* Commands and versions for everything are now configurable
* The `-j` Make flag is now respected
2025-01-05 22:14:24 -05:00
刘皓
2dbbfd57b4
Use WASI SDK C compiler for preprocessing Ruby headers instead of native C compiler 2025-01-05 17:03:17 -05:00
刘皓
1439b3181d
Use C compiler to preprocess Ruby headers before passing to Ctags
Ctags by itself misses a few functions defined in the Ruby API.
2025-01-05 16:42:48 -05:00
刘皓
19cafa332c
Fix array indexing in sandbox-bindgen.rb 2025-01-05 13:08:33 -05:00
刘皓
7de761873c
Fix _sbindgen_create_func_ptr() implementation 2025-01-04 22:27:02 -05:00
刘皓
3e79e8b390
Add binding generator for Ruby in libretro builds 2025-01-04 18:13:44 -05:00
刘皓
adf4fbf758
Rename lzma subproject to liblzma 2025-01-03 17:42:44 -05:00
刘皓
5cf4e8716b
Improve path normalization in wasi.cpp 2025-01-03 17:29:58 -05:00
刘皓
886fa6b96f
Remove malloc() and free() as much as possible in wasi.cpp 2025-01-03 14:06:35 -05:00
刘皓
d18704d76f
Fix memory leaks in wasi.cpp 2025-01-03 12:22:29 -05:00
刘皓
acb55e42bd
Add the -static flag back into Windows builds
Meson documentation lied to me...
2025-01-03 01:35:35 -05:00
刘皓
e6a6288fc4
Fix libretro Linux builds 2025-01-03 01:20:22 -05:00
刘皓
075a997d8c
Fix undefined behaviour in w2c_wasi__snapshot__preview1 constructor 2025-01-03 00:57:20 -05:00
刘皓
caf0f7ef32
Statically link C++ standard library and libpthread on libretro Windows 2025-01-03 00:04:21 -05:00
刘皓
e581b58305
Use GNU patch in libretro macOS CI instead of BSD patch 2025-01-02 20:40:11 -05:00
刘皓
ff6d72f617
Fix LZMA compilation error on Windows 2025-01-02 19:15:15 -05:00
刘皓
cc52f2e332
Make libzip Meson subproject use header files from the other Meson subprojects 2025-01-02 18:54:50 -05:00
刘皓
77b7dda096
Add all dependencies of libretro build as Meson subprojects 2025-01-02 17:51:22 -05:00
刘皓
54f9055ee1
Remove useless enormous file from Ruby in libretro builds 2025-01-02 12:10:31 -05:00
刘皓
d099f485fd
Change Ruby command-line arguments in libretro builds
The old arguments were invoking undefined behaviour that may or may not
cause crashes when initializing Ruby depending on which path on the
build machine Ruby was built on!
2025-01-02 11:51:55 -05:00
刘皓
7f4a5f46f8
Add -v to ninja command in libretro CI
To help with debugging.
2025-01-02 00:17:30 -05:00
刘皓
ee7ea872a3
Fix libretro Windows builds not being uploaded 2025-01-01 18:14:40 -05:00
刘皓
a32646ff72
Define WABT_BIG_ENDIAN=1 on big-endian hosts
WebAssembly is little-endian regardless of what machine you run it on,
so the WebAssembly implementation needs to know if the machine is
big-endian or little-endian to function properly.
2025-01-01 17:36:52 -05:00
刘皓
ca6fb125c1
Make sure exported libretro/WASI functions match the required signatures
Apparently `environ` is some kind of reserved word in MSYS2's build
environment, which caused hard-to-understand linking errors on Windows
due to one of the functions in wasi.cpp having an argument named
`environ`. I've changed the name of the offending argument to `env`.

I've also added `extern "C"` to all exported functions to make sure
something like this doesn't happen again - the compiler should now
refuse to compile the code if there are function signature mismatches in
exported functions.
2025-01-01 17:17:52 -05:00
刘皓
2723b3396b
Only use gnu_symbol_visibility on macOS 2025-01-01 15:53:04 -05:00
刘皓
5893b94ac7
Replace linker flags in libretro builds with equivalent Meson options 2025-01-01 15:06:28 -05:00
刘皓
42cccfd03d
Only use pkg-config in macOS builds 2025-01-01 14:55:19 -05:00
刘皓
70959f5368
Add macOS aarch64 build to CI 2025-01-01 13:54:17 -05:00
刘皓
a56ec3ff7a
Apply some fixes to libretro CI builds 2025-01-01 02:13:15 -05:00
刘皓
e4b6a75b4a
Add Libretro Linux cross builds and Libretro Windows build to CI 2025-01-01 01:53:26 -05:00
刘皓
5fdb91e830
Readd WASI fd_renumber implementation 2024-12-31 00:28:47 -05:00
刘皓
dbe6ff891e
Implement mounting game zip files
Right now I've implemented opening game files that are in zip format and
added a filesystem implementation to allow reading the game files. I've
also added a `Dir.glob` call core.cpp to print the contents of the root
directory of the game zip file to the log as a test.
2024-12-31 00:25:00 -05:00
刘皓
7dac6a4620
Hash extra-ruby-bindings.h in GitHub autobuild workflow 2024-12-30 20:29:36 -05:00
刘皓
69fdcc0f20
Implement a generic WASI filesystem for ZIP files 2024-12-30 19:01:57 -05:00
刘皓
9d5e18d88b
Fix non-libretro builds for real this time 2024-12-30 14:14:45 -05:00
刘皓
765afcaaa1
Define WASM_RT_TRAP_HANDLER 2024-12-30 14:12:52 -05:00
刘皓
d5de2c0c25
Remove unnecessary args_get implementation 2024-12-30 13:58:38 -05:00
刘皓
4e15b7b2d0
Fix WASI fd_readdir implementation not iterating over subdirectories 2024-12-30 13:49:32 -05:00