Commit Graph
180 Commits
Author SHA1 Message Date
Donovan Watteau 16e2068aec JANITORIAL: Fix various single-character typos 2022-11-11 20:55:56 +01:00
athrxx ff0c339d19 SCUMM: (IMS/MT-32) - fix regression
(assert in SAMNMAX)
2022-10-23 14:36:30 +02:00
athrxx 74609d7fa5 SCUMM: (IMS/MT-32) - minor fixes for playback on real hardware
- avoid sending unnecessary sysex messages
- add a delay after certain sysex messages
(but without calling OSystem::delayMillis(), since
that has negative impact on the playback).
2022-10-22 22:20:41 +02:00
athrxx d54ddce0a1 SCUMM: (IMS/MT32) - reduced delay during device init
The delays were way longer than necessary.
Also removed some unnecessary percussion channel code
that caused issues on real hardware.
2022-10-22 15:36:19 +02:00
Donovan Watteau 0e81058cc7 SCUMM: Don't print unprintable chars in warnings and errors 2022-10-16 22:27:58 +03:00
D G Turner 1ff2bb3ed2 SCUMM: Fix Memset of Non-Trivial Data Structure GCC Compiler Warning 2022-10-11 08:49:09 +01:00
athrxx e67737a749 SCUMM: (IMS) - use short version strings for MT-32 display
The builds distributed over the website have long version strings
(which include the revison number) that don't fit the MT-32 display.
So we just trim them after the version number...
2022-10-10 22:44:13 +02:00
athrxx cc6f904269 SCUMM: (IMS) - code style fixes 2022-10-10 22:44:08 +02:00
Eugene Sandulenko cb406dd95b SCUMM: Comment out unused class variable 2022-10-10 00:22:57 +02:00
Eugene Sandulenko 80e772ad3b SCUMM: Add missing override keyword 2022-10-10 00:22:40 +02:00
Torbjörn Andersson 1fd16c11e2 SCUMM: Fix infinite-ish loop in IMuseDriver_MT32::initDevice()
If infoStr was longer than 20 characters, 20 - infoStr.size() would turn
into a very large positive number, causing the string-padding loop to
run "forever".
2022-10-09 15:25:03 +02:00
D G Turner 8dfe2ccc96 SCUMM: Fix GCC Pedantic Compiler Warning Due To Extra Semicolon 2022-10-08 06:40:23 +01:00
athrxx 0a15c027b2 SCUMM: (Amiga/Mac/PCSpk) - add detune/transpose to sound drivers. 2022-10-08 00:28:21 +02:00
athrxx 8a487f0ff1 SCUMM: (SAMNMAX) - add some missing volume controls
(unsure if used)
2022-10-08 00:28:18 +02:00
athrxx f5c421e52a SCUMM: (IMS) - some cleanup and fixes
Move some Midi related code into the new drivers. I have
kept some handling for Mac and PCSpk for now, since I'll
have to do more research, before I touch them. But eventually
it would be nice to get rid of as much of these sound
type checks/exceptions in the common code as possible.

Also, I finally verified that Samnmax does actually init the
pitchbend factor to 2, but it can be set to 0 by control
change 16. In this case the pitchbend message will alter
the volume instead of the pitch. I don't know if that method
is used anywhere, though.
2022-10-08 00:28:15 +02:00
athrxx 70c2d07f19 SCUMM: (IMS) - minor fixes 2022-10-06 18:47:56 +02:00
athrxx caa96a50f0 SCUMM: (IMS) - refactor MT32/GM drivers
The MT32 driver could be based on the GM driver for the
most parts. Also minor fixes and cleanup.
2022-10-06 18:47:55 +02:00
athrxx ead51cb45e SCUMM: (IMS) - add general midi driver
This is the GM counterpart for the MT32 driver, mostly based on
SAMNMAX, but I have also added the necessary things from the
DOTT driver.
2022-10-06 18:47:51 +02:00
athrxx 6984faf958 AUDIO: add data size arg to MidiChannel::sysEx_customInstrument()
As a safety check...

