849 Commits

Author SHA1 Message Date
D G Turner
9af3ef5e88 AUDIO: MT32: Fix Undefined Macro Compiler Warnings
These were emitted by GCC when -Wundef was passed.
2022-03-21 21:37:04 +00:00
D G Turner
a1de9a95c6 AUDIO: MT32: Fix Internal Sample Rate Converter Code
This was previously disabled implicitly by the missing define
symbols in the SampleRateConvertor module. This has now been enabled
to use the internal rate convertor code.

This was generating undefined macro warnings from GCC when -Wundef
was passed.
2022-03-20 22:54:04 +00:00
NMIError
221fa4c841
AUDIO: Add support for RetroWave OPL3
This commit adds support for the SudoMaker RetroWave OPL3 sound card. Requires
the retrowave library.

Add the following settings to scummvm.ini:
retrowaveopl3_bus=serial
retrowaveopl3_port=<port> f.e. COM3 or ttyACM0
2022-01-29 17:33:29 +01:00
Paweł Kołodziejski
20cb0ae228
ALL: Cleanup ResidualVM -> ScummVM 2021-12-26 21:19:38 +01:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis
9473b382b5 AUDIO: Remove unused variable
Thanks to eientei for reporting this
2021-12-24 03:25:22 +02:00
Quietust
3f4d59800d AUDIO: Add Paula per-channel DMA interrupts
These will be needed for proper emulation of the Amiga SCUMM V2/V3
sound engines.
2021-12-13 20:53:21 +01:00
D G Turner
1dd7e98be3 AUDIO: Fix GCC Warning by Removing Redundant Assertion from Mixer
The output buffer size variable is unsigned so an assertion of
greater than or equal to zero will always be true, which generates
a type limits compiler warning.
2021-12-11 20:50:05 +00:00
Andrea Boscarino
f37489dd80 AUDIO/BACKENDS: Store output audio buffer size in Mixer 2021-12-09 22:03:40 +01:00
Paweł Kołodziejski
2bc3d7f4ed
AUDIO: Fixed compiler warning, this is always true 2021-12-05 16:17:20 +01:00
Coen Rampen
b70ab20fc8 AUDIO: MIDI controller defaults on track start
This commit adds a feature to the multisource MIDI drivers which allows setting
a default value for most controllers. This default is then applied at the start
of every new track, which ensures controllers are in the correct state.
This can be used for games which use some controller, but do not reset it at
the start of each track, which can lead to incorrect playback.
2021-11-17 21:54:59 +01:00
Orgad Shaneh
2bd0347968 AUDIO: Use override
Using clang-tidy modernize-use-override
2021-11-14 20:14:11 +02:00
Orgad Shaneh
af529f568b AUDIO: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 13:41:02 +02:00
Orgad Shaneh
7a4e5612de JANITORIAL: Replace new[]/memset with new[]()
Mostly done using the following Ruby script:

