Commit Graph
38 Commits
Author SHA1 Message Date
Nunuhara Cabbage 0d771384da Fix SengokuRanceFont.SP_SetTextMetricsClassic
This function doesn't overwrite values in the text style that aren't
contained in the sact_text_metrics_t object.
2022-04-30 06:33:20 -07:00
Nunuhara Cabbage f2dd4def12 Fix bug in gfx_draw_glyph
blend_amap_color_shader now uses the alpha value.
2022-04-29 18:13:22 -07:00
Nunuhara Cabbage 9089fa1fd1 Rewrite fnl font renderer
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).
2022-04-28 19:13:27 -07:00
Nunuhara Cabbage 8fb0153963 SengokuRanceFont: anti-aliasing and glyph caching
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.
2022-04-24 17:19:27 -07:00
Nunuhara Cabbage 3b72b88e9c SengokuRanceFont improvements
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.
2022-04-23 22:52:07 -07:00
Nunuhara Cabbage 21cb503c06 Read debugger config at startup
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.
2022-04-14 10:54:00 -07:00
Nunuhara Cabbage 9ede2d7af9 debugger: add vm-state command
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.
2022-04-14 09:08:57 -07:00
Nunuhara Cabbage 3507ebc609 Fix texture leak in sprite_set_cg_2x 2022-04-10 18:43:41 -07:00
Nunuhara Cabbage 912a73d42a Implement HLLs for English version of Rance VI 2022-04-10 18:24:47 -07:00
Nunuhara Cabbage 1f239c766f Rance 02: render '}' as dash 2022-04-04 20:17:34 -07:00
Nunuhara Cabbage 47cb99927d Update libsys4 2022-04-02 08:32:48 -07:00
Nunuhara Cabbage bd0b488a75 Don't call "0" function if it doesn't exist
To support .ain files produced by sys4c which doesn't create the global
alloc function (yet).
2022-01-23 10:33:29 -08:00
Nunuhara Cabbage 5f221d939f Add -e,--echo-message option
Add option to echo messages to standard output. Messages are prefixed
with "MSG %d:" so that they can be filtered by a script.
2021-12-11 09:57:46 -08:00
Nunuhara Cabbage 39c69423e3 Fix audio bug causing infinite loops in SR
Fix bug where SACT2.Music_IsPlay would return true after a stream
stopped playing. This was causing infinite loops in Sengoku Rance when
waiting for a fade-out to complete.
2021-12-09 20:33:19 -08:00
Nunuhara Cabbage 488ccc0c74 Implmement MainEXFile HLL (Rance 01 version)
Implement the Rance 01 version of MainEXFile (later versions have a
different interface).
2021-10-22 18:34:39 -07:00
Nunuhara Cabbage 5ff042738e Initial delegates implementation
This isn't very well tested yet, but it runs Rance 01 up to the first
HLL error.
2021-10-18 10:45:10 -07:00
Nunuhara Cabbage ab5c86b1fa Implement joypad support 2021-09-19 20:28:51 -07:00
Nunuhara Cabbage f25e26ecf4 Refactor archive management code
Implement a new interface for managing archives. This is mainly to
support loading afa archives alongside ald archives.

Also included here is some code for creating an index for afa CG
archives (the numbers used to reference CGs in afa archives correspond
to the file name, not the position in the archive).
2021-05-16 08:06:40 -07:00
Nunuhara Cabbage 654e0b4737 Implement various instructions
Implement:
    SH_SASSIGN_STRUCTSREF
    SH_SASSIGN_GLOBALSREF
    SH_STRUCTSREF_NE_STR0
    SH_GLOBALSREF_NE_STR0
    SH_LOC_LT_IMM_OR_LOC_GE_IMM

