For reasons which I can't explain, the string "タイプ = ループ" doesn't
work correctly as a format for sscanf on mingw.
Instead, we match the exact string including whitespace.
Previously, the debugger displayed `ref int` variables like this:
ref_int: <unsupported-data-type>
<void>: <unsupported-data-type>
This commit introduces `dbg_variable_to_string()` to dereference these
variables and display their underlying value. Both the command-line and
DAP debugger interfaces have been updated to use this new functionality.
During dungeon initialization, these functions may be called with
uninitialized variables that hold the coordinates from the previous
dungeon exploration.
Replaced the hardcoded 40x3x40 dungeon size with dimensions read
dynamically from the `m_dsd` data structure. This allows for loading
dungeons of various sizes.
This change adds a check to ensure that a door is present before
attempting to set its lock status.
This is necessary because the trap that locks doors has a bug and
attempts to lock doors in the wrong direction.
This fixes https://github.com/kichikuou/xsystem4-android/issues/22.
Once the user grants network access permission, Rance Quest will call
HTTPDownloader.Post upon startup, making it impossible to start the
game without this change.
This fixes#277.
Now dungeon_load_dungeon() and dungeon_load_texture() can be called
multiple times without causing memory leaks.
This change also simplifies the loading process by removing
dungeon_finalize_loading() helper function, as the map only depends on
ctx->dgn, while the renderer only depends on ctx->dtx.
Use ceil(threshold) as cutoff distance in dilate shader, and tone down
the strength of the fractional part of the threshold.
Take bold width into account during layout.
This fixes the text rendering of name plates in Rance Quest.
This function is responsible for generating random dungeons for Pastel
Chime Continue.
The dgn_generate_drawfield() function implements the main logic. This
algorithm constructs the dungeon through a multi-step process involving
room creation, recursive expansion, wall placement, treasure room
generation, and corridor pruning/extension.
AutoDungeonE_Create() calls this function to create a layout based on
specified parameters, and then populates arrays with the proposed
coordinates of items, enemies, and traps.
This implementation strives to faithfully reproduce the behavior of
DrawField.dll, including its bugs, although it has not been strictly
verified.
The DAP 'evaluate' request handler now correctly uses the 'frameId'
argument to set the evaluation context.
This also fixes incorrect evaluation of expressions containing non-ASCII
characters.
Because make_rsave() determines the version of resume save based on the
AIN version, it returns RSM v6 for Pastel Chime Continue. But this game
requires the comment field added in RSM v7.
This solves the issue by upgrading to RSM v7 when comments are written
to the save file.
In hll_call(), pointers to heap data passed by reference could become
invalid if the heap was reallocated during the call.
The previous implementation attempted to prevent this by calling
heap_guarantee() to pre-allocate heap space. However, this approach
does not work for certain functions in PastelChime2 HLL, which can
perform an unbounded number of heap allocations.
This commit removes heap_guarantee() and replaces it with a more robust
copy-in/copy-out strategy:
- Before the call (Copy-in): For reference arguments, the pointer value
is copied from the heap to a local variable on the stack. A pointer to
this local variable is then passed to the HLL function.
- After the call (Copy-out): The pointer value, which may have been
modified by the HLL function, is written back from the local variable
to its original slot in the heap.
This HLL implements the core gameplay logic for the 3D dungeon
exploration mode.
Key features:
- Collision and Movement:
- Implements 2D collision detection for player movement against walls.
- Field_CalcMove() function calculates the desired position and
adjusts it to slide along walls upon collision.
- Party and AI Mechanics:
- Field_UpdatePlayersUnit() manages party movement, creating a smooth,
snake-like following behavior for up to two companions.
- Field_UpdateEnemyPos() provides basic enemy AI, enabling them to
chase the player when in line-of-sight and within range, or return
to a base position otherwise.
- Interactive Environment:
- Field_UpdateDoors() implements automatic doors that open and close
based on player proximity.
- Field_CheckObjectHit() detects when the player enters the hit-range
of an object, triggering events.
- 3D Space UI:
- Adds dungeon_project_world_to_screen() to translate 3D world
coordinates into 2D screen positions.
- Field_UpdateObjectNamePlate() and Field_UpdateDoorNamePlate() use
this projection to display and manage interactive nameplates for
objects and doors.
- Data Persistence:
- DungeonDataSave() and DungeonDataLoad() serializes and deserializes
the complete dungeon state to .DSD files.
- Integrates dungeon data with the main save system by copying .DSD
files to/from slot-specific .DSA files.
Note: The most complex function in this HLL, the dungeon generator
AutoDungeonE_Create(), is not implemented in this change.
DrawField is a variant of DrawDungeon. Unlike the first-person
perspective of DrawDungeon, DrawField uses a third-person, bird's-eye
view camera.
Key features include:
- Character Rendering: A new system to render up to 256 billboarded
sprites (characters, enemies, etc.) in the 3D world. The renderer
supports controlling position, sprite animation, and visibility for
each character.
- DrawField HLL API: Functions for loading assets, managing characters,
and manipulating dungeon properties like door locks.
- Renderer: The core renderer is updated to support the DrawField mode.
This includes disabling fog, handling sprite sheets via UV
manipulation, and rendering ceilings as billboards.
- Map: The 2D map has been updated to reflect the DrawField style,
including colored door lock indicators.