Commit Graph
669 Commits
Author SHA1 Message Date
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02:00
NMIError 7857df2ea9 MIDI: MT-32 / GM driver
This adds a new MidiDriver subclass with functionality
for MIDI based devices like the MT-32 and GM devices
or emulators.
2020-11-28 17:59:15 +00:00
sluicebox 3c71df687b SCI: Return correct kSciAudioCD value on failure
SSCI returns 0 when CD audio track can't be selected
2020-11-27 10:58:35 -08:00
sluicebox 843dd302d7 SCI: Add support for fan library sciAudio 1.1
Used by Soulshade Asylum
2020-09-29 18:36:37 -07:00
sluicebox d592a67125 SCI32: Add kDoAudio support for Mac AIFF patch files
Fixes LSL6 hires Mac aerobics room and end credits
2020-09-01 10:31:32 -07:00
aryanrawlani28 4b6976c558 GUI: U32: Reduce number of files changed and fixes
Up until last commit, everything was working fine but the amount of files changed was too large. This commit tries to reduce the changes.

- Add a fake constructor to Keymap, text-to-speech, setDescription (save-state)
- Redirecting functions for PopUpWidget::appendEntry, ButtonWidget::setLabel, GUIErrorMessage
- Use the above functions and constructors to reduce changes in Engines
- Fix warnings being in unicode. Only output english text in - Warnings, Errors, etc.
- Mark some strings as "translation" strings. (Not yet added to POTFILES)
- Remove some CP related things from po/modules.mk
- Previously used some Common::convertToU32 where it was not necessary, replace this with u32constructor
2020-08-30 14:43:41 +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
Filippos Karapetis ef6f8c008f SCI: Ignore digital channel data in midiMixChannels(), and remove some GOTOs
These are found at the end of SCI01/SCI1 SND files with sound effects
2020-08-30 13:37:19 +03:00
Filippos Karapetis 648d669c2d SCI: Properly handle alternative MIDI sound effects for SCI01/CI1 games
SCI01/SCI1 games have sound effects in SND files, which contain both
digital sounds and their alternative MIDI counterparts. Allow the user
to listen to the alternative MIDI counterparts by unchecking the
"Prefer digital sound effects" checkbox, like with other SCI versions.
Fixes bug #11587
2020-08-30 13:37:19 +03:00
Walter van Niftrik c8293df572 SCI: Add Roland D-110/D-10/D-20 support 2020-08-27 14:56:17 +02:00
Walter van Niftrik e0b8d8e414 SCI: Replace native_fb01 Checkbox with PopUp
Use a PopUp widget instead of a Checkbox, to allow for more devices
to be added in the future.
2020-08-27 14:56:17 +02:00
Walter van Niftrik 5f9e0eb395 SCI: Add mutexes to AmigaMac driver 2020-08-24 23:14:45 +02:00
Thierry Crozat 96efdb5575 SCI: Fix compilation of template MidiPlayer classes 2020-08-21 01:09:47 +01:00
Walter van Niftrik 099a3fac07 SCI: Relax sanity check for SQ3-DE 2020-08-20 23:58:37 +02:00
Walter van Niftrik 06210392c8 SCI: Fix error C2988 in VS2015 2020-08-20 23:58:37 +02:00
Walter van Niftrik 148f9e9bca SCI: Fix "early driver" list for SCI0 Amiga 2020-08-20 23:58:37 +02:00
Walter van Niftrik 786059a34c SCI: Refactor AmigaMac sound driver 2020-08-20 23:58:37 +02:00
Walter van NiftrikandMatthew Hoops 8529d2649b SCI: Add new Amiga and Mac sound drivers
Co-authored-by: Matthew Hoops <clone2727@gmail.com>
2020-08-20 23:58:37 +02:00
athrxx 77dc9dfd09 SCI: (CMS driver) - minor sound improvement
This reintroduces two original bugs that I found too nasty to implement when I made the driver. These are present in all SCI0 CMS drivers. They do actually influence the sound in an positive way and make it more faithful when comparing to DOSBox. I have added an #ifdef option so it can be easily enabled and disabled for testing.
2020-06-18 18:35:25 +02:00
Filippos Karapetis 76161cce3f SCI: Adjust comment 2020-05-24 12:42:59 +03:00
Zvika Haramaty a4e01b46f4 SCI: fix #10907 - Wrong music when restoring games 2020-05-24 12:42:58 +03:00
athrxx e16ab73cc1 SCI: fix bug #11476 (QFG1: Incomplete Music)
(regression from  3154d57)
2020-05-23 16:25:43 +03:00
Eugene Sandulenko 7a152e9af4 JANITORIAL: #include "engine.h" -> "engines/engine.h" 2020-05-10 23:45:43 +02:00
sluicebox ee139e1684 SCI32: Update GM detection for MOTHERGOOSE Mac
Fixes MOTHERGOOSE Mac music, which unlike PC is not General MIDI.
2020-05-06 15:50:28 -07:00
Zvika Haramaty 6006cfee3e SCI: MIDI - don't send "controller 75" to physical device
Sierra used MIDI controller 75 for internal purposes, and it shouldn't
be issued to the real MIDI device.
This fixes issue #11409
2020-04-20 18:55:09 +02:00
sluicebox 23fc7f52e0 SCI: Fix SoundResource error handling, ctor, dtor
Fixes several problems with the SoundResource class:

