Commit Graph
417 Commits
Author SHA1 Message Date
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
Nunuhara Cabbage 74230869ae Fix memory leak in ACXLoader 2021-05-09 19:18:47 -07:00
Nunuhara Cabbage 713a612d2c Implement DrawGraph.CopyWithAlphaMap
Used in Haru Urare.
2021-05-09 16:19:57 -07:00
Nunuhara Cabbage 649c0d530e Implement FileOperation.Get{File,Folder}List
Used in Haru Urare.
2021-05-09 15:18:13 -07:00
Nunuhara Cabbage 16b026b7b6 Add stubs for IbisInputEngine
Used in Alice 2010.
2021-05-09 15:17:47 -07:00
Nunuhara Cabbage 5a28c73492 Implement MultiSprite text functions
Implement StoatSpriteEngine.MultiSprite_SetText and related functions.
2021-05-09 12:14:54 -07:00
Nunuhara Cabbage 35d3f58395 Merge pull request #22 from kichikuou/SP_SetCGFromFile
Implement SACT2.SP_SetCGFromFile
2021-05-08 21:02:33 -07:00
kichikuou c561317fb9 Implement SACT2.SP_SetCGFromFile
It's useful when testing graphics functions.
2021-05-09 09:07:37 +09:00
Nunuhara Cabbage 8a42494b11 Implement Math.SetSeedByCurrentTime
Used in Alice 2010
2021-05-08 11:43:03 -07:00
Nunuhara Cabbage 49458585d6 Implement ADVSceneKeeper functions
This is a serialization interface for a particular struct type. I've
implemented it somewhat generically, only checking that the name of the
struct matches the expected type. The actual structure of the objects
passed in is not checked, and in fact this structure differs between
games.

The serialized data produced by ADVSceneKeeper.Save should be identical
to what's produced by AnteaterADVEngine.dll from Shaman's Sanctuary.
2021-05-08 10:52:47 -07:00
Nunuhara Cabbage 5c6793d012 Merge pull request #21 from kichikuou/DrawDungeon
Initial implementation of DrawDungeon.hll (Rance VI)
2021-05-08 09:21:48 -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 788a6ef82c Merge pull request #20 from kichikuou/blend
Implement DrawGraph.BlendAMapColor and DrawGraph.BlendDA_DAxSA
2021-05-08 06:41:32 -07:00
kichikuou e5cb875f9b Implement DrawGraph.BlendAMapColor and DrawGraph.BlendDA_DAxSA
And fixes DrawGraph.SubDA_DAxSA.
2021-05-08 20:52:48 +09:00
Nunuhara Cabbage 28ca3d01e2 Implement StoatSpriteEngine.CharSprite functions
With the exception of the Rebuild, Save and Load functions.

Used in 僕だけの保健室
2021-05-06 20:58:10 -07:00
Nunuhara Cabbage 058eee03e5 Fix various issues with SACT2
Ensure that sact_get_sprite always returns a sprite object if sprite
number is not negative. SACT2 functions in general should work before
pixel data is attached to a sprite.

This also fixes the default for the 'show' property (true) and changes
the logic for adding/removing sprites from the scene to be less
error-prone (checked whenever a sprite is dirtied).
2021-05-06 20:11:33 -07:00
Nunuhara Cabbage 601bb1d556 Implement AnteaterADVEngine.ADVLogList functions
These functions were originally part of StoatSpriteEngine but were moved
to a separate library in Shaman's Sanctuary. This implementation should
be fully compatible with AnteaterADVEngine.dll, even if the game were to
inspect the serialized data produced by ADVLogList_Save.

