This commit adds a fallback for the GOG version of I Have No Mouth... This
version is missing the AdLib instrument definition files which are necessary
to use the Miles driver. If these files are missing, the regular AdLib driver
is used, which has built-in instrument definitions. A warning is shown so the
user knows the music is inaccurate without the missing files.
The engine expected all files listed in the detection entries to be resource
files. This commit adds the option to use a non-resource file for detection.
This is needed to use a MID file to detect one of the Windows versions of
Inherit the Earth.
This commit adds separate detection entries for the Windows and Linux versions
of Inherit The Earth.
There was a combined DOS/Windows/Linux entry with DOS as the platform. It is
not clear to me if this is a combined release or a single entry for three
separate releases, but the Windows and Linux release do exist as separate
releases. These would be detected with DOS as the platform, which would cause
the music not to work, because the DOS, Windows and Linux versions use
different music formats.
We can detect the modern 64-bit macOS and WinCE trial versions and
inform users that they're unsupported.
We should explore whether the limited trial functionality can be
implemented in ScummVM, as the Pocket PC version has some unique
features in both trial and unlocked states.
Miles 2 uses the default MT-32 pitch bend range of 12 semitones for its AdLib
driver. Miles 3 switched to the default GM pitch bend range of 2 semitones for
AdLib. ScummVM would always use the Miles 2 pitch bend range, which caused
pitch bend for Miles 3 games to sound wrong on AdLib.
To fix this, a property was added to the Miles AdLib driver to specify which
Miles version to emulate. Depending on the value of this option, the correct
default pitch bend range is set.
This employs a "lazy" approach: the "format" for the credits stays
exactly as it was, i.e., perl code. Of course one may want to change
this to another format (e.g. YAML, JSON, XML; or also shell script or
AWK, like `configure.engine` uses). But I deliberately kept it simple,
to get a minimal change that is easy to verify. Any further changes to
e.g. the format can be layered atop this.
This fixes the fade-outs in IHNM, most notably at the end of the title screen
when using GM. Fades would take 30 seconds instead of the intended 3, and the
engine did not wait for the fade to finish but immediately played the next
track, which aborted the fade.
Note that the engine still does not always wait for a fade to finish when it is
triggered from a script. For example after AM's speech when dying in
Gorrister's chapter, in the original interpreter the music fades out while the
screen fades to black. In ScummVM, the screen does not fade out, so the music
fade is immediately aborted by playing the next track.
This limits the pitch bend and sustain reset messages at the end of MIDI tracks
to I Have No Mouth, And I Must Scream. Inherit The Earth does not use sustain
and pitch bend is already reset at the start of each track. IHNM does use
sustain and does not reset pitch bend at the start of each track.
A new MidiParser object is created every time a MIDI track is played, but the
old parser would not be freed. Fixed this by first deleting the parser before
creating a new one.
Music volume is now handled by the Music class. Some calls to play included a
call to setVolume, but play already does this, so these calls were unnecessary.
This removes the MusicDriver class, which was a subclass of MidiPlayer. The
MidiPlayer relies on MidiChannel objects for some functionality and has
problems with the Miles AdLib driver and Munt.
The functionality of this class is now implemented in the Music class. Volume
management is handled by the multisource MIDI drivers themselves, and added to
the Music class for digital and PC98 music.
I whish I knew whether I am implementing an original bug here or if this is intended behavior. But it does achieve text output faithful to the original. And it even does actually look better...
This commit aims at getting the text almost pixel-exact like the original (from disasm and from comparison with an emulator).
It seems that the original messed up the upscaling (from 320x200 to 640x400). The whole method how they do it is weird. The text is rendered on a 320x200 pixel surface and this surface gets blitted in the center of a 640x400 pixel screen. Sometimes they
seem to assume to draw onto 320x200, sometimes onto 640x400 (e. g. the line height for the paragraph headlines is assumed to be 11, although the font height is 18; and it will use height 18 for all the other text lines). Also, the orginal will use different printing methods for the headlines and for the text blocks below, which also doesn't help to get this right...
Now, some credits text lines are still off by 1 pixel vertically due to my method of upscaling (at the very last moment in drawDirtyRects()). I find this a much cleaner approach than the original method which is just hacking up the whole graphics code to use 640x400 coords (except for the places they forgot, see above). But this also means I can't hit the odd lines for text positioning, thus the one pixel off sometimes...
The font style is diiferent for various strings (e.g. verbs are drawn outlined instead of shaded, converse line are drawn normally instead of shaded).
Also implement sjis version of "bullet" for the converse strings.
- The Japanese font is drawn in double resolution on the top layer. The rest of the graphics gets drawn in standard VGA resolution on the bottom layer, then scaled 2x and merged with the top layer.
- Adjust mouse handling. In dual layer mode the event manager reports mouse coordinates in double resolution, so these have to be scaled down.