135417 Commits

Author SHA1 Message Date
Simon Delamarre
988d4882a2
GOB: fix a few cursor glitches in Adibou2
Try to mimic more closely what is done in the executable.

Fixes black squares sometimes blinking around the cursor (just after selecting the character, when hoovering seeds bags in the vegetable garden...), and fix a temporarily disappearing "waiting" cursor in some "change CD" screens.
2022-12-02 11:44:34 +01:00
Simon Delamarre
abade0260d
GOB: fix some animation speed issues in Adibou2
In some cases, e.g. Adibou walking from his house, the animation is drawn using video object and _mult->animate() calls, but outside any "evaluate hotspots" loop. The loop is done directly from the scripts and has no synchronization with frame rate, so the animation goes too fast.

We add a timing correction in the animate() loop, by not incrementing the video frame number in video object if we are in advance, and continuing the loop, to keep the UI responsive.
2022-12-02 11:44:34 +01:00
Simon Delamarre
19476c96a5
GOB: split the big "updateAnim" function 2022-12-02 11:44:34 +01:00
Simon Delamarre
fc8d530e51
GOB: protection from sound-only videos without proper flags in Adibou2
Such videos may try to allocate a Surface with null width/height.

Fix the jokes "jingle" of the radio in Adibou's house.
2022-12-02 11:44:34 +01:00
Simon Delamarre
0e5953ad67
GOB: fix a crash when returning to launcher from Adibou2 2022-12-02 11:44:34 +01:00
Simon Delamarre
dd0748fa66
GOB: a few format fixes 2022-12-02 11:44:33 +01:00
Simon Delamarre
012b520872
GOB: a few missing "0 -> nullptr" replacements 2022-12-02 11:44:33 +01:00
Simon Delamarre
dc83f97a2e
GOB: fix interrupted intro sound in Adibou2
The script relies on "var_off_212" (current frame) becoming "-1" when the video ends, but its update was disabled for sound-only videos, by a hack for "Bamboo" game to deal with multiple live videos.

We disable this hack (i.e. re-enable var_off_212 update) when there is only one "live" video.
2022-12-02 11:44:33 +01:00
Simon Delamarre
653ae7caf3
GOB: ensure waitSoundEnd is not called on "live" videos
waitSoundEnd call finishSound(), an then updateLive(), which will load new frames while being in "finished" state.
The !props.noBlock check on call site was not enough, as sometimes the close order on a live video does not have "live" flags.
2022-12-02 11:44:33 +01:00
Simon Delamarre
31e0fda5e7
GOB: more Adibou2 videos must be played in the background
Besides startFrame == -2, it seems that a video must also go to the background (i.e. be non-blocking) if start_frame == end_frame == 0 *and* if it is not to be drawn into a specific sprite.

But more conditions may apply - they are very difficult to follow in the ASM.

This fixes interrupted sound issues in Adibou2 "Playtoons" minigame help descriptions.
2022-12-02 11:44:33 +01:00
Simon Delamarre
6705ee619d
GOB: fix a typo in a comment 2022-12-02 11:44:33 +01:00
Simon Delamarre
9beca4c206
GOB: work around an infinite loop issue in Adibou 2 "change CD" screen
It seems that this bug is harmless in the original game because it requires a certain combination of files to be present in the CD, which is not the case in practice in Adibou2 CDs ; but it exists for us because our fake "CD" search includes all files in game directory and sub-directories.
2022-12-02 11:44:33 +01:00
Simon Delamarre
709df52d48
GOB: fix some audio/video sync issues in Adibou2
This workaround solves audio/video sync issues that used to appear frequently in many animations, e.g. when Adibou kicks the ball in the garden.

Those animations easily get out of sync when the timing is done by hotspots::evaluate, which sometimes does not call animate() as often as needed for good sync (mouse events processing, in particular, can delay the call).
The original game seems to use also some kind of frame skipping to address this problem.
2022-12-02 11:44:33 +01:00
Simon Delamarre
375559b9e3
GOB: fix Adibou2 cake recipes not showing properly 2022-12-02 11:44:33 +01:00
Simon Delamarre
912f61c904
GOB: skip '\r' or '\n' bytes when printing text
CRLF is sometimes found at the end of resource strings, but uselessly (the "printText" opcode has no is no "newline" capacity)