Also, fix an bug in A_EMPTY and SH_IF_STRUCT_A_NOT_EMPTY.
2021-05-14 22:38:32 -07:00
Nunuhara Cabbage 17639a7ec3 Support reading AliceStart.ini 2021-05-13 21:06:23 -07:00
Nunuhara Cabbage 3249138bf4 Implement SH_REF_LOCAL_ASSIGN_STRUCTREF2
Used in Haruka VS Escalayer
2021-05-13 20:07:16 -07:00
Nunuhara Cabbage ba2accdf58 Implement remaining instructions for Haru Urare
A few of the new instructions which were not used in that game are still
unimplemented.
2021-05-12 16:40:51 -07:00
Nunuhara Cabbage 2365fb3a01 Implement various SH_ instructions
Implement various shorthand instructions introduced in Alice 2010. This
is enough to get through the first scene in Haru Urare.
2021-05-09 20:53:32 -07:00
kichikuou 89e37c2428 Add dependency wrap file for cglm
Since libcglm-dev is not available in Debian buster (added in bullseye).
2021-05-08 22:42:57 +09:00
kichikuou adb558c67c Initial implementation of DrawDungeon.hll (Rance VI)
In addition to DrawDungeon.c, this adds the following files in
{src,include}/dungeon/:

- dgn.{h,c}: Parser for .dgn (map data)
- dtx.{h,c}: Parser for .dtx (textures)
- tes.{h,c}: Parser for .tes (sound IDs associated with textures)
- dungeon.{h,c}: Renderer main routines
- mesh.{h,c}: Renderer for walls and stairs
- skybox.{h,c}: Renderer for background cubemap
- event_markers.{h,c}: Renderer for event markers

And the following changes are made to the existing graphics code:

- sact_Update() calls dungeon_update(), so that event markers animate
- gfx_render_texture() renders vertically flipped image when
  texture.flip_y == true (see the comment in dungeon_context_create())

Some features are not implemented yet, including 2D maps and door
animation.

This makes cglm a dependency.
2021-05-08 22:42:57 +09:00
Nunuhara Cabbage b986789b64 Initial implementation of StoatSpriteEngine
Implement the SP_SetText* and MultiSprite_* functions added by
StoatSpriteEngine (as well as the TRANS_* functions introduced in
SACTDX). Enough to get to the opening movie in Vanish!
2021-05-02 16:07:06 -07:00
Nunuhara Cabbage 4f75f2d7ed Refactor sact_graphics.c
Split the code from sact_graphics.c into sprite.c and hll/SACT2.c.
sprite.c contains an index-independent sprite/scene interface, whereas
hll/SACT2.c handles the indexing of sprites.

This is to better support the StoatSpriteEngine.MultiSprite_* functions,
which use a different indexing system.
2021-05-01 13:55:08 -07:00
Nunuhara Cabbage 90b16b5ce6 Implement PassRegister library
Used in Beat Blades Haruka.
2021-04-25 10:25:25 -07:00
Nunuhara Cabbage 1aaa7eec5a Handle incorrectly cased .acx file names
Fixes an issue in Tsuma Shibori (and probably other games) where .acx
file lookup fails because the actual file name contains characters which
differ in case from the name given in the code.
2021-04-21 20:53:48 -07:00
Nunuhara Cabbage 5252eb079c Update libsys4 2021-02-27 12:38:52 -08:00
Nunuhara Cabbage fabafeea8f Update libsys4
Fixes crash in Daibanchou when loading PMS8 CGs.
2021-02-20 10:23:12 -08:00
Nunuhara Cabbage 9b0dd6d0f1 Fix minor issues
Resolve signed comparison warnings and fix a couple OOB array reads.
2021-02-19 21:04:05 -08:00
Nunuhara Cabbage 0aa0f8f249 Update libsys4 2021-02-13 13:22:57 -08:00
Nunuhara Cabbage cf31524092 Update libsys4 2020-12-13 12:36:55 -08:00
Nunuhara Cabbage b5b5fdd8a2 Allow running with no arguments
xsystem4 can now be run from within a game directory with no arguments.
Alternatively, the game directory can be passed instead of the path to
System40.ini.
2020-09-05 10:05:33 -07:00
Nunuhara Cabbage ac0f2eaa13 Merge branch 'kichikuou-mac-opengl' into master 2020-09-03 10:39:31 -07:00
Nunuhara Cabbage a901404d3c Declare global variables extern in headers
Recent versions of gcc seem to emit symbols for unadorned declarations,
leading to linker errors.
2020-09-03 10:15:25 -07:00
Nunuhara Cabbage 80b8eacab2 Move libsys4 into separate repository
To allow pulling xsystem4 and alice-tools apart.
2020-08-28 21:32:18 -07:00