Commit Graph
989 Commits
Author SHA1 Message Date
kichikuou bf3700ea8e Fix a bug that bgm did not work after movie load failed
When movie_free() was called in movie_load(), mixer_stream_stop(0) was
mistakenly called and the music mixer was stopped.
2023-10-15 15:00:07 +09:00
Nunuhara Cabbage c521f1faf7 Merge pull request #137 from kichikuou/confirm3
Add Confirm3.Initialize
2023-09-25 20:10:23 -07:00
kichikuou ef7b789810 Add Confirm3.Initialize
For some reason, this function is renamed from GetHDDVolumeNumber only
in Momoiro Guardian.

This also makes all Confirm3 functions HLL_QUIET_UNIMPLEMENTED.
2023-09-17 21:22:43 +09:00
Nunuhara Cabbage 530f606657 Merge pull request #136 from kichikuou/sactdx
Add SACTDX.SP_DeleteAll
2023-09-05 06:06:03 -07:00
kichikuou 120b9888f1 Add SACTDX.SP_DeleteAll
Used in Edo Ranze.
2023-09-05 20:31:27 +09:00
Nunuhara Cabbage 87884d4230 Merge pull request #135 from kichikuou/s_mod
Fix S_MOD for bool and long int
2023-09-01 20:38:21 -07:00
kichikuou 0b4eb92e95 Fix S_MOD for bool and long int
* The "type" argument of S_MOD is 48 for bool, 56 for long int
* %b, %c, %d can consume any integer types (int, bool, or long int)
* If the value cannot be consumed, S_MOD should return the format
  string instead of an empty string
2023-09-02 11:36:54 +09:00
kichikuou 51e55644f5 DrawDungeon14: Fix incorrect return types in SetRaster{Scroll,Amp} 2023-09-02 11:11:01 +09:00
Nunuhara Cabbage 296496e895 Merge pull request #134 from kichikuou/raster
DrawDungeon14: Implement raster effect
2023-09-01 13:42:49 -07:00
kichikuou afae3fc9a6 DrawDungeon14: Implement raster effect
It is implemented as a post-processing effect. The hack for the
projection transform matrix has been removed, because now the image is
flipped upside down in the post-processing stage.
2023-09-01 21:45:46 +09:00
kichikuou a301ca1311 DrawGraph, Gpx2Plus: Implement CopyReverseUD() 2023-08-31 14:16:52 +09:00
Nunuhara Cabbage eb97693e3f Merge pull request #133 from kichikuou/msgskip
Fix path resolution in MsgSkip.Init
2023-08-25 06:48:35 -07:00
kichikuou a6f01f7f82 Fix path resolution in MsgSkip.Init
Some games (Ojou-sama o Iinari ni Suru Game and Double Sensei Life, as
far as I know) pass "SaveData\\MsgSkip.asd" to MsgSkip.Init. So this
change:

* uses savedir_path() to resolve the relative path, and
* removes the "SaveData\\" prefix, otherwise "SaveData/" will be
  duplicated in the resolved path.
2023-08-24 21:31:14 +09:00
Nunuhara Cabbage a27996def8 Merge pull request #132 from kichikuou/window-settings
SystemService: Implement "Wait Vsync" window setting
2023-08-22 18:26:42 -07:00
kichikuou fa96987eca SystemService: Implement "Wait Vsync" window setting
This also rewrites the SetWindowSetting and GetWindowSetting functions
based on the understanding gained from examining games after Haru Urare:

* Setting IDs are consistent across games.
* Settings 5 and 6 are added in Pastel Chime 3, both default true
2023-08-22 21:27:46 +09:00
Nunuhara Cabbage 192e65a827 Merge pull request #131 from kichikuou/mixer
SystemService can only access mixers specified in ini
2023-07-13 16:58:47 -07:00
kichikuou a536912b38 SystemService can only access mixers specified in ini
This ensures that SystemService.hll mixer functions can only access
mixers specified in System40.ini, even if xsystem4 added more mixers.

Beat Blades Haruka checks the number and names of mixers, and refuses to
open the config screen if they are not as expected.
2023-07-13 09:13:26 +09:00
Nunuhara Cabbage fcf26a9ca7 Merge pull request #130 from kichikuou/flash
Flash: Add support for sounds and sprite objects
2023-07-09 16:43:49 -07:00
kichikuou 4cb374dd5d Flash: add support for sprite objects
This implementation supports only single-frame sprites with a single
child object. As far as I know, all Flash effects in AliceSoft games
meet this requirement.
2023-07-09 17:05:25 +09:00
kichikuou 9543bf1761 Flash: sound support
The DefineSound tag in SWF has raw PCM data, so we create a WAV file in-
memory and pass it to audio_play_archive_data(). This is not strictly
necessary since libsndfile can handle raw PCM data, but keeps the audio
and mixer interfaces simple.
2023-07-09 17:05:21 +09:00
Nunuhara Cabbage 1527a1cb85 Merge pull request #129 from kichikuou/tapir
Initial implementation of TapirEngine HLL
2023-07-08 07:27:32 -07:00
kichikuou 588d4f1024 Initial implementation of TapirEngine HLL
TapirEngine is the 3D rendering engine used in RanceQuest.

