Ticket #3053: sky-adlib.diff
File sky-adlib.diff, 2.5 KB (added by , 18 years ago) |
---|
-
engines/sky/music/musicbase.h
58 58 bool musicIsPlaying(void); 59 59 uint8 giveVolume(void) { return (uint8)_musicVolume; }; 60 60 uint8 giveCurrentMusic(void) { return _currentMusic; }; 61 v oid setVolume(uint16 param);61 virtual void setVolume(uint16 param); 62 62 63 63 protected: 64 64 -
engines/sky/music/adlibmusic.h
53 53 virtual void setupPointers(void); 54 54 virtual void setupChannels(uint8 *channelData); 55 55 virtual void startDriver(void); 56 virtual void setVolume(uint16 param); 56 57 57 58 void premixerCall(int16 *buf, uint len); 58 59 }; -
engines/sky/music/adlibchannel.cpp
85 85 } 86 86 87 87 void AdlibChannel::updateVolume(uint16 pVolume) { 88 pVolume = (pVolume * 3) >> 1; 89 if (pVolume > 0x7F) 90 pVolume = 0x7F; 91 _musicVolume = pVolume | 128; 88 89 // Do nothing. The mixer handles the music volume for us. 92 90 } 93 91 94 92 /* This class uses the same area for the register mirror as the original -
engines/sky/music/adlibmusic.cpp
39 39 40 40 _opl = makeAdlibOPL(_sampleRate); 41 41 42 _mixer->playInputStream(Audio::Mixer::k PlainSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true);42 _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_soundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); 43 43 } 44 44 45 45 AdlibMusic::~AdlibMusic(void) { … … 107 107 for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++) { 108 108 uint16 chDataStart = ((channelData[(cnt << 1) | 1] << 8) | channelData[cnt << 1]) + _musicDataLoc; 109 109 _channels[cnt] = new AdlibChannel(_opl, _musicData, chDataStart); 110 _channels[cnt]->updateVolume(_musicVolume);111 110 } 112 111 } 113 112 113 void AdlibMusic::setVolume(uint16 param) { 114 _musicVolume = param; 115 _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, 2 * param); 116 } 117 114 118 void AdlibMusic::startDriver(void) { 115 119 116 120 uint16 cnt = 0;