Commit Graph
998 Commits
Author SHA1 Message Date
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
Nunuhara Cabbage 4330d63516 Merge pull request #17 from kichikuou/mtrand
Use mt19937int in libsys4
2021-02-27 12:40:30 -08:00
Nunuhara Cabbage 5252eb079c Update libsys4 2021-02-27 12:38:52 -08:00
kichikuou 7fcffc9b34 Use mt19937int in libsys4 2021-02-27 17:23:25 +09:00
Nunuhara Cabbage 742e145dc0 Merge pull request #15 from kichikuou/voice
Fix voice playback issue in Daibanchou
2021-02-23 16:44:08 -08:00
kichikuou da11820bd5 Fix voice playback issue in Daibanchou
This fixes an issue where wav_unload_slot() stops playing ALL channels
if slot->channel == -1.
2021-02-23 18:32:58 +09:00
Nunuhara Cabbage bd4d0c27b5 Merge pull request #14 from kichikuou/gpx2plus
Gpx2Plus improvements
2021-02-21 08:25:42 -08:00
kichikuou 921502a284 Gpx2Plus: Implement more MsgDraw markup commands
And now it aligns text to bottom if a line has different sized fonts.
2021-02-21 21:14:01 +09:00
kichikuou 3d822bfb37 Gpx2Plus: Implement some basic visual effects
The effect IDs are common with SACT.

Unimplemented effects will fall back to crossfade.
2021-02-21 21:13:56 +09:00
Nunuhara Cabbage 851a19acc1 Work around for FFI heap reallocation bugs
ref types are currently passed to HLL functions as pointers into the
heap. If the HLL function itself needs to allocate memory from the heap,
it can cause the heap to be reallocated, rendering these heap pointers
invalid.

In order to work around this, hll_call now guarantees 64 slots are
available on the heap before calling any HLL function. This is not a
great solution, but it should work to the extent that HLL functions only
allocate a fixed number of heap slots < 64.

This bug could be easily triggered by scrolling up on the message log in
Sengoku Rance.
2021-02-20 20:41:05 -08:00
Nunuhara Cabbage 899e928128 Fix bug in MsgLogViewer 2021-02-20 20:36:39 -08:00
Nunuhara Cabbage bd4c368966 Implement KiwiSoundEngine HLL library
Used in SLC's (?) "media files" patch for the English translated version
of Daibanchou (enables .ogg playback).

This library is largely identical to the SACT2 audio interface.

Currently this doesn't loop .ogg music correctly. From what I remember
SDL_Mixer doesn't support setting custom loop points so this isn't easy
to fix.
2021-02-20 15:17:13 -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 25ec470fa9 Merge pull request #13 from kichikuou/daibanchou
Implement the remaining HLLs for Big Bang Age
2021-02-20 10:06:36 -08:00
kichikuou 954d5090ed Implement the remaining HLLs for Big Bang Age
This adds the following HLL libraries:

- BanMisc
- Bitarray
- Confirm
- InputDevice
- MenuMsg
- PlayDemo
- Timer

Big Bang Age (Daibanchou) is mostly playable as of this commit.
2021-02-20 14:39:17 +09:00
Nunuhara Cabbage 77fe2b714d Merge pull request #12 from kichikuou/datafile
Implement DataFile HLL library
2021-02-19 21:05:42 -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
kichikuou 89c9c9128e Implement DataFile HLL library
It provides access to data tables in *DA.ald, and is used in Big Bang Age.

mt19937int.c is the first standard version of Mersenne Twister,
downloaded from
http://www.math.sci.hiroshima-u.ac.jp/m-mat/MT/VERSIONS/C-LANG/ver980409.html.
2021-02-20 10:17:55 +09:00
Nunuhara Cabbage a8ab5a27bd Merge pull request #11 from kichikuou/gpx2plus
Implement Gpx2Plus HLL library
2021-02-14 09:15:42 -08:00
kichikuou 57d165fb05 Avoid strndup()
It doesn't compile in Windows.
2021-02-14 17:23:13 +09:00