3573 Commits

Author SHA1 Message Date
Torbjörn Andersson
cdfe9b5b4c SCUMM: Add practice mode box for Mac Loom
Unlike the PC version, the practice mode box appears to be hard-coded in
the Mac version. The script that draws the box in the PC version just
sets variables in the Mac version. This implementation is based on
screenshots.

To keep things a bit saner, I've split out the Mac-specific drawing to
its own file.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
620d885eac SCUMM: Clarify comment about shadowed text in Mac Loom 2021-05-17 18:44:29 +02:00
Torbjörn Andersson
9051349f31 SCUMM: Always draw notes and note names with a shadow in Mac Loom
But apparently the shadow for notes is a bit different from what I draw.
I have to figure that one out later.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
3ef517d2a1 SCUMM: Fix some memory leaks
I forgot to free the streams after asking the Mac resource manager for a
resource.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
93cbb988a6 SCUMM: Some fixes that I'm not sure exactly what they do
I don't know what these fixes do exactly, but judging by the old code
they should be there.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
ec6f0b1cf3 SCUMM: Some fixes for removing text
Drawing boxes and restoring verb backgrounds now also clears the text
surface in Macintosh Loom.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
5c0c64bc5a SCUMM: Fixed black screen after loading savegame.
I misunderstood the purpose of _textSurface. Now text is drawn to the
Mac screen, and a text mask is drawn to the _textSurface. I hope that's
better.

Still no luck with the non-disappearing text at the start of the game
though.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
6980ddb337 SCUMM: Add hard-coded Macintosh palette for Loom
I think this is correct. It's based on Basilisk II.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
85ba3876e4 SCUMM: Fix Mac text rendering.
The font renderer now remembers if the previous character ended on an
odd X coordinate, and compensates for that when calculating the next
character's position.

Maybe there's a more elegant way to do it, but it will do for now. The
rendering appears identical to the original, at least for the test case
I'm using.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
27420f78d4 SCUMM: Simplified Mac font rendering
Instead of trying to keep track of the real Mac screen coordinates in
the _charset data type, use the original 320x200 coordinates and only
scale up at the time of rendering.

Either way, the output is not pixel perfect, and this is much less error
prone.

Now if only text removal worked correctly...
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
5b70ddd802 SCUMM: Fix text color and shadow
Text positioning is still all over the place, though.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
fbefa65da9 SCUMM: Mark screen as dirty in the Mac font renderer
The difficulty buttons are now drawn almost correctly, even if little
else is. (The text position appears to be slightly wrong.)
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
70a36d6b71 SCUMM: Use high-resolution cursor for Mac Loom 2021-05-17 18:44:29 +02:00
Torbjörn Andersson
819cfb8383 SCUMM: Initial work on Mac Loom font renderer
The main purpose of this set of changes is to refactor the code to make
it easier to pass the name of the Macintosh resource file to other parts
of the engine (it used to be hard-coded in the music players), and to
scale-up the graphics by 2.

The actual font rendering is almost completely broken.
2021-05-17 18:44:29 +02:00
Filippos Karapetis
cb6a107499 SCUMM: Limit x-range of selection workaround to Hebrew versions
Fixes bug #12552
2021-05-17 02:08:21 +03:00
wonst719
7ac29d2dcd SCUMM: Fix HashMap usage in Korean translation code 2021-05-16 21:09:24 +09:00
Torbjörn Andersson
40a7ebcc81 SCUMM: Add Macintosh variant of Monkey Island 1
For detection purposes, the Mac variant is the same as the CD variant
except without audio tracks. Otherwise, ScummVM will warn about the
"missing" audio files when the game starts.

