Part of StoatSpriteEngine and KiwiSoundEngine.
This fixes an issue with per-channel volume settings not working
correctly in Haruurare (and presumably other games).
Only unscaled glyph bitmaps are now cached in regular memory. Scaled
glyphs are stored as textures on the GPU. Only the alpha channel on
glyph textures is used, with the color being provided as an input to the
shader.
Outline and bold rendering is improved by using a simple dilate shader.
This looks okay but could be improved (the result is a bit blurry
still).
This improves the look and (especially) the performance of text
rendering in the MangaGamer version of Sengoku Rance.
There are still some bugs/unimplemented features, but the game should be
more or less bearable to play in this state.
The game now basically runs, but with very bad performance and lots of
aliasing on text.
Need to implement anti-aliasing and caching of rendered glyphs next.
Add an option to control the horizontal scaling of text. This is mainly
to work around text overflow issues in the MangaGamer version of Rance
02 (an appropriate value is set automatically for that game).
Read .xsys4-debugrc from ~/.xsystem4 and/or the game directory on
startup. This is just a text file with one debugger command per line.
Can be used to set breakpoints or log functions automatically at
startup.
This can also be used to work around a limitation on Windows where the
IME doesn't work in the debugger, making it impossible to input Japanese
text.
Add vm-state command, which prints disassembly around the current
instruction pointer and the current contents of the stack.
It was necessary to change how breakpoints are implemented for this.
When adding a breakpoint, the original opcode now remains in the
instruction stream, bitwise-or'd with BREAKPOINT. A hash table indexed
by address is used to store breakpoint objects.
* Add "frame" command to change the current frame.
* Add "members" command to print struct members for current frame (if it's
a method frame).
* Support printing member variables (e.g. "this.var") in the "print"
command.
Gpx2Plus.CopyStretchReduceAMap behaves differently in the English
version.
Fixes an issue with text being squashed horizontally on the regional
phase menus.
System 4 has 4 font weights: light, medium, bold and heavy bold.
SDL_ttf has 2 (normal and bold). For now, xsystem4 treats light/medium
as normal and bold/heavy-bold as bold.
It was a bug to call this function outside of sact_Update, because it
set scene_is_dirty to false without first rendering the scene. This can
cause the scene to not be rendered in a timely manner.
cJSON_AddArrayItem is O(n), which made saving arrays O(n^2). This was
causing extremely poor performance when saving large arrays, such as
those created by MultiSprite_Encode.
A special cJSON_CreateIntArray_cb function is now used instead, which
can create and populate an array in O(n).
Add a new debugger interface using a simple command language. This is
less powerful than the scheme interface (which still exists) but more
ergonomic for interactive debugging.
This debugger has no external dependencies (it will however use readline
if available) and is included in builds by default.
A sample interaction might look like:
xsystem4 --debug /path/to/game
dbg(cmd)> breakpoint bar
Set breakpoint at function 'bar' (0x00001234)
dbg(cmd)> continue
Hit breakpoint at function 'bar' (0x00001234)
dbg(cmd)> backtrace
#0 0x00001234 in bar
#1 0x00002222 in foo
#2 0x00004444 in main
dbg(cmd)> locals
[0] i: 2
[1] s: "baz"
dbg(cmd)> locals 1
[0] j: 3
[1] obj: { m_i = 0; m_s = "" }
dbg(cmd)> quit
For structs / arrays, json_to_vm_value() calls json_load_page() on
freshly allocated pages for which no constructor has been called.
json_load_page() should not call destructors for such uninitialized
pages.
json_load_page() is also called by BanMisc.LoadStruct and File.Read,
with an initialized struct. In that case destructors should be called.
This fixes crash in Widenyo after system.GroupLoad.
The method parameter of this function has a different meaning from that
of SACT2.SP_SetDrawMethod.
I've only checked it in Widenyo, but it seems 0 and 1 are valid values
and 1 is additive blending.
Refactor GoatGUIEngine into various files under src/parts/.
The external interface to this code is the functions prefixed with PE_
and generally following the naming of the HLL functions which they
implement.
The reason for this is that there are multiple HLL libraries that
implement more or less the same GUI interface (GoatGUIEngine, GUIEngine
and PartsEngine).
Also added here are a number of miscellaneous stubbed-out HLL functions
that are used by Rance 01 (which now runs up to the point where it tries
to create the title menu).
1. DG_CALL has to clean up the stack before jumping to the return
address.
2. DG_SET (contrary to its name) is an append operation; it's basically
a combination of DG_NEW_FROM_METHOD and DG_PLUSA.
3. DG_SET and DG_PLUSA need to check for and ignore duplicates.
4. Delegate pages store *references* to structs; the VM should NOT copy
the struct page when copying a delegate page.