Commit Graph
182 Commits
Author SHA1 Message Date
athrxx 1878364c2f SCI: (CMS) - fix regression 2022-12-11 17:53:33 +01:00
Cameron Cawley e97812c296 SCI: Move MidiDriver_CMS to the new CMS API 2022-11-22 19:19:20 +02:00
Donovan Watteau 5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Orgad Shaneh 940c7bfc14 SCI: Use nullptr
Using clang-tidy modernize-use-nullptr
2021-11-14 15:51:59 +02:00
sluicebox ecc72dce23 SCI: Don't poll input events from MIDI thread
In March, b67c2d72d6 moved some MIDI
initialization from the main thread to the MIDI thread. This caused
MidiPlayer_Midi::sysEx() to run on the MIDI thread for the first time.
This is a problem because it calls SciEngine:sleep(), which polls
events, and that causes MacOS to throw an exception for calling
SDL_PollEvent() on a non-main thread.

While investigating, it also turns out that MidiPlayer_Midi::sysEx()
and MidiPlayer_Fb01::sysEx() were calling OSystem::updateScreen(),
and that also shouldn't be happening on a non-main thread.

Now SciEngine::sleep() is only called on the main thread, and
OSystem::delayMillis() is called on the MIDI timer thread.
Continuing to call sleep() on the main thread keeps the UI responsive
when loading patches, which can take several seconds.
The OSystem::updateScreen() calls had no effect and have been removed.

Fixes bug #12947
2021-09-21 16:35:46 -05:00
Paul Gilbert 005561d305 COMMON: Increase Stream pos, seek, size from int32 to int64 2021-07-08 18:24:28 -07:00
sluicebox 4e8db68d4a SCI: Remove asserting "new" allocation results 2021-05-23 16:55:35 -06:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
sluicebox 9982c761a2 SCI: Update all old bug tracker ticket numbers 2021-02-25 01:18:52 -08:00
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
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 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
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
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
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
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
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
athrxx a6bf63bc1a SCI: revert accidental commits 2019-07-17 20:46:32 +02:00
athrxx 59f1e7aa48 SCI: (FB01 sound driver) - SCI0_LATE fix
Fix up SCI0_LATE variant of the driver so that it actually plays anything (and even correctly). SCI1 hasn't seen any testing from me so far. I don't know whether that version works. Same for SCI0_EARLY...
2019-07-17 17:38:26 +02:00
athrxx 77dbefb907 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-17 17:38:26 +02:00
athrxx d988e40e25 SCI: (PC98 audio driver) - base tempo correction
(somewhat difficult to make out any difference, but it does affect the envelope processing)
2019-07-17 17:38:26 +02:00
athrxx 80f163b0fc ALL: revert accidental commits 2019-06-21 14:19:42 +02:00
athrxx 5e9b690ea4 hh 2019-06-21 13:35:35 +02:00
athrxx f35eae7287 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-06-21 13:35:35 +02:00
athrxx 09f3d11cc1 SCI: (PC98 audio driver) - base tempo correction
(somewhat difficult to make out any difference, but it does affect the envelope processing)
2019-06-21 13:35:34 +02:00
athrxx c7126c9bc4 SCI: (PC98 sound driver) - fix channel assignment bug 2019-04-28 23:24:50 +02:00