Commit graph

19 commits

Author SHA1 Message Date
刘皓
09bcb1532c
Refactor out the SANDBOX_COROUTINE() macro
Removing this macro allows the correct line numbers to show up in GDB
stack traces.
2025-04-30 19:00:48 -04:00
刘皓
2de7a050db
Use property binding helper macros in libretro builds 2025-04-30 15:47:02 -04:00
刘皓
c0b0816b8a
Add wrap_property helper function for bindings in libretro builds 2025-04-28 13:39:06 -04:00
刘皓
b3976bf61e
Fix several bugs and missing bindings in libretro builds 2025-04-16 21:57:13 -04:00
刘皓
981a7a2bd0
Remove unnecessary coroutines from libretro color= binding implementations 2025-04-02 13:22:31 -04:00
刘皓
207a5263e5
Fix typo in libretro flashable bindings 2025-03-22 11:52:44 -04:00
刘皓
7d557354da
Implement flashable and viewport element bindings for libretro builds 2025-03-20 22:38:05 -04:00
刘皓
eb9a5a467e
Add Graphics.frame_count bindings in libretro builds 2025-03-20 21:29:22 -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
刘皓
67de008ed2
Add angle and mirror functions to libretro sprite bindings
Finally, it can get past the title screen of KNight-Blade.
2025-03-17 14:01:19 -04: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
刘皓
cae4166765
Use rb_obj_alloc instead of rb_class_new_instance in binding-sandbox
Somehow, using `rb_class_new_instance` causes use-after-free errors in
the subsequent call to `set_private_data`.

Well, `rb_obj_alloc` is what's used in the normal MRI bindings. I just
replaced the `rb_obj_alloc` calls with `rb_class_new_instance`
at some point in binding-sandbox. Guess that wasn't a good idea.
2025-02-16 23:30:09 -05:00
刘皓
4e05a3cc99
Fix objects being prematurely freed in binding-sandbox 2025-02-07 18:10:06 -05:00
刘皓
060fa3b9b3
Fix some mistakes in binding-sandbox 2025-02-07 12:14:29 -05:00
刘皓
a75cf4ae22
Implement plane bindings for binding-sandbox 2025-02-06 19:44:34 -05:00
刘皓
1e42180fa2
Stub out more of the sprite bindings for binding-sandbox 2025-02-05 22:30:04 -05:00
刘皓
f1ad41814a
Start implementing input for libretro builds 2025-02-04 23:47:54 -05:00
刘皓
739185594e
Implement more of binding-sandbox 2025-01-22 11:52:10 -05:00
刘皓
019812f71e
Start writing class/method stubs for binding-sandbox
I know I've got a long road ahead of me. I'm committing my work so far
for future reference and so that I can check for CI failures.
2025-01-21 12:56:17 -05:00