Commit Graph
632 Commits
Author SHA1 Message Date
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
Nunuhara Cabbage 21cb503c06 Read debugger config at startup
Read .xsys4-debugrc from ~/.xsystem4 and/or the game directory on
startup. This is just a text file with one debugger command per line.
Can be used to set breakpoints or log functions automatically at
startup.

This can also be used to work around a limitation on Windows where the
IME doesn't work in the debugger, making it impossible to input Japanese
text.
2022-04-14 10:54:00 -07:00
Nunuhara Cabbage 9ede2d7af9 debugger: add vm-state command
Add vm-state command, which prints disassembly around the current
instruction pointer and the current contents of the stack.

It was necessary to change how breakpoints are implemented for this.
When adding a breakpoint, the original opcode now remains in the
instruction stream, bitwise-or'd with BREAKPOINT. A hash table indexed
by address is used to store breakpoint objects.
2022-04-14 09:08:57 -07:00
Nunuhara Cabbage caf11f3991 Debugger improvements
* Add "frame" command to change the current frame.
* Add "members" command to print struct members for current frame (if it's
  a method frame).
* Support printing member variables (e.g. "this.var") in the "print"
  command.
2022-04-12 19:18:05 -07:00
Nunuhara Cabbage 78354cbdaf audio: seek to 0 when stopping stream
Fix issue in Rance VI where BGM would resume playing from the previous
position instead of restarting after a stream was stopped.

Also fix an issue where a stale sample could be played when starting a
stream after it had been stopped.
2022-04-11 21:25:31 -07:00
Nunuhara Cabbage af3af870fa Add game compatibility table 2022-04-11 18:54:50 -07:00
Nunuhara Cabbage 5e1ab7894f Respect UseJoypad value in System40.ini
Joypad support is enabled if UseJoypad = true. This can be overridden by
the --joypad option, which now takes an optional argument, which may be
"off".
2022-04-11 18:05:51 -07:00
Nunuhara Cabbage 951834fb57 Improve joypad input mapping
Implement buttons 1-4 as left analog stick directions (with cooldown) to
match SACT2.

Other buttons are also remapped to match the SACT2 mapping.
2022-04-11 17:45:21 -07:00
Nunuhara Cabbage 34fa732f91 Use fallback for unimplemented effects
Use EFFECT_BLUR_CROSSFADE as a fallback for unimplemented effects.
2022-04-10 18:50:49 -07:00
Nunuhara Cabbage 3507ebc609 Fix texture leak in sprite_set_cg_2x 2022-04-10 18:43:41 -07:00
Nunuhara Cabbage 5bff9aa922 Fix channel_play/channel_stop return values
The corresponding SACT2 functions return 1 if the channel is already
playing/stopped.

This eliminates some error message spam on the console.
2022-04-10 18:33:32 -07:00
Nunuhara Cabbage 912a73d42a Implement HLLs for English version of Rance VI 2022-04-10 18:24:47 -07:00
Nunuhara Cabbage ef8ebadc7e Fix bug in SACT2.CG_IsExist 2022-04-10 15:32:41 -07:00
Nunuhara Cabbage 5581417937 Implement SACT2.WP_SetSP
Used in English version of Rance VI.
2022-04-10 09:04:00 -07:00
Nunuhara Cabbage 75bb6d1e43 Guard against division by zero in MOD 2022-04-10 09:02:30 -07:00
Nunuhara Cabbage eca92c4f7e Add compatibility hack for English Daibanchou
Gpx2Plus.CopyStretchReduceAMap behaves differently in the English
version.

