Commit Graph
81 Commits
Author SHA1 Message Date
Coen Rampen 734817597b AUDIO: Add rhythm mode support to AdLib MS driver
This adds support for the OPL rhythm mode to the AdLib multisource MIDI driver.
Some games (f.e. Simon 1) use this to generate the rhythm sounds of their music.
2022-05-09 17:19:41 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 04eacfa7d3 LURE: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Alexandre Detiste 6044504762 JANITORIAL: typos
some in the variable names, some in the comments;
no change for the strings that interract with original games assets
2021-10-31 20:46:31 +01:00
Coen Rampen c234eb64a2 LURE: Fix struct init, member hiding warnings 2021-07-02 15:40:14 +02:00
Coen Rampen e56542808b LURE: Fix invalid array and struct init 2021-07-02 14:51:51 +02:00
Coen Rampen e2a1362bf9 LURE: Improve AdLib support
This improves the AdLib support for Lure of the Temptress, which was unfinished.
2021-07-02 14:16:50 +02:00
NMIError 17f4e65aff LURE: Improve MT-32 fade-out in intro
The first track in the LotT introduction fades out before the second track
starts. The fade-out is implemented by reducing the velocity of the new notes
that are being played. Because this does not affect notes that are already
playing, the fade-out effect is not very good. I've replaced this by a fade-out
using MIDI channel volume.
2020-12-08 17:00:28 +01:00
NMIError 6454b69026 LURE: Fix game over screen
The music playing at the game over screen would only play once and send MIDI
CC 18 messages, which are not defined in the MIDI standard. I added looping and
removed the non-standard MIDI messages to prevent possible compatibility
issues.

The music for cutscenes and for the game over screen had some strange volume
differences compared to the original interpreter which seem to be caused by a
bug in the original interpreter where volume adjustments from sound effects
would carry over into the music. I've added a note to explain this difference.
2020-12-08 17:00:28 +01:00
NMIError 432529b2bb LURE: Fix chute animation
The animation that plays when you fall through the sewage chute near the start
of the game had some issues. Fades were missing at several points, the middle
part of the animation was played only once and too slow, and when skipping the
animation it would only skip the currently playing part instead of the entire
animation.

To fix these issues, I've added an option to AnimationSequence to loop the
animation a number of times.
2020-12-08 17:00:28 +01:00
NMIError ae3c9777a9 LURE: Fix warnings for missing init and unsigned/signed 2020-12-06 16:37:08 +00:00
NMIError f134e41b8c LURE: Don't send aftertouch to MT-32
Some tracks in LotT contain channel aftertouch events. These are not supported
by the MT-32 and the original interpreter does not send them to the MIDI
device. This change removes them from the MIDI output.
2020-12-06 16:37:08 +00:00
NMIError 20d5307bb9 LURE: Stop MIDI notes when pausing
When pausing the game by bringing up the ScummVM menu, the MIDI notes would
hang. I've added code to pause and resume the active MIDI parsers, which stops
the active notes.
2020-12-06 16:37:08 +00:00
NMIError 81c514ac8f LURE: Add MT-32 initialization icon blinking 2020-12-06 16:37:08 +00:00
NMIError 89e6ffc2e6 LURE: Use MT-32/GM MidiDriver
This change adds the MT-32/GM multisource MidiDriver to LotT. This adds the
following functionality:
- MT-32 initialization using the SysEx queue. ScummVM will remain responsive
while the SysExes are sent and the user can abort the process when skipping the
introduction or quitting the game.
- Use of Roland GS MT-32 instrument mapping.

It also allows for a proper implementation of music fade-outs. Some
functionality previously implemented in SoundManager is now done by the driver.
2020-12-06 16:37:08 +00:00
NMIError 887dcf8c13 LURE: Remove TrashReverb
The original interpreter sends out a SysEx to turn off the MT-32 reverb when
opening a door while outside. This does not seem to work properly in the
original interpreter, and it is unclear what the developer's intentions were
with this function, so I've added a comment and removed the functionality.
2020-12-06 16:37:08 +00:00
NMIError f45a55d809 LURE: Add audio initialization icon
When sending SysEx data to the MT-32, the game blinks an icon in the lower left
corner of the screen. This change adds that icon. It is stored in the
executable, so I added code to create_lure_dat to extract the icon and add it
to the ScummVM data file. The new version of this file is now required to run
the game.
2020-12-06 16:37:08 +00:00
NMIError ffcf4976b7 LURE: Fix looping sound effects
Some sound effects in LotT loop, like the thunderstorm in the beginning of the
game. This is indicated by the high bit of the sound number. This change adds
support for these looping sound effects.
2020-12-06 16:37:08 +00:00
NMIError 93abb89ec1 LURE: Remove Note Off velocity
The LotT MT-32 MIDI data specifies a velocity value for the Note Off events,
but this is not sent to the MT-32 by the original interpreter. This removes the
velocity from the Note Off events, so it matches the MIDI output of the
original interpreter.
2020-12-06 16:37:08 +00:00
NMIError 288ffbedf4 LURE: Fix MT-32 channel assignments
ScummVM would add one to the number of MIDI channels specified for a sound
resource, but this does not match the actual number of channels used in the
MIDI data. Additionally, it would not take into account the fact that the first
MIDI channel used in the MT-32 data is channel 1 instead of 0. This change
corrects this; the MIDI channels used now match those of the original
interpreter.
2020-12-06 16:37:08 +00:00
NMIError c57ad9c1f5 LURE: Fix MT-32 sound volume
Lure of the Temptress defines a volume level for each sound resource. This is a
byte value which can increase or decrease the volume of the sound as specified
in the MIDI data (80h is the neutral value). The original interpreter applies
this as a scaling factor to the Note On velocity for the MT-32. ScummVM used it
to scale the MIDI volume control change values instead, causing incorrect
volume levels.

