Commit Graph
670 Commits
Author SHA1 Message Date
kichikuou 03f23c4339 Fix date/time getter functions
Values returned by SACT2.System_GetDate etc. should correspond to the
Windows SYSTEMTIME structure, not struct tm.

This also fixes a bug where get_time() returns a value greater than 60
for `sec`.
2022-05-08 14:20:45 +09:00
Nunuhara Cabbage b499c432fd Update game compatibility table
MangaGamer version of Sengoku Rance is now supported.
2022-05-05 21:11:25 -07:00
Nunuhara Cabbage fa4cdc81d0 Use gfx_draw_glyph for SACT2 (etc.) text rendering
This greatly improves the look of outlines, especially at larger font
sizes (such as in Haruurare).
2022-05-05 18:12:18 -07:00
Nunuhara Cabbage 0b52a4baa0 Fix issue with text blend mode
The source alpha was being multiplied by itself, making text look
thinner than it should. Now we just take the max alpha.
2022-05-05 18:09:51 -07:00
Nunuhara Cabbage 6080af3621 Implement Sound_GetGroupNumFromDataNum
Part of StoatSpriteEngine and KiwiSoundEngine.

This fixes an issue with per-channel volume settings not working
correctly in Haruurare (and presumably other games).
2022-05-04 20:30:03 -07:00
Nunuhara Cabbage 5924225bc2 Implement DrawGraph.BrightDestOnly 2022-05-03 21:08:01 -07:00
Nunuhara Cabbage 7fc60f6607 Implement DrawGraph.ScreenDA_DAxSA 2022-05-03 20:48:21 -07:00
Nunuhara Cabbage 44891458f1 Implement DrawGraph.SaturDP_DPxSA 2022-05-03 20:01:48 -07:00
Nunuhara Cabbage 703a66106f Implement DrawGraph.FillMultiply 2022-05-03 18:57:06 -07:00
Nunuhara Cabbage af33413826 Implement DrawGraph.FillScreen 2022-05-03 18:53:55 -07:00
Nunuhara Cabbage 54f6ece82d Implement DrawGraph.FillAMapGradationUD 2022-05-03 18:49:40 -07:00
Nunuhara Cabbage 3b75b6b545 Implement DrawGraph.BlendScreenAlpha
This completes the full suite of DrawGraph blending functions.
2022-05-02 21:18:49 -07:00
Nunuhara Cabbage e65560b67a Implement DrawGraph.BlendMultiply 2022-05-02 20:48:42 -07:00
Nunuhara Cabbage 2fd081234b Implement DrawGraph.BlendScreen 2022-05-02 20:43:16 -07:00
Nunuhara Cabbage 65be47e05b Implement DrawGraph.BlendUseAMapColor 2022-05-02 20:35:02 -07:00
Nunuhara Cabbage 9108ce19ea Implement DrawGraph.BlendAMapAlphaSrcBright 2022-05-02 18:19:09 -07:00
Nunuhara Cabbage 2f573803c4 Implement DrawGraph.BlendAMapBright 2022-05-02 17:01:23 -07:00
Nunuhara Cabbage 6d745054a4 Implement DrawGraph.BlendAMapSrcOnly 2022-05-02 16:20:40 -07:00
Nunuhara Cabbage 0fc5442e42 Implement DrawGraph.BlendAddSatur 2022-05-02 15:38:53 -07:00
Nunuhara Cabbage d482e165d6 Implement DrawGraph.BlendSrcBright 2022-05-02 15:12:40 -07:00
Nunuhara Cabbage d085951f68 Implement EFFECT_BLUR_FADEOUT
Used in Sengoku Rance (when Ran summons Suzaku).
2022-05-02 11:25:42 -07:00
Nunuhara Cabbage f3969e7d7e Implement EFFECT_ZOOM_IN_CROSSFADE
Used in Sengoku Rance (when Ran summons Suzaku).

The scale curve in this implementation is a bit off compared to
AliceSoft's implementation (theirs looks a bit sharper at the end), but
it's only really noticable with a very long effect time.

AliceSoft's implementation also has a lot more jitter, but I don't think
this is intentional.
2022-05-02 09:41:05 -07:00
Nunuhara Cabbage ae56a0f4b4 fnl: Fix reported width of tab character
The reported size of the tab character seems to be roughly 2.88x the
size of the glyph in the font.

This fixes a text layout issue with the commander info (HP, Job, etc).
2022-05-02 07:54:43 -07:00
Nunuhara Cabbage 6e05874ee1 Implement SACT2.QuakeScreen and EFFECT_OSCILLATE 2022-05-01 13:27:55 -07:00
Nunuhara Cabbage ccf049b4d5 Implement fade effects
Implement EFFECT_FADEOUT, EFFECT_FADEIN, EFFECT_WHITEOUT and
EFFECT_WHITEIN.

I'm not aware of these being used in any game (fade effects seem to be
implemented manually most of the time).
2022-05-01 12:06:53 -07:00
Nunuhara Cabbage 237fbebcf5 Implement EFFECT_ZOOM_LR and EFFECT_ZOOM_RL
Used in Sengoku Rance.

These are implemented using DrawGraph primitives since it's simpler than
writing a shader in this case.
2022-05-01 11:43:24 -07:00
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 b0d1549964 fnl: implement space_scale_x
Fixes some text layout issues.

