Commit Graph

3587 Commits

Author SHA1 Message Date
Orgad Shaneh
3b05a52588
SCUMM: Workaround missing subtitle in The Dig (#3014)
Fixes #4410
2021-06-02 21:59:50 +03:00
athrxx
d099ed5047 SCUMM: (FM-TOWNS) - make scrolling more smooth for fast platforms
The engine now measures whether it can perform one screen update within a 60Hz tick. Unfortunately the calls to OSystem::updateScreen() may take very long, depending on the backend and the filter setting. In this case the engine will start to catch up to the current frame. It should still look fine, unless the platform is way too slow for the selected filter setting (with the wrong settings it is not too difficult to achieve OSystem::updateScreen()  durations of over 100ms).
2021-05-28 20:26:28 +02:00
athrxx
cdfc7aba23 SCUMM: (FM-TOWNS) - cleanup 2021-05-24 13:53:42 +02:00
athrxx
cfa0654ce8 SCUMM: (FM-TOWNS) - fix for builds w/o USE_RGBCOLOR
These changes are currently pointless, since the affected function variants won't be called. The Japanese game versions for which they would be used are not supported in non-USE_RGBCOLOR builds. But the code should be correct nonetheless...
2021-05-24 04:13:23 +02:00
athrxx
78de93126f SCUMM: (FM-TOWNS) - optimize drawing code
("drawing" in this case means the data conversion and transfer from the gfx layers to the screen buffer)

From my measuring experiments in the MSVC debugger this speeds up the drawing 2 - 3 times. Not sure about release builds, whether these profit even more.
2021-05-24 03:34:49 +02:00
athrxx
78ec256cca SCUMM: (FM-TOWNS) - fix bug no. 12560 ("[FM Towns] scrolling much too slow")
(partly revert fb8f1084)

There is no simple solution that would still  leave the "butter smooth" scrolling for faster platforms intact. I have measured times between several code points to find any bottlenecks. My finding is that even single script opcodes may well take over 200ms to execute. And exceeding a singe 60 Hz tick happens way more often (which makes the scrolling fall behind and have to catch up, thus becoming a bit sloppy). So, for the "butter smooth" scrolling I'll probably implement a timer for the screen updates (which will then really behave much more like the interrupt handler of the original). But that's for a separate commit. This one is mostly about the bug ticket..
2021-05-22 14:24:54 +02:00
sluicebox
55344bf0bc SCUMM: Add missing debug channel terminator 2021-05-22 03:56:02 -06:00
ysj1173886760
9f1f800d5a SCUMM: add forward declaration of FontSJIS 2021-05-22 01:34:57 +02:00
ysj1173886760
263d27a89b SCUMM: move debug messages in detection into kDebugGlobalDetection channel 2021-05-22 01:34:57 +02:00
ysj1173886760
17efb68cba SCUMM: move debug channels to metaEngineDetection 2021-05-22 01:34:57 +02:00
Orgad Shaneh
8047607908 SCUMM: Fix unclickable centered verbs
Fixes #12552
2021-05-17 22:16:56 +03:00
athrxx
fb8f108402 SCUMM: (FM-Towns) - improve smooth scroling
I have made the scrolling more smooth and still hopefully managed not to break the sync with the engine (which really is a bit tricky).
I've tested playing the ZAK and LOOM intros and also walking around in ZAK and MI2, since there are some good test cases there. I've also compared all these side by side with the UNZ emulator.
2021-05-17 20:02:24 +02:00
Torbjörn Andersson
f8c4fe63e3 SCUMM: Hack Mac Loom note names to never be light gray
Note names can be drawn in three different colors: Dark gray for notes
you don't know, light gray for notes you know, and white for notes
you're using.

Or at least, that's how the DOS version does it. But there, notes
automatically go back to light gray once the draft is done. In the Mac
version, that doesn't seem to happen. And judging by how it behaves when
running it in a Mac emulator, known notes are always white.
2021-05-17 18:44:29 +02:00
Torbjörn Andersson
c0c072f4c4 SCUMM: Add hack against Mac Loom distaff glitch
Here is what I think happens: When text is removed, the text surface is
cleared in its entirety. This means that the next time the screen is
updated, it may redraw the low-resolution background. Since this has no
information about the high-resolution text, any such text is lost.

The distaff notes and note names are drawn in with the high-resolution
font. When using the distaff, only the note name is redrawn, not the
note itself. The way screen updates are handled, a larger area than just
the note name gets redrawn, and then part of the note may be cleared
away.

To get around this, when a note name is drawn on the distaff the text
surface is also updated with the note itself. (There is no need to
redraw the note, since we can assume it's already on screen, and we
don't want to bother with getting the color right.)

The only time the printChar() function prints note names should be on
the distaff. The Practice Mode box is handled by drawChar() instead.
2021-05-17 18:44:29 +02:00
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 30d34fa63d, 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 89c5cd5e5d.
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