- Constructor doesn't fully initialize object if resource doesn't exist
- Destructor crashes if object not fully initialized
- Constructor has no mechanism to report failure
- Callers believe failure is reported by constructor returning null
- SoundCommandParser::initSoundResource attempts to pre-detect failure
  insufficiently in the absence of a formal mechanism.

SoundResource now always fully initializes, the destructor no longer
accesses uninitialized memory, and an exists() method has been added
which callers now test.

SQ6 Mac can now progress past the main menu.
2020-04-12 01:47:15 -07:00
Zvika Haramaty 0b747dba48 SCI: fix #9907 by choosing queued sound with highest priority 2020-03-17 09:34:45 +02:00
Zvika Haramaty 5ab4185257 SCI: using only channels 1-8 on GM devices
There are many situations that GM sounds worse than MT, even for games
that were written for GM.
I think this is related to this.
And, there is a note in midi.cpp:
// NOTE: SSCI uses channels 1 through 8 for General MIDI as well, in the drivers I checked

Also, issue #6686 reports that using the "higher" channels causes
problem on a real SC-55.

This change solves at least: #6686, #9735 and #10297
2020-02-19 08:08:40 +02:00
NMIError b2468d9442 SCI/MIDI: GS drumkits - comments and re-usability
- Move the GS drumkit fallback map to generic audio code for re-use
- Added comments and debug message
2020-02-16 13:33:45 +02:00
NMIError 65f85a232d SCI: Add support for Roland GS drumkits
This adds support for the Roland GS drumkits used by SQ5 and QfG3.
The original Sierra GM driver does not pass the drumkit select MIDI
messages to the GM device, but they do exist in the MIDI data.

Another issue is that the drumkit numbers used are incorrect. This
does work on the original Roland SC-55 devices because they correct
the drumkit numbers. Later devices do not do this. Code has been
added to correct these wrong drumkit numbers.
2020-02-16 13:33:45 +02:00
sluicebox 1e3bd598ba SCI: Remove MIDI driver timer before closing
Fixes bug #10374
2020-02-15 15:10:24 -08:00
Bastien Bouclet 553d2968bb SCI: Add override keywords 2020-02-09 12:43:16 +01:00
sluicebox ed9318494d SCI32: Fix Mac sound initialization error 2020-02-07 13:15:43 -08:00
athrxx 21b5f9262c AUDIO: (FM-TOWNS/PC-98) - fix regression from 0e734722
My commit 0e734722 causes lockups in SCUMM (sometimes) and SCI (very often). I didn't like the way I had fixed this before, but in the end I now had to do it in a similar way.
2019-12-18 20:50:39 +01:00
D G Turner d11c61db14 SCI: Fix Missing Default Switch Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-12-01 05:06:31 +00:00
sluicebox 4b13347df8 SCI32: Add support for AIFF audio
Used by at least LSL6 Mac CD for voices
2019-10-21 11:13:24 -07:00
sluicebox 4d5699a8e7 SCI32: Add support for Mac SND resource playback
Used by at least GK1 Mac, which can now be started without erroring
2019-10-11 14:19:43 -07:00
athrxx 2a2351eb2c SCI: (FB01 sound driver) - get rid of mutex
- The mutex was added to avoid the triggering of the assert in backends/midi/windows.cpp, line 95. Meanwhile, this issue has been addressed differently.
- SCI does not per se require a mutex for the sound drivers. The engine is mostly thread-safe by avoiding driver calls through the main thread.
2019-08-25 11:58:20 +02:00
sluicebox 99a7478cd6 SCI: Update Sound:vol in processUpdateCues
Sound:vol is updated when updating cues starting in SCI_VERSION_1_MIDDLE.

Fixes bug #10244. SQ4 localized floppy versions depend on this when getting
in the orange ship, they fade music and wait for the volume to reach zero.