Text rendering/layout in the MangaGamer version of Sengoku Rance is now
basically working as intended.
2022-04-30 11:15:06 -07:00
Nunuhara Cabbage a25f066a05 fnl: eliminate text halo
Fill fully-transparent pixels on the destination texture with the text
color before rendering to it. This eliminates halos around text caused
by the invisible texture color (usually black) being blended with the
text.
2022-04-30 10:52:55 -07:00
Nunuhara Cabbage 0d771384da Fix SengokuRanceFont.SP_SetTextMetricsClassic
This function doesn't overwrite values in the text style that aren't
contained in the sact_text_metrics_t object.
2022-04-30 06:33:20 -07:00
Nunuhara Cabbage f2dd4def12 Fix bug in gfx_draw_glyph
blend_amap_color_shader now uses the alpha value.
2022-04-29 18:13:22 -07:00
Nunuhara Cabbage f7b6da9679 Implement DrawGraph.BlendAMapColorAlpha
Used in the Rance VI credits.
2022-04-28 20:43:55 -07:00
Nunuhara Cabbage 9089fa1fd1 Rewrite fnl font renderer
Only unscaled glyph bitmaps are now cached in regular memory. Scaled
glyphs are stored as textures on the GPU. Only the alpha channel on
glyph textures is used, with the color being provided as an input to the
shader.

Outline and bold rendering is improved by using a simple dilate shader.
This looks okay but could be improved (the result is a bit blurry
still).
2022-04-28 19:13:27 -07:00
Nunuhara Cabbage 8fb0153963 SengokuRanceFont: anti-aliasing and glyph caching
This improves the look and (especially) the performance of text
rendering in the MangaGamer version of Sengoku Rance.

There are still some bugs/unimplemented features, but the game should be
more or less bearable to play in this state.
2022-04-24 17:19:27 -07:00
Nunuhara Cabbage 3b72b88e9c SengokuRanceFont improvements
The game now basically runs, but with very bad performance and lots of
aliasing on text.

Need to implement anti-aliasing and caching of rendered glyphs next.
2022-04-23 22:52:07 -07:00
Nunuhara Cabbage 547524d07b SACT2: render sprites in correct order for same Z
If two sprites have the same Z value, they are rendered in increasing
order of their sprite numbers.

This fixes an issue in the MangaGamer version of Sengoku Rance, which
depends on this behavior.
2022-04-21 19:04:20 -07:00
Nunuhara Cabbage 76710475fb Simplify/fix SACT2 sprite code
This code was changed at some point so that sact_get_sprite allocates a
sprite and only returns NULL for a negative sprite index, but some
functions were still assuming that it could return NULL under normal
circumstances and trying to manually allocate sprites.

I've gone through all of the SP_* functions to check which ones allocate
a sprite and which ones don't. If a function doesn't allocate a sprite,
sact_try_get_sprite is called instead of sact_get_sprite.

This fixes a crash on startup in the MangaGamer version of Sengoku
Rance (SengokuRanceFont.SP_ClearState was incorrectly allocating a
sprite).
2022-04-20 20:57:44 -07:00
Nunuhara Cabbage 06d51dc30e Include <limits.h> in system4.c
Per #46
2022-04-19 16:45:33 -07:00
Nunuhara Cabbage e8481d04c0 Note glew dependency in README
Per #46
2022-04-19 16:44:29 -07:00
Nunuhara Cabbage da12d6183e Remove "invalid keycode" warnings
Some games (e.g. Rance VI) just scan through all all keys up to 256 when
waiting for input.
2022-04-18 07:19:32 -07:00
Nunuhara Cabbage 3d5f63a583 Handle special character mapping in Rance VI (EN) 2022-04-17 17:03:38 -07:00
Nunuhara Cabbage 8639e53348 debugger: correctly print bool, lint and NULL 2022-04-17 15:24:00 -07:00
Nunuhara Cabbage 9bcd17a151 Add --font-x-scale option
Add an option to control the horizontal scaling of text. This is mainly
to work around text overflow issues in the MangaGamer version of Rance
02 (an appropriate value is set automatically for that game).
alpha-2
2022-04-17 09:44:44 -07:00
Nunuhara Cabbage 55aed4c755 Implement EFFECT_TURN_PAGE
Used in Rance VI.
2022-04-16 21:51:12 -07:00
Nunuhara Cabbage c1e9099a6c Implement EFFECT_LINEAR_BLUR
Used in Rance VI.
This implementation is not perfect, but it gets pretty close.

Alicesoft's implementation has a sharper curve on the blur size around
t=0.5, giving a "snappy" effect at the middle of the transition.
2022-04-16 10:47:59 -07:00
Nunuhara Cabbage 5b436ed98e Merge pull request #45 from kichikuou/compat-table
Update game_compatibility.md
2022-04-15 18:50:24 -07:00
Nunuhara Cabbage f58c1b43bc audio: fix corner cases in fade implementation
Properly handle the case where the stream loops while fading, by
tracking the elapsed frame count rather than comparing the current frame
with a computed end position.

Properly handle the case where time=0, by applying the volume
immediately instead of in the audio callback.

This fixes some audio bugs in Rance VI.
2022-04-15 11:31:55 -07:00
kichikuou 92ee64dcb8 Update game_compatibility.md
- Change DALK外伝 and ままにょにょ to unsupported
- Expand ALICEの館7 games
2022-04-15 19:45:07 +09:00
Nunuhara Cabbage 0ab9a59e99 Implement SystemService.SetMixerName
Used in Rance VI (at game over screen).
2022-04-14 16:21:24 -07:00
Nunuhara Cabbage 68ca748296 Fix bug in vm_free
This function is not supposed to call destructors, but was calling
heap_unref instead of exit_unref on local pages.

Fixes a bug in Rance VI where the game would crash on game over.
2022-04-14 16:19:26 -07:00