When the noop flag was set on a MIDI event by the AGOS Simon 1 Windows or GMF
parsers, it would not be cleared when parsing the next event, leading to all
subsequent MIDI events being ignored.
Fixed this by setting the noop flag to false when it is not applicable to a
MIDI event.
When using this option with Simon 1, Simon wouldn't be cleared from the
bottom of the screen, if pressing Esc when Simon starts walking through
the screen right after the "Simon the Sorcerer" title is printed, at the
very beginning of the game.
Triggering the clearSurfaces() code even when _neverFade is enabled
solves this problem.
Fixes a mistake of mine in commit 802caa4c39.
Waxworks DOS has both digital and limited MIDI SFX. The game scripts use two
different opcodes for trigging digital and MIDI SFX; if a sound effect has both
a digital and a MIDI version, both opcodes are triggered. When digital SFX are
active, ScummVM would try to handle both the digital and the MIDI opcode by
playing a digital SFX. This would crash the game if the MIDI SFX ID was invalid
as a digital SFX ID. Strangely enough, this bug also seems to affect the Amiga
version. Apparently both opcodes are still in the scripts of this version, even
though it does not support MIDI at all AFAIK.
This commit fixes the issue by only playing the MIDI SFX if digital SFX are
turned off and ignoring them otherwise.
The engine would try to initialize the MidiPlayer for all DOS games, even the
ones that don't use MIDI (Personal Nightmare and Feeble Files demos). This
caused a problem with the new MIDI code, which does not set up the necessary
objects for these games and crashed on a null pointer.
This is fixed by adding PN and FF as exceptions to the if condition guarding
initialization of the MidiPlayer.
Simon1 and Simon2 fade the screen to black whenever leaving a room,
but this can be slow to render on some devices, and for some people
nowadays it can really make the pace of the game quite slow.
This commit enables the Accolade AdLib driver's OPL3 mode for Elvira 1. It adds
some extra notes, most notable in the intro track. A small fix is applied to
one of the instruments in the intro track to make it work properly with this
mode.
Some Elvira 1 music tracks would not loop properly. These tracks make use of
the loop event, which stores the position in the MIDI stream where the parser
will later loop to. An event is optionally preceded by a delta, as indicated by
the _noDelta property of the parser. However, when looping, this flag was not
set to the state matching the event after the loop point. This would sometimes
cause the parser to interpret a MIDI event as a delta, which would break the
parsing.
This is fixed by storing the _noDelta flag with the loop data and setting it
to the stored value when looping.
This change improves the accuracy of the timing of the AdLib SFX of Elvira 2
and Waxworks. The frequency of the SFX script timer is now synchronized with
the callback timer of the AdLib driver, which makes the timing of the OPL
register writes match that of the original interpreter.
This adds support for the AdLib and MT-32 sound effects in Elvira 2 and
Waxworks. It adds an option to the UI to toggle between sampled and
synthesized SFX. It also adds the following enhancements:
- AdLib OPL3 mode for Elvira 2, Waxworks and Simon 1 floppy demo. This can be
selected using a new UI option.
- Mixed AdLib/MIDI mode for Elvira 2 and Waxworks.
- Implemented "monophonic chords", a feature of the original MIDI code which
would play only the highest note of a chord on AdLib. Most noticable in the
Waxworks music.
- Added UI option to select Simon 1 DOS music tempos.
- Rewrite of the AdLib and MT-32 drivers to remove duplication and make use of
features of the standard multisource drivers.
- Refactored MidiPlayer to standardize interface and remove code moved to the
drivers and parsers.
The DOS version of Simon 1 has different music tempos compared to the Windows
version. This commit adds the option to both the DOS and Windows MIDI parsers
to use either the DOS or Windows tempos.
The AGOS PC-98 MIDI driver did not check the native_mt32 flag when determining
the type of MIDI device. This would cause a hardware MT-32 or external
softsynth to be treated as a GM device.
This commit fixes this by adding the missing check.
The first scene of the Simon The Sorcerer 2 intro uses 3 music tracks. The last
2 are missing from the MT-32 MIDI data set. The original interpreter just stops
playing music after the first track and does not restart until the next scene.
This commit fixes this problem by using the GM versions of these 2 tracks
instead and mapping the GM instruments to MT-32 ones.
The DOS versions of Simon the Sorcerer 2 now use the Miles drivers. AdLib now
sounds like the original does. ScummVM would use the second set of XMIDI data,
written for the MT-32, for GM with instrument remapping. Now the first set is
used, which uses GM instruments and has extra instruments on several pieces.
For all versions music fade-outs have been added during screen fades.
MIDI music is now paused by pausing the parser(s) instead of relying on the
mixer streams to stop providing callbacks. This gives more consistent behavior
as external MIDI devices or softsynths now also pause playback.
Muting sound now sets the volume to 0 instead of pausing playback.
This updates the Simon 1 DOS AdLib driver and adds an AdLib driver for Windows.
The DOS driver now has OPL3 support, which eliminates the note cut off that
frequently occurs on an OPL2. It also allows for some limited use of stereo.
The driver now plays the floppy SFX accurately compared to the original
interpreter. It also implements multisource functionality, allowing for
separate volume control for music and SFX for the floppy version.
The Windows driver just maps the MT-32 instruments of the Simon 1 MIDI data to
the equivalent GM instruments.
This commit adds MIDI parser subclasses for the Simon 1 GMF format and for the
SMF variant used by the Windows versions of Simon 1 and 2.
The GMF format was handled by the SMF parser, which can now be removed from
that class. It also fixes the tempos not matching the DOS interpreter.
The Simon Windows SMF variant was handled in the AGOS midi class. Moving it to
a separate parser allows for some cleaner code in that class. It now also
corrects the tempos to match those of the DOS interpreter.