Also throw out some warnings when loading savegames
with instrument data for a different device (the savegame
incompatibility would be very nice to be fixed, but it is not
trivial.
2022-10-06 18:47:47 +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 0bb59a7a64 SCUMM: init struct members 2022-09-19 18:14:50 +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 f5bfc7b60a SCUMM: (IMS) - improve transpose precision
(I have checked some more drivers. It seems that the AdLib and PC Speaker
drivers of the earlier games have larger boundaries, the MT-32 drivers have
smaller ones)
2022-09-13 22:13:43 +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 ee4fb8749d SCUMM: (IMS) - properly distinguish between PC Speaker and AdLib 2022-09-07 23:07:34 +02:00
athrxx ec03fd5243 SCUMM: (SAMNMAX) - fix GM/AdLib distinction
In SAMNMAX the player wouldn't properly distinguish between GM and AdLib, because the sound all have the same 'Midi' tag. Now, this gets tested in a way than works for all targets.
2022-09-07 22:43:54 +02:00
athrxx 755e6222bb SCUMM: (DOTT) - properly set detune for new midi parts
(after changing the detune handling a bit, we also need to
have it in Part::sendAll())
2022-09-07 18:56:57 +02:00
athrxx b7bbdd4792 SCUMM: remove garbage (debug) code 2022-09-06 22:26:30 +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
Orgad Shaneh c2e7eeb563 SCUMM: Replace new[]/memset with new[]() 2021-11-10 19:53:15 +01:00
athrxx 5f4c1e86c9 SCUMM: fix regression from 0876537f
(there could still be use after delete cases)
2021-08-10 21:03:33 +02:00
athrxx 0876537f06 SCUMM: (DOTT) - fix bug no. 12776 ("Use after free error in DOTT intro") 2021-08-10 19:44:14 +02:00
Torbjörn Andersson 3454101f59 SCUMM: Fix missing iMuse instruments (mainly Mac MI2 and FoA)
The way the condition for checking if an instrument is valid, it should
be valid if the music player and MIDI driver agree on whether it's MT-32
MIDI. Otherwise, it's only valid if the instrument can be mapped to or
from MT-32.

But the way the check was written, it would always look for an
instrument mapping, since || binds harder than the ? operator.

All MT-32 instruments can be mapped to General MIDI, but a few General
MIDI instrument can't be mapped to MT-32. So theoretically, this should
have happened a lot. However, the GM instruments that can't be mapped
are mostly sound effects. The only cases where I've actually heard it
is with the Mac versions of Monkey Island 2 and Fate of Atlantis. They
provide their own digitized instruments, so who knows how those numbers
were assigned.

Two obvious early cases were the swamp music in Monkey Island 2 and the
New York music in Fate of Atlantis. Both were missing a "wood block"
instrument, among other things.
2021-07-07 12:27:54 +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
Mathias Parnaudeau ac1d5352be SCUMM: Fix format-truncation warning in IMUSE player
The size in snprintf includes the final null character, so here
3 bytes are not enough to store a space, 2 digits and the null
character.
The compiler complained and the output used to display 1 digit
instead of 2, for each byte.
Extend this size from 3 to 4 in the snprintf call.
2021-04-30 00:05:24 +01:00
Orgad Shaneh a21f7d8e96 SCUMM: Fix compiler warning 2021-04-19 22:11:06 +03: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
aryanrawlani28 bed05ea134 GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project

- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor
2020-08-30 14:43:41 +02:00
Bastien Bouclet 730a1ee4cc SCUMM: Add override keywords 2020-02-09 12:43:16 +01:00
athrxx 923b8ea312 SCUMM: (iMUSE/Amiga) - improve sound driver destructor 2020-01-02 14:42:47 +01:00