Fixed Adlib sound problem on old (small header) games. Thanks for eriktorbjorn for the material that led to the solution.
svn-id: r7610
This commit is contained in:
parent
a6d1c3e151
commit
c88e0b5301
5 changed files with 11 additions and 5 deletions
|
@ -928,7 +928,7 @@ void MidiDriver_ADLIB::send (uint32 b) {
|
|||
|
||||
uint32 MidiDriver_ADLIB::property (int prop, uint32 param) {
|
||||
switch (prop) {
|
||||
case PROP_SMALLHEADER: // Indicates older game, use different operator volume algorithm
|
||||
case PROP_OLD_ADLIB: // Older games used a different operator volume algorithm
|
||||
_game_SmallHeader = (param > 0);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -286,6 +286,7 @@ class IMuseInternal {
|
|||
friend struct Player;
|
||||
|
||||
private:
|
||||
bool _old_adlib_instruments;
|
||||
bool _enable_multi_midi;
|
||||
MidiDriver *_midi_adlib;
|
||||
MidiDriver *_midi_native;
|
||||
|
@ -1654,6 +1655,9 @@ uint32 IMuseInternal::property(int prop, uint32 value) {
|
|||
case IMuse::PROP_MULTI_MIDI:
|
||||
_enable_multi_midi = (value > 0);
|
||||
break;
|
||||
|
||||
case IMuse::PROP_OLD_ADLIB_INSTRUMENTS:
|
||||
_old_adlib_instruments = (value > 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1697,6 +1701,8 @@ int IMuseInternal::initialize(OSystem *syst, MidiDriver *native_midi) {
|
|||
|
||||
void IMuseInternal::initMidiDriver (MidiDriver *midi) {
|
||||
// Open MIDI driver
|
||||
midi->property (MidiDriver::PROP_OLD_ADLIB, _old_adlib_instruments ? 1 : 0);
|
||||
|
||||
int result = midi->open();
|
||||
if (result)
|
||||
error("IMuse initialization - ", MidiDriver::getErrorName(result));
|
||||
|
@ -3477,7 +3483,5 @@ uint32 IMuse::property(int prop, uint32 value) { in(); uint32 ret = _target->pro
|
|||
// to the client.
|
||||
IMuse *IMuse::create (OSystem *syst, MidiDriver *midi) {
|
||||
IMuseInternal *engine = IMuseInternal::create (syst, midi);
|
||||
if (midi)
|
||||
midi->property (MidiDriver::PROP_SMALLHEADER, (g_scumm->_features & GF_SMALL_HEADER) ? 1 : 0);
|
||||
return new IMuse (syst, engine);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ public:
|
|||
enum {
|
||||
PROP_TEMPO_BASE = 1,
|
||||
PROP_NATIVE_MT32 = 2,
|
||||
PROP_MULTI_MIDI = 3
|
||||
PROP_MULTI_MIDI = 3,
|
||||
PROP_OLD_ADLIB_INSTRUMENTS = 4
|
||||
};
|
||||
|
||||
void on_timer (MidiDriver *midi);
|
||||
|
|
|
@ -606,6 +606,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst)
|
|||
if (_imuse) {
|
||||
if (detector->_gameTempo != 0)
|
||||
_imuse->property(IMuse::PROP_TEMPO_BASE, detector->_gameTempo);
|
||||
_imuse->property (IMuse::PROP_OLD_ADLIB_INSTRUMENTS, (_features & GF_SMALL_HEADER) ? 1 : 0);
|
||||
_imuse->property (IMuse::PROP_MULTI_MIDI, detector->_multi_midi);
|
||||
_imuse->property (IMuse::PROP_NATIVE_MT32, detector->_native_mt32);
|
||||
_imuse->set_music_volume(_sound->_sound_volume_music);
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
enum {
|
||||
PROP_TIMEDIV = 1,
|
||||
PROP_SMALLHEADER = 2
|
||||
PROP_OLD_ADLIB = 2
|
||||
};
|
||||
|
||||
// Open the midi driver.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue