刘皓
a84d85cf1f
Update some more dirty flags when deserializing save states in libretro builds
2025-05-30 14:57:24 -04:00
刘皓
6ddc8c6ce4
Update plane/window dirty flags when deserializing save states in libretro builds
2025-05-29 21:54:11 -04:00
刘皓
56c711f1c1
Move some serialization-related code from binding-util to sandbox-serial-util
2025-05-29 21:06:29 -04:00
刘皓
7980cd440a
Handle change watches when deserializing save states in libretro builds
2025-05-29 10:41:19 -04:00
刘皓
c802e24f1b
Fix WASI file descriptor deserialization bugs in libretro builds
2025-05-28 17:07:22 -04:00
刘皓
b664b3c8c7
Disconnect dispose watches before deserializing save states in libretro builds
2025-05-28 16:01:32 -04:00
刘皓
6f472fb732
Handle disposal when deserializing save states in libretro builds
2025-05-28 15:32:43 -04:00
刘皓
1f5d90822c
Remove designated initializers
...
Apparently these are not valid until C++20.
2025-05-27 21:28:29 -04:00
刘皓
ede42dbb1b
Fix serialization of Tilemap::Autotiles
and TilemapVX::BitmapArray
in libretro builds, for real this time
2025-05-27 19:11:58 -04:00
刘皓
8ca753d85d
Continue implementing save state deserialization in libretro builds
2025-05-27 16:59:41 -04:00
刘皓
290ce15875
Fix typos in binding-sandbox/sandbox-serial-util.h
2025-05-26 21:29:10 -04:00
刘皓
d383889d4e
Start implementing save state deserialization in libretro builds
2025-05-25 16:07:40 -04:00
刘皓
c8dc6792b2
Improve pointer deserialization utilities in libretro builds
2025-05-25 14:58:59 -04:00
刘皓
cf11a0ed14
Also change void *&
to const void *&
in sandbox_serialize_member_declaration
2025-05-25 12:39:04 -04:00
刘皓
58e3ec2035
Change second argument of sandbox_deserialize
from void *&
to const void *&
2025-05-25 09:33:12 -04:00
刘皓
7558f3fbcb
Add utilities for deserializing save states in libretro builds
2025-05-24 22:16:26 -04:00
刘皓
bc0bd7fe65
Make some small improvements to save state serialization in libretro builds
2025-05-24 19:19:57 -04:00
刘皓
b1ba7e1606
Fix coroutine state being changed on read in libretro builds
2025-05-24 17:05:11 -04:00
刘皓
0b27c24bd5
Implement save state serialization for stack pointer and Asyncify state/data in libretro builds
2025-05-24 13:25:40 -04:00
刘皓
e957af931c
Implement save state serialization for WASI file descriptors in libretro builds
2025-05-23 23:59:29 -04:00
刘皓
057b6dc95d
Serialize the path of the currently playing movie in libretro builds
2025-05-23 12:06:03 -04:00
刘皓
01ff2ec75a
Apply some small fixes to save state serialization in libretro builds
2025-05-22 19:20:28 -04:00
刘皓
941e0e1cef
Fix linker error in binding-sandbox/sandbox-serial-util.h on some platforms
2025-05-22 13:35:58 -04:00
刘皓
2896ec5abd
Implement save state serialization for C++ objects owned by the bindings in libretro builds
2025-05-22 12:49:01 -04:00
刘皓
4561a0b0f8
Fix edge case in set_private_data
in libretro builds
2025-05-20 19:16:20 -04:00
刘皓
551206e7b4
Don't set private data if an exception has occurred in the bindings
2025-05-20 18:58:44 -04:00
刘皓
39567dd0ea
Add fiber stack indices into libretro save state
2025-05-20 18:34:55 -04:00
刘皓
80b3833fff
Start implementing save state serialization in libretro builds
2025-05-20 17:42:35 -04:00
刘皓
b8fb59e558
Make sure stack_index
is initialized in binding-sandbox/binding-base.h
...
This field needs to be initialized when `struct frame` is constructed,
or its value may be random.
I also changed the type of `stack_index` to `wasm_size_t` so that it's
the same size on every platform.
2025-05-20 15:51:50 -04:00
刘皓
ecfaa4eebf
Add a safety check to mkxp_sandbox::binding_base::object::~object()
2025-05-19 21:14:50 -04:00
刘皓
cd628048ef
Store destructors in a global table instead of in the object itself in libretro builds
2025-05-19 19:27:30 -04:00
刘皓
16e701fc7c
Rearrange typenums in binding-sandbox/binding-util.h in lexicographic order
2025-05-19 16:19:57 -04:00
刘皓
1d88c068fb
Fix libretro PlayStation 3 compilation error in binding-sandbox/binding-base.cpp
2025-05-19 15:48:06 -04:00
刘皓
031245491f
Keep track of all C++ objects allocated by bindings in libretro builds
...
This commit adds `sb()->create_object()`, `sb()->get_object()`,
`sb()->check_object_type()` and `sb()->destroy_object()` in libretro
builds to keep track of all C++ objects allocated by the bindings in
libretro builds. This has some benefits:
* Any C++ objects allocated by the bindings that are still alive when
the game terminates can now be deallocated instead of being leaked
like before.
* We now keep track of the types of all objects allocated by the
bindings, so we will be able to detect when the bindings attempt to
access objects of mismatching type.
* Keeping track of all allocated objects is required to implement
libretro save states.
* Objects are now kept track of using numeric keys whose sizes are the
same on every platform rather than pointers, which helps with making
save states portable across platforms.
2025-05-19 14:44:44 -04:00
刘皓
5b5ffd6f18
Handle game shutdown properly in libretro builds
2025-05-18 10:03:08 -04:00
刘皓
ef58df103a
Remember to actually initialize exception classes in libretro builds
2025-05-18 09:42:42 -04:00
刘皓
83a6b7a1f1
Re-add missing GFX_LOCK
/GFX_UNLOCK
calls in binding-sandbox
2025-05-17 19:41:43 -04:00
刘皓
134e08ce6a
Allow the entire codebase to build with -fno-exceptions -fno-rtti
in libretro builds
2025-05-16 21:59:54 -04:00
刘皓
3b564efd79
Remove direct dependency on Boost.Core in libretro builds
2025-05-16 15:51:51 -04:00
刘皓
e3cbed2fb3
Remove unused next_func_ptr
field of binding_base
2025-05-14 21:16:50 -04:00
刘皓
28fb36af98
Capitalize /Dist, /Game, /Save and /System in libretro builds for consistency
2025-05-13 17:53:59 -04:00
刘皓
d62d6aef3e
Remove WASI_DEBUG
macro
2025-05-12 13:50:48 -04:00
刘皓
67e61917a7
Apply big-endian fixes to binding-sandbox/wasi.cpp as well
2025-05-12 12:39:08 -04:00
刘皓
7347afed21
Revert "Make sure sandbox stack grows upwards in big-endian libretro builds"
...
This reverts commit 58e6f71ef3
.
The original behaviour was the correct one. The stack should always grow
downwards.
2025-05-10 23:37:39 -04:00
刘皓
68b2067a45
Remove void pointer arithmetic in binding-sandbox/binding-base.h
2025-05-10 20:44:46 -04:00
刘皓
58e6f71ef3
Make sure sandbox stack grows upwards in big-endian libretro builds
2025-05-10 19:23:43 -04:00
刘皓
3ba12e5672
Fix handling of big-endian platforms in libretro builds
...
In big-endian libretro builds, the WebAssembly memory is reversed, so no
byte-swapping is required to read from/write to WebAssembly memory
(which is little-endian).
However, that means the ways to get and set values in WebAssembly memory
are endianness-dependent, so I've added the correct such ways for
big-endian platforms.
2025-05-10 18:55:14 -04:00
刘皓
09ed08c087
Fix edge case in memory reallocation algorithm in wasm-rt.cpp
2025-05-10 11:09:20 -04:00
刘皓
c5747f17c5
Fix minor issues in binding-sandbox/binding-base.h and binding-sandbox/binding-util.h
2025-05-10 09:25:43 -04:00
刘皓
8ec189e3d2
Remove always-false static_assert
from binding-sandbox/binding-base.h
...
This is causing compilation errors with some compilers.
2025-05-09 23:28:17 -04:00