xsystem4.scene: returns a list of scene entities
* all entities have an entityId that can be used in further requests
* SACT2 sprites have a 'sprite' member with a spriteId that can be
used in further requests
xsystem4.renderEntity: renders a scene entity and returns the texture
xsystem4.spriteTexture: returns the stored SACT2 sprite texture
xsystem4.renderParts: renders a parts object and returns the texture
xsystem4.partsTexture: returns the stored parts object texture
Image data in texture objects is RGB8888 encoded in base 64.
Transparent objects should be drawn in order from furthest to nearest.
In DrawDungeon, the actual viewpoint is slightly behind the camera, but
this was not taken into account when sorting cells by distance.
Fixes#120
And by extension config.save_dir. This fixes an issue where paths
retrieved by system.GetSaveFolderName and then passed to gamedir_path
would become invalid.
Fixes#115
So far only basic debugging functionality is implemented (breakpoints,
stepping, stack traces/variables).
This is not tested against an established DAP client. My intention is to
create a custom GUI frontend and extend the protocol to support
xsystem4-specific features, such as inspecting the scene. (This work is
underway.)
Instruction references are hex-encoded address strings. Clients do not
need to obtain them from DAP requests. This is outside the spec, but it
is needed for a binary-only debugger.
Functions that write directly to stdout (e.g. printf) should generally
not be used any more. Instead, use either sys_message (which respects
sys_silent) or log_message (which will send the message to the debugger
if DAP is enabled). stderr can be used as normal.
Don't allocate massive textures for each text object. Instead, allocate
a texture for each character and then compose them onto an appropriately
sized texture.
Fixes a performance issue in Rance 01.
When loading a delegate, the stored objects must be registered to it.
Also, delegate_call cannot use vm_execute because the VM cannot be
resumed from such a state.
Incidentally, this means that ResumeSave cannot be called from within a
constructor/destructor (since they also use vm_execute), but this is
probably not a problem.
The format should not be considered stable at this point, as PartsEngine
support is still experimental and subject to change. But it's useful to
have these functions for testing purposes.
Although delegate pages store references to objects on the heap,
adding/removing objects from a delegate does not affect their reference
counts. When an object that is a member of a delegate is deleted, it is
automatically removed from the delegate.
In practice, this means that every object needs to keep a list of
delegates that it belongs to. This increases the size of the page header
on 64 bit systems, but not by much since the additional metadata can be
stored in a union with the array-specific metadata.
The game currently runs up until the first unimplemented function
(SeekEndMotion) during the intro events, using the existing PE_
functions with a few minor fixes.
The afa implementation from libsys4 now handles basename indexing, so we
use that instead of creating a separate index. Also, afa v1 is now
properly supported in libsys4, so there is no need for the
id_indexed_afa hack.
Statically link FFmpeg on Windows. This requires building a slimmed-down
version of FFmpeg from source. The build process is documented in the
README.
Also add ffmpeg dependency to the nix flake.
This allows playback of videos in encodings other than MPEG-1, e.g. VC-1
used in the English version of Rance VI.
The FFmpeg dependency is optional. If it's not available, the PL_MPEG
backend will be used.
Try to link statically as much as possible on Windows, to reduce the
number of DLLs that have to be shipped with Windows builds.
Also document the build process on Windows.
In SACT2 it's declared as int, so any integer can be passed. A Sengoku
Rance mod actually passes 2, but some compilers generate code that
interprets it as false.
After this, xsystem4 uses the global/group save format used by the
original System4, instead of the JSON format. Existing JSON save files
can still be loaded.
This makes save files interoperable between System4 and xsystem4 in some
games, including Sengoku Rance and Toushin Toshi III.
Otherwise it ERROR()s in gfx_set_framebuffer() due to an incomplete
framebuffer.
This happens when trying to display text without specifying a message
window in SACT2. AliceSoft's implementation ignores this.