Commit graph

48 commits

Author SHA1 Message Date
Coen Rampen
ed650e1cf0 AUDIO: Fix OPL channel allocation for rhythm mode 2025-02-22 23:13:54 +01:00
Coen Rampen
a28952f1b0 AGOS: Fix bad rhythm instruments in Simon 1 DOS 2025-02-22 16:57:47 +01:00
Le Philousophe
c7e3415511 AUDIO: Avoid duplicating pointers by making use of const_cast
const_cast is valid in these cases because the pointed data is
dynamically allocated.
2025-01-28 23:24:40 +02:00
Cameron Cawley
7187c9293f AUDIO: Mark more AdLib symbols as const 2025-01-28 23:24:40 +02:00
Le Philousophe
d614b5d31c AGOS: Migrate engine to Path 2023-12-24 13:19:25 +01:00
Donovan Watteau
18ab6803d6 JANITORIAL: Fix various "an" typos in comments 2023-03-16 14:47:28 +01:00
athrxx
d5331c3c2c AGOS: fix some warnings
(only the obvious ones, where nothing can be broken by the fix)
2022-09-02 15:36:48 +02:00
Coen Rampen
b12feb2ae9 AGOS: Add Simon 1 invalid AdLib errors
This adds error messages in case the Simon 1 AdLib instrument bank file is
missing or invalid.
2022-06-05 14:31:48 +02:00
Coen Rampen
8536fd9794 AGOS: Fix AdLib instrument remapping check
_instrumentRemapping is always set in readDriverData, so this check is unnecessary.
2022-06-02 20:06:04 +02:00
Coen Rampen
38eff6c7c3 AGOS: Add OPL3 mode for Elvira 1
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.
2022-05-16 12:18:11 +02:00
Coen Rampen
07a6b54f54 AGOS: Add CMS support for Elvira 1
This adds support for the Creative Music System / Gameblaster to Elvira 1.
2022-05-16 12:18:11 +02:00
Coen Rampen
6ec2329fc9 AGOS: Fix compiler warnings
Add missing override, fix bad memset, remove unused variable.
2022-05-09 20:21:00 +02:00
Coen Rampen
3dd5568cab AGOS: Improve E2/WW AdLib SFX timing
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.
2022-05-09 17:19:45 +02:00
Coen Rampen
5e95bdcbda AGOS: Elvira 1 - add support for Casio devices
This adds support for the Casio MT-540, CT-460 and CSM-1 for Elvira 1.
2022-05-09 17:19:44 +02:00
Coen Rampen
5e1905f5f6 AGOS: Waxworks OPL3 mode instrument attack fix
This fixes the slow attack for several instruments, which causes some barely
audible notes in OPL3 mode.
2022-05-09 17:19:44 +02:00
Coen Rampen
66bb075f1c AGOS: Add E2/WW AdLib and MT-32 SFX and enhancements
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.
2022-05-09 17:19:44 +02:00
Coen Rampen
a0ffa1e005 AGOS: Fix PC-98 MIDI driver not using Native MT-32
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.
2022-05-09 17:19:43 +02:00
Coen Rampen
d37681a729 AGOS: Update Simon 1 AdLib drivers
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.
2022-05-09 17:19:42 +02:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh
8c81b5026a AGOS: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
Orgad Shaneh
ee57380de7 ENGINES: JANITORIAL: Remove 'virtual' when override is specified 2021-11-14 14:32:04 +02:00
Orgad Shaneh
3919f53326 ENGINES: Replace new[]/memset with new[]() 2021-11-10 19:53:15 +01:00
Torbjörn Andersson
09433c1c1d AGOS: Use the music volume setting for Accolade AdLib driver
At this point, the driver still tries to play notes at the maximum
allowed volume or louder, but ScummVM's music volume setting can bring
them back down to the expected range. That may have to be good enough
for now.

Also, since the master volume is only used internally there's no need to
keep converting back and forth. Just use the interval 0-255 throughout.
2021-11-02 07:08:13 +01:00
Torbjörn Andersson
f25e74b697 AGOS: Further work on Waxworks AdLib volume
After feedback from NMIError, and some more guesswork. The master volume
isn't applied until noteOnSetVolume(), so that the correct adjusted
volume can be stored in the channel data structure.