Fixes garbage characters in Adibou2 diploma text.
2022-12-02 11:44:32 +01:00
Simon Delamarre
4ae76a7812
GOB: in "printText" opcode, bits 8-16 of "backColor" indicate the destination surface
Fixes the text in Adibou2's diploma.
2022-12-02 11:44:32 +01:00
Simon Delamarre
0f811dcd6a
GOB: vertical offset bugfix when deflating VMD directly onto a video surface
This fixes a frame offset error in the puzzle game of Adibou2, where the vertical offset was added twice.
2022-12-02 11:44:32 +01:00
Simon Delamarre
df04e1c74c
GOB: drawing order bugfix in Adibou2
Order "100" (and above) should not be modified.

+ rewrite more clearly "order correction" rules
2022-12-02 11:44:32 +01:00
Simon Delamarre
2d0ee1ffa1
GOB: fix some parasite sprites issues in Adibou2
Some sprite cleaning was missing when destroying objects.
2022-12-02 11:44:32 +01:00
Simon Delamarre
bc18fc6361
GOB: workaround to handle application CD changes in some Adibou2 versions
Some versions of Adibou2 are only able to handle one CD at a time. This workaround enable to add Adibou2 applications by copying them as a subdirectory of the game directory, just like in multi-cd-aware versions.
2022-12-02 11:44:32 +01:00
Simon Delamarre
0fcbc34266
GOB: fix regression in Adibou2 paths handling
We still need to call getFile() on paths to remove special tokens (@:, <ALLCD>...), but we do not strip paths anymore.
2022-12-02 11:44:32 +01:00
Simon Delamarre
4a6520c670
GOB: fix exercises completion details in Adibou2 tree 2022-12-02 11:44:32 +01:00
Simon Delamarre
33e13b2ba3
GOB: workaround a bug in Adibou2 scripts after character deletion
Characters deletion in Adibou2 work by deleting all files matching with character number as suffix, but this removes also some unrelated save files about installed applications
2022-12-02 11:44:31 +01:00
Simon Delamarre
d9951de616
GOB: fix a crash in o7_readData when filename is empty 2022-12-02 11:44:31 +01:00
Simon Delamarre
baf76dd2d7
GOB: increase Variables stack size (600 -> 1000)
Previous max size (600) can be reached in some Adibou2 scripts
2022-12-02 11:44:31 +01:00
Simon Delamarre
8a08d6470b
GOB: o7_deleteFile, allow to delete all files matching a pattern
Fixes the "delete character" button in Adibou2

We cannot strip paths for this opcode, as scripts sometimes delete all files in a directory (e.g. "TEMP\*.*", that would have been simplified as "*.*" with path stripping).

Use also full path match for read/write/copy/move operations, to allow distinguishing savegames with same filename under different directories, with a fallback to simple filename matching.
2022-12-02 11:44:31 +01:00
Simon Delamarre
73a3b0580f
GOB: fix a uint16/uint32 cast error in o2_pushVars
Ints were converted to uint16 first and then uint32 before being pushed, and popped as uint32, so a pushed (int32) "-1" was popped as (uint32) 65535.
This fixes an infinite loop when making a mistake in Adibou2 "write sentence in order" exercise.
2022-12-02 11:44:31 +01:00
Simon Delamarre
736223cb7b
GOB: work around a bug in Adibou2 script of "pleasant/unpleasant" game
The script accessed uninitialized parts of an array (index 0 while the array was initialized from index 1).
2022-12-02 11:44:31 +01:00
Simon Delamarre
283fd1b103
GOB: more cursor resizing fixes for Adibou2
This fixes remaining cursor issues in an English version of Adibou2.
2022-12-02 11:44:31 +01:00
Simon Delamarre
4e77480374
GOB: cursors can now be loaded from NE executables
Some Adibou2 versions use NE executables instead of PE, and rely on the "name table" feature for map the cursor name the cursor data.
2022-12-02 11:44:31 +01:00
Simon Delamarre
37965283bf
COMMON: add support for "name table" resource in NE executables
A "resource ID -> name" mapping found in some NE executables, stored as a resource.