Also added missing file size for one of the Mac verions. I have that
version, so this should be correct.
2021-05-07 13:18:49 +03:00
Torbjörn Andersson
ab94375aa7 SCUMM: Remove unnecessary include. 2021-05-06 15:21:07 +02:00
Orgad Shaneh
a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Cameron Cawley
d02daaeb2b
SCUMM: Remove direct use of Graphics::Surface from ARM code (#2931) 2021-05-04 00:17:52 +03:00
Orgad Shaneh
dd88556a0c SCUMM: Fix autosave
Autosave was centralized in 30d34fa63d1f5ccf37dfd9c80b0009c4115e78f2, but
SCUMM engine was left behind.

Bugreport #12026
2021-05-01 11:30:45 +03:00
Mathias Parnaudeau
ac1d5352be SCUMM: Fix format-truncation warning in IMUSE player
The size in snprintf includes the final null character, so here
3 bytes are not enough to store a space, 2 digits and the null
character.
The compiler complained and the output used to display 1 digit
instead of 2, for each byte.
Extend this size from 3 to 4 in the snprintf call.
2021-04-30 00:05:24 +01:00
Little Cat
f9b741c0ee SCUMM: Add comments describing the room variables. 2021-04-27 01:03:00 +03:00
Little Cat
e0b61f1ec3 SCUMM: Fixed regression caused by Pete Workaround
The original commit containing the Pete Wheeler hotfix for the Baseball gmaes has caused a regression where batting with any other bat as Pete Wheeler would slow down his swinging animation after hitting the ball.  Whoops.  This fixes the regression by adding another check to determine whether he is bunting or not.
2021-04-27 01:03:00 +03:00
Orgad Shaneh
c8fc484c37 SCUMM: Fix X-range of selection for Hebrew on scumm<7
curRect.left is assigned in the script, and it is not modified. right is
assigned with the screen width - original left.

This results in bad highlighting of the verbs all over the line width,
instead of being limited to the actual string.

Due to that, sometimes the selection range of the up/down arrows overlaps
with some of the verbs, and then these verbs cannot be selected.

Solve by storing the original left value, and using it as initial x
position for the string (the actual right-to-left manipulation is done in
drawString()), and modify the value of curRect.left to match the string
that was actually drawn.

This bug is similar to the one that was fixed in 58e921eb87, but the
solution that was done there for v7 and v8 cannot work here, because the
string logic is much more complicated.
2021-04-26 21:26:41 +03:00
Eugene Sandulenko
f5b0b27fdf
SCUMM: Added detection for freddi1. Bugreport #12104 2021-04-23 15:56:49 +02:00
Zvika Haramaty
a1f440c073 SCUMM: FM-TOWNS: Add optional trimming to 200 pixels height
Trimming the screen to 200 pixels allows using aspect ratio correction.
2021-04-20 23:56:39 +02:00
Orgad Shaneh
a21f7d8e96 SCUMM: Fix compiler warning 2021-04-19 22:11:06 +03:00
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Eugene Sandulenko
a138c0b646
ENGINES: Fix mess with the mismatched engine ids between engine/detection plugins 2021-04-14 14:42:38 +02:00
Eugene Sandulenko
a03b3091d2 SCUMM: Avoid double scaling in Help dialog 2021-04-11 21:21:44 +02:00
athrxx
ca6db6e409 SCUMM: (IMUSE/Amiga) - ignore Roland GS setting for Amiga driver
(Fix for bug no. 12374 - the invalid GS setting would cause a nullptr deref)
2021-04-10 16:02:05 +02:00
Little Cat
71f490e550 SCUMM: Add workaround for Pete Wheeler softlock
This workaround fixes a script bug in Backyard Baseball 2001 and 2003 where bunting a foul ball as Pete Wheeler may softlock the game if the ball goes far left or right field.

The original Backyard Baseball 1997 release does not seem to have this bug in my testing.
2021-04-09 17:47:53 +02:00
Orgad Shaneh
5c0b76ec34 SCUMM: Add some missing includes
Pre-included files are not reliable.
2021-04-05 08:52:23 +03:00
Orgad Shaneh
3e27d24994 SCUMM: Fix calculation of arrow position on Hebrew
The text buffer starts on the i offset. This was overlooked in the original
patch.

This amends commit 89c5cd5e5d81d780c74bf5da01ac6fb227e0695c.
2021-03-31 02:03:21 +03:00
Orgad Shaneh
89c5cd5e5d SCUMM: Simplify and optimize calculation of left position in Hebrew
Control characters are already handled in getStringWidth. There is no
reason to copy the entire string for stripping them.
2021-03-25 08:28:19 +02:00
D G Turner
a404c80d41 SCUMM: Fix Memset on Non-Trivial Structure GCC Compiler Warnings 2021-03-24 23:23:46 +00:00
Orgad Shaneh
e074a6da1b SCUMM: Fix compiler warnings for bad formats
long and size_t are not the same on Win64.
2021-03-23 17:32:04 +02:00
BLooperZ
b88403b18b SCUMM: INSANE: always enable line wrap on hebrew 2021-03-19 01:20:10 +01:00
BLooperZ
ad58230915 SCUMM: always enable line wrap on hebrew 2021-03-19 01:20:10 +01:00
Andrea Boscarino
17b4a5a088 SCUMM: FT: improve and fix iMUSE Digital 2021-03-14 19:10:37 +01:00
Orgad Shaneh
58e921eb87 SCUMM: Fix wrong rect for verbs on Hebrew
The value of left is applied from the script all the time, and was
replaced in drawVerb.

The problem with this approach is that redrawVerbs maps the mouse
location to verb index *before* calling drawVerb, so the rectangles it
compares against are invalid in X-axis (right is always _screenWidth -
1, and left is always 5).

This caused several bugs:
* Each verb was clickable all over the screen's width, although it was
  not highlighted.
* If the mouse was between 2 verbs, long above short, the Y-axis has 6
  overlapping pixels (e.g. 1: 330-360, 2: 354-384). Scanning is done
  bottom-up, so 1 was highlighted, but 2 was selected because of the
  previous bullet.
* The text on Hebrew was aligned to the right without any padding. Other
  languages have left = 5.

Fixed by setting right instead of left when applying the script, and
adjusting left in drawVerb. Other languages are not affected.

Another issue, unrelated to language selection: A verb that was split to
2 lines was clickable all over the screen's width. That's because
curRect.right was set beyond the _screenWidth, and it was not trimmed to
the first (longer) line's length. On Hebrew, curRect.left became
negative. This is also fixed in this commit.
2021-03-08 11:57:30 +02:00
sluicebox
93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
athrxx
9b582ce0c5 SCUMM: (LOOM) - fix bug no. 11480
(Loom (VGA) - Graphical glitches where some text appears over previous line and the wood musical note disappear)

The glitch is caused by a workaround in ScummEngine::actorTalk(). Removing it will make the original bug (speech animations for empty text strings) reappear. I have located the code which prevents that in LOOM DOS EGA disasm and added that. The FM-Towns versions don't have such code, but I do not get that weird speech animations either. So it seems to be fixed in a different manner there...
2021-02-28 21:00:23 +01:00
athrxx
80f79d21c9 SCUMM: (FM-Towns) - fix graphics glitch
In certain situations a string rect could get restored twice, e. g. LOOM, dragon's lair, when double clicking the gold pile and then pressing Esc.
2021-02-28 21:00:23 +01:00
athrxx
65f567d817 SCUMM: (FM-Towns) - array declaration cleanup
_cyclRects can have no more than 10 entries, but was declared as [16]. Someone put a TODO about it in saveload.cpp, so why not fix it...
2021-02-28 21:00:23 +01:00
Orgad Shaneh
c0461b789e SCUMM: Fix bad offset on game loading
The iterator l was used inside the loop, which caused it to bail out
after 12 iterations instead of 16.

Amends 434d1f37f9398b6a7a1b08cd5464a1d5ecccdc41.
2021-02-19 23:18:16 +02:00
Andrea Boscarino
bb4863969f SCUMM: Digital iMUSE: deschedule crossfades for flushed tracks 2021-02-17 12:36:33 +00:00
Andrea Boscarino
da89e91e5c SCUMM: Digital iMUSE: fix FT crash and music breaking bug 2021-02-17 12:36:33 +00:00
athrxx
4f9ae442d5 SCUMM: (FM-TOWNS) - add smooth scrolling
This is mostly based on ZAK and MI2 disasm (and a bit LOOM). For MI1 and INDY4 I have at least checked with the FM-Towns UNZ emulator to ensure that they actually have the smooth scrolling.

The smooth scrolling is a bit tricky with regard to the timing. The scrolling tends to be a bit too slow for the engine, since it happens at a speed of 1 pixel per 60Hz tick, while the engine sometimes writes one or more new 8 pixel strips at the same time. So the scrolling often has to catch up to the engine. The original has a compensation mechanism which I tried to adapt. We'll see if it needs more fine tuning...

The Loom intro even glitches in the UNZ FM-Towns emulator due overflowing the scrolling surface (and causing a wraparound). But I made a fix for that.

Since we do have a bug report about the speed of the ZAK intro (and the new scrolling code does affect the timing) I have run the ZAK intro in ScummVM and in the FM-Towns UNZ emulator (with i80386DX, 16 MHz setting) side by side and they seem totally in sync. If I reduce the MHz setting in the emulator to 10 MHz on the emulator the intro will play slower, but still not play through the whole song. With 8 MHz I get close to finishing the song, but this seems to be almost to slow to run the game properly. So I'll leave that bug ticket open...
2021-02-11 20:01:24 +01:00