Commit Graph
39 Commits
Author SHA1 Message Date
Nunuhara Cabbage 8d381dbf49 Ensure _ModuleInit runs after VM reset
Fixes crash after game over in MangaGamer version of Sengoku Rance.
2022-05-01 08:23:05 -07:00
Nunuhara Cabbage 912a73d42a Implement HLLs for English version of Rance VI 2022-04-10 18:24:47 -07:00
Nunuhara Cabbage 38df5ea1c1 Use display_sjis0/display_utf0 in messages
Ensure correct encoding for error/warning/log messages.
2022-04-06 19:33:33 -07:00
Nunuhara Cabbage 73eb1d0e34 Merge branch 'master' of github.com:nunuhara/xsystem4 2022-03-27 15:47:09 -07:00
kichikuou 6d34f0e18d Implement ChrLoader HLL
For Widenyo.
2022-03-25 10:30:18 +09:00
kichikuou 2707bc9a7e Implement MapLoader HLL
For Widenyo.

Now sprite_set_cg() takes a struct cg, so that CG can be loaded from
custom sources such as .map file.
2022-03-25 10:29:30 +09:00
kichikuou 94d7e0cd5d Add stub for SoundFilePlayer
For Widenyo.
2022-03-24 22:00:35 +09:00
Nunuhara Cabbage 5b2f9d7536 Refactor GoatGUIEngine and add misc. stubs
Refactor GoatGUIEngine into various files under src/parts/.
The external interface to this code is the functions prefixed with PE_
and generally following the naming of the HLL functions which they
implement.

The reason for this is that there are multiple HLL libraries that
implement more or less the same GUI interface (GoatGUIEngine, GUIEngine
and PartsEngine).

Also added here are a number of miscellaneous stubbed-out HLL functions
that are used by Rance 01 (which now runs up to the point where it tries
to create the title menu).
2022-01-30 10:12:20 -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
kichikuou 1d8615d14f Initial implementation of DrawDungeon14.hll (GALZOO Island)
Major differences from DrawDungeon.hll are:

- DGN, DTX, TES are loaded from individual files, not from a DLF archive
- 2D map functions are not used
- (unimplemented) Spinning motion of event markers
- (unimplemented) Additional 3D object types (polygon models and roofs)
2021-06-13 17:00:44 +09:00
kichikuou 66d6fc38da Implement DrawSimpleText HLL
Used in GALZOO Island.
2021-06-13 13:14:57 +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 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 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
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 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 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 db1daa5be7 Add stubs for AliceLogo4 library
Used in Vanish!
2021-04-25 19:25:54 -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 90b16b5ce6 Implement PassRegister library
Used in Beat Blades Haruka.
2021-04-25 10:25:25 -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 51a3712270 Add stub for SystemService.RestrainScreensaver
Used in El Mayflower.
2021-04-22 19:28:14 -07: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 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
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
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
kichikuou c6d354e22f Implement Gpx2Plus HLL library
Gpx2Plus is the graphics library used in Big Bang Age (which predates
SACT2). Fortunately the underlying graphics primitives are mostly in
common with SACT2, so many functions just call gfx counterparts.

This implementation covers all Gpx2Plus functions used in Big Bang Age.

Caveats:
- Gpx2Plus.EffectCopy() does not apply any effect yet.
- Some markup commands for Gpx2Plus.Msg*() are not implemented yet.
2021-02-14 16:46:46 +09:00
Nunuhara Cabbage d69bc33449 Don't create stubs for unimplemented HLL functions
hll_call() prints the same message as the old stub functions if no
implementation is provided. This makes the --audit option more accurate.
2020-08-26 17:30:22 -07:00
Nunuhara Cabbage b04b0c3018 Implement system.Reset 2020-08-25 17:47:45 -07:00
Nunuhara Cabbage 81a947d74d Partial InputString hll implementation
Not implemented: display of intermediate results.
2020-07-12 16:10:10 -07:00
Nunuhara Cabbage b617449178 aindump/ainedit: initial ain v14 support
Support for Evenicle 2 and Haha Ranman.

There are a few changes in v14:
* a number of new instructions (semantics yet unknown)
* HLL function arguments and return values can now be complex types
  (e.g. arrays, enums)
* support for nested arrays (this isn't necessarily new, but it doesn't
  occur in Rance X at all)
2020-05-17 13:21:37 -07:00
Nunuhara Cabbage f164480f35 Initial fnl (bitmap) font rendering implementation
Enough to get text on the screen, but it isn't pretty. No antialiasing,
kerning, vertical placement isn't correct, probably the size isn't even
quite correct, etc.
2020-04-25 08:09:13 -07:00
Nunuhara Cabbage 9e0ae18a05 Add stubs for SengokuRanceFont.dll
And enough implementation to run up to the intro without crashing.
2020-04-05 19:36:42 -07:00
Nunuhara Cabbage 0d74a3b686 Partial MsgLogManager/MsgLogViewer implementation
Enough to get the message log in Sengoku Rance working.
2020-03-08 17:19:19 -07:00
Nunuhara Cabbage 529c7024c2 Move --audit from aindump to xsystem4
Move --audit option from aindump to xsystem4 proper, and implement
auditing of HLL functions.
2020-03-06 21:14:02 -08:00
Nunuhara Cabbage 6a4d11f3de Use libffi for library calls
Use libffi to portably call arbitrary functions at runtime, rather than
forcing library functions to use a standard prototype.
2020-01-07 22:48:29 -08:00