Commit graph

63 commits

Author SHA1 Message Date
刘皓
dcd29f44a9
Remove dependency on libzip in libretro builds 2025-03-31 13:26:54 -04:00
刘皓
de5216c3ce
Implement loading from encrypted game archives in libretro builds 2025-03-30 23:37:19 -04:00
刘皓
79af1d7028
Reset the active OpenGL texture every frame in libretro builds
This isn't to fix any bug I've experienced on any platform thus far, but
to avoid problems showing up in the future, since the libretro API docs
say you should unbind everything every frame.
2025-03-20 12:11:57 -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
刘皓
247c9a5485
Remove unnecessary gl.BindFramebuffer != NULL check from core.cpp 2025-03-14 14:41:43 -04:00
刘皓
0bf11c857f
Merge branch 'libretro-compat' into libretro 2025-03-12 12:48:44 -04:00
刘皓
bee7716b0d
Don't get libretro callbacks if core is initialized
It seems getting performance callbacks also doesn't work except in the
specific call to `retro_set_environment` that occurs before the core is
initialized, so this seems easier than handling only the logging
callback specially.
2025-03-12 12:48:24 -04:00
刘皓
ebca366cc3
Merge branch 'libretro-compat' into libretro 2025-03-11 22:38:55 -04:00
刘皓
ca78a29ad5
Fix RetroArch logs being empty for libretro builds on certain platforms
See commit d8a6f293e01faac371a8776c1cc65755136febb8 from https://github.com/EasyRPG/Player/pull/3365
2025-03-11 22:00:26 -04:00
刘皓
f3419a9c16
Merge branch 'libretro-compat' into libretro 2025-03-03 12:08:13 -05:00
刘皓
15e832cb34
Use _aligned_free() to free memory allocated by _aligned_malloc() 2025-03-03 12:07:45 -05:00
刘皓
bffd6a280e
Merge branch 'libretro-compat' into libretro 2025-03-02 14:13:57 -05:00
刘皓
95dc3d6908
Fix game path trimming in core.cpp on Windows 2025-03-02 13:35:04 -05:00
刘皓
6ab88d328b
Tell the libretro frontend to try to prevent OpenGL context destruction 2025-03-02 11:28:12 -05:00
刘皓
656e81fbb6
Remove erroneous return statements from retro_run()
We need to call `video_refresh()` exactly once every time `retro_run()`
is called as per the libretro docs. These return statements were
preventing that from happening.
2025-03-01 22:01:23 -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
刘皓
8126afddca
Unbind OpenGL objects after every frame in libretro builds 2025-02-26 20:12:10 -05:00
刘皓
3c878ef4c1
Set all OpenGL state again every frame in libretro builds, not just the viewport
Since the libretro frontend can do whatever to the OpenGL state between
frames, we can't make any assumptions about the state at the beginning
of a frame.
2025-02-26 17:58:41 -05:00
刘皓
4a810730f1
Merge branch 'libretro-compat' into libretro 2025-02-22 23:16:58 -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
刘皓
20c8f6d463
Get Graphics::update() working (probably) in libretro builds 2025-02-19 18:16:08 -05:00
刘皓
540d5f1a1a
Integrate fallback glBindFramebuffer implementation into libretro builds 2025-02-19 12:28:20 -05:00
刘皓
7e4484a640
Start integrating the OpenGL code for sprites into libretro builds 2025-02-18 23:12:42 -05:00
刘皓
4b17373dc7
Implement loading OpenGL symbols in libretro builds 2025-02-18 18:39:01 -05:00
刘皓
7c5ae9a8e5
Start integrating libretro OpenGL graphics 2025-02-18 14:05:14 -05:00
刘皓
206e8508b6
Replace WABT's WebAssembly runtime with a custom implementation 2025-02-11 20:40:55 -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
刘皓
44da7c5f9c
Implement the rest of the vanilla RGSS input API for libretro builds 2025-02-05 17:28:39 -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
刘皓
37a7559e38
Remove dependency on ghc::filesystem in libretro builds 2025-02-01 13:03:13 -05:00
刘皓
f03d8e3f5d
Embed mkxp-z version into the libretro core 2025-01-31 23:35:20 -05:00
刘皓
9f8d321c84
Use a better method of fixing the Emscripten OpenAL symbol conflict 2025-01-30 22:55:20 -05:00
刘皓
e598114a73
Fix OpenAL symbol conflict in libretro Emscripten build 2025-01-30 21:25:20 -05:00
刘皓
b249ad0d98
Add Ogg, Vorbis and libsndfile to libretro builds 2025-01-28 23:25:17 -05:00
刘皓
64f0f093c3
Render audio to OpenAL every frame in libretro builds 2025-01-27 17:47:33 -05:00
刘皓
66720a5bc0
Use embedded GMGSx.sf2 as soundfont in libretro builds 2025-01-27 13:15:55 -05:00
刘皓
b1133b78f7
Fix some libretro compilation errors on Android, Darwin, Nintendo and Windows 2025-01-27 11:48:53 -05:00
刘皓
c42949713d
Start integrating the audio code into libretro builds 2025-01-27 00:34:52 -05:00
刘皓
84ca884f84
Reimplement WASI filesystem on top of existing mkxp-z filesystem implementation
This allows more flexibility when loading games in libretro builds,
since we can now load games either from a directory or from a ZIP or 7Z
archive. Also, the path cache is now active for all filesystem calls
made from inside Ruby.
2025-01-25 22:03:52 -05:00
刘皓
b1206d9dc5
Implement enough stub bindings for binding-sandbox to begin testing KNight-Blade 2025-01-23 14:23:34 -05:00
刘皓
7d753e2655
Implement even more of binding-sandbox
I've made it so that `Graphics.update` pauses the Ruby VM and returns to
the libretro frontend. Once the libretro frontend calls `retro_run()`
again, the Ruby VM resumes. This allows the libretro frontend to control
the rendering loop.
2025-01-22 21:52:55 -05:00
刘皓
739185594e
Implement more of binding-sandbox 2025-01-22 11:52:10 -05:00
刘皓
4c9e68e066
Convert VALUEs to little-endian before passing to function pointers 2025-01-21 20:14:53 -05:00