In Rance 9 (and Blade Briders), KiwiSoundEngine looks up BGM and sound
files in archives by name formatted as "%05d" rather than by archive
index. Since the Sound_Seek function only exists in these games' HLL
definitions, its presence is used to switch Music_IsExist, Music_Prepare,
Sound_IsExist and Sound_Prepare to name-based lookups at PreLink time.
PartsEngine.UpdateComponent() is a three-argument function that
corresponds to the older PartsEngine's Update() function.
PE_UpdateComponent is a one-argument function for
GUIEngine.UpdateComponent().
As noted in notes/parts-engine.md, many functions have been renamed.
They link to existing PE_ functions.
Some functions have had their arguments or return values changed from
int to float. For now, they just use the existing int functions.
Class members are destroyed in the reverse order of their declaration
(like C++). The previous code destroyed members in declaration order,
which caused a use-after-free in Rance 9's T_Map class.
Added a test to verify the reverse destruction order.
When a delegate finishes calling all registered functions,
variable_fini() was called on the original stack arguments. For ref
types, this results in an unbalanced heap_unref() because the caller
pushes raw ref-values without incrementing the reference count. Non-ref
string/struct/array arguments are not affected because their push
instructions allocate new heap slots with ownership.
This fixes use-after-free in T_Loop@checkSelect in Rance 9.
Two changes from Pastel Chime 3 (likely to make the executables
incompatible):
- SystemService.XXX function
- PartsEngine.Update() has two dummy string parameters
The system.ExistsFile() system call returns 1 if a file or directory
exists, but returns 0 when the provided path ends with a directory
separator, regardless of whether a directory exists at that location.
This subtle difference in behavior caused problems in Pastel Chime 3.
The meaning of the method parameter is the same as that of
StoatSpriteEngine.SP_SetDrawMethod.
This fixes a visual issue in Pastel Chime 3's battle scene.
This allows a specified part to be used as an alpha map (clipper) during
rendering. A dedicated vertex shader (parts.v.glsl) is introduced to
calculate clipping coordinates using an inverse transformation matrix.
Refactored parts_render_text() to use parts_render_texture() so that
alpha clipping is applied to text. This also enables color modifications
for text, while rotation and scaling remain unsupported, matching the
original PartsEngine behavior.
Incremented the parts save version since alpha_clipper_parts_no is now
persisted.
This fixes an issue where thumbnails do not display on the save screen
in Pastel Chime 3.
If `cg_name` starting with "<save>" is passed, the function loads the CG
from the save directory.
Note that unlike GoatGUIEngine.SetPartsCG() in Rance Quest, `cg_name`
does not include "SaveData\\".
This library is for rendering the isometric map grid in Pastel Chime 3.
It manages a background texture and an isometric grid texture. The grid
is generated from a sprite tile and an array representing tile
visibility. It provides functions to create, delete, and copy/blend
these textures onto destination sprites.
This HLL provides functionality for loading, managing, and rendering
animations stored in the MAD file format. A MAD file consists of a
header followed by a series of QNT image frames.
Pastel Chime 3 executes system.GroupSave() with a group name of
"共有データ", but that group name does not exist in the OBJG section of
AIN.
Pascha3.exe does not treat such system.GroupSave() calls as failures,
instead behaving as if saving an empty variable group.
Custom comparison functions for string arrays receive their arguments by
value. Create a copy of the strings before pushing them to the stack to
prevent them from being prematurely freed after the function call.
This appears to be an anti-cheat mechanism. To make save files
compatible, it should do the same calculation as the original,
but for now we just return the values as they are.
Memory allocated with xcalloc_aligned (which uses _aligned_malloc on
Windows) must be freed with _aligned_free. Using standard free() caused
heap corruption and crashes.
There is no need to call initialize_instructions() in system4.c, because
ain_open() initializes the instruction set internally when it reads the
VERS tag.
This fixes a crash when processing DefineSprite tags that contain no
PlaceObject2 tags, as seen in Rance Quest's `Battle/斧攻撃・雷.aff`.
These sprites are now registered in parts_flash->sprites with a NULL
object, and are safely skipped by the renderer.
The debugger previously started execution upon receiving a 'launch'
request. This created a race condition where execution could begin
before breakpoints were set by the client.
This change ensures the debugger waits for both 'launch' and
'configurationDone' requests before starting the debugee. This allows
the client to set breakpoints before execution begins.