Commit graph

123 commits

Author SHA1 Message Date
刘皓
cf34d9d464
Implement bold and italic font rendering in libretro builds 2025-08-02 18:04:32 -04:00
刘皓
e2be5b5d50
Fix libretro save state serialization of hires transition map 2025-07-28 23:11:29 -04:00
刘皓
406d6a479f
Don't try to free resources in Bitmap::releaseResources() if the bitmap isn't initialized 2025-07-09 13:53:07 -04:00
刘皓
32802c0721
Don't call assumeRubyGC(false) in Bitmap::sandbox_deserialize_begin 2025-07-06 11:20:45 -04:00
刘皓
1a275a1866
Properly set assumingRubyGC when deserializing bitmaps from libretro save states 2025-07-06 11:08:44 -04:00
刘皓
e22b2c6d5a
Fix some bugs and safety issues in sandbox memory manipulation functions 2025-07-03 22:04:29 -04:00
刘皓
00c688309b
Fix edge case in pointer unswizzling algorithm for libretro save state serialization
If there are two Ruby objects, A and B, that are both no longer used
(i.e. they're able to be freed by the Ruby garbage collector), and A
references B, then it's possible for the Ruby garbage collector to free
B but not also free A in the same garbage collection cycle.

The pointer unswizzling algorithm currently crashes when the garbage
collector does this because the object A will still be in
`sb()->objects` but B will not be, and so save state serialization will
still try to serialize A. When the pointer unswizzling algorithm tries
to serialize all the other objects A references and cannot find the
referenced object B, the program crashes.
2025-07-02 13:32:06 -04:00
刘皓
2f5850bfc1
Fix some bugs in bitmap deserialization for libretro save states 2025-06-24 18:14:08 -04:00
刘皓
ef64eaa4e5
Implement reinitializing OpenGL objects in libretro builds
Libretro provides a way to detect when the OpenGL context is destroyed,
like on Android and possibly also iOS when switching between apps. This
commit implements reinitializing all OpenGL objects when this happens so
that the graphics continue to function in this case.
2025-06-10 16:30:44 -04:00
刘皓
75b3108321
Fix some edge cases in handling animated bitmaps in libretro builds 2025-06-03 14:03:02 -04:00
刘皓
47ed9730ed
Fix some remaining issues with bitmap serialization/deserialization for libretro save states 2025-06-02 13:19:31 -04:00
刘皓
c679d27017
Optimize handling of empty diff tiles during bitmap libretro save state deserialization 2025-06-01 22:58:21 -04:00
刘皓
cfc8eb93ba
Fix libretro save state serialization of Bitmap.fill_rect 2025-06-01 22:48:13 -04:00
刘皓
4887ac62ad
Implement serializing/deserializing bitmap pixels for libretro save states 2025-06-01 21:35:27 -04:00
刘皓
adc9cdd96d
Implement reloading bitmaps during libretro save state deserialization 2025-05-31 18:33:47 -04:00
刘皓
6f6efb4ef0
Fix fonts and autotiles/bitmap arrays being leaked when serializing libretro save states 2025-05-31 12:26:26 -04:00
刘皓
2ee1b61670
Fix some more bugs in libretro save state serialization/deserialization 2025-05-31 10:47:47 -04:00
刘皓
28b81ca95d
Update tilemap dirty flags during libretro save state deserialization 2025-05-29 14:57:02 -04:00
刘皓
7980cd440a
Handle change watches when deserializing save states in libretro builds 2025-05-29 10:41:19 -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
刘皓
d383889d4e
Start implementing save state deserialization in libretro builds 2025-05-25 16:07:40 -04:00
刘皓
1b0757c5db
Fix save state serialization of bitmaps in libretro builds 2025-05-23 10:09:03 -04:00
刘皓
01ff2ec75a
Apply some small fixes to save state serialization in libretro builds 2025-05-22 19:20:28 -04:00
刘皓
bff931ce94
Fix linker error in bitmap.cpp in libretro 3DS build 2025-05-22 15:26:26 -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
刘皓
aef7eff511
Fix some compilation errors in standalone builds 2025-05-17 13:03:57 -04:00
刘皓
5199c48de7
Remove exceptions from mkxp-z src/ directory 2025-05-16 15:54:32 -04:00
刘皓
f57568e051
Allow some libretro core options to be changed during execution 2025-05-11 18:54:56 -04:00
刘皓
87eea255c5
Remove void pointer arithmetic in src/display/bitmap.cpp 2025-05-10 23:27:30 -04:00
刘皓
2a8370a8ee
Fix typo in bitmap.cpp 2025-05-10 20:09:56 -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
刘皓
13c0657691
Handle current working directory properly in libretro builds
Any relative paths that the game tries to access in libretro builds will
now be relative to whatever is the current working directory in the Ruby
sandbox, which will also now be initialized to the game directory during
initialization. Before, all of the bindings that took paths were
hardcoded to prepend the path with the game directory.
2025-05-06 16:55:28 -04:00
刘皓
a0219e7c79
Implement loading animated GIF bitmaps in libretro builds 2025-05-03 11:07:55 -04:00
刘皓
2de7a050db
Use property binding helper macros in libretro builds 2025-04-30 15:47:02 -04:00
刘皓
6c83fbe180
Implement UTF-8 parsing for Bitmap.draw_text/.text_size in libretro builds 2025-04-19 23:37:39 -04:00
刘皓
ae0a7a7f87
Implement text shadow and outline in libretro builds 2025-04-19 11:53:53 -04:00
刘皓
b3976bf61e
Fix several bugs and missing bindings in libretro builds 2025-04-16 21:57:13 -04:00
刘皓
8c16bc0092
Implement config loading in libretro builds 2025-04-11 23:12:05 -04:00
刘皓
5a0a8b76bd
Implement solid text rendering in libretro builds 2025-04-04 21:55:30 -04:00
刘皓
23781a645b
Implement bindings for changing font size and color in libretro builds 2025-03-31 18:48:14 -04:00
刘皓
81b94d1498
Remove dependency on SDL headers in libretro builds
I'd already removed the SDL static libraries from libretro builds for
portability, but kept the headers to make it easier to port the codebase
to libretro. Eventually it was time to stop using the SDL headers as a
crutch.
2025-03-29 12:37:07 -04:00
刘皓
c2aa007228
Fix text size calculation in libretro builds
Since I got rid of SDL in libretro builds, I can't use SDL_ttf, so I
have to implement text rendering somewhat more manually. I'm still
getting the hang of it.
2025-03-27 14:59:28 -04:00
刘皓
a6393d6301
Implement rudimentary FreeType-based font rendering in libretro builds
Yes, it's quite garbage, but I'll improve on it later. What's important
is that it helps get libretro builds to a testable state.
2025-03-05 17:11:39 -05:00
刘皓
740dfd51c9
Start integrating font code into libretro builds 2025-03-04 18:52:20 -05:00
刘皓
9f33a0acea
Implement image loading in libretro builds 2025-02-25 12:53:57 -05:00
刘皓
2029539ece
Replace pixman with pixman-region in libretro builds 2025-02-24 17:13:25 -05:00
刘皓
8a8860912a
Merge branch 'libretro-compat' into libretro 2025-02-21 23:56:52 -05:00