Delegates "weakly" reference objects, meaning that referenced objects
can be deleted. Delegate invocations must not invoke on deleted objects.
This is achieved as follows:
* Each heap object has a sequential number.
* Each delegate object is backed by a page storing (object, function,
seq) triples.
* Deleted objects can be detected by comparing the sequential number
stored in the delegate with the sequential number of the object
currently on the heap.
This is consistent with the AliceSoft's implementation (presumed from
the contents of resume save).
This implementation removes dead objects from the delegate in DG_CALL
and DG_NUMOF instructions. (We could do that more often, e.g. when an
object is added to a delegate.)
This breaks existing resume saves that contain delegates. For games that
predate delegate support, this does not affect the save format.
This reverts the following commits:
* 4b1257f "Fix delegate memory management"
* 9bb4665 "Add changes to vm.h" (partial revert)
* 75d6386 "Fix ResumeSave/ResumeLoad bugs with delegates" (partial
revert)
We are going to take a different approach to implementing weak
references in delegates.
As far as I'm aware, the only unimplemented functionality is Y-rotations
of parts objects, which is only used for some screen transition
animations. I was able to clear the game without issue.
When loading parts, we need to mark them as dirty and recalculate
hitboxes. Also fix loading of numerals, which was completely broken
previously on games that use combined numeral CGs (e.g. Rance 01).
Numerals now use a `parts_numeral_font` structure, so that textures can
be shared between numeral objects.
Add an option to insert a delay when skipping messages with CTRL.
This is accomplished by overriding the 'A' function. Since the function
to check the state of a key (CTRL in this case) varies by game, an
xsystem4-specific system call is added for this purpose.
Fixes#119
* SetFind(2) lets the sprite to participate in hit testing even if it is
not visible.
* SetAnime() respects frame_s and frame_e parameters. Sprites animate
only when `current` is within the range of [frame_s, frame_e].
* SetCurrent() resets animation state.
DALKDemo is responsible not only for the opening demo but also for the
UI of the title menu. This change fully implements DALKDemo. DALKEDemo
is stubbed out.
gfx_render_text uses floats for layout, so the parts_text layout should
use floats to match.
This fixes an issue with off-center text in the English version of Rance
01.
The interface to this feature is strange. The message window visibility
state is passed to Update/UpdateParts every frame rather than being a
part of the global parts state. I've implemented it using global state,
which might be subtly wrong in some way, but it seems to work as
expected in Rance 01.
PE_UpdateComponent needs to be called before rendering the starting
frame of a transition effect.
This fixes a glitch in the ●立ち絵 function of Rance 01 when
transitioning to a variant CG.