This implements the minimum functionality that is needed to render the
first battle scene. The lighting is still incorrect.
2023-07-08 08:05:07 +09:00
kichikuou c815d48274 Add stubs for SpriteEngine functions
- ChipmunkSpriteEngine.SP_Suspend
- StoatSpriteEngine.FPS_SetShow
- StoatSpriteEngine.FPS_GetShow
2023-07-07 09:29:21 +09:00
kichikuou 1730ddebae ChipmunkSpriteEngine: Add DX_{Get,Set}UsePower2Texture 2023-07-03 08:39:45 +09:00
kichikuou 1694f5cb89 Add Math.tan 2023-07-03 08:39:42 +09:00
Nunuhara Cabbage 1855cd4167 Merge pull request #128 from kichikuou/drawline
DrawGraph: Implement DrawLine and DrawLineToAMap
2023-07-02 07:30:10 -07:00
kichikuou a4ff641366 DrawGraph: Implement DrawLine and DrawLineToAMap 2023-07-02 14:04:31 +09:00
Nunuhara Cabbage 2085c28bd1 Merge pull request #127 from kichikuou/text
StoatSpriteEngine: Clear cached font_size struct in SP_SetTextSpriteSize
2023-07-01 20:54:12 -07:00
kichikuou 6c2a55c67a StoatSpriteEngine: Clear cached font_size struct in SP_SetTextSpriteSize
This fixes text layout issue in Daiteikoku and Rance Quest.
2023-07-02 10:11:44 +09:00
Nunuhara Cabbage 2ffb4a4ab0 Merge pull request #126 from kichikuou/DrawGraph
Add two DrawGraph functions used in Daiteikoku
2023-06-18 07:16:08 -07:00
kichikuou 0e5d41a728 Implement DrawGraph.CopyGrayscale
Used in Daiteikoku.
2023-06-18 20:57:00 +09:00
kichikuou e1d5eba1f2 Implement DrawGraph.CopyRotZoom2Bilinear
Used in Daiteikoku.

It's similar to DrawGraph.CopyRotZoom, but specifies source and
destination center points.
2023-06-18 20:57:00 +09:00
Nunuhara Cabbage c99e9842ad Merge pull request #125 from kichikuou/file2
Implement File2.OpenArchiveForRead
2023-06-17 22:05:22 -07:00
kichikuou 20fabf40fa Implement File2.OpenArchiveForRead
Rance Quest uses yet another ad hoc archive format (.rea) for the map
data. This function opens an entry in the rea archive for reading.
2023-06-17 13:47:51 +09:00
Nunuhara Cabbage d8bba6e391 Merge pull request #124 from kichikuou/flash
Partial implementation of Flash parts type
2023-06-16 19:54:40 -07:00
kichikuou 01429fe2a8 Update libsys4 2023-06-17 11:32:47 +09:00
kichikuou 3496f45e39 parts: add basic implementation of Flash type
Sprite objects and sounds are not implemented yet.
2023-06-17 11:32:14 +09:00
kichikuou 88c37a9165 Add AFF/SWF parser
This SWF parser is far from complete, in particular it only supports
simple bitmap-filled rectangular shapes, but it covers all the features
used in Daiteikoku, Rance Quest, Pastel Chime 3 and Dorapeko.

Flash files are stored in archives in AFF format, which is an encrypted
SWF wrapper. The decryption code was adapted from GARbro.
2023-06-17 11:32:11 +09:00
kichikuou 6d3abdaa02 Add ASSET_FLASH asset type 2023-06-11 15:06:44 +09:00
Nunuhara Cabbage eaa08b6991 Merge pull request #123 from kichikuou/sprite-newline
Fix sact_SP_TextNewLine when nTextSize is 0
2023-06-04 15:30:35 -07:00
kichikuou 1887ceff7f Fix sact_SP_TextNewLine when nTextSize is 0
Text sprites hold the height of the text drawn on them, and
sact_SP_TextNewLine increases the Y coordinate by this value if
nTextSize is 0.

The nTextSize argument of sact_SP_TextHome affects this value.

Beat Blades Haruka depends on this behavior.
2023-06-04 12:04:28 +09:00
Nunuhara Cabbage ff26a7f646 Merge pull request #122 from kichikuou/majo
Fix graphics issues found in Majo no Shokuzai
2023-06-03 13:07:02 -07:00
kichikuou 7dd85e445e Fix DrawGraph.CopyRotateY*
The back side sprite should not appear as a mirror image.
2023-06-03 13:18:13 +09:00
kichikuou 4f22907004 Fix DrawGraph.CopyRotZoom*
The `w` and `h` parameters are clamped to the source texture size.
2023-06-03 13:18:13 +09:00
Nunuhara Cabbage ddc9f1ae12 DAP: add scene/parts requests
xsystem4.scene: returns a list of scene entities
  * all entities have an entityId that can be used in further requests
  * SACT2 sprites have a 'sprite' member with a spriteId that can be
    used in further requests

xsystem4.renderEntity: renders a scene entity and returns the texture
xsystem4.spriteTexture: returns the stored SACT2 sprite texture
xsystem4.renderParts: renders a parts object and returns the texture
xsystem4.partsTexture: returns the stored parts object texture

Image data in texture objects is RGB8888 encoded in base 64.
2023-05-26 08:44:36 -07:00
Nunuhara Cabbage 7392d74efe Replace debug_print with to_json
to_json and cJSON_Print are now used when displaying debug information.

The main reason for this change it to support sending objects over DAP.
2023-05-14 20:12:34 -07:00
Nunuhara Cabbage 535a1f1804 Merge branch 'master' of github.com:nunuhara/xsystem4 2023-05-13 12:14:12 -07:00
Nunuhara Cabbage d387ee2816 Merge pull request #121 from kichikuou/dungeon
DrawDungeon: Fix cell drawing order
2023-05-13 12:13:13 -07:00
kichikuou dc174fa91c DrawDungeon: Fix cell drawing order
Transparent objects should be drawn in order from furthest to nearest.
In DrawDungeon, the actual viewpoint is slightly behind the camera, but
this was not taken into account when sorting cells by distance.

Fixes #120
2023-05-13 11:27:45 +09:00
kichikuou cf318bb47c Add debug print function for DrawDungeon plugin
For now it just prints the camera position.
2023-05-13 10:56:36 +09:00