This has been bugging me for a while...
Note that ifNotStateCommon and ifStateCommon have
been semantically inverted until now. I also fixed their
naming now to reflect what they are actually doing.
We should play the "Pickum item" sound when starting a new game, but until
now, only the "crickets" sound was played in ScummVM.
Using triggerSound() instead of addSoundToQueue() to deal with this sound
effect fixes this, and AndywinXp confirmed from 6502 disasm that "whatever
is called through startSound is executed immediately", and "there doesn't
seem to be a sound queue."
Thanks a lot again, Andy! :)
This closes and fixes#11971:
"SCUMM: MANIAC/ZAK C64: GUI & dialog text are incorrectly
positioned on screen, and cursor is improperly layered"
The ticket also mentions improperly layered cursor:
"the pointer cursors pass *behind* the various character sprites
on screen", but there's really nothing we can do about it,
our cursor handling is way too different to function like the original
(and anyway, it looks like a severe C64 hardware limitation quirk...)
Albeit not 100% necessary for rewriting the HE sound engine,
I decided to make this change in order to:
- Give proper meaning to magic numbers and variables
which were given temporary names 20 years ago;
- Avoid going insane when making comparison with HE code
and ours, when rewriting the sound code.
In the English version, Syd's biography says that he's "tring" to start
his own new-wave band. Other versions I've seen (in person or on YouTube)
have either fixed the typo, or (in the case of the NES version)
completely rewritten the text. Fix this, and mark it as an enhancement.
This does not improve anything about these modes for v2 and v3, except:
- brighter CGA colors
- v2 will also get the more accurate Hercules mouse cursor
I will do improve v2/v3 as separate tasks. v3 seems to be mostly fine, anyway, except for the actors (we dither them just like the backgrounds, but that looks different in DOSBox).
According to the manual, you can execute commands by clicking on the
sentence line. But this doesn't work with the v1 or v2 DOS versions,
even though it works with the C64 demo. This is because the verb script
doesn't for this, so we have to do that ourselves. This is loosely based
on how Zak McKracken does it.
The lab cutscene where Purple Tentacle is bullying Sandy would hang
when Dr Fred is done talking, in the official French version.
This appears to be related to this VAR_CHARCOUNT check in script no. 155:
[0085] (14) print(9,"{{Dr Fred's reaction line, shorter in French}}");
[00DA] (80) breakHere();
[00DB] (44) unless (VAR_CHARCOUNT > 90) goto 00DA;
Usually, French sentences are a bit longer than English sentences, but
in this case, it's shorter, but yet the script didn't adjust the 90
value, so it would indefinitely loop, causing the scene to hang (until
the player presses the Esc key) and Sandy's reaction to be lost.
So we just pad this string with extra spaces if its length looks too
short for the default VAR_CHARCOUNT check. This should also remain
harmless if the string *is* long enough, or if a translation did fix
the VAR_CHARCOUNT check.
Still, we only restrict this workaround to the French version for now,
since we're not aware of a similar problem with other translations.
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.
In contrast to the comment in o_beginOverride() VAR(VAR_OVERRIDE) is not set in the disassembly. In addition the cutscene stack-pointer is always 0 as this feature is not used in v0. This makes o_beginOverride() work the same way o2_beginOverride() and so it is not needed anymore.
Note that fetchScriptWord() was changed to ScummEngine::fetchScriptWord() in o2_beginOverride() as ScummEngine_v0::fetchScriptWord() only fetches a byte.
As we need two bytes here we have to use ScummEngine::fetchScriptWord().