Fixes an issue with text being squashed horizontally on the regional
phase menus.
2022-04-09 11:42:17 -07:00
Nunuhara Cabbage 322eccb371 Simplify sact_Effect 2022-04-09 09:02:52 -07:00
Nunuhara Cabbage a48704e0e2 Daibanchou: fix BGM/Sound indexing
Fix issue where wrong sounds/music are played in Daibanchou.
2022-04-08 20:07:48 -07:00
Nunuhara Cabbage 95a7719b65 Implement DrawGraph.CopyRotateX,CopyRotateXUseAmap
Used in Tsuma Shibori.
2022-04-08 18:43:51 -07:00
Nunuhara Cabbage ac248c310c Fix -e encoding on Windows alpha-1 2022-04-07 18:22:01 -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 b45e8e73dc Fix replaying animation bug in StoatSpriteEngine
Fix a bug where animations would replay after calling
StoatSpriteEngine.MultiSprite_EndAllMove (e.g. the start of battle
animation in Rance 02 replaying after every attack).
2022-04-06 17:55:28 -07:00
Nunuhara Cabbage 48b53881de Fix bug in load_heap 2022-04-06 17:51:39 -07:00
Nunuhara Cabbage 11e4880def Handle all font weights
System 4 has 4 font weights: light, medium, bold and heavy bold.
SDL_ttf has 2 (normal and bold). For now, xsystem4 treats light/medium
as normal and bold/heavy-bold as bold.
2022-04-05 19:33:56 -07:00
Nunuhara Cabbage e88ae62c08 Remove scene_flip function
It was a bug to call this function outside of sact_Update, because it
set scene_is_dirty to false without first rendering the scene. This can
cause the scene to not be rendered in a timely manner.
2022-04-05 19:31:13 -07:00
Nunuhara Cabbage 8a131d416b Add 'screen' draw method to StoatSpriteEngine
This fixes an issue in Rance 02 where Sill's fire arrow attack had a
black background (reported in #44).
2022-04-05 16:55:47 -07:00
Nunuhara Cabbage 2ca1ce14c5 Fix memory leak in SH_S_ASSIGN_CALLSYS19 2022-04-05 16:40:59 -07:00
Nunuhara Cabbage 5fe61c14d9 Rance 02: render '^' as 'é' 2022-04-04 21:26:23 -07:00
Nunuhara Cabbage 1f239c766f Rance 02: render '}' as dash 2022-04-04 20:17:34 -07:00
Nunuhara Cabbage 6c8b674f0e CharSpriteManager: fix truncated descenders
Fix issue where text descenders would be truncated in games using
CharSpriteManager (e.g. Alice 2010).
2022-04-04 11:32:27 -07:00
Nunuhara Cabbage 89d8210c14 Compatibility hack for Rance 02 (MangaGamer)
The MangaGamer version of Rance 02 has a custom proportional font
implementation which makes assumptions about the font in use. This is
worked around by rewriting their '_CalculateWidth' function to use
fixed-width logic.

I also tried using TTF_SizeUTF8 to get the proper character width but I
found this made the text overflow even worse than using a fixed width
(at least with the default gothic font, perhaps other fonts would fare
better).
2022-04-04 11:20:47 -07:00
Nunuhara Cabbage 6118eef06a Implement EFFECT_UP_DOWN_CROSSFADE 2022-04-04 06:52:51 -07:00
Nunuhara Cabbage 888b491b38 Implement EFFECT_CROSSFADE_LR 2022-04-03 22:35:37 -07:00
Nunuhara Cabbage 26c8f399cb Fix bug in iarray_write_string
Fix bug affecting non-ASCII text in iarray_write_string. This fixes a
bug in ADVLogList_Save/ADVLogList_Load which would cause log text to
become garbled after loading a save.
2022-04-03 21:05:12 -07:00
Nunuhara Cabbage c73842ae75 Fix major memory leak in ADVSceneKeeper
The VM can under no circumstance store it's own data on the heap. Doing
so causes said data to leak into saved VM images. This is the worst kind
of memory leak: even restarting the game will not fix it, because the
data is permanently leaked into the save files.

This will break save compatibility in games that use ADVSceneKeeper
(e.g. Alice 2010 games).
2022-04-03 20:38:28 -07:00
Nunuhara Cabbage fbfa5bbb5f Fix memory leak in ADVLogList_Save 2022-04-03 15:12:41 -07:00
Nunuhara Cabbage f01f002a54 Improve performance of vm_save_image
cJSON_AddArrayItem is O(n), which made saving arrays O(n^2). This was
causing extremely poor performance when saving large arrays, such as
those created by MultiSprite_Encode.

A special cJSON_CreateIntArray_cb function is now used instead, which
can create and populate an array in O(n).
2022-04-03 13:42:36 -07:00
Nunuhara Cabbage 5713742a99 Implement MultiSprite_Encode/MultiSprite_Decode 2022-04-03 13:41:34 -07:00
Nunuhara Cabbage 47cb99927d Update libsys4 2022-04-02 08:32:48 -07:00