Not described by any documentation I could find, but the corresponding #define can be encountered in some old header files.

Mentioned by this blog post https://www.toptensoftware.com/blog/win3mu-5/ (section "The Mysterious Resource Type #15").
2022-12-02 11:44:31 +01:00
Simon Delamarre
0ac43888f2
GOB: handle saving Adibou2 drawings on "floppy disk"
They will just land on the save directory, as other saves, with fix filename "adibou2_drawing_on_floppy_disk".

The use case is to facilitate sharing drawings between different Adibou characters, for example to continue a friend's drawing. In this view, we wrap the full picture and its thumbnail in a same file with a fix filename, so that one need only to move the "adibou2_drawing_on_floppy_disk" file between Adibou2 installations to share "floppy disk" drawings.
2022-12-02 11:44:30 +01:00
Simon Delamarre
5d66b9a200
GOB: add some Adibou1 stubs 2022-12-02 11:44:30 +01:00
Simon Delamarre
cab63f8d31
GOB: skip copy protection test in Adibou1 2022-12-02 11:44:30 +01:00
Simon Delamarre
87536a16e4
GOB: fix errors in Adibou2 savegame files list 2022-12-02 11:44:30 +01:00
Simon Delamarre
680077d92b
GOB: add save handler stubs for Adibou1
Remove a blocking "floppy disk error" screen on some versions.
2022-12-02 11:44:30 +01:00
Simon Delamarre
a0c30a957e
GOB: add more Adibou1 versions 2022-12-02 11:44:30 +01:00
Simon Delamarre
b6e991f1c4
GOB: implement case -1 of o1_keyFunc
Same as case 1. Fixes the "Cancel" button of "Change CD" screen in Adibou2.
2022-12-02 11:44:30 +01:00
Simon Delamarre
572ac219ba
GOB: another fillRect mode used in Adibou2, "fill except one color"
Fixes level 3 of the "mask" game.
2022-12-02 11:44:30 +01:00
Simon Delamarre
141cd85e75
GOB: workaround for an issue with text tool in Adibou2 paint game 2022-12-02 11:44:30 +01:00
Simon Delamarre
f187fdf5a4
GOB: add an English version of Adibou ("Adiboo") 2022-12-02 11:44:29 +01:00
Simon Delamarre
656cc44dfe
GOB: use oPlaytoons_printText in Adibou2
Partially fix the "text" tool in paint game, font spacing is now correct (there is still a key listening issue, though).
2022-12-02 11:44:29 +01:00
Simon Delamarre
d1793fb833
GOB: fix in oPlaytoons_printText 2022-12-02 11:44:29 +01:00
Simon Delamarre
da7439b3f3
GOB: Adibou2 forces palette entries 0 / 255 to be black / white 2022-12-02 11:44:29 +01:00
Simon Delamarre
65ec3bfa8a
GOB: remove a forced retrace in newCycleAnim for Adibou2
Lead to glitches (scenes shown too soon before loading the correct palette), and does not seem to be needed.
2022-12-02 11:44:29 +01:00
Simon Delamarre
519b9b88ec
GOB: disable filename replacement for Adibou2 database IDs.
Fix missing names in applications list.
2022-12-02 11:44:29 +01:00
Simon Delamarre
edb0528536
GOB: no "fade" animation in Adibou2 after o1_palLoad
No fade transitions in the original game, and it leads to glitches (e.g. sometimes a scene is shown to soon, with a wrong palette, due to unexpected retrace in fade() call).
2022-12-02 11:44:29 +01:00
Simon Delamarre
f19528a0ad
GOB: avoid warning in o7_setActiveCD when matching main game directory 2022-12-02 11:44:29 +01:00
Simon Delamarre
b907d2afa6
GOB: workaround for a bug in Adibou2 scripts of "cooking" activity 2022-12-02 11:44:29 +01:00
Simon Delamarre
fc8b36f1d8
GOB: DRAW_PUTPIXEL with pattern 0xFF is getPixel() in Adibou2 2022-12-02 11:44:28 +01:00