Commit Graph
461 Commits
Author SHA1 Message Date
kichikuou fa5ed2db35 Implement DrawDungeon.{Load,Save}WalkData
Also fixes compiler warnings in map.c.
2021-05-23 14:11:18 +09:00
kichikuou d48c9fb5af Fix crash in dungeon_set_* when removing objects 2021-05-23 14:10:58 +09:00
Nunuhara Cabbage 29b6193542 Merge pull request #26 from kichikuou/rance6-save
Implement / fix things enough to perform save in Rance VI
2021-05-22 08:47:20 -07:00
kichikuou 021f74285c Implement SR_REF2 instruction
Used in CConfig@Save of Rance VI.
2021-05-22 17:07:14 +09:00
kichikuou ce004ee3cc Make {gamedir,savedir}_path accept absolute paths
This fixes Rance VI which passes SACT2.SP_SaveCG and
SACT2.SP_SetCGFromFile absolute paths like
`system.GetSaveFolderName() + "\\" + "ScreenA.qnt"`.

Also, now savedir_path() uses unix_path() rather than sjis2utf().
2021-05-22 17:07:14 +09:00
kichikuou ea513ca727 Implement SACT2.SaveCG
Used in Rance VI.
2021-05-22 17:07:14 +09:00
Nunuhara Cabbage 9c26a80acf Various GoatGUIEngine improvements
* button states (default, hovered, clicked)
* on-cursor and on-click sound playback
* "LoopCG" animations
2021-05-21 23:56:26 -07:00
Nunuhara Cabbage 7eb6216b80 Add audio_play_sound function
Implement a system for allocating anonymous channels so that libraries
can play sounds without having to manage channels.

A library that uses audio_play_sound must ensure that audio_update is
called periodically to garbage collect finished channels.
2021-05-21 23:30:16 -07:00
Nunuhara Cabbage dd985a3769 Refactor sprite/scene management code
Create a separate interface for managing the scene. The sact_sprite
interface is implemented on top of this, as is GoatGUIEngine (which is
now independent of sact_sprite).

This will allow more specialized graphics interfaces to be implemented
without adding to the complexity of the sact_sprite interace. (For
example, GoatGUIEngine needs to store multiple textures per sprite for
button states; this is not supported by sact_sprite.)
2021-05-21 18:56:33 -07:00
Nunuhara Cabbage b1c55d6f03 Implement basic GoatGUIEngine input handling 2021-05-21 15:22:16 -07:00
Nunuhara Cabbage 439a393836 Merge pull request #25 from kichikuou/leak
Fix texture leak in sprite_set_cg(_from_file)
2021-05-21 12:46:28 -07:00
kichikuou 2c262f7060 Fix texture leak in sprite_set_cg(_from_file) 2021-05-21 22:34:03 +09:00
Nunuhara Cabbage eba29786bc Partial implementation of GoatGUIEngine
Enough to get to the main menu in Shaman's Sanctuary.
2021-05-20 18:19:52 -07:00
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