(Dir.glob('**/*.cpp') + Dir.glob('**/*.h')).each do |file|
  s = File.read(file, encoding: 'iso8859-1')
  t = s.gsub(/(([\w_.\[\]]+)\s*=\s*new\s+\S+?\[[^\]]+?\](?!\())([^\{\}]*?)\n\s+memset\(\s*\2\s*,\s*0\s*,[^;]*;/m, '\1()\3')
  if t != s
    File.open(file, 'w') { |io| io.write(t) }
  end
end
2021-11-10 19:53:15 +01:00
Coen Rampen
e4887696a9 AUDIO: Fix ineffective version prop on Miles AdLib
Setting the Miles driver version property to 3 was meant to set the pitch bend
range to 2. In the AdLib driver, the pitch bend range was set during
construction, before the version property could be set, so this did not work
properly. This is fixed by moving the MIDI data initialization from the
constructor to the open function.
2021-11-04 22:15:38 +01: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
D G Turner
46ca3865f0 AUDIO: (FM-TOWNS): Update Comment on Dead Code 2021-10-31 18:51:10 +00:00
Coen Rampen
952de88758 SCUMM: Fix Sam & Max OPL3 pitch bend
The pitch bend in Sam & Max was exaggerated when using the OPL3 driver. The
OPL3 functionality was apparently implemented by examining just the original
driver code and not the MIDI processing code in the interpreter. The pitch bend
values sent to the driver are not standard MIDI pitch bend values, but have
been processed by the interpreter, so the driver logic cannot be directly
applied to the pitch bend values from the MIDI data.

This commit fixes the pitch bend calculations to produce the same results as
the original interpreter. It also restores the pitch bend range functionality.
This was disabled for OPL3, probably because it is implemented in the
interpreter instead of the driver. It is used in several Sam & Max MIDI tracks.
2021-10-30 21:34:27 +02:00
D G Turner
6a3310eb6f AUDIO: (FM-TOWNS): Fix Duplicated Branch GCC Warning 2021-10-29 18:02:59 +01:00
Torbjörn Andersson
338b3c6dee AUDIO: Fix check for OPL3 capable emulation
Both DOSBox and Nuked OPL should handle OPL3. Only the old MAME one
doesn't.
2021-10-20 13:34:31 +02:00
Coen Rampen
d8491ecea4 AUDIO: Add default for OPL channel volume
This adds an option to the AdLib multisource driver to set the MIDI channel
volume that will be used to initialize to OPL 4x registers.
2021-10-09 16:59:44 +02:00
Coen Rampen
111b237e02 AUDIO: Fix Roland GS emulation not using MT-32 drumkit
The Roland GS MT-32 emulation option would not select the MT-32 drumkit on the
GS device, because the drumkit change was filtered out in the MT32GM driver.
This commit fixes this by adding an exception for this drumkit change when GS
MT-32 emulation is active.
2021-10-09 16:59:44 +02:00
Coen Rampen
2661548758 AUDIO: Fix stray ; and some warnings 2021-09-27 23:40:54 +02:00
Coen Rampen
5362b1b302 AUDIO: Add command queue to PC speaker emulator
This adds a command queue to the PC speaker emulator for PWM-style sounds that
need timing of less than a millisecond. The play method only supports
milliseconds and requires real time control, which is difficult to achieve with
microsecond timings.
The new playQueue method allows you to queue up playback instructions with
microsecond timing, which are executed when audio samples need to be generated.
2021-09-27 21:45:40 +02:00
Cameron Cawley
c2bbccd1db AUDIO: Support using .wav files for extracted Audio CD tracks 2021-09-07 14:35:43 +03:00
Eugene Sandulenko
198975a007
AUDIO: Fix message format 2021-08-23 16:26:31 +02:00
Coen Rampen
c0388b833c AUDIO/MIDI: Fix OPL empty instrument check
The empty OPL instrument check would check only the ADSR envelope fields for 0,
assuming this would mean the instrument would produce no sound. However, some
of these fields are flipped, i.e. max value would produce no sound. So this
shortcut was invalid. It is replaced by checking all fields for 0.
2021-08-14 21:48:10 +02:00
Coen Rampen
1b6b124c57 AUDIO/MIDI: Clear timer registers in OPL driver init 2021-08-14 21:48:10 +02:00
djsrv
22775dff7e AUDIO: Create Mixer::loopChannel() 2021-08-12 13:18:27 -04:00
Coen Rampen
dfb8db2ae2 AUDIO/MIDI: Add dual OPL2 support to Miles AdLib driver
This adds support for the dual OPL2 chip configuration to the Miles AdLib MIDI
driver.
2021-08-12 14:30:52 +02:00
Coen Rampen
0245ae15b0 AUDIO/MIDI: Add reset source volume to multisource drivers
This adds a convenience function to reset the source volume to the source
neutral volume.
2021-08-08 22:12:06 +02:00
Coen Rampen
7fb83e71b5 AUDIO/MIDI: Add timer proc to null multisource driver
This adds a timer proc to the null multisource MIDI driver to drive the fading
process. The null driver does not have any audio to fade, but without this the
fades will just hang and isFading will remain true. The fades are now
effectively timers so game behavior will remain consistent whether MIDI is
turned on or off.
2021-08-08 22:12:06 +02:00
Coen Rampen
994609e91c AUDIO/MIDI: Make Miles pitch bend range v3 specific
Miles version 3 introduced support for the MIDI pitch bend range RPN using the
data entry MSB controller. The ScummVM implementation would also process this
controller for Miles version 2 games. This caused a problem in Ultima 8, which
used Miles 2 and which had MIDI data that contained some (probably leftover)
data entry MSB events. These had no effect in the original interpreter, but in
ScummVM they caused the pitch bend range to change, resulting in incorrect
playback.

This is fixed by only processing the data entry MSB controller events when
Miles version is set to 3.
2021-08-08 22:12:06 +02:00
Max Horn
1d7d03bd6e AUDIO: fix global constructor warnings 2021-08-07 10:46:14 +02:00
Coen Rampen
d65edaa6b3 AUDIO/MIDI: Fix Miles default source volume
The default source neutral volume for the Miles MIDI driver is set at 256.
However, the default source volume was the same as that of the regular MT-32/GM
driver: 255. This would cause a small volume decrease if a game did not set
source volume.

This commit fixes this issue by setting the default source volume for the Miles
MIDI driver at 256.
2021-08-06 21:01:09 +02:00
Coen Rampen
54663b953a AUDIO/MIDI: Fix Miles AdLib initialization
The ScummVM Miles AdLib driver would write some different initialization values
to the OPL registers than the original Miles drivers did. The most significant
difference was the amplitude and vibrato depth.

This commit changes the Miles AdLib driver to set the same values as the
original drivers. It also adds support for initializing a dual OPL2
configuration.
2021-08-06 21:01:09 +02:00
Coen Rampen
d73b19b9b3 AUDIO/MIDI: Fix Miles 3 AdLib pitch bend range
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.
2021-08-06 21:01:08 +02:00
Max Horn
34523aba7e JANITORIAL: Fix some typos 2021-08-04 15:43:15 +02:00
Coen Rampen
2edc3773bc AUDIO/MIDI: Fix Miles AdLib fades
This fixes some issues which caused the fades in the Miles AdLib driver to not
work properly:
- _timerRate was not set
- end of track meta event was not handled, so active fades were not aborted by
deinitializing the source on end of track
The timerProc fields and onTimer function were removed because they duplicate
functionality from the MidiDriver_Multisource base class.
2021-07-29 20:24:42 +02:00
Coen Rampen
aae00f50b1 AUDIO/MIDI: Added support for Miles v3 initialization
This adds a MidiDriver property which controls the Miles AIL/MSS version to
emulate. This controls the initialization of MT-32 and GM devices. MSS v3 added
GM support, which caused some differences between v2 and v3 in how MIDI devices
are initialized. Some games might rely on certain default settings for correct
playback.
2021-07-29 20:24:42 +02:00
Coen Rampen
e63b556015 SAGA: Add ITE MT-32 display message
This adds the message that the DOS version of Inherit The Earth displays on the
MT-32 when quitting the game.
2021-07-29 20:24:42 +02:00
Coen Rampen
55fadd03a1 AUDIO/MIDI: Change Miles AdLib creation type to multisource
This changes the return type of the Miles AdLib MIDI driver factory function to
the recently introduced superclass MidiDriver_Multisource, which allows for
easier use of multisource functionality for consumers of the factory function.
2021-07-13 22:11:58 +02:00
Coen Rampen
780d8d187a AUDIO/MIDI: Fix volume changes not applied by Miles driver
This adds applying source volume for all sources to the Miles MIDI driver. This
was missing and caused changes to user volume not to be applied for some games.
2021-07-10 20:33:35 +02:00
Cameron Cawley
674094016a AUDIO: Fix missing include 2021-07-09 17:09:32 +01:00
Coen Rampen
5c287139b3 AUDIO/MIDI: Add partial multisource support to Miles AdLib driver
Adds an implementation of the multisource interface to the Miles AdLib driver.
This partial implementation only supports the volume management functions and
the use of a single source (0), which is sufficient for most games (that only
use MIDI for background music). Full multisource support will be added later.
2021-07-09 15:20:50 +02:00
Coen Rampen
3c16991c05 AUDIO/MIDI: Add multisource support to QuickTime MIDI parser
Adds support for passing a source number to the MIDI driver to the QuickTime
MIDI parser.
2021-07-09 15:20:50 +02:00
Coen Rampen
9f96a86fec AUDIO/MIDI: Add multisource NULL MIDI driver
Adds a noop MIDI driver implementing the multisource interface.
2021-07-09 15:20:50 +02:00
D G Turner
99a1a90e76 AUDIO: Fix for GCC Warnings from 64-bit Stream API Changes 2021-07-09 04:23:10 +01:00
Paul Gilbert
005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
athrxx
8e0092c5d2 AUDIO: (Amiga) - adapt mutex handling to latest mixer code changes 2021-07-04 18:05:00 +02:00