Commit Graph
998 Commits
Author SHA1 Message Date
Nunuhara Cabbage 512c1dee2a Implement DrawGraph.CopyStretchBlend{AMap}
Used in Haru Urare.

Also, redirect DrawGraph.CopyStretch{AMap}Interp to the regular
implementations (bilinar interpolation is default).
2021-05-17 09:01:11 -07:00
Nunuhara Cabbage d7286a2f30 Implement DrawGraph.CopyRotateY{UseAMap}
Used in Haru Urare.
2021-05-17 08:01:35 -07:00
Nunuhara Cabbage 3b7fb2c60c Use mat4 type from cglm instead of GLfloat[16]
Also reimplement DrawGraph.CopyRotZoom using cglm functions.
2021-05-16 17:34:42 -07:00
Nunuhara Cabbage f768fed99c Merge branch 'master' of https://github.com/nunuhara/xsystem4 2021-05-16 12:18:39 -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 770b517f07 Merge pull request #24 from kichikuou/blur
Implement DrawGraph.Copy{,AMap}{Width,Height}Blur
2021-05-16 07:26:51 -07:00
Nunuhara Cabbage 6f4cc339a3 Merge pull request #23 from kichikuou/DrawDungeon
DrawDungeon.hll: Implement 2D maps
2021-05-16 07:25:32 -07:00
kichikuou 91213785a7 Implement DrawGraph.Copy{,AMap}{Width,Height}Blur 2021-05-16 22:04:40 +09:00
kichikuou e066c428cd DrawDungeon.hll: Implement 2D maps 2021-05-16 18:21:38 +09:00
Nunuhara Cabbage 92b81f21ee Add stubs for ChipmunkSpriteEngine
Used in Shaman's Sanctuary. Mostly identical to StoatSpriteEngine, but
with a few additions and some removed functions (notably, the
MultiSprite functions were removed).
2021-05-15 18:55:24 -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 9582ad6129 Fix memory leak in VSFile 2021-05-14 21:05:07 -07:00
Nunuhara Cabbage e208f146b9 Fix VSFile
This is actually used for static data shipped with some games, so the
binary format needs to match the original implementation.
2021-05-14 20:30:40 -07:00
Nunuhara Cabbage 50a719ba76 Implement DrawGraph.FillAMap{Over,Under}Border
Used in Alice 2010.
2021-05-14 18:35:29 -07:00
Nunuhara Cabbage 72807b6955 Implement SystemService.GetGameName
Used in Haru Urare.
2021-05-13 21:06:56 -07:00
Nunuhara Cabbage 17639a7ec3 Support reading AliceStart.ini 2021-05-13 21:06:23 -07:00
Nunuhara Cabbage d393647267 Implement StoatSpriteEngine.SYSTEM_* functions 2021-05-13 20:19:53 -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 291bb82be6 Implement DrawGraph.CopyStretchWithAlphaMap 2021-05-13 18:34:17 -07:00
Nunuhara Cabbage ca8cdddb3b Allow Array.Fill on empty array 2021-05-13 18:09:13 -07:00
Nunuhara Cabbage b3783178f4 Implement MultiSprite_SetOriginPosMode
Used in Rance 02.
2021-05-12 22:02:48 -07:00
Nunuhara Cabbage 10d838ebc4 Fix bug when loading heap
Need to grow as needed.
2021-05-12 19:36:48 -07:00
Nunuhara Cabbage 2a9e7a417b Implement CharSpriteMangager_{Rebuild,Save,Load} 2021-05-12 19:35:53 -07:00
Nunuhara Cabbage d5cbea3f94 Implement various SystemService functions
Enough so that Haru Urare doesn't crash in the settings menu.
2021-05-12 16:42:35 -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 dffbd3125c Fix StoatSpriteEngine.ADVLogList_GetADVLogVoice
This function has a different interface than the AnteaterADVEngine
version.
2021-05-11 19:32:59 -07:00
Nunuhara Cabbage 4120e344f1 Fix SACT2.SP_CreatePixelOnly
Create pixel-only textures as RGB (no alpha). This fixes some issues
with DrawGraph functions writing to an alpha channel that shouldn't
exist (e.g. causes black screen in Haru Urare).

This doesn't fix the analogous issue for CGs which shouldn't have an
alpha channel.
2021-05-10 22:11:28 -07:00
Nunuhara Cabbage 968179fadb Guard against division by zero
Happens in Haru Urare, apparently this is not an error.
2021-05-10 22:07:23 -07:00
Nunuhara Cabbage 20e25a8860 SACT2: Don't allocate sprite in getter functions
SACT2.SP_Get* functions shouldn't allocate a sprite if the given sprite
number isn't allocated.
2021-05-10 20:27:33 -07:00
Nunuhara Cabbage c735ee5af2 Fix DrawGraph.GetAlphaColor/SACT2.SP_GetAMapValue
Properly handle cases where the coordinate is outside of the sprite.
Fixes an issue on the Haru Urare menu sceen.
2021-05-09 21:49:53 -07:00
Nunuhara Cabbage e74fc33cf0 Add stubs for miscellaneous HLL functions
Used in Haru Urare.
2021-05-09 20:55:37 -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
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