This change applies the sound resource volume to note velocity instead, which
results in the same volume as the original interpreter. I've left the old
method in place for AdLib, because I'm not sure how the original interpeter
handles sound resource volume in this case.
2020-12-06 16:37:08 +00:00
NMIError 991061ee1b LURE: Fix music/SFX distinction
Distinction between music and SFX was made based on the most significant bit in
the sound number byte. This does not accurately reflect which MIDI sequences
are music or a sound effect.

Instead, I've added a flag which can be passed to
SoundManager::musicInterface_Play to indicate whether the sound is music or a
sound effect. All music is started from hard-coded animation sequences, so this
flag can be passed from ScummVM code when appropriate.
2020-12-06 16:37:08 +00:00
NMIError a994870fb3 LURE: Disable All Notes Off from parser
Lure uses multiple MIDI parsers simultaneously, so having a parser send All
Notes Off events on all channels does not work.
2020-12-06 16:37:08 +00:00
NMIError 945c6c1643 LURE: Remove default MIDI volume
Some music tracks (f.e. the 2nd introduction track) do not properly set the
volume on all channels and rely on the volume set by the previous track.
ScummVM would reset the volume on all channels between tracks, which caused
wrong volumes on some channels. I've removed this.
2020-12-06 16:37:08 +00:00
NMIError 3dd3776cfd LURE: Fix wrong MT-32 MIDI channels for music
The MIDI player remaps the channels in the MIDI data to the available channels
on the MIDI device. In case of MT-32 music, this does not work, because the
percussion channel gets remapped to an instrument channel. The original
interpreter does not remap the channels of the music at all.

I've turned off channel remapping for all MT-32 MIDI data marked as music.
2020-12-06 16:37:08 +00:00
NMIError 3d550b8535 LURE: Added MT-32 SysEx loading 2020-12-06 16:37:08 +00:00
Cameron Cawley cf068bcc08 ALL: Remove direct use of OSystem::createMutex() 2020-08-21 09:39:00 +02:00
Adrian Frühwirth 49116b4ae7 ALL: Use CLIP to clip volumes 2018-05-05 17:57:31 +02:00
Torbjörn Andersson 70a2ca8b7d JANITORIAL: Silence more GCC 7 warnings
All these fall through were marked as deliberate, so again I've only
changed the comment to silence GCC.
2017-08-06 13:30:51 +02:00
Eugene Sandulenko 940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00
Johannes Schickel b03ca0e80a LURE: Make GPL headers consistent in themselves. 2014-02-18 02:39:36 +01:00
Christoph Mallon e40ba4c135 JANITORIAL: Simply use *x instead of *x.get() on smart pointers. 2012-03-13 15:43:59 +01:00
Tarek Soliman a4798602d7 JANITORIAL: Fix missing whitespace in pointer cast
find -name '*.h' -or -name '*.cpp' | xargs sed -r -i 's@\(([A-Za-z0-9]+)\*\)@(\1 *)@g'

This seems to have caught some params as well which is not undesirable IMO.
It also caught some strings containing this which is undesirable so I
excluded them manually. (engines/sci/engine/kernel_tables.h)
2012-02-15 10:07:10 -06:00
Johannes Schickel 61795739f8 COMMON: Rename Common::set_to to Common::fill.
This makes the name match with the name of the STL function with the same
behavior.
2011-11-16 18:06:30 +01:00
Ori Avtalion aa0f307e06 ALL: Require DECLARE_SINGLETON to be used in the Common namepsace
Silences the clang warning:

  static data member specialization of '_singleton' must
  originally be declared in namespace 'Common'; accepted as a C++0x
  extension [-Wc++0x-extensions]