Also added here is a minimal implementation of CrayfishLogViewer.hll.
This is a debug API but it's useful for creating test cases that can
run on both System40.exe and xsystem when system.Output is not
available.
2021-05-06 09:57:17 -07:00
Nunuhara Cabbage 9202454ed1 Add stubs for StoatSpriteEngine.SYSTEM_* functions
Also implement StoatSpriteEngine.SP_DeleteAll
2021-05-03 17:41:53 -07:00
Nunuhara Cabbage 65868cde8f Implement MultiSprite_SetAllShowMessageFrame
Apparently type 0 is used for CGs that should disappear together with
the message frame when right clicking.
2021-05-02 19:51:29 -07:00
Nunuhara Cabbage 0fb1ef1c05 Implement DrawGraph.FillWithAlpha
Used in Vanish!
2021-05-02 18:05:40 -07:00
Nunuhara Cabbage 8ae67056c6 Implement system.CopySaveFile 2021-05-02 17:36:17 -07:00
Nunuhara Cabbage 73db60afb3 Implement VSFile.hll 2021-05-02 17:34:14 -07:00
Nunuhara Cabbage c0954e3a72 Add stubs for DrawMovie2.hll 2021-05-02 16:29:38 -07:00
Nunuhara Cabbage ab052e0246 Implement Math.Ceil 2021-05-02 16:09:06 -07: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 863666ed6d Move StoatSpriteEngine impl to separate file
Also clean up some redundant functions in hll/SACT2.c
2021-05-01 22:04:49 -07:00
Nunuhara Cabbage 9a8ad87ae1 Merge branch 'master' of https://github.com/nunuhara/xsystem4 2021-05-01 13:59:12 -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 bbfc516045 Merge pull request #19 from kichikuou/array-fix
Fix vm_copy() for reference types
2021-05-01 07:27:32 -07:00
kichikuou a0d833649a Fix vm_copy() for reference types
This fixes a use-after-free bug in the first battle of Rance VI.
2021-05-01 19:50:09 +09:00
kichikuou eda0fc244f Add an early return to array_copy()
This fixes test_array_copy() broken by 0274052.
2021-05-01 19:49:33 +09:00
Nunuhara Cabbage 0274052947 Fix memory leak in A_ALLOC
Need to free dst page if already allocated.
2021-04-27 19:15:28 -07:00
Nunuhara Cabbage 9b84e38874 Fix double-free of unimplemented return value
When returning an empty string, the reference count must be
incremented.

Fixes crash when closing AliveZ.
2021-04-27 16:59:38 -07:00
Nunuhara Cabbage db1daa5be7 Add stubs for AliceLogo4 library
Used in Vanish!
2021-04-25 19:25:54 -07:00
Nunuhara Cabbage f0fc236903 Implement system.DeleteSaveFile
Used in Vanish!
2021-04-25 19:25:13 -07:00
Nunuhara Cabbage e46f90377c Implement StoatSpriteEngine library
Used in Vanish!

Another extension of SACT2. This just re-exports SACT2 as
StoatSpriteEngine. The SP_SetTextSprite* and MultiSprite_* functions
added in this iteration of the library are not yet implemented.
2021-04-25 19:21:22 -07:00
Nunuhara Cabbage 0e77b7ea16 Implement various things used in AliveZ 2021-04-25 16:50:01 -07:00
Nunuhara Cabbage 152aa8275a Implement various things used in Haruka
* system.ExistFunc
* Math.log + Math.log10
* SystemService mixer functions
2021-04-25 15:40:15 -07:00
Nunuhara Cabbage 90b16b5ce6 Implement PassRegister library
Used in Beat Blades Haruka.
2021-04-25 10:25:25 -07:00
Nunuhara Cabbage a10475d185 Implmement system.GetGameName
Used in Beat Blades Haruka.
2021-04-25 10:24:07 -07:00
Nunuhara Cabbage 8fc12e62c3 Add stubs for SACTDX library
Used in お嬢様をいいなりにするゲーム. This library is identical to SACT2
but with the addition of some kind of transaction API. For now, the
TRANS_* functions are implemented as no-ops.
2021-04-24 11:02:57 -07:00
Nunuhara Cabbage df0f7a590b Implement system.Resume{Read,Write}Comment
Used in お嬢様をいいなりにするゲーム.
2021-04-24 11:00:52 -07:00
Nunuhara Cabbage ffc08d40f0 Implement DrawGraph.SubDA_DAxSA
Used in ほいっぷハニー.
2021-04-22 20:25:47 -07:00
Nunuhara Cabbage 51a3712270 Add stub for SystemService.RestrainScreensaver
Used in El Mayflower.
2021-04-22 19:28:14 -07:00
Nunuhara Cabbage f282c69266 Implement DrawGraph.CopyColorReverse
Just a copy operation that inverts colors. Used in Rance VI Sonogo.
2021-04-22 19:20:12 -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 052ca908b3 Validate keycode in key_is_down 2021-04-19 20:56:42 -07:00
Nunuhara Cabbage 9bc8aa22af Merge pull request #18 from kichikuou/GlobalLoad
system.GlobalLoad() should not call destructors
2021-03-07 09:17:33 -08:00
kichikuou 843a8cf212 system.GlobalLoad() should not call destructors
Fixes #16.
2021-03-07 10:40:05 +09:00