Commit Graph
86 Commits
Author SHA1 Message Date
Donovan Watteau 16e2068aec JANITORIAL: Fix various single-character typos 2022-11-11 20:55:56 +01:00
Donovan Watteau 0e81058cc7 SCUMM: Don't print unprintable chars in warnings and errors 2022-10-16 22:27:58 +03:00
athrxx cc6f904269 SCUMM: (IMS) - code style fixes 2022-10-10 22:44:08 +02:00
athrxx 40b459164b SCUMM: (IMS) - add dedicated MT-32 sound driver
(fixes bug no. 1248 - "SAM: some MIDI channels missing on MT-32")

This is a very obvious bug if the speech is turned off (otherwise the speech will
kind of cover it up). In the SAMNMAX intro it is hardly playing anything.

The reason is that the newer sound system has an extra driver layer between the
imuse parts and the actual hardware which mananges the channels (similar to
what we already do for AdLib, Amiga, FM-Towns...). Whenever the songs are
attempting to use a Midi part > 9 our current system will fail.

I have written the MT-32 player to also handle the older games music and sound
effects. This will allow cleaning up various more hacks in the common sound code.
I have done only little cleanup here, since it is not the main purpose of the commit.

I will also write a GM driver. This is going to be easier. Currently, there is a only
some init and skeleton code for it, the rest is just pass-through...
2022-10-06 18:47:46 +02:00
athrxx 99dd6cb248 SCUMM: (IMS) - minor restructuring and cleanup
Currently, Roland MT-32 sound is broken for
SAMNMAX. Just try the intro song with shut off
speech. It is very obvious that it plays with a quite
reduced number of channels compared to the
original interpreter.

Now, due to the not-so-helpful code design (much
of the iMuse code has been drawn into the common
code) it has become increasingly difficult to fix Midi
related thing in iMuse. I have added more and more
crude hacks over time.

SAMNMAX requires more elaborate channel
allocation. To make it happen I have added driver
wrappers for Midi to the iMuse code.

Other than that, I have done only minor cleanup here.