Confirmed against asm that this is not in SQ4 floppy (early) but is in
LSL1VGA (middle) and SQ4 localized floppies and SQ4CD (late).
2019-08-12 03:30:31 -07:00
athrxx ed297b4e4d SCI: (FB01 sound driver) - fix potential lockup
(add another mutex lock)
2019-08-07 22:36:12 +02:00
athrxx 9d56eb2dc7 SCI: (FB01 sound driver) - add missing empty line 2019-08-07 18:11:16 +02:00
Walter van Niftrik 522d077ad8 SCI: Fix pitch wheel bug in adlib driver 2019-08-07 16:43:08 +02:00
athrxx 09f007fa5e SCI: (ADL driver) - implement/fix voice mapping
- Backport some code of waltervn's fork at his recommendation (taken from 97604200 and 4c3bfee5). That code has caught some bitrot and I were too lazy to manually resolve the merge conflicts. All changes have been re-checked with disasm.
- Add initTrack() implementation for SCI0 EARLY/LATE
- Minor cleanup
- Please note that this commit does not fix any shortcomings of the SCI sound engine
2019-08-07 16:43:08 +02:00
athrxx f8c98d76e6 SCI: (ADL driver) - remove unused declaration 2019-08-07 16:43:07 +02:00
athrxx 9ea6c43c97 SCI: error dialog for missing sound patch/driver files
After implementing such a dialog into the fb01 driver it did make sense to me to also have this as a feature for all other aftermarket drivers/patches.

So now the sound drivers can report missing files after the failed open() call which will then be displayed in a dialog. Which will at least be more helpful than our usual error messages...
2019-08-07 16:43:07 +02:00
athrxx 47a2f62c15 SCI: (FB01 sound driver) - several fixes
Fix SCI0 (LATE/EARLY) variants of the driver which were broken (didn't play at all). This might be of my own doing, since I introduced the initTrack() method into the driver class and the fb01 driver didn't have one so far.

SCI1 didn't seem to require much fixing. I modified some things according to my findings in the driver disasms. QFG2 and JONES seem to be fine. I am not too happy with KQ5. It has volume issues, but they might be present in the original, too.

I also added an isOpen() check and a mutex to avoid threading issues. When aborting SCI (either quitting ScummVM or returning ot the launcher) while using the fb01 driver I frequently (more often than not) got the assert from backends/midi/windows.cpp, line 95. This fixes that.

I've done plenty of checks and experiments with the sound bank initialization. But I found no bugs or possible improvements there. Hard to tell whether the sound is right. That device seems to have a mind of its own...
2019-08-07 16:43:06 +02:00
athrxx 0e73472207 AUDIO: (FM-Towns/PC98) - cleanup mutex handling 2019-08-07 16:43:06 +02:00
athrxx 8b197e4ec7 SCI: (FM-Towns sound driver) - fix pitchwheel glitch
Pitchwheel and channel volume settings need to be updated when the channels get  reassigned.
This bug caused faulty music at least in KQ5 when walking from the dwarves scene into the harp playing tree scene.
2019-08-07 16:43:05 +02:00
athrxx fce453dc43 SCI: (CMS sound driver) - handle invalid program changes
(This triggered an assert in PQ2 at the airport. I've added a warning instead, since the original driver has no handling for that sort of thing. Invalid programs will simply point into invalid memory blocks)
2019-07-24 15:47:06 +02:00
athrxx 926388b8f4 SCI: (CMS sound driver) - add support for SCI0
I haven't found an elegant and non-intrusive way to squeeze SCI0 support into LordHoto's existing code. The drivers are too different. So I made some rearrangements. The basic mechanisms of LordHoto's SCI1 code should remain the same as before, though. I only introduced some more classes, moved some code into these classes and renamed some things (mainly for myself, so as not to get confused).

I fixed two voice mapping bugs in the existing driver code. The first bug in bindVocies() effectively hindered the driver from playing anything at all when the CMS_DISABLE_VOICE_MAPPING #define wasn't set (_voice[i].channel == 0xFF instead of _voice[i].channel != 0xFF). The second bug in unbindVoices() was not a complete show stopper, but the function simply did not "unbind the voice". The line which does the actual removal of the channel assignment was missing.

The SCI0 driver portions have been tested with: PQ2, KQ4, LSL3, QFG1, ICE and COC.

SCI_0_EARLY versions apparently don't support the CMS. At least I haven't seen a driver file so far. And there seems to be no no instrument patch resource. Although the latter issue needn't necessarily be one, since the patch data array in the driver is actually preset with data (which gets overwritten as soon as a patch file is loaded). Maybe this would work for SCI_0_EARLY. However, I haven't tested this, since I really would have have a look at a driver file first if one actually exists. For now, I have limited the driver to SCI_0_LATE.

SCI1 has been tested with KQ5 and LSL5 (not extensively, just to see whether anything got broken and whether my voice mapping fixes work).
2019-07-22 20:17:38 +02:00