Wrapping "namespace Common {}" around the macro assignment causes clang
to complain about a spurious semicolon, and removing the semicolon at
the end of the macro causes some editors to misbehave.

Changing the requirement of using the macro in one namespace (the
global) to another (Common) seems a small price to pay to
silence a warning.
2011-06-30 22:41:41 +03:00
strangerke 69b1485a22 GIT: Clean up: Suppress SVN tags, now useless 2011-05-12 01:16:22 +02:00
Max Horn 088bd7a70b ENGINES: Remove unused MIDI pass-through code 2011-03-23 17:07:48 +01:00
Max Horn e70fd59b35 ENGINES: Further simplify pseudo MidiDrivers; fix some regressions
The regression affected AGOS and maybe some others; specifically,
the real MidiDriver would have been deleted twice -- I previously
missed that the Engine instances takes care of freeing the real
MidiDriver, not the MidiPlayer wrapping it.

This commit should clarify the ownership of the real MidiDriver for
most pseudo MidiDrivers.
2011-03-23 16:49:41 +01:00
Max Horn 29847ea42d AUDIO: Change several fake MidiDrivers to MidiDriver_BASE subclasses
Many engines follow the advice in audio/midiparser.h and create a
"pseudo-MidiDriver" subclass. But MidiParser really only needs a tiny
subset of the MidiDriver capabilities, namely those found in
MidiDriver_BASE. So we try to subclass from that whenever possible; this
allows us to remove many stub methods, and enables further future
simplifications.
2011-03-23 15:25:47 +01:00
Max Horn 8982fff1b7 AUDIO: Add pure virtual MidiDriver::isOpen() method
This in turn enables modifying MidiDriver_MPU401::close() to allow
it to be called on a midi driver that has not yet been opened.

The specific issue that triggered me to make these changes was a
crash-upon-quit in HUGO, caused by it instantiating a midi driver,
then encountering an error (missing hugo.dat) *before* having
opened the new midi driver; the general cleanup code then tries
to close the (not yet opened) midi driver -> kaboom

Also fixed some engines which were leaking MidiDriver instances.
2011-03-22 23:51:47 +01:00
Max Horn 42ab839dd6 AUDIO: Rename sound/ dir to audio/
svn-id: r55850
2011-02-09 01:09:01 +00:00
Max Horn abe1959d36 COMMON: Simplify DECLARE_SINGLETON macro
This makes it possible to write
  DECLARE_SINGLETON(foo);
instead of
  DECLARE_SINGLETON(foo)
without causing a warning about an extra semicolon.
The extra semicolon helps some editors at parsing the C++ code.

svn-id: r54258
2010-11-16 08:23:13 +00:00
Johannes Schickel 6588398ce6 MIDI: Send a reset MIDI device signal on startup.
This is currently done in the engine code. I adapted AGI, AGOS, DRACI,
GROOVIE, LURE, MADE, QUEEN, SAGA, SKY, TINSEL and TOUCHE to send a reset
device on startup. The sound output still works fine (started up a game
from every engine), so this should hopefully not introduce any regressions.

As far as I can tell it seems that SCUMM does send a proper device reset, so
I did not touch it. KYRA only sends a proper reset for MT-32 currently. I am
not sure about SCI though.

This fixes bug #3066826 "SIMON: MIDI notes off when using RTL after SCI".

svn-id: r52736
2010-09-15 22:00:20 +00:00
Johannes Schickel e3d1ec482c LURE: Make LURE respect the mute settings.
svn-id: r51101
2010-07-21 20:12:35 +00:00
Florian Kagerer c35e350531 AUDIO: get rid of MDT_PREFER_MIDI since it should be sufficient to either select MDT_PREFER_MT32 or MDT_PREFER_GM
svn-id: r50288
2010-06-25 20:51:57 +00:00
Max Horn bbad3f333a Patch #1956501: "GUI/LAUNCHER: Midi device selection"
svn-id: r50128
2010-06-21 21:36:36 +00:00
Johannes Schickel 40562798d6 Fix our DECLARE_SINGLETON macro to conform to the C++ specs.
We need to use a namespace Common { } there to make strict C++ compilers
like clang++ and comeau happy. I also added a slight comment about why
that is needed to the macro definition and a note that you need to use
it from the global namespace.

svn-id: r48254
2010-03-13 21:55:49 +00:00
Johannes Schickel bfcdbae648 Change some comments to use "AdLib" instead of "adlib".
svn-id: r47534
2010-01-25 00:39:46 +00:00
Arnaud Boutonné 1f79fd5788 Some more header modifications ("Graphic Adventure Engine" and the legal property paragraph)
svn-id: r47489
2010-01-23 22:50:24 +00:00