Now the volume seems too low to me, but of course that could be fixed by
having some other default value than 15 for _masterVolume.
2021-11-02 07:08:13 +01:00
Torbjörn Andersson
f59e060763 AGOS: Fix Waxworks AdLib music (bug #13048)
Because only the unused channelVolueAdjust value was clipped, the actual
velocity of the note would often overflow, causing the note to be almost
muted instead of played at full volume.

I assume it was an oversight that chanelVolumeAdjust wasn't used, so
I've fixed that and moved the clipping to after all adjustments have
been made. Also eliminated some unneeded floating-point math.

Is it correct now? I honestly don't know. It seems that, at least in
Waxworks, almost all notes end up being played at max volume. But maybe
that's how it should be?
2021-11-02 07:08:13 +01:00
athrxx
4a6dbc73db AGOS: attempt to fix bug no. 12617 ("AGOS: Deadlock when shutting down game")
I have also made the necessary changes to the PC-98 audio drivers which were written to work around the current situation, but now also need a different order in the destructors.
2021-06-11 17:49:33 +02:00
Eugene Sandulenko
5e7fe2dc57
JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
athrxx
4c0ff2b023 AGOS: (ELVIRA/PC98/Jp) - add paranoia checks to sound driver 2021-01-22 02:16:49 +01:00
athrxx
a3fd19265f AGOS: (ELVIRA/PC98/Jp) - add sound driver
Added support for PC9801-26, Roland MT-32 and General Midi. I have left out the PC speaker part for now.
2021-01-22 00:47:59 +01:00
athrxx
bb8c70f865 AGOS: (ELVIRA/PC98/Jp) - fix startup
Add necessary file name and file format modifications so that the game at least loads up and runs up to the start scene without glitches.
2021-01-22 00:47:58 +01:00
Bastien Bouclet
1624da8c99 AGOS: Add override keywords 2020-02-09 12:43:14 +01:00
D G Turner
3a0ed17e66 AGOS: Fix Accolade MIDI Driver Compilation Breakage
These were broken by the last PR merge which included a cpp file in a
way which will not build reliably. This splits the Accolade MIDI driver
structure definitions into headers allowing these to be included
instead.

Also, minor cleanup by removal of unused header includes.
2019-06-03 19:35:48 +01:00
Fedor Antokhin
b1bd75a083 AGOS: Mute fix for ADLIB Accolade 2019-06-03 17:06:00 +01:00
Ori Avtalion
5e49800901 AGOS: Reduce audio header dependencies 2016-04-14 16:48:02 +03:00
Johannes Schickel
cf42dc0a35 AGOS: Slight cleanup in Simon1 AdLib output initialization code. 2015-07-23 22:33:56 +02:00
Johannes Schickel
979a885ef9 AGOS: Add initial version of Simon1 DOS AdLib output.
Testing so far has not really happened. Only the first part of the intro has
been tested.
2015-07-23 22:33:56 +02:00
Max Horn
856475067a MISC: Remove some unused private member variables 2015-07-19 17:13:18 +02:00
Matthew Hoops
bed9da8b9d AUDIO: Remove all AudioStream access to OPL 2015-07-07 20:19:47 -04:00
Matthew Hoops
0c5d40e94c AGOS: Use the built-in OPL timer 2015-07-07 20:19:45 -04:00
Matthew Hoops
2e8f9dcec9 AUDIO: Remove the sample rate configuration from the OPL code 2015-07-07 20:19:42 -04:00
Martin Kiewitz
a4d3ad396c AGOS: Accolade music driver: fix memory leak
in factory
2015-07-03 00:57:25 +02:00
Martin Kiewitz
bfa7d89500 AGOS: Accolade music: read driver data in factory
moved driver reading code into factory of both Accolade music drivers
2015-07-03 00:52:36 +02:00
Martin Kiewitz
fe31e6a3f6 AGOS: Accolade AdLib: remove _ from reset-methods
remove "_" from reset-method-names
2015-06-27 19:05:59 +02:00
Martin Kiewitz
5f77bcc74c AGOS: Accolade MT32: General MIDI mapping
- renamed _MT32 to _nativeMT32
this name doesn't really make sense, because MUNT isn't a native
MT32, but the name is common to the other engines
- implement MT32 -> General MIDI mapping in case no MT32 is
available
- implement dialog screen, so that user is told about General MIDI
mapping and that it may sound awful
2015-06-21 10:06:12 +02:00
Martin Kiewitz
3f9c44c743 AGOS: Accolade AdLib/MT32 driver naming cleanup 2015-06-21 03:23:01 +02:00
Martin Kiewitz
01802eec5f AGOS: Accolade adlib driver: remove debug warning 2015-06-21 01:26:16 +02:00
Martin Kiewitz
69436f6c41 AGOS: Elvira 2 seems to use MUSIC.DRV variant
- Kirben told me that Elvira 2 is shipped with MUSIC.DRV and
INSTR.DAT file. Using MUSIC.DRV file makes the music work properly
I couldn't check, b/c I own none of these games.

- also commented out implemented bug of INSTR.DAT/MUSIC.DRV
This bug only affected the adlib drivers, so I guess we should
rather fix it instead of implementing the same buggy behavior
2015-06-21 01:20:21 +02:00
Martin Kiewitz
d24c68c739 AGOS: implement Accolade AdLib + MT32 music drivers
- both known variants are supported (INSTR.DAT + MUSIC.DRV)
- INSTR.DAT/MUSIC.DRV holds channel mapping, instrument mapping, etc.
- fixed bug inside S1D MidiParser, that ruined some instrument changes
0xFC header was seen as 2 byte header, but it's 4 bytes in Elvira 2
and 5 bytes in Waxworks / Simon 1 demo
- dynamic channel allocation for the MUSIC.DRV adlib driver is not
implemented atm, simply because at least the demos of Waxworks and
Simon 1 do not use this feature
- sound effects of Waxworks are not implemented atm
- note: the game "Altered Destiny" uses Accolade INSTR.DAT variant too
2015-06-21 00:45:45 +02:00