Actually, I would have liked to withdraw much more
of the iMuse code from the common code and move
it to SCUMM (basically all the MidiChannel
stuff which is exclusively used by iMuse. But it turns
out that it is so thoroughly intertwined (the major
blocker here being the AdLib driver) that it requires
more thought and effort and would just distract me
from fixing the SAMNMAX sound.
2022-10-06 18:47:40 +02:00
athrxx 78ec6a9c23 SCUMM: (IMS) - get rid of instrument static var
I noticed broken sound when starting DOTT with MT-32
setting, then returning to the launcher and then starting in
GM mode.
Turns out that there was a nasty static var in instrument.cpp
that was not always reset to the correct value.
Instead of just doing that I cleaned it up a bit and got rid of
the static var.
2022-09-15 20:56:46 +02:00
athrxx e052fee77f SCUMM: (IMS) - cleanup sound init process
Reduce abuse of the property function to set init vars.
Better distinction between drivers to prevent a GM init on
the Mac driver (which could happen depending on the
launcher sound setting).
2022-09-13 22:13:53 +02:00
athrxx 1b4d3ea3ed SCUMM: (IMS) - cleanup
(also fix Amiga regression)
2022-09-08 22:42:04 +02:00
athrxx 0b8d7cf0f4 SCUMM: (IMS) - fix transpose clipping boundaries
These are a bit different between DOTT and the earlier
games.
2022-09-08 20:49:42 +02:00
athrxx 3ac55f9246 SCUMM: (IMS) - add some checks during init
Make sure GM init is only done with an actual GM setup.
These are mostly the same checks we already do in the
engine, but it still seems better to do this
2022-09-07 23:07:58 +02:00
athrxx 162e1bb764 SCUMM: (DOTT) - fix AdLib transpose/detune
Continued bug fixing for ticket no. 13460 ("Incorrect MIDI
pitch bending"). This time the AdLib part (which applies
to FM-Towns, too, since it is more or less the same driver).
This fixes the sound when the bird is dropping from the
sky in the DOTT intro.

Also separate the GM code for SAMNMAX a bit after
checking the original code.
2022-09-06 22:01:21 +02:00
athrxx 3ef9ec5560 SCUMM: (DOTT) - fix bug no. 13460 (Incorrect MIDI pitch bending)
(General Midi Part only)

The bug report says that the AdLib part is broken, too. I am not sure about that device. For GM it was very obvious, though...
2022-09-04 13:32:38 +02:00
Donovan Watteau 4ec06a2bf6 SCUMM: Unify WORKAROUND usage and complete/tweak some of them 2022-08-07 17:24:27 +02:00
athrxx c8edabf34b SCUMM: (iMuse) - instead of its own mutex, use the one from the mixer
(avoid deadlocks in MI2/INDY4 FM-Towns and other possible targets with heavy mutex usage)
2022-07-10 21:53:54 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh ed5489929c SCUMM: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
sluicebox 674ed112aa JANITORIAL: Update more old bug tracker numbers
I missed the six digit ones and a few others in:
93eeffc84d
2021-06-09 14:28:52 -06:00
sluicebox 93eeffc84d JANITORIAL: Update old bug tracker numbers 2021-03-03 02:15:05 +02:00
athrxx 4a7b720a31 SCUMM: whitespace 2020-10-24 17:58:29 +02:00
D G Turner 59b639ed4d SCUMM: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-23 11:56:16 +00:00
D G Turner 84d0a294af SCUMM: Replace Various String Functions with Common String Usage
This removes the dependency on the unsafe strcpy and strcat string
functions with usage of Common::String instead.
2019-09-15 20:20:03 +01:00
athrxx aecf194880 SCUMM: (iMUSE/Amiga) - minor fixes
- At at least one place in INDY4 the game attempts to send a Roland MT-32 patch to the Amiga driver. This will fail and thus not cause any harm, but I have added a check nonetheless. The original Amiga driver ignores sysex messages that don't have the iMuse manufacturer id 7D.
- In INDY4 the iMuse player thinks it has a percussion channel due to the fact that it plays ROL resources. This should also be irrelevant for the actual playback, but I have added a check for that, too.
2019-07-22 20:17:38 +02:00
athrxx 4c45f9f39f SCUMM: (iMUSE/Amiga) - fix INDY4 instruments handling
FOA Amiga uses 'ROL ' resources (unlike MI2 which has 'AMI ' resources). So our imuse player treated those as MT32 tracks playing on a non-MT32 device and applied GM mapping. Which of course messed up the instruments.
2019-07-17 17:26:52 +02:00
athrxx d1b64aab0c SCUMM: (iMuse/Amiga) - improve accuracy
This fixes the issue that some rhythm instruments didn't receive correct notes. The changes have been limited to the Amiga versions.
2019-07-14 21:45:29 +02:00
athrxx 0899ecc987 SCUMM: hook up Amiga MI2 + INDY4 to new sound driver 2019-07-14 20:56:27 +02:00
athrxx 9afdde2601 SCUMM: add Amiga iMuse sound driver
(applies to MI2 and INDY4)
2019-07-14 20:56:27 +02:00
Adrian Frühwirth 7ebbb12dfb SCUMM: Remove superfluous 'else' in IMuseInternal::ImSetTrigger()
Both means to calculate `diff` are essentially equal because
wraparound of unsigned integers is well-defined and does what
the 'else' branch is simulating manually. Because of this,
gcc complains when compiling with -Wduplicated-branches.
2018-05-07 22:21:42 +02:00
Colin Snover 08186aeec6 SCUMM: Rename iMUSE save/load function to avoid confusing function hiding 2018-01-31 21:24:09 -06:00
Colin Snover 2e061d95c5 COMMON: Move VER macro for serializer into common code 2018-01-31 17:58:01 +01:00
Colin Snover 9916b26383 SCUMM: Replace UB-triggering serialization code with Common::Serializer
Fixes Trac#10342.
2018-01-31 17:58:01 +01:00
Ben Castricum d58f594755 SCUMM: MI2 kill tune 113 on start of next, Fixes bug #1410 / Booty Island
Fix the "MI2: Two soundtracks playing at once" bug from the bug tracker.
It's triggered when the player enters the kiosk for the second time and
leaves before tune 113 is started.
2017-07-30 22:10:54 +02:00
Ben Castricum 392d8b44ff SCUMM: MI2 kill tune 107 on start of next, Fixes bug #1410 / Scabb Island
Fix the "MI2: Two soundtracks playing at once" bug from the forum.  It's
triggered when the player is moving faster then the scripts expect causing
the "stop tune 117" command be executed before the start of the tune.
Effectily creating a hanging tune 107.
This patch kills the tune when this sitation is detected.
2017-07-30 22:10:54 +02:00
Johannes Schickel 3847465163 SCUMM: Make GPL headers consistent in themselves. 2014-02-18 02:39:38 +01:00
Sven Hesse 989ea7cb56 JANITORIAL: Remove trailing whitespace 2013-07-14 19:01:47 +02:00
Torbjörn Andersson 29bc36d070 SCUMM: Fix initGM() buffer overflow (CID 1032513)
We're clearly using 12 bytes, not 11.
2013-07-06 14:03:31 +02:00
tcarey dc6b39d058 SCUMM: Clean-up of Roland GS code
1. Remove _sc55 bool. All Roland GS-capable devices have MT-32 sound/drum maps, so they should always be used when _enable_gs is set.
2. Always enable _native_mt32 if Roland GS mode is selected. I don't know why I never did this originally, since _enable_gs is automatically disabled for SCUMM v6+ games that use General MIDI tracks instead of MT-32 music.
3. Set master tune for GS devices to 442.0kHz. This is the master tune setting for the MT-32.
2013-05-11 19:18:11 +03:00
Willem Jan Palenstijn 2d1fd3b554 ALL: Fix typo (existant->existent) 2013-02-23 22:07:32 +01:00
Torbjörn Andersson f0c1d8dcc4 SCUMM: Add hack to preserve savegame compatibility with Mac MI1
For old savegames, we now use a "dummy" iMUSE objet to skip the old
iMUSE save state. I had hoped to be able to do this without making
any changes to the iMUSE code itself, but I was unable to.

Also added note about how the save state for the new music will not
quite work if the mixer output rate changes. Personally, I'm not
too worried about that. It breaks, but it shouldn't break badly.
2012-11-16 07:49:17 +01:00
Johannes Schickel 58f542d434 SCUMM: Implement support for Monkey Island 2 Mac music.
This is a initial RE of the audio output Monkey Island 2 Mac uses. Support
for special sound effects is not in there yet.
2012-09-20 02:12:41 +02:00
Johannes Schickel 482fcea8f3 SCUMM: Add debug output in case the code tries to set up a non-existant iMuse instrument. 2011-07-14 01:09:47 +02:00
Johannes Schickel f814dc971c SCUMM: Handle default instrument set up in iMuse like the original. 2011-07-14 00:49:32 +02:00
Johannes Schickel 25c0f0a772 SCUMM: Adapt iMuse code formatting to our standards. 2011-07-11 22:53:41 +02:00
Johannes Schickel fb4ed2224f SCUMM: Minor clean up in iMuse instrument handling code. 2011-07-10 05:28:20 +02:00
Johannes Schickel abbd29b16a SCUMM: Limit iMuse default instrument load to PC Speaker output.
Albeit the code is marked as a hack inside the source, the original behaved
exaclty the same. If the code is removed the PC Speaker output will miss notes,
since unlike the original we only output to parts, which have an instrument set
up.
2011-07-10 05:21:25 +02:00
Johannes Schickel ed993e6350 SCUMM: Initial PC Speaker output implementation for SCUMM v5.
This is *not* complete yet.
2011-07-08 04:45:01 +02:00
Max Horn 88913c0139 ALL: Remove trailing whitespaces
This tries to make our code a bit more compliant with our code formatting
conventions. For future use, this is the command I used:
  git ls-files "*.cpp" "*.h" | xargs sed -i -e 's/[ \t]*$//'
2011-06-20 00:59:48 +02:00
athrxx 1ca44c076c SCUMM: fix possible portability issue 2011-06-15 00:10:55 +02:00
athrxx 3d42141e9d SCUMM: implement some missing (very low relevance) imuse code
1) Don't skip transpose setting in sysex command 0. There are only a few sounds where this setting is used (mainly sfx).

2) Make MI2 and INDY4 read certain player start parameters from the sound resource. The start parameters usually  match our default parameters (exception: e.g. LeChuck's Fortress). The use of these parameters has been dropped in DOTT (they use default parameters like we do).
2011-05-29 01:03:55 +02:00
athrxx 5fd257d3cc SCUMM: fix regression 2011-05-16 18:04:40 +02:00
athrxx 6fd78858d7 SCUMM: formatting 2011-05-16 